changeset 1560:3b93da7c778a icedtea6-1.5.1

2009-08-07 Lillian Angel <langel@redhat.com> * NEWS: Updated. * Makefile.am: Added new security patches. * plugin/icedtea/netscape/javascript/JSObject.java: Security patch applied to disallow the ability to run unsigned code as signed under some cases. * plugin/icedtea/sun/applet/PluginAppletSecurityContext.java: * Likewise. * rt/net/sourceforge/jnlp/SecurityDesc.java: Likewise. * rt/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: Likewise. * plugin/icedtea/netscape/javascript/JSObjectCreatePermission.java: * Likewise. * rt/netscape/javascript/JSObjectCreatePermission.java: Likewise. * patches/security/icedtea-6588003.patch, patches/security/icedtea-6656586.patch, patches/security/icedtea-6656610.patch, patches/security/icedtea-6656625.patch, patches/security/icedtea-6657133.patch, patches/security/icedtea-6657619.patch, patches/security/icedtea-6657625.patch, patches/security/icedtea-6657695.patch, patches/security/icedtea-6660049.patch, patches/security/icedtea-6660539.patch, patches/security/icedtea-6736293.patch, patches/security/icedtea-6738524.patch, patches/security/icedtea-6777448.patch, patches/security/icedtea-6777487.patch, patches/security/icedtea-6801071.patch, patches/security/icedtea-6801497.patch, patches/security/icedtea-6813167.patch, patches/security/icedtea-6823373.patch, patches/security/icedtea-6824440.patch, patches/security/icedtea-6830335.patch, patches/security/icedtea-6845701.patch: New security patches.
author langel
date Fri, 07 Aug 2009 10:05:32 -0400
parents 3a9ce0147736
children a402beae312e
files ChangeLog Makefile.am NEWS patches/security/icedtea-6588003.patch patches/security/icedtea-6656586.patch patches/security/icedtea-6656610.patch patches/security/icedtea-6656625.patch patches/security/icedtea-6657133.patch patches/security/icedtea-6657619.patch patches/security/icedtea-6657625.patch patches/security/icedtea-6657695.patch patches/security/icedtea-6660049.patch patches/security/icedtea-6660539.patch patches/security/icedtea-6736293.patch patches/security/icedtea-6738524.patch patches/security/icedtea-6777448.patch patches/security/icedtea-6777487.patch patches/security/icedtea-6801071.patch patches/security/icedtea-6801497.patch patches/security/icedtea-6813167.patch patches/security/icedtea-6823373.patch patches/security/icedtea-6824440.patch patches/security/icedtea-6830335.patch patches/security/icedtea-6845701.patch plugin/icedtea/netscape/javascript/JSObject.java plugin/icedtea/netscape/javascript/JSObjectCreatePermission.java plugin/icedtea/sun/applet/PluginAppletSecurityContext.java rt/net/sourceforge/jnlp/SecurityDesc.java rt/net/sourceforge/jnlp/runtime/JNLPClassLoader.java
diffstat 29 files changed, 171198 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri May 29 09:35:05 2009 -0400
+++ b/ChangeLog	Fri Aug 07 10:05:32 2009 -0400
@@ -1,3 +1,37 @@
+2009-08-07 Lillian Angel  <langel@redhat.com>
+	
+	* NEWS: Updated.
+	* Makefile.am: Added new security patches.
+	* plugin/icedtea/netscape/javascript/JSObject.java: Security patch
+	applied to disallow the ability to run unsigned code as
+	signed under some cases.
+	* plugin/icedtea/sun/applet/PluginAppletSecurityContext.java: Likewise.
+	* rt/net/sourceforge/jnlp/SecurityDesc.java: Likewise.
+	* rt/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: Likewise.
+	* plugin/icedtea/netscape/javascript/JSObjectCreatePermission.java: Likewise.
+	* rt/netscape/javascript/JSObjectCreatePermission.java: Likewise.
+	* patches/security/icedtea-6588003.patch,
+	patches/security/icedtea-6656586.patch,
+	patches/security/icedtea-6656610.patch,
+	patches/security/icedtea-6656625.patch,
+	patches/security/icedtea-6657133.patch,
+	patches/security/icedtea-6657619.patch,
+	patches/security/icedtea-6657625.patch,
+	patches/security/icedtea-6657695.patch,
+	patches/security/icedtea-6660049.patch,
+	patches/security/icedtea-6660539.patch,
+	patches/security/icedtea-6736293.patch,
+	patches/security/icedtea-6738524.patch,
+	patches/security/icedtea-6777448.patch,
+	patches/security/icedtea-6777487.patch,
+	patches/security/icedtea-6801071.patch,
+	patches/security/icedtea-6801497.patch,
+	patches/security/icedtea-6813167.patch,
+	patches/security/icedtea-6823373.patch,
+	patches/security/icedtea-6824440.patch,
+	patches/security/icedtea-6830335.patch,
+	patches/security/icedtea-6845701.patch: New security patches.
+
 2009-05-25  Xerxes RĂ„nby  <xerxes@zafena.se>
 
 	* acinclude.m4: Fix: Renamed TARGET_ARCH to CROSS_TARGET_ARCH
--- a/Makefile.am	Fri May 29 09:35:05 2009 -0400
+++ b/Makefile.am	Fri Aug 07 10:05:32 2009 -0400
@@ -585,7 +585,28 @@
 	patches/icedtea-pr261.patch \
 	patches/icedtea-doc-headers.patch \
 	patches/openjdk/bidi-tests.patch \
-	patches/openjdk/annotation-tests.patch
+	patches/openjdk/annotation-tests.patch \
+	patches/security/icedtea-6588003.patch \
+	patches/security/icedtea-6656586.patch \
+	patches/security/icedtea-6656610.patch \
+	patches/security/icedtea-6656625.patch \
+	patches/security/icedtea-6657133.patch \
+	patches/security/icedtea-6657619.patch \
+	patches/security/icedtea-6657625.patch \
+	patches/security/icedtea-6657695.patch \
+	patches/security/icedtea-6660049.patch \
+	patches/security/icedtea-6660539.patch \
+	patches/security/icedtea-6736293.patch \
+	patches/security/icedtea-6738524.patch \
+	patches/security/icedtea-6777448.patch \
+	patches/security/icedtea-6801497.patch \
+	patches/security/icedtea-6801071.patch \
+	patches/security/icedtea-6777487.patch \
+	patches/security/icedtea-6823373.patch \
+	patches/security/icedtea-6824440.patch \
+	patches/security/icedtea-6830335.patch \
+	patches/security/icedtea-6845701.patch \
+	patches/security/icedtea-6813167.patch
 
 if WITH_ALT_HSBUILD
 ICEDTEA_PATCHES += \
@@ -1450,7 +1471,7 @@
 	find hotspot-tools -name '*.java' | sort > $@
 	mkdir -p lib/hotspot-tools
 
-ABS_SOURCE_DIRS = $(abs_top_builddir)/generated:$(abs_top_srcdir)/rt
+ABS_SOURCE_DIRS = $(abs_top_builddir)/generated:$(abs_top_builddir)/rt:$(abs_top_srcdir)/rt
 stamps/hotspot-tools-class-files.stamp: hotspot-tools-source-files.txt
 	if ! test -d $(ICEDTEA_BOOT_DIR) ; \
 	then \
--- a/NEWS	Fri May 29 09:35:05 2009 -0400
+++ b/NEWS	Fri Aug 07 10:05:32 2009 -0400
@@ -1,3 +1,7 @@
+New in release 1.5.1 (2009-08-07)
+- Security updates from Sun.
+- Plugin/Netx security fix.
+
 New in release 1.5 (2009-05-20)
 
 - Static trace support through systemtap.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/security/icedtea-6588003.patch	Fri Aug 07 10:05:32 2009 -0400
@@ -0,0 +1,54 @@
+--- old/jdk/src/share/classes/javax/swing/text/LayoutQueue.java	2009-07-17 10:36:04.000000000 -0400
++++ openjdk/jdk/src/share/classes/javax/swing/text/LayoutQueue.java	2009-07-22 11:25:41.000000000 -0400
+@@ -25,6 +25,7 @@
+ package javax.swing.text;
+ 
+ import java.util.Vector;
++import sun.awt.AppContext;
+ 
+ /**
+  * A queue of text layout tasks.
+@@ -35,10 +36,10 @@
+  */
+ public class LayoutQueue {
+ 
+-    Vector tasks;
+-    Thread worker;
++    private static final Object DEFAULT_QUEUE = new Object();	
+ 
+-    static LayoutQueue defaultQueue;
++    private Vector<Runnable> tasks;
++    private Thread worker;
+ 
+     /**
+      * Construct a layout queue.
+@@ -51,10 +52,15 @@
+      * Fetch the default layout queue.
+      */
+     public static LayoutQueue getDefaultQueue() {
+-        if (defaultQueue == null) {
+-            defaultQueue = new LayoutQueue();
++        AppContext ac = AppContext.getAppContext();
++        synchronized (DEFAULT_QUEUE) {
++            LayoutQueue defaultQueue = (LayoutQueue) ac.get(DEFAULT_QUEUE);
++            if (defaultQueue == null) {
++                defaultQueue = new LayoutQueue();
++                ac.put(DEFAULT_QUEUE, defaultQueue);
++            }
++            return defaultQueue;
+         }
+-        return defaultQueue;
+     }
+ 
+     /**
+@@ -63,7 +69,9 @@
+      * @param q the new queue.
+      */
+     public static void setDefaultQueue(LayoutQueue q) {
+-        defaultQueue = q;
++        synchronized (DEFAULT_QUEUE) {
++            AppContext.getAppContext().put(DEFAULT_QUEUE, q);
++        }
+     }
+ 
+     /**
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/security/icedtea-6656586.patch	Fri Aug 07 10:05:32 2009 -0400
@@ -0,0 +1,32 @@
+--- old/jdk/src/share/classes/java/awt/Cursor.java	2009-07-17 10:36:02.000000000 -0400
++++ openjdk/jdk/src/share/classes/java/awt/Cursor.java	2009-07-22 11:28:14.000000000 -0400
+@@ -119,6 +119,11 @@
+ 
+     protected static Cursor predefined[] = new Cursor[14];
+ 
++    /**
++     * This field is a private replacement for 'predefined' array.
++     */
++    private final static Cursor[] predefinedPrivate = new Cursor[14];
++
+     /* Localization names and default values */
+     static final String[][] cursorProperties = {
+         { "AWT.DefaultCursor", "Default Cursor" },
+@@ -252,10 +257,15 @@
+         if (type < Cursor.DEFAULT_CURSOR || type > Cursor.MOVE_CURSOR) {
+             throw new IllegalArgumentException("illegal cursor type");
+         }
++        Cursor c = predefinedPrivate[type];
++        if (c == null) {
++            predefinedPrivate[type] = c = new Cursor(type);
++        }
++        // fill 'predefined' array for backwards compatibility.
+         if (predefined[type] == null) {
+-            predefined[type] = new Cursor(type);
++            predefined[type] = c;
+         }
+-        return predefined[type];
++        return c;
+     }
+ 
+     /**
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/security/icedtea-6656610.patch	Fri Aug 07 10:05:32 2009 -0400
@@ -0,0 +1,30 @@
+--- old/src/share/classes/javax/accessibility/AccessibleResourceBundle.java	Fri Jun 19 15:30:16 2009
++++ openjdk/jdk/src/share/classes/javax/accessibility/AccessibleResourceBundle.java	Fri Jun 19 15:30:14 2009
+@@ -44,15 +44,11 @@
+      * localized display strings.
+      */
+     public Object[][] getContents() {
+-        return contents;
+-    }
++        // The table holding the mapping between the programmatic keys
++        // and the display strings for the en_US locale.
++        return new Object[][] {
+ 
+-    /**
+-     * The table holding the mapping between the programmatic keys
+-     * and the display strings for the en_US locale.
+-     */
+-    static final Object[][] contents = {
+-    // LOCALIZE THIS
++        // LOCALIZE THIS
+         // Role names
+ //        { "application","application" },
+ //        { "border","border" },
+@@ -151,5 +147,6 @@
+         { "vertical","vertical" },
+         { "horizontal","horizontal" }
+     // END OF MATERIAL TO LOCALIZE
+-    };
++        };
++    }
+ }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/security/icedtea-6656625.patch	Fri Aug 07 10:05:32 2009 -0400
@@ -0,0 +1,180 @@
+--- old/src/share/classes/com/sun/imageio/plugins/bmp/BMPImageReaderSpi.java	2009-04-24 17:32:19.463300000 +0400
++++ openjdk/jdk/src/share/classes/com/sun/imageio/plugins/bmp/BMPImageReaderSpi.java	2009-04-24 17:32:18.529300000 +0400
+@@ -51,7 +51,7 @@
+               entensions,
+               mimeType,
+               "com.sun.imageio.plugins.bmp.BMPImageReader",
+-              STANDARD_INPUT_TYPE,
++              new Class[] { ImageInputStream.class },
+               writerSpiNames,
+               false,
+               null, null, null, null,
+--- old/src/share/classes/com/sun/imageio/plugins/bmp/BMPImageWriterSpi.java	2009-04-24 17:32:32.537300000 +0400
++++ openjdk/jdk/src/share/classes/com/sun/imageio/plugins/bmp/BMPImageWriterSpi.java	2009-04-24 17:32:31.632300000 +0400
+@@ -32,6 +32,7 @@
+ import javax.imageio.spi.ImageWriterSpi;
+ import javax.imageio.spi.ServiceRegistry;
+ import javax.imageio.spi.IIORegistry;
++import javax.imageio.stream.ImageOutputStream;
+ import javax.imageio.ImageWriter;
+ import javax.imageio.ImageTypeSpecifier;
+ import javax.imageio.IIOException;
+@@ -55,7 +56,7 @@
+               entensions,
+               mimeType,
+               "com.sun.imageio.plugins.bmp.BMPImageWriter",
+-              STANDARD_OUTPUT_TYPE,
++              new Class[] { ImageOutputStream.class },
+               readerSpiNames,
+               false,
+               null, null, null, null,
+--- old/src/share/classes/com/sun/imageio/plugins/gif/GIFImageReaderSpi.java	2009-04-24 17:32:39.646300000 +0400
++++ openjdk/jdk/src/share/classes/com/sun/imageio/plugins/gif/GIFImageReaderSpi.java	2009-04-24 17:32:38.722300000 +0400
+@@ -62,7 +62,7 @@
+               suffixes,
+               MIMETypes,
+               readerClassName,
+-              STANDARD_INPUT_TYPE,
++              new Class[] { ImageInputStream.class },
+               writerSpiNames,
+               true,
+               GIFStreamMetadata.nativeMetadataFormatName,
+--- old/src/share/classes/com/sun/imageio/plugins/gif/GIFImageWriterSpi.java	2009-04-24 17:32:48.539300000 +0400
++++ openjdk/jdk/src/share/classes/com/sun/imageio/plugins/gif/GIFImageWriterSpi.java	2009-04-24 17:32:44.764300000 +0400
+@@ -31,6 +31,7 @@
+ import javax.imageio.ImageTypeSpecifier;
+ import javax.imageio.ImageWriter;
+ import javax.imageio.spi.ImageWriterSpi;
++import javax.imageio.stream.ImageOutputStream;
+ import com.sun.imageio.plugins.common.PaletteBuilder;
+ 
+ public class GIFImageWriterSpi extends ImageWriterSpi {
+@@ -59,7 +60,7 @@
+               suffixes,
+               MIMETypes,
+               writerClassName,
+-              STANDARD_OUTPUT_TYPE,
++              new Class[] { ImageOutputStream.class },
+               readerSpiNames,
+               true,
+               GIFWritableStreamMetadata.NATIVE_FORMAT_NAME,
+--- old/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReaderSpi.java	2009-04-24 17:32:57.302300000 +0400
++++ openjdk/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReaderSpi.java	2009-04-24 17:32:56.484300000 +0400
+@@ -48,7 +48,7 @@
+               JPEG.suffixes,
+               JPEG.MIMETypes,
+               "com.sun.imageio.plugins.jpeg.JPEGImageReader",
+-              STANDARD_INPUT_TYPE,
++              new Class[] { ImageInputStream.class },
+               writerSpiNames,
+               true,
+               JPEG.nativeStreamMetadataFormatName,
+--- old/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriterSpi.java	2009-04-24 17:33:03.013300000 +0400
++++ openjdk/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriterSpi.java	2009-04-24 17:33:02.189300000 +0400
+@@ -28,6 +28,7 @@
+ import javax.imageio.spi.ImageWriterSpi;
+ import javax.imageio.spi.ServiceRegistry;
+ import javax.imageio.spi.IIORegistry;
++import javax.imageio.stream.ImageOutputStream;
+ import javax.imageio.ImageWriter;
+ import javax.imageio.ImageTypeSpecifier;
+ import javax.imageio.IIOException;
+@@ -51,7 +52,7 @@
+               JPEG.suffixes,
+               JPEG.MIMETypes,
+               "com.sun.imageio.plugins.jpeg.JPEGImageWriter",
+-              STANDARD_OUTPUT_TYPE,
++              new Class[] { ImageOutputStream.class },
+               readerSpiNames,
+               true,
+               JPEG.nativeStreamMetadataFormatName,
+--- old/src/share/classes/com/sun/imageio/plugins/png/PNGImageReaderSpi.java	2009-04-24 17:33:08.626300000 +0400
++++ openjdk/jdk/src/share/classes/com/sun/imageio/plugins/png/PNGImageReaderSpi.java	2009-04-24 17:33:07.782300000 +0400
+@@ -62,7 +62,7 @@
+               suffixes,
+               MIMETypes,
+               readerClassName,
+-              STANDARD_INPUT_TYPE,
++              new Class[] { ImageInputStream.class },
+               writerSpiNames,
+               false,
+               null, null,
+--- old/src/share/classes/com/sun/imageio/plugins/png/PNGImageWriterSpi.java	2009-04-24 17:33:16.641300000 +0400
++++ openjdk/jdk/src/share/classes/com/sun/imageio/plugins/png/PNGImageWriterSpi.java	2009-04-24 17:33:15.880300000 +0400
+@@ -34,6 +34,7 @@
+ import javax.imageio.metadata.IIOMetadataFormat;
+ import javax.imageio.metadata.IIOMetadataFormatImpl;
+ import javax.imageio.spi.ImageWriterSpi;
++import javax.imageio.stream.ImageOutputStream;
+ 
+ /**
+  */
+@@ -63,7 +64,7 @@
+                 suffixes,
+                 MIMETypes,
+                 writerClassName,
+-                STANDARD_OUTPUT_TYPE,
++                new Class[] { ImageOutputStream.class },
+                 readerSpiNames,
+                 false,
+                 null, null,
+--- old/src/share/classes/com/sun/imageio/plugins/wbmp/WBMPImageReaderSpi.java	2009-04-24 17:33:24.247300000 +0400
++++ openjdk/jdk/src/share/classes/com/sun/imageio/plugins/wbmp/WBMPImageReaderSpi.java	2009-04-24 17:33:23.392300000 +0400
+@@ -51,7 +51,7 @@
+               entensions,
+               mimeType,
+               "com.sun.imageio.plugins.wbmp.WBMPImageReader",
+-              STANDARD_INPUT_TYPE,
++              new Class[] { ImageInputStream.class },
+               writerSpiNames,
+               true,
+               null, null, null, null,
+--- old/src/share/classes/com/sun/imageio/plugins/wbmp/WBMPImageWriterSpi.java	2009-04-24 17:33:30.351300000 +0400
++++ openjdk/jdk/src/share/classes/com/sun/imageio/plugins/wbmp/WBMPImageWriterSpi.java	2009-04-24 17:33:29.522300000 +0400
+@@ -28,6 +28,7 @@
+ import javax.imageio.spi.ImageWriterSpi;
+ import javax.imageio.spi.ServiceRegistry;
+ import javax.imageio.spi.IIORegistry;
++import javax.imageio.stream.ImageOutputStream;
+ import javax.imageio.ImageWriter;
+ import javax.imageio.ImageTypeSpecifier;
+ import javax.imageio.IIOException;
+@@ -54,7 +55,7 @@
+               entensions,
+               mimeType,
+               "com.sun.imageio.plugins.wbmp.WBMPImageWriter",
+-              STANDARD_OUTPUT_TYPE,
++              new Class[] { ImageOutputStream.class },
+               readerSpiNames,
+               true,
+               null, null, null, null,
+--- old/src/share/classes/javax/imageio/spi/ImageReaderSpi.java	2009-04-24 17:33:36.338300000 +0400
++++ openjdk/jdk/src/share/classes/javax/imageio/spi/ImageReaderSpi.java	2009-04-24 17:33:35.313300000 +0400
+@@ -227,7 +227,11 @@
+             throw new IllegalArgumentException
+                 ("inputTypes.length == 0!");
+         }
+-        this.inputTypes = (Class[])inputTypes.clone();
++
++        this.inputTypes = (inputTypes == STANDARD_INPUT_TYPE) ?
++            new Class<?>[] { ImageInputStream.class } :
++            inputTypes.clone();
++
+         // If length == 0, leave it null
+         if (writerSpiNames != null && writerSpiNames.length > 0) {
+             this.writerSpiNames = (String[])writerSpiNames.clone();
+--- old/src/share/classes/javax/imageio/spi/ImageWriterSpi.java	2009-04-24 17:33:48.992300000 +0400
++++ openjdk/jdk/src/share/classes/javax/imageio/spi/ImageWriterSpi.java	2009-04-24 17:33:48.164300000 +0400
+@@ -228,7 +228,11 @@
+             throw new IllegalArgumentException
+                 ("outputTypes.length == 0!");
+         }
+-        this.outputTypes = (Class[])outputTypes.clone();
++
++        this.outputTypes = (outputTypes == STANDARD_OUTPUT_TYPE) ?
++            new Class<?>[] { ImageOutputStream.class } :
++            outputTypes.clone();
++
+         // If length == 0, leave it null
+         if (readerSpiNames != null && readerSpiNames.length > 0) {
+             this.readerSpiNames = (String[])readerSpiNames.clone();
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/security/icedtea-6657133.patch	Fri Aug 07 10:05:32 2009 -0400
@@ -0,0 +1,190 @@
+--- old/src/share/classes/com/sun/imageio/stream/StreamCloser.java	2009-04-24 17:51:15.411300000 +0400
++++ openjdk/jdk/src/share/classes/com/sun/imageio/stream/StreamCloser.java	2009-04-24 17:51:14.693300000 +0400
+@@ -43,35 +43,35 @@
+  */
+ public class StreamCloser {
+ 
+-    private static WeakHashMap<ImageInputStream, Object> toCloseQueue;
++    private static WeakHashMap<CloseAction, Object> toCloseQueue;
+     private static Thread streamCloser;
+ 
+-    public static void addToQueue(ImageInputStream iis) {
++    public static void addToQueue(CloseAction ca) {
+         synchronized (StreamCloser.class) {
+             if (toCloseQueue == null) {
+                 toCloseQueue =
+-                    new WeakHashMap<ImageInputStream, Object>();
++                    new WeakHashMap<CloseAction, Object>();
+             }
+ 
+-            toCloseQueue.put(iis, null);
++            toCloseQueue.put(ca, null);
+ 
+             if (streamCloser == null) {
+                 final Runnable streamCloserRunnable = new Runnable() {
+                     public void run() {
+                         if (toCloseQueue != null) {
+                             synchronized (StreamCloser.class) {
+-                                Set<ImageInputStream> set =
++                                Set<CloseAction> set =
+                                     toCloseQueue.keySet();
+                                 // Make a copy of the set in order to avoid
+                                 // concurrent modification (the is.close()
+                                 // will in turn call removeFromQueue())
+-                                ImageInputStream[] streams =
+-                                    new ImageInputStream[set.size()];
+-                                streams = set.toArray(streams);
+-                                for (ImageInputStream is : streams) {
+-                                    if (is != null) {
++                                CloseAction[] actions =
++                                    new CloseAction[set.size()];
++                                actions = set.toArray(actions);
++                                for (CloseAction ca : actions) {
++                                    if (ca != null) {
+                                         try {
+-                                            is.close();
++                                            ca.performAction();
+                                         } catch (IOException e) {
+                                         }
+                                     }
+@@ -102,10 +102,28 @@
+         }
+     }
+ 
+-    public static void removeFromQueue(ImageInputStream iis) {
++    public static void removeFromQueue(CloseAction ca) {
+         synchronized (StreamCloser.class) {
+             if (toCloseQueue != null) {
+-                toCloseQueue.remove(iis);
++                toCloseQueue.remove(ca);
++            }
++        }
++    }
++
++    public static CloseAction createCloseAction(ImageInputStream iis) {
++        return new CloseAction(iis);
++    }
++
++    public static final class CloseAction {
++        private ImageInputStream iis;
++
++        private CloseAction(ImageInputStream iis) {
++            this.iis = iis;
++        }
++
++        public void performAction() throws IOException {
++            if (iis != null) {
++                iis.close();
+             }
+         }
+     }
+--- old/src/share/classes/javax/imageio/plugins/bmp/BMPImageWriteParam.java	2009-04-24 17:51:20.931300000 +0400
++++ openjdk/jdk/src/share/classes/javax/imageio/plugins/bmp/BMPImageWriteParam.java	2009-04-24 17:51:20.193300000 +0400
+@@ -78,7 +78,7 @@
+         super(locale);
+ 
+         // Set compression types ("BI_RGB" denotes uncompressed).
+-        compressionTypes = BMPConstants.compressionTypeNames;
++        compressionTypes = BMPConstants.compressionTypeNames.clone();
+ 
+         // Set compression flag.
+         canWriteCompressed = true;
+--- old/src/share/classes/javax/imageio/stream/FileCacheImageInputStream.java	2009-04-24 17:51:26.427300000 +0400
++++ openjdk/jdk/src/share/classes/javax/imageio/stream/FileCacheImageInputStream.java	2009-04-24 17:51:25.718300000 +0400
+@@ -62,6 +62,10 @@
+     /** The DisposerRecord that closes the underlying cache. */
+     private final DisposerRecord disposerRecord;
+ 
++    /** The CloseAction that closes the stream in
++     *  the StreamCloser's shutdown hook                     */
++    private final StreamCloser.CloseAction closeAction;
++
+     /**
+      * Constructs a <code>FileCacheImageInputStream</code> that will read
+      * from a given <code>InputStream</code>.
+@@ -96,7 +100,9 @@
+         this.cacheFile =
+             File.createTempFile("imageio", ".tmp", cacheDir);
+         this.cache = new RandomAccessFile(cacheFile, "rw");
+-        StreamCloser.addToQueue(this);
++
++        this.closeAction = StreamCloser.createCloseAction(this);
++        StreamCloser.addToQueue(closeAction);
+ 
+         disposerRecord = new StreamDisposerRecord(cacheFile, cache);
+         if (getClass() == FileCacheImageInputStream.class) {
+@@ -242,7 +248,7 @@
+         stream = null;
+         cache = null;
+         cacheFile = null;
+-        StreamCloser.removeFromQueue(this);
++        StreamCloser.removeFromQueue(closeAction);
+     }
+ 
+     /**
+--- old/src/share/classes/javax/imageio/stream/FileCacheImageOutputStream.java	2009-04-24 17:51:31.903300000 +0400
++++ openjdk/jdk/src/share/classes/javax/imageio/stream/FileCacheImageOutputStream.java	2009-04-24 17:51:31.186300000 +0400
+@@ -48,6 +48,10 @@
+     // Pos after last (rightmost) byte written
+     private long maxStreamPos = 0L;
+ 
++    /** The CloseAction that closes the stream in
++     *  the StreamCloser's shutdown hook                     */
++    private final StreamCloser.CloseAction closeAction;
++
+     /**
+      * Constructs a <code>FileCacheImageOutputStream</code> that will write
+      * to a given <code>outputStream</code>.
+@@ -82,7 +86,9 @@
+         this.cacheFile =
+             File.createTempFile("imageio", ".tmp", cacheDir);
+         this.cache = new RandomAccessFile(cacheFile, "rw");
+-        StreamCloser.addToQueue(this);
++
++        this.closeAction = StreamCloser.createCloseAction(this);
++        StreamCloser.addToQueue(closeAction);
+     }
+ 
+     public int read() throws IOException {
+@@ -227,7 +233,7 @@
+         cacheFile = null;
+         stream.flush();
+         stream = null;
+-        StreamCloser.removeFromQueue(this);
++        StreamCloser.removeFromQueue(closeAction);
+     }
+ 
+     public void flushBefore(long pos) throws IOException {
+--- old/src/share/lib/security/java.security	2009-04-24 17:51:37.610300000 +0400
++++ openjdk/jdk/src/share/lib/security/java.security	2009-04-24 17:51:36.806300000 +0400
+@@ -127,7 +127,7 @@
+ # passed to checkPackageAccess unless the
+ # corresponding RuntimePermission ("accessClassInPackage."+package) has
+ # been granted.
+-package.access=sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.
++package.access=sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.
+ 
+ #
+ # List of comma-separated packages that start with or equal this string
+--- old/src/share/lib/security/java.security-solaris	2009-04-24 17:51:42.988300000 +0400
++++ openjdk/jdk/src/share/lib/security/java.security-solaris	2009-04-24 17:51:42.256300000 +0400
+@@ -128,7 +128,7 @@
+ # passed to checkPackageAccess unless the
+ # corresponding RuntimePermission ("accessClassInPackage."+package) has
+ # been granted.
+-package.access=sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.
++package.access=sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.
+ 
+ #
+ # List of comma-separated packages that start with or equal this string
+--- old/src/share/lib/security/java.security-windows	2009-04-24 17:51:48.445300000 +0400
++++ openjdk/jdk/src/share/lib/security/java.security-windows	2009-04-24 17:51:47.730300000 +0400
+@@ -128,7 +128,7 @@
+ # passed to checkPackageAccess unless the
+ # corresponding RuntimePermission ("accessClassInPackage."+package) has
+ # been granted.
+-package.access=sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.
++package.access=sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.
+ 
+ #
+ # List of comma-separated packages that start with or equal this string
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/security/icedtea-6657619.patch	Fri Aug 07 10:05:32 2009 -0400
@@ -0,0 +1,11 @@
+--- old/./src/share/classes/com/sun/jndi/dns/DnsContext.java	Mon Jul 13 21:42:27 2009
++++ openjdk/jdk/src/share/classes/com/sun/jndi/dns/DnsContext.java	Mon Jul 13 21:42:27 2009
+@@ -922,7 +922,7 @@
+ 
+     //---------- Debugging
+ 
+-    public static boolean debug = false;
++    private static final boolean debug = false;
+ 
+     private static final void dprint(String msg) {
+         if (debug) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/security/icedtea-6657625.patch	Fri Aug 07 10:05:32 2009 -0400
@@ -0,0 +1,18 @@
+--- old/src/share/classes/com/sun/media/sound/StandardMidiFileWriter.java	2009-05-13 15:20:07.765625000 +0400
++++ openjdk/jdk/src/share/classes/com/sun/media/sound/StandardMidiFileWriter.java	2009-05-13 15:20:06.953125000 +0400
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright 1999-2007 Sun Microsystems, Inc.  All Rights Reserved.
++ * Copyright 1999-2009 Sun Microsystems, Inc.  All Rights Reserved.
+  * 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 @@
+     /**
+      * MIDI parser types
+      */
+-    public static final int types[] = {
++    private static final int types[] = {
+         MIDI_TYPE_0,
+         MIDI_TYPE_1
+     };
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/security/icedtea-6657695.patch	Fri Aug 07 10:05:32 2009 -0400
@@ -0,0 +1,53 @@
+--- old/./src/share/classes/com/sun/security/sasl/util/AbstractSaslImpl.java	Tue Jul 14 14:55:29 2009
++++ openjdk/jdk/src/share/classes/com/sun/security/sasl/util/AbstractSaslImpl.java	Tue Jul 14 14:55:28 2009
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright 2000-2003 Sun Microsystems, Inc.  All Rights Reserved.
++ * Copyright 2000-2009 Sun Microsystems, Inc.  All Rights Reserved.
+  * 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,10 +48,6 @@
+  * @author Rosanna Lee
+  */
+ public abstract class AbstractSaslImpl {
+-    /**
+-     * Logger for debug messages
+-     */
+-    protected static Logger logger;  // set in initLogger(); lazily loads logger
+ 
+     protected boolean completed = false;
+     protected boolean privacy = false;
+@@ -68,7 +64,6 @@
+     protected String myClassName;
+ 
+     protected AbstractSaslImpl(Map props, String className) throws SaslException {
+-        initLogger();
+         myClassName = className;
+ 
+         // Parse properties  to set desired context options
+@@ -325,19 +320,15 @@
+         }
+     }
+ 
+-    /**
+-     * Sets logger field.
+-     */
+-    private static synchronized void initLogger() {
+-        if (logger == null) {
+-            logger = Logger.getLogger(SASL_LOGGER_NAME);
+-        }
+-    }
+-
+     // ---------------- Constants  -----------------
+     private static final String SASL_LOGGER_NAME = "javax.security.sasl";
+     protected static final String MAX_SEND_BUF = "javax.security.sasl.sendmaxbuffer";
+ 
++    /** 
++     * Logger for debug messages 
++     */
++    protected static final Logger logger = Logger.getLogger(SASL_LOGGER_NAME);
++
+     // default 0 (no protection); 1 (integrity only)
+     protected static final byte NO_PROTECTION = (byte)1;
+     protected static final byte INTEGRITY_ONLY_PROTECTION = (byte)2;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/security/icedtea-6660049.patch	Fri Aug 07 10:05:32 2009 -0400
@@ -0,0 +1,630 @@
+--- old/src/share/classes/javax/swing/plaf/synth/Region.java	2009-06-17 18:19:24.156250000 +0400
++++ openjdk/jdk/src/share/classes/javax/swing/plaf/synth/Region.java	2009-06-17 18:19:22.421875000 +0400
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright 2002-2004 Sun Microsystems, Inc.  All Rights Reserved.
++ * Copyright 2002-2009 Sun Microsystems, Inc.  All Rights Reserved.
+  * 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,13 @@
+  */
+ package javax.swing.plaf.synth;
+ 
+-import javax.swing.*;
+-import java.util.*;
++import sun.awt.AppContext;
++
++import java.util.HashMap;
++import java.util.Locale;
++import java.util.Map;
++import javax.swing.JComponent;
++import javax.swing.UIDefaults;
+ 
+ /**
+  * A distinct rendering area of a Swing component.  A component may
+@@ -67,8 +72,8 @@
+  * @author Scott Violet
+  */
+ public class Region {
+-    private static final Map uiToRegionMap = new HashMap();
+-    private static final Map lowerCaseNameMap = new HashMap();
++    private static final Object UI_TO_REGION_MAP_KEY = new Object();
++    private static final Object LOWER_CASE_NAME_MAP_KEY = new Object();   
+ 
+     /**
+      * ArrowButton's are special types of buttons that also render a
+@@ -77,400 +82,433 @@
+      * To bind a style to this <code>Region</code> use the name
+      * <code>ArrowButton</code>.
+      */
+-    public static final Region ARROW_BUTTON = new Region("ArrowButton",
+-                                                         "ArrowButtonUI");
++    public static final Region ARROW_BUTTON = new Region("ArrowButton", false);
+ 
+     /**
+      * Button region. To bind a style to this <code>Region</code> use the name
+      * <code>Button</code>.
+      */
+-    public static final Region BUTTON = new Region("Button",
+-                                                   "ButtonUI");
++    public static final Region BUTTON = new Region("Button", false);
+ 
+     /**
+      * CheckBox region. To bind a style to this <code>Region</code> use the name
+      * <code>CheckBox</code>.
+      */
+-    public static final Region CHECK_BOX = new Region("CheckBox",
+-                                                   "CheckBoxUI");
++    public static final Region CHECK_BOX = new Region("CheckBox", false);
+ 
+     /**
+      * CheckBoxMenuItem region. To bind a style to this <code>Region</code> use
+      * the name <code>CheckBoxMenuItem</code>.
+      */
+-    public static final Region CHECK_BOX_MENU_ITEM = new Region(
+-                                     "CheckBoxMenuItem", "CheckBoxMenuItemUI");
++    public static final Region CHECK_BOX_MENU_ITEM = new Region("CheckBoxMenuItem", false);
+ 
+     /**
+      * ColorChooser region. To bind a style to this <code>Region</code> use
+      * the name <code>ColorChooser</code>.
+      */
+-    public static final Region COLOR_CHOOSER = new Region(
+-                                     "ColorChooser", "ColorChooserUI");
++    public static final Region COLOR_CHOOSER = new Region("ColorChooser", false);
+ 
+     /**
+      * ComboBox region. To bind a style to this <code>Region</code> use
+      * the name <code>ComboBox</code>.
+      */
+-    public static final Region COMBO_BOX = new Region(
+-                                     "ComboBox", "ComboBoxUI");
++    public static final Region COMBO_BOX = new Region("ComboBox", false);
+ 
+     /**
+      * DesktopPane region. To bind a style to this <code>Region</code> use
+      * the name <code>DesktopPane</code>.
+      */
+-    public static final Region DESKTOP_PANE = new Region("DesktopPane",
+-                                                         "DesktopPaneUI");
++    public static final Region DESKTOP_PANE = new Region("DesktopPane", false);
++
+     /**
+      * DesktopIcon region. To bind a style to this <code>Region</code> use
+      * the name <code>DesktopIcon</code>.
+      */
+-    public static final Region DESKTOP_ICON = new Region("DesktopIcon",
+-                                                         "DesktopIconUI");
++    public static final Region DESKTOP_ICON = new Region("DesktopIcon", false);
+ 
+     /**
+      * EditorPane region. To bind a style to this <code>Region</code> use
+      * the name <code>EditorPane</code>.
+      */
+-    public static final Region EDITOR_PANE = new Region("EditorPane",
+-                                                        "EditorPaneUI");
++    public static final Region EDITOR_PANE = new Region("EditorPane", false);
+ 
+     /**
+      * FileChooser region. To bind a style to this <code>Region</code> use
+      * the name <code>FileChooser</code>.
+      */
+-    public static final Region FILE_CHOOSER = new Region("FileChooser",
+-                                                         "FileChooserUI");
++    public static final Region FILE_CHOOSER = new Region("FileChooser", false);
+ 
+     /**
+      * FormattedTextField region. To bind a style to this <code>Region</code> use
+      * the name <code>FormattedTextField</code>.
+      */
+-    public static final Region FORMATTED_TEXT_FIELD = new Region(
+-                            "FormattedTextField", "FormattedTextFieldUI");
++    public static final Region FORMATTED_TEXT_FIELD = new Region("FormattedTextField", false);
+ 
+     /**
+      * InternalFrame region. To bind a style to this <code>Region</code> use
+      * the name <code>InternalFrame</code>.
+      */
+-    public static final Region INTERNAL_FRAME = new Region("InternalFrame",
+-                                                           "InternalFrameUI");
++    public static final Region INTERNAL_FRAME = new Region("InternalFrame", false);
++
+     /**
+      * TitlePane of an InternalFrame. The TitlePane typically
+      * shows a menu, title, widgets to manipulate the internal frame.
+      * To bind a style to this <code>Region</code> use the name
+      * <code>InternalFrameTitlePane</code>.
+      */
+-    public static final Region INTERNAL_FRAME_TITLE_PANE =
+-                         new Region("InternalFrameTitlePane",
+-                                    "InternalFrameTitlePaneUI");
++    public static final Region INTERNAL_FRAME_TITLE_PANE = new Region("InternalFrameTitlePane", false);
+ 
+     /**
+      * Label region. To bind a style to this <code>Region</code> use the name
+      * <code>Label</code>.
+      */
+-    public static final Region LABEL = new Region("Label", "LabelUI");
++    public static final Region LABEL = new Region("Label", false);
+ 
+     /**
+      * List region. To bind a style to this <code>Region</code> use the name
+      * <code>List</code>.
+      */
+-    public static final Region LIST = new Region("List", "ListUI");
++    public static final Region LIST = new Region("List", false);
+ 
+     /**
+      * Menu region. To bind a style to this <code>Region</code> use the name
+      * <code>Menu</code>.
+      */
+-    public static final Region MENU = new Region("Menu", "MenuUI");
++    public static final Region MENU = new Region("Menu", false);
+ 
+     /**
+      * MenuBar region. To bind a style to this <code>Region</code> use the name
+      * <code>MenuBar</code>.
+      */
+-    public static final Region MENU_BAR = new Region("MenuBar", "MenuBarUI");
++    public static final Region MENU_BAR = new Region("MenuBar", false);
+ 
+     /**
+      * MenuItem region. To bind a style to this <code>Region</code> use the name
+      * <code>MenuItem</code>.
+      */
+-    public static final Region MENU_ITEM = new Region("MenuItem","MenuItemUI");
++    public static final Region MENU_ITEM = new Region("MenuItem", false);
+ 
+     /**
+      * Accelerator region of a MenuItem. To bind a style to this
+      * <code>Region</code> use the name <code>MenuItemAccelerator</code>.
+      */
+-    public static final Region MENU_ITEM_ACCELERATOR = new Region(
+-                                         "MenuItemAccelerator");
++    public static final Region MENU_ITEM_ACCELERATOR = new Region("MenuItemAccelerator", true);
+ 
+     /**
+      * OptionPane region. To bind a style to this <code>Region</code> use
+      * the name <code>OptionPane</code>.
+      */
+-    public static final Region OPTION_PANE = new Region("OptionPane",
+-                                                        "OptionPaneUI");
++    public static final Region OPTION_PANE = new Region("OptionPane", false);
+ 
+     /**
+      * Panel region. To bind a style to this <code>Region</code> use the name
+      * <code>Panel</code>.
+      */
+-    public static final Region PANEL = new Region("Panel", "PanelUI");
++    public static final Region PANEL = new Region("Panel", false);
+ 
+     /**
+      * PasswordField region. To bind a style to this <code>Region</code> use
+      * the name <code>PasswordField</code>.
+      */
+-    public static final Region PASSWORD_FIELD = new Region("PasswordField",
+-                                                           "PasswordFieldUI");
++    public static final Region PASSWORD_FIELD = new Region("PasswordField", false);
+ 
+     /**
+      * PopupMenu region. To bind a style to this <code>Region</code> use
+      * the name <code>PopupMenu</code>.
+      */
+-    public static final Region POPUP_MENU = new Region("PopupMenu",
+-                                                       "PopupMenuUI");
++    public static final Region POPUP_MENU = new Region("PopupMenu", false);
+ 
+     /**
+      * PopupMenuSeparator region. To bind a style to this <code>Region</code>
+      * use the name <code>PopupMenuSeparator</code>.
+      */
+-    public static final Region POPUP_MENU_SEPARATOR = new Region(
+-                           "PopupMenuSeparator", "PopupMenuSeparatorUI");
++    public static final Region POPUP_MENU_SEPARATOR = new Region("PopupMenuSeparator", false);
+ 
+     /**
+      * ProgressBar region. To bind a style to this <code>Region</code>
+      * use the name <code>ProgressBar</code>.
+      */
+-    public static final Region PROGRESS_BAR = new Region("ProgressBar",
+-                                                         "ProgressBarUI");
++    public static final Region PROGRESS_BAR = new Region("ProgressBar", false);
+ 
+     /**
+      * RadioButton region. To bind a style to this <code>Region</code>
+      * use the name <code>RadioButton</code>.
+      */
+-    public static final Region RADIO_BUTTON = new Region(
+-                               "RadioButton", "RadioButtonUI");
++    public static final Region RADIO_BUTTON = new Region("RadioButton", false);
+ 
+     /**
+      * RegionButtonMenuItem region. To bind a style to this <code>Region</code>
+      * use the name <code>RadioButtonMenuItem</code>.
+      */
+-    public static final Region RADIO_BUTTON_MENU_ITEM = new Region(
+-                               "RadioButtonMenuItem", "RadioButtonMenuItemUI");
++    public static final Region RADIO_BUTTON_MENU_ITEM = new Region("RadioButtonMenuItem", false);
+ 
+     /**
+      * RootPane region. To bind a style to this <code>Region</code> use
+      * the name <code>RootPane</code>.
+      */
+-    public static final Region ROOT_PANE = new Region("RootPane",
+-                                                      "RootPaneUI");
++    public static final Region ROOT_PANE = new Region("RootPane", false);
+ 
+     /**
+      * ScrollBar region. To bind a style to this <code>Region</code> use
+      * the name <code>ScrollBar</code>.
+      */
+-    public static final Region SCROLL_BAR = new Region("ScrollBar",
+-                                                       "ScrollBarUI");
++    public static final Region SCROLL_BAR = new Region("ScrollBar", false);
++
+     /**
+      * Track of the ScrollBar. To bind a style to this <code>Region</code> use
+      * the name <code>ScrollBarTrack</code>.
+      */
+-    public static final Region SCROLL_BAR_TRACK = new Region("ScrollBarTrack");
++    public static final Region SCROLL_BAR_TRACK = new Region("ScrollBarTrack", true);
++
+     /**
+      * Thumb of the ScrollBar. The thumb is the region of the ScrollBar
+      * that gives a graphical depiction of what percentage of the View is
+      * currently visible. To bind a style to this <code>Region</code> use
+      * the name <code>ScrollBarThumb</code>.
+      */
+-    public static final Region SCROLL_BAR_THUMB = new Region("ScrollBarThumb");
++    public static final Region SCROLL_BAR_THUMB = new Region("ScrollBarThumb", true);
+ 
+     /**
+      * ScrollPane region. To bind a style to this <code>Region</code> use
+      * the name <code>ScrollPane</code>.
+      */
+-    public static final Region SCROLL_PANE = new Region("ScrollPane",
+-                                                        "ScrollPaneUI");
++    public static final Region SCROLL_PANE = new Region("ScrollPane", false);
+ 
+     /**
+      * Separator region. To bind a style to this <code>Region</code> use
+      * the name <code>Separator</code>.
+      */
+-    public static final Region SEPARATOR = new Region("Separator",
+-                                                      "SeparatorUI");
++    public static final Region SEPARATOR = new Region("Separator", false);
+ 
+     /**
+      * Slider region. To bind a style to this <code>Region</code> use
+      * the name <code>Slider</code>.
+      */
+-    public static final Region SLIDER = new Region("Slider", "SliderUI");
++    public static final Region SLIDER = new Region("Slider", false);
++
+     /**
+      * Track of the Slider. To bind a style to this <code>Region</code> use
+      * the name <code>SliderTrack</code>.
+      */
+-    public static final Region SLIDER_TRACK = new Region("SliderTrack");
++    public static final Region SLIDER_TRACK = new Region("SliderTrack", true);
++
+     /**
+      * Thumb of the Slider. The thumb of the Slider identifies the current
+      * value. To bind a style to this <code>Region</code> use the name
+      * <code>SliderThumb</code>.
+      */
+-    public static final Region SLIDER_THUMB = new Region("SliderThumb");
++    public static final Region SLIDER_THUMB = new Region("SliderThumb", true);
+ 
+     /**
+      * Spinner region. To bind a style to this <code>Region</code> use the name
+      * <code>Spinner</code>.
+      */
+-    public static final Region SPINNER = new Region("Spinner", "SpinnerUI");
++    public static final Region SPINNER = new Region("Spinner", false);
+ 
+     /**
+      * SplitPane region. To bind a style to this <code>Region</code> use the name
+      * <code>SplitPane</code>.
+      */
+-    public static final Region SPLIT_PANE = new Region("SplitPane",
+-                                                      "SplitPaneUI");
++    public static final Region SPLIT_PANE = new Region("SplitPane", false);
+ 
+     /**
+      * Divider of the SplitPane. To bind a style to this <code>Region</code>
+      * use the name <code>SplitPaneDivider</code>.
+      */
+-    public static final Region SPLIT_PANE_DIVIDER = new Region(
+-                                        "SplitPaneDivider");
++    public static final Region SPLIT_PANE_DIVIDER = new Region("SplitPaneDivider", true);
+ 
+     /**
+      * TabbedPane region. To bind a style to this <code>Region</code> use
+      * the name <code>TabbedPane</code>.
+      */
+-    public static final Region TABBED_PANE = new Region("TabbedPane",
+-                                                        "TabbedPaneUI");
++    public static final Region TABBED_PANE = new Region("TabbedPane", false);
++
+     /**
+      * Region of a TabbedPane for one tab. To bind a style to this
+      * <code>Region</code> use the name <code>TabbedPaneTab</code>.
+      */
+-    public static final Region TABBED_PANE_TAB = new Region("TabbedPaneTab");
++    public static final Region TABBED_PANE_TAB = new Region("TabbedPaneTab", true);
++
+     /**
+      * Region of a TabbedPane containing the tabs. To bind a style to this
+      * <code>Region</code> use the name <code>TabbedPaneTabArea</code>.
+      */
+-    public static final Region TABBED_PANE_TAB_AREA =
+-                                 new Region("TabbedPaneTabArea");
++    public static final Region TABBED_PANE_TAB_AREA = new Region("TabbedPaneTabArea", true);
++
+     /**
+      * Region of a TabbedPane containing the content. To bind a style to this
+      * <code>Region</code> use the name <code>TabbedPaneContent</code>.
+      */
+-    public static final Region TABBED_PANE_CONTENT =
+-                                 new Region("TabbedPaneContent");
++    public static final Region TABBED_PANE_CONTENT = new Region("TabbedPaneContent", true);
+ 
+     /**
+      * Table region. To bind a style to this <code>Region</code> use
+      * the name <code>Table</code>.
+      */
+-    public static final Region TABLE = new Region("Table", "TableUI");
++    public static final Region TABLE = new Region("Table", false);
+ 
+     /**
+      * TableHeader region. To bind a style to this <code>Region</code> use
+      * the name <code>TableHeader</code>.
+      */
+-    public static final Region TABLE_HEADER = new Region("TableHeader",
+-                                                         "TableHeaderUI");
++    public static final Region TABLE_HEADER = new Region("TableHeader", false);
++
+     /**
+      * TextArea region. To bind a style to this <code>Region</code> use
+      * the name <code>TextArea</code>.
+      */
+-    public static final Region TEXT_AREA = new Region("TextArea",
+-                                                      "TextAreaUI");
++    public static final Region TEXT_AREA = new Region("TextArea", false);
+ 
+     /**
+      * TextField region. To bind a style to this <code>Region</code> use
+      * the name <code>TextField</code>.
+      */
+-    public static final Region TEXT_FIELD = new Region("TextField",
+-                                                       "TextFieldUI");
++    public static final Region TEXT_FIELD = new Region("TextField", false);
+ 
+     /**
+      * TextPane region. To bind a style to this <code>Region</code> use
+      * the name <code>TextPane</code>.
+      */
+-    public static final Region TEXT_PANE = new Region("TextPane",
+-                                                      "TextPaneUI");
++    public static final Region TEXT_PANE = new Region("TextPane", false);
+ 
+     /**
+      * ToggleButton region. To bind a style to this <code>Region</code> use
+      * the name <code>ToggleButton</code>.
+      */
+-    public static final Region TOGGLE_BUTTON = new Region("ToggleButton",
+-                                                          "ToggleButtonUI");
++    public static final Region TOGGLE_BUTTON = new Region("ToggleButton", false);
+ 
+     /**
+      * ToolBar region. To bind a style to this <code>Region</code> use
+      * the name <code>ToolBar</code>.
+      */
+-    public static final Region TOOL_BAR = new Region("ToolBar", "ToolBarUI");
++    public static final Region TOOL_BAR = new Region("ToolBar", false);
++
+     /**
+      * Region of the ToolBar containing the content. To bind a style to this
+      * <code>Region</code> use the name <code>ToolBarContent</code>.
+      */
+-    public static final Region TOOL_BAR_CONTENT = new Region("ToolBarContent");
++    public static final Region TOOL_BAR_CONTENT = new Region("ToolBarContent", true);
++
+     /**
+      * Region for the Window containing the ToolBar. To bind a style to this
+      * <code>Region</code> use the name <code>ToolBarDragWindow</code>.
+      */
+-    public static final Region TOOL_BAR_DRAG_WINDOW = new Region(
+-                                        "ToolBarDragWindow", null, false);
++    public static final Region TOOL_BAR_DRAG_WINDOW = new Region("ToolBarDragWindow", false);
+ 
+     /**
+      * ToolTip region. To bind a style to this <code>Region</code> use
+      * the name <code>ToolTip</code>.
+      */
+-    public static final Region TOOL_TIP = new Region("ToolTip", "ToolTipUI");
++    public static final Region TOOL_TIP = new Region("ToolTip", false);
+ 
+     /**
+      * ToolBar separator region. To bind a style to this <code>Region</code> use
+      * the name <code>ToolBarSeparator</code>.
+      */
+-    public static final Region TOOL_BAR_SEPARATOR = new Region(
+-                          "ToolBarSeparator", "ToolBarSeparatorUI");
++    public static final Region TOOL_BAR_SEPARATOR = new Region("ToolBarSeparator", false);
+ 
+     /**
+      * Tree region. To bind a style to this <code>Region</code> use the name
+      * <code>Tree</code>.
+      */
+-    public static final Region TREE = new Region("Tree", "TreeUI");
++    public static final Region TREE = new Region("Tree", false);
++
+     /**
+      * Region of the Tree for one cell. To bind a style to this
+      * <code>Region</code> use the name <code>TreeCell</code>.
+      */
+-    public static final Region TREE_CELL = new Region("TreeCell");
++    public static final Region TREE_CELL = new Region("TreeCell", true);
+ 
+     /**
+      * Viewport region. To bind a style to this <code>Region</code> use
+      * the name <code>Viewport</code>.
+      */
+-    public static final Region VIEWPORT = new Region("Viewport", "ViewportUI");
+-
++    public static final Region VIEWPORT = new Region("Viewport", false);
+ 
+-    private String name;
+-    private boolean subregion;
++    private static Map<String, Region> getUItoRegionMap() {
++        AppContext context = AppContext.getAppContext();
++        Map<String, Region> map = (Map<String, Region>) context.get(UI_TO_REGION_MAP_KEY);
++        if (map == null) {
++            map = new HashMap<String, Region>();
++            map.put("ArrowButtonUI", ARROW_BUTTON);
++            map.put("ButtonUI", BUTTON);
++            map.put("CheckBoxUI", CHECK_BOX);
++            map.put("CheckBoxMenuItemUI", CHECK_BOX_MENU_ITEM);
++            map.put("ColorChooserUI", COLOR_CHOOSER);
++            map.put("ComboBoxUI", COMBO_BOX);
++            map.put("DesktopPaneUI", DESKTOP_PANE);
++            map.put("DesktopIconUI", DESKTOP_ICON);
++            map.put("EditorPaneUI", EDITOR_PANE);
++            map.put("FileChooserUI", FILE_CHOOSER);
++            map.put("FormattedTextFieldUI", FORMATTED_TEXT_FIELD);
++            map.put("InternalFrameUI", INTERNAL_FRAME);
++            map.put("InternalFrameTitlePaneUI", INTERNAL_FRAME_TITLE_PANE);
++            map.put("LabelUI", LABEL);
++            map.put("ListUI", LIST);
++            map.put("MenuUI", MENU);
++            map.put("MenuBarUI", MENU_BAR);
++            map.put("MenuItemUI", MENU_ITEM);
++            map.put("OptionPaneUI", OPTION_PANE);
++            map.put("PanelUI", PANEL);
++            map.put("PasswordFieldUI", PASSWORD_FIELD);
++            map.put("PopupMenuUI", POPUP_MENU);
++            map.put("PopupMenuSeparatorUI", POPUP_MENU_SEPARATOR);
++            map.put("ProgressBarUI", PROGRESS_BAR);
++            map.put("RadioButtonUI", RADIO_BUTTON);
++            map.put("RadioButtonMenuItemUI", RADIO_BUTTON_MENU_ITEM);
++            map.put("RootPaneUI", ROOT_PANE);
++            map.put("ScrollBarUI", SCROLL_BAR);
++            map.put("ScrollPaneUI", SCROLL_PANE);
++            map.put("SeparatorUI", SEPARATOR);
++            map.put("SliderUI", SLIDER);
++            map.put("SpinnerUI", SPINNER);
++            map.put("SplitPaneUI", SPLIT_PANE);
++            map.put("TabbedPaneUI", TABBED_PANE);
++            map.put("TableUI", TABLE);
++            map.put("TableHeaderUI", TABLE_HEADER);
++            map.put("TextAreaUI", TEXT_AREA);
++            map.put("TextFieldUI", TEXT_FIELD);
++            map.put("TextPaneUI", TEXT_PANE);
++            map.put("ToggleButtonUI", TOGGLE_BUTTON);
++            map.put("ToolBarUI", TOOL_BAR);
++            map.put("ToolTipUI", TOOL_TIP);
++            map.put("ToolBarSeparatorUI", TOOL_BAR_SEPARATOR);
++            map.put("TreeUI", TREE);
++            map.put("ViewportUI", VIEWPORT);
++            context.put(UI_TO_REGION_MAP_KEY, map);
++        }
++        return map;
++    }
+ 
++    private static Map<Region, String> getLowerCaseNameMap() {
++        AppContext context = AppContext.getAppContext();
++        Map<Region, String> map = (Map<Region, String>) context.get(LOWER_CASE_NAME_MAP_KEY);
++        if (map == null) {
++            map = new HashMap<Region, String>();
++            context.put(LOWER_CASE_NAME_MAP_KEY, map);
++        }
++        return map;
++    }
+ 
+     static Region getRegion(JComponent c) {
+-        return (Region)uiToRegionMap.get(c.getUIClassID());
++        return getUItoRegionMap().get(c.getUIClassID());
+     }
+ 
+     static void registerUIs(UIDefaults table) {
+-        Iterator uis = uiToRegionMap.keySet().iterator();
+-
+-        while (uis.hasNext()) {
+-            Object key = uis.next();
+-
++        for (Object key : getUItoRegionMap().keySet()) {
+             table.put(key, "javax.swing.plaf.synth.SynthLookAndFeel");
+         }
+     }
+ 
++    private final String name;
++    private final boolean subregion;
+ 
+-    Region(String name) {
+-        this(name, null, true);
+-    }
+-
+-    Region(String name, String ui) {
+-        this(name, ui, false);
++    private Region(String name, boolean subregion) {
++        if (name == null) {
++            throw new NullPointerException("You must specify a non-null name");
++        }
++        this.name = name;
++        this.subregion = subregion;
+     }
+ 
+     /**
+@@ -485,14 +523,10 @@
+      * @param subregion Whether or not this is a subregion.
+      */
+     protected Region(String name, String ui, boolean subregion) {
+-        if (name == null) {
+-            throw new NullPointerException("You must specify a non-null name");
+-        }
+-        this.name = name;
++        this(name, subregion);
+         if (ui != null) {
+-            uiToRegionMap.put(ui, this);
++            getUItoRegionMap().put(ui, this);
+         }
+-        this.subregion = subregion;
+     }
+ 
+     /**
+@@ -518,16 +552,17 @@
+ 
+     /**
+      * Returns the name, in lowercase.
++     *
++     * @return lower case representation of the name of the Region
+      */
+     String getLowerCaseName() {
+-        synchronized(lowerCaseNameMap) {
+-            String lowerCaseName = (String)lowerCaseNameMap.get(this);
+-            if (lowerCaseName == null) {
+-                lowerCaseName = getName().toLowerCase();
+-                lowerCaseNameMap.put(this, lowerCaseName);
+-            }
+-            return lowerCaseName;
++        Map<Region, String> lowerCaseNameMap = getLowerCaseNameMap();
++        String lowerCaseName = lowerCaseNameMap.get(this);
++        if (lowerCaseName == null) {
++            lowerCaseName = name.toLowerCase(Locale.ENGLISH);
++            lowerCaseNameMap.put(this, lowerCaseName);
+         }
++        return lowerCaseName;
+     }
+ 
+     /**
+@@ -535,6 +570,7 @@
+      *
+      * @return name of the Region.
+      */
++    @Override
+     public String toString() {
+         return name;
+     }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/security/icedtea-6660539.patch	Fri Aug 07 10:05:32 2009 -0400
@@ -0,0 +1,74 @@
+--- old/src/share/classes/java/beans/Introspector.java	2009-04-27 15:20:16.078125000 +0400
++++ openjdk/jdk/src/share/classes/java/beans/Introspector.java	2009-04-27 15:20:13.593750000 +0400
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright 1996-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * Copyright 1996-2009 Sun Microsystems, Inc.  All Rights Reserved.
+  * 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 java.util.List;
+ import java.util.WeakHashMap;
+ import java.util.TreeMap;
++import sun.awt.AppContext;
+ import sun.reflect.misc.ReflectUtil;
+ 
+ /**
+@@ -111,8 +112,8 @@
+     // Static Caches to speed up introspection.
+     private static Map declaredMethodCache =
+         Collections.synchronizedMap(new WeakHashMap());
+-    private static Map beanInfoCache =
+-        Collections.synchronizedMap(new WeakHashMap());
++
++    private static final Object BEANINFO_CACHE = new Object();
+ 
+     private Class beanClass;
+     private BeanInfo explicitBeanInfo;
+@@ -175,10 +176,18 @@
+         if (!ReflectUtil.isPackageAccessible(beanClass)) {
+             return (new Introspector(beanClass, null, USE_ALL_BEANINFO)).getBeanInfo();
+         }
+-        BeanInfo bi = (BeanInfo)beanInfoCache.get(beanClass);
++        Map<Class<?>, BeanInfo> map;
++        synchronized (BEANINFO_CACHE) {
++            map = (Map<Class<?>, BeanInfo>) AppContext.getAppContext().get(BEANINFO_CACHE);
++            if (map == null) {
++                map = Collections.synchronizedMap(new WeakHashMap<Class<?>, BeanInfo>());
++                AppContext.getAppContext().put(BEANINFO_CACHE, map);
++            }
++        }
++        BeanInfo bi = map.get(beanClass);
+         if (bi == null) {
+             bi = (new Introspector(beanClass, null, USE_ALL_BEANINFO)).getBeanInfo();
+-            beanInfoCache.put(beanClass, bi);
++            map.put(beanClass, bi);
+         }
+         return bi;
+     }
+@@ -327,7 +336,10 @@
+      */
+ 
+     public static void flushCaches() {
+-        beanInfoCache.clear();
++        Map map = (Map) AppContext.getAppContext().get(BEANINFO_CACHE);
++        if (map != null) {
++            map.clear();
++        }
+         declaredMethodCache.clear();
+     }
+ 
+@@ -350,7 +362,10 @@
+         if (clz == null) {
+             throw new NullPointerException();
+         }
+-        beanInfoCache.remove(clz);
++        Map map = (Map) AppContext.getAppContext().get(BEANINFO_CACHE);
++        if (map != null) {
++            map.remove(clz);
++        }
+         declaredMethodCache.remove(clz);
+     }
+ 
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/security/icedtea-6736293.patch	Fri Aug 07 10:05:32 2009 -0400
@@ -0,0 +1,61 @@
+--- old/src/share/classes/javax/management/openmbean/OpenMBeanAttributeInfoSupport.java	Wed May  6 16:57:04 2009
++++ openjdk/jdk/src/share/classes/javax/management/openmbean/OpenMBeanAttributeInfoSupport.java	Wed May  6 16:57:04 2009
+@@ -690,7 +690,7 @@
+     private static <T> T convertFromString(String s, OpenType<T> openType) {
+         Class<T> c;
+         try {
+-            c = cast(Class.forName(openType.getClassName()));
++            c = cast(Class.forName(openType.safeGetClassName()));
+         } catch (ClassNotFoundException e) {
+             throw new NoClassDefFoundError(e.toString());  // can't happen
+         }
+@@ -711,7 +711,7 @@
+             } catch (Exception e) {
+                 final String msg =
+                     "Could not convert \"" + s + "\" using method: " + valueOf;
+-                throw new IllegalArgumentException(msg);
++                throw new IllegalArgumentException(msg, e);
+             }
+         }
+ 
+@@ -728,7 +728,7 @@
+             } catch (Exception e) {
+                 final String msg =
+                     "Could not convert \"" + s + "\" using constructor: " + con;
+-                throw new IllegalArgumentException(msg);
++                throw new IllegalArgumentException(msg, e);
+             }
+         }
+ 
+@@ -757,7 +757,7 @@
+             stringArrayClass =
+                 Class.forName(squareBrackets + "Ljava.lang.String;");
+             targetArrayClass =
+-                Class.forName(squareBrackets + "L" + baseType.getClassName() +
++                Class.forName(squareBrackets + "L" + baseType.safeGetClassName() +
+                               ";");
+         } catch (ClassNotFoundException e) {
+             throw new NoClassDefFoundError(e.toString());  // can't happen
+@@ -769,7 +769,6 @@
+                 "array with same dimensions";
+             throw new IllegalArgumentException(msg);
+         }
+-        Class<?> targetComponentClass = targetArrayClass.getComponentType();
+         OpenType<?> componentOpenType;
+         if (dim == 1)
+             componentOpenType = baseType;
+--- old/src/share/classes/javax/management/openmbean/OpenType.java	Wed May  6 16:57:05 2009
++++ openjdk/jdk/src/share/classes/javax/management/openmbean/OpenType.java	Wed May  6 16:57:05 2009
+@@ -304,7 +304,12 @@
+      * @return the class name.
+      */
+     public String getClassName() {
++        return className;
++    }
+ 
++    // A version of getClassName() that can only be called from within this
++    // package and that cannot be overridden.
++    String safeGetClassName() {
+         return className;
+     }
+ 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/security/icedtea-6738524.patch	Fri Aug 07 10:05:32 2009 -0400
@@ -0,0 +1,42 @@
+--- oldjdk/src/share/classes/com/sun/media/sound/JDK13Services.java	2009-05-13 15:17:09.656250000 +0400
++++ openjdk/jdk/src/share/classes/com/sun/media/sound/JDK13Services.java	2009-05-13 15:17:08.843750000 +0400
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright 1999-2007 Sun Microsystems, Inc.  All Rights Reserved.
++ * Copyright 1999-2009 Sun Microsystems, Inc.  All Rights Reserved.
+  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+  *
+  * This code is free software; you can redistribute it and/or modify it
+@@ -41,6 +41,15 @@
+ import javax.sound.midi.spi.SoundbankReader;
+ import javax.sound.midi.spi.MidiDeviceProvider;
+ 
++import javax.sound.midi.Receiver;
++import javax.sound.midi.Sequencer;
++import javax.sound.midi.Synthesizer;
++import javax.sound.midi.Transmitter;
++import javax.sound.sampled.Clip;
++import javax.sound.sampled.Port;
++import javax.sound.sampled.SourceDataLine;
++import javax.sound.sampled.TargetDataLine;
++
+ 
+ /**
+  * JDK13Services uses the Service class in JDK 1.3
+@@ -186,6 +195,16 @@
+         If the property is not set, null is returned.
+      */
+     private static synchronized String getDefaultProvider(Class typeClass) {
++        if (!SourceDataLine.class.equals(typeClass)
++                && !TargetDataLine.class.equals(typeClass)
++                && !Clip.class.equals(typeClass)
++                && !Port.class.equals(typeClass)
++                && !Receiver.class.equals(typeClass)
++                && !Transmitter.class.equals(typeClass)
++                && !Synthesizer.class.equals(typeClass)
++                && !Sequencer.class.equals(typeClass)) {
++            return null;
++        }
+         String value;
+         String propertyName = typeClass.getName();
+         value = JSSecurityManager.getProperty(propertyName);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/security/icedtea-6777448.patch	Fri Aug 07 10:05:32 2009 -0400
@@ -0,0 +1,69 @@
+--- old/src/share/classes/com/sun/media/sound/JSSecurityManager.java	2009-05-13 15:19:07.312500000 +0400
++++ openjdk/jdk/src/share/classes/com/sun/media/sound/JSSecurityManager.java	2009-05-13 15:19:06.453125000 +0400
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright 1999-2007 Sun Microsystems, Inc.  All Rights Reserved.
++ * Copyright 1999-2009 Sun Microsystems, Inc.  All Rights Reserved.
+  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+  *
+  * This code is free software; you can redistribute it and/or modify it
+@@ -283,28 +283,37 @@
+ 
+ 
+     static List getProviders(final Class providerClass) {
+-        PrivilegedAction action = new PrivilegedAction() {
+-                public Object run() {
+-                    List p = new ArrayList();
+-                    Iterator ps = Service.providers(providerClass);
+-                    while (ps.hasNext()) {
+-                        try {
+-                            Object provider = ps.next();
+-                            if (providerClass.isInstance(provider)) {
+-                                // $$mp 2003-08-22
+-                                // Always adding at the beginning reverses the
+-                                // order of the providers. So we no longer have
+-                                // to do this in AudioSystem and MidiSystem.
+-                                p.add(0, provider);
+-                            }
+-                        } catch (Throwable t) {
+-                            //$$fb 2002-11-07: do not fail on SPI not found
+-                            if (Printer.err) t.printStackTrace();
+-                        }                                                                  }
+-                    return p;
++        List p = new ArrayList();
++        // Service.providers(Class) just creates "lazy" iterator instance,
++        // so it doesn't require do be called from privileged section
++        final Iterator ps = Service.providers(providerClass);
++
++        // the iterator's hasNext() method looks through classpath for
++        // the provider class names, so it requires read permissions
++        PrivilegedAction<Boolean> hasNextAction = new PrivilegedAction<Boolean>() {
++            public Boolean run() {
++                return ps.hasNext();
++            }
++        };
++
++        while (AccessController.doPrivileged(hasNextAction)) {
++            try {
++                // the iterator's next() method creates instances of the
++                // providers and it should be called in the current security
++                // context
++                Object provider = ps.next();
++                if (providerClass.isInstance(provider)) {
++                    // $$mp 2003-08-22
++                    // Always adding at the beginning reverses the
++                    // order of the providers. So we no longer have
++                    // to do this in AudioSystem and MidiSystem.
++                    p.add(0, provider);
+                 }
+-            };
+-        List providers = (List) AccessController.doPrivileged(action);
+-        return providers;
++            } catch (Throwable t) {
++                //$$fb 2002-11-07: do not fail on SPI not found
++                if (Printer.err) t.printStackTrace();
++            }
++        }
++        return p;
+     }
+ }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/security/icedtea-6777487.patch	Fri Aug 07 10:05:32 2009 -0400
@@ -0,0 +1,179 @@
+--- old/src/share/classes/java/beans/MetaData.java	2009-04-27 19:00:26.359375000 +0400
++++ openjdk/jdk/src/share/classes/java/beans/MetaData.java	2009-04-27 19:00:25.062500000 +0400
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright 2000-2007 Sun Microsystems, Inc.  All Rights Reserved.
++ * Copyright 2000-2009 Sun Microsystems, Inc.  All Rights Reserved.
+  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+  *
+  * This code is free software; you can redistribute it and/or modify it
+@@ -331,31 +331,6 @@
+         return (oldC.size() == newC.size()) && oldC.containsAll(newC);
+     }
+ 
+-    static Object getPrivateField(final Object instance, final String name) {
+-        return AccessController.doPrivileged(
+-                new PrivilegedAction() {
+-                    public Object run() {
+-                        Class type = instance.getClass();
+-                        while ( true ) {
+-                            try {
+-                                Field field = type.getDeclaredField(name);
+-                                field.setAccessible(true);
+-                                return field.get( instance );
+-                            }
+-                            catch (NoSuchFieldException exception) {
+-                                type = type.getSuperclass();
+-                                if (type == null) {
+-                                    throw new IllegalStateException("Could not find field " + name, exception);
+-                                }
+-                            }
+-                            catch (Exception exception) {
+-                                throw new IllegalStateException("Could not get value " + type.getName() + '.' + name, exception);
+-                            }
+-                        }
+-                    }
+-                } );
+-    }
+-
+     static final class EmptyList_PersistenceDelegate extends java_util_Collections {
+         protected Expression instantiate(Object oldInstance, Encoder out) {
+             return new Expression(oldInstance, Collections.class, "emptyList", null);
+@@ -496,7 +471,7 @@
+ 
+     static final class CheckedCollection_PersistenceDelegate extends java_util_Collections {
+         protected Expression instantiate(Object oldInstance, Encoder out) {
+-            Object type = getPrivateField(oldInstance, "type");
++            Object type = MetaData.getPrivateFieldValue(oldInstance, "java.util.Collections$CheckedCollection.type");
+             List list = new ArrayList((Collection) oldInstance);
+             return new Expression(oldInstance, Collections.class, "checkedCollection", new Object[]{list, type});
+         }
+@@ -504,7 +479,7 @@
+ 
+     static final class CheckedList_PersistenceDelegate extends java_util_Collections {
+         protected Expression instantiate(Object oldInstance, Encoder out) {
+-            Object type = getPrivateField(oldInstance, "type");
++            Object type = MetaData.getPrivateFieldValue(oldInstance, "java.util.Collections$CheckedCollection.type");
+             List list = new LinkedList((Collection) oldInstance);
+             return new Expression(oldInstance, Collections.class, "checkedList", new Object[]{list, type});
+         }
+@@ -512,7 +487,7 @@
+ 
+     static final class CheckedRandomAccessList_PersistenceDelegate extends java_util_Collections {
+         protected Expression instantiate(Object oldInstance, Encoder out) {
+-            Object type = getPrivateField(oldInstance, "type");
++            Object type = MetaData.getPrivateFieldValue(oldInstance, "java.util.Collections$CheckedCollection.type");
+             List list = new ArrayList((Collection) oldInstance);
+             return new Expression(oldInstance, Collections.class, "checkedList", new Object[]{list, type});
+         }
+@@ -520,7 +495,7 @@
+ 
+     static final class CheckedSet_PersistenceDelegate extends java_util_Collections {
+         protected Expression instantiate(Object oldInstance, Encoder out) {
+-            Object type = getPrivateField(oldInstance, "type");
++            Object type = MetaData.getPrivateFieldValue(oldInstance, "java.util.Collections$CheckedCollection.type");
+             Set set = new HashSet((Set) oldInstance);
+             return new Expression(oldInstance, Collections.class, "checkedSet", new Object[]{set, type});
+         }
+@@ -528,7 +503,7 @@
+ 
+     static final class CheckedSortedSet_PersistenceDelegate extends java_util_Collections {
+         protected Expression instantiate(Object oldInstance, Encoder out) {
+-            Object type = getPrivateField(oldInstance, "type");
++            Object type = MetaData.getPrivateFieldValue(oldInstance, "java.util.Collections$CheckedCollection.type");
+             SortedSet set = new TreeSet((SortedSet) oldInstance);
+             return new Expression(oldInstance, Collections.class, "checkedSortedSet", new Object[]{set, type});
+         }
+@@ -536,8 +511,8 @@
+ 
+     static final class CheckedMap_PersistenceDelegate extends java_util_Collections {
+         protected Expression instantiate(Object oldInstance, Encoder out) {
+-            Object keyType = getPrivateField(oldInstance, "keyType");
+-            Object valueType = getPrivateField(oldInstance, "valueType");
++            Object keyType   = MetaData.getPrivateFieldValue(oldInstance, "java.util.Collections$CheckedMap.keyType");
++            Object valueType = MetaData.getPrivateFieldValue(oldInstance, "java.util.Collections$CheckedMap.valueType");
+             Map map = new HashMap((Map) oldInstance);
+             return new Expression(oldInstance, Collections.class, "checkedMap", new Object[]{map, keyType, valueType});
+         }
+@@ -545,8 +520,8 @@
+ 
+     static final class CheckedSortedMap_PersistenceDelegate extends java_util_Collections {
+         protected Expression instantiate(Object oldInstance, Encoder out) {
+-            Object keyType = getPrivateField(oldInstance, "keyType");
+-            Object valueType = getPrivateField(oldInstance, "valueType");
++            Object keyType   = MetaData.getPrivateFieldValue(oldInstance, "java.util.Collections$CheckedMap.keyType");
++            Object valueType = MetaData.getPrivateFieldValue(oldInstance, "java.util.Collections$CheckedMap.valueType");
+             SortedMap map = new TreeMap((SortedMap) oldInstance);
+             return new Expression(oldInstance, Collections.class, "checkedSortedMap", new Object[]{map, keyType, valueType});
+         }
+@@ -568,7 +543,7 @@
+     }
+ 
+     private static Object getType(Object instance) {
+-        return java_util_Collections.getPrivateField(instance, "keyType");
++        return MetaData.getPrivateFieldValue(instance, "java.util.EnumMap.keyType");
+     }
+ }
+ 
+@@ -587,7 +562,7 @@
+     }
+ 
+     private static Object getType(Object instance) {
+-        return java_util_Collections.getPrivateField(instance, "elementType");
++        return MetaData.getPrivateFieldValue(instance, "java.util.EnumSet.elementType");
+     }
+ }
+ 
+@@ -1268,7 +1243,7 @@
+ 
+     private Integer getAxis(Object object) {
+         Box box = (Box) object;
+-        return (Integer) java_util_Collections.getPrivateField(box.getLayout(), "axis");
++        return (Integer) MetaData.getPrivateFieldValue(box.getLayout(), "javax.swing.BoxLayout.axis");
+     }
+ }
+ 
+@@ -1351,6 +1326,7 @@
+ }
+ 
+ class MetaData {
++    private static final Map<String,Field> fields = Collections.synchronizedMap(new WeakHashMap<String, Field>());
+     private static Hashtable internalPersistenceDelegates = new Hashtable();
+     private static Hashtable transientProperties = new Hashtable();
+ 
+@@ -1706,4 +1682,35 @@
+         }
+         tp.add(property);
+     }
++
++    static Object getPrivateFieldValue(Object instance, String name) {
++        Field field = fields.get(name);
++        if (field == null) {
++            int index = name.lastIndexOf('.');
++            final String className = name.substring(0, index);
++            final String fieldName = name.substring(1 + index);
++            field = AccessController.doPrivileged(new PrivilegedAction<Field>() {
++                public Field run() {
++                    try {
++                        Field field = Class.forName(className).getDeclaredField(fieldName);
++                        field.setAccessible(true);
++                        return field;
++                    }
++                    catch (ClassNotFoundException exception) {
++                        throw new IllegalStateException("Could not find class", exception);
++                    }
++                    catch (NoSuchFieldException exception) {
++                        throw new IllegalStateException("Could not find field", exception);
++                    }
++                }
++            });
++            fields.put(name, field);
++        }
++        try {
++            return field.get(instance);
++        }
++        catch (IllegalAccessException exception) {
++            throw new IllegalStateException("Could not get value of the field", exception);
++        }
++    }
+ }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/security/icedtea-6801071.patch	Fri Aug 07 10:05:32 2009 -0400
@@ -0,0 +1,175 @@
+--- old/make/sun/net/FILES_java.gmk	Tue May 12 12:00:05 2009
++++ openjdk/jdk/make/sun/net/FILES_java.gmk	Tue May 12 12:00:05 2009
+@@ -24,6 +24,7 @@
+ #
+ 
+ FILES_java = \
++	sun/net/ApplicationProxy.java \
+ 	sun/net/InetAddressCachePolicy.java \
+ 	sun/net/URLCanonicalizer.java \
+ 	sun/net/NetworkClient.java \
+--- old/src/share/classes/java/net/Socket.java	Tue May 12 12:00:08 2009
++++ openjdk/jdk/src/share/classes/java/net/Socket.java	Tue May 12 12:00:07 2009
+@@ -118,7 +118,7 @@
+         if (proxy == null) {
+             throw new IllegalArgumentException("Invalid Proxy");
+         }
+-        Proxy p = proxy == Proxy.NO_PROXY ? Proxy.NO_PROXY : new Proxy(proxy.type(), proxy.address());
++        Proxy p = proxy == Proxy.NO_PROXY ? Proxy.NO_PROXY : sun.net.ApplicationProxy.create(proxy);
+         if (p.type() == Proxy.Type.SOCKS) {
+             SecurityManager security = System.getSecurityManager();
+             InetSocketAddress epoint = (InetSocketAddress) p.address();
+--- old/src/share/classes/java/net/SocksSocketImpl.java	Tue May 12 12:00:10 2009
++++ openjdk/jdk/src/share/classes/java/net/SocksSocketImpl.java	Tue May 12 12:00:09 2009
+@@ -48,6 +48,10 @@
+     private InputStream cmdIn = null;
+     private OutputStream cmdOut = null;
+ 
++    /* true if the Proxy has been set programatically */
++    private boolean applicationSetProxy;  /* false */
++
++
+     SocksSocketImpl() {
+         // Nothing needed
+     }
+@@ -64,6 +68,7 @@
+             // Use getHostString() to avoid reverse lookups
+             server = ad.getHostString();
+             port = ad.getPort();
++            applicationSetProxy = true;
+         }
+     }
+ 
+@@ -165,8 +170,7 @@
+                         throw (IOException) pae.getException();
+                     }
+                 } else {
+-                    userName = java.security.AccessController.doPrivileged(
+-                        new sun.security.action.GetPropertyAction("user.name"));
++                    userName = getUserName();
+                 }
+             }
+             if (userName == null)
+@@ -267,8 +271,7 @@
+         out.write((endpoint.getPort() >> 8) & 0xff);
+         out.write((endpoint.getPort() >> 0) & 0xff);
+         out.write(endpoint.getAddress().getAddress());
+-        String userName = java.security.AccessController.doPrivileged(
+-               new sun.security.action.GetPropertyAction("user.name"));
++        String userName = getUserName();
+         try {
+             out.write(userName.getBytes("ISO-8859-1"));
+         } catch (java.io.UnsupportedEncodingException uee) {
+@@ -589,8 +592,7 @@
+         out.write((super.getLocalPort() >> 8) & 0xff);
+         out.write((super.getLocalPort() >> 0) & 0xff);
+         out.write(addr1);
+-        String userName = java.security.AccessController.doPrivileged(
+-               new sun.security.action.GetPropertyAction("user.name"));
++        String userName = getUserName();
+         try {
+             out.write(userName.getBytes("ISO-8859-1"));
+         } catch (java.io.UnsupportedEncodingException uee) {
+@@ -1052,4 +1054,16 @@
+         super.close();
+     }
+ 
++    private String getUserName() {
++        String userName = "";
++        if (applicationSetProxy) {
++            try {
++                userName = System.getProperty("user.name");
++            } catch (SecurityException se) { /* swallow Exception */ }
++        } else {
++            userName = java.security.AccessController.doPrivileged(
++                new sun.security.action.GetPropertyAction("user.name"));
++        }
++        return userName;
++    }
+ }
+--- old/src/share/classes/java/net/URL.java	Tue May 12 12:00:12 2009
++++ openjdk/jdk/src/share/classes/java/net/URL.java	Tue May 12 12:00:11 2009
+@@ -999,7 +999,7 @@
+         }
+ 
+         // Create a copy of Proxy as a security measure
+-        Proxy p = proxy == Proxy.NO_PROXY ? Proxy.NO_PROXY : new Proxy(proxy.type(), proxy.address());
++        Proxy p = proxy == Proxy.NO_PROXY ? Proxy.NO_PROXY : sun.net.ApplicationProxy.create(proxy);
+         SecurityManager sm = System.getSecurityManager();
+         if (p.type() != Proxy.Type.DIRECT && sm != null) {
+             InetSocketAddress epoint = (InetSocketAddress) p.address();
+--- old/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java	Tue May 12 12:00:14 2009
++++ openjdk/jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java	Tue May 12 12:00:13 2009
+@@ -559,12 +559,20 @@
+         responses = new MessageHeader();
+         this.handler = handler;
+         instProxy = p;
+-        cookieHandler = (CookieHandler)java.security.AccessController.doPrivileged(
+-            new java.security.PrivilegedAction() {
+-            public Object run() {
+-                return CookieHandler.getDefault();
+-            }
+-        });
++        if (instProxy instanceof sun.net.ApplicationProxy) {
++            /* Application set Proxies should not have access to cookies
++             * in a secure environment unless explicitly allowed. */
++            try { 
++                cookieHandler = CookieHandler.getDefault();
++            } catch (SecurityException se) { /* swallow exception */ }
++        } else {
++            cookieHandler = java.security.AccessController.doPrivileged(
++                new java.security.PrivilegedAction<CookieHandler>() {
++                public CookieHandler run() {
++                    return CookieHandler.getDefault();
++                }
++            });
++        }
+         cacheHandler = (ResponseCache)java.security.AccessController.doPrivileged(
+             new java.security.PrivilegedAction() {
+             public Object run() {
+--- /dev/null	Tue May 12 12:00:16 2009
++++ openjdk/jdk/src/share/classes/sun/net/ApplicationProxy.java	Tue May 12 12:00:16 2009
+@@ -0,0 +1,43 @@
++/*
++ * Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++
++package sun.net;
++
++import java.net.Proxy;
++import java.net.SocketAddress;
++
++/**
++ * Proxy wrapper class so that we can determine application set
++ * proxies by type.
++ */
++public final class ApplicationProxy extends Proxy {
++    private ApplicationProxy(Proxy proxy) {
++        super(proxy.type(), proxy.address());
++    }
++
++    public static ApplicationProxy create(Proxy proxy) {
++        return new ApplicationProxy(proxy);
++    }
++}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/security/icedtea-6801497.patch	Fri Aug 07 10:05:32 2009 -0400
@@ -0,0 +1,59 @@
+--- old/src/share/classes/java/net/Socket.java	Thu Apr 30 16:27:37 2009
++++ openjdk/jdk/src/share/classes/java/net/Socket.java	Thu Apr 30 16:27:37 2009
+@@ -114,9 +114,14 @@
+      * @since   1.5
+      */
+     public Socket(Proxy proxy) {
+-        if (proxy != null && proxy.type() == Proxy.Type.SOCKS) {
++        // Create a copy of Proxy as a security measure
++        if (proxy == null) {
++            throw new IllegalArgumentException("Invalid Proxy");
++        }
++        Proxy p = proxy == Proxy.NO_PROXY ? Proxy.NO_PROXY : new Proxy(proxy.type(), proxy.address());
++        if (p.type() == Proxy.Type.SOCKS) {
+             SecurityManager security = System.getSecurityManager();
+-            InetSocketAddress epoint = (InetSocketAddress) proxy.address();
++            InetSocketAddress epoint = (InetSocketAddress) p.address();
+             if (security != null) {
+                 if (epoint.isUnresolved())
+                     epoint = new InetSocketAddress(epoint.getHostName(), epoint.getPort());
+@@ -127,10 +132,10 @@
+                     security.checkConnect(epoint.getAddress().getHostAddress(),
+                                           epoint.getPort());
+             }
+-            impl = new SocksSocketImpl(proxy);
++            impl = new SocksSocketImpl(p);
+             impl.setSocket(this);
+         } else {
+-            if (proxy == Proxy.NO_PROXY) {
++            if (p == Proxy.NO_PROXY) {
+                 if (factory == null) {
+                     impl = new PlainSocketImpl();
+                     impl.setSocket(this);
+
+--- old/src/share/classes/java/net/URL.java	Thu Apr 30 16:27:37 2009
++++ openjdk/jdk/src/share/classes/java/net/URL.java	Thu Apr 30 16:27:37 2009
+@@ -998,9 +998,11 @@
+             throw new IllegalArgumentException("proxy can not be null");
+         }
+ 
++        // Create a copy of Proxy as a security measure
++        Proxy p = proxy == Proxy.NO_PROXY ? Proxy.NO_PROXY : new Proxy(proxy.type(), proxy.address());
+         SecurityManager sm = System.getSecurityManager();
+-        if (proxy.type() != Proxy.Type.DIRECT && sm != null) {
+-            InetSocketAddress epoint = (InetSocketAddress) proxy.address();
++        if (p.type() != Proxy.Type.DIRECT && sm != null) {
++            InetSocketAddress epoint = (InetSocketAddress) p.address();
+             if (epoint.isUnresolved())
+                 sm.checkConnect(epoint.getHostName(), epoint.getPort());
+             else
+@@ -1007,7 +1009,7 @@
+                 sm.checkConnect(epoint.getAddress().getHostAddress(),
+                                 epoint.getPort());
+         }
+-        return handler.openConnection(this, proxy);
++        return handler.openConnection(this, p);
+     }
+ 
+     /**
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/security/icedtea-6813167.patch	Fri Aug 07 10:05:32 2009 -0400
@@ -0,0 +1,168806 @@
+--- old/./THIRD_PARTY_README	Thu Jul 30 17:09:00 2009
++++ openjdk/jaxws/./THIRD_PARTY_README	Thu Jul 30 17:08:59 2009
+@@ -32,7 +32,7 @@
+ 
+ --- end of LICENSE file ---
+ %% This notice is provided with respect to ASM, which may be included with this software: 
+-Copyright (c) 2000-2005 INRIA, France Telecom
++Copyright (c) 2000-2007 INRIA, France Telecom
+ All rights reserved.
+ 
+ Redistribution and use in source and binary forms, with or without
+--- old/src/share/classes/com/sun/codemodel/internal/CodeWriter.java	Thu Jul 30 17:09:04 2009
++++ openjdk/jaxws/src/share/classes/com/sun/codemodel/internal/CodeWriter.java	Thu Jul 30 17:09:03 2009
+@@ -35,21 +35,21 @@
+ 
+ /**
+  * Receives generated code and writes to the appropriate storage.
+- * 
++ *
+  * @author
+- * 	Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
++ *      Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+ public abstract class CodeWriter {
+-    
++
+     /**
+      * Called by CodeModel to store the specified file.
+      * The callee must allocate a storage to store the specified file.
+-     * 
++     *
+      * <p>
+      * The returned stream will be closed before the next file is
+      * stored. So the callee can assume that only one OutputStream
+      * is active at any given time.
+-     * 
++     *
+      * @param   pkg
+      *      The package of the file to be written.
+      * @param   fileName
+--- old/src/share/classes/com/sun/codemodel/internal/JAnnotatable.java	Thu Jul 30 17:09:07 2009
++++ openjdk/jaxws/src/share/classes/com/sun/codemodel/internal/JAnnotatable.java	Thu Jul 30 17:09:06 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.codemodel.internal;
+ 
+ import java.lang.annotation.Annotation;
+--- old/src/share/classes/com/sun/codemodel/internal/JAnnotationArrayMember.java	Thu Jul 30 17:09:10 2009
++++ openjdk/jaxws/src/share/classes/com/sun/codemodel/internal/JAnnotationArrayMember.java	Thu Jul 30 17:09:10 2009
+@@ -155,4 +155,3 @@
+         f.nl().o().p('}');
+     }
+ }
+-
+--- old/src/share/classes/com/sun/codemodel/internal/JAnnotationUse.java	Thu Jul 30 17:09:14 2009
++++ openjdk/jaxws/src/share/classes/com/sun/codemodel/internal/JAnnotationUse.java	Thu Jul 30 17:09:13 2009
+@@ -199,8 +199,7 @@
+       *
+       */
+      public JAnnotationUse param(String name, Class value){
+-         addValue(name, new JAnnotationStringValue(JExpr.lit(value.getName())));
+-         return this;
++         return param(name,clazz.owner().ref(value));
+     }
+ 
+     /**
+@@ -289,4 +288,3 @@
+         return memberValues.size()==1 && memberValues.containsKey("value");
+     }
+ }
+-
+--- old/src/share/classes/com/sun/codemodel/internal/JAnnotationWriter.java	Thu Jul 30 17:09:17 2009
++++ openjdk/jaxws/src/share/classes/com/sun/codemodel/internal/JAnnotationWriter.java	Thu Jul 30 17:09:17 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.codemodel.internal;
+ 
+ import java.lang.annotation.Annotation;
+--- old/src/share/classes/com/sun/codemodel/internal/JAnonymousClass.java	Thu Jul 30 17:09:21 2009
++++ openjdk/jaxws/src/share/classes/com/sun/codemodel/internal/JAnonymousClass.java	Thu Jul 30 17:09:20 2009
+@@ -26,9 +26,9 @@
+ 
+ /**
+  * Anonymous class quick hack.
+- * 
++ *
+  * @author
+- * 	Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
++ *      Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+ class JAnonymousClass extends JDefinedClass {
+ 
+@@ -36,13 +36,13 @@
+      * Base interface/class from which this anonymous class is built.
+      */
+     private final JClass base;
+-    
++
+     JAnonymousClass( JClass _base) {
+         super(_base.owner(), 0, null);
+         this.base = _base;
+     }
+-    
++
+     public String fullName() {
+-    	return base.fullName();
++        return base.fullName();
+     }
+ }
+--- old/src/share/classes/com/sun/codemodel/internal/JArray.java	Thu Jul 30 17:09:24 2009
++++ openjdk/jaxws/src/share/classes/com/sun/codemodel/internal/JArray.java	Thu Jul 30 17:09:24 2009
+@@ -54,25 +54,25 @@
+     }
+ 
+     public void generate(JFormatter f) {
+-        
++
+         // generally we produce new T[x], but when T is an array type (T=T'[])
+         // then new T'[][x] is wrong. It has to be new T'[x][].
+         int arrayCount = 0;
+         JType t = type;
+-        
++
+         while( t.isArray() ) {
+             t = t.elementType();
+             arrayCount++;
+         }
+-        
++
+         f.p("new").g(t).p('[');
+         if (size != null)
+             f.g(size);
+         f.p(']');
+-        
++
+         for( int i=0; i<arrayCount; i++ )
+             f.p("[]");
+-        
++
+         if ((size == null) || (exprs != null))
+             f.p('{');
+         if (exprs != null) {
+--- old/src/share/classes/com/sun/codemodel/internal/JArrayClass.java	Thu Jul 30 17:09:28 2009
++++ openjdk/jaxws/src/share/classes/com/sun/codemodel/internal/JArrayClass.java	Thu Jul 30 17:09:27 2009
+@@ -30,26 +30,26 @@
+ 
+ /**
+  * Array class.
+- * 
++ *
+  * @author
+- * 	Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
++ *      Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+ final class JArrayClass extends JClass {
+-    
++
+     // array component type
+     private final JType componentType;
+-    
+-    
++
++
+     JArrayClass( JCodeModel owner, JType component ) {
+         super(owner);
+         this.componentType = component;
+     }
+-    
+-    
++
++
+     public String name() {
+         return componentType.name()+"[]";
+     }
+-    
++
+     public String fullName() {
+         return componentType.fullName()+"[]";
+     }
+@@ -97,10 +97,10 @@
+ 
+     public boolean equals(Object obj) {
+         if(!(obj instanceof JArrayClass))   return false;
+-        
++
+         if( componentType.equals( ((JArrayClass)obj).componentType ) )
+             return true;
+-        
++
+         return false;
+     }
+ 
+@@ -111,11 +111,11 @@
+     protected JClass substituteParams(JTypeVar[] variables, List<JClass> bindings) {
+         if( componentType.isPrimitive() )
+             return this;
+-        
++
+         JClass c = ((JClass)componentType).substituteParams(variables,bindings);
+         if(c==componentType)
+             return this;
+-        
++
+         return new JArrayClass(owner(),c);
+     }
+ 
+--- old/src/share/classes/com/sun/codemodel/internal/JArrayCompRef.java	Thu Jul 30 17:09:31 2009
++++ openjdk/jaxws/src/share/classes/com/sun/codemodel/internal/JArrayCompRef.java	Thu Jul 30 17:09:30 2009
+@@ -63,9 +63,9 @@
+     }
+ 
+     public JExpression assign(JExpression rhs) {
+-		return JExpr.assign(this,rhs);
++                return JExpr.assign(this,rhs);
+     }
+     public JExpression assignPlus(JExpression rhs) {
+-		return JExpr.assignPlus(this,rhs);
++                return JExpr.assignPlus(this,rhs);
+     }
+ }
+--- old/src/share/classes/com/sun/codemodel/internal/JAssignmentTarget.java	Thu Jul 30 17:09:34 2009
++++ openjdk/jaxws/src/share/classes/com/sun/codemodel/internal/JAssignmentTarget.java	Thu Jul 30 17:09:34 2009
+@@ -29,9 +29,9 @@
+ /**
+  * Marker interface for code components that can be placed to
+  * the left of '=' in an assignment.
+- * 
++ *
+  * A left hand value can always be a right hand value, so
+- * this interface derives from {@link JExpression}. 
++ * this interface derives from {@link JExpression}.
+  */
+ public interface JAssignmentTarget extends JGenerable, JExpression {
+     JExpression assign(JExpression rhs);
+--- old/src/share/classes/com/sun/codemodel/internal/JAtom.java	Thu Jul 30 17:09:38 2009
++++ openjdk/jaxws/src/share/classes/com/sun/codemodel/internal/JAtom.java	Thu Jul 30 17:09:37 2009
+@@ -30,13 +30,13 @@
+  * JAtoms: Simple code components that merely generate themselves.
+  */
+ final class JAtom extends JExpressionImpl {
+-    
++
+     private final String what;
+-    
++
+     JAtom(String what) {
+         this.what = what;
+     }
+-    
++
+     public void generate(JFormatter f) {
+         f.p(what);
+     }
+--- old/src/share/classes/com/sun/codemodel/internal/JBlock.java	Thu Jul 30 17:09:41 2009
++++ openjdk/jaxws/src/share/classes/com/sun/codemodel/internal/JBlock.java	Thu Jul 30 17:09:41 2009
+@@ -111,7 +111,15 @@
+         return r;
+     }
+ 
++    /**
++     * Returns true if this block is empty and does not contain
++     * any statement.
++     */
++    public boolean isEmpty() {
++        return content.isEmpty();
++    }
+ 
++
+     /**
+      * Adds a local variable declaration to this block
+      *
+@@ -387,11 +395,11 @@
+ 
+     /**
+      * Creates a "literal" statement directly.
+-     * 
++     *
+      * <p>
+      * Specified string is printed as-is.
+      * This is useful as a short-cut.
+-     * 
++     *
+      * <p>
+      * For example, you can invoke this method as:
+      * <code>directStatement("a=b+c;")</code>.
+--- old/src/share/classes/com/sun/codemodel/internal/JBreak.java	Thu Jul 30 17:09:45 2009
++++ openjdk/jaxws/src/share/classes/com/sun/codemodel/internal/JBreak.java	Thu Jul 30 17:09:44 2009
+@@ -30,12 +30,12 @@
+  * JBreak statement
+  */
+ final class JBreak implements JStatement {
+-    
++
+     private final JLabel label;
+-    
++
+     /**
+      * JBreak constructor
+-     * 
++     *
+      * @param   _label
+      *      break label or null.
+      */
+--- old/src/share/classes/com/sun/codemodel/internal/JCase.java	Thu Jul 30 17:09:48 2009
++++ openjdk/jaxws/src/share/classes/com/sun/codemodel/internal/JCase.java	Thu Jul 30 17:09:48 2009
+@@ -30,7 +30,7 @@
+ public final class JCase implements JStatement {
+ 
+     /**
+-     * label part of the case statement 
++     * label part of the case statement
+      */
+     private JExpression label;
+ 
+@@ -43,7 +43,7 @@
+      * is this a regular case statement or a default case statement?
+      */
+     private boolean isDefaultCase = false;
+-    
++
+     /**
+      * Construct a case statement
+      */
+@@ -59,7 +59,7 @@
+         this.label = label;
+         this.isDefaultCase = isDefaultCase;
+     }
+-    
++
+     public JExpression label() {
+         return label;
+     }
+@@ -76,7 +76,7 @@
+         } else {
+             f.p("default:").nl();
+         }
+-    	if (body != null)
++        if (body != null)
+             f.s(body);
+         f.o();
+     }
+--- old/src/share/classes/com/sun/codemodel/internal/JCast.java	Thu Jul 30 17:09:52 2009
++++ openjdk/jaxws/src/share/classes/com/sun/codemodel/internal/JCast.java	Thu Jul 30 17:09:51 2009
+@@ -42,7 +42,7 @@
+     private final JExpression object;
+ 
+     /**
+-     * JCast constructor 
++     * JCast constructor
+      *
+      * @param type
+      *        JType to which the expression is cast
+--- old/src/share/classes/com/sun/codemodel/internal/JClass.java	Thu Jul 30 17:09:55 2009
++++ openjdk/jaxws/src/share/classes/com/sun/codemodel/internal/JClass.java	Thu Jul 30 17:09:54 2009
+@@ -34,7 +34,7 @@
+ /**
+  * Represents a Java reference type, such as a class, an interface,
+  * an enum, an array type, a parameterized type.
+- * 
++ *
+  * <p>
+  * To be exact, this object represents an "use" of a reference type,
+  * not necessarily a declaration of it, which is modeled as {@link JDefinedClass}.
+@@ -49,13 +49,13 @@
+      * Gets the name of this class.
+      *
+      * @return
+-     *	name of this class, without any qualification.
+-     *	For example, this method returns "String" for
++     *  name of this class, without any qualification.
++     *  For example, this method returns "String" for
+      *  <code>java.lang.String</code>.
+      */
+     abstract public String name();
+-	
+-	/**
++
++        /**
+      * Gets the package to which this class belongs.
+      * TODO: shall we move move this down?
+      */
+@@ -68,14 +68,14 @@
+     public JClass outer() {
+         return null;
+     }
+-	
++
+     private final JCodeModel _owner;
+     /** Gets the JCodeModel object to which this object belongs. */
+     public final JCodeModel owner() { return _owner; }
+-    
++
+     /**
+      * Gets the super class of this class.
+-     * 
++     *
+      * @return
+      *      Returns the JClass representing the superclass of the
+      *      entity (class or interface) represented by this {@link JClass}.
+@@ -85,23 +85,23 @@
+      *      If this JClass represents {@link Object}, return null.
+      */
+     abstract public JClass _extends();
+-    
++
+     /**
+      * Iterates all super interfaces directly implemented by
+      * this class/interface.
+-     * 
++     *
+      * @return
+-     *		A non-null valid iterator that iterates all
+-     *		{@link JClass} objects that represents those interfaces
+-     *		implemented by this object.
++     *          A non-null valid iterator that iterates all
++     *          {@link JClass} objects that represents those interfaces
++     *          implemented by this object.
+      */
+     abstract public Iterator<JClass> _implements();
+-    
++
+     /**
+      * Iterates all the type parameters of this class/interface.
+-     * 
++     *
+      * <p>
+-     * For example, if this {@link JClass} represents 
++     * For example, if this {@link JClass} represents
+      * <code>Set&lt;T></code>, this method returns an array
+      * that contains single {@link JTypeVar} for 'T'.
+      */
+@@ -155,20 +155,20 @@
+      */
+     public final boolean isAssignableFrom( JClass derived ) {
+         // to avoid the confusion, always use "this" explicitly in this method.
+-        
++
+         // null can be assigned to any type.
+         if( derived instanceof JNullType )  return true;
+-        
++
+         if( this==derived )     return true;
+-        
++
+         // the only class that is assignable from an interface is
+         // java.lang.Object
+         if( this==_package().owner().ref(Object.class) )  return true;
+-        
++
+         JClass b = derived._extends();
+         if( b!=null && this.isAssignableFrom(b) )
+             return true;
+-        
++
+         if( this.isInterface() ) {
+             Iterator itfs = derived._implements();
+             while( itfs.hasNext() )
+@@ -175,7 +175,7 @@
+                 if( this.isAssignableFrom((JClass)itfs.next()) )
+                     return true;
+         }
+-        
++
+         return false;
+     }
+ 
+@@ -239,7 +239,7 @@
+     /**
+      * "Narrows" a generic class to a concrete class by specifying
+      * a type argument.
+-     * 
++     *
+      * <p>
+      * <code>.narrow(X)</code> builds <code>Set&lt;X></code> from <code>Set</code>.
+      */
+@@ -257,7 +257,7 @@
+     /**
+      * "Narrows" a generic class to a concrete class by specifying
+      * a type argument.
+-     * 
++     *
+      * <p>
+      * <code>.narrow(X)</code> builds <code>Set&lt;X></code> from <code>Set</code>.
+      */
+@@ -298,18 +298,18 @@
+ 
+     /**
+      * Substitutes the type variables with their actual arguments.
+-     * 
++     *
+      * <p>
+      * For example, when this class is Map&lt;String,Map&lt;V>>,
+      * (where V then doing
+      * substituteParams( V, Integer ) returns a {@link JClass}
+      * for <code>Map&lt;String,Map&lt;Integer>></code>.
+-     * 
++     *
+      * <p>
+      * This method needs to work recursively.
+      */
+     protected abstract JClass substituteParams( JTypeVar[] variables, List<JClass> bindings );
+-    
++
+     public String toString() {
+         return this.getClass().getName() + '(' + name() + ')';
+     }
+@@ -323,12 +323,12 @@
+     public final JInvocation staticInvoke(JMethod method) {
+         return new JInvocation(this,method);
+     }
+-    
++
+     /** Generates a static method invocation. */
+     public final JInvocation staticInvoke(String method) {
+         return new JInvocation(this,method);
+     }
+-    
++
+     /** Static field reference. */
+     public final JFieldRef staticRef(String field) {
+         return new JFieldRef(this, field);
+--- old/src/share/classes/com/sun/codemodel/internal/JClassAlreadyExistsException.java	Thu Jul 30 17:09:59 2009
++++ openjdk/jaxws/src/share/classes/com/sun/codemodel/internal/JClassAlreadyExistsException.java	Thu Jul 30 17:09:58 2009
+@@ -26,20 +26,20 @@
+ 
+ /**
+  * Indicates that the class is already created.
+- * 
++ *
+  * @author
+- * 	Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
++ *      Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+ public class JClassAlreadyExistsException extends Exception {
+     private final JDefinedClass existing;
+-    
++
+     public JClassAlreadyExistsException( JDefinedClass _existing ) {
+         this.existing = _existing;
+     }
+-    
++
+     /**
+      * Gets a reference to the existing {@link JDefinedClass}.
+-     * 
++     *
+      * @return
+      *      This method always return non-null valid object.
+      */
+--- old/src/share/classes/com/sun/codemodel/internal/JClassContainer.java	Thu Jul 30 17:10:02 2009
++++ openjdk/jaxws/src/share/classes/com/sun/codemodel/internal/JClassContainer.java	Thu Jul 30 17:10:01 2009
+@@ -30,7 +30,7 @@
+  * The common aspect of a package and a class.
+  */
+ public interface JClassContainer {
+-    
++
+     /**
+      * Returns true if the container is a class.
+      */
+@@ -39,7 +39,7 @@
+      * Returns true if the container is a package.
+      */
+     boolean isPackage();
+-    
++
+     /**
+      * Add a new class to this package/class.
+      *
+@@ -50,15 +50,15 @@
+      *        Name of class to be added to this package
+      *
+      * @return Newly generated class
+-     * 
++     *
+      * @exception JClassAlreadyExistsException
+      *      When the specified class/interface was already created.
+      */
+     JDefinedClass _class(int mods, String name) throws JClassAlreadyExistsException;
+-    
++
+     /**
+      * Add a new public class to this class/package.
+-     * 
++     *
+      * @exception JClassAlreadyExistsException
+      *      When the specified class/interface was already created.
+      */
+@@ -74,7 +74,7 @@
+      *        Name of interface to be added to this package
+      *
+      * @return Newly generated interface
+-     * 
++     *
+      * @exception JClassAlreadyExistsException
+      *      When the specified class/interface was already created.
+      */
+@@ -82,7 +82,7 @@
+ 
+     /**
+      * Adds a public interface to this package.
+-     * 
++     *
+      * @exception JClassAlreadyExistsException
+      *      When the specified class/interface was already created.
+      */
+@@ -92,7 +92,7 @@
+      * Create a new class or a new interface.
+      *
+      * @deprecated
+-     *      use {@link #_class(int, String, ClassType)} 
++     *      use {@link #_class(int, String, ClassType)}
+      */
+     public JDefinedClass _class(int mods, String name, boolean isInterface )
+         throws JClassAlreadyExistsException;
+@@ -109,16 +109,16 @@
+      * class.
+      */
+     public Iterator<JDefinedClass> classes();
+-    
++
+     /**
+      * Parent JClassContainer.
+-     * 
++     *
+      * If this is a package, this method returns a parent package,
+      * or null if this package is the root package.
+-     * 
++     *
+      * If this is an outer-most class, this method returns a package
+      * to which it belongs.
+-     * 
++     *
+      * If this is an inner class, this method returns the outer
+      * class.
+      */
+@@ -136,7 +136,7 @@
+      * Get the root code model object.
+      */
+     public JCodeModel owner();
+-    
++
+     /**
+      * Add an annotationType Declaration to this package
+      * @param name
+@@ -145,10 +145,10 @@
+      *      newly created Annotation Type Declaration
+      * @exception JClassAlreadyExistsException
+      *      When the specified class/interface was already created.
+-     
++
+      */
+     public JDefinedClass _annotationTypeDeclaration(String name) throws JClassAlreadyExistsException;
+-    
++
+     /**
+      * Add a public enum to this package
+      * @param name
+@@ -157,8 +157,8 @@
+      *      newly created Enum
+      * @exception JClassAlreadyExistsException
+      *      When the specified class/interface was already created.
+-     
++
+      */
+     public JDefinedClass _enum (String name) throws JClassAlreadyExistsException;
+-    
++
+ }
+--- old/src/share/classes/com/sun/codemodel/internal/JCodeModel.java	Thu Jul 30 17:10:05 2009
++++ openjdk/jaxws/src/share/classes/com/sun/codemodel/internal/JCodeModel.java	Thu Jul 30 17:10:05 2009
+@@ -78,17 +78,17 @@
+  * See {@link #_class(String, ClassType)}.
+  */
+ public final class JCodeModel {
+-    
++
+     /** The packages that this JCodeWriter contains. */
+     private HashMap<String,JPackage> packages = new HashMap<String,JPackage>();
+-    
++
+     /** All JReferencedClasses are pooled here. */
+     private final HashMap<Class,JReferencedClass> refClasses = new HashMap<Class,JReferencedClass>();
+ 
+-    
++
+     /** Obtains a reference to the special "null" type. */
+     public final JNullType NULL = new JNullType(this);
+-    // primitive types 
++    // primitive types
+     public final JPrimitiveType VOID    = new JPrimitiveType(this,"void",   Void.class);
+     public final JPrimitiveType BOOLEAN = new JPrimitiveType(this,"boolean",Boolean.class);
+     public final JPrimitiveType BYTE    = new JPrimitiveType(this,"byte",   Byte.class);
+@@ -98,13 +98,13 @@
+     public final JPrimitiveType FLOAT   = new JPrimitiveType(this,"float",  Float.class);
+     public final JPrimitiveType LONG    = new JPrimitiveType(this,"long",   Long.class);
+     public final JPrimitiveType DOUBLE  = new JPrimitiveType(this,"double", Double.class);
+-    
++
+     /**
+      * If the flag is true, we will consider two classes "Foo" and "foo"
+      * as a collision.
+      */
+     protected static final boolean isCaseSensitiveFileSystem = getFileSystemCaseSensitivity();
+-    
++
+     private static boolean getFileSystemCaseSensitivity() {
+         try {
+             // let the system property override, in case the user really
+@@ -112,7 +112,7 @@
+             if( System.getProperty("com.sun.codemodel.internal.FileSystemCaseSensitive")!=null )
+                 return true;
+         } catch( Exception e ) {}
+-        
++
+         // on Unix, it's case sensitive.
+         return (File.separatorChar == '/');
+     }
+@@ -119,7 +119,7 @@
+ 
+ 
+     public JCodeModel() {}
+-    
++
+     /**
+      * Add a package to the list of packages to be generated
+      *
+@@ -136,7 +136,7 @@
+         }
+         return p;
+     }
+-    
++
+     public final JPackage rootPackage() {
+         return _package("");
+     }
+@@ -148,10 +148,10 @@
+     public Iterator<JPackage> packages() {
+         return packages.values().iterator();
+     }
+-    
++
+     /**
+      * Creates a new generated class.
+-     * 
++     *
+      * @exception JClassAlreadyExistsException
+      *      When the specified class/interface was already created.
+      */
+@@ -186,7 +186,7 @@
+ 
+     /**
+      * Gets a reference to the already created generated class.
+-     * 
++     *
+      * @return null
+      *      If the class is not yet created.
+      * @see JPackage#_getClass(String)
+@@ -201,7 +201,7 @@
+ 
+     /**
+      * Creates a new anonymous class.
+-     * 
++     *
+      * @deprecated
+      *      The naming convention doesn't match the rest of the CodeModel.
+      *      Use {@link #anonymousClass(JClass)} instead.
+@@ -220,13 +220,13 @@
+     public JDefinedClass anonymousClass(Class baseType) {
+         return anonymousClass(ref(baseType));
+     }
+-    
++
+     /**
+      * Generates Java source code.
+      * A convenience method for <code>build(destDir,destDir,System.out)</code>.
+-     * 
+-     * @param	destDir
+-     *		source files are generated into this directory.
++     *
++     * @param   destDir
++     *          source files are generated into this directory.
+      * @param   status
+      *      if non-null, progress indication will be sent to this stream.
+      */
+@@ -238,10 +238,10 @@
+      * Generates Java source code.
+      * A convenience method that calls {@link #build(CodeWriter,CodeWriter)}.
+      *
+-     * @param	srcDir
+-     *		Java source files are generated into this directory.
+-     * @param	resourceDir
+-     *		Other resource files are generated into this directory.
++     * @param   srcDir
++     *          Java source files are generated into this directory.
++     * @param   resourceDir
++     *          Other resource files are generated into this directory.
+      * @param   status
+      *      if non-null, progress indication will be sent to this stream.
+      */
+@@ -275,7 +275,7 @@
+     public void build( CodeWriter out ) throws IOException {
+         build(out,out);
+     }
+-    
++
+     /**
+      * Generates Java source code.
+      */
+@@ -301,7 +301,7 @@
+         return r;
+     }
+ 
+-	
++
+     /**
+      * Obtains a reference to an existing class from its Class object.
+      *
+@@ -511,11 +511,11 @@
+ 
+     /**
+      * References to existing classes.
+-     * 
++     *
+      * <p>
+      * JReferencedClass is kept in a pool so that they are shared.
+      * There is one pool for each JCodeModel object.
+-     * 
++     *
+      * <p>
+      * It is impossible to cache JReferencedClass globally only because
+      * there is the _package() method, which obtains the owner JPackage
+--- old/src/share/classes/com/sun/codemodel/internal/JCommentPart.java	Thu Jul 30 17:10:09 2009
++++ openjdk/jaxws/src/share/classes/com/sun/codemodel/internal/JCommentPart.java	Thu Jul 30 17:10:08 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.codemodel.internal;
+ 
+ import java.util.ArrayList;
+@@ -77,7 +78,8 @@
+      */
+     protected void format( JFormatter f, String indent ) {
+         if(!f.isPrinting()) {
+-            // quickly pass the types to JFormatter
++            // quickly pass the types to JFormatter, as that's all we care.
++            // we don't need to worry about the exact formatting of text.
+             for( Object o : this )
+                 if(o instanceof JClass)
+                     f.g((JClass)o);
+@@ -97,12 +99,12 @@
+                 while( (idx=s.indexOf('\n'))!=-1 ) {
+                     String line = s.substring(0,idx);
+                     if(line.length()>0)
+-                        f.p(line);
++                        f.p(escape(line));
+                     s = s.substring(idx+1);
+                     f.nl().p(indent);
+                 }
+                 if(s.length()!=0)
+-                    f.p(s);
++                    f.p(escape(s));
+             } else
+             if(o instanceof JClass) {
+                 // TODO: this doesn't print the parameterized type properly
+@@ -117,4 +119,16 @@
+         if(!isEmpty())
+             f.nl();
+     }
++
++    /**
++     * Escapes the appearance of the comment terminator.
++     */
++    private String escape(String s) {
++        while(true) {
++            int idx = s.indexOf("*/");
++            if(idx <0)   return s;
++
++            s = s.substring(0,idx+1)+"<!---->"+s.substring(idx+1);
++        }
++    }
+ }
+--- old/src/share/classes/com/sun/codemodel/internal/JContinue.java	Thu Jul 30 17:10:12 2009
++++ openjdk/jaxws/src/share/classes/com/sun/codemodel/internal/JContinue.java	Thu Jul 30 17:10:12 2009
+@@ -30,12 +30,12 @@
+  * JContinue statement
+  */
+ class JContinue implements JStatement {
+-    
++
+     private final JLabel label;
+-    
++
+     /**
+      * JContinue constructor.
+-     * 
++     *
+      * @param _label
+      *      a valid label or null.
+      */
+--- old/src/share/classes/com/sun/codemodel/internal/JDefinedClass.java	Thu Jul 30 17:10:16 2009
++++ openjdk/jaxws/src/share/classes/com/sun/codemodel/internal/JDefinedClass.java	Thu Jul 30 17:10:15 2009
+@@ -56,7 +56,7 @@
+     /** Name of this class. Null if anonymous. */
+     private String name = null;
+ 
+-    
++
+     /** Modifiers for the class declaration */
+     private JMods mods;
+ 
+@@ -95,7 +95,7 @@
+ 
+     /**
+      * Flag that controls whether this class should be really generated or not.
+-     * 
++     *
+      * Sometimes it is useful to generate code that refers to class X,
+      * without actually generating the code of X.
+      * This flag is used to surpress X.java file in the output.
+@@ -120,19 +120,19 @@
+      */
+     private JClassContainer outer = null;
+ 
+-    
++
+     /** Default value is class or interface
+      *  or annotationTypeDeclaration
+      *  or enum
+-     * 
++     *
+      */
+     private final ClassType classType;
+-    
++
+     /** List containing the enum value declarations
+-     *  
++     *
+      */
+ //    private List enumValues = new ArrayList();
+-    
++
+     /**
+      * Set of enum constants that are keyed by names.
+      * In Java, enum constant order is actually significant,
+@@ -168,13 +168,13 @@
+         String name) {
+         this(mods, name, null, owner);
+     }
+-    
++
+     private JDefinedClass(
+             int mods,
+             String name,
+             JClassContainer parent,
+             JCodeModel owner) {
+-    	this (mods,name,parent,owner,ClassType.CLASS);
++        this (mods,name,parent,owner,ClassType.CLASS);
+     }
+ 
+     /**
+@@ -191,13 +191,13 @@
+         String name,
+         JClassContainer parent,
+         JCodeModel owner,
+-		ClassType classTypeVal) {
++                ClassType classTypeVal) {
+         super(owner);
+ 
+         if(name!=null) {
+             if (name.trim().length() == 0)
+                 throw new IllegalArgumentException("JClass name empty");
+-    
++
+             if (!Character.isJavaIdentifierStart(name.charAt(0))) {
+                 String msg =
+                     "JClass name "
+@@ -250,7 +250,7 @@
+             throw new IllegalArgumentException("unable to set the super class for an interface");
+         if (superClass == null)
+             throw new NullPointerException();
+-        
++
+         for( JClass o=superClass.outer(); o!=null; o=o.outer() ){
+             if(this==o){
+                 throw new IllegalArgumentException("Illegal class inheritance loop." +
+@@ -257,7 +257,7 @@
+                 "  Outer class " + this.name + " may not subclass from inner class: " + o.name());
+             }
+         }
+-        
++
+         this.superClass = superClass;
+         return this;
+     }
+@@ -302,7 +302,7 @@
+ 
+     /**
+      * JClass name accessor.
+-     * 
++     *
+      * <p>
+      * For example, for <code>java.util.List</code>, this method
+      * returns <code>"List"</code>"
+@@ -312,7 +312,7 @@
+     public String name() {
+         return name;
+     }
+-    
++
+     /**
+      * If the named enum already exists, the reference to it is returned.
+      * Otherwise this method generates a new enum reference with the given
+@@ -319,7 +319,7 @@
+      * name and returns it.
+      *
+      * @param name
+-     *  	The name of the constant.
++     *          The name of the constant.
+      * @return
+      *      The generated type-safe enum constant.
+      */
+@@ -416,8 +416,8 @@
+      */
+     public boolean isAnnotationTypeDeclaration() {
+         return this.classType==ClassType.ANNOTATION_TYPE_DECL;
+-        
+ 
++
+     }
+ 
+     /**
+@@ -428,12 +428,12 @@
+      *      newly created Annotation Type Declaration
+      * @exception JClassAlreadyExistsException
+      *      When the specified class/interface was already created.
+-     
++
+      */
+     public JDefinedClass _annotationTypeDeclaration(String name) throws JClassAlreadyExistsException {
+-    	return _class (JMod.PUBLIC,name,ClassType.ANNOTATION_TYPE_DECL);
++        return _class (JMod.PUBLIC,name,ClassType.ANNOTATION_TYPE_DECL);
+     }
+-   
++
+     /**
+      * Add a public enum to this package
+      * @param name
+@@ -442,36 +442,36 @@
+      *      newly created Enum
+      * @exception JClassAlreadyExistsException
+      *      When the specified class/interface was already created.
+-     
++
+      */
+     public JDefinedClass _enum (String name) throws JClassAlreadyExistsException {
+-    	return _class (JMod.PUBLIC,name,ClassType.ENUM);
++        return _class (JMod.PUBLIC,name,ClassType.ENUM);
+     }
+-    
++
+     /**
+      * Add a public enum to this package
+      * @param name
+      *      Name of the enum to be added to this package
+      * @param mods
+-     * 		Modifiers for this enum declaration
++     *          Modifiers for this enum declaration
+      * @return
+      *      newly created Enum
+      * @exception JClassAlreadyExistsException
+      *      When the specified class/interface was already created.
+-     
++
+      */
+     public JDefinedClass _enum (int mods,String name) throws JClassAlreadyExistsException {
+-    	return _class (mods,name,ClassType.ENUM);
++        return _class (mods,name,ClassType.ENUM);
+     }
+-    
+-    
+ 
+-    
+ 
++
++
++
+     public ClassType getClassType(){
+         return this.classType;
+     }
+-    
++
+     public JFieldVar field(
+         int mods,
+         Class type,
+@@ -494,7 +494,7 @@
+      * Removes a {@link JFieldVar} from this class.
+      *
+      * @throws IllegalArgumentException
+-     *      if the given field is not a field on this class. 
++     *      if the given field is not a field on this class.
+      */
+     public void removeField(JFieldVar field) {
+         if(fields.remove(field.name())!=field)
+@@ -535,7 +535,7 @@
+     /**
+      * Looks for a method that has the specified method signature
+      * and return it.
+-     * 
++     *
+      * @return
+      *      null if not found.
+      */
+@@ -582,7 +582,7 @@
+     /**
+      * Looks for a method that has the specified method signature
+      * and return it.
+-     * 
++     *
+      * @return
+      *      null if not found.
+      */
+@@ -627,7 +627,7 @@
+      * @deprecated
+      */
+     public JDefinedClass _class(int mods, String name, boolean isInterface) throws JClassAlreadyExistsException {
+-    	return _class(mods,name,isInterface?ClassType.INTERFACE:ClassType.CLASS);
++        return _class(mods,name,isInterface?ClassType.INTERFACE:ClassType.CLASS);
+     }
+ 
+     public JDefinedClass _class(int mods, String name, ClassType classTypeVal)
+@@ -696,7 +696,7 @@
+     /**
+      * Mark this file as hidden, so that this file won't be
+      * generated.
+-     * 
++     *
+      * <p>
+      * This feature could be used to generate code that refers
+      * to class X, without actually generating X.java.
+@@ -782,7 +782,7 @@
+                 f.d(c);
+                 first = false;
+             }
+-        	f.p(';').nl();
++                f.p(';').nl();
+         }
+ 
+         for( JFieldVar field : fields.values() )
+@@ -799,7 +799,7 @@
+             for (JDefinedClass dc : classes.values())
+                 f.nl().d(dc);
+ 
+-        
++
+         if (directBlock != null)
+             f.p(directBlock);
+         f.nl().o().p('}').nl();
+@@ -807,7 +807,7 @@
+ 
+     /**
+      * Places the given string directly inside the generated class.
+-     * 
++     *
+      * This method can be used to add methods/fields that are not
+      * generated by CodeModel.
+      * This method should be used only as the last resort.
+--- old/src/share/classes/com/sun/codemodel/internal/JDirectClass.java	Thu Jul 30 17:10:19 2009
++++ openjdk/jaxws/src/share/classes/com/sun/codemodel/internal/JDirectClass.java	Thu Jul 30 17:10:19 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.codemodel.internal;
+ 
+ import java.util.Iterator;
+@@ -32,7 +33,7 @@
+  * A special {@link JClass} that represents an unknown class (except its name.)
+  *
+  * @author Kohsuke Kawaguchi
+- * @see JCodeModel#directClass(String) 
++ * @see JCodeModel#directClass(String)
+  */
+ final class JDirectClass extends JClass {
+ 
+--- old/src/share/classes/com/sun/codemodel/internal/JDocComment.java	Thu Jul 30 17:10:23 2009
++++ openjdk/jaxws/src/share/classes/com/sun/codemodel/internal/JDocComment.java	Thu Jul 30 17:10:22 2009
+@@ -42,18 +42,18 @@
+ 
+     /** list of @param tags */
+     private final Map<String,JCommentPart> atParams = new HashMap<String,JCommentPart>();
+-    
++
+     /** list of xdoclets */
+     private final Map<String,Map<String,String>> atXdoclets = new HashMap<String,Map<String,String>>();
+-    
++
+     /** list of @throws tags */
+     private final Map<JClass,JCommentPart> atThrows = new HashMap<JClass,JCommentPart>();
+-    
++
+     /**
+      * The @return tag part.
+      */
+     private JCommentPart atReturn = null;
+-    
++
+     /** The @deprecated tag */
+     private JCommentPart atDeprecated = null;
+ 
+@@ -93,7 +93,7 @@
+     public JCommentPart addThrows( Class exception ) {
+         return addThrows( owner.ref(exception) );
+     }
+-    
++
+     /**
+      * add an @throws tag to the javadoc
+      */
+@@ -103,7 +103,7 @@
+             atThrows.put(exception,p=new JCommentPart());
+         return p;
+     }
+-    
++
+     /**
+      * Appends a text to @return tag.
+      */
+@@ -193,4 +193,3 @@
+ 
+     private static final String INDENT = " *     ";
+ }
+-
+--- old/src/share/classes/com/sun/codemodel/internal/JEnumConstant.java	Thu Jul 30 17:10:26 2009
++++ openjdk/jaxws/src/share/classes/com/sun/codemodel/internal/JEnumConstant.java	Thu Jul 30 17:10:26 2009
+@@ -88,7 +88,7 @@
+      * @return never null.
+      */
+     public String getName() {
+-    	return this.type.fullName().concat(".").concat(this.name);
++        return this.type.fullName().concat(".").concat(this.name);
+     }
+ 
+     /**
+@@ -143,6 +143,6 @@
+     }
+ 
+     public void generate(JFormatter f) {
+-    	f.t(type).p('.').p(name);
++        f.t(type).p('.').p(name);
+     }
+ }
+--- old/src/share/classes/com/sun/codemodel/internal/JExpr.java	Thu Jul 30 17:10:30 2009
++++ openjdk/jaxws/src/share/classes/com/sun/codemodel/internal/JExpr.java	Thu Jul 30 17:10:29 2009
+@@ -51,11 +51,11 @@
+     public static JInvocation _new(JType t) {
+         return new JInvocation(t);
+     }
+-    
++
+     public static JInvocation invoke(String method) {
+         return new JInvocation((JExpression)null, method);
+     }
+-    
++
+     public static JInvocation invoke(JMethod method) {
+         return new JInvocation((JExpression)null,method);
+     }
+@@ -129,8 +129,8 @@
+     public static JArray newArray(JType type, int size) {
+         return newArray(type,lit(size));
+     }
+-    
+-    
++
++
+     private static final JExpression __this = new JAtom("this");
+     /**
+      * Returns a reference to "this", an implicit reference
+@@ -144,8 +144,8 @@
+      * to the super class.
+      */
+     public static JExpression _super() { return __super; }
+-    
+-    
++
++
+     /* -- Literals -- */
+ 
+     private static final JExpression __null = new JAtom("null");
+@@ -152,12 +152,12 @@
+     public static JExpression _null() {
+         return __null;
+     }
+-    
++
+     /**
+      * Boolean constant that represents <code>true</code>
+      */
+     public static final JExpression TRUE = new JAtom("true");
+-    
++
+     /**
+      * Boolean constant that represents <code>false</code>
+      */
+@@ -166,7 +166,7 @@
+     public static JExpression lit(boolean b) {
+         return b?TRUE:FALSE;
+     }
+-    
++
+     public static JExpression lit(int n) {
+         return new JAtom(Integer.toString(n));
+     }
+@@ -185,10 +185,10 @@
+ 
+     static final String charEscape = "\b\t\n\f\r\"\'\\";
+     static final String charMacro  = "btnfr\"'\\";
+-    
++
+     /**
+      * Escapes the given string, then surrounds it by the specified
+-     * quotation mark. 
++     * quotation mark.
+      */
+     public static String quotify(char quote, String s) {
+         int n = s.length();
+@@ -198,17 +198,21 @@
+             char c = s.charAt(i);
+             int j = charEscape.indexOf(c);
+             if(j>=0) {
+-                sb.append('\\');
+-                sb.append(charMacro.charAt(j));
++                if((quote=='"' && c=='\'') || (quote=='\'' && c=='"')) {
++                    sb.append(c);
++                } else {
++                    sb.append('\\');
++                    sb.append(charMacro.charAt(j));
++                }
+             } else {
+                 // technically Unicode escape shouldn't be done here,
+                 // for it's a lexical level handling.
+-                // 
++                //
+                 // However, various tools are so broken around this area,
+                 // so just to be on the safe side, it's better to do
+                 // the escaping here (regardless of the actual file encoding)
+                 //
+-                // see bug 
++                // see bug
+                 if( c<0x20 || 0x7E<c ) {
+                     // not printable. use Unicode escape
+                     sb.append("\\u");
+@@ -232,15 +236,15 @@
+     public static JExpression lit(String s) {
+         return new JStringLiteral(s);
+     }
+-    
++
+     /**
+      * Creates an expression directly from a source code fragment.
+-     * 
++     *
+      * <p>
+      * This method can be used as a short-cut to create a JExpression.
+      * For example, instead of <code>_a.gt(_b)</code>, you can write
+      * it as: <code>JExpr.direct("a>b")</code>.
+-     * 
++     *
+      * <p>
+      * Be warned that there is a danger in using this method,
+      * as it obfuscates the object model.
+@@ -253,4 +257,3 @@
+         };
+     }
+ }
+-
+--- old/src/share/classes/com/sun/codemodel/internal/JFieldVar.java	Thu Jul 30 17:10:33 2009
++++ openjdk/jaxws/src/share/classes/com/sun/codemodel/internal/JFieldVar.java	Thu Jul 30 17:10:32 2009
+@@ -76,7 +76,7 @@
+      * @return JDocComment containing javadocs for this class
+      */
+     public JDocComment javadoc() {
+-        if( jdoc == null ) 
++        if( jdoc == null )
+             jdoc = new JDocComment(owner.owner());
+         return jdoc;
+     }
+@@ -87,6 +87,5 @@
+         super.declare( f );
+     }
+ 
+-   
+-}
+ 
++}
+--- old/src/share/classes/com/sun/codemodel/internal/JForEach.java	Thu Jul 30 17:10:40 2009
++++ openjdk/jaxws/src/share/classes/com/sun/codemodel/internal/JForEach.java	Thu Jul 30 17:10:40 2009
+@@ -33,17 +33,17 @@
+  */
+ public final class JForEach implements JStatement {
+ 
+-	private final JType type;
+-	private final String var;
+-	private JBlock body = null; // lazily created
+-	private final JExpression collection;
++        private final JType type;
++        private final String var;
++        private JBlock body = null; // lazily created
++        private final JExpression collection;
+     private final JVar loopVar;
+ 
+-	public JForEach(JType vartype, String variable, JExpression collection) {
++        public JForEach(JType vartype, String variable, JExpression collection) {
+ 
+-		this.type = vartype;
+-		this.var = variable;
+-		this.collection = collection;
++                this.type = vartype;
++                this.var = variable;
++                this.collection = collection;
+         loopVar = new JVar(JMods.forVar(JMod.NONE), type, var, collection);
+     }
+ 
+@@ -51,24 +51,24 @@
+     /**
+      * Returns a reference to the loop variable.
+      */
+-	public JVar var() {
+-		return loopVar;
+-	}
++        public JVar var() {
++                return loopVar;
++        }
+ 
+-	public JBlock body() {
+-		if (body == null)
+-			body = new JBlock();
+-		return body;
+-	}
++        public JBlock body() {
++                if (body == null)
++                        body = new JBlock();
++                return body;
++        }
+ 
+-	public void state(JFormatter f) {
+-		f.p("for (");
+-		f.g(type).id(var).p(": ").g(collection);
+-		f.p(')');
+-		if (body != null)
+-			f.g(body).nl();
+-		else
+-			f.p(';').nl();
+-	}
++        public void state(JFormatter f) {
++                f.p("for (");
++                f.g(type).id(var).p(": ").g(collection);
++                f.p(')');
++                if (body != null)
++                        f.g(body).nl();
++                else
++                        f.p(';').nl();
++        }
+ 
+ }
+--- old/src/share/classes/com/sun/codemodel/internal/JForLoop.java	Thu Jul 30 17:10:44 2009
++++ openjdk/jaxws/src/share/classes/com/sun/codemodel/internal/JForLoop.java	Thu Jul 30 17:10:43 2009
+@@ -34,39 +34,39 @@
+  */
+ 
+ public class JForLoop implements JStatement {
+-    
++
+     private List<Object> inits = new ArrayList<Object>();
+     private JExpression test = null;
+     private List<JExpression> updates = new ArrayList<JExpression>();
+     private JBlock body = null;
+-    
++
+     public JVar init(int mods, JType type, String var, JExpression e) {
+         JVar v = new JVar(JMods.forVar(mods), type, var, e);
+         inits.add(v);
+         return v;
+     }
+-    
++
+     public JVar init(JType type, String var, JExpression e) {
+         return init(JMod.NONE, type, var, e);
+     }
+-    
++
+     public void init(JVar v, JExpression e) {
+         inits.add(JExpr.assign(v, e));
+     }
+-    
++
+     public void test(JExpression e) {
+         this.test = e;
+     }
+-    
++
+     public void update(JExpression e) {
+         updates.add(e);
+     }
+-    
++
+     public JBlock body() {
+         if (body == null) body = new JBlock();
+         return body;
+     }
+-    
++
+     public void state(JFormatter f) {
+         f.p("for (");
+         boolean first = true;
+@@ -84,5 +84,5 @@
+         else
+             f.p(';').nl();
+     }
+-    
++
+ }
+--- old/src/share/classes/com/sun/codemodel/internal/JFormatter.java	Thu Jul 30 17:10:47 2009
++++ openjdk/jaxws/src/share/classes/com/sun/codemodel/internal/JFormatter.java	Thu Jul 30 17:10:47 2009
+@@ -114,7 +114,7 @@
+     public JFormatter(Writer w) {
+         this(new PrintWriter(w));
+     }
+-    
++
+     /**
+      * Closes this formatter.
+      */
+@@ -445,8 +445,8 @@
+         final String packageName = clazz._package().name();
+         if(packageName.equals("java.lang"))
+             return true;    // no need to explicitly import java.lang classes
+-    
+-        if (clazz._package() == c._package()){ 
++
++        if (clazz._package() == c._package()){
+             // inner classes require an import stmt.
+             // All other pkg local classes do not need an
+             // import stmt for ref.
+--- old/src/share/classes/com/sun/codemodel/internal/JGenerifiable.java	Thu Jul 30 17:10:51 2009
++++ openjdk/jaxws/src/share/classes/com/sun/codemodel/internal/JGenerifiable.java	Thu Jul 30 17:10:50 2009
+@@ -26,9 +26,9 @@
+ 
+ /**
+  * Declarations that can have type variables.
+- * 
++ *
+  * Something that can be made into a generic.
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+@@ -37,17 +37,17 @@
+      * Adds a new type variable to this declaration.
+      */
+     JTypeVar generify( String name );
+-    
++
+     /**
+      * Adds a new type variable to this declaration with a bound.
+      */
+     JTypeVar generify( String name, Class bound );
+-    
++
+     /**
+      * Adds a new type variable to this declaration with a bound.
+      */
+     JTypeVar generify( String name, JClass bound );
+-    
++
+     /**
+      * Iterates all the type parameters of this class/interface.
+      */
+--- old/src/share/classes/com/sun/codemodel/internal/JGenerifiableImpl.java	Thu Jul 30 17:10:54 2009
++++ openjdk/jaxws/src/share/classes/com/sun/codemodel/internal/JGenerifiableImpl.java	Thu Jul 30 17:10:53 2009
+@@ -29,17 +29,17 @@
+ 
+ /**
+  * Implementation of {@link JGenerifiable}.
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+ abstract class JGenerifiableImpl implements JGenerifiable, JDeclaration {
+-    
++
+     /** Lazily created list of {@link JTypeVar}s. */
+     private List<JTypeVar> typeVariables = null;
+-    
++
+     protected abstract JCodeModel owner();
+-    
++
+     public void declare( JFormatter f ) {
+         if(typeVariables!=null) {
+             f.p('<');
+@@ -67,7 +67,7 @@
+     public JTypeVar generify(String name, JClass bound) {
+         return generify(name).bound(bound);
+     }
+-    
++
+     public JTypeVar[] typeParams() {
+         if(typeVariables==null)
+             return JTypeVar.EMPTY_ARRAY;
+--- old/src/share/classes/com/sun/codemodel/internal/JInvocation.java	Thu Jul 30 17:10:57 2009
++++ openjdk/jaxws/src/share/classes/com/sun/codemodel/internal/JInvocation.java	Thu Jul 30 17:10:57 2009
+@@ -80,7 +80,7 @@
+     JInvocation(JExpression object, JMethod method) {
+         this( (JGenerable)object, method );
+     }
+-    
++
+     /**
+      * Invokes a static method on a class.
+      */
+@@ -107,7 +107,7 @@
+     /**
+      * Invokes a constructor of an object (i.e., creates
+      * a new object.)
+-     * 
++     *
+      * @param c
+      *      Type of the object to be created. If this type is
+      *      an array type, added arguments are treated as array
+@@ -158,14 +158,14 @@
+                     f.id(name).p('(');
+             }
+         }
+-                
++
+         f.g(args);
+ 
+         if (isConstructor && type.isArray())
+             f.p('}');
+-        else 
++        else
+             f.p(')');
+-            
++
+         if( type instanceof JDefinedClass && ((JDefinedClass)type).isAnonymous() ) {
+             ((JAnonymousClass)type).declareBody(f);
+         }
+--- old/src/share/classes/com/sun/codemodel/internal/JJavaName.java	Thu Jul 30 17:11:01 2009
++++ openjdk/jaxws/src/share/classes/com/sun/codemodel/internal/JJavaName.java	Thu Jul 30 17:11:00 2009
+@@ -231,6 +231,7 @@
+               "(.*)basis","$1bases",
+                "(.*)axis","$1axes",
+                  "(.+)is","$1ises",
++                 "(.+)ss","$1sses",
+                  "(.+)us","$1uses",
+                   "(.+)s","$1s",
+                "(.*)foot","$1feet",
+--- old/src/share/classes/com/sun/codemodel/internal/JLabel.java	Thu Jul 30 17:11:04 2009
++++ openjdk/jaxws/src/share/classes/com/sun/codemodel/internal/JLabel.java	Thu Jul 30 17:11:03 2009
+@@ -26,17 +26,17 @@
+ 
+ /**
+  * Label that can be used for continue and break.
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+ public class JLabel implements JStatement {
+-    
++
+     final String label;
+-    
++
+     /**
+      * JBreak constructor
+-     * 
++     *
+      * @param   _label
+      *      break label or null.
+      */
+--- old/src/share/classes/com/sun/codemodel/internal/JMethod.java	Thu Jul 30 17:11:07 2009
++++ openjdk/jaxws/src/share/classes/com/sun/codemodel/internal/JMethod.java	Thu Jul 30 17:11:07 2009
+@@ -38,49 +38,49 @@
+  */
+ public class JMethod extends JGenerifiableImpl implements JDeclaration, JAnnotatable {
+ 
+-	/**
+-	 * Modifiers for this method
+-	 */
+-	private JMods mods;
++        /**
++         * Modifiers for this method
++         */
++        private JMods mods;
+ 
+-	/**
+-	 * Return type for this method
+-	 */
+-	private JType type = null;
++        /**
++         * Return type for this method
++         */
++        private JType type = null;
+ 
+-	/**
+-	 * Name of this method
+-	 */
+-	private String name = null;
++        /**
++         * Name of this method
++         */
++        private String name = null;
+ 
+-	/**
+-	 * List of parameters for this method's declaration
+-	 */
+-	private final List<JVar> params = new ArrayList<JVar>();
++        /**
++         * List of parameters for this method's declaration
++         */
++        private final List<JVar> params = new ArrayList<JVar>();
+ 
+-	/**
+-	 * Set of exceptions that this method may throw.
++        /**
++         * Set of exceptions that this method may throw.
+      * A set instance lazily created.
+-	 */
+-	private Set<JClass> _throws;
++         */
++        private Set<JClass> _throws;
+ 
+-	/**
+-	 * JBlock of statements that makes up the body this method
+-	 */
+-	private JBlock body = null;
++        /**
++         * JBlock of statements that makes up the body this method
++         */
++        private JBlock body = null;
+ 
+-	private JDefinedClass outer;
++        private JDefinedClass outer;
+ 
+-	/**
+-	 * javadoc comments for this JMethod
+-	 */
+-	private JDocComment jdoc = null;
++        /**
++         * javadoc comments for this JMethod
++         */
++        private JDocComment jdoc = null;
+ 
+-	/**
+-	 * Variable parameter for this method's varargs declaration
+-	 * introduced in J2SE 1.5
+-	 */
+-	private JVar varParam = null;
++        /**
++         * Variable parameter for this method's varargs declaration
++         * introduced in J2SE 1.5
++         */
++        private JVar varParam = null;
+ 
+     /**
+      * Annotations on this variable. Lazily created.
+@@ -88,51 +88,51 @@
+     private List<JAnnotationUse> annotations = null;
+ 
+ 
+-	private boolean isConstructor() {
+-		return type == null;
+-	}
+-    
++        private boolean isConstructor() {
++                return type == null;
++        }
++
+     /** To set the default value for the
+      *  annotation member
+      */
+     private JExpression defaultValue = null;
+-    
+ 
+-	/**
+-	 * JMethod constructor
+-	 *
+-	 * @param mods
+-	 *        Modifiers for this method's declaration
+-	 *
+-	 * @param type
+-	 *        Return type for the method
+-	 *
+-	 * @param name
+-	 *        Name of this method
+-	 */
+-	JMethod(JDefinedClass outer, int mods, JType type, String name) {
+-		this.mods = JMods.forMethod(mods);
+-		this.type = type;
+-		this.name = name;
+-		this.outer = outer;
+-	}
+ 
+-	/**
+-	 * Constructor constructor
+-	 *
+-	 * @param mods
+-	 *        Modifiers for this constructor's declaration
+-	 *
+-	 * @param _class
+-	 *        JClass containing this constructor
+-	 */
+-	JMethod(int mods, JDefinedClass _class) {
+-		this.mods = JMods.forMethod(mods);
+-		this.type = null;
+-		this.name = _class.name();
+-		this.outer = _class;
+-	}
+-    
++        /**
++         * JMethod constructor
++         *
++         * @param mods
++         *        Modifiers for this method's declaration
++         *
++         * @param type
++         *        Return type for the method
++         *
++         * @param name
++         *        Name of this method
++         */
++        JMethod(JDefinedClass outer, int mods, JType type, String name) {
++                this.mods = JMods.forMethod(mods);
++                this.type = type;
++                this.name = name;
++                this.outer = outer;
++        }
++
++        /**
++         * Constructor constructor
++         *
++         * @param mods
++         *        Modifiers for this constructor's declaration
++         *
++         * @param _class
++         *        JClass containing this constructor
++         */
++        JMethod(int mods, JDefinedClass _class) {
++                this.mods = JMods.forMethod(mods);
++                this.type = null;
++                this.name = _class.name();
++                this.outer = _class;
++        }
++
+     private Set<JClass> getThrows() {
+         if(_throws==null)
+             _throws = new TreeSet<JClass>(ClassNameComparator.theInstance);
+@@ -139,56 +139,56 @@
+         return _throws;
+     }
+ 
+-	/**
+-	 * Add an exception to the list of exceptions that this
+-	 * method may throw.
+-	 *
+-	 * @param exception
+-	 *        Name of an exception that this method may throw
+-	 */
+-	public JMethod _throws(JClass exception) {
++        /**
++         * Add an exception to the list of exceptions that this
++         * method may throw.
++         *
++         * @param exception
++         *        Name of an exception that this method may throw
++         */
++        public JMethod _throws(JClass exception) {
+         getThrows().add(exception);
+-		return this;
+-	}
++                return this;
++        }
+ 
+-	public JMethod _throws(Class exception) {
+-		return _throws(outer.owner().ref(exception));
+-	}
++        public JMethod _throws(Class exception) {
++                return _throws(outer.owner().ref(exception));
++        }
+ 
+-	/**
+-	 * Add the specified variable to the list of parameters
+-	 * for this method signature.
+-	 *
+-	 * @param type
+-	 *        JType of the parameter being added
+-	 *
+-	 * @param name
+-	 *        Name of the parameter being added
+-	 *
+-	 * @return New parameter variable
+-	 */
+-	public JVar param(int mods, JType type, String name) {
+-		JVar v = new JVar(JMods.forVar(mods), type, name, null);
+-		params.add(v);
+-		return v;
+-	}
++        /**
++         * Add the specified variable to the list of parameters
++         * for this method signature.
++         *
++         * @param type
++         *        JType of the parameter being added
++         *
++         * @param name
++         *        Name of the parameter being added
++         *
++         * @return New parameter variable
++         */
++        public JVar param(int mods, JType type, String name) {
++                JVar v = new JVar(JMods.forVar(mods), type, name, null);
++                params.add(v);
++                return v;
++        }
+ 
+-	public JVar param(JType type, String name) {
+-		return param(JMod.NONE, type, name);
+-	}
++        public JVar param(JType type, String name) {
++                return param(JMod.NONE, type, name);
++        }
+ 
+-	public JVar param(int mods, Class type, String name) {
+-		return param(mods, outer.owner()._ref(type), name);
+-	}
++        public JVar param(int mods, Class type, String name) {
++                return param(mods, outer.owner()._ref(type), name);
++        }
+ 
+-	public JVar param(Class type, String name) {
+-		return param(outer.owner()._ref(type), name);
+-	}
++        public JVar param(Class type, String name) {
++                return param(outer.owner()._ref(type), name);
++        }
+ 
+-	/**
+-	 * @see #varParam(JType, String)
+-	 */
+-	public JVar varParam(Class type, String name) {
++        /**
++         * @see #varParam(JType, String)
++         */
++        public JVar varParam(Class type, String name) {
+         return varParam(outer.owner()._ref(type),name);
+     }
+ 
+@@ -203,31 +203,31 @@
+      *        Name of the parameter being added
+      *
+      * @return the variable parameter
+-     * 
++     *
+      * @throws IllegalStateException
+      *      If this method is called twice.
+-     *      varargs in J2SE 1.5 can appear only once in the 
++     *      varargs in J2SE 1.5 can appear only once in the
+      *      method signature.
+      */
+     public JVar varParam(JType type, String name) {
+-		if (!hasVarArgs()) {
++                if (!hasVarArgs()) {
+ 
+             varParam =
+-				new JVar(
+-					JMods.forVar(JMod.NONE),
+-					type.array(),
+-					name,
+-					null);
+-			return varParam;
+-		} else {
+-			throw new IllegalStateException(
+-				"Cannot have two varargs in a method,\n"
+-					+ "Check if varParam method of JMethod is"
+-					+ " invoked more than once");
++                                new JVar(
++                                        JMods.forVar(JMod.NONE),
++                                        type.array(),
++                                        name,
++                                        null);
++                        return varParam;
++                } else {
++                        throw new IllegalStateException(
++                                "Cannot have two varargs in a method,\n"
++                                        + "Check if varParam method of JMethod is"
++                                        + " invoked more than once");
+ 
+-		}
++                }
+ 
+-	}
++        }
+ 
+     /**
+      * Adds an annotation to this variable.
+@@ -256,17 +256,17 @@
+         return TypedAnnotationWriter.create(clazz,this);
+     }
+ 
+-	/**
+-	 * Check if there are any varargs declared
+-	 * for this method signature.
+-	 */
+-	public boolean hasVarArgs() {
+-		return this.varParam!=null;
+-	}
++        /**
++         * Check if there are any varargs declared
++         * for this method signature.
++         */
++        public boolean hasVarArgs() {
++                return this.varParam!=null;
++        }
+ 
+-	public String name() {
+-		return name;
+-	}
++        public String name() {
++                return name;
++        }
+ 
+     /**
+      * Changes the name of the method.
+@@ -276,11 +276,11 @@
+     }
+ 
+     /**
+-	 * Returns the return type.
+-	 */
+-	public JType type() {
+-		return type;
+-	}
++         * Returns the return type.
++         */
++        public JType type() {
++                return type;
++        }
+ 
+     /**
+      * Overrides the return type.
+@@ -290,98 +290,98 @@
+     }
+ 
+     /**
+-	 * Returns all the parameter types in an array.
+-	 * @return
+-	 *      If there's no parameter, an empty array will be returned.
+-	 */
+-	public JType[] listParamTypes() {
+-		JType[] r = new JType[params.size()];
+-		for (int i = 0; i < r.length; i++)
+-			r[i] = params.get(i).type();
+-		return r;
+-	}
++         * Returns all the parameter types in an array.
++         * @return
++         *      If there's no parameter, an empty array will be returned.
++         */
++        public JType[] listParamTypes() {
++                JType[] r = new JType[params.size()];
++                for (int i = 0; i < r.length; i++)
++                        r[i] = params.get(i).type();
++                return r;
++        }
+ 
+-	/**
+-	 * Returns  the varags parameter type.
+-	 * @return
+-	 * If there's no vararg parameter type, null will be returned.
+-	 */
+-	public JType listVarParamType() {
+-		if (varParam != null)
+-			return varParam.type();
+-		else
+-			return null;
+-	}
++        /**
++         * Returns  the varags parameter type.
++         * @return
++         * If there's no vararg parameter type, null will be returned.
++         */
++        public JType listVarParamType() {
++                if (varParam != null)
++                        return varParam.type();
++                else
++                        return null;
++        }
+ 
+-	/**
+-	 * Returns all the parameters in an array.
+-	 * @return
+-	 *      If there's no parameter, an empty array will be returned.
+-	 */
+-	public JVar[] listParams() {
+-		return params.toArray(new JVar[params.size()]);
+-	}
++        /**
++         * Returns all the parameters in an array.
++         * @return
++         *      If there's no parameter, an empty array will be returned.
++         */
++        public JVar[] listParams() {
++                return params.toArray(new JVar[params.size()]);
++        }
+ 
+-	/**
+-	 * Returns the variable parameter
+-	 * @return
+-	 *      If there's no parameter, null will be returned.
+-	 */
+-	public JVar listVarParam() {
+-		return varParam;
+-	}
++        /**
++         * Returns the variable parameter
++         * @return
++         *      If there's no parameter, null will be returned.
++         */
++        public JVar listVarParam() {
++                return varParam;
++        }
+ 
+-	/**
+-	 * Returns true if the method has the specified signature.
+-	 */
+-	public boolean hasSignature(JType[] argTypes) {
+-		JVar[] p = listParams();
+-		if (p.length != argTypes.length)
+-			return false;
++        /**
++         * Returns true if the method has the specified signature.
++         */
++        public boolean hasSignature(JType[] argTypes) {
++                JVar[] p = listParams();
++                if (p.length != argTypes.length)
++                        return false;
+ 
+-		for (int i = 0; i < p.length; i++)
+-			if (!p[i].type().equals(argTypes[i]))
+-				return false;
++                for (int i = 0; i < p.length; i++)
++                        if (!p[i].type().equals(argTypes[i]))
++                                return false;
+ 
+-		return true;
+-	}
++                return true;
++        }
+ 
+-	/**
+-	 * Get the block that makes up body of this method
+-	 *
+-	 * @return Body of method
+-	 */
+-	public JBlock body() {
+-		if (body == null)
+-			body = new JBlock();
+-		return body;
+-	}
+-    
++        /**
++         * Get the block that makes up body of this method
++         *
++         * @return Body of method
++         */
++        public JBlock body() {
++                if (body == null)
++                        body = new JBlock();
++                return body;
++        }
++
+     /**
+      * Specify the default value for this annotation member
+-     * @param value 
++     * @param value
+      *           Default value for the annotation member
+-     * 
++     *
+      */
+     public void declareDefaultValue(JExpression value){
+         this.defaultValue = value;
+     }
+ 
+-	/**
+-	 * Creates, if necessary, and returns the class javadoc for this
+-	 * JDefinedClass
+-	 *
+-	 * @return JDocComment containing javadocs for this class
+-	 */
+-	public JDocComment javadoc() {
+-		if (jdoc == null)
+-			jdoc = new JDocComment(owner());
+-		return jdoc;
+-	}
++        /**
++         * Creates, if necessary, and returns the class javadoc for this
++         * JDefinedClass
++         *
++         * @return JDocComment containing javadocs for this class
++         */
++        public JDocComment javadoc() {
++                if (jdoc == null)
++                        jdoc = new JDocComment(owner());
++                return jdoc;
++        }
+ 
+-	public void declare(JFormatter f) {
+-		if (jdoc != null)
+-			f.g(jdoc);
++        public void declare(JFormatter f) {
++                if (jdoc != null)
++                        f.g(jdoc);
+ 
+         if (annotations != null){
+             for (JAnnotationUse a : annotations)
+@@ -388,16 +388,17 @@
+                 f.g(a).nl();
+         }
+ 
+-		// declare the generics parameters
+-		super.declare(f);
++        f.g(mods);
+ 
+-		f.g(mods);
+-		if (!isConstructor())
+-			f.g(type);
+-		f.id(name).p('(').i();
++        // declare the generics parameters
++                super.declare(f);
++
++                if (!isConstructor())
++                        f.g(type);
++                f.id(name).p('(').i();
+         // when parameters are printed in new lines, we want them to be indented.
+         // there's a good chance no newlines happen, too, but just in case it does.
+-		boolean first = true;
++                boolean first = true;
+         for (JVar var : params) {
+             if (!first)
+                 f.p(',');
+@@ -406,33 +407,33 @@
+             f.b(var);
+             first = false;
+         }
+-		if (hasVarArgs()) {
+-			if (!first)
+-				f.p(',');
+-			f.g(varParam.type().elementType());
+-			f.p("... ");
+-			f.id(varParam.name());
+-		}
++                if (hasVarArgs()) {
++                        if (!first)
++                                f.p(',');
++                        f.g(varParam.type().elementType());
++                        f.p("... ");
++                        f.id(varParam.name());
++                }
+ 
+-		f.o().p(')');
+-		if (_throws!=null && !_throws.isEmpty()) {
+-			f.nl().i().p("throws").g(_throws).nl().o();
+-		}
+-        
++                f.o().p(')');
++                if (_throws!=null && !_throws.isEmpty()) {
++                        f.nl().i().p("throws").g(_throws).nl().o();
++                }
++
+         if (defaultValue != null) {
+             f.p("default ");
+             f.g(defaultValue);
+         }
+-		if (body != null) {
+-			f.s(body);
+-		} else if (
+-			!outer.isInterface() && !outer.isAnnotationTypeDeclaration() && !mods.isAbstract() && !mods.isNative()) {
+-			// Print an empty body for non-native, non-abstract methods
+-			f.s(new JBlock());
+-		} else {
+-			f.p(';').nl();
+-		}
+-	}
++                if (body != null) {
++                        f.s(body);
++                } else if (
++                        !outer.isInterface() && !outer.isAnnotationTypeDeclaration() && !mods.isAbstract() && !mods.isNative()) {
++                        // Print an empty body for non-native, non-abstract methods
++                        f.s(new JBlock());
++                } else {
++                        f.p(';').nl();
++                }
++        }
+ 
+     /**
+      * @return
+@@ -444,13 +445,13 @@
+     }
+ 
+     /**
+-     * @deprecated use {@link #mods()} 
++     * @deprecated use {@link #mods()}
+      */
+     public JMods getMods() {
+-		return mods;
+-	}
++                return mods;
++        }
+ 
+-	protected JCodeModel owner() {
+-		return outer.owner();
+-	}
++        protected JCodeModel owner() {
++                return outer.owner();
++        }
+ }
+--- old/src/share/classes/com/sun/codemodel/internal/JMods.java	Thu Jul 30 17:11:11 2009
++++ openjdk/jaxws/src/share/classes/com/sun/codemodel/internal/JMods.java	Thu Jul 30 17:11:10 2009
+@@ -33,25 +33,25 @@
+  * Modifier groups.
+  */
+ public class JMods implements JGenerable {
+-    
++
+ //
+ // mask
+ //
+     private static int VAR
+-	= JMod.FINAL;
++        = JMod.FINAL;
+ 
+     private static int FIELD
+-	= (JMod.PUBLIC | JMod.PRIVATE | JMod.PROTECTED
+-	   | JMod.STATIC | JMod.FINAL
+-	   | JMod.TRANSIENT | JMod.VOLATILE);
++        = (JMod.PUBLIC | JMod.PRIVATE | JMod.PROTECTED
++           | JMod.STATIC | JMod.FINAL
++           | JMod.TRANSIENT | JMod.VOLATILE);
+ 
+     private static int METHOD
+-	= (JMod.PUBLIC | JMod.PRIVATE | JMod.PROTECTED | JMod.FINAL
+-	   | JMod.ABSTRACT | JMod.STATIC | JMod.NATIVE | JMod.SYNCHRONIZED);
++        = (JMod.PUBLIC | JMod.PRIVATE | JMod.PROTECTED | JMod.FINAL
++           | JMod.ABSTRACT | JMod.STATIC | JMod.NATIVE | JMod.SYNCHRONIZED);
+ 
+     private static int CLASS
+-	= (JMod.PUBLIC | JMod.PRIVATE | JMod.PROTECTED
+-	   | JMod.STATIC | JMod.FINAL | JMod.ABSTRACT );
++        = (JMod.PUBLIC | JMod.PRIVATE | JMod.PROTECTED
++           | JMod.STATIC | JMod.FINAL | JMod.ABSTRACT );
+ 
+     private static int INTERFACE = JMod.PUBLIC;
+ 
+@@ -109,17 +109,17 @@
+     public boolean isNative() {
+         return (mods & JMod.NATIVE) != 0;
+     }
+-    
++
+     public boolean isSynchronized() {
+         return (mods & JMod.SYNCHRONIZED) != 0;
+     }
+-    
++
+     public void setSynchronized(boolean newValue) {
+         setFlag( JMod.SYNCHRONIZED, newValue );
+     }
+-    
++
+     // TODO: more
+-    
++
+     private void setFlag( int bit, boolean newValue ) {
+         mods = (mods & ~bit) | (newValue?bit:0);
+     }
+--- old/src/share/classes/com/sun/codemodel/internal/JNarrowedClass.java	Thu Jul 30 17:11:14 2009
++++ openjdk/jaxws/src/share/classes/com/sun/codemodel/internal/JNarrowedClass.java	Thu Jul 30 17:11:14 2009
+@@ -33,7 +33,7 @@
+  * Represents X&lt;Y>.
+  *
+  * TODO: consider separating the decl and the use.
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+@@ -50,7 +50,7 @@
+     JNarrowedClass(JClass basis, JClass arg) {
+         this(basis,Collections.singletonList(arg));
+     }
+-    
++
+     JNarrowedClass(JClass basis, List<JClass> args) {
+         super(basis.owner());
+         this.basis = basis;
+@@ -86,7 +86,7 @@
+         buf.append('>');
+         return buf.toString();
+     }
+-    
++
+     public String fullName() {
+         StringBuilder buf = new StringBuilder();
+         buf.append(basis.fullName());
+@@ -196,7 +196,7 @@
+     protected JClass substituteParams(JTypeVar[] variables, List<JClass> bindings) {
+         JClass b = basis.substituteParams(variables,bindings);
+         boolean different = b!=basis;
+-        
++
+         List<JClass> clazz = new ArrayList<JClass>(args.size());
+         for( int i=0; i<clazz.size(); i++ ) {
+             JClass c = args.get(i).substituteParams(variables,bindings);
+@@ -203,7 +203,7 @@
+             clazz.set(i,c);
+             different |= c != args.get(i);
+         }
+-        
++
+         if(different)
+             return new JNarrowedClass(b,clazz);
+         else
+--- old/src/share/classes/com/sun/codemodel/internal/JNullType.java	Thu Jul 30 17:11:18 2009
++++ openjdk/jaxws/src/share/classes/com/sun/codemodel/internal/JNullType.java	Thu Jul 30 17:11:17 2009
+@@ -30,12 +30,12 @@
+ 
+ /**
+  * Special class object that represents the type of "null".
+- * 
++ *
+  * <p>
+  * Use this class with care.
+- * 
++ *
+  * @author
+- * 	Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
++ *      Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+ public final class JNullType extends JClass {
+ 
+--- old/src/share/classes/com/sun/codemodel/internal/JPackage.java	Thu Jul 30 17:11:21 2009
++++ openjdk/jaxws/src/share/classes/com/sun/codemodel/internal/JPackage.java	Thu Jul 30 17:11:21 2009
+@@ -65,12 +65,12 @@
+      * List of resources files inside this package.
+      */
+     private final Set<JResourceFile> resources = new HashSet<JResourceFile>();
+-    
++
+     /**
+      * All {@link JClass}s in this package keyed the upper case class name.
+-     * 
++     *
+      * This field is non-null only on Windows, to detect
+-     * "Foo" and "foo" as a collision. 
++     * "Foo" and "foo" as a collision.
+      */
+     private final Map<String,JDefinedClass> upperCaseClassMap;
+ 
+@@ -98,40 +98,15 @@
+     JPackage(String name, JCodeModel cw) {
+         this.owner = cw;
+         if (name.equals(".")) {
+-            String msg = "JPackage name . is not allowed";
++            String msg = "Package name . is not allowed";
+             throw new IllegalArgumentException(msg);
+         }
+-        
+-        int dots = 1;
+-        for (int i = 0; i < name.length(); i++) {
+-            char c = name.charAt(i);
+-            if (c == '.') {
+-                dots++;
+-                continue;
+-            }
+-            if (dots > 1) {
+-                String msg = "JPackage name " + name + " missing identifier";
+-                throw new IllegalArgumentException(msg);
+-            } else if (dots == 1 && !Character.isJavaIdentifierStart(c)) {
+-                String msg =
+-                    "JPackage name " + name + " contains illegal " + "character for beginning of identifier: " + c;
+-                throw new IllegalArgumentException(msg);
+-            } else if (!Character.isJavaIdentifierPart(c)) {
+-                String msg = "JPackage name " + name + "contains illegal " + "character: " + c;
+-                throw new IllegalArgumentException(msg);
+-            }
+-            dots = 0;
+-        }
+-        if (!name.trim().equals("") && dots != 0) {
+-            String msg = "JPackage name not allowed to end with .";
+-            throw new IllegalArgumentException(msg);
+-        }
+-        
++
+         if(JCodeModel.isCaseSensitiveFileSystem)
+             upperCaseClassMap = null;
+         else
+             upperCaseClassMap = new HashMap<String,JDefinedClass>();
+-        
++
+         this.name = name;
+     }
+ 
+@@ -139,13 +114,13 @@
+     public JClassContainer parentContainer() {
+         return parent();
+     }
+-    
++
+     /**
+      * Gets the parent package, or null if this class is the root package.
+      */
+     public JPackage parent() {
+         if(name.length()==0)    return null;
+-        
++
+         int idx = name.lastIndexOf('.');
+         return owner._package(name.substring(0,idx));
+     }
+@@ -153,7 +128,7 @@
+     public boolean isClass() { return false; }
+     public boolean isPackage() { return true; }
+     public JPackage getPackage() { return this; }
+-    
++
+     /**
+      * Add a class to this package.
+      *
+@@ -164,7 +139,7 @@
+      *        Name of class to be added to this package
+      *
+      * @return Newly generated class
+-     * 
++     *
+      * @exception JClassAlreadyExistsException
+      *      When the specified class/interface was already created.
+      */
+@@ -177,9 +152,9 @@
+      * @deprecated
+      */
+     public JDefinedClass _class( int mods, String name, boolean isInterface ) throws JClassAlreadyExistsException {
+-    	return _class(mods,name, isInterface?ClassType.INTERFACE:ClassType.CLASS );
++        return _class(mods,name, isInterface?ClassType.INTERFACE:ClassType.CLASS );
+     }
+-    
++
+     public JDefinedClass _class( int mods, String name, ClassType classTypeVal ) throws JClassAlreadyExistsException {
+         if(classes.containsKey(name))
+             throw new JClassAlreadyExistsException(classes.get(name));
+@@ -186,28 +161,28 @@
+         else {
+             // XXX problems caught in the NC constructor
+             JDefinedClass c = new JDefinedClass(this, mods, name, classTypeVal);
+-            
++
+             if( upperCaseClassMap!=null ) {
+                 JDefinedClass dc = upperCaseClassMap.get(name.toUpperCase());
+                 if(dc!=null)
+                     throw new JClassAlreadyExistsException(dc);
+                 upperCaseClassMap.put(name.toUpperCase(),c);
+-            }            
++            }
+             classes.put(name,c);
+             return c;
+         }
+     }
+ 
+-	/**
+-	 * Adds a public class to this package.
+-	 */
++        /**
++         * Adds a public class to this package.
++         */
+     public JDefinedClass _class(String name) throws JClassAlreadyExistsException {
+-		return _class( JMod.PUBLIC, name );
+-	}
++                return _class( JMod.PUBLIC, name );
++        }
+ 
+     /**
+      * Gets a reference to the already created {@link JDefinedClass}.
+-     * 
++     *
+      * @return null
+      *      If the class is not yet created.
+      */
+@@ -246,7 +221,7 @@
+     public JDefinedClass _interface(String name) throws JClassAlreadyExistsException {
+         return _interface(JMod.PUBLIC, name);
+     }
+-    
++
+     /**
+      * Add an annotationType Declaration to this package
+      * @param name
+@@ -255,12 +230,12 @@
+      *      newly created Annotation Type Declaration
+      * @exception JClassAlreadyExistsException
+      *      When the specified class/interface was already created.
+-     
++
+      */
+     public JDefinedClass _annotationTypeDeclaration(String name) throws JClassAlreadyExistsException {
+-    	return _class (JMod.PUBLIC,name,ClassType.ANNOTATION_TYPE_DECL);
++        return _class (JMod.PUBLIC,name,ClassType.ANNOTATION_TYPE_DECL);
+     }
+-	
++
+     /**
+      * Add a public enum to this package
+      * @param name
+@@ -269,10 +244,10 @@
+      *      newly created Enum
+      * @exception JClassAlreadyExistsException
+      *      When the specified class/interface was already created.
+-     
++
+      */
+     public JDefinedClass _enum (String name) throws JClassAlreadyExistsException {
+-    	return _class (JMod.PUBLIC,name,ClassType.ENUM);
++        return _class (JMod.PUBLIC,name,ClassType.ENUM);
+     }
+     /**
+      * Adds a new resource file to this package.
+@@ -281,7 +256,7 @@
+         resources.add(rsrc);
+         return rsrc;
+     }
+-    
++
+     /**
+      * Checks if a resource of the given name exists.
+      */
+@@ -291,7 +266,7 @@
+                 return true;
+         return false;
+     }
+-    
++
+     /**
+      * Iterates all resource files in this package.
+      */
+@@ -325,7 +300,7 @@
+         if (upperCaseClassMap != null)
+             upperCaseClassMap.remove(c.name().toUpperCase());
+     }
+-	
++
+     /**
+      * Reference a class within this package.
+      */
+@@ -340,7 +315,7 @@
+ 
+         return owner.ref(Class.forName(n));
+     }
+-    
++
+     /**
+      * Gets a reference to a sub package of this package.
+      */
+@@ -356,7 +331,7 @@
+     public Iterator<JDefinedClass> classes() {
+         return classes.values().iterator();
+     }
+-    
++
+     /**
+      * Checks if a given name is already defined as a class/interface
+      */
+@@ -379,9 +354,9 @@
+      * Get the name of this package
+      *
+      * @return
+-     *		The name of this package, or the empty string if this is the
+-     *		null package. For example, this method returns strings like
+-     *		<code>"java.lang"</code>
++     *          The name of this package, or the empty string if this is the
++     *          null package. For example, this method returns strings like
++     *          <code>"java.lang"</code>
+      */
+     public String name() {
+         return name;
+--- old/src/share/classes/com/sun/codemodel/internal/JPrimitiveType.java	Thu Jul 30 17:11:25 2009
++++ openjdk/jaxws/src/share/classes/com/sun/codemodel/internal/JPrimitiveType.java	Thu Jul 30 17:11:24 2009
+@@ -41,7 +41,7 @@
+      * For example, this would be "java.lang.Short" for short.
+      */
+     private final JClass wrapperClass;
+-    
++
+     JPrimitiveType(JCodeModel owner, String typeName, Class wrapper ) {
+         this.owner = owner;
+         this.typeName = typeName;
+@@ -53,7 +53,7 @@
+     public String fullName() {
+         return typeName;
+     }
+-        
++
+     public String name() {
+         return fullName();
+     }
+@@ -68,7 +68,7 @@
+             arrayClass = new JArrayClass(owner,this);
+         return arrayClass;
+     }
+-    
++
+     /**
+      * Obtains the wrapper class for this primitive type.
+      * For example, this method returns a reference to java.lang.Integer
+@@ -99,16 +99,16 @@
+      * Wraps an expression of this type to the corresponding wrapper class.
+      * For example, if this class represents "float", this method will return
+      * the expression <code>new Float(x)</code> for the paramter x.
+-     * 
++     *
+      * REVISIT: it's not clear how this method works for VOID.
+      */
+     public JExpression wrap( JExpression exp ) {
+         return JExpr._new(boxify()).arg(exp);
+     }
+-    
++
+     /**
+      * Do the opposite of the wrap method.
+-     * 
++     *
+      * REVISIT: it's not clear how this method works for VOID.
+      */
+     public JExpression unwrap( JExpression exp ) {
+--- old/src/share/classes/com/sun/codemodel/internal/JResourceFile.java	Thu Jul 30 17:11:28 2009
++++ openjdk/jaxws/src/share/classes/com/sun/codemodel/internal/JResourceFile.java	Thu Jul 30 17:11:28 2009
+@@ -34,16 +34,16 @@
+ public abstract class JResourceFile {
+ 
+     private final String name;
+-    
++
+     protected JResourceFile( String name ) {
+         this.name = name;
+     }
+-    
++
+     /**
+      * Gets the name of this property file
+      */
+-    public String name() { 
+-        return name; 
++    public String name() {
++        return name;
+     }
+ 
+     /**
+--- old/src/share/classes/com/sun/codemodel/internal/JStringLiteral.java	Thu Jul 30 17:11:32 2009
++++ openjdk/jaxws/src/share/classes/com/sun/codemodel/internal/JStringLiteral.java	Thu Jul 30 17:11:31 2009
+@@ -26,7 +26,7 @@
+ 
+ /**
+  * String literal.
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+@@ -33,15 +33,15 @@
+ public class JStringLiteral extends JExpressionImpl {
+ 
+     public final String str;
+-    
+ 
++
+     JStringLiteral(String what) {
+         this.str = what;
+-    
++
+     }
+-   
+-    
++
++
+     public void generate(JFormatter f) {
+-    	f.p(JExpr.quotify('"', str));
++        f.p(JExpr.quotify('"', str));
+     }
+ }
+--- old/src/share/classes/com/sun/codemodel/internal/JSwitch.java	Thu Jul 30 17:11:35 2009
++++ openjdk/jaxws/src/share/classes/com/sun/codemodel/internal/JSwitch.java	Thu Jul 30 17:11:34 2009
+@@ -42,7 +42,7 @@
+      * vector of JCases.
+      */
+     private List<JCase> cases = new ArrayList<JCase>();
+-    
++
+     /**
+      * a single default case
+      */
+@@ -67,12 +67,12 @@
+ 
+     public JCase _default() {
+         // what if (default != null) ???
+-        
++
+         // default cases statements don't have a label
+         defaultCase = new JCase(null, true);
+         return defaultCase;
+     }
+-    
++
+     public void state(JFormatter f) {
+         if (JOp.hasTopOp(test)) {
+             f.p("switch ").g(test).p(" {").nl();
+--- old/src/share/classes/com/sun/codemodel/internal/JType.java	Thu Jul 30 17:11:38 2009
++++ openjdk/jaxws/src/share/classes/com/sun/codemodel/internal/JType.java	Thu Jul 30 17:11:38 2009
+@@ -62,7 +62,7 @@
+ 
+     /** Gets the owner code model object. */
+     public abstract JCodeModel owner();
+-    
++
+     /**
+      * Gets the full name of the type.
+      *
+@@ -93,10 +93,10 @@
+      *     Names like "int", "void", "BigInteger".
+      */
+     public abstract String name();
+-    
++
+     /**
+      * Create an array type of this type.
+-     * 
++     *
+      * This method is undefined for primitive void type, which
+      * doesn't have any corresponding array representation.
+      *
+@@ -138,12 +138,12 @@
+     public JType erasure() {
+         return this;
+     }
+-    
++
+     /**
+      * Returns true if this is a referenced type.
+      */
+     public final boolean isReference() {
+-    	return !isPrimitive();
++        return !isPrimitive();
+     }
+ 
+     /**
+--- old/src/share/classes/com/sun/codemodel/internal/JTypeVar.java	Thu Jul 30 17:11:42 2009
++++ openjdk/jaxws/src/share/classes/com/sun/codemodel/internal/JTypeVar.java	Thu Jul 30 17:11:41 2009
+@@ -29,15 +29,15 @@
+ 
+ /**
+  * Type variable used to declare generics.
+- * 
++ *
+  * @see JGenerifiable
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+ public final class JTypeVar extends JClass implements JDeclaration {
+-    
++
+     private final String name;
+-    
++
+     private JClass bound;
+ 
+     JTypeVar(JCodeModel owner, String _name) {
+@@ -44,7 +44,7 @@
+         super(owner);
+         this.name = _name;
+     }
+-    
++
+     public String name() {
+         return name;
+     }
+@@ -56,10 +56,10 @@
+     public JPackage _package() {
+         return null;
+     }
+-    
++
+     /**
+      * Adds a bound to this variable.
+-     * 
++     *
+      * @return  this
+      */
+     public JTypeVar bound( JClass c ) {
+@@ -71,7 +71,7 @@
+ 
+     /**
+      * Returns the class bound of this variable.
+-     * 
++     *
+      * <p>
+      * If no bound is given, this method returns {@link Object}.
+      */
+--- old/src/share/classes/com/sun/codemodel/internal/JTypeWildcard.java	Thu Jul 30 17:11:45 2009
++++ openjdk/jaxws/src/share/classes/com/sun/codemodel/internal/JTypeWildcard.java	Thu Jul 30 17:11:45 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.codemodel.internal;
+ 
+ import java.util.Iterator;
+--- old/src/share/classes/com/sun/codemodel/internal/JVar.java	Thu Jul 30 17:11:49 2009
++++ openjdk/jaxws/src/share/classes/com/sun/codemodel/internal/JVar.java	Thu Jul 30 17:11:48 2009
+@@ -197,12 +197,12 @@
+         f.id(name);
+     }
+ 
+-	
++
+     public JExpression assign(JExpression rhs) {
+-		return JExpr.assign(this,rhs);
++                return JExpr.assign(this,rhs);
+     }
+     public JExpression assignPlus(JExpression rhs) {
+-		return JExpr.assignPlus(this,rhs);
++                return JExpr.assignPlus(this,rhs);
+     }
+-	
++
+ }
+--- old/src/share/classes/com/sun/codemodel/internal/TypedAnnotationWriter.java	Thu Jul 30 17:11:52 2009
++++ openjdk/jaxws/src/share/classes/com/sun/codemodel/internal/TypedAnnotationWriter.java	Thu Jul 30 17:11:51 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.codemodel.internal;
+ 
+ import java.lang.reflect.InvocationHandler;
+--- old/src/share/classes/com/sun/codemodel/internal/fmt/JBinaryFile.java	Thu Jul 30 17:11:55 2009
++++ openjdk/jaxws/src/share/classes/com/sun/codemodel/internal/fmt/JBinaryFile.java	Thu Jul 30 17:11:55 2009
+@@ -33,20 +33,20 @@
+ /**
+  * Allows the application to use OutputStream to define data
+  * that will be stored into a file.
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+ public final class JBinaryFile extends JResourceFile {
+-    
++
+     private final ByteArrayOutputStream baos = new ByteArrayOutputStream();
+-    
++
+     public JBinaryFile( String name ) {
+         super(name);
+     }
+-    
++
+     /**
+-     * 
++     *
+      * @return
+      *      Data written to the returned output stream will be written
+      *      to the file.
+@@ -54,7 +54,7 @@
+     public OutputStream getDataStore() {
+         return baos;
+     }
+-    
++
+     public void build(OutputStream os) throws IOException {
+         os.write( baos.toByteArray() );
+     }
+--- old/src/share/classes/com/sun/codemodel/internal/fmt/JPropertyFile.java	Thu Jul 30 17:11:59 2009
++++ openjdk/jaxws/src/share/classes/com/sun/codemodel/internal/fmt/JPropertyFile.java	Thu Jul 30 17:11:58 2009
+@@ -38,9 +38,9 @@
+     public JPropertyFile( String name ) {
+         super(name);
+     }
+-    
++
+     private final Properties data = new Properties();
+-    
++
+     /**
+      * Adds key/value pair into the property file.
+      * If you call this method twice with the same key,
+@@ -49,11 +49,11 @@
+     public void add( String key, String value ) {
+         data.put(key,value);
+     }
+-    
++
+     // TODO: method to iterate values in data?
+     // TODO: should we rather expose Properties object directly via
+     // public Properties body() { return data; } ?
+-    
++
+     public void build( OutputStream out ) throws IOException {
+         data.store(out,null);
+     }
+--- old/src/share/classes/com/sun/codemodel/internal/fmt/JSerializedObject.java	Thu Jul 30 17:12:02 2009
++++ openjdk/jaxws/src/share/classes/com/sun/codemodel/internal/fmt/JSerializedObject.java	Thu Jul 30 17:12:01 2009
+@@ -39,7 +39,7 @@
+ public class JSerializedObject extends JResourceFile {
+ 
+     private final Object obj;
+-    
++
+     /**
+      * @exception   IOException
+      *      If the serialization fails, this exception is thrown
+@@ -48,9 +48,9 @@
+         super(name);
+         this.obj = obj;
+     }
+-    
++
+     /**
+-     * called by JPackage to serialize the object 
++     * called by JPackage to serialize the object
+      */
+     protected void build( OutputStream os ) throws IOException {
+         // serialize the obj into a ByteArrayOutputStream
+--- old/src/share/classes/com/sun/codemodel/internal/fmt/JStaticFile.java	Thu Jul 30 17:12:05 2009
++++ openjdk/jaxws/src/share/classes/com/sun/codemodel/internal/fmt/JStaticFile.java	Thu Jul 30 17:12:05 2009
+@@ -31,13 +31,13 @@
+ import com.sun.codemodel.internal.JResourceFile;
+ 
+ /**
+- * Allows an application to copy a resource file to the output. 
+- * 
++ * Allows an application to copy a resource file to the output.
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+ public final class JStaticFile extends JResourceFile {
+-    
++
+     private final ClassLoader classLoader;
+     private final String resourceName;
+     private final boolean isResource;
+@@ -45,7 +45,7 @@
+     public JStaticFile(String _resourceName) {
+         this(_resourceName,!_resourceName.endsWith(".java"));
+     }
+-    
++
+     public JStaticFile(String _resourceName,boolean isResource) {
+         this( JStaticFile.class.getClassLoader(), _resourceName, isResource );
+     }
+@@ -67,13 +67,13 @@
+ 
+     protected void build(OutputStream os) throws IOException {
+         DataInputStream dis = new DataInputStream(classLoader.getResourceAsStream(resourceName));
+-        
++
+         byte[] buf = new byte[256];
+         int sz;
+         while( (sz=dis.read(buf))>0 )
+             os.write(buf,0,sz);
+-        
++
+         dis.close();
+     }
+-    
++
+ }
+--- old/src/share/classes/com/sun/codemodel/internal/fmt/JStaticJavaFile.java	Thu Jul 30 17:12:09 2009
++++ openjdk/jaxws/src/share/classes/com/sun/codemodel/internal/fmt/JStaticJavaFile.java	Thu Jul 30 17:12:08 2009
+@@ -44,7 +44,7 @@
+ 
+ /**
+  * Statically generated Java soruce file.
+- * 
++ *
+  * <p>
+  * This {@link JResourceFile} implementation will generate a Java source
+  * file by copying the source code from a resource.
+@@ -59,24 +59,24 @@
+  * <p>
+  * Note that because we don't parse the static Java source code,
+  * the returned {@link JClass} object doesn't respond to methods like
+- * "isInterface" or "_extends",  
+- * 
++ * "isInterface" or "_extends",
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+ public final class JStaticJavaFile extends JResourceFile {
+-    
++
+     private final JPackage pkg;
+     private final String className;
+     private final URL source;
+     private final JStaticClass clazz;
+     private final LineFilter filter;
+-    
++
+     public JStaticJavaFile(JPackage _pkg, String className, String _resourceName) {
+         this( _pkg, className,
+             JStaticJavaFile.class.getClassLoader().getResource(_resourceName), null );
+     }
+-    
++
+     public JStaticJavaFile(JPackage _pkg, String _className, URL _source, LineFilter _filter ) {
+         super(_className+".java");
+         if(_source==null)   throw new NullPointerException();
+@@ -86,9 +86,9 @@
+         this.source = _source;
+         this.filter = _filter;
+     }
+-    
++
+     /**
+-     * Returns a class object that represents a statically generated code. 
++     * Returns a class object that represents a statically generated code.
+      */
+     public final JClass getJClass() {
+         return clazz;
+@@ -100,12 +100,12 @@
+ 
+     protected  void build(OutputStream os) throws IOException {
+         InputStream is = source.openStream();
+-        
++
+         BufferedReader r = new BufferedReader(new InputStreamReader(is));
+         PrintWriter w = new PrintWriter(new BufferedWriter(new OutputStreamWriter(os)));
+         LineFilter filter = createLineFilter();
+         int lineNumber=1;
+-        
++
+         try {
+             String line;
+             while((line=r.readLine())!=null) {
+@@ -117,11 +117,11 @@
+         } catch( ParseException e ) {
+             throw new IOException("unable to process "+source+" line:"+lineNumber+"\n"+e.getMessage());
+         }
+-        
++
+         w.close();
+         r.close();
+     }
+-    
++
+     /**
+      * Creates a {@link LineFilter}.
+      * <p>
+@@ -133,7 +133,7 @@
+         LineFilter f = new LineFilter() {
+             public String process(String line) {
+                 if(!line.startsWith("package ")) return line;
+-                
++
+                 // replace package decl
+                 if( pkg.isUnnamed() )
+                     return null;
+@@ -146,7 +146,7 @@
+         else
+             return f;
+     }
+-    
++
+     /**
+      * Filter that alters the Java source code.
+      * <p>
+@@ -162,13 +162,13 @@
+          *      null to strip the line off. Otherwise the returned
+          *      String will be written out. Do not add '\n' at the end
+          *      of this string.
+-         * 
++         *
+          * @exception ParseException
+          *      when for some reason there's an error in the line.
+          */
+         String process(String line) throws ParseException;
+     }
+-    
++
+     /**
+      * A {@link LineFilter} that combines two {@link LineFilter}s.
+      */
+@@ -184,12 +184,12 @@
+             return second.process(line);
+         }
+     }
+-    
+-    
++
++
+     private class JStaticClass extends JClass {
+ 
+         private final JTypeVar[] typeParams;
+-        
++
+         JStaticClass() {
+             super(pkg.owner());
+             // TODO: allow those to be specified
+@@ -199,7 +199,7 @@
+         public String name() {
+             return className;
+         }
+-        
++
+         public String fullName() {
+             if(pkg.isUnnamed())
+                 return className;
+--- old/src/share/classes/com/sun/codemodel/internal/fmt/JTextFile.java	Thu Jul 30 17:12:12 2009
++++ openjdk/jaxws/src/share/classes/com/sun/codemodel/internal/fmt/JTextFile.java	Thu Jul 30 17:12:12 2009
+@@ -34,9 +34,9 @@
+ 
+ /**
+  * Simple text file.
+- * 
++ *
+  * @author
+- * 	Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
++ *      Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+ public class JTextFile extends JResourceFile
+ {
+@@ -43,13 +43,13 @@
+     public JTextFile( String name ) {
+         super(name);
+     }
+-    
++
+     private String contents = null;
+-    
++
+     public void setContents( String _contents ) {
+         this.contents = _contents;
+     }
+-    
++
+     public void build( OutputStream out ) throws IOException {
+         Writer w = new OutputStreamWriter(out);
+         w.write(contents);
+--- old/src/share/classes/com/sun/codemodel/internal/package-info.java	Thu Jul 30 17:12:16 2009
++++ openjdk/jaxws/src/share/classes/com/sun/codemodel/internal/package-info.java	Thu Jul 30 17:12:15 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ /**
+  * <h1>Library for generating Java source code</h1>.
+  *
+--- old/src/share/classes/com/sun/codemodel/internal/util/ClassNameComparator.java	Thu Jul 30 17:12:19 2009
++++ openjdk/jaxws/src/share/classes/com/sun/codemodel/internal/util/ClassNameComparator.java	Thu Jul 30 17:12:18 2009
+@@ -30,13 +30,13 @@
+ /**
+  * Comparator object that sorts {@link JClass}es in the order
+  * of their names.
+- * 
++ *
+  * @author
+- * 	Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
++ *      Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+ public class ClassNameComparator implements Comparator<JClass> {
+     private ClassNameComparator() {}
+-    
++
+     public int compare(JClass l, JClass r) {
+         return l.fullName().compareTo(r.fullName());
+     }
+--- old/src/share/classes/com/sun/codemodel/internal/util/EncoderFactory.java	Thu Jul 30 17:12:22 2009
++++ openjdk/jaxws/src/share/classes/com/sun/codemodel/internal/util/EncoderFactory.java	Thu Jul 30 17:12:22 2009
+@@ -22,11 +22,10 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ /*
+  * @(#)$Id: EncoderFactory.java,v 1.3 2005/09/10 19:07:33 kohsuke Exp $
+  */
+-
+-
+ package com.sun.codemodel.internal.util;
+ 
+ import java.lang.reflect.Constructor;
+@@ -35,9 +34,9 @@
+ 
+ /**
+  * Creates {@link CharsetEncoder} from a charset name.
+- * 
++ *
+  * Fixes a MS1252 handling bug in JDK1.4.2.
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+@@ -45,13 +44,13 @@
+     public static CharsetEncoder createEncoder( String encodin ) {
+         Charset cs = Charset.forName(System.getProperty("file.encoding"));
+         CharsetEncoder encoder = cs.newEncoder();
+-        
++
+         if( cs.getClass().getName().equals("sun.nio.cs.MS1252") ) {
+             try {
+                 // at least JDK1.4.2_01 has a bug in MS1252 encoder.
+                 // specifically, it returns true for any character.
+                 // return a correct encoder to workaround this problem
+-                
++
+                 // statically binding to MS1252Encoder will cause a Link error
+                 // (at least in IBM JDK1.4.1)
+                 Class ms1252encoder = Class.forName("com.sun.codemodel.internal.util.MS1252Encoder");
+@@ -66,7 +65,7 @@
+                 return encoder;
+             }
+         }
+-        
++
+         return encoder;
+     }
+ }
+--- old/src/share/classes/com/sun/codemodel/internal/util/JavadocEscapeWriter.java	Thu Jul 30 17:12:26 2009
++++ openjdk/jaxws/src/share/classes/com/sun/codemodel/internal/util/JavadocEscapeWriter.java	Thu Jul 30 17:12:25 2009
+@@ -31,9 +31,9 @@
+ /**
+  * {@link Writer} that escapes characters that are unsafe
+  * as Javadoc comments.
+- * 
++ *
+  * Such characters include '&lt;' and '&amp;'.
+- * 
++ *
+  * <p>
+  * Note that this class doesn't escape other Unicode characters
+  * that are typically unsafe. For example, &#x611B; (A kanji
+@@ -40,16 +40,16 @@
+  * that means "love") can be considered as unsafe because
+  * javac with English Windows cannot accept this character in the
+  * source code.
+- * 
++ *
+  * <p>
+  * If the application needs to escape such characters as well, then
+  * they are on their own.
+- * 
++ *
+  * @author
+- * 	Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
++ *      Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+ public class JavadocEscapeWriter extends FilterWriter {
+-    
++
+     public JavadocEscapeWriter( Writer next ) {
+         super(next);
+     }
+@@ -63,7 +63,7 @@
+         else
+             out.write(ch);
+     }
+-    
++
+     public void write(char[] buf, int off, int len) throws IOException {
+         for( int i=0; i<len; i++ )
+             write(buf[off+i]);
+@@ -76,7 +76,7 @@
+     public void write(String buf, int off, int len) throws IOException {
+         write( buf.toCharArray(), off, len );
+     }
+-    
++
+     public void write(String buf) throws IOException {
+         write( buf.toCharArray(), 0, buf.length() );
+     }
+--- old/src/share/classes/com/sun/codemodel/internal/util/MS1252Encoder.java	Thu Jul 30 17:12:29 2009
++++ openjdk/jaxws/src/share/classes/com/sun/codemodel/internal/util/MS1252Encoder.java	Thu Jul 30 17:12:28 2009
+@@ -22,11 +22,10 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ /*
+  * @(#)$Id: MS1252Encoder.java,v 1.2 2005/09/10 19:07:33 kohsuke Exp $
+  */
+-
+-
+ package com.sun.codemodel.internal.util;
+ 
+ import java.nio.charset.Charset;
+@@ -33,12 +32,12 @@
+ 
+ /**
+  * MS1252 encoder that corrects a bug in JDK1.4.2_01.
+- * 
++ *
+  * <p>
+  * See
+  * http://www.microsoft.com/globaldev/reference/sbcs/1252.htm
+  * for the normative definition.
+- * 
++ *
+  * This code depends on Sun internal package, so we have to make sure
+  * it won't be executed on other JDKs.
+  */
+@@ -49,171 +48,171 @@
+     }
+ 
+     private final static String index2 =
+-        "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007" + 
+-        "\b\t\n\u000B\f\r\u000E\u000F" + 
+-        "\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017" + 
+-        "\u0018\u0019\u001A\u001B\u001C\u001D\u001E\u001F" + 
+-        "\u0020\u0021\"\u0023\u0024\u0025\u0026\'" + 
+-        "\u0028\u0029\u002A\u002B\u002C\u002D\u002E\u002F" + 
+-        "\u0030\u0031\u0032\u0033\u0034\u0035\u0036\u0037" + 
+-        "\u0038\u0039\u003A\u003B\u003C\u003D\u003E\u003F" + 
+-        "\u0040\u0041\u0042\u0043\u0044\u0045\u0046\u0047" + 
+-        "\u0048\u0049\u004A\u004B\u004C\u004D\u004E\u004F" + 
+-        "\u0050\u0051\u0052\u0053\u0054\u0055\u0056\u0057" + 
+-        "\u0058\u0059\u005A\u005B\\\u005D\u005E\u005F" + 
+-        "\u0060\u0061\u0062\u0063\u0064\u0065\u0066\u0067" + 
+-        "\u0068\u0069\u006A\u006B\u006C\u006D\u006E\u006F" + 
+-        "\u0070\u0071\u0072\u0073\u0074\u0075\u0076\u0077" + 
+-        "\u0078\u0079\u007A\u007B\u007C\u007D\u007E\u007F" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u00A0\u00A1\u00A2\u00A3\u00A4\u00A5\u00A6\u00A7" + 
+-        "\u00A8\u00A9\u00AA\u00AB\u00AC\u00AD\u00AE\u00AF" + 
+-        "\u00B0\u00B1\u00B2\u00B3\u00B4\u00B5\u00B6\u00B7" + 
+-        "\u00B8\u00B9\u00BA\u00BB\u00BC\u00BD\u00BE\u00BF" + 
+-        "\u00C0\u00C1\u00C2\u00C3\u00C4\u00C5\u00C6\u00C7" + 
+-        "\u00C8\u00C9\u00CA\u00CB\u00CC\u00CD\u00CE\u00CF" + 
+-        "\u00D0\u00D1\u00D2\u00D3\u00D4\u00D5\u00D6\u00D7" + 
+-        "\u00D8\u00D9\u00DA\u00DB\u00DC\u00DD\u00DE\u00DF" + 
+-        "\u00E0\u00E1\u00E2\u00E3\u00E4\u00E5\u00E6\u00E7" + 
+-        "\u00E8\u00E9\u00EA\u00EB\u00EC\u00ED\u00EE\u00EF" + 
+-        "\u00F0\u00F1\u00F2\u00F3\u00F4\u00F5\u00F6\u00F7" + 
+-        "\u00F8\u00F9\u00FA\u00FB\u00FC\u00FD\u00FE\u00FF" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u008C\u009C\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u008A\u009A\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u009F\u0000\u0000\u0000\u0000\u008E\u009E\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0083\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0088\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0098\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0096\u0097\u0000" + 
+-        "\u0000\u0000\u0091\u0092\u0082\u0000\u0093\u0094" + 
+-        "\u0084\u0000\u0086\u0087\u0095\u0000\u0000\u0000" + 
+-        "\u0085\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0089\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u008B\u009B\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0080\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0099\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" + 
+-        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"; 
++        "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007" +
++        "\b\t\n\u000B\f\r\u000E\u000F" +
++        "\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017" +
++        "\u0018\u0019\u001A\u001B\u001C\u001D\u001E\u001F" +
++        "\u0020\u0021\"\u0023\u0024\u0025\u0026\'" +
++        "\u0028\u0029\u002A\u002B\u002C\u002D\u002E\u002F" +
++        "\u0030\u0031\u0032\u0033\u0034\u0035\u0036\u0037" +
++        "\u0038\u0039\u003A\u003B\u003C\u003D\u003E\u003F" +
++        "\u0040\u0041\u0042\u0043\u0044\u0045\u0046\u0047" +
++        "\u0048\u0049\u004A\u004B\u004C\u004D\u004E\u004F" +
++        "\u0050\u0051\u0052\u0053\u0054\u0055\u0056\u0057" +
++        "\u0058\u0059\u005A\u005B\\\u005D\u005E\u005F" +
++        "\u0060\u0061\u0062\u0063\u0064\u0065\u0066\u0067" +
++        "\u0068\u0069\u006A\u006B\u006C\u006D\u006E\u006F" +
++        "\u0070\u0071\u0072\u0073\u0074\u0075\u0076\u0077" +
++        "\u0078\u0079\u007A\u007B\u007C\u007D\u007E\u007F" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u00A0\u00A1\u00A2\u00A3\u00A4\u00A5\u00A6\u00A7" +
++        "\u00A8\u00A9\u00AA\u00AB\u00AC\u00AD\u00AE\u00AF" +
++        "\u00B0\u00B1\u00B2\u00B3\u00B4\u00B5\u00B6\u00B7" +
++        "\u00B8\u00B9\u00BA\u00BB\u00BC\u00BD\u00BE\u00BF" +
++        "\u00C0\u00C1\u00C2\u00C3\u00C4\u00C5\u00C6\u00C7" +
++        "\u00C8\u00C9\u00CA\u00CB\u00CC\u00CD\u00CE\u00CF" +
++        "\u00D0\u00D1\u00D2\u00D3\u00D4\u00D5\u00D6\u00D7" +
++        "\u00D8\u00D9\u00DA\u00DB\u00DC\u00DD\u00DE\u00DF" +
++        "\u00E0\u00E1\u00E2\u00E3\u00E4\u00E5\u00E6\u00E7" +
++        "\u00E8\u00E9\u00EA\u00EB\u00EC\u00ED\u00EE\u00EF" +
++        "\u00F0\u00F1\u00F2\u00F3\u00F4\u00F5\u00F6\u00F7" +
++        "\u00F8\u00F9\u00FA\u00FB\u00FC\u00FD\u00FE\u00FF" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u008C\u009C\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u008A\u009A\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u009F\u0000\u0000\u0000\u0000\u008E\u009E\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0083\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0088\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0098\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0096\u0097\u0000" +
++        "\u0000\u0000\u0091\u0092\u0082\u0000\u0093\u0094" +
++        "\u0084\u0000\u0086\u0087\u0095\u0000\u0000\u0000" +
++        "\u0085\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0089\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u008B\u009B\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0080\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0099\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" +
++        "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000";
+ 
+     private final static short index1[] = {
+-        0, 256, 461, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 
+-        403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 
+-        698, 920, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 
+-        403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 
+-        403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 
+-        403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 
+-        403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 
+-        403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 
+-        403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 
+-        403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 
+-        403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 
+-        403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 
+-        403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 
+-        403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 
+-        403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 
+-        403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 
++        0, 256, 461, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403,
++        403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403,
++        698, 920, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403,
++        403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403,
++        403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403,
++        403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403,
++        403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403,
++        403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403,
++        403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403,
++        403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403,
++        403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403,
++        403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403,
++        403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403,
++        403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403,
++        403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403,
++        403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403,
+     };
+ 
+     public boolean canEncode(char c) {
+--- old/src/share/classes/com/sun/codemodel/internal/util/SingleByteEncoder.java	Thu Jul 30 17:12:32 2009
++++ openjdk/jaxws/src/share/classes/com/sun/codemodel/internal/util/SingleByteEncoder.java	Thu Jul 30 17:12:32 2009
+@@ -24,7 +24,7 @@
+  */
+ 
+ /*
+- * @(#)SingleByteEncoder.java	1.14 03/01/23
++ * @(#)SingleByteEncoder.java   1.14 03/01/23
+  */
+ 
+ package com.sun.codemodel.internal.util;
+@@ -51,109 +51,109 @@
+     private final Surrogate.Parser sgp = new Surrogate.Parser();
+ 
+     protected SingleByteEncoder(Charset cs,
+-				short[] index1, String index2,
+-				int mask1, int mask2, int shift)
++                                short[] index1, String index2,
++                                int mask1, int mask2, int shift)
+     {
+-	super(cs, 1.0f, 1.0f);
+-	this.index1 = index1;
+-	this.index2 = index2;
+-	this.mask1 = mask1;
+-	this.mask2 = mask2;
+-	this.shift = shift;
++        super(cs, 1.0f, 1.0f);
++        this.index1 = index1;
++        this.index2 = index2;
++        this.mask1 = mask1;
++        this.mask2 = mask2;
++        this.shift = shift;
+     }
+ 
+     public boolean canEncode(char c) {
+-	char testEncode;
+-	testEncode = index2.charAt(index1[(c & mask1) >> shift]
+-				   + (c & mask2));
+-	if (testEncode == '\u0000')
+-	    return false;
+-	else
+-	    return true;
++        char testEncode;
++        testEncode = index2.charAt(index1[(c & mask1) >> shift]
++                                   + (c & mask2));
++        if (testEncode == '\u0000')
++            return false;
++        else
++            return true;
+     }
+ 
+     private CoderResult encodeArrayLoop(CharBuffer src, ByteBuffer dst) {
+-	char[] sa = src.array();
+-	int sp = src.arrayOffset() + src.position();
+-	int sl = src.arrayOffset() + src.limit();
+-	sp = (sp <= sl ? sp : sl);
+-	byte[] da = dst.array();
+-	int dp = dst.arrayOffset() + dst.position();
+-	int dl = dst.arrayOffset() + dst.limit();
+-	dp = (dp <= dl ? dp : dl);
++        char[] sa = src.array();
++        int sp = src.arrayOffset() + src.position();
++        int sl = src.arrayOffset() + src.limit();
++        sp = (sp <= sl ? sp : sl);
++        byte[] da = dst.array();
++        int dp = dst.arrayOffset() + dst.position();
++        int dl = dst.arrayOffset() + dst.limit();
++        dp = (dp <= dl ? dp : dl);
+ 
+-	try {
+-	    while (sp < sl) {
+-		char c = sa[sp];
+-		if (Surrogate.is(c)) {
+-		    if (sgp.parse(c, sa, sp, sl) < 0)
+-			return sgp.error();
+-		    return sgp.unmappableResult();
+-		}
+-		if (c >= '\uFFFE')
+-		    return CoderResult.unmappableForLength(1);
+-		if (dl - dp < 1)
+-		    return CoderResult.OVERFLOW;
++        try {
++            while (sp < sl) {
++                char c = sa[sp];
++                if (Surrogate.is(c)) {
++                    if (sgp.parse(c, sa, sp, sl) < 0)
++                        return sgp.error();
++                    return sgp.unmappableResult();
++                }
++                if (c >= '\uFFFE')
++                    return CoderResult.unmappableForLength(1);
++                if (dl - dp < 1)
++                    return CoderResult.OVERFLOW;
+ 
+-		char e = index2.charAt(index1[(c & mask1) >> shift]
+-				       + (c & mask2));
++                char e = index2.charAt(index1[(c & mask1) >> shift]
++                                       + (c & mask2));
+ 
+-		// If output byte is zero because input char is zero
+-		// then character is mappable, o.w. fail
+-		if (e == '\u0000' && c != '\u0000')
+-		    return CoderResult.unmappableForLength(1);
++                // If output byte is zero because input char is zero
++                // then character is mappable, o.w. fail
++                if (e == '\u0000' && c != '\u0000')
++                    return CoderResult.unmappableForLength(1);
+ 
+-		sp++;
+-		da[dp++] = (byte)e;
+-	    }
+-	    return CoderResult.UNDERFLOW;
+-	} finally {
+-	    src.position(sp - src.arrayOffset());
+-	    dst.position(dp - dst.arrayOffset());
+-	}
++                sp++;
++                da[dp++] = (byte)e;
++            }
++            return CoderResult.UNDERFLOW;
++        } finally {
++            src.position(sp - src.arrayOffset());
++            dst.position(dp - dst.arrayOffset());
++        }
+     }
+ 
+     private CoderResult encodeBufferLoop(CharBuffer src, ByteBuffer dst) {
+-	int mark = src.position();
+-	try {
+-	    while (src.hasRemaining()) {
+-		char c = src.get();
+-		if (Surrogate.is(c)) {
+-		    if (sgp.parse(c, src) < 0)
+-			return sgp.error();
+-		    return sgp.unmappableResult();
+-		}
+-		if (c >= '\uFFFE')
+-		    return CoderResult.unmappableForLength(1);
+-		if (!dst.hasRemaining())
+-		    return CoderResult.OVERFLOW;
++        int mark = src.position();
++        try {
++            while (src.hasRemaining()) {
++                char c = src.get();
++                if (Surrogate.is(c)) {
++                    if (sgp.parse(c, src) < 0)
++                        return sgp.error();
++                    return sgp.unmappableResult();
++                }
++                if (c >= '\uFFFE')
++                    return CoderResult.unmappableForLength(1);
++                if (!dst.hasRemaining())
++                    return CoderResult.OVERFLOW;
+ 
+-		char e = index2.charAt(index1[(c & mask1) >> shift]
+-				       + (c & mask2));
++                char e = index2.charAt(index1[(c & mask1) >> shift]
++                                       + (c & mask2));
+ 
+-		// If output byte is zero because input char is zero
+-		// then character is mappable, o.w. fail
+-		if (e == '\u0000' && c != '\u0000')
+-		    return CoderResult.unmappableForLength(1);
++                // If output byte is zero because input char is zero
++                // then character is mappable, o.w. fail
++                if (e == '\u0000' && c != '\u0000')
++                    return CoderResult.unmappableForLength(1);
+ 
+-		mark++;
+-		dst.put((byte)e);
+-	    }
+-	    return CoderResult.UNDERFLOW;
+-	} finally {
+-	    src.position(mark);
+-	}
++                mark++;
++                dst.put((byte)e);
++            }
++            return CoderResult.UNDERFLOW;
++        } finally {
++            src.position(mark);
++        }
+     }
+ 
+     protected CoderResult encodeLoop(CharBuffer src, ByteBuffer dst) {
+-	if (true && src.hasArray() && dst.hasArray())
+-	    return encodeArrayLoop(src, dst);
+-	else
+-	    return encodeBufferLoop(src, dst);
++        if (true && src.hasArray() && dst.hasArray())
++            return encodeArrayLoop(src, dst);
++        else
++            return encodeBufferLoop(src, dst);
+     }
+ 
+     public byte encode(char inputChar) {
+-	return (byte)index2.charAt(index1[(inputChar & mask1) >> shift] +
+-		(inputChar & mask2));
++        return (byte)index2.charAt(index1[(inputChar & mask1) >> shift] +
++                (inputChar & mask2));
+     }
+ }
+--- old/src/share/classes/com/sun/codemodel/internal/util/Surrogate.java	Thu Jul 30 17:12:36 2009
++++ openjdk/jaxws/src/share/classes/com/sun/codemodel/internal/util/Surrogate.java	Thu Jul 30 17:12:35 2009
+@@ -58,7 +58,7 @@
+      * Tells whether or not the given UTF-16 value is a high surrogate.
+      */
+     public static boolean isHigh(int c) {
+-	return (MIN_HIGH <= c) && (c <= MAX_HIGH);
++        return (MIN_HIGH <= c) && (c <= MAX_HIGH);
+     }
+ 
+     /**
+@@ -65,7 +65,7 @@
+      * Tells whether or not the given UTF-16 value is a low surrogate.
+      */
+     public static boolean isLow(int c) {
+-	return (MIN_LOW <= c) && (c <= MAX_LOW);
++        return (MIN_LOW <= c) && (c <= MAX_LOW);
+     }
+ 
+     /**
+@@ -72,7 +72,7 @@
+      * Tells whether or not the given UTF-16 value is a surrogate character,
+      */
+     public static boolean is(int c) {
+-	return (MIN <= c) && (c <= MAX);
++        return (MIN <= c) && (c <= MAX);
+     }
+ 
+     /**
+@@ -80,7 +80,7 @@
+      * surrogate pair in UTF-16.
+      */
+     public static boolean neededFor(int uc) {
+-	return (uc >= UCS4_MIN) && (uc <= UCS4_MAX);
++        return (uc >= UCS4_MIN) && (uc <= UCS4_MAX);
+     }
+ 
+     /**
+@@ -87,7 +87,7 @@
+      * Returns the high UTF-16 surrogate for the given UCS-4 character.
+      */
+     public static char high(int uc) {
+-	return (char)(0xd800 | (((uc - UCS4_MIN) >> 10) & 0x3ff));
++        return (char)(0xd800 | (((uc - UCS4_MIN) >> 10) & 0x3ff));
+     }
+ 
+     /**
+@@ -94,7 +94,7 @@
+      * Returns the low UTF-16 surrogate for the given UCS-4 character.
+      */
+     public static char low(int uc) {
+-	return (char)(0xdc00 | ((uc - UCS4_MIN) & 0x3ff));
++        return (char)(0xdc00 | ((uc - UCS4_MIN) & 0x3ff));
+     }
+ 
+     /**
+@@ -101,7 +101,7 @@
+      * Converts the given surrogate pair into a 32-bit UCS-4 character.
+      */
+     public static int toUCS4(char c, char d) {
+-	return (((c & 0x3ff) << 10) | (d & 0x3ff)) + 0x10000;
++        return (((c & 0x3ff) << 10) | (d & 0x3ff)) + 0x10000;
+     }
+ 
+     /**
+@@ -110,130 +110,130 @@
+      */
+     public static class Parser {
+ 
+-	public Parser() { }
++        public Parser() { }
+ 
+-	private int character;		// UCS-4
+-	private CoderResult error = CoderResult.UNDERFLOW;
+-	private boolean isPair;
++        private int character;          // UCS-4
++        private CoderResult error = CoderResult.UNDERFLOW;
++        private boolean isPair;
+ 
+-	/**
+-	 * Returns the UCS-4 character previously parsed.
+-	 */
+-	public int character() {
+-	    return character;
+-	}
++        /**
++         * Returns the UCS-4 character previously parsed.
++         */
++        public int character() {
++            return character;
++        }
+ 
+-	/**
+-	 * Tells whether or not the previously-parsed UCS-4 character was
+-	 * originally represented by a surrogate pair.
+-	 */
+-	public boolean isPair() {
+-	    return isPair;
+-	}
++        /**
++         * Tells whether or not the previously-parsed UCS-4 character was
++         * originally represented by a surrogate pair.
++         */
++        public boolean isPair() {
++            return isPair;
++        }
+ 
+-	/**
+-	 * Returns the number of UTF-16 characters consumed by the previous
+-	 * parse.
+-	 */
+-	public int increment() {
+-	    return isPair ? 2 : 1;
+-	}
++        /**
++         * Returns the number of UTF-16 characters consumed by the previous
++         * parse.
++         */
++        public int increment() {
++            return isPair ? 2 : 1;
++        }
+ 
+-	/**
+-	 * If the previous parse operation detected an error, return the object
+-	 * describing that error.
+-	 */
+-	public CoderResult error() {
+-	    return error;
+-	}
++        /**
++         * If the previous parse operation detected an error, return the object
++         * describing that error.
++         */
++        public CoderResult error() {
++            return error;
++        }
+ 
+-	/**
+-	 * Returns an unmappable-input result object, with the appropriate
+-	 * input length, for the previously-parsed character.
+-	 */
+-	public CoderResult unmappableResult() {
+-	    return CoderResult.unmappableForLength(isPair ? 2 : 1);
+-	}
++        /**
++         * Returns an unmappable-input result object, with the appropriate
++         * input length, for the previously-parsed character.
++         */
++        public CoderResult unmappableResult() {
++            return CoderResult.unmappableForLength(isPair ? 2 : 1);
++        }
+ 
+-	/**
+-	 * Parses a UCS-4 character from the given source buffer, handling
+-	 * surrogates.
+-	 *
+-	 * @param  c    The first character
+-	 * @param  in   The source buffer, from which one more character
+-	 *              will be consumed if c is a high surrogate
+-	 *
+-	 * @return   Either a parsed UCS-4 character, in which case the isPair()
+-	 *           and increment() methods will return meaningful values, or
+-	 *           -1, in which case error() will return a descriptive result
+-	 *           object
+-	 */
+-	public int parse(char c, CharBuffer in) {
+-	    if (isHigh(c)) {
+-		if (!in.hasRemaining()) {
+-		    error = CoderResult.UNDERFLOW;
+-		    return -1;
+-		}
+-		char d = in.get();
+-		if (isLow(d)) {
+-		    character = toUCS4(c, d);
+-		    isPair = true;
+-		    error = null;
+-		    return character;
+-		}
+-		error = CoderResult.malformedForLength(1);
+-		return -1;
+-	    }
+-	    if (isLow(c)) {
+-		error = CoderResult.malformedForLength(1);
+-		return -1;
+-	    }
+-	    character = c;
+-	    isPair = false;
+-	    error = null;
+-	    return character;
+-	}
++        /**
++         * Parses a UCS-4 character from the given source buffer, handling
++         * surrogates.
++         *
++         * @param  c    The first character
++         * @param  in   The source buffer, from which one more character
++         *              will be consumed if c is a high surrogate
++         *
++         * @return   Either a parsed UCS-4 character, in which case the isPair()
++         *           and increment() methods will return meaningful values, or
++         *           -1, in which case error() will return a descriptive result
++         *           object
++         */
++        public int parse(char c, CharBuffer in) {
++            if (isHigh(c)) {
++                if (!in.hasRemaining()) {
++                    error = CoderResult.UNDERFLOW;
++                    return -1;
++                }
++                char d = in.get();
++                if (isLow(d)) {
++                    character = toUCS4(c, d);
++                    isPair = true;
++                    error = null;
++                    return character;
++                }
++                error = CoderResult.malformedForLength(1);
++                return -1;
++            }
++            if (isLow(c)) {
++                error = CoderResult.malformedForLength(1);
++                return -1;
++            }
++            character = c;
++            isPair = false;
++            error = null;
++            return character;
++        }
+ 
+-	/**
+-	 * Parses a UCS-4 character from the given source buffer, handling
+-	 * surrogates.
+-	 *
+-	 * @param  c    The first character
+-	 * @param  ia   The input array, from which one more character
+-	 *              will be consumed if c is a high surrogate
+-	 * @param  ip   The input index
+-	 * @param  il   The input limit
+-	 *
+-	 * @return   Either a parsed UCS-4 character, in which case the isPair()
+-	 *           and increment() methods will return meaningful values, or
+-	 *           -1, in which case error() will return a descriptive result
+-	 *           object
+-	 */
+-	public int parse(char c, char[] ia, int ip, int il) {
+-	    if (isHigh(c)) {
+-		if (il - ip < 2) {
+-		    error = CoderResult.UNDERFLOW;
+-		    return -1;
+-		}
+-		char d = ia[ip + 1];
+-		if (isLow(d)) {
+-		    character = toUCS4(c, d);
+-		    isPair = true;
+-		    error = null;
+-		    return character;
+-		}
+-		error = CoderResult.malformedForLength(1);
+-		return -1;
+-	    }
+-	    if (isLow(c)) {
+-		error = CoderResult.malformedForLength(1);
+-		return -1;
+-	    }
+-	    character = c;
+-	    isPair = false;
+-	    error = null;
+-	    return character;
+-	}
++        /**
++         * Parses a UCS-4 character from the given source buffer, handling
++         * surrogates.
++         *
++         * @param  c    The first character
++         * @param  ia   The input array, from which one more character
++         *              will be consumed if c is a high surrogate
++         * @param  ip   The input index
++         * @param  il   The input limit
++         *
++         * @return   Either a parsed UCS-4 character, in which case the isPair()
++         *           and increment() methods will return meaningful values, or
++         *           -1, in which case error() will return a descriptive result
++         *           object
++         */
++        public int parse(char c, char[] ia, int ip, int il) {
++            if (isHigh(c)) {
++                if (il - ip < 2) {
++                    error = CoderResult.UNDERFLOW;
++                    return -1;
++                }
++                char d = ia[ip + 1];
++                if (isLow(d)) {
++                    character = toUCS4(c, d);
++                    isPair = true;
++                    error = null;
++                    return character;
++                }
++                error = CoderResult.malformedForLength(1);
++                return -1;
++            }
++            if (isLow(c)) {
++                error = CoderResult.malformedForLength(1);
++                return -1;
++            }
++            character = c;
++            isPair = false;
++            error = null;
++            return character;
++        }
+ 
+     }
+ 
+@@ -244,111 +244,111 @@
+      */
+     public static class Generator {
+ 
+-	public Generator() { }
++        public Generator() { }
+ 
+-	private CoderResult error = CoderResult.OVERFLOW;
++        private CoderResult error = CoderResult.OVERFLOW;
+ 
+-	/**
+-	 * If the previous generation operation detected an error, return the
+-	 * object describing that error.
+-	 */
+-	public CoderResult error() {
+-	    return error;
+-	}
++        /**
++         * If the previous generation operation detected an error, return the
++         * object describing that error.
++         */
++        public CoderResult error() {
++            return error;
++        }
+ 
+-	/**
+-	 * Generates one or two UTF-16 characters to represent the given UCS-4
+-	 * character.
+-	 *
+-	 * @param  uc   The UCS-4 character
+-	 * @param  len  The number of input bytes from which the UCS-4 value
+-	 *              was constructed (used when creating result objects)
+-	 * @param  dst  The destination buffer, to which one or two UTF-16
+-	 *              characters will be written
+-	 *
+-	 * @return   Either a positive count of the number of UTF-16 characters
+-	 *           written to the destination buffer, or -1, in which case
+-	 *           error() will return a descriptive result object
+-	 */
+-	public int generate(int uc, int len, CharBuffer dst) {
+-	    if (uc <= 0xffff) {
+-		if (is(uc)) {
+-		    error = CoderResult.malformedForLength(len);
+-		    return -1;
+-		}
+-		if (dst.remaining() < 1) {
+-		    error = CoderResult.OVERFLOW;
+-		    return -1;
+-		}
+-		dst.put((char)uc);
+-		error = null;
+-		return 1;
+-	    }
+-	    if (uc < UCS4_MIN) {
+-		error = CoderResult.malformedForLength(len);
+-		return -1;
+-	    }
+-	    if (uc <= UCS4_MAX) {
+-		if (dst.remaining() < 2) {
+-		    error = CoderResult.OVERFLOW;
+-		    return -1;
+-		}
+-		dst.put(high(uc));
+-		dst.put(low(uc));
+-		error = null;
+-		return 2;
+-	    }
+-	    error = CoderResult.unmappableForLength(len);
+-	    return -1;
+-	}
++        /**
++         * Generates one or two UTF-16 characters to represent the given UCS-4
++         * character.
++         *
++         * @param  uc   The UCS-4 character
++         * @param  len  The number of input bytes from which the UCS-4 value
++         *              was constructed (used when creating result objects)
++         * @param  dst  The destination buffer, to which one or two UTF-16
++         *              characters will be written
++         *
++         * @return   Either a positive count of the number of UTF-16 characters
++         *           written to the destination buffer, or -1, in which case
++         *           error() will return a descriptive result object
++         */
++        public int generate(int uc, int len, CharBuffer dst) {
++            if (uc <= 0xffff) {
++                if (is(uc)) {
++                    error = CoderResult.malformedForLength(len);
++                    return -1;
++                }
++                if (dst.remaining() < 1) {
++                    error = CoderResult.OVERFLOW;
++                    return -1;
++                }
++                dst.put((char)uc);
++                error = null;
++                return 1;
++            }
++            if (uc < UCS4_MIN) {
++                error = CoderResult.malformedForLength(len);
++                return -1;
++            }
++            if (uc <= UCS4_MAX) {
++                if (dst.remaining() < 2) {
++                    error = CoderResult.OVERFLOW;
++                    return -1;
++                }
++                dst.put(high(uc));
++                dst.put(low(uc));
++                error = null;
++                return 2;
++            }
++            error = CoderResult.unmappableForLength(len);
++            return -1;
++        }
+ 
+-	/**
+-	 * Generates one or two UTF-16 characters to represent the given UCS-4
+-	 * character.
+-	 *
+-	 * @param  uc   The UCS-4 character
+-	 * @param  len  The number of input bytes from which the UCS-4 value
+-	 *              was constructed (used when creating result objects)
+-	 * @param  da   The destination array, to which one or two UTF-16
+-	 *              characters will be written
+-	 * @param  dp   The destination position
+-	 * @param  dl   The destination limit
+-	 *
+-	 * @return   Either a positive count of the number of UTF-16 characters
+-	 *           written to the destination buffer, or -1, in which case
+-	 *           error() will return a descriptive result object
+-	 */
+-	public int generate(int uc, int len, char[] da, int dp, int dl) {
+-	    if (uc <= 0xffff) {
+-		if (is(uc)) {
+-		    error = CoderResult.malformedForLength(len);
+-		    return -1;
+-		}
+-		if (dl - dp < 1) {
+-		    error = CoderResult.OVERFLOW;
+-		    return -1;
+-		}
+-		da[dp] = (char)uc;
+-		error = null;
+-		return 1;
+-	    }
+-	    if (uc < UCS4_MIN) {
+-		error = CoderResult.malformedForLength(len);
+-		return -1;
+-	    }
+-	    if (uc <= UCS4_MAX) {
+-		if (dl - dp < 2) {
+-		    error = CoderResult.OVERFLOW;
+-		    return -1;
+-		}
+-		da[dp] = high(uc);
+-		da[dp + 1] = low(uc);
+-		error = null;
+-		return 2;
+-	    }
+-	    error = CoderResult.unmappableForLength(len);
+-	    return -1;
+-	}
++        /**
++         * Generates one or two UTF-16 characters to represent the given UCS-4
++         * character.
++         *
++         * @param  uc   The UCS-4 character
++         * @param  len  The number of input bytes from which the UCS-4 value
++         *              was constructed (used when creating result objects)
++         * @param  da   The destination array, to which one or two UTF-16
++         *              characters will be written
++         * @param  dp   The destination position
++         * @param  dl   The destination limit
++         *
++         * @return   Either a positive count of the number of UTF-16 characters
++         *           written to the destination buffer, or -1, in which case
++         *           error() will return a descriptive result object
++         */
++        public int generate(int uc, int len, char[] da, int dp, int dl) {
++            if (uc <= 0xffff) {
++                if (is(uc)) {
++                    error = CoderResult.malformedForLength(len);
++                    return -1;
++                }
++                if (dl - dp < 1) {
++                    error = CoderResult.OVERFLOW;
++                    return -1;
++                }
++                da[dp] = (char)uc;
++                error = null;
++                return 1;
++            }
++            if (uc < UCS4_MIN) {
++                error = CoderResult.malformedForLength(len);
++                return -1;
++            }
++            if (uc <= UCS4_MAX) {
++                if (dl - dp < 2) {
++                    error = CoderResult.OVERFLOW;
++                    return -1;
++                }
++                da[dp] = high(uc);
++                da[dp + 1] = low(uc);
++                error = null;
++                return 2;
++            }
++            error = CoderResult.unmappableForLength(len);
++            return -1;
++        }
+ 
+     }
+ 
+--- old/src/share/classes/com/sun/codemodel/internal/util/UnicodeEscapeWriter.java	Thu Jul 30 17:12:39 2009
++++ openjdk/jaxws/src/share/classes/com/sun/codemodel/internal/util/UnicodeEscapeWriter.java	Thu Jul 30 17:12:39 2009
+@@ -31,15 +31,15 @@
+ /**
+  * {@link Writer} that escapes non US-ASCII characters into
+  * Java Unicode escape \\uXXXX.
+- * 
++ *
+  * This process is necessary if the method names or field names
+  * contain non US-ASCII characters.
+- * 
++ *
+  * @author
+- * 	Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
++ *      Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+ public class UnicodeEscapeWriter extends FilterWriter {
+-    
++
+     public UnicodeEscapeWriter( Writer next ) {
+         super(next);
+     }
+@@ -58,17 +58,17 @@
+ 
+     /**
+      * Can be overrided. Return true if the character
+-     * needs to be escaped. 
++     * needs to be escaped.
+      */
+     protected boolean requireEscaping(int ch) {
+         if(ch>=128)     return true;
+-        
++
+         // control characters
+         if( ch<0x20 && " \t\r\n".indexOf(ch)==-1 )  return true;
+-        
++
+         return false;
+     }
+-    
++
+     public final void write(char[] buf, int off, int len) throws IOException {
+         for( int i=0; i<len; i++ )
+             write(buf[off+i]);
+@@ -81,7 +81,7 @@
+     public final void write(String buf, int off, int len) throws IOException {
+         write( buf.toCharArray(), off, len );
+     }
+-    
++
+     public final void write(String buf) throws IOException {
+         write( buf.toCharArray(), 0, buf.length() );
+     }
+--- old/src/share/classes/com/sun/codemodel/internal/writer/FileCodeWriter.java	Thu Jul 30 17:12:43 2009
++++ openjdk/jaxws/src/share/classes/com/sun/codemodel/internal/writer/FileCodeWriter.java	Thu Jul 30 17:12:42 2009
+@@ -36,25 +36,25 @@
+ 
+ /**
+  * Writes all the source files under the specified file folder.
+- * 
++ *
+  * @author
+- * 	Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
++ *      Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+ public class FileCodeWriter extends CodeWriter {
+ 
+     /** The target directory to put source code. */
+     private final File target;
+-    
++
+     /** specify whether or not to mark the generated files read-only */
+     private final boolean readOnly;
+ 
+     /** Files that shall be marked as read only. */
+     private final Set<File> readonlyFiles = new HashSet<File>();
+-    
++
+     public FileCodeWriter( File target ) throws IOException {
+         this(target,false);
+     }
+-    
++
+     public FileCodeWriter( File target, boolean readOnly ) throws IOException {
+         this.target = target;
+         this.readOnly = readOnly;
+@@ -61,12 +61,12 @@
+         if(!target.exists() || !target.isDirectory())
+             throw new IOException(target + ": non-existent directory");
+     }
+-    
+-    
++
++
+     public OutputStream openBinary(JPackage pkg, String fileName) throws IOException {
+         return new FileOutputStream(getFile(pkg,fileName));
+     }
+-    
++
+     protected File getFile(JPackage pkg, String fileName ) throws IOException {
+         File dir;
+         if(pkg.isUnnamed())
+@@ -73,17 +73,17 @@
+             dir = target;
+         else
+             dir = new File(target, toDirName(pkg));
+-        
++
+         if(!dir.exists())   dir.mkdirs();
+-        
++
+         File fn = new File(dir,fileName);
+-        
++
+         if (fn.exists()) {
+             if (!fn.delete())
+                 throw new IOException(fn + ": Can't delete previous version");
+         }
+-        
+-        
++
++
+         if(readOnly)        readonlyFiles.add(fn);
+         return fn;
+     }
+@@ -93,7 +93,7 @@
+         for (File f : readonlyFiles)
+             f.setReadOnly();
+     }
+-    
++
+     /** Converts a package name to the directory name. */
+     private static String toDirName( JPackage pkg ) {
+         return pkg.name().replace('.',File.separatorChar);
+--- old/src/share/classes/com/sun/codemodel/internal/writer/FilterCodeWriter.java	Thu Jul 30 17:12:46 2009
++++ openjdk/jaxws/src/share/classes/com/sun/codemodel/internal/writer/FilterCodeWriter.java	Thu Jul 30 17:12:46 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.codemodel.internal.writer;
+ 
+ import java.io.OutputStream;
+--- old/src/share/classes/com/sun/codemodel/internal/writer/ProgressCodeWriter.java	Thu Jul 30 17:12:50 2009
++++ openjdk/jaxws/src/share/classes/com/sun/codemodel/internal/writer/ProgressCodeWriter.java	Thu Jul 30 17:12:49 2009
+@@ -36,9 +36,9 @@
+ /**
+  * Filter CodeWriter that writes a progress message to the specified
+  * PrintStream.
+- * 
++ *
+  * @author
+- * 	Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
++ *      Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+ public class ProgressCodeWriter extends FilterCodeWriter {
+     public ProgressCodeWriter( CodeWriter output, PrintStream progress ) {
+@@ -49,7 +49,7 @@
+     }
+ 
+     private final PrintStream progress;
+-    
++
+     public OutputStream openBinary(JPackage pkg, String fileName) throws IOException {
+         report(pkg, fileName);
+         return super.openBinary(pkg,fileName);
+@@ -59,7 +59,7 @@
+         report(pkg, fileName);
+         return super.openSource(pkg,fileName);
+     }
+-    
++
+     private void report(JPackage pkg, String fileName) {
+         if(pkg.isUnnamed()) progress.println(fileName);
+         else
+--- old/src/share/classes/com/sun/codemodel/internal/writer/PrologCodeWriter.java	Thu Jul 30 17:12:53 2009
++++ openjdk/jaxws/src/share/classes/com/sun/codemodel/internal/writer/PrologCodeWriter.java	Thu Jul 30 17:12:52 2009
+@@ -32,17 +32,17 @@
+ import com.sun.codemodel.internal.JPackage;
+ 
+ /**
+- * Writes all the source files under the specified file folder and 
++ * Writes all the source files under the specified file folder and
+  * inserts a file prolog comment in each java source file.
+- * 
++ *
+  * @author
+  *  Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+ public class PrologCodeWriter extends FilterCodeWriter {
+-    
++
+     /** prolog comment */
+     private final String prolog;
+-    
++
+     /**
+      * @param core
+      *      This CodeWriter will be used to actually create a storage for files.
+@@ -53,23 +53,23 @@
+      *      This string may contain newlines to produce multi-line comments.
+      *      '//' will be inserted at the beginning of each line to make it
+      *      a valid Java comment, so the caller can just pass strings like
+-     *      "abc\ndef" 
++     *      "abc\ndef"
+      */
+     public PrologCodeWriter( CodeWriter core, String prolog ) {
+         super(core);
+         this.prolog = prolog;
+     }
+-    
+-    
++
++
+     public Writer openSource(JPackage pkg, String fileName) throws IOException {
+         Writer w = super.openSource(pkg,fileName);
+-        
++
+         PrintWriter out = new PrintWriter(w);
+-        
++
+         // write prolog if this is a java source file
+         if( prolog != null ) {
+             out.println( "//" );
+-            
++
+             String s = prolog;
+             int idx;
+             while( (idx=s.indexOf('\n'))!=-1 ) {
+@@ -80,7 +80,7 @@
+             out.println();
+         }
+         out.flush();    // we can't close the stream for that would close the undelying stream.
+-        
++
+         return w;
+     }
+ }
+--- old/src/share/classes/com/sun/codemodel/internal/writer/SingleStreamCodeWriter.java	Thu Jul 30 17:12:56 2009
++++ openjdk/jaxws/src/share/classes/com/sun/codemodel/internal/writer/SingleStreamCodeWriter.java	Thu Jul 30 17:12:56 2009
+@@ -35,17 +35,17 @@
+ /**
+  * Output all source files into a single stream with a little
+  * formatting header in front of each file.
+- * 
++ *
+  * This is primarily for human consumption of the generated source
+  * code, such as to debug/test CodeModel or to quickly inspect the result.
+- * 
++ *
+  * @author
+- * 	Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
++ *      Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+ public class SingleStreamCodeWriter extends CodeWriter {
+-    
++
+     private final PrintStream out;
+-    
++
+     /**
+      * @param os
+      *      This stream will be closed at the end of the code generation.
+@@ -57,11 +57,11 @@
+     public OutputStream openBinary(JPackage pkg, String fileName) throws IOException {
+         String pkgName = pkg.name();
+         if(pkgName.length()!=0)     pkgName += '.';
+-        
++
+         out.println(
+             "-----------------------------------" + pkgName+fileName +
+             "-----------------------------------");
+-            
++
+         return new FilterOutputStream(out) {
+             public void close() {
+                 // don't let this stream close
+--- old/src/share/classes/com/sun/codemodel/internal/writer/ZipCodeWriter.java	Thu Jul 30 17:13:00 2009
++++ openjdk/jaxws/src/share/classes/com/sun/codemodel/internal/writer/ZipCodeWriter.java	Thu Jul 30 17:12:59 2009
+@@ -35,9 +35,9 @@
+ 
+ /**
+  * Writes all the files into a zip file.
+- * 
++ *
+  * @author
+- * 	Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
++ *      Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+ public class ZipCodeWriter extends CodeWriter {
+     /**
+@@ -51,15 +51,15 @@
+             public void close() {}
+         };
+     }
+-    
++
+     private final ZipOutputStream zip;
+-    
++
+     private final OutputStream filter;
+-        
++
+     public OutputStream openBinary(JPackage pkg, String fileName) throws IOException {
+         String name = fileName;
+         if(!pkg.isUnnamed())    name = toDirName(pkg)+name;
+-        
++
+         zip.putNextEntry(new ZipEntry(name));
+         return filter;
+     }
+--- old/src/share/classes/com/sun/istack/internal/Nullable.java	Thu Jul 30 17:13:03 2009
++++ openjdk/jaxws/src/share/classes/com/sun/istack/internal/Nullable.java	Thu Jul 30 17:13:03 2009
+@@ -32,7 +32,7 @@
+ 
+ /**
+  * Designates that a field, return value, argument, or a variable may be null.
+- * 
++ *
+  * @author Kohsuke Kawaguchi
+  */
+ @Documented
+--- old/src/share/classes/com/sun/istack/internal/Pool.java	Thu Jul 30 17:13:07 2009
++++ openjdk/jaxws/src/share/classes/com/sun/istack/internal/Pool.java	Thu Jul 30 17:13:06 2009
+@@ -25,6 +25,7 @@
+ package com.sun.istack.internal;
+ 
+ import java.util.concurrent.ConcurrentLinkedQueue;
++import java.lang.ref.WeakReference;
+ 
+ /**
+  * Pool of reusable objects that are indistinguishable from each other,
+@@ -33,6 +34,7 @@
+  * @author Kohsuke Kawaguchi
+  */
+ public interface Pool<T> {
++
+     /**
+      * Gets a new object from the pool.
+      *
+@@ -46,7 +48,6 @@
+      */
+     void recycle(@NotNull T t);
+ 
+-
+     /**
+      * Default implementation that uses {@link ConcurrentLinkedQueue}
+      * as the data store.
+@@ -55,7 +56,10 @@
+      * <p>
+      * Don't rely on the fact that this class extends from {@link ConcurrentLinkedQueue}.
+      */
+-    public abstract class Impl<T> extends ConcurrentLinkedQueue<T> implements Pool<T> {
++    public abstract class Impl<T> implements Pool<T> {
++
++        private volatile WeakReference<ConcurrentLinkedQueue<T>> queue;
++
+         /**
+          * Gets a new object from the pool.
+          *
+@@ -66,9 +70,10 @@
+          *      always non-null.
+          */
+         public final @NotNull T take() {
+-            T t = super.poll();
+-            if(t==null)
++            T t = getQueue().poll();
++            if(t==null) {
+                 return create();
++            }
+             return t;
+         }
+ 
+@@ -76,9 +81,24 @@
+          * Returns an object back to the pool.
+          */
+         public final void recycle(T t) {
+-            super.offer(t);
++            getQueue().offer(t);
+         }
+ 
++        private ConcurrentLinkedQueue<T> getQueue() {
++            WeakReference<ConcurrentLinkedQueue<T>> q = queue;
++            if (q != null) {
++                ConcurrentLinkedQueue<T> d = q.get();
++                if (d != null) {
++                    return d;
++                }
++            }
++            // overwrite the queue
++            ConcurrentLinkedQueue<T> d = new ConcurrentLinkedQueue<T>();
++            queue = new WeakReference<ConcurrentLinkedQueue<T>>(d);
++
++            return d;
++        }
++
+         /**
+          * Creates a new instance of object.
+          *
+--- old/src/share/classes/com/sun/istack/internal/XMLStreamReaderToContentHandler.java	Thu Jul 30 17:13:10 2009
++++ openjdk/jaxws/src/share/classes/com/sun/istack/internal/XMLStreamReaderToContentHandler.java	Thu Jul 30 17:13:09 2009
+@@ -54,14 +54,24 @@
+ 
+     // if true, when the conversion is completed, leave the cursor to the last
+     // event that was fired (such as end element)
+-    private boolean eagerQuit;
++    private final boolean eagerQuit;
+ 
+     /**
+      * If true, not start/endDocument event.
+      */
+-    private boolean fragment;
++    private final boolean fragment;
+ 
++    // array of the even length of the form { prefix0, uri0, prefix1, uri1, ... }
++    private final String[] inscopeNamespaces;
++
+     /**
++     * @see #XMLStreamReaderToContentHandler(XMLStreamReader, ContentHandler, boolean, boolean, String[])
++     */
++    public XMLStreamReaderToContentHandler(XMLStreamReader staxCore, ContentHandler saxCore, boolean eagerQuit, boolean fragment) {
++        this(staxCore, saxCore, eagerQuit, fragment, new String[0]);
++    }
++
++    /**
+      * Construct a new StAX to SAX adapter that will convert a StAX event
+      * stream into a SAX event stream.
+      *
+@@ -69,14 +79,22 @@
+      *                StAX event source
+      * @param saxCore
+      *                SAXevent sink
++     * @param eagerQuit
++     * @param fragment
++     * @param inscopeNamespaces
++     *                array of the even length of the form { prefix0, uri0, prefix1, uri1, ... }
+      */
+-    public XMLStreamReaderToContentHandler(XMLStreamReader staxCore, ContentHandler saxCore, boolean eagerQuit, boolean fragment) {
++    public XMLStreamReaderToContentHandler(XMLStreamReader staxCore, ContentHandler saxCore,
++            boolean eagerQuit, boolean fragment, String[] inscopeNamespaces) {
+         this.staxStreamReader = staxCore;
+         this.saxHandler = saxCore;
+         this.eagerQuit = eagerQuit;
+         this.fragment = fragment;
++        this.inscopeNamespaces = inscopeNamespaces;
++        assert inscopeNamespaces.length%2 == 0;
+     }
+ 
++
+     /*
+      * @see StAXReaderToContentHandler#bridge()
+      */
+@@ -100,6 +118,10 @@
+ 
+             handleStartDocument();
+ 
++            for(int i=0; i < inscopeNamespaces.length; i+=2) {
++                saxHandler.startPrefixMapping(inscopeNamespaces[i], inscopeNamespaces[i+1]);
++            }
++
+             OUTER:
+             do {
+                 // These are all of the events listed in the javadoc for
+@@ -156,6 +178,10 @@
+                 event=staxStreamReader.next();
+             } while (depth!=0);
+ 
++            for(int i=0; i < inscopeNamespaces.length; i+=2) {
++                saxHandler.endPrefixMapping(inscopeNamespaces[i]);
++            }
++
+             handleEndDocument();
+         } catch (SAXException e) {
+             throw new XMLStreamException2(e);
+--- old/src/share/classes/com/sun/istack/internal/ws/AnnotationProcessorFactoryImpl.java	Thu Jul 30 17:13:14 2009
++++ openjdk/jaxws/src/share/classes/com/sun/istack/internal/ws/AnnotationProcessorFactoryImpl.java	Thu Jul 30 17:13:13 2009
+@@ -66,10 +66,7 @@
+         types.add("javax.jws.soap.SOAPBinding");
+         types.add("javax.jws.soap.SOAPMessageHandler");
+         types.add("javax.jws.soap.SOAPMessageHandlers");
+-        types.add("javax.xml.ws.BeginService");
+-        types.add("javax.xml.ws.EndService");
+         types.add("javax.xml.ws.BindingType");
+-        types.add("javax.xml.ws.ParameterIndex");
+         types.add("javax.xml.ws.RequestWrapper");
+         types.add("javax.xml.ws.ResponseWrapper");
+         types.add("javax.xml.ws.ServiceMode");
+@@ -78,8 +75,6 @@
+         types.add("javax.xml.ws.WebServiceClient");
+         types.add("javax.xml.ws.WebServiceProvider");
+         types.add("javax.xml.ws.WebServiceRef");
+-        
+-        types.add("javax.xml.ws.security.MessageSecurity");
+         supportedAnnotations = Collections.unmodifiableCollection(types);
+     }
+ 
+@@ -86,21 +81,21 @@
+     public AnnotationProcessorFactoryImpl() {
+     }
+ 
+-    
++
+     public Collection<String> supportedOptions() {
+         return supportedOptions;
+     }
+ 
+-    public Collection<String> supportedAnnotationTypes() { 
++    public Collection<String> supportedAnnotationTypes() {
+         return supportedAnnotations;
+     }
+-    
++
+     /*
+      * Return an instance of the {@link com.sun.istack.internal.ws.WSAP WSAP} AnnotationProcesor.
+      */
+     public AnnotationProcessor getProcessorFor(Set<AnnotationTypeDeclaration> atds,
+-					AnnotationProcessorEnvironment apEnv) {
+-                                            
++                                        AnnotationProcessorEnvironment apEnv) {
++
+         if (wsAP == null) {
+             AnnotationProcessorContext context = new AnnotationProcessorContext();
+             wsAP = new WebServiceAP(null, context, null, null);
+@@ -110,7 +105,3 @@
+         return wsAP;
+     }
+ }
+-
+-
+-
+-
+--- old/src/share/classes/com/sun/istack/internal/ws/package-info.java	Thu Jul 30 17:13:17 2009
++++ openjdk/jaxws/src/share/classes/com/sun/istack/internal/ws/package-info.java	Thu Jul 30 17:13:16 2009
+@@ -30,7 +30,7 @@
+  *
+  * <p>The {@link com.sun.istack.internal.ws.AnnotationProcessorFactoryImpl AnnoatationnProcessorFactoryImpl} class
+  * tells the <a href="http://java.sun.com/j2se/1.5.0/docs/tooldocs/share/apt.html">APT</a>
+- * framework that there exists an {@com.sun.mirror.apt.AnnotationProcessor AnnotationProcessor} 
++ * framework that there exists an {@com.sun.mirror.apt.AnnotationProcessor AnnotationProcessor}
+  * ({@link com.sun.istak.ws.WSAP WSAP}) for for processing javax.jws.*, javax.jws.soap.*,
+  *  and javax.xml.ws.* annotations.
+  *
+--- old/src/share/classes/com/sun/tools/internal/jxc/ConfigReader.java	Thu Jul 30 17:13:20 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/jxc/ConfigReader.java	Thu Jul 30 17:13:20 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.jxc;
+ 
+ import java.io.File;
+@@ -280,4 +281,3 @@
+ 
+     }
+ }
+-
+--- old/src/share/classes/com/sun/tools/internal/jxc/MessageBundle.properties	Thu Jul 30 17:13:24 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/jxc/MessageBundle.properties	Thu Jul 30 17:13:23 2009
+@@ -30,8 +30,8 @@
+     Non-existent directory: {0}
+ 
+ VERSION = \
+-	schemagen version "JAXB 2.1.3" \n\
+-	JavaTM Architecture for XML Binding(JAXB) Reference Implementation, (build JAXB 2.1.3 in JDK)	
++        schemagen version "JAXB 2.1.10 in JDK 6" \n\
++        JavaTM Architecture for XML Binding(JAXB) Reference Implementation, (build JAXB 2.1.10 in JDK 6)
+ 
+ USAGE = \
+ Usage: schemagen [-options ...] <java files> \n\
+@@ -42,4 +42,3 @@
+ \ \ \ \ -episode <file>   :  generate episode file for separate compilation\n\
+ \ \ \ \ -version          :  display version information\n\
+ \ \ \ \ -help             :  display this usage message
+- 
+--- old/src/share/classes/com/sun/tools/internal/jxc/Messages.java	Thu Jul 30 17:13:27 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/jxc/Messages.java	Thu Jul 30 17:13:26 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.jxc;
+ 
+ import java.text.MessageFormat;
+--- old/src/share/classes/com/sun/tools/internal/jxc/NGCCRuntimeEx.java	Thu Jul 30 17:13:30 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/jxc/NGCCRuntimeEx.java	Thu Jul 30 17:13:30 2009
+@@ -39,7 +39,7 @@
+ /**
+  * Controls the  validating and converting  of values obtained
+  * from the config file.
+- * 
++ *
+  * @author
+  *     Bhakti Mehta (bhakti.mehta@sun.com)
+  */
+--- old/src/share/classes/com/sun/tools/internal/jxc/SchemaGenerator.java	Thu Jul 30 17:13:34 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/jxc/SchemaGenerator.java	Thu Jul 30 17:13:33 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.jxc;
+ 
+ import java.io.File;
+--- old/src/share/classes/com/sun/tools/internal/jxc/apt/AnnotationParser.java	Thu Jul 30 17:13:37 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/AnnotationParser.java	Thu Jul 30 17:13:37 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.jxc.apt;
+ 
+ import java.io.File;
+--- old/src/share/classes/com/sun/tools/internal/jxc/apt/AnnotationProcessorFactoryImpl.java	Thu Jul 30 17:13:41 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/AnnotationProcessorFactoryImpl.java	Thu Jul 30 17:13:40 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.jxc.apt;
+ 
+ import java.util.Arrays;
+--- old/src/share/classes/com/sun/tools/internal/jxc/apt/Const.java	Thu Jul 30 17:13:44 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/Const.java	Thu Jul 30 17:13:44 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.jxc.apt;
+ 
+ import java.io.File;
+--- old/src/share/classes/com/sun/tools/internal/jxc/apt/ErrorReceiverImpl.java	Thu Jul 30 17:13:48 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/ErrorReceiverImpl.java	Thu Jul 30 17:13:47 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.jxc.apt;
+ 
+ import com.sun.mirror.apt.AnnotationProcessorEnvironment;
+--- old/src/share/classes/com/sun/tools/internal/jxc/apt/InlineAnnotationReaderImpl.java	Thu Jul 30 17:13:51 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/InlineAnnotationReaderImpl.java	Thu Jul 30 17:13:51 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.jxc.apt;
+ 
+ import java.lang.annotation.Annotation;
+--- old/src/share/classes/com/sun/tools/internal/jxc/apt/MessageBundle.properties	Thu Jul 30 17:13:55 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/MessageBundle.properties	Thu Jul 30 17:13:54 2009
+@@ -31,4 +31,3 @@
+ 
+ OPERAND_MISSING = \
+     Option "{0}" is missing an operand.
+- 
+--- old/src/share/classes/com/sun/tools/internal/jxc/apt/Messages.java	Thu Jul 30 17:13:58 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/Messages.java	Thu Jul 30 17:13:58 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.jxc.apt;
+ 
+ import java.text.MessageFormat;
+--- old/src/share/classes/com/sun/tools/internal/jxc/apt/Options.java	Thu Jul 30 17:14:02 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/Options.java	Thu Jul 30 17:14:01 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.jxc.apt;
+ 
+ import java.io.File;
+@@ -86,7 +87,7 @@
+                 throw new BadCommandLineException(
+                         (Messages.OPERAND_MISSING.format(args[i])));
+             classpath = args[++i];
+-            
++
+             return 1;
+         }
+ 
+@@ -96,6 +97,3 @@
+ 
+ 
+ }
+-
+-
+-
+--- old/src/share/classes/com/sun/tools/internal/jxc/apt/SchemaGenerator.java	Thu Jul 30 17:14:05 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/jxc/apt/SchemaGenerator.java	Thu Jul 30 17:14:04 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.jxc.apt;
+ 
+ import java.io.File;
+--- old/src/share/classes/com/sun/tools/internal/jxc/gen/config/AttributesImpl.java	Thu Jul 30 17:14:08 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/AttributesImpl.java	Thu Jul 30 17:14:08 2009
+@@ -44,8 +44,8 @@
+  * </blockquote>
+  *
+  * <p>This class provides a default implementation of the SAX2
+- * {@link org.xml.sax.Attributes Attributes} interface, with the 
+- * addition of manipulators so that the list can be modified or 
++ * {@link org.xml.sax.Attributes Attributes} interface, with the
++ * addition of manipulators so that the list can be modified or
+  * reused.</p>
+  *
+  * <p>There are two typical uses of this class:</p>
+@@ -56,15 +56,15 @@
+  * <li>to construct or modify an Attributes object in a SAX2 driver or filter.</li>
+  * </ol>
+  *
+- * <p>This class replaces the now-deprecated SAX1 {@link 
++ * <p>This class replaces the now-deprecated SAX1 {@link
+  * org.xml.sax.helpers.AttributeListImpl AttributeListImpl}
+  * class; in addition to supporting the updated Attributes
+  * interface rather than the deprecated {@link org.xml.sax.AttributeList
+- * AttributeList} interface, it also includes a much more efficient 
++ * AttributeList} interface, it also includes a much more efficient
+  * implementation using a single array rather than a set of Vectors.</p>
+  *
+  * @since SAX 2.0
+- * @author David Megginson, 
++ * @author David Megginson,
+  *         <a href="mailto:sax@megginson.com">sax@megginson.com</a>
+  * @version 2.0
+  */
+@@ -71,7 +71,7 @@
+ public class AttributesImpl implements Attributes
+ {
+ 
+-
++
+     ////////////////////////////////////////////////////////////////////
+     // Constructors.
+     ////////////////////////////////////////////////////////////////////
+@@ -101,7 +101,7 @@
+     }
+ 
+ 
+-
++
+     ////////////////////////////////////////////////////////////////////
+     // Implementation of org.xml.sax.Attributes.
+     ////////////////////////////////////////////////////////////////////
+@@ -141,7 +141,7 @@
+      * Return an attribute's local name.
+      *
+      * @param index The attribute's index (zero-based).
+-     * @return The attribute's local name, the empty string if 
++     * @return The attribute's local name, the empty string if
+      *         none is available, or null if the index if out of range.
+      * @see org.xml.sax.Attributes#getLocalName
+      */
+@@ -159,7 +159,7 @@
+      * Return an attribute's qualified (prefixed) name.
+      *
+      * @param index The attribute's index (zero-based).
+-     * @return The attribute's qualified name, the empty string if 
++     * @return The attribute's qualified name, the empty string if
+      *         none is available, or null if the index is out of bounds.
+      * @see org.xml.sax.Attributes#getQName
+      */
+@@ -228,7 +228,7 @@
+         if (data[i].equals(uri) && data[i+1].equals(localName)) {
+         return i / 5;
+         }
+-    } 
++    }
+     return -1;
+     }
+ 
+@@ -247,7 +247,7 @@
+         if (data[i+2].equals(qName)) {
+         return i / 5;
+         }
+-    } 
++    }
+     return -1;
+     }
+ 
+@@ -269,7 +269,7 @@
+         if (data[i].equals(uri) && data[i+1].equals(localName)) {
+         return data[i+3];
+         }
+-    } 
++    }
+     return null;
+     }
+ 
+@@ -336,7 +336,7 @@
+     }
+ 
+ 
+-
++
+     ////////////////////////////////////////////////////////////////////
+     // Manipulators.
+     ////////////////////////////////////////////////////////////////////
+@@ -346,7 +346,7 @@
+      * Clear the attribute list for reuse.
+      *
+      * <p>Note that no memory is actually freed by this call:
+-     * the current arrays are kept so that they can be 
++     * the current arrays are kept so that they can be
+      * reused.</p>
+      */
+     public void clear ()
+@@ -360,7 +360,7 @@
+      *
+      * <p>It may be more efficient to reuse an existing object
+      * rather than constantly allocating new ones.</p>
+-     * 
++     *
+      * @param atts The attributes to copy.
+      */
+     public void setAttributes (Attributes atts)
+@@ -367,7 +367,7 @@
+     {
+     clear();
+     length = atts.getLength();
+-    data = new String[length*5]; 
++    data = new String[length*5];
+     for (int i = 0; i < length; i++) {
+         data[i*5] = atts.getURI(i);
+         data[i*5+1] = atts.getLocalName(i);
+@@ -564,7 +564,7 @@
+     }
+ 
+ 
+-
++
+     ////////////////////////////////////////////////////////////////////
+     // Internal methods.
+     ////////////////////////////////////////////////////////////////////
+@@ -612,7 +612,7 @@
+     }
+ 
+ 
+-
++
+     ////////////////////////////////////////////////////////////////////
+     // Internal state.
+     ////////////////////////////////////////////////////////////////////
+@@ -623,4 +623,3 @@
+ }
+ 
+ // end of AttributesImpl.java
+-
+--- old/src/share/classes/com/sun/tools/internal/jxc/gen/config/Classes.java	Thu Jul 30 17:14:12 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/Classes.java	Thu Jul 30 17:14:12 2009
+@@ -57,7 +57,7 @@
+     }
+ 
+     private void action0()throws SAXException {
+-         this.excludes.add(exclude_content); 
++         this.excludes.add(exclude_content);
+ }
+ 
+     private void action1()throws SAXException {
+@@ -64,7 +64,7 @@
+         $runtime.processList(__text);}
+ 
+     private void action2()throws SAXException {
+-         this.includes.add(include_content); 
++         this.includes.add(include_content);
+ }
+ 
+     private void action3()throws SAXException {
+@@ -75,6 +75,11 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
++        case 0:
++            {
++                revertToParentFromEnterElement(this, super._cookie, $__uri, $__local, $__qname, $attrs);
++            }
++            break;
+         case 12:
+             {
+                 if(($__uri == "" && $__local == "classes")) {
+@@ -92,34 +97,29 @@
+                 $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+             }
+             break;
+-        case 2:
++        case 11:
+             {
+-                if(($__uri == "" && $__local == "excludes")) {
++                if(($__uri == "" && $__local == "includes")) {
+                     $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
+-                    $_ngcc_current_state = 6;
++                    $_ngcc_current_state = 10;
+                 }
+                 else {
+-                    $_ngcc_current_state = 1;
+-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
++                    unexpectedEnterElement($__qname);
+                 }
+             }
+             break;
+-        case 11:
++        case 2:
+             {
+-                if(($__uri == "" && $__local == "includes")) {
++                if(($__uri == "" && $__local == "excludes")) {
+                     $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
+-                    $_ngcc_current_state = 10;
++                    $_ngcc_current_state = 6;
+                 }
+                 else {
+-                    unexpectedEnterElement($__qname);
++                    $_ngcc_current_state = 1;
++                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                 }
+             }
+             break;
+-        case 0:
+-            {
+-                revertToParentFromEnterElement(this, super._cookie, $__uri, $__local, $__qname, $attrs);
+-            }
+-            break;
+         default:
+             {
+                 unexpectedEnterElement($__qname);
+@@ -133,6 +133,17 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
++        case 0:
++            {
++                revertToParentFromLeaveElement(this, super._cookie, $__uri, $__local, $__qname);
++            }
++            break;
++        case 4:
++            {
++                $_ngcc_current_state = 3;
++                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
++            }
++            break;
+         case 3:
+             {
+                 if(($__uri == "" && $__local == "excludes")) {
+@@ -144,12 +155,6 @@
+                 }
+             }
+             break;
+-        case 4:
+-            {
+-                $_ngcc_current_state = 3;
+-                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+         case 2:
+             {
+                 $_ngcc_current_state = 1;
+@@ -156,11 +161,11 @@
+                 $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 1:
++        case 8:
+             {
+-                if(($__uri == "" && $__local == "classes")) {
++                if(($__uri == "" && $__local == "includes")) {
+                     $runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
+-                    $_ngcc_current_state = 0;
++                    $_ngcc_current_state = 2;
+                 }
+                 else {
+                     unexpectedLeaveElement($__qname);
+@@ -167,11 +172,11 @@
+                 }
+             }
+             break;
+-        case 8:
++        case 1:
+             {
+-                if(($__uri == "" && $__local == "includes")) {
++                if(($__uri == "" && $__local == "classes")) {
+                     $runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
+-                    $_ngcc_current_state = 2;
++                    $_ngcc_current_state = 0;
+                 }
+                 else {
+                     unexpectedLeaveElement($__qname);
+@@ -178,11 +183,6 @@
+                 }
+             }
+             break;
+-        case 0:
+-            {
+-                revertToParentFromLeaveElement(this, super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+         default:
+             {
+                 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 4:
+             {
+                 $_ngcc_current_state = 3;
+@@ -208,11 +213,6 @@
+                 $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 0:
+-            {
+-                revertToParentFromEnterAttribute(this, super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+         default:
+             {
+                 unexpectedEnterAttribute($__qname);
+@@ -226,6 +226,11 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
++        case 0:
++            {
++                revertToParentFromLeaveAttribute(this, super._cookie, $__uri, $__local, $__qname);
++            }
++            break;
+         case 4:
+             {
+                 $_ngcc_current_state = 3;
+@@ -238,11 +243,6 @@
+                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 0:
+-            {
+-                revertToParentFromLeaveAttribute(this, super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+         default:
+             {
+                 unexpectedLeaveAttribute($__qname);
+@@ -253,6 +253,11 @@
+ 
+     public void text(String $value) throws SAXException {
+         switch($_ngcc_current_state) {
++        case 0:
++            {
++                revertToParentFromText(this, super._cookie, $value);
++            }
++            break;
+         case 9:
+             {
+                 include_content = $value;
+@@ -260,7 +265,7 @@
+                 action2();
+             }
+             break;
+-        case 3:
++        case 4:
+             {
+                 exclude_content = $value;
+                 $_ngcc_current_state = 3;
+@@ -267,7 +272,7 @@
+                 action0();
+             }
+             break;
+-        case 4:
++        case 3:
+             {
+                 exclude_content = $value;
+                 $_ngcc_current_state = 3;
+@@ -301,11 +306,6 @@
+                 action1();
+             }
+             break;
+-        case 0:
+-            {
+-                revertToParentFromText(this, super._cookie, $value);
+-            }
+-            break;
+         }
+     }
+ 
+@@ -318,11 +318,10 @@
+         return(($_ngcc_current_state == 0));
+     }
+ 
+-    
++
+        private List includes = new ArrayList();
+        public List getIncludes() { return $runtime.getIncludePatterns(this.includes);}
+        private List excludes = new ArrayList();
+        public List getExcludes() { return $runtime.getExcludePatterns(this.excludes);}
+-       
+-}
+ 
++}
+--- old/src/share/classes/com/sun/tools/internal/jxc/gen/config/Config.java	Thu Jul 30 17:14:16 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/Config.java	Thu Jul 30 17:14:15 2009
+@@ -70,15 +70,10 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
+-        case 0:
++        case 4:
+             {
+-                revertToParentFromEnterElement(this, super._cookie, $__uri, $__local, $__qname, $attrs);
+-            }
+-            break;
+-        case 1:
+-            {
+-                if(($__uri == "" && $__local == "schema")) {
+-                    NGCCHandler h = new Schema(this, super._source, $runtime, 3, baseDir);
++                if(($__uri == "" && $__local == "classes")) {
++                    NGCCHandler h = new Classes(this, super._source, $runtime, 34);
+                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+@@ -97,10 +92,26 @@
+                 }
+             }
+             break;
++        case 1:
++            {
++                if(($__uri == "" && $__local == "schema")) {
++                    NGCCHandler h = new Schema(this, super._source, $runtime, 31, baseDir);
++                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
++                }
++                else {
++                    unexpectedEnterElement($__qname);
++                }
++            }
++            break;
++        case 0:
++            {
++                revertToParentFromEnterElement(this, super._cookie, $__uri, $__local, $__qname, $attrs);
++            }
++            break;
+         case 2:
+             {
+                 if(($__uri == "" && $__local == "schema")) {
+-                    NGCCHandler h = new Schema(this, super._source, $runtime, 4, baseDir);
++                    NGCCHandler h = new Schema(this, super._source, $runtime, 32, baseDir);
+                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+@@ -120,17 +131,6 @@
+                 }
+             }
+             break;
+-        case 4:
+-            {
+-                if(($__uri == "" && $__local == "classes")) {
+-                    NGCCHandler h = new Classes(this, super._source, $runtime, 6);
+-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+-                }
+-                else {
+-                    unexpectedEnterElement($__qname);
+-                }
+-            }
+-            break;
+         default:
+             {
+                 unexpectedEnterElement($__qname);
+@@ -145,11 +145,6 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
+-        case 0:
+-            {
+-                revertToParentFromLeaveElement(this, super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+         case 1:
+             {
+                 if(($__uri == "" && $__local == "config")) {
+@@ -161,6 +156,11 @@
+                 }
+             }
+             break;
++        case 0:
++            {
++                revertToParentFromLeaveElement(this, super._cookie, $__uri, $__local, $__qname);
++            }
++            break;
+         case 2:
+             {
+                 $_ngcc_current_state = 1;
+@@ -257,13 +257,6 @@
+     public void text(String $value) throws SAXException {
+         int $ai;
+         switch($_ngcc_current_state) {
+-        case 6:
+-            {
+-                bd = $value;
+-                $_ngcc_current_state = 5;
+-                action1();
+-            }
+-            break;
+         case 0:
+             {
+                 revertToParentFromText(this, super._cookie, $value);
+@@ -283,19 +276,32 @@
+                 }
+             }
+             break;
++        case 6:
++            {
++                bd = $value;
++                $_ngcc_current_state = 5;
++                action1();
++            }
++            break;
+         }
+     }
+ 
+     public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException {
+         switch($__cookie__) {
+-        case 3:
++        case 34:
+             {
++                classes = ((Classes)$__result__);
++                $_ngcc_current_state = 2;
++            }
++            break;
++        case 31:
++            {
+                 _schema = ((Schema)$__result__);
+                 action0();
+                 $_ngcc_current_state = 1;
+             }
+             break;
+-        case 4:
++        case 32:
+             {
+                 _schema = ((Schema)$__result__);
+                 action0();
+@@ -302,12 +308,6 @@
+                 $_ngcc_current_state = 1;
+             }
+             break;
+-        case 6:
+-            {
+-                classes = ((Classes)$__result__);
+-                $_ngcc_current_state = 2;
+-            }
+-            break;
+         }
+     }
+ 
+@@ -315,7 +315,7 @@
+         return(($_ngcc_current_state == 0));
+     }
+ 
+-    
++
+    private File baseDir;
+    private Classes classes;
+    private List schema = new ArrayList();
+@@ -324,4 +324,3 @@
+    public List getSchema() { return this.schema;}
+ 
+ }
+-
+--- old/src/share/classes/com/sun/tools/internal/jxc/gen/config/NGCCEventReceiver.java	Thu Jul 30 17:14:20 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/NGCCEventReceiver.java	Thu Jul 30 17:14:19 2009
+@@ -28,8 +28,8 @@
+ import org.xml.sax.SAXException;
+ 
+ /**
+- * 
+- * 
++ *
++ *
+  * @author Kohsuke Kawaguchi (kk@kohsuke.org)
+  */
+ public interface NGCCEventReceiver {
+--- old/src/share/classes/com/sun/tools/internal/jxc/gen/config/NGCCEventSource.java	Thu Jul 30 17:14:23 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/NGCCEventSource.java	Thu Jul 30 17:14:23 2009
+@@ -28,8 +28,8 @@
+ import org.xml.sax.SAXException;
+ 
+ /**
+- * 
+- * 
++ *
++ *
+  * @author Kohsuke Kawaguchi (kk@kohsuke.org)
+  */
+ public interface NGCCEventSource {
+@@ -38,7 +38,7 @@
+      * ID of the EventReceiver thread.
+      */
+     int replace( NGCCEventReceiver _old, NGCCEventReceiver _new );
+-    
++
+     /** Sends an enter element event to the specified EventReceiver thread. */
+     void sendEnterElement( int receiverThreadId, String uri, String local, String qname, Attributes atts ) throws SAXException;
+ 
+--- old/src/share/classes/com/sun/tools/internal/jxc/gen/config/NGCCHandler.java	Thu Jul 30 17:14:27 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/NGCCHandler.java	Thu Jul 30 17:14:26 2009
+@@ -28,51 +28,51 @@
+ import org.xml.sax.SAXException;
+ 
+ /**
+- * 
+- * 
++ *
++ *
+  * @version $Id: NGCCHandler.java,v 1.9 2002/09/29 02:55:48 okajima Exp $
+  * @author Kohsuke Kawaguchi (kk@kohsuke.org)
+  */
+ public abstract class NGCCHandler implements NGCCEventReceiver {
+     protected NGCCHandler( NGCCEventSource source, NGCCHandler parent, int parentCookie ) {
+-            
++
+         _parent = parent;
+         _source = source;
+         _cookie = parentCookie;
+     }
+-    
++
+     /**
+      * Parent NGCCHandler, if any.
+      * If this is the root handler, this field will be null.
+      */
+     protected final NGCCHandler _parent;
+-    
++
+     /**
+      * Event source.
+      */
+     protected final NGCCEventSource _source;
+-    
++
+     /**
+      * This method will be implemented by the generated code
+      * and returns a reference to the current runtime.
+      */
+     protected abstract NGCCRuntime getRuntime();
+-    
++
+     /**
+      * Cookie assigned by the parent.
+-     * 
++     *
+      * This value will be passed to the onChildCompleted handler
+      * of the parent.
+      */
+     protected final int _cookie;
+-    
++
+     // used to copy parameters to (enter|leave)(Element|Attribute) events.
+     //protected String localName,uri,qname;
+-    
+-    
++
++
+     /**
+      * Notifies the completion of a child object.
+-     * 
++     *
+      * @param result
+      *      The parsing result of the child state.
+      * @param cookie
+@@ -85,7 +85,7 @@
+      *      attribute transition.
+      */
+     protected abstract void onChildCompleted( Object result, int cookie, boolean needAttCheck ) throws SAXException;
+-    
++
+ //
+ //
+ // spawns a new child object from event handlers.
+@@ -93,35 +93,35 @@
+ //
+     public void spawnChildFromEnterElement( NGCCEventReceiver child,
+         String uri, String localname, String qname, Attributes atts) throws SAXException {
+-        
++
+         int id = _source.replace(this,child);
+         _source.sendEnterElement(id,uri,localname,qname,atts);
+     }
+     public void spawnChildFromEnterAttribute( NGCCEventReceiver child,
+         String uri, String localname, String qname) throws SAXException {
+-            
++
+         int id = _source.replace(this,child);
+         _source.sendEnterAttribute(id,uri,localname,qname);
+     }
+     public void spawnChildFromLeaveElement( NGCCEventReceiver child,
+         String uri, String localname, String qname) throws SAXException {
+-            
++
+         int id = _source.replace(this,child);
+         _source.sendLeaveElement(id,uri,localname,qname);
+     }
+     public void spawnChildFromLeaveAttribute( NGCCEventReceiver child,
+         String uri, String localname, String qname) throws SAXException {
+-            
++
+         int id = _source.replace(this,child);
+         _source.sendLeaveAttribute(id,uri,localname,qname);
+     }
+     public void spawnChildFromText( NGCCEventReceiver child,
+         String value) throws SAXException {
+-            
++
+         int id = _source.replace(this,child);
+         _source.sendText(id,value);
+     }
+-    
++
+ //
+ //
+ // reverts to the parent object from the child handler
+@@ -129,7 +129,7 @@
+ //
+     public void revertToParentFromEnterElement( Object result, int cookie,
+         String uri,String local,String qname, Attributes atts ) throws SAXException {
+-            
++
+         int id = _source.replace(this,_parent);
+         _parent.onChildCompleted(result,cookie,true);
+         _source.sendEnterElement(id,uri,local,qname,atts);
+@@ -136,13 +136,13 @@
+     }
+     public void revertToParentFromLeaveElement( Object result, int cookie,
+         String uri,String local,String qname ) throws SAXException {
+-        
++
+         if(uri==NGCCRuntime.IMPOSSIBLE && uri==local && uri==qname && _parent==null )
+             // all the handlers are properly finalized.
+             // quit now, because we don't have any more NGCCHandler.
+             // see the endDocument handler for detail
+             return;
+-        
++
+         int id = _source.replace(this,_parent);
+         _parent.onChildCompleted(result,cookie,true);
+         _source.sendLeaveElement(id,uri,local,qname);
+@@ -149,7 +149,7 @@
+     }
+     public void revertToParentFromEnterAttribute( Object result, int cookie,
+         String uri,String local,String qname ) throws SAXException {
+-            
++
+         int id = _source.replace(this,_parent);
+         _parent.onChildCompleted(result,cookie,true);
+         _source.sendEnterAttribute(id,uri,local,qname);
+@@ -156,7 +156,7 @@
+     }
+     public void revertToParentFromLeaveAttribute( Object result, int cookie,
+         String uri,String local,String qname ) throws SAXException {
+-            
++
+         int id = _source.replace(this,_parent);
+         _parent.onChildCompleted(result,cookie,true);
+         _source.sendLeaveAttribute(id,uri,local,qname);
+@@ -163,7 +163,7 @@
+     }
+     public void revertToParentFromText( Object result, int cookie,
+         String text ) throws SAXException {
+-            
++
+         int id = _source.replace(this,_parent);
+         _parent.onChildCompleted(result,cookie,true);
+         _source.sendText(id,text);
+--- old/src/share/classes/com/sun/tools/internal/jxc/gen/config/NGCCInterleaveFilter.java	Thu Jul 30 17:14:30 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/NGCCInterleaveFilter.java	Thu Jul 30 17:14:30 2009
+@@ -30,7 +30,7 @@
+ /**
+  * Dispatches incoming events into sub handlers appropriately
+  * so that the interleaving semantics will be correctly realized.
+- * 
++ *
+  * @author Kohsuke Kawaguchi (kk@kohsuke.org)
+  */
+ public abstract class NGCCInterleaveFilter implements NGCCEventSource, NGCCEventReceiver {
+@@ -38,14 +38,14 @@
+         this._parent = parent;
+         this._cookie = cookie;
+     }
+-    
++
+     protected void setHandlers( NGCCEventReceiver[] receivers ) {
+         this._receivers = receivers;
+     }
+-    
++
+     /** event receiverse. */
+     protected NGCCEventReceiver[] _receivers;
+-    
++
+     public int replace(NGCCEventReceiver oldHandler, NGCCEventReceiver newHandler) {
+         for( int i=0; i<_receivers.length; i++ )
+             if( _receivers[i]==oldHandler ) {
+@@ -86,12 +86,12 @@
+      * Nest level. Lock will be release when the lockCount becomes 0.
+      */
+     private int lockCount=0;
+-    
++
+     public void enterElement(
+         String uri, String localName, String qname,Attributes atts) throws SAXException {
+-        
++
+         if(isJoining)   return; // ignore any token if we are joining. See joinByXXXX.
+-        
++
+         if(lockCount++==0) {
+             lockedReceiver = findReceiverOfElement(uri,localName);
+             if(lockedReceiver==-1) {
+@@ -100,7 +100,7 @@
+                 return;
+             }
+         }
+-        
++
+         _receivers[lockedReceiver].enterElement(uri,localName,qname,atts);
+     }
+     public void leaveElement(String uri, String localName, String qname) throws SAXException {
+@@ -113,7 +113,7 @@
+     }
+     public void enterAttribute(String uri, String localName, String qname) throws SAXException {
+         if(isJoining)   return; // ignore any token if we are joining. See joinByXXXX.
+-        
++
+         if(lockCount++==0) {
+             lockedReceiver = findReceiverOfAttribute(uri,localName);
+             if(lockedReceiver==-1) {
+@@ -122,12 +122,12 @@
+                 return;
+             }
+         }
+-                
++
+         _receivers[lockedReceiver].enterAttribute(uri,localName,qname);
+     }
+     public void leaveAttribute(String uri, String localName, String qname) throws SAXException {
+         if(isJoining)   return; // ignore any token if we are joining. See joinByXXXX.
+-        
++
+         if( lockCount-- == 0 )
+             joinByLeaveAttribute(null,uri,localName,qname);
+         else
+@@ -135,7 +135,7 @@
+     }
+     public void text(String value) throws SAXException {
+         if(isJoining)   return; // ignore any token if we are joining. See joinByXXXX.
+-        
++
+         if(lockCount!=0)
+             _receivers[lockedReceiver].text(value);
+         else {
+@@ -150,18 +150,18 @@
+     /**
+      * Implemented by the generated code to determine the handler
+      * that can receive the given element.
+-     * 
++     *
+      * @return
+      *      Thread ID of the receiver that can handle this event,
+      *      or -1 if none.
+      */
+     protected abstract int findReceiverOfElement( String uri, String local );
+-    
++
+     /**
+      * Returns the handler that can receive the given attribute, or null.
+      */
+     protected abstract int findReceiverOfAttribute( String uri, String local );
+-    
++
+     /**
+      * Returns the handler that can receive text events, or null.
+      */
+@@ -176,7 +176,7 @@
+ //
+ //
+ 
+-    
++
+     /**
+      * Set to true when this handler is in the process of
+      * joining all branches.
+@@ -185,16 +185,16 @@
+ 
+     /**
+      * Joins all the child receivers.
+-     * 
++     *
+      * <p>
+      * This method is called by a child receiver when it sees
+      * something that it cannot handle, or by this object itself
+      * when it sees an event that it can't process.
+-     * 
++     *
+      * <p>
+      * This method forces children to move to its final state,
+      * then revert to the parent.
+-     * 
++     *
+      * @param source
+      *      If this method is called by one of the child receivers,
+      *      the receiver object. If this method is called by itself,
+@@ -202,7 +202,7 @@
+      */
+     public void joinByEnterElement( NGCCEventReceiver source,
+         String uri, String local, String qname, Attributes atts ) throws SAXException {
+-        
++
+         if(isJoining)   return; // we are already in the process of joining. ignore.
+         isJoining = true;
+ 
+@@ -214,7 +214,7 @@
+         for( int i=0; i<_receivers.length; i++ )
+             if( _receivers[i]!=source )
+                 _receivers[i].enterElement(uri,local,qname,atts);
+-        
++
+         // revert to the parent
+         _parent._source.replace(this,_parent);
+         _parent.onChildCompleted(null,_cookie,true);
+@@ -221,10 +221,10 @@
+         // send this event to the parent
+         _parent.enterElement(uri,local,qname,atts);
+     }
+-    
++
+     public void joinByLeaveElement( NGCCEventReceiver source,
+         String uri, String local, String qname ) throws SAXException {
+-        
++
+         if(isJoining)   return; // we are already in the process of joining. ignore.
+         isJoining = true;
+ 
+@@ -236,7 +236,7 @@
+         for( int i=0; i<_receivers.length; i++ )
+             if( _receivers[i]!=source )
+                 _receivers[i].leaveElement(uri,local,qname);
+-        
++
+         // revert to the parent
+         _parent._source.replace(this,_parent);
+         _parent.onChildCompleted(null,_cookie,true);
+@@ -243,10 +243,10 @@
+         // send this event to the parent
+         _parent.leaveElement(uri,local,qname);
+     }
+-    
++
+     public void joinByEnterAttribute( NGCCEventReceiver source,
+         String uri, String local, String qname ) throws SAXException {
+-        
++
+         if(isJoining)   return; // we are already in the process of joining. ignore.
+         isJoining = true;
+ 
+@@ -258,7 +258,7 @@
+         for( int i=0; i<_receivers.length; i++ )
+             if( _receivers[i]!=source )
+                 _receivers[i].enterAttribute(uri,local,qname);
+-        
++
+         // revert to the parent
+         _parent._source.replace(this,_parent);
+         _parent.onChildCompleted(null,_cookie,true);
+@@ -265,10 +265,10 @@
+         // send this event to the parent
+         _parent.enterAttribute(uri,local,qname);
+     }
+-    
++
+     public void joinByLeaveAttribute( NGCCEventReceiver source,
+         String uri, String local, String qname ) throws SAXException {
+-        
++
+         if(isJoining)   return; // we are already in the process of joining. ignore.
+         isJoining = true;
+ 
+@@ -280,7 +280,7 @@
+         for( int i=0; i<_receivers.length; i++ )
+             if( _receivers[i]!=source )
+                 _receivers[i].leaveAttribute(uri,local,qname);
+-        
++
+         // revert to the parent
+         _parent._source.replace(this,_parent);
+         _parent.onChildCompleted(null,_cookie,true);
+@@ -287,13 +287,13 @@
+         // send this event to the parent
+         _parent.leaveAttribute(uri,local,qname);
+     }
+-    
++
+     public void joinByText( NGCCEventReceiver source,
+         String value ) throws SAXException {
+ 
+         if(isJoining)   return; // we are already in the process of joining. ignore.
+         isJoining = true;
+-        
++
+         // send special token to the rest of the branches.
+         // these branches don't understand this token, so they will
+         // try to move to a final state and send the token back to us,
+@@ -317,28 +317,28 @@
+ // event dispatching methods
+ //
+ //
+-    
++
+     public void sendEnterAttribute( int threadId,
+         String uri, String local, String qname) throws SAXException {
+-        
++
+         _receivers[threadId].enterAttribute(uri,local,qname);
+     }
+ 
+     public void sendEnterElement( int threadId,
+         String uri, String local, String qname, Attributes atts) throws SAXException {
+-        
++
+         _receivers[threadId].enterElement(uri,local,qname,atts);
+     }
+ 
+     public void sendLeaveAttribute( int threadId,
+         String uri, String local, String qname) throws SAXException {
+-        
++
+         _receivers[threadId].leaveAttribute(uri,local,qname);
+     }
+ 
+     public void sendLeaveElement( int threadId,
+         String uri, String local, String qname) throws SAXException {
+-        
++
+         _receivers[threadId].leaveElement(uri,local,qname);
+     }
+ 
+--- old/src/share/classes/com/sun/tools/internal/jxc/gen/config/NGCCRuntime.java	Thu Jul 30 17:14:34 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/NGCCRuntime.java	Thu Jul 30 17:14:33 2009
+@@ -37,28 +37,28 @@
+ 
+ /**
+  * Runtime Engine for RELAXNGCC execution.
+- * 
++ *
+  * This class has the following functionalities:
+- * 
++ *
+  * <ol>
+  *  <li>Managing a stack of NGCCHandler objects and
+  *      switching between them appropriately.
+- * 
++ *
+  *  <li>Keep track of all Attributes.
+- * 
++ *
+  *  <li>manage mapping between namespace URIs and prefixes.
+- * 
++ *
+  *  <li>TODO: provide support for interleaving.
+- * 
++ *
+  * @version $Id: NGCCRuntime.java,v 1.16 2003/03/23 02:47:46 okajima Exp $
+  * @author Kohsuke Kawaguchi (kk@kohsuke.org)
+  */
+ public class NGCCRuntime implements ContentHandler, NGCCEventSource {
+-    
++
+     public NGCCRuntime() {
+         reset();
+     }
+-    
++
+     /**
+      * Sets the root handler, which will be used to parse the
+      * root element.
+@@ -70,7 +70,7 @@
+      * Usually a generated class that corresponds to the &lt;start>
+      * pattern will be used as the root handler, but any NGCCHandler
+      * can be a root handler.
+-     * 
++     *
+      * @exception IllegalStateException
+      *      If this method is called but it doesn't satisfy the
+      *      pre-condition stated above.
+@@ -80,12 +80,12 @@
+             throw new IllegalStateException();
+         currentHandler = rootHandler;
+     }
+-    
+-    
++
++
+     /**
+      * Cleans up all the data structure so that the object can be reused later.
+      * Normally, applications do not need to call this method directly,
+-     * 
++     *
+      * as the runtime resets itself after the endDocument method.
+      */
+     public void reset() {
+@@ -99,30 +99,30 @@
+         redirect = null;
+         redirectionDepth = 0;
+         text = new StringBuffer();
+-        
++
+         // add a dummy attributes at the bottom as a "centinel."
+         attStack.push(new AttributesImpl());
+     }
+ 
+     // current content handler can be acccessed via set/getContentHandler.
+-    
++
+     private Locator locator;
+     public void setDocumentLocator( Locator _loc ) { this.locator=_loc; }
+     /**
+      * Gets the source location of the current event.
+-     * 
++     *
+      * <p>
+      * One can call this method from RelaxNGCC handlers to access
+-     * the line number information. Note that to 
++     * the line number information. Note that to
+      */
+     public Locator getLocator() { return locator; }
+-    
+ 
++
+     /** stack of {@link Attributes}. */
+     private final Stack attStack = new Stack();
+     /** current attributes set. always equal to attStack.peek() */
+     private AttributesImpl currentAtts;
+-    
++
+     /**
+      * Attributes that belong to the current element.
+      * <p>
+@@ -134,34 +134,34 @@
+     public Attributes getCurrentAttributes() {
+         return currentAtts;
+     }
+-    
++
+     /** accumulated text. */
+     private StringBuffer text = new StringBuffer();
+-    
+-    
+-    
+-    
++
++
++
++
+     /** The current NGCCHandler. Always equals to handlerStack.peek() */
+     private NGCCEventReceiver currentHandler;
+-    
++
+     public int replace( NGCCEventReceiver o, NGCCEventReceiver n ) {
+         if(o!=currentHandler)
+             throw new IllegalStateException();  // bug of RelaxNGCC
+         currentHandler = n;
+-        
++
+         return 0;   // we only have one thread.
+     }
+-    
++
+     /**
+      * Processes buffered text.
+-     * 
++     *
+      * This method will be called by the start/endElement event to process
+      * buffered text as a text event.
+-     * 
++     *
+      * <p>
+      * Whitespace handling is a tricky business. Consider the following
+      * schema fragment:
+-     * 
++     *
+      * <xmp>
+      * <element name="foo">
+      *   <choice>
+@@ -170,24 +170,24 @@
+      *   </choice>
+      * </element>
+      * </xmp>
+-     * 
++     *
+      * Assume we hit the following instance:
+      * <xmp>
+      * <foo> <bar/></foo>
+      * </xmp>
+-     * 
++     *
+      * Then this first space needs to be ignored (for otherwise, we will
+      * end up treating this space as the match to &lt;text/> and won't
+      * be able to process &lt;bar>.)
+-     * 
++     *
+      * Now assume the following instance:
+      * <xmp>
+      * <foo/>
+      * </xmp>
+-     * 
++     *
+      * This time, we need to treat this empty string as a text, for
+      * otherwise we won't be able to accept this instance.
+-     * 
++     *
+      * <p>
+      * This is very difficult to solve in general, but one seemingly
+      * easy solution is to use the type of next event. If a text is
+@@ -194,22 +194,22 @@
+      * followed by a start tag, it follows from the constraint on
+      * RELAX NG that that text must be either whitespaces or a match
+      * to &lt;text/>.
+-     * 
++     *
+      * <p>
+      * On the contrary, if a text is followed by a end tag, then it
+      * cannot be whitespace unless the content model can accept empty,
+      * in which case sending a text event will be harmlessly ignored
+      * by the NGCCHandler.
+-     * 
++     *
+      * <p>
+      * Thus this method take one parameter, which controls the
+      * behavior of this method.
+-     * 
++     *
+      * <p>
+      * TODO: according to the constraint of RELAX NG, if characters
+      * follow an end tag, then they must be either whitespaces or
+      * must match to &lt;text/>.
+-     * 
++     *
+      * @param   possiblyWhitespace
+      *      True if the buffered character can be ignorabale. False if
+      *      it needs to be consumed.
+@@ -219,25 +219,25 @@
+             ; // ignore. See the above javadoc comment for the description
+         else
+             currentHandler.text(text.toString());   // otherwise consume this token
+-        
++
+         // truncate StringBuffer, but avoid excessive allocation.
+         if(text.length()>1024)  text = new StringBuffer();
+         else                    text.setLength(0);
+     }
+-    
++
+     public void processList( String str ) throws SAXException {
+         StringTokenizer t = new StringTokenizer(str, " \t\r\n");
+         while(t.hasMoreTokens())
+             currentHandler.text(t.nextToken());
+     }
+-    
++
+     public void startElement(String uri, String localname, String qname, Attributes atts)
+             throws SAXException {
+-        
++
+         uri = uri.intern();
+         localname = localname.intern();
+         qname = qname.intern();
+-        
++
+         if(redirect!=null) {
+             redirect.startElement(uri,localname,qname,atts);
+             redirectionDepth++;
+@@ -247,14 +247,14 @@
+             currentHandler.enterElement(uri, localname, qname, atts);
+         }
+     }
+-    
++
+     /**
+      * Called by the generated handler code when an enter element
+      * event is consumed.
+-     * 
++     *
+      * <p>
+      * Pushes a new attribute set.
+-     * 
++     *
+      * <p>
+      * Note that attributes are NOT pushed at the startElement method,
+      * because the processing of the enterElement event can trigger
+@@ -269,7 +269,7 @@
+         nsEffectiveStack.push( new Integer(nsEffectivePtr) );
+         nsEffectivePtr = namespaces.size();
+     }
+-    
++
+     public void onLeaveElementConsumed(String uri, String localName, String qname) throws SAXException {
+         attStack.pop();
+         if(attStack.isEmpty())
+@@ -278,36 +278,36 @@
+             currentAtts = (AttributesImpl)attStack.peek();
+         nsEffectivePtr = ((Integer)nsEffectiveStack.pop()).intValue();
+     }
+-    
++
+     public void endElement(String uri, String localname, String qname)
+             throws SAXException {
+-        
++
+         uri = uri.intern();
+         localname = localname.intern();
+         qname = qname.intern();
+-        
++
+         if(redirect!=null) {
+             redirect.endElement(uri,localname,qname);
+             redirectionDepth--;
+-            
++
+             if(redirectionDepth!=0)
+                 return;
+-                
++
+             // finished redirection.
+             for( int i=0; i<namespaces.size(); i+=2 )
+                 redirect.endPrefixMapping((String)namespaces.get(i));
+             redirect.endDocument();
+-            
++
+             redirect = null;
+             // then process this element normally
+         }
+-        
++
+         processPendingText(false);
+-        
++
+         currentHandler.leaveElement(uri, localname, qname);
+ //        System.out.println("endElement:"+localname);
+     }
+-    
++
+     public void characters(char[] ch, int start, int length) throws SAXException {
+         if(redirect!=null)
+             redirect.characters(ch,start,length);
+@@ -320,7 +320,7 @@
+         else
+             text.append(ch,start,length);
+     }
+-    
++
+     public int getAttributeIndex(String uri, String localname) {
+         return currentAtts.getIndex(uri, localname);
+     }
+@@ -330,7 +330,7 @@
+         final String qname  = currentAtts.getQName(index).intern();
+         final String value  = currentAtts.getValue(index);
+         currentAtts.removeAttribute(index);
+-        
++
+         currentHandler.enterAttribute(uri,local,qname);
+         currentHandler.text(value);
+         currentHandler.leaveAttribute(uri,local,qname);
+@@ -345,7 +345,7 @@
+             namespaces.add(uri);
+         }
+     }
+-    
++
+     public void endPrefixMapping( String prefix ) throws SAXException {
+         if(redirect!=null)
+             redirect.endPrefixMapping(prefix);
+@@ -354,20 +354,20 @@
+             namespaces.remove(namespaces.size()-1);
+         }
+     }
+-    
++
+     public void skippedEntity( String name ) throws SAXException {
+         if(redirect!=null)
+             redirect.skippedEntity(name);
+     }
+-    
++
+     public void processingInstruction( String target, String data ) throws SAXException {
+         if(redirect!=null)
+             redirect.processingInstruction(target,data);
+     }
+-    
++
+     /** Impossible token. This value can never be a valid XML name. */
+     static final String IMPOSSIBLE = "\u0000";
+-    
++
+     public void endDocument() throws SAXException {
+         // consume the special "end document" token so that all the handlers
+         // currently at the stack will revert to their respective parents.
+@@ -381,10 +381,10 @@
+         // With this grammar, when the endElement event is consumed, two handlers
+         // are on the stack (because a child object won't revert to its parent
+         // unless it sees a next event.)
+-        
++
+         // pass around an "impossible" token.
+         currentHandler.leaveElement(IMPOSSIBLE,IMPOSSIBLE,IMPOSSIBLE);
+-        
++
+         reset();
+     }
+     public void startDocument() throws SAXException {}
+@@ -397,28 +397,28 @@
+ // event dispatching methods
+ //
+ //
+-    
++
+     public void sendEnterAttribute( int threadId,
+         String uri, String local, String qname) throws SAXException {
+-        
++
+         currentHandler.enterAttribute(uri,local,qname);
+     }
+ 
+     public void sendEnterElement( int threadId,
+         String uri, String local, String qname, Attributes atts) throws SAXException {
+-        
++
+         currentHandler.enterElement(uri,local,qname,atts);
+     }
+ 
+     public void sendLeaveAttribute( int threadId,
+         String uri, String local, String qname) throws SAXException {
+-        
++
+         currentHandler.leaveAttribute(uri,local,qname);
+     }
+ 
+     public void sendLeaveElement( int threadId,
+         String uri, String local, String qname) throws SAXException {
+-        
++
+         currentHandler.leaveElement(uri,local,qname);
+     }
+ 
+@@ -434,7 +434,7 @@
+ //
+     /** When redirecting a sub-tree, this value will be non-null. */
+     private ContentHandler redirect = null;
+-    
++
+     /**
+      * Counts the depth of the elements when we are re-directing
+      * a sub-tree to another ContentHandler.
+@@ -445,11 +445,11 @@
+      * This method can be called only from the enterElement handler.
+      * The sub-tree rooted at the new element will be redirected
+      * to the specified ContentHandler.
+-     * 
++     *
+      * <p>
+      * Currently active NGCCHandler will only receive the leaveElement
+      * event of the newly started element.
+-     * 
++     *
+      * @param   uri,local,qname
+      *      Parameters passed to the enter element event. Used to
+      *      simulate the startElement event for the new ContentHandler.
+@@ -456,11 +456,11 @@
+      */
+     public void redirectSubtree( ContentHandler child,
+         String uri, String local, String qname ) throws SAXException {
+-        
++
+         redirect = child;
+         redirect.setDocumentLocator(locator);
+         redirect.startDocument();
+-        
++
+         // TODO: when a prefix is re-bound to something else,
+         // the following code is potentially dangerous. It should be
+         // modified to report active bindings only.
+@@ -469,7 +469,7 @@
+                 (String)namespaces.get(i),
+                 (String)namespaces.get(i+1)
+             );
+-        
++
+         redirect.startElement(uri,local,qname,currentAtts);
+         redirectionDepth=1;
+     }
+@@ -503,17 +503,17 @@
+      * namespace bindings declared on "bob".
+      */
+     private int nsEffectivePtr=0;
+-    
++
+     /**
+      * Stack to preserve old nsEffectivePtr values.
+      */
+     private final Stack nsEffectiveStack = new Stack();
+-    
++
+     public String resolveNamespacePrefix( String prefix ) {
+         for( int i = nsEffectivePtr-2; i>=0; i-=2 )
+             if( namespaces.get(i).equals(prefix) )
+                 return (String)namespaces.get(i+1);
+-        
++
+         // no binding was found.
+         if(prefix.equals(""))   return "";  // return the default no-namespace
+         if(prefix.equals("xml"))    // pre-defined xml prefix
+--- old/src/share/classes/com/sun/tools/internal/jxc/gen/config/Schema.java	Thu Jul 30 17:14:37 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/Schema.java	Thu Jul 30 17:14:37 2009
+@@ -65,6 +65,23 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
++        case 0:
++            {
++                revertToParentFromEnterElement(this, super._cookie, $__uri, $__local, $__qname, $attrs);
++            }
++            break;
++        case 2:
++            {
++                if(($ai = $runtime.getAttributeIndex("","location"))>=0) {
++                    $runtime.consumeAttribute($ai);
++                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
++                }
++                else {
++                    $_ngcc_current_state = 1;
++                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
++                }
++            }
++            break;
+         case 6:
+             {
+                 if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) {
+@@ -88,23 +105,6 @@
+                 }
+             }
+             break;
+-        case 0:
+-            {
+-                revertToParentFromEnterElement(this, super._cookie, $__uri, $__local, $__qname, $attrs);
+-            }
+-            break;
+-        case 2:
+-            {
+-                if(($ai = $runtime.getAttributeIndex("","location"))>=0) {
+-                    $runtime.consumeAttribute($ai);
+-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+-                }
+-                else {
+-                    $_ngcc_current_state = 1;
+-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+-                }
+-            }
+-            break;
+         default:
+             {
+                 unexpectedEnterElement($__qname);
+@@ -119,23 +119,23 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
+-        case 6:
++        case 0:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) {
++                revertToParentFromLeaveElement(this, super._cookie, $__uri, $__local, $__qname);
++            }
++            break;
++        case 2:
++            {
++                if(($ai = $runtime.getAttributeIndex("","location"))>=0) {
+                     $runtime.consumeAttribute($ai);
+                     $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                 }
+                 else {
+-                    $_ngcc_current_state = 2;
++                    $_ngcc_current_state = 1;
+                     $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                 }
+             }
+             break;
+-        case 0:
+-            {
+-                revertToParentFromLeaveElement(this, super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+         case 1:
+             {
+                 if(($__uri == "" && $__local == "schema")) {
+@@ -147,14 +147,14 @@
+                 }
+             }
+             break;
+-        case 2:
++        case 6:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","location"))>=0) {
++                if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) {
+                     $runtime.consumeAttribute($ai);
+                     $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                 }
+                 else {
+-                    $_ngcc_current_state = 1;
++                    $_ngcc_current_state = 2;
+                     $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                 }
+             }
+@@ -172,17 +172,6 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
+-        case 6:
+-            {
+-                if(($__uri == "" && $__local == "namespace")) {
+-                    $_ngcc_current_state = 8;
+-                }
+-                else {
+-                    $_ngcc_current_state = 2;
+-                    $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+-                }
+-            }
+-            break;
+         case 0:
+             {
+                 revertToParentFromEnterAttribute(this, super._cookie, $__uri, $__local, $__qname);
+@@ -199,6 +188,17 @@
+                 }
+             }
+             break;
++        case 6:
++            {
++                if(($__uri == "" && $__local == "namespace")) {
++                    $_ngcc_current_state = 8;
++                }
++                else {
++                    $_ngcc_current_state = 2;
++                    $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
++                }
++            }
++            break;
+         default:
+             {
+                 unexpectedEnterAttribute($__qname);
+@@ -212,15 +212,15 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
+-        case 6:
++        case 0:
+             {
+-                $_ngcc_current_state = 2;
+-                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
++                revertToParentFromLeaveAttribute(this, super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 0:
++        case 2:
+             {
+-                revertToParentFromLeaveAttribute(this, super._cookie, $__uri, $__local, $__qname);
++                $_ngcc_current_state = 1;
++                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+         case 7:
+@@ -233,6 +233,12 @@
+                 }
+             }
+             break;
++        case 6:
++            {
++                $_ngcc_current_state = 2;
++                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
++            }
++            break;
+         case 3:
+             {
+                 if(($__uri == "" && $__local == "location")) {
+@@ -243,12 +249,6 @@
+                 }
+             }
+             break;
+-        case 2:
+-            {
+-                $_ngcc_current_state = 1;
+-                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+         default:
+             {
+                 unexpectedLeaveAttribute($__qname);
+@@ -260,24 +260,6 @@
+     public void text(String $value) throws SAXException {
+         int $ai;
+         switch($_ngcc_current_state) {
+-        case 8:
+-            {
+-                namespace = $value;
+-                $_ngcc_current_state = 7;
+-            }
+-            break;
+-        case 6:
+-            {
+-                if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) {
+-                    $runtime.consumeAttribute($ai);
+-                    $runtime.sendText(super._cookie, $value);
+-                }
+-                else {
+-                    $_ngcc_current_state = 2;
+-                    $runtime.sendText(super._cookie, $value);
+-                }
+-            }
+-            break;
+         case 0:
+             {
+                 revertToParentFromText(this, super._cookie, $value);
+@@ -295,6 +277,12 @@
+                 }
+             }
+             break;
++        case 8:
++            {
++                namespace = $value;
++                $_ngcc_current_state = 7;
++            }
++            break;
+         case 4:
+             {
+                 loc = $value;
+@@ -302,6 +290,18 @@
+                 action0();
+             }
+             break;
++        case 6:
++            {
++                if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) {
++                    $runtime.consumeAttribute($ai);
++                    $runtime.sendText(super._cookie, $value);
++                }
++                else {
++                    $_ngcc_current_state = 2;
++                    $runtime.sendText(super._cookie, $value);
++                }
++            }
++            break;
+         }
+     }
+ 
+@@ -314,11 +314,10 @@
+         return(($_ngcc_current_state == 0));
+     }
+ 
+-    
++
+        private File location;
+        private String namespace;
+        public String getNamespace() { return this.namespace;}
+        public File getLocation() { return this.location;}
+-     
+-}
+ 
++}
+--- old/src/share/classes/com/sun/tools/internal/jxc/gen/config/config.xsd	Thu Jul 30 17:14:42 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/jxc/gen/config/config.xsd	Thu Jul 30 17:14:42 2009
+@@ -23,6 +23,8 @@
+  CA 95054 USA or visit www.sun.com if you need additional information or
+  have any questions.
+ -->
++
++
+ <!-- THIS IS A GENERATED FILE. DO NOT MODIFY. -->
+ <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
+   <xs:element name="config">
+--- old/src/share/classes/com/sun/tools/internal/jxc/model/nav/APTNavigator.java	Thu Jul 30 17:14:46 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/jxc/model/nav/APTNavigator.java	Thu Jul 30 17:14:45 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.jxc.model.nav;
+ 
+ import java.util.ArrayList;
+@@ -306,7 +307,7 @@
+     }
+ 
+     public boolean isInnerClass(TypeDeclaration clazz) {
+-        return clazz.getDeclaringType()!=null;
++        return clazz.getDeclaringType()!=null && !clazz.getModifiers().contains(Modifier.STATIC);
+     }
+ 
+     public boolean isArray(TypeMirror t) {
+@@ -549,4 +550,3 @@
+         }
+     };
+ }
+-
+--- old/src/share/classes/com/sun/tools/internal/ws/Invoker.java	Thu Jul 30 17:14:50 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/Invoker.java	Thu Jul 30 17:14:49 2009
+@@ -55,10 +55,12 @@
+     static int invoke(String mainClass, String[] args) throws Throwable {
+         // use the platform default proxy if available.
+         // see sun.net.spi.DefaultProxySelector for details.
+-        try {
+-            System.setProperty("java.net.useSystemProxies","true");
+-        } catch (SecurityException e) {
+-            // failing to set this property isn't fatal
++        if(!noSystemProxies) {
++            try {
++                System.setProperty("java.net.useSystemProxies","true");
++            } catch (SecurityException e) {
++                // failing to set this property isn't fatal
++            }
+         }
+ 
+         ClassLoader oldcc = Thread.currentThread().getContextClassLoader();
+@@ -93,7 +95,7 @@
+                 }
+ 
+             }
+-            
++
+             Thread.currentThread().setContextClassLoader(cl);
+ 
+             Class compileTool = cl.loadClass(mainClass);
+@@ -132,7 +134,7 @@
+ 
+     /**
+      * Creates a classloader that can load JAXB/WS 2.1 API and tools.jar,
+-     * and then return a classloader that can RI classes, which can see all those APIs and tools.jar.  
++     * and then return a classloader that can RI classes, which can see all those APIs and tools.jar.
+      */
+     public static ClassLoader createClassLoader(ClassLoader cl) throws ClassNotFoundException, MalformedURLException, ToolsJarNotFoundException {
+ 
+@@ -220,4 +222,18 @@
+         "com.sun.xml.internal.bind.",
+         "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/classes/com/sun/tools/internal/ws/WsGen.java	Thu Jul 30 17:14:53 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/WsGen.java	Thu Jul 30 17:14:53 2009
+@@ -28,7 +28,7 @@
+ 
+ /**
+  * WsGen tool entry point.
+- * 
++ *
+  * @author Vivek Pandey
+  * @author Kohsuke Kawaguchi
+  */
+--- old/src/share/classes/com/sun/tools/internal/ws/WsImport.java	Thu Jul 30 17:14:57 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/WsImport.java	Thu Jul 30 17:14:56 2009
+@@ -28,7 +28,7 @@
+ 
+ /**
+  * WsImport tool entry point.
+- * 
++ *
+  * @author Vivek Pandey
+  * @author Kohsuke Kawaguchi
+  */
+--- old/src/share/classes/com/sun/tools/internal/ws/api/TJavaGeneratorExtension.java	Thu Jul 30 17:15:00 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/api/TJavaGeneratorExtension.java	Thu Jul 30 17:14:59 2009
+@@ -34,6 +34,7 @@
+  *
+  * @see JavaGeneratorExtensionFacade
+  * @author Vivek Pandey
++ * @deprecated This class is deprecated, will be removed in JAX-WS 2.2 RI.
+  */
+ public abstract class TJavaGeneratorExtension {
+     /**
+--- old/src/share/classes/com/sun/tools/internal/ws/api/wsdl/TWSDLExtensible.java	Thu Jul 30 17:15:03 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/api/wsdl/TWSDLExtensible.java	Thu Jul 30 17:15:03 2009
+@@ -32,6 +32,8 @@
+  * A WSDL element or attribute that can be extended.
+  *
+  * @author Vivek Pandey
++ * @deprecated This interface is deprecated, will be removed in JAX-WS 2.2 RI.
++ *
+  */
+ public interface TWSDLExtensible {
+     /**
+--- old/src/share/classes/com/sun/tools/internal/ws/api/wsdl/TWSDLExtension.java	Thu Jul 30 17:15:07 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/api/wsdl/TWSDLExtension.java	Thu Jul 30 17:15:06 2009
+@@ -29,6 +29,7 @@
+  * A WSDL extension
+  *
+  * @author Vivek Pandey
++ * @deprecated This interface is deprecated, will be removed in JAX-WS 2.2 RI.
+  */
+ public interface TWSDLExtension {
+     /**
+--- old/src/share/classes/com/sun/tools/internal/ws/api/wsdl/TWSDLExtensionHandler.java	Thu Jul 30 17:15:10 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/api/wsdl/TWSDLExtensionHandler.java	Thu Jul 30 17:15:10 2009
+@@ -33,6 +33,7 @@
+  * with it for the WSDL extensibility elements thats not already defined in the WSDL 1.1 spec, such as SOAP or MIME.
+  *
+  * @author Vivek Pandey
++ * @deprecated This class is deprecated, will be removed in JAX-WS 2.2 RI.
+  */
+ public abstract class TWSDLExtensionHandler {
+     /**
+@@ -46,7 +47,7 @@
+ 
+     /**
+      * This interface is called during WSDL parsing on detecting any wsdl extension.
+-     * 
++     *
+      * @param context Parser context that will be passed on by the wsdl parser
+      * @param parent  The Parent element within which the extensibility element is defined
+      * @param e       The extensibility elemenet
+--- old/src/share/classes/com/sun/tools/internal/ws/api/wsdl/TWSDLOperation.java	Thu Jul 30 17:15:14 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/api/wsdl/TWSDLOperation.java	Thu Jul 30 17:15:13 2009
+@@ -33,6 +33,7 @@
+  * Abstracts wsdl:portType/wsdl:operation
+  *
+  * @author Vivek Pandey
++ * @deprecated This interface is deprecated, will be removed in JAX-WS 2.2 RI.
+  */
+ public interface TWSDLOperation extends TWSDLExtensible{
+     /**
+--- old/src/share/classes/com/sun/tools/internal/ws/api/wsdl/TWSDLParserContext.java	Thu Jul 30 17:15:18 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/api/wsdl/TWSDLParserContext.java	Thu Jul 30 17:15:17 2009
+@@ -33,6 +33,7 @@
+  * it can be latter used by other extensions to resolve the namespaces.
+  *
+  * @author Vivek Pandey
++ * @deprecated This interface is deprecated, will be removed in JAX-WS 2.2 RI.
+  */
+ public interface TWSDLParserContext {
+ 
+--- old/src/share/classes/com/sun/tools/internal/ws/package-info.java	Thu Jul 30 17:15:21 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/package-info.java	Thu Jul 30 17:15:21 2009
+@@ -24,25 +24,25 @@
+  */
+ 
+ /**
+- * <h1>JAX-WS 2.0.1 Tools</h1>
+- * This document describes the tools included with JAX-WS 2.0.1. 
++ * <h1>JAX-WS 2.1 Tools</h1>
++ * This document describes the tools included with JAX-WS 2.0.1.
+  *
+  * {@DotDiagram
+      digraph G {
+        // external tools
+        APT;
+- 
++
+        // ANT tasks
+        node [style=filled,color=lightyellow];
+-       "WsGen ANT Task"; "WsImport ANT Task"; "Apt ANT Task"; 
++       "WsGen ANT Task"; "WsImport ANT Task"; "Apt ANT Task";
+ 
+       // commandline
+        node [style=filled,color=lightpink];
+        wsgen; wsimport;
+- 
++
+        // libraries
+       node [style=filled,color=lightblue];
+-      CompileTool; "WSAP"; WebServiceAP; Processor; Modeler; ProcessorActions; 
++      WsimportTool; WsgenTool;"WSAP"; WebServiceAP; WSDLModeler;WSDLParser;SeiGenerator;ServiceGenerator;ExceptionGenerator;"JAXB XJC APIs";CodeModel;
+ 
+        // aps
+ #       node [style=filled,color=lightpink];
+@@ -49,15 +49,17 @@
+ #       "JAX-WS"; tools; runtime; SPI; "Annotation Processor";
+ 
+        "Apt ANT Task" -> APT;
+-       "WsGen ANT Task" -> wsgen -> CompileTool;
+-       "WsImport ANT Task" -> wsimport -> CompileTool;
+-       
+-       CompileTool -> APT -> WSAP -> WebServiceAP;
+-       CompileTool -> Processor -> Modeler;
+-       Processor -> ProcessorActions;
+-       CompileTool -> WebServiceAP;
+- 
+-       Modeler -> WSDLModeler;
++       "WsGen ANT Task" -> wsgen -> WsgenTool;
++       "WsImport ANT Task" -> wsimport -> WsimportTool;
++
++       WsgenTool -> APT -> WSAP -> WebServiceAP;
++       WsimportTool -> WSDLModeler;
++       WSDLModeler->WSDLParser;
++       WSDLModeler->"JAXB XJC APIs"
++       WsimportTool->SeiGenerator->CodeModel;
++       WsimportTool->ServiceGenerator->CodeModel;
++       WsimportTool->ExceptionGenerator->CodeModel;
++       WebServiceAP->CodeModel
+      }
+  * }
+  * <div align=right>
+@@ -65,7 +67,7 @@
+  * </div>
+  *
+  * <h2>ANT Tasks</h2>
+-   <d1>   
++   <d1>
+  *  <dt>{@link com.sun.tools.internal.ws.ant.Apt Apt}
+  *  <dd>An ANT task to invoke <a href="http://java.sun.com/j2se/1.5.0/docs/tooldocs/share/apt.html">APT</a>.
+ 
+@@ -72,27 +74,27 @@
+  *  <dt>{@link com.sun.tools.internal.ws.ant.WsGen2 WsGen}
+  *  <dd>
+  *    An ANT task to invoke {@link com.sun.tools.internal.ws.WsGen WsGen}
+- 
++
+  *  <dt>{@link com.sun.tools.internal.ws.ant.WsImport2 WsImport}
+  *  <dd>
+  *    An ANT task to invoke {@link com.sun.tools.internal.ws.WsImport WsImport}
+- * 
+- *  </d1>       
++ *
++ *  </d1>
+  * <h2>Command-line Tools</h2>
+-   <d1>   
++   <d1>
+  *  <dt><a href="http://java.sun.com/j2se/1.5.0/docs/tooldocs/share/apt.html">APT</a>
+-     <dd>A Java SE tool and framework for processing annotations. APT will invoke a JAX-WS AnnotationProcossor for 
++     <dd>A Java SE tool and framework for processing annotations. APT will invoke a JAX-WS AnnotationProcossor for
+  *   processing Java source  files with javax.jws.* annotations and making them web services.
+- *   APT will compile the Java source files and generate any additional classes needed to make an javax.jws.WebService 
+- *   annotated class a Web service.  
++ *   APT will compile the Java source files and generate any additional classes needed to make an javax.jws.WebService
++ *   annotated class a Web service.
+  *
+  *  <dt>{@link com.sun.tools.internal.ws.WsGen WsGen}
+- *  <dd>Tool to process a compiled javax.jws.WebService annotated class and to generate the necessary classes to make 
+- *  it a Web service.  
+- 
++ *  <dd>Tool to process a compiled javax.jws.WebService annotated class and to generate the necessary classes to make
++ *  it a Web service.
++
+  *  <dt>{@link com.sun.tools.internal.ws.ant.WsImport2 WsImport}
+  *  <dd>
+- *    Tool to import a WSDL and to generate an SEI (a javax.jws.WebService) interface that can be either implemented 
++ *    Tool to import a WSDL and to generate an SEI (a javax.jws.WebService) interface that can be either implemented
+  *    on the server to build a web service, or can be used on the client to invoke the web service.
+  *  </d1>
+  * <h2>Implementation Classes</h2>
+@@ -103,7 +105,7 @@
+  *
+  *
+  *    <dt>{@link com.sun.tools.internal.ws.processor.modeler.Modeler Modeler}
+- *    <dd>A Modeler is used to create a Model of a Web Service from a particular Web 
++ *    <dd>A Modeler is used to create a Model of a Web Service from a particular Web
+  *    Web Service description such as a WSDL
+  *    file.
+  *
+@@ -111,8 +113,8 @@
+  *    <dd>The WSDLModeler processes a WSDL to create a Model.
+  *
+  *    <dt>{@link com.sun.tools.internal.ws.processor.modeler.annotation.WebServiceAP WebServiceAP}
+- *    <dd>WebServiceAP is a APT AnnotationProcessor for processing javax.jws.* and 
+- *    javax.xml.ws.* annotations. This class is used either by the WsGen (CompileTool) tool or 
++ *    <dd>WebServiceAP is a APT AnnotationProcessor for processing javax.jws.* and
++ *    javax.xml.ws.* annotations. This class is used either by the WsGen (CompileTool) tool or
+  *    idirectly via the {@link com.sun.istack.internal.ws.WSAP WSAP} when invoked by APT.
+  *
+  *    <dt>{@link com.sun.istack.internal.ws.AnnotationProcessorFactoryImpl WSAP}
+--- old/src/share/classes/com/sun/tools/internal/ws/processor/ProcessorException.java	Thu Jul 30 17:15:25 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/ProcessorException.java	Thu Jul 30 17:15:24 2009
+@@ -30,9 +30,9 @@
+ /**
+  * ProcessorException represents an exception that occurred while processing
+  * a web service.
+- * 
++ *
+  * @see JAXWSExceptionBase
+- * 
++ *
+  * @author WS Development Team
+  */
+ public class ProcessorException extends JAXWSExceptionBase {
+@@ -42,7 +42,7 @@
+     }
+ 
+     public ProcessorException(String msg){
+-        super(msg);        
++        super(msg);
+     }
+ 
+     public ProcessorException(Throwable throwable) {
+--- old/src/share/classes/com/sun/tools/internal/ws/processor/generator/CustomExceptionGenerator.java	Thu Jul 30 17:15:28 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/CustomExceptionGenerator.java	Thu Jul 30 17:15:28 2009
+@@ -59,7 +59,7 @@
+         WsimportOptions options,
+         ErrorReceiver receiver){
+         CustomExceptionGenerator exceptionGen = new CustomExceptionGenerator(model, options, receiver);
+-        exceptionGen.doGeneration();        
++        exceptionGen.doGeneration();
+     }
+     private CustomExceptionGenerator(
+         Model model,
+@@ -90,7 +90,7 @@
+     private void registerFault(Fault fault) {
+          try {
+             write(fault);
+-            faults.put(fault.getJavaException().getName(), fault.getExceptionClass()); 
++            faults.put(fault.getJavaException().getName(), fault.getExceptionClass());
+         } catch (JClassAlreadyExistsException e) {
+             throw new GeneratorException("generator.nestedGeneratorError",e);
+         }
+@@ -109,7 +109,7 @@
+         for (String doc : getJAXWSClassComment()) {
+             comment.add(doc);
+         }
+-        
++
+         cls._extends(java.lang.Exception.class);
+ 
+         //@WebFault
+--- old/src/share/classes/com/sun/tools/internal/ws/processor/generator/GeneratorBase.java	Thu Jul 30 17:15:32 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/GeneratorBase.java	Thu Jul 30 17:15:31 2009
+@@ -156,12 +156,14 @@
+         return comments;
+     }
+ 
+-    protected JDefinedClass getClass(String className, ClassType type) {
++    protected JDefinedClass getClass(String className, ClassType type) throws JClassAlreadyExistsException {
+         JDefinedClass cls;
+         try {
+             cls = cm._class(className, type);
+         } catch (JClassAlreadyExistsException e){
+             cls = cm._getClass(className);
++            if(cls == null)
++                throw e;
+         }
+         return cls;
+     }
+--- old/src/share/classes/com/sun/tools/internal/ws/processor/generator/SeiGenerator.java	Thu Jul 30 17:15:35 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/SeiGenerator.java	Thu Jul 30 17:15:35 2009
+@@ -36,7 +36,11 @@
+ 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;
+ import javax.jws.WebParam;
+@@ -48,6 +52,8 @@
+ import java.util.ArrayList;
+ import java.util.List;
+ 
++import org.xml.sax.Locator;
++
+ public class SeiGenerator extends GeneratorBase{
+     private String serviceNS;
+     private TJavaGeneratorExtension extension;
+@@ -66,7 +72,7 @@
+         //spec does not require generation of these annotations
+         // and we can infer from wsdl anyway, so lets disable it
+         //register(new W3CAddressingJavaGeneratorExtension());
+-        
++
+         for (TJavaGeneratorExtension j : extensions)
+             register(j);
+ 
+@@ -83,10 +89,22 @@
+         }
+ 
+ 
+-        JDefinedClass cls = getClass(className, ClassType.INTERFACE);
+-        if (cls == null)
++        JDefinedClass cls = null;
++        try {
++            cls = getClass(className, ClassType.INTERFACE);
++        } catch (JClassAlreadyExistsException e) {
++            QName portTypeName =
++                (QName) port.getProperty(
++                        ModelProperties.PROPERTY_WSDL_PORT_TYPE_NAME);
++            Locator loc = null;
++            if(portTypeName != null){
++                PortType pt = port.portTypes.get(portTypeName);
++                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())
+@@ -173,11 +191,11 @@
+     private void writeXmlSeeAlso(JDefinedClass cls) {
+         if (model.getJAXBModel().getS2JJAXBModel() != null) {
+             List<JClass> objectFactories = model.getJAXBModel().getS2JJAXBModel().getAllObjectFactories();
+-            
++
+             //if there are no object facotires, dont generate @XmlSeeAlso
+             if(objectFactories.size() == 0)
+                 return;
+-            
++
+             JAnnotationUse xmlSeeAlso = cls.annotate(cm.ref(XmlSeeAlso.class));
+             JAnnotationArrayMember paramArray = xmlSeeAlso.paramArray("value");
+             for (JClass of : objectFactories) {
+@@ -441,15 +459,7 @@
+         if (port.isProvider()) {
+             return;                // Not generating for Provider based endpoint
+         }
+-
+-
+-        try {
+-            write(port);
+-        } catch (Exception e) {
+-            throw new GeneratorException(
+-                "generator.nestedGeneratorError",
+-                e);
+-        }
++        write(port);
+     }
+ 
+     private void register(TJavaGeneratorExtension h) {
+--- old/src/share/classes/com/sun/tools/internal/ws/processor/generator/ServiceGenerator.java	Thu Jul 30 17:15:39 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/ServiceGenerator.java	Thu Jul 30 17:15:38 2009
+@@ -29,11 +29,13 @@
+ import com.sun.tools.internal.ws.processor.model.Model;
+ import com.sun.tools.internal.ws.processor.model.Port;
+ import com.sun.tools.internal.ws.processor.model.Service;
++import com.sun.tools.internal.ws.processor.model.ModelProperties;
+ import com.sun.tools.internal.ws.processor.model.java.JavaInterface;
+ 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.resources.GeneratorMessages;
++import com.sun.tools.internal.ws.wsdl.document.PortType;
+ import com.sun.xml.internal.bind.api.JAXBRIContext;
+ import com.sun.xml.internal.ws.util.JAXWSUtils;
+ 
+@@ -42,168 +44,181 @@
+ import javax.xml.ws.WebServiceClient;
+ import javax.xml.ws.WebServiceFeature;
+ import java.io.IOException;
++import java.io.File;
+ import java.net.MalformedURLException;
+ import java.net.URL;
++import java.util.logging.Logger;
+ 
++import org.xml.sax.Locator;
+ 
++
+ /**
+- *
+  * @author WS Development Team
+  */
+-public class ServiceGenerator extends GeneratorBase{
++public class ServiceGenerator extends GeneratorBase {
+ 
+-    public static void generate(Model model, WsimportOptions options, ErrorReceiver receiver){
++    public static void generate(Model model, WsimportOptions options, ErrorReceiver receiver) {
+         ServiceGenerator serviceGenerator = new ServiceGenerator(model, options, receiver);
+         serviceGenerator.doGeneration();
+     }
++
+     private ServiceGenerator(Model model, WsimportOptions options, ErrorReceiver receiver) {
+         super(model, options, receiver);
+     }
+ 
+-    private JInvocation createURL(URL url) {
+-        return JExpr._new(cm.ref(URL.class)).arg(url.toExternalForm());
+-    }
+-
+     @Override
+     public void visit(Service service) {
++        JavaInterface intf = service.getJavaInterface();
++        String className = Names.customJavaTypeClassName(intf);
++        if (donotOverride && GeneratorUtil.classExists(options, className)) {
++            log("Class " + className + " exists. Not overriding.");
++            return;
++        }
++
++        JDefinedClass cls;
+         try {
+-            JavaInterface intf = service.getJavaInterface();
+-            String className = Names.customJavaTypeClassName(intf);
+-            if (donotOverride && GeneratorUtil.classExists(options, className)) {
+-                log("Class " + className + " exists. Not overriding.");
+-                return;
+-            }
++            cls = getClass(className, ClassType.CLASS);
++        } catch (JClassAlreadyExistsException e) {
++            receiver.error(service.getLocator(), GeneratorMessages.GENERATOR_SERVICE_CLASS_ALREADY_EXIST(className, service.getName()));
++            return;
++        }
+ 
+-            JDefinedClass cls = getClass(className, ClassType.CLASS);
++        cls._extends(javax.xml.ws.Service.class);
++        String serviceFieldName = JAXBRIContext.mangleNameToClassName(service.getName().getLocalPart()).toUpperCase();
++        String wsdlLocationName = serviceFieldName + "_WSDL_LOCATION";
++        JFieldVar urlField = cls.field(JMod.PRIVATE | JMod.STATIC | JMod.FINAL, URL.class, wsdlLocationName);
+ 
+-            cls._extends(javax.xml.ws.Service.class);
+-            String serviceFieldName = JAXBRIContext.mangleNameToClassName(service.getName().getLocalPart()).toUpperCase();
+-            String wsdlLocationName = serviceFieldName+"_WSDL_LOCATION";
+-            JFieldVar urlField = cls.field(JMod.PRIVATE|JMod.STATIC|JMod.FINAL, URL.class, wsdlLocationName);
+-            JClass qNameCls = cm.ref(QName.class);
+-            JInvocation inv;
+-            inv = JExpr._new(qNameCls);
+-            inv.arg("namespace");
+-            inv.arg("localpart");
+ 
++        cls.field(JMod.PRIVATE | JMod.STATIC | JMod.FINAL, Logger.class, "logger", cm.ref(Logger.class).staticInvoke("getLogger").arg(JExpr.dotclass(cm.ref(className)).invoke("getName")));
+ 
+-            JBlock staticBlock = cls.init();
+-            URL url = new URL(JAXWSUtils.absolutize(JAXWSUtils.getFileOrURLName(wsdlLocation)));
+-            JVar urlVar = staticBlock.decl(cm.ref(URL.class),"url", JExpr._null());
+-            JTryBlock tryBlock = staticBlock._try();
+-            tryBlock.body().assign(urlVar, createURL(url)); 
+-            JCatchBlock catchBlock = tryBlock._catch(cm.ref(MalformedURLException.class));
+-            catchBlock.param("e");
+-            catchBlock.body().directStatement("e.printStackTrace();");
+-            staticBlock.assign(urlField, urlVar);
+-          
+-            //write class comment - JAXWS warning
+-            JDocComment comment = cls.javadoc();
++        JClass qNameCls = cm.ref(QName.class);
++        JInvocation inv;
++        inv = JExpr._new(qNameCls);
++        inv.arg("namespace");
++        inv.arg("localpart");
+ 
+-            if(service.getJavaDoc() != null){
+-                comment.add(service.getJavaDoc());
+-                comment.add("\n\n");
+-            }
+ 
+-            for (String doc : getJAXWSClassComment()) {
+-                comment.add(doc);
+-            }
++        JBlock staticBlock = cls.init();
++        JVar urlVar = staticBlock.decl(cm.ref(URL.class), "url", JExpr._null());
++        JTryBlock tryBlock = staticBlock._try();
++        JVar baseUrl = tryBlock.body().decl(cm.ref(URL.class), "baseUrl");
++        tryBlock.body().assign(baseUrl, JExpr.dotclass(cm.ref(className)).invoke("getResource").arg("."));
++        tryBlock.body().assign(urlVar, JExpr._new(cm.ref(URL.class)).arg(baseUrl).arg(wsdlLocation));
++        JCatchBlock catchBlock = tryBlock._catch(cm.ref(MalformedURLException.class));
++        catchBlock.param("e");
+ 
+-            JMethod constructor = cls.constructor(JMod.PUBLIC);
+-            constructor.param(URL.class, "wsdlLocation");
+-            constructor.param(QName.class, "serviceName");
+-            constructor.body().directStatement("super(wsdlLocation, serviceName);");
+-            
+-            constructor = cls.constructor(JMod.PUBLIC);
+-            constructor.body().directStatement("super("+wsdlLocationName+", new QName(\""+service.getName().getNamespaceURI()+"\", \""+service.getName().getLocalPart()+"\"));");
+-            
+-            //@WebService
+-            JAnnotationUse webServiceClientAnn = cls.annotate(cm.ref(WebServiceClient.class));
+-            writeWebServiceClientAnnotation(service, webServiceClientAnn);
++        catchBlock.body().directStatement("logger.warning(\"Failed to create URL for the wsdl Location: " + JExpr.quotify('\'', wsdlLocation) + ", retrying as a local file\");");
++        catchBlock.body().directStatement("logger.warning(e.getMessage());");
+ 
+-            //@HandlerChain
+-            writeHandlerConfig(Names.customJavaTypeClassName(service.getJavaInterface()), cls, options);
++        staticBlock.assign(urlField, urlVar);
+ 
+-            for (Port port: service.getPorts()) {
+-                if (port.isProvider()) {
+-                    continue;  // No getXYZPort() for porvider based endpoint
+-                }
++        //write class comment - JAXWS warning
++        JDocComment comment = cls.javadoc();
+ 
+-                //write getXyzPort()
+-                writeDefaultGetPort(port, cls);
++        if (service.getJavaDoc() != null) {
++            comment.add(service.getJavaDoc());
++            comment.add("\n\n");
++        }
+ 
+-                //write getXyzPort(WebServicesFeature...)
+-                if(options.target.isLaterThan(Options.Target.V2_1))
+-                    writeGetPort(port, cls);
++        for (String doc : getJAXWSClassComment()) {
++            comment.add(doc);
++        }
++
++        JMethod constructor = cls.constructor(JMod.PUBLIC);
++        constructor.param(URL.class, "wsdlLocation");
++        constructor.param(QName.class, "serviceName");
++        constructor.body().directStatement("super(wsdlLocation, serviceName);");
++
++        constructor = cls.constructor(JMod.PUBLIC);
++        constructor.body().directStatement("super(" + wsdlLocationName + ", new QName(\"" + service.getName().getNamespaceURI() + "\", \"" + service.getName().getLocalPart() + "\"));");
++
++        //@WebService
++        JAnnotationUse webServiceClientAnn = cls.annotate(cm.ref(WebServiceClient.class));
++        writeWebServiceClientAnnotation(service, webServiceClientAnn);
++
++        //@HandlerChain
++        writeHandlerConfig(Names.customJavaTypeClassName(service.getJavaInterface()), cls, options);
++
++        for (Port port : service.getPorts()) {
++            if (port.isProvider()) {
++                continue;  // No getXYZPort() for porvider based endpoint
+             }
+-        } catch (IOException e) {
+-            receiver.error(e);
++
++            //Get the SEI class
++            JType retType;
++            try {
++                retType = getClass(port.getJavaInterface().getName(), ClassType.INTERFACE);
++            } catch (JClassAlreadyExistsException e) {
++                QName portTypeName =
++                        (QName) port.getProperty(
++                                ModelProperties.PROPERTY_WSDL_PORT_TYPE_NAME);
++                Locator loc = null;
++                if (portTypeName != null) {
++                    PortType pt = port.portTypes.get(portTypeName);
++                    if (pt != null)
++                        loc = pt.getLocator();
++                }
++                receiver.error(loc, GeneratorMessages.GENERATOR_SEI_CLASS_ALREADY_EXIST(port.getJavaInterface().getName(), portTypeName));
++                return;
++            }
++
++            //write getXyzPort()
++            writeDefaultGetPort(port, retType, cls);
++
++            //write getXyzPort(WebServicesFeature...)
++            if (options.target.isLaterThan(Options.Target.V2_1))
++                writeGetPort(port, retType, cls);
+         }
+     }
+ 
+-    private void writeGetPort(Port port, JDefinedClass cls) {
+-        JType retType = getClass(port.getJavaInterface().getName(), ClassType.INTERFACE);
++    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 ");
+-        paramDoc.append("{@link "+WebServiceFeature.class.getName()+"}");
++        paramDoc.append("{@link " + WebServiceFeature.class.getName() + "}");
+         paramDoc.append("to configure on the proxy.  Supported features not in the <code>features</code> parameter will have their default values.");
+-        ret.add("returns "+retType.name());
++        ret.add("returns " + retType.name());
+         m.varParam(WebServiceFeature.class, "features");
+         JBlock body = m.body();
+-        StringBuffer statement = new StringBuffer("return (");
++        StringBuffer statement = new StringBuffer("return ");
++        statement.append("super.getPort(new QName(\"").append(port.getName().getNamespaceURI()).append("\", \"").append(port.getName().getLocalPart()).append("\"), ");
+         statement.append(retType.name());
+-        statement.append(")super.getPort(new QName(\"").append(port.getName().getNamespaceURI()).append("\", \"").append(port.getName().getLocalPart()).append("\"), ");
+-        statement.append(retType.name());
+         statement.append(".class, features);");
+         body.directStatement(statement.toString());
+         writeWebEndpoint(port, m);
+     }
+ 
+-    private void writeDefaultGetPort(Port port, JDefinedClass cls) {
+-        JType retType = getClass(port.getJavaInterface().getName(), ClassType.INTERFACE);
++    private void writeDefaultGetPort(Port port, JType retType, JDefinedClass cls) {
+         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());
++        ret.add("returns " + retType.name());
+         JBlock body = m.body();
+-        StringBuffer statement = new StringBuffer("return (");
++        StringBuffer statement = new StringBuffer("return ");
++        statement.append("super.getPort(new QName(\"").append(port.getName().getNamespaceURI()).append("\", \"").append(port.getName().getLocalPart()).append("\"), ");
+         statement.append(retType.name());
+-        statement.append(")super.getPort(new QName(\"").append(port.getName().getNamespaceURI()).append("\", \"").append(port.getName().getLocalPart()).append("\"), ");
+-        statement.append(retType.name());
+         statement.append(".class);");
+         body.directStatement(statement.toString());
+         writeWebEndpoint(port, m);
+     }
+ 
+-
+-    protected JDefinedClass getClass(String className, ClassType type) {
+-        JDefinedClass cls;
+-        try {
+-            cls = cm._class(className, type);
+-        } catch (JClassAlreadyExistsException e){
+-            cls = cm._getClass(className);
+-        }
+-        return cls;
+-    }      
+-    
+     private void writeWebServiceClientAnnotation(Service service, JAnnotationUse wsa) {
+         String serviceName = service.getName().getLocalPart();
+-        String serviceNS= service.getName().getNamespaceURI();
++        String serviceNS = service.getName().getNamespaceURI();
+         wsa.param("name", serviceName);
+         wsa.param("targetNamespace", serviceNS);
+         wsa.param("wsdlLocation", wsdlLocation);
+-    }    
+-    
++    }
++
+     private void writeWebEndpoint(Port port, JMethod m) {
+         JAnnotationUse webEndpointAnn = m.annotate(cm.ref(WebEndpoint.class));
+         webEndpointAnn.param("name", port.getName().getLocalPart());
+-    }    
++    }
+ }
+--- old/src/share/classes/com/sun/tools/internal/ws/processor/generator/W3CAddressingJavaGeneratorExtension.java	Thu Jul 30 17:15:43 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/generator/W3CAddressingJavaGeneratorExtension.java	Thu Jul 30 17:15:42 2009
+@@ -22,9 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * $Id: W3CAddressingJavaGeneratorExtension.java,v 1.1.2.4 2006/10/31 19:57:28 vivekp Exp $
+- */
+ 
+ package com.sun.tools.internal.ws.processor.generator;
+ 
+--- old/src/share/classes/com/sun/tools/internal/ws/processor/model/AsyncOperation.java	Thu Jul 30 17:15:46 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/AsyncOperation.java	Thu Jul 30 17:15:46 2009
+@@ -108,7 +108,7 @@
+             return new JavaSimpleType(new JAXBTypeAndAnnotation(cb));
+ 
+         }
+-        return null;        
++        return null;
+     }
+ 
+     public Operation getNormalOperation(){
+--- old/src/share/classes/com/sun/tools/internal/ws/processor/model/ExtendedModelVisitor.java	Thu Jul 30 17:15:50 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/ExtendedModelVisitor.java	Thu Jul 30 17:15:49 2009
+@@ -43,7 +43,7 @@
+             for (Port port : service.getPorts()) {
+                 preVisit(port);
+                 if (shouldVisit(port)) {
+-                    for (Operation operation : port.getOperations()) {                        
++                    for (Operation operation : port.getOperations()) {
+                         preVisit(operation);
+                         Request request = operation.getRequest();
+                         if (request != null) {
+--- old/src/share/classes/com/sun/tools/internal/ws/processor/model/HeaderFault.java	Thu Jul 30 17:15:54 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/HeaderFault.java	Thu Jul 30 17:15:53 2009
+@@ -57,4 +57,3 @@
+     private QName _message;
+     private String _part;
+ }
+-
+--- old/src/share/classes/com/sun/tools/internal/ws/processor/model/Message.java	Thu Jul 30 17:15:57 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Message.java	Thu Jul 30 17:15:56 2009
+@@ -172,7 +172,7 @@
+     }
+ 
+     public void addParameter(Parameter p) {
+-        if (_parametersByName.containsKey(p.getName())) {            
++        if (_parametersByName.containsKey(p.getName())) {
+             errorReceiver.error(getEntity().getLocator(), ModelMessages.MODEL_PARAMETER_NOTUNIQUE(p.getName(), p.getName()));
+             throw new AbortException();
+         }
+--- old/src/share/classes/com/sun/tools/internal/ws/processor/model/Port.java	Thu Jul 30 17:16:01 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/Port.java	Thu Jul 30 17:16:00 2009
+@@ -26,6 +26,7 @@
+ package com.sun.tools.internal.ws.processor.model;
+ 
+ import com.sun.tools.internal.ws.processor.model.java.JavaInterface;
++import com.sun.tools.internal.ws.wsdl.document.PortType;
+ import com.sun.tools.internal.ws.wsdl.document.soap.SOAPStyle;
+ import com.sun.tools.internal.ws.wsdl.framework.Entity;
+ 
+@@ -174,4 +175,5 @@
+     private String _address;
+     private String _serviceImplName;
+     private Map<String, Operation> operationsByName = new HashMap<String, Operation>();
++    public Map<QName, PortType> portTypes = new HashMap<QName, PortType>();
+ }
+--- old/src/share/classes/com/sun/tools/internal/ws/processor/model/java/JavaInterface.java	Thu Jul 30 17:16:04 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/java/JavaInterface.java	Thu Jul 30 17:16:03 2009
+@@ -140,7 +140,7 @@
+     public void setInterfacesList(List l) {
+         interfaces = l;
+     }
+-    
++
+     public String getSimpleName() {
+         return ClassNameInfo.getName(name);
+     }
+--- old/src/share/classes/com/sun/tools/internal/ws/processor/model/java/JavaMethod.java	Thu Jul 30 17:16:07 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/java/JavaMethod.java	Thu Jul 30 17:16:07 2009
+@@ -27,6 +27,7 @@
+ 
+ import com.sun.tools.internal.ws.resources.ModelMessages;
+ import com.sun.tools.internal.ws.wscompile.ErrorReceiver;
++import com.sun.tools.internal.ws.wscompile.WsimportOptions;
+ import com.sun.tools.internal.ws.processor.model.Parameter;
+ 
+ import java.util.ArrayList;
+@@ -42,12 +43,14 @@
+     private final String name;
+     private final List<JavaParameter> parameters = new ArrayList<JavaParameter>();
+     private final List<String> exceptions = new ArrayList<String>();
++    private final WsimportOptions options;
+     private JavaType returnType;
+ 
+-    public JavaMethod(String name, ErrorReceiver receiver) {
++    public JavaMethod(String name, WsimportOptions options, ErrorReceiver receiver) {
+         this.name = name;
+         this.returnType = null;
+         this.errorReceiver = receiver;
++        this.options = options;
+     }
+ 
+     public String getName() {
+@@ -83,10 +86,19 @@
+     public void addParameter(JavaParameter param) {
+         // verify that this member does not already exist
+         if (hasParameter(param.getName())) {
+-            errorReceiver.error(param.getParameter().getLocator(), ModelMessages.MODEL_PARAMETER_NOTUNIQUE(param.getName(), param.getParameter().getEntityName()));
+-            Parameter duplicParam = getParameter(param.getName());
+-            errorReceiver.error(duplicParam.getLocator(), ModelMessages.MODEL_PARAMETER_NOTUNIQUE(param.getName(), duplicParam.getEntityName()));
+-            return;
++            if(options.isExtensionMode()){
++                param.setName(getUniqueName(param.getName()));
++            }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{
++                    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()));
++                }
++                return;
++            }
+         }
+         parameters.add(param);
+     }
+@@ -106,4 +118,12 @@
+     public Iterator<String> getExceptions() {
+         return exceptions.iterator();
+     }
++
++    private String getUniqueName(String param){
++        int parmNum = 0;
++        while(hasParameter(param)){
++            param = param + Integer.toString(parmNum++);
++        }
++        return param;
++    }
+ }
+--- old/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBElementMember.java	Thu Jul 30 17:16:11 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBElementMember.java	Thu Jul 30 17:16:10 2009
+@@ -31,7 +31,7 @@
+ /**
+  * @author Kathy Walsh, Vivek Pandey
+  *
+- * 
++ *
+  */
+ 
+ public class JAXBElementMember {
+@@ -56,8 +56,8 @@
+         return _type;
+     }
+     public void setType(JAXBType t) {
+-        _type = t;        
+-    }    
++        _type = t;
++    }
+     public boolean isRepeated() {
+         return _repeated;
+     }
+@@ -88,7 +88,7 @@
+     public void setProperty(JAXBProperty prop) {
+         _prop = prop;
+     }
+-    
++
+     private QName _name;
+     private JAXBType _type;
+     private JavaStructureMember _javaStructureMember;
+--- old/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBModel.java	Thu Jul 30 17:16:15 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBModel.java	Thu Jul 30 17:16:14 2009
+@@ -44,7 +44,7 @@
+     /**
+      * All the mappings known to this model.
+      */
+-    private List<JAXBMapping> mappings;   
++    private List<JAXBMapping> mappings;
+ 
+     // index for faster access.
+     private final Map<QName,JAXBMapping> byQName = new HashMap<QName,JAXBMapping>();
+--- old/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBProperty.java	Thu Jul 30 17:16:18 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBProperty.java	Thu Jul 30 17:16:18 2009
+@@ -68,7 +68,7 @@
+     public void setName(String name) {
+         this.name = name;
+     }
+-    
++
+     public JAXBTypeAndAnnotation getType() {
+         return type;
+     }
+--- old/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBType.java	Thu Jul 30 17:16:22 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/model/jaxb/JAXBType.java	Thu Jul 30 17:16:21 2009
+@@ -71,11 +71,11 @@
+     }
+ 
+     public boolean isUnwrappable(){
+-        return getJaxbMapping().getWrapperStyleDrilldown() != null;
++        return jaxbMapping != null && jaxbMapping.getWrapperStyleDrilldown() != null;
+     }
+ 
+     public boolean hasWrapperChildren(){
+-        return (getWrapperChildren().size() > 0) ? true : false;
++        return wrapperChildren.size() > 0;
+     }
+ 
+     public boolean isLiteralType() {
+--- old/src/share/classes/com/sun/tools/internal/ws/processor/modeler/Modeler.java	Thu Jul 30 17:16:26 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/Modeler.java	Thu Jul 30 17:16:25 2009
+@@ -29,7 +29,7 @@
+ import com.sun.tools.internal.ws.processor.model.Model;
+ 
+ /**
+- * A Modeler is used to create a Model of a Web Service from a particular Web 
++ * A Modeler is used to create a Model of a Web Service from a particular Web
+  * Web Service description such as a WSDL
+  *
+  * @author WS Development Team
+--- old/src/share/classes/com/sun/tools/internal/ws/processor/modeler/annotation/MakeSafeTypeVisitor.java	Thu Jul 30 17:16:29 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/annotation/MakeSafeTypeVisitor.java	Thu Jul 30 17:16:28 2009
+@@ -45,26 +45,26 @@
+      * Creates a new instance of MakeSafeTypeVisitor
+      */
+     public MakeSafeTypeVisitor(AnnotationProcessorEnvironment apEnv) {
+-        collectionDecl = apEnv.getTypeDeclaration(COLLECTION_CLASSNAME);        
++        collectionDecl = apEnv.getTypeDeclaration(COLLECTION_CLASSNAME);
+         mapDecl = apEnv.getTypeDeclaration(MAP_CLASSNAME);
+     }
+-    
++
+     protected TypeMirror onArrayType(ArrayType type, Types apTypes) {
+-        return apTypes.getErasure(type);   
++        return apTypes.getErasure(type);
+     }
+-    
++
+     protected TypeMirror onPrimitiveType(PrimitiveType type, Types apTypes) {
+-        return apTypes.getErasure(type);   
++        return apTypes.getErasure(type);
+     }
+-     
++
+     protected TypeMirror onClassType(ClassType type, Types apTypes) {
+         return processDeclaredType(type, apTypes);
+     }
+-    
++
+     protected TypeMirror onInterfaceType(InterfaceType type, Types apTypes) {
+-        return processDeclaredType(type, apTypes);        
++        return processDeclaredType(type, apTypes);
+     }
+-    
++
+     private TypeMirror processDeclaredType(DeclaredType type, Types apTypes) {
+         if (TypeModeler.isSubtype(type.getDeclaration(), collectionDecl) ||
+             TypeModeler.isSubtype(type.getDeclaration(), mapDecl)) {
+@@ -72,22 +72,22 @@
+             TypeMirror[] safeArgs = new TypeMirror[args.size()];
+             int i = 0;
+             for (TypeMirror arg : args) {
+-                safeArgs[i++]= apply(arg, apTypes);                    
++                safeArgs[i++]= apply(arg, apTypes);
+             }
+             return apTypes.getDeclaredType(type.getDeclaration(), safeArgs);
+         }
+         return apTypes.getErasure(type);
+     }
+-    
++
+     protected TypeMirror onTypeVariable(TypeVariable type, Types apTypes) {
+-        return apTypes.getErasure(type);        
++        return apTypes.getErasure(type);
+     }
+-    
++
+     protected TypeMirror onVoidType(VoidType type, Types apTypes) {
+-        return type;        
++        return type;
+     }
+ 
+     protected TypeMirror onWildcard(WildcardType type, Types apTypes) {
+-        return apTypes.getErasure(type);   
++        return apTypes.getErasure(type);
+     }
+ }
+--- old/src/share/classes/com/sun/tools/internal/ws/processor/modeler/annotation/WebServiceAP.java	Thu Jul 30 17:16:33 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/annotation/WebServiceAP.java	Thu Jul 30 17:16:32 2009
+@@ -58,8 +58,8 @@
+ 
+ 
+ /**
+- * WebServiceAP is a APT AnnotationProcessor for processing javax.jws.* and 
+- * javax.xml.ws.* annotations. This class is used either by the WsGen (CompileTool) tool or 
++ * WebServiceAP is a APT AnnotationProcessor for processing javax.jws.* and
++ * javax.xml.ws.* annotations. This class is used either by the WsGen (CompileTool) tool or
+  *    idirectly via the {@link com.sun.istack.internal.ws.AnnotationProcessorFactoryImpl} when invoked by APT.
+  *
+  * @author WS Development Team
+@@ -210,6 +210,7 @@
+     public void onError(String message) {
+         if (messager != null) {
+             messager.printError(message);
++            throw new AbortException();
+         } else {
+             throw new ModelerException(message);
+         }
+@@ -417,6 +418,3 @@
+         return javaName;
+     }
+ }
+-
+-
+-
+--- old/src/share/classes/com/sun/tools/internal/ws/processor/modeler/annotation/WebServiceConstants.java	Thu Jul 30 17:16:41 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/annotation/WebServiceConstants.java	Thu Jul 30 17:16:40 2009
+@@ -47,16 +47,16 @@
+     public static final String HTTP_PREFIX                  = "http://";
+     public static final String JAVA_LANG_OBJECT             = "java.lang.Object";
+     public static final String EMTPY_NAMESPACE_ID           = "";
+-    
+ 
++
+     public static final char SIGC_INNERCLASS  = '$';
+     public static final char SIGC_UNDERSCORE  = '_';
+-    
+-    public static final String DOT = ".";    
++
++    public static final String DOT = ".";
+     public static final String PORT = "WSDLPort";
+     public static final String BINDING = "Binding";
+     public static final String RESPONSE = "Response";
+-    
++
+     /*
+      * Identifiers potentially useful for all Generators
+      */
+@@ -73,11 +73,11 @@
+     public static final String HOLDER_CLASSNAME =
+         javax.xml.ws.Holder.class.getName();
+     public static final String COLLECTION_CLASSNAME =
+-        java.util.Collection.class.getName();    
++        java.util.Collection.class.getName();
+     public static final String MAP_CLASSNAME =
+-        java.util.Map.class.getName();    
+-    
++        java.util.Map.class.getName();
+ 
++
+     // 181 constants
+     public static final String WEBSERVICE_NAMESPACE         = "http://www.bea.com/xml/ns/jws";
+     public static final String HANDLER_CONFIG               = "handler-config";
+--- old/src/share/classes/com/sun/tools/internal/ws/processor/modeler/annotation/WebServiceVisitor.java	Thu Jul 30 17:16:44 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/annotation/WebServiceVisitor.java	Thu Jul 30 17:16:44 2009
+@@ -441,10 +441,21 @@
+ 
+     protected boolean shouldProcessMethod(MethodDeclaration method, WebMethod webMethod) {
+         builder.log("should process method: "+method.getSimpleName()+" hasWebMethods: "+ hasWebMethods+" ");
++        /*
++        Fix for https://jax-ws.dev.java.net/issues/show_bug.cgi?id=577
+         if (hasWebMethods && webMethod == null) {
+             builder.log("webMethod == null");
+             return false;
+         }
++        */
++        Collection<Modifier> modifiers = method.getModifiers();
++        boolean staticFinal = modifiers.contains(Modifier.STATIC) || modifiers.contains(Modifier.FINAL);
++        if (staticFinal) {
++            if (webMethod != null) {
++                builder.onError(method.getPosition(), WebserviceapMessages.localizableWEBSERVICEAP_WEBSERVICE_METHOD_IS_STATIC_OR_FINAL(method.getDeclaringType(), method));
++            }
++            return false;
++        }
+         boolean retval = (endpointReferencesInterface ||
+                 method.getDeclaringType().equals(typeDecl) ||
+                 (method.getDeclaringType().getAnnotation(WebService.class) != null));
+@@ -474,10 +485,6 @@
+             builder.onError(classDecl.getPosition(), WebserviceapMessages.localizableWEBSERVICEAP_WEBSERVICE_CLASS_IS_ABSTRACT(classDecl.getQualifiedName()));
+             return false;
+         }
+-        if (classDecl.getDeclaringType() != null && !modifiers.contains(Modifier.STATIC) && !isStateful) {
+-            builder.onError(classDecl.getPosition(), WebserviceapMessages.localizableWEBSERVICEAP_WEBSERVICE_CLASS_IS_INNERCLASS_NOT_STATIC(classDecl.getQualifiedName()));
+-            return false;
+-        }
+         boolean hasDefaultConstructor = false;
+         for (ConstructorDeclaration constructor : classDecl.getConstructors()) {
+             if (constructor.getModifiers().contains(Modifier.PUBLIC) &&
+@@ -487,6 +494,11 @@
+             }
+         }
+         if (!hasDefaultConstructor && !isStateful) {
++            if (classDecl.getDeclaringType() != null && !modifiers.contains(Modifier.STATIC)) {
++                builder.onError(classDecl.getPosition(), WebserviceapMessages.localizableWEBSERVICEAP_WEBSERVICE_CLASS_IS_INNERCLASS_NOT_STATIC(classDecl.getQualifiedName()));
++                return false;
++            }
++
+             builder.onError(classDecl.getPosition(), WebserviceapMessages.localizableWEBSERVICEAP_WEBSERVICE_NO_DEFAULT_CONSTRUCTOR(classDecl.getQualifiedName()));
+             return false;
+         }
+@@ -577,8 +589,8 @@
+                 return false;
+         }
+         ClassType superClass = classDecl.getSuperclass();
+-        
+-        if (!superClass.getDeclaration().getQualifiedName().equals(JAVA_LANG_OBJECT) && superClass != null && !methodsAreLegal(superClass.getDeclaration())) {
++
++        if (!superClass.getDeclaration().getQualifiedName().equals(JAVA_LANG_OBJECT) && !methodsAreLegal(superClass.getDeclaration())) {
+             return false;
+         }
+         return true;
+@@ -590,17 +602,19 @@
+         //SEI cannot have methods with @WebMethod(exclude=true)
+         if (typeDecl instanceof InterfaceDeclaration && webMethod != null && webMethod.exclude())
+             builder.onError(method.getPosition(), WebserviceapMessages.localizableWEBSERVICEAP_INVALID_SEI_ANNOTATION_ELEMENT_EXCLUDE("exclude=true", typeDecl.getQualifiedName(), method.toString()));
+-        
++
+         if (hasWebMethods && (webMethod == null))
+             return true;
+         if (!hasWebMethods && (webMethod !=null) && webMethod.exclude()) {
+             return true;
+         }
++        /*
++        This check is not needed as Impl class is already checked that it is not abstract.
+         if (typeDecl instanceof ClassDeclaration && method.getModifiers().contains(Modifier.ABSTRACT)) {
+             builder.onError(method.getPosition(), WebserviceapMessages.localizableWEBSERVICEAP_WEBSERVICE_METHOD_IS_ABSTRACT(typeDecl.getQualifiedName(), method.getSimpleName()));
+             return false;
+         }
+-
++        */
+         if (!isLegalType(method.getReturnType())) {
+             builder.onError(method.getPosition(), WebserviceapMessages.localizableWEBSERVICEAP_METHOD_RETURN_TYPE_CANNOT_IMPLEMENT_REMOTE(typeDecl.getQualifiedName(),
+                 method.getSimpleName(),
+@@ -708,11 +722,11 @@
+             if (!builder.isRemoteException(exDecl)) {
+                 builder.onError(method.getPosition(), WebserviceapMessages.localizableWEBSERVICEAP_ONEWAY_OPERATION_CANNOT_DECLARE_EXCEPTIONS(typeDecl.getQualifiedName(), method.toString(), exDecl.getQualifiedName()));
+                 valid = false;
+-            }                
++            }
+         }
+         return valid;
+     }
+-    
++
+     protected int getModeParameterCount(MethodDeclaration method, WebParam.Mode mode) {
+         WebParam webParam;
+         int cnt = 0;
+@@ -731,7 +745,7 @@
+         }
+         return cnt;
+     }
+-    
++
+     protected boolean isEquivalentModes(WebParam.Mode mode1, WebParam.Mode mode2) {
+         if (mode1.equals(mode2))
+             return true;
+@@ -742,15 +756,20 @@
+             return true;
+         return false;
+     }
+-    
++
+     protected boolean isHolder(ParameterDeclaration param) {
+         return builder.getHolderValueType(param.getType()) != null;
+     }
+-    
++
+     protected boolean isLegalType(TypeMirror type) {
+         if (!(type instanceof DeclaredType))
+             return true;
+-        return !builder.isRemote(((DeclaredType)type).getDeclaration());
++        TypeDeclaration typeDecl = ((DeclaredType)type).getDeclaration();
++        if(typeDecl == 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.onError(WebserviceapMessages.WEBSERVICEAP_COULD_NOT_FIND_TYPEDECL(typeDecl.toString(), context.getRound()));
++        }
++        return !builder.isRemote(typeDecl);
+     }
+ 
+     protected ParameterDeclaration getOutParameter(MethodDeclaration method) {
+@@ -763,7 +782,7 @@
+         }
+         return null;
+     }
+-    
++
+     protected static class MySOAPBinding implements SOAPBinding {
+         public Style style() {return SOAPBinding.Style.DOCUMENT;}
+         public Use use() {return SOAPBinding.Use.LITERAL; }
+@@ -773,4 +792,3 @@
+         }
+     }
+ }
+-
+--- old/src/share/classes/com/sun/tools/internal/ws/processor/modeler/annotation/WebServiceWrapperGenerator.java	Thu Jul 30 17:16:48 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/annotation/WebServiceWrapperGenerator.java	Thu Jul 30 17:16:48 2009
+@@ -127,8 +127,10 @@
+         boolean beanGenerated = false;
+         for (ReferenceType thrownType : method.getThrownTypes()) {
+             ClassDeclaration typeDecl = ((ClassType)thrownType).getDeclaration();
+-            if (typeDecl == null)
++            if (typeDecl == null){
+                 builder.onError(WebserviceapMessages.WEBSERVICEAP_COULD_NOT_FIND_TYPEDECL(thrownType.toString(), context.getRound()));
++                return false;
++            }
+             boolean tmp = generateExceptionBean(typeDecl, beanPackage);
+             beanGenerated = beanGenerated || tmp;
+         }
+@@ -195,7 +197,7 @@
+                 if (resWrapper.targetNamespace().length() > 0)
+                     resNamespace = resWrapper.targetNamespace();
+             }
+-            canOverwriteResponse = builder.canOverWriteClass(requestClassName);
++            canOverwriteResponse = builder.canOverWriteClass(responseClassName);
+             if (!canOverwriteResponse) {
+                 builder.log("Class " + responseClassName + " exists. Not overwriting.");
+             }
+@@ -267,7 +269,7 @@
+             if (webResult.name().length() > 0) {
+                 responseElementName = webResult.name();
+                 responseName = JAXBRIContext.mangleNameToVariableName(webResult.name());
+-                
++
+                 //We wont have to do this if JAXBRIContext.mangleNameToVariableName() takes
+                 //care of mangling java identifiers
+                 responseName = Names.getJavaReserverVarialbeName(responseName);
+@@ -278,7 +280,7 @@
+             isResultHeader = webResult.header();
+         }
+ 
+-        // class members 
++        // class members
+         WebParam webParam;
+         TypeMirror paramType;
+         String paramName;
+@@ -418,7 +420,7 @@
+                 } else {
+                     field.annotate(XmlValue.class);
+                 }
+-                annotateParameterWithJAXBAnnotations(field, memInfo.getJaxbAnnotations());                
++                annotateParameterWithJAXBAnnotations(field, memInfo.getJaxbAnnotations());
+             }
+ 
+             // copy adapter if needed
+@@ -593,7 +595,7 @@
+             return;
+ 
+         String accessorName =JAXBRIContext.mangleNameToPropertyName(paramName);
+-        String getterPrefix = paramType.equals("boolean") || paramType.equals("java.lang.Boolean") ? "is" : "get";
++        String getterPrefix = paramType.toString().equals("boolean")? "is" : "get";
+         JType propType = getType(paramType);
+         JMethod m = cls.method(JMod.PUBLIC, propType, getterPrefix+ accessorName);
+         JDocComment methodDoc = m.javadoc();
+@@ -610,5 +612,4 @@
+         body = m.body();
+         body.assign( JExpr._this().ref(paramName), param );
+     }
+-}      
+-    
++}
+--- old/src/share/classes/com/sun/tools/internal/ws/processor/modeler/wsdl/ConsoleErrorReporter.java	Thu Jul 30 17:16:52 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/wsdl/ConsoleErrorReporter.java	Thu Jul 30 17:16:51 2009
+@@ -57,6 +57,8 @@
+         print(WscompileMessages.WSIMPORT_ERROR_MESSAGE(e.getMessage()), e);
+     }
+ 
++
++
+     public void fatalError(SAXParseException e) {
+         if(debug)
+             e.printStackTrace();
+@@ -76,6 +78,11 @@
+         print(WscompileMessages.WSIMPORT_INFO_MESSAGE(e.getMessage()), e);
+     }
+ 
++    public void debug(SAXParseException e){
++        print(WscompileMessages.WSIMPORT_DEBUG_MESSAGE(e.getMessage()), e);
++    }
++
++
+     private void print(String message, SAXParseException e) {
+         output.println(message);
+         output.println(getLocationString(e));
+--- old/src/share/classes/com/sun/tools/internal/ws/processor/modeler/wsdl/ModelerUtils.java	Thu Jul 30 17:16:56 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/wsdl/ModelerUtils.java	Thu Jul 30 17:16:55 2009
+@@ -171,7 +171,7 @@
+         parameter.setProperty(ModelProperties.PROPERTY_PARAM_MESSAGE_PART_NAME,
+                 partName);
+         parameter.setEmbedded(false);
+-        parameter.setType(jaxbType);        
++        parameter.setType(jaxbType);
+         parameter.setTypeName(jaxbType.getJavaType().getType().getName());
+         parameter.setBlock(block);
+         return parameter;
+--- old/src/share/classes/com/sun/tools/internal/ws/processor/modeler/wsdl/PseudoSchemaBuilder.java	Thu Jul 30 17:16:59 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/wsdl/PseudoSchemaBuilder.java	Thu Jul 30 17:16:58 2009
+@@ -28,6 +28,7 @@
+ import static com.sun.tools.internal.ws.processor.modeler.wsdl.WSDLModelerBase.getExtensionOfType;
+ import com.sun.tools.internal.ws.wscompile.ErrorReceiver;
+ import com.sun.tools.internal.ws.wscompile.WsimportOptions;
++import com.sun.tools.internal.ws.wscompile.Options;
+ import com.sun.tools.internal.ws.wsdl.document.*;
+ import com.sun.tools.internal.ws.wsdl.document.jaxws.JAXWSBinding;
+ import com.sun.tools.internal.ws.wsdl.document.schema.SchemaKinds;
+@@ -46,7 +47,7 @@
+ /**
+  * Builds all possible pseudo schemas for async operation ResponseBean to feed to XJC.
+  *
+- * @author Vivek Pandey 
++ * @author Vivek Pandey
+  */
+ public class PseudoSchemaBuilder {
+ 
+@@ -101,7 +102,7 @@
+             is.setSystemId(sysId+(i + 1));
+         }
+         //add w3c EPR binding
+-        if(!(options.noAddressingBbinding && options.isExtensionMode())){
++        if(!(options.noAddressingBbinding) && options.target.isLaterThan(Options.Target.V2_1)){
+             InputSource is = new InputSource(new ByteArrayInputStream(w3ceprSchemaBinding.getBytes()));
+             is.setSystemId(sysId+(++i +1));
+             b.schemas.add(is);
+--- old/src/share/classes/com/sun/tools/internal/ws/processor/modeler/wsdl/WSDLModeler.java	Thu Jul 30 17:17:03 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/wsdl/WSDLModeler.java	Thu Jul 30 17:17:02 2009
+@@ -74,7 +74,7 @@
+ public class WSDLModeler extends WSDLModelerBase {
+ 
+     //map of wsdl:operation QName to <soapenv:Body> child, as per BP it must be unique in a port
+-    private final Map<QName, QName> uniqueBodyBlocks = new HashMap<QName, QName>();
++    private final Map<QName, Operation> uniqueBodyBlocks = new HashMap<QName, Operation>();
+     private final QName VOID_BODYBLOCK = new QName("");
+     private ClassNameCollector classNameCollector;
+     private final String explicitDefaultPackage;
+@@ -121,7 +121,7 @@
+ 
+             Model model = internalBuildModel(document);
+             if(model == null || errReceiver.hadError())
+-                return null;                    
++                return null;
+             //ClassNameCollector classNameCollector = new ClassNameCollector();
+             classNameCollector.process(model);
+             if (classNameCollector.getConflictingClassNames().isEmpty()) {
+@@ -131,7 +131,7 @@
+             }
+             // do another pass, this time with conflict resolution enabled
+             model = internalBuildModel(document);
+-            
++
+             classNameCollector.process(model);
+             if (classNameCollector.getConflictingClassNames().isEmpty()) {
+                 // we're done
+@@ -334,11 +334,12 @@
+                         || (!soapBinding.getTransport().equals(
+                         SOAPConstants.URI_SOAP_TRANSPORT_HTTP) && !soapBinding.getTransport().equals(
+                         SOAP12Constants.URI_SOAP_TRANSPORT_HTTP)))) {
+-                    warning(wsdlPort, ModelerMessages.WSDLMODELER_WARNING_IGNORING_SOAP_BINDING_NON_HTTP_TRANSPORT(wsdlPort.getName()));
+                     if (!options.isExtensionMode()) {
+                         // cannot deal with non-HTTP ports
++                        warning(wsdlPort, ModelerMessages.WSDLMODELER_WARNING_IGNORING_SOAP_BINDING_NON_HTTP_TRANSPORT(wsdlPort.getName()));
+                         return false;
+                     }
++
+                 }
+ 
+                 /**
+@@ -493,7 +494,7 @@
+     }
+ 
+     /**
+-     * Returns an operation purely from abstract operation 
++     * Returns an operation purely from abstract operation
+      */
+     private Operation processNonSOAPOperation() {
+         Operation operation =
+@@ -533,7 +534,7 @@
+         }
+ 
+         //set the style based on heuristic that message has either all parts defined
+-        // using type(RPC) or element(DOCUMENT)       
++        // using type(RPC) or element(DOCUMENT)
+         setNonSoapStyle(inputMessage, outputMessage);
+ 
+         // Process parameterOrder and get the parameterList
+@@ -596,7 +597,7 @@
+      *
+      * We assume that the message parts could have either all of them with type attribute (RPC)
+      * or element (DOCUMENT)
+-     * 
++     *
+      * Shall this check if parts are mixed and throw error message?
+      */
+     private void setNonSoapStyle(Message inputMessage, Message outputMessage) {
+@@ -679,7 +680,12 @@
+ 
+         if (soapStyle == SOAPStyle.RPC) {
+             if (soapRequestBody.isEncoded()) {
+-                error(soapRequestBody, ModelerMessages.WSDLMODELER_20_RPCENC_NOT_SUPPORTED());
++                if(options.isExtensionMode()){
++                    warning(soapRequestBody, ModelerMessages.WSDLMODELER_20_RPCENC_NOT_SUPPORTED());
++                    processNonSOAPOperation();
++                }else{
++                    error(soapRequestBody, ModelerMessages.WSDLMODELER_20_RPCENC_NOT_SUPPORTED());
++                }
+             }
+             return processLiteralSOAPOperation(StyleAndUse.RPC_LITERAL);
+         }
+@@ -815,20 +821,71 @@
+         QName body = VOID_BODYBLOCK;
+         QName opName = null;
+ 
++        Operation thatOp;
+         if (bb.hasNext()) {
+             body = bb.next().getName();
+-            opName = uniqueBodyBlocks.get(body);
++            thatOp = uniqueBodyBlocks.get(body);
+         } else {
+             //there is no body block
+             body = VOID_BODYBLOCK;
+-            opName = uniqueBodyBlocks.get(VOID_BODYBLOCK);
++            thatOp = uniqueBodyBlocks.get(VOID_BODYBLOCK);
+         }
+-        if (opName != null) {
+-            error(info.port, ModelerMessages.WSDLMODELER_NON_UNIQUE_BODY(info.port.getName(), info.operation.getName(), opName, body));
+-        } else {
+-            uniqueBodyBlocks.put(body, info.operation.getName());
++
++        if(thatOp != null){
++            if(options.isExtensionMode()){
++                warning(info.port, ModelerMessages.WSDLMODELER_NON_UNIQUE_BODY_WARNING(info.port.getName(), info.operation.getName(), thatOp.getName(), body));
++            }else{
++                error(info.port, ModelerMessages.WSDLMODELER_NON_UNIQUE_BODY_ERROR(info.port.getName(), info.operation.getName(), thatOp.getName(), body));
++            }
++        }else{
++            uniqueBodyBlocks.put(body, info.operation);
+         }
+ 
++        //Add additional headers
++        if (options.additionalHeaders) {
++            List<Parameter> additionalHeaders = new ArrayList<Parameter>();
++            if (inputMessage != null) {
++                for (MessagePart part : getAdditionHeaderParts(inputMessage, true)) {
++                    QName name = part.getDescriptor();
++                    JAXBType jaxbType = getJAXBType(part);
++                    Block block = new Block(name, jaxbType, part);
++                    Parameter param = ModelerUtils.createParameter(part.getName(), jaxbType, block);
++                    additionalHeaders.add(param);
++                    request.addHeaderBlock(block);
++                    request.addParameter(param);
++                    definitiveParameterList.add(param);
++                }
++            }
++
++            if (isRequestResponse && outputMessage != null) {
++                List<Parameter> outParams = new ArrayList<Parameter>();
++                for (MessagePart part : getAdditionHeaderParts(outputMessage, false)) {
++                    QName name = part.getDescriptor();
++                    JAXBType jaxbType = getJAXBType(part);
++                    Block block = new Block(name, jaxbType, part);
++                    Parameter param = ModelerUtils.createParameter(part.getName(), jaxbType, block);
++                    param.setMode(Mode.OUT);
++                    outParams.add(param);
++                    response.addHeaderBlock(block);
++                    response.addParameter(param);
++                }
++                for (Parameter outParam : outParams) {
++                    for (Parameter inParam : additionalHeaders) {
++                        if (inParam.getName().equals(outParam.getName()) &&
++                                inParam.getBlock().getName().equals(outParam.getBlock().getName())) {
++                            //it is INOUT
++                            inParam.setMode(Mode.INOUT);
++                            outParam.setMode(Mode.INOUT);
++                            break;
++                        }
++                    }
++                    if (outParam.isOUT()) {
++                        definitiveParameterList.add(outParam);
++                    }
++                }
++            }
++        }
++
+         // faults with duplicate names
+         Set duplicateNames = getDuplicateFaultNames();
+ 
+@@ -848,6 +905,7 @@
+         return info.operation;
+     }
+ 
++
+     private boolean validateParameterName(List<Parameter> params) {
+         if (options.isExtensionMode())
+             return true;
+@@ -1108,7 +1166,7 @@
+                 JAXBType responseBeanType = jaxbModelBuilder.getJAXBType(responseBeanName);
+                 if(responseBeanType == null){
+                     error(info.operation.getEntity(), ModelerMessages.WSDLMODELER_RESPONSEBEAN_NOTFOUND(info.operation.getName()));
+-                }                
++                }
+                 operation.setResponseBean(responseBeanType);
+             }
+         }
+@@ -1460,6 +1518,19 @@
+         return null;
+     }
+ 
++    private List<MessagePart> getAdditionHeaderParts(Message message, boolean isInput){
++        List<MessagePart> headerParts = new ArrayList<MessagePart>();
++        List<MessagePart> parts = message.getParts();
++        List<MessagePart> headers = getHeaderParts(isInput);
++
++        for(MessagePart part: headers){
++            if(parts.contains(part))
++                continue;
++            headerParts.add(part);
++        }
++        return headerParts;
++    }
++
+     private List<MessagePart> getHeaderPartsFromMessage(Message message, boolean isInput) {
+         List<MessagePart> headerParts = new ArrayList<MessagePart>();
+         Iterator<MessagePart> parts = message.parts();
+@@ -1490,19 +1561,6 @@
+         return null;
+     }
+ 
+-    private List<MessagePart> getHeaderPartsNotFromMessage(Message message, boolean isInput) {
+-        List<MessagePart> headerParts = new ArrayList<MessagePart>();
+-        List<MessagePart> parts = message.getParts();
+-        Iterator<MessagePart> headers = getHeaderParts(isInput).iterator();
+-        while (headers.hasNext()) {
+-            MessagePart part = headers.next();
+-            if (!parts.contains(part)) {
+-                headerParts.add(part);
+-            }
+-        }
+-        return headerParts;
+-    }
+-
+     private List<MessagePart> getHeaderParts(boolean isInput) {
+         TWSDLExtensible ext;
+         if (isInput) {
+@@ -1997,7 +2055,7 @@
+                 return isWrappable;
+         }
+ 
+-        //then into wsdl:portType        
++        //then into wsdl:portType
+         PortType portType = info.port.resolveBinding(document).resolvePortType(document);
+         jaxwsBinding = (JAXWSBinding) getExtensionOfType(portType, JAXWSBinding.class);
+         if (jaxwsBinding != null) {
+@@ -2247,6 +2305,10 @@
+                 (QName) port.getProperty(
+                         ModelProperties.PROPERTY_WSDL_PORT_TYPE_NAME);
+         PortType pt = (PortType) document.find(Kinds.PORT_TYPE, portTypeName);
++        //populate the portType map here. We should get rid of all these properties
++        // lets not do it as it may break NB
++        //TODO: clean all these stuff part of NB RFE
++        port.portTypes.put(portTypeName, pt);
+         JAXWSBinding jaxwsCust = (JAXWSBinding) getExtensionOfType(pt, JAXWSBinding.class);
+         if (jaxwsCust != null && jaxwsCust.getClassName() != null) {
+             CustomName name = jaxwsCust.getClassName();
+@@ -2271,7 +2333,7 @@
+     private void createJavaMethodForAsyncOperation(Port port, Operation operation,
+                                                    JavaInterface intf) {
+         String candidateName = getJavaNameForOperation(operation);
+-        JavaMethod method = new JavaMethod(candidateName, errReceiver);
++        JavaMethod method = new JavaMethod(candidateName, options, errReceiver);
+         Request request = operation.getRequest();
+         Iterator requestBodyBlocks = request.getBodyBlocks();
+         Block requestBlock =
+@@ -2338,7 +2400,7 @@
+             return;
+         }
+         String candidateName = getJavaNameForOperation(operation);
+-        JavaMethod method = new JavaMethod(candidateName, errReceiver);
++        JavaMethod method = new JavaMethod(candidateName, options, errReceiver);
+         Request request = operation.getRequest();
+         Parameter returnParam = (Parameter) operation.getProperty(WSDL_RESULT_PARAMETER);
+         if (returnParam != null) {
+@@ -2718,7 +2780,7 @@
+ 
+     private void reportError(Entity entity,
+         String formattedMsg, Exception nestedException ) {
+-        Locator locator = (entity == null)?NULL_LOCATOR:entity.getLocator();
++        Locator locator = (entity == null)?null:entity.getLocator();
+ 
+         SAXParseException e = new SAXParseException2( formattedMsg,
+             locator,
+--- old/src/share/classes/com/sun/tools/internal/ws/processor/modeler/wsdl/WSDLModelerBase.java	Thu Jul 30 17:17:07 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/modeler/wsdl/WSDLModelerBase.java	Thu Jul 30 17:17:07 2009
+@@ -288,23 +288,11 @@
+     private boolean validateMimeContentPartNames(List<MIMEContent> mimeContents) {
+         //validate mime:content(s) in the mime:part as per R2909
+         for (MIMEContent mimeContent : mimeContents) {
+-            String mimeContnetPart = null;
++            String mimeContnetPart;
++            mimeContnetPart = getMimeContentPartName(mimeContent);
+             if(mimeContnetPart == null) {
+-                mimeContnetPart = getMimeContentPartName(mimeContent);
+-                if(mimeContnetPart == null) {
+-                    warning(mimeContent, ModelerMessages.MIMEMODELER_INVALID_MIME_CONTENT_MISSING_PART_ATTRIBUTE(info.operation.getName().getLocalPart()));
+-                    return false;
+-                }
+-            }else {
+-                String newMimeContnetPart = getMimeContentPartName(mimeContent);
+-                if(newMimeContnetPart == null) {
+-                    warning(mimeContent, ModelerMessages.MIMEMODELER_INVALID_MIME_CONTENT_MISSING_PART_ATTRIBUTE(info.operation.getName().getLocalPart()));
+-                    return false;
+-                }else if(!newMimeContnetPart.equals(mimeContnetPart)) {
+-                    //throw new ModelerException("mimemodeler.invalidMimeContent.differentPart");
+-                    warning(mimeContent, ModelerMessages.MIMEMODELER_INVALID_MIME_CONTENT_DIFFERENT_PART());
+-                    return false;
+-                }
++                warning(mimeContent, ModelerMessages.MIMEMODELER_INVALID_MIME_CONTENT_MISSING_PART_ATTRIBUTE(info.operation.getName().getLocalPart()));
++                return false;
+             }
+         }
+         return true;
+@@ -386,6 +374,9 @@
+     protected String getRequestNamespaceURI(SOAPBody body) {
+         String namespaceURI = body.getNamespace();
+         if (namespaceURI == null) {
++            if(options.isExtensionMode()){
++                return info.modelPort.getName().getNamespaceURI();
++            }
+             // the WSDL document is invalid
+             // at least, that's my interpretation of section 3.5 of the WSDL 1.1 spec!
+             error(body, ModelerMessages.WSDLMODELER_INVALID_BINDING_OPERATION_INPUT_SOAP_BODY_MISSING_NAMESPACE(info.bindingOperation.getName()));
+@@ -396,6 +387,9 @@
+     protected String getResponseNamespaceURI(SOAPBody body) {
+         String namespaceURI = body.getNamespace();
+         if (namespaceURI == null) {
++            if(options.isExtensionMode()){
++                return info.modelPort.getName().getNamespaceURI();
++            }
+             // the WSDL document is invalid
+             // at least, that's my interpretation of section 3.5 of the WSDL 1.1 spec!
+             error(body, ModelerMessages.WSDLMODELER_INVALID_BINDING_OPERATION_OUTPUT_SOAP_BODY_MISSING_NAMESPACE(info.bindingOperation.getName()));
+@@ -703,7 +697,7 @@
+         if(numPasses > 1)
+             return;
+         if(entity == null)
+-            errReceiver.warning(NULL_LOCATOR, message);
++            errReceiver.warning(null, message);
+         else
+             errReceiver.warning(entity.getLocator(), message);
+     }
+@@ -710,7 +704,7 @@
+ 
+     protected void error(Entity entity, String message){
+         if(entity == null)
+-            errReceiver.error(NULL_LOCATOR, message);
++            errReceiver.error(null, message);
+         else
+             errReceiver.error(entity.getLocator(), message);
+         throw new AbortException();
+--- old/src/share/classes/com/sun/tools/internal/ws/processor/util/ClassNameCollector.java	Thu Jul 30 17:17:11 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/util/ClassNameCollector.java	Thu Jul 30 17:17:10 2009
+@@ -80,8 +80,10 @@
+     protected void preVisit(Service service) throws Exception {
+         registerClassName(
+             ((JavaInterface)service.getJavaInterface()).getName());
+-        registerClassName(
+-            ((JavaInterface)service.getJavaInterface()).getImpl());
++        // We don't generate Impl classes, commenting it out.
++        // Otherwise, it would cause naming conflicts
++        //registerClassName(
++        //    ((JavaInterface)service.getJavaInterface()).getImpl());
+     }
+ 
+     protected void processPort11x(Port port){
+--- old/src/share/classes/com/sun/tools/internal/ws/processor/util/DirectoryUtil.java	Thu Jul 30 17:17:14 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/processor/util/DirectoryUtil.java	Thu Jul 30 17:17:14 2009
+@@ -100,4 +100,3 @@
+         }
+     }
+ }
+-
+--- old/src/share/classes/com/sun/tools/internal/ws/resources/ConfigurationMessages.java	Thu Jul 30 17:17:18 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/ConfigurationMessages.java	Thu Jul 30 17:17:17 2009
+@@ -31,7 +31,7 @@
+ 
+ /**
+  * Defines string formatting method for each constant in the resource file
+- * 
++ *
+  */
+ public final class ConfigurationMessages {
+ 
+@@ -44,7 +44,7 @@
+ 
+     /**
+      * invalid element "{2}" in file "{0}" (line {1})
+-     * 
++     *
+      */
+     public static String CONFIGURATION_INVALID_ELEMENT(Object arg0, Object arg1, Object arg2) {
+         return localizer.localize(localizableCONFIGURATION_INVALID_ELEMENT(arg0, arg1, arg2));
+@@ -56,7 +56,7 @@
+ 
+     /**
+      * Ignoring: binding file ""{0}". It is not a jaxws or a jaxb binding file.
+-     * 
++     *
+      */
+     public static String CONFIGURATION_NOT_BINDING_FILE(Object arg0) {
+         return localizer.localize(localizableCONFIGURATION_NOT_BINDING_FILE(arg0));
+--- old/src/share/classes/com/sun/tools/internal/ws/resources/GeneratorMessages.java	Thu Jul 30 17:17:21 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/GeneratorMessages.java	Thu Jul 30 17:17:21 2009
+@@ -31,7 +31,7 @@
+ 
+ /**
+  * Defines string formatting method for each constant in the resource file
+- * 
++ *
+  */
+ public final class GeneratorMessages {
+ 
+@@ -38,6 +38,30 @@
+     private final static LocalizableMessageFactory messageFactory = new LocalizableMessageFactory("com.sun.tools.internal.ws.resources.generator");
+     private final static Localizer localizer = new Localizer();
+ 
++    public static Localizable localizableGENERATOR_SERVICE_CLASS_ALREADY_EXIST(Object arg0, Object arg1) {
++        return messageFactory.getMessage("generator.service.classAlreadyExist", arg0, arg1);
++    }
++
++    /**
++     * Could not generate Service, class: {0} already exists. Rename wsdl:Service "{1}" using JAX-WS customization
++     *
++     */
++    public static String GENERATOR_SERVICE_CLASS_ALREADY_EXIST(Object arg0, Object arg1) {
++        return localizer.localize(localizableGENERATOR_SERVICE_CLASS_ALREADY_EXIST(arg0, arg1));
++    }
++
++    public static Localizable localizableGENERATOR_SEI_CLASS_ALREADY_EXIST(Object arg0, Object arg1) {
++        return messageFactory.getMessage("generator.sei.classAlreadyExist", arg0, arg1);
++    }
++
++    /**
++     * Could not generate SEI, class: {0} already exists. Rename wsdl:portType "{1}" using JAX-WS customization
++     *
++     */
++    public static String GENERATOR_SEI_CLASS_ALREADY_EXIST(Object arg0, Object arg1) {
++        return localizer.localize(localizableGENERATOR_SEI_CLASS_ALREADY_EXIST(arg0, arg1));
++    }
++
+     public static Localizable localizableGENERATOR_NESTED_GENERATOR_ERROR(Object arg0) {
+         return messageFactory.getMessage("generator.nestedGeneratorError", arg0);
+     }
+@@ -44,7 +68,7 @@
+ 
+     /**
+      * generator error: {0}
+-     * 
++     *
+      */
+     public static String GENERATOR_NESTED_GENERATOR_ERROR(Object arg0) {
+         return localizer.localize(localizableGENERATOR_NESTED_GENERATOR_ERROR(arg0));
+@@ -56,7 +80,7 @@
+ 
+     /**
+      * internal error (should not happen): {0}
+-     * 
++     *
+      */
+     public static String GENERATOR_INTERNAL_ERROR_SHOULD_NOT_HAPPEN(Object arg0) {
+         return localizer.localize(localizableGENERATOR_INTERNAL_ERROR_SHOULD_NOT_HAPPEN(arg0));
+@@ -68,7 +92,7 @@
+ 
+     /**
+      * WSDL has some characters which native java encoder can''t encode: "{0}"
+-     * 
++     *
+      */
+     public static String GENERATOR_INDENTINGWRITER_CHARSET_CANTENCODE(Object arg0) {
+         return localizer.localize(localizableGENERATOR_INDENTINGWRITER_CHARSET_CANTENCODE(arg0));
+@@ -80,7 +104,7 @@
+ 
+     /**
+      * can''t create directory: {0}
+-     * 
++     *
+      */
+     public static String GENERATOR_CANNOT_CREATE_DIR(Object arg0) {
+         return localizer.localize(localizableGENERATOR_CANNOT_CREATE_DIR(arg0));
+@@ -92,7 +116,7 @@
+ 
+     /**
+      * can''t write file: {0}
+-     * 
++     *
+      */
+     public static String GENERATOR_CANT_WRITE(Object arg0) {
+         return localizer.localize(localizableGENERATOR_CANT_WRITE(arg0));
+--- old/src/share/classes/com/sun/tools/internal/ws/resources/JavacompilerMessages.java	Thu Jul 30 17:17:25 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/JavacompilerMessages.java	Thu Jul 30 17:17:24 2009
+@@ -31,7 +31,7 @@
+ 
+ /**
+  * Defines string formatting method for each constant in the resource file
+- * 
++ *
+  */
+ public final class JavacompilerMessages {
+ 
+@@ -44,7 +44,7 @@
+ 
+     /**
+      * {0} is not available in the classpath, requires Sun's JDK version 5.0 or latter.
+-     * 
++     *
+      */
+     public static String JAVACOMPILER_CLASSPATH_ERROR(Object arg0) {
+         return localizer.localize(localizableJAVACOMPILER_CLASSPATH_ERROR(arg0));
+@@ -56,7 +56,7 @@
+ 
+     /**
+      * There is no such method {0} available, requires Sun's JDK version 5.0 or latter.
+-     * 
++     *
+      */
+     public static String JAVACOMPILER_NOSUCHMETHOD_ERROR(Object arg0) {
+         return localizer.localize(localizableJAVACOMPILER_NOSUCHMETHOD_ERROR(arg0));
+@@ -68,7 +68,7 @@
+ 
+     /**
+      * error : {0}.
+-     * 
++     *
+      */
+     public static String JAVACOMPILER_ERROR(Object arg0) {
+         return localizer.localize(localizableJAVACOMPILER_ERROR(arg0));
+--- old/src/share/classes/com/sun/tools/internal/ws/resources/ModelMessages.java	Thu Jul 30 17:17:28 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/ModelMessages.java	Thu Jul 30 17:17:28 2009
+@@ -31,7 +31,7 @@
+ 
+ /**
+  * Defines string formatting method for each constant in the resource file
+- * 
++ *
+  */
+ public final class ModelMessages {
+ 
+@@ -44,7 +44,7 @@
+ 
+     /**
+      * duplicate service added to model: {0}
+-     * 
++     *
+      */
+     public static String MODEL_DUPLICATE_SERVICE(Object arg0) {
+         return localizer.localize(localizableMODEL_DUPLICATE_SERVICE(arg0));
+@@ -56,7 +56,7 @@
+ 
+     /**
+      * model error: {0}
+-     * 
++     *
+      */
+     public static String MODEL_NESTED_MODEL_ERROR(Object arg0) {
+         return localizer.localize(localizableMODEL_NESTED_MODEL_ERROR(arg0));
+@@ -68,7 +68,7 @@
+ 
+     /**
+      * duplicate PortType added to model: {0}
+-     * 
++     *
+      */
+     public static String MODEL_DUPLICATE_PORTTYPE(Object arg0) {
+         return localizer.localize(localizableMODEL_DUPLICATE_PORTTYPE(arg0));
+@@ -80,7 +80,7 @@
+ 
+     /**
+      * Failed to generate Java signature: duplicate exception names {0}. Use JAXWS binding customization to rename the wsdl:part "{1}"
+-     * 
++     *
+      */
+     public static String MODEL_EXCEPTION_NOTUNIQUE(Object arg0, Object arg1) {
+         return localizer.localize(localizableMODEL_EXCEPTION_NOTUNIQUE(arg0, arg1));
+@@ -92,7 +92,7 @@
+ 
+     /**
+      * xsd:all compositor not supported for the wildcard in schema type: "{0}"
+-     * 
++     *
+      */
+     public static String MODEL_SCHEMA_INVALID_WILDCARD_ALL_COMPOSITOR(Object arg0) {
+         return localizer.localize(localizableMODEL_SCHEMA_INVALID_WILDCARD_ALL_COMPOSITOR(arg0));
+@@ -104,7 +104,7 @@
+ 
+     /**
+      * facet "{0}" not supported on simple type: "{0}"
+-     * 
++     *
+      */
+     public static String MODEL_SCHEMA_SIMPLE_TYPE_WITH_FACETS(Object arg0) {
+         return localizer.localize(localizableMODEL_SCHEMA_SIMPLE_TYPE_WITH_FACETS(arg0));
+@@ -116,7 +116,7 @@
+ 
+     /**
+      * unsupported anonymous type ({0})
+-     * 
++     *
+      */
+     public static String MODEL_SCHEMA_UNSUPPORTED_TYPE_ANONYMOUS(Object arg0) {
+         return localizer.localize(localizableMODEL_SCHEMA_UNSUPPORTED_TYPE_ANONYMOUS(arg0));
+@@ -128,7 +128,7 @@
+ 
+     /**
+      * invalid attribute name: "_value" in complexType: "{0}", _value is JAXWS reserved name, this name is generated in the generated javabean class to hold content value in the generated javabean class for complexType/simpleContent.
+-     * 
++     *
+      */
+     public static String MODEL_COMPLEX_TYPE_SIMPLE_CONTENT_RESERVED_NAME(Object arg0) {
+         return localizer.localize(localizableMODEL_COMPLEX_TYPE_SIMPLE_CONTENT_RESERVED_NAME(arg0));
+@@ -140,7 +140,7 @@
+ 
+     /**
+      * simpleType: "{0}" derivation by xsd:union not supported
+-     * 
++     *
+      */
+     public static String MODEL_SCHEMA_UNION_NOT_SUPPORTED(Object arg0) {
+         return localizer.localize(localizableMODEL_SCHEMA_UNION_NOT_SUPPORTED(arg0));
+@@ -152,7 +152,7 @@
+ 
+     /**
+      * "{0}"
+-     * 
++     *
+      */
+     public static String MODEL_SCHEMA_JAXB_EXCEPTION_MESSAGE(Object arg0) {
+         return localizer.localize(localizableMODEL_SCHEMA_JAXB_EXCEPTION_MESSAGE(arg0));
+@@ -164,7 +164,7 @@
+ 
+     /**
+      * invalid id "{1} in model document (line {0})
+-     * 
++     *
+      */
+     public static String MODEL_IMPORTER_INVALID_ID(Object arg0, Object arg1) {
+         return localizer.localize(localizableMODEL_IMPORTER_INVALID_ID(arg0, arg1));
+@@ -176,7 +176,7 @@
+ 
+     /**
+      * invalid message type: {0}
+-     * 
++     *
+      */
+     public static String MODEL_INVALID_MESSAGE_TYPE(Object arg0) {
+         return localizer.localize(localizableMODEL_INVALID_MESSAGE_TYPE(arg0));
+@@ -188,7 +188,7 @@
+ 
+     /**
+      * unknown location
+-     * 
++     *
+      */
+     public static String CONSOLE_ERROR_REPORTER_UNKNOWN_LOCATION() {
+         return localizer.localize(localizableCONSOLE_ERROR_REPORTER_UNKNOWN_LOCATION());
+@@ -200,7 +200,7 @@
+ 
+     /**
+      * model exporter: unsupported class: {0}
+-     * 
++     *
+      */
+     public static String MODEL_EXPORTER_UNSUPPORTED_CLASS(Object arg0) {
+         return localizer.localize(localizableMODEL_EXPORTER_UNSUPPORTED_CLASS(arg0));
+@@ -212,7 +212,7 @@
+ 
+     /**
+      * no encoder found for simpleType: "{0}"
+-     * 
++     *
+      */
+     public static String MODEL_SCHEMA_ENCODER_NOT_FOUND(Object arg0) {
+         return localizer.localize(localizableMODEL_SCHEMA_ENCODER_NOT_FOUND(arg0));
+@@ -224,7 +224,7 @@
+ 
+     /**
+      * Element "{0}" not found.
+-     * 
++     *
+      */
+     public static String MODEL_SCHEMA_ELEMENT_NOT_FOUND(Object arg0) {
+         return localizer.localize(localizableMODEL_SCHEMA_ELEMENT_NOT_FOUND(arg0));
+@@ -236,7 +236,7 @@
+ 
+     /**
+      * uniqueness constraint violation, duplicate member "{0}" added to JavaStructureType "{1}"
+-     * 
++     *
+      */
+     public static String MODEL_UNIQUENESS_JAVASTRUCTURETYPE(Object arg0, Object arg1) {
+         return localizer.localize(localizableMODEL_UNIQUENESS_JAVASTRUCTURETYPE(arg0, arg1));
+@@ -249,24 +249,12 @@
+     /**
+      * {0}
+      * {1}
+-     * 
++     *
+      */
+     public static String MODEL_SAXPARSER_EXCEPTION(Object arg0, Object arg1) {
+         return localizer.localize(localizableMODEL_SAXPARSER_EXCEPTION(arg0, arg1));
+     }
+ 
+-    public static Localizable localizable_002F_002F_JAXWS() {
+-        return messageFactory.getMessage("//JAXWS");
+-    }
+-
+-    /**
+-     *  2.0
+-     * 
+-     */
+-    public static String _002F_002F_JAXWS() {
+-        return localizer.localize(localizable_002F_002F_JAXWS());
+-    }
+-
+     public static Localizable localizableMODEL_DUPLICATE_FAULTMESSAGE(Object arg0) {
+         return messageFactory.getMessage("model.duplicate.faultmessage", arg0);
+     }
+@@ -273,7 +261,7 @@
+ 
+     /**
+      * duplicate fault message added to model: {0}
+-     * 
++     *
+      */
+     public static String MODEL_DUPLICATE_FAULTMESSAGE(Object arg0) {
+         return localizer.localize(localizableMODEL_DUPLICATE_FAULTMESSAGE(arg0));
+@@ -285,7 +273,7 @@
+ 
+     /**
+      * invalid property in model document (line {0}
+-     * 
++     *
+      */
+     public static String MODEL_IMPORTER_INVALID_PROPERTY(Object arg0) {
+         return localizer.localize(localizableMODEL_IMPORTER_INVALID_PROPERTY(arg0));
+@@ -297,7 +285,7 @@
+ 
+     /**
+      * syntax error in model document (line {0})
+-     * 
++     *
+      */
+     public static String MODEL_IMPORTER_SYNTAX_ERROR(Object arg0) {
+         return localizer.localize(localizableMODEL_IMPORTER_SYNTAX_ERROR(arg0));
+@@ -309,7 +297,7 @@
+ 
+     /**
+      * unsupported type ({0}): "{1}" (namespace: {2})
+-     * 
++     *
+      */
+     public static String MODEL_SCHEMA_UNSUPPORTED_TYPE(Object arg0, Object arg1, Object arg2) {
+         return localizer.localize(localizableMODEL_SCHEMA_UNSUPPORTED_TYPE(arg0, arg1, arg2));
+@@ -321,7 +309,7 @@
+ 
+     /**
+      * no java mapping for simpleType: "{0}"
+-     * 
++     *
+      */
+     public static String MODEL_SCHEMA_INVALID_SIMPLE_TYPE_NO_JAVA_TYPE(Object arg0) {
+         return localizer.localize(localizableMODEL_SCHEMA_INVALID_SIMPLE_TYPE_NO_JAVA_TYPE(arg0));
+@@ -333,7 +321,7 @@
+ 
+     /**
+      * simpleType: "{0}" derivation by xsd:list not supported
+-     * 
++     *
+      */
+     public static String MODEL_SCHEMA_LIST_NOT_SUPPORTED(Object arg0) {
+         return localizer.localize(localizableMODEL_SCHEMA_LIST_NOT_SUPPORTED(arg0));
+@@ -345,7 +333,7 @@
+ 
+     /**
+      * LiteralArrayWrapper cannot have a parent type
+-     * 
++     *
+      */
+     public static String MODEL_ARRAYWRAPPER_NO_PARENT() {
+         return localizer.localize(localizableMODEL_ARRAYWRAPPER_NO_PARENT());
+@@ -357,7 +345,7 @@
+ 
+     /**
+      * duplicate part added to model: {0}
+-     * 
++     *
+      */
+     public static String MODEL_DUPLICATE_PART(Object arg0) {
+         return localizer.localize(localizableMODEL_DUPLICATE_PART(arg0));
+@@ -369,7 +357,7 @@
+ 
+     /**
+      * duplicate Operation added to model: {0}
+-     * 
++     *
+      */
+     public static String MODEL_DUPLICATE_OPERATION(Object arg0) {
+         return localizer.localize(localizableMODEL_DUPLICATE_OPERATION(arg0));
+@@ -381,7 +369,7 @@
+ 
+     /**
+      * parent of type "{0}" already set to "{1}", new value = "{2}"
+-     * 
++     *
+      */
+     public static String MODEL_PARENT_TYPE_ALREADY_SET(Object arg0, Object arg1, Object arg2) {
+         return localizer.localize(localizableMODEL_PARENT_TYPE_ALREADY_SET(arg0, arg1, arg2));
+@@ -393,7 +381,7 @@
+ 
+     /**
+      * LiteralArrayWrapper cannot have subtypes
+-     * 
++     *
+      */
+     public static String MODEL_ARRAYWRAPPER_NO_SUBTYPES() {
+         return localizer.localize(localizableMODEL_ARRAYWRAPPER_NO_SUBTYPES());
+@@ -405,7 +393,7 @@
+ 
+     /**
+      * invalid literal "{0}" in enumeration "{1}" (namespace: {2})
+-     * 
++     *
+      */
+     public static String MODEL_SCHEMA_INVALID_LITERAL_IN_ENUMERATION(Object arg0, Object arg1, Object arg2) {
+         return localizer.localize(localizableMODEL_SCHEMA_INVALID_LITERAL_IN_ENUMERATION(arg0, arg1, arg2));
+@@ -417,7 +405,7 @@
+ 
+     /**
+      * unsupported schema type: "{0}"
+-     * 
++     *
+      */
+     public static String MODEL_SCHEMA_UNSUPPORTED_SCHEMA_TYPE(Object arg0) {
+         return localizer.localize(localizableMODEL_SCHEMA_UNSUPPORTED_SCHEMA_TYPE(arg0));
+@@ -429,7 +417,7 @@
+ 
+     /**
+      * model version "{1}" newer than runtime version "{2}" (line {0}): need to upgrade to a newer runtime
+-     * 
++     *
+      */
+     public static String MODEL_IMPORTER_INVALID_MINOR_MINOR_OR_PATCH_VERSION(Object arg0, Object arg1, Object arg2) {
+         return localizer.localize(localizableMODEL_IMPORTER_INVALID_MINOR_MINOR_OR_PATCH_VERSION(arg0, arg1, arg2));
+@@ -441,7 +429,7 @@
+ 
+     /**
+      * circularity detected in schema: "{0}"
+-     * 
++     *
+      */
+     public static String MODEL_SCHEMA_CIRCULARITY(Object arg0) {
+         return localizer.localize(localizableMODEL_SCHEMA_CIRCULARITY(arg0));
+@@ -453,7 +441,7 @@
+ 
+     /**
+      * unsupported XML Schema feature: "{0}" in component {1}, mapping it to javax.xml.soap.SOAPElement
+-     * 
++     *
+      */
+     public static String MODEL_SCHEMA_NOT_IMPLEMENTED_GENERATING_SOAP_ELEMENT(Object arg0, Object arg1) {
+         return localizer.localize(localizableMODEL_SCHEMA_NOT_IMPLEMENTED_GENERATING_SOAP_ELEMENT(arg0, arg1));
+@@ -465,7 +453,7 @@
+ 
+     /**
+      * LiteralArrayWrapper element member already set.
+-     * 
++     *
+      */
+     public static String MODEL_ARRAYWRAPPER_MEMBER_ALREADY_SET() {
+         return localizer.localize(localizableMODEL_ARRAYWRAPPER_MEMBER_ALREADY_SET());
+@@ -477,7 +465,7 @@
+ 
+     /**
+      * invalid class name "{1}" in model document (line {0})
+-     * 
++     *
+      */
+     public static String MODEL_IMPORTER_INVALID_CLASS(Object arg0, Object arg1) {
+         return localizer.localize(localizableMODEL_IMPORTER_INVALID_CLASS(arg0, arg1));
+@@ -489,7 +477,7 @@
+ 
+     /**
+      * not a valid model document
+-     * 
++     *
+      */
+     public static String MODEL_IMPORTER_NON_MODEL() {
+         return localizer.localize(localizableMODEL_IMPORTER_NON_MODEL());
+@@ -501,7 +489,7 @@
+ 
+     /**
+      * invalid version "{1}" in model document (line {0})
+-     * 
++     *
+      */
+     public static String MODEL_IMPORTER_INVALID_VERSION(Object arg0, Object arg1) {
+         return localizer.localize(localizableMODEL_IMPORTER_INVALID_VERSION(arg0, arg1));
+@@ -513,7 +501,7 @@
+ 
+     /**
+      * invalid simpleType: "{0}", had null namespaceURI
+-     * 
++     *
+      */
+     public static String MODEL_SCHEMA_INVALID_SIMPLE_TYPE_NO_NAMESPACE_URI(Object arg0) {
+         return localizer.localize(localizableMODEL_SCHEMA_INVALID_SIMPLE_TYPE_NO_NAMESPACE_URI(arg0));
+@@ -525,7 +513,7 @@
+ 
+     /**
+      *   line {0} of {1}
+-     * 
++     *
+      */
+     public static String CONSOLE_ERROR_REPORTER_LINE_X_OF_Y(Object arg0, Object arg1) {
+         return localizer.localize(localizableCONSOLE_ERROR_REPORTER_LINE_X_OF_Y(arg0, arg1));
+@@ -536,8 +524,10 @@
+     }
+ 
+     /**
+-     * Failed to generate Java signature: duplicate parameter names {0}. Use JAXWS binding customization to rename the wsdl:part "{1}"
+-     * 
++     * Failed to generate Java signature: duplicate parameter name "{0}". Try one of these
++     *  1. Use JAXWS binding customization to rename the wsdl:part "{1}"
++     *  2. Run wsimport with -extension switch.
++     *
+      */
+     public static String MODEL_PARAMETER_NOTUNIQUE(Object arg0, Object arg1) {
+         return localizer.localize(localizableMODEL_PARAMETER_NOTUNIQUE(arg0, arg1));
+@@ -549,7 +539,7 @@
+ 
+     /**
+      * in simpleType: "{0}", itemType "{1}" can not be derived by list
+-     * 
++     *
+      */
+     public static String MODEL_SCHEMA_INVALID_SIMPLE_TYPE_INVALID_ITEM_TYPE(Object arg0, Object arg1) {
+         return localizer.localize(localizableMODEL_SCHEMA_INVALID_SIMPLE_TYPE_INVALID_ITEM_TYPE(arg0, arg1));
+@@ -561,7 +551,7 @@
+ 
+     /**
+      * duplicate property added to model: {0}
+-     * 
++     *
+      */
+     public static String MODEL_DUPLICATE_PROPERTY(Object arg0) {
+         return localizer.localize(localizableMODEL_DUPLICATE_PROPERTY(arg0));
+@@ -573,7 +563,7 @@
+ 
+     /**
+      * uniqueness constraint violation
+-     * 
++     *
+      */
+     public static String MODEL_UNIQUENESS() {
+         return localizer.localize(localizableMODEL_UNIQUENESS());
+@@ -585,7 +575,7 @@
+ 
+     /**
+      * for Uxxx codes
+-     * 
++     *
+      */
+     public static String _002F_002F_REPLACEMENT() {
+         return localizer.localize(localizable_002F_002F_REPLACEMENT());
+@@ -597,7 +587,7 @@
+ 
+     /**
+      * in simpleType: "{0}", xsd:list itemType "{1}" is invalid
+-     * 
++     *
+      */
+     public static String MODEL_SCHEMA_INVALID_SIMPLE_TYPE_NO_ITEM_LITERAL_TYPE(Object arg0, Object arg1) {
+         return localizer.localize(localizableMODEL_SCHEMA_INVALID_SIMPLE_TYPE_NO_ITEM_LITERAL_TYPE(arg0, arg1));
+@@ -609,7 +599,7 @@
+ 
+     /**
+      * invalid simpleType: "{0}"
+-     * 
++     *
+      */
+     public static String MODEL_SCHEMA_INVALID_SIMPLE_TYPE(Object arg0) {
+         return localizer.localize(localizableMODEL_SCHEMA_INVALID_SIMPLE_TYPE(arg0));
+@@ -621,7 +611,7 @@
+ 
+     /**
+      * LiteralArrayWrapper may only have one element member.
+-     * 
++     *
+      */
+     public static String MODEL_ARRAYWRAPPER_ONLY_ONE_MEMBER() {
+         return localizer.localize(localizableMODEL_ARRAYWRAPPER_ONLY_ONE_MEMBER());
+@@ -633,12 +623,27 @@
+ 
+     /**
+      * invalid literal value in model document (line {0})
+-     * 
++     *
+      */
+     public static String MODEL_IMPORTER_INVALID_LITERAL(Object arg0) {
+         return localizer.localize(localizableMODEL_IMPORTER_INVALID_LITERAL(arg0));
+     }
+ 
++    public static Localizable localizableMODEL_PARAMETER_NOTUNIQUE_WRAPPER(Object arg0, Object arg1) {
++        return messageFactory.getMessage("model.parameter.notunique.wrapper", arg0, arg1);
++    }
++
++    /**
++     * Failed to generate Java signature: duplicate parameter name "{0}". Try one of these
++     *  1. Use JAXWS binding customization to rename the wsdl:part "{1}"
++     *  2. Run wsimport with -extension switch.
++     *  3. This is wrapper style operation, to resolve parameter name conflict, you can also try disabling wrapper style by using <jaxws:enableWrapperStyle>false</jaxws:enableWrapperStyle> wsdl customization.
++     *
++     */
++    public static String MODEL_PARAMETER_NOTUNIQUE_WRAPPER(Object arg0, Object arg1) {
++        return localizer.localize(localizableMODEL_PARAMETER_NOTUNIQUE_WRAPPER(arg0, arg1));
++    }
++
+     public static Localizable localizableMODEL_SCHEMA_NOT_IMPLEMENTED(Object arg0) {
+         return messageFactory.getMessage("model.schema.notImplemented", arg0);
+     }
+@@ -645,7 +650,7 @@
+ 
+     /**
+      * unsupported XML Schema feature ({0})
+-     * 
++     *
+      */
+     public static String MODEL_SCHEMA_NOT_IMPLEMENTED(Object arg0) {
+         return localizer.localize(localizableMODEL_SCHEMA_NOT_IMPLEMENTED(arg0));
+@@ -657,7 +662,7 @@
+ 
+     /**
+      * invalid literal "{0}" in anonymous enumeration
+-     * 
++     *
+      */
+     public static String MODEL_SCHEMA_INVALID_LITERAL_IN_ENUMERATION_ANONYMOUS(Object arg0) {
+         return localizer.localize(localizableMODEL_SCHEMA_INVALID_LITERAL_IN_ENUMERATION_ANONYMOUS(arg0));
+@@ -669,7 +674,7 @@
+ 
+     /**
+      * LiteralArrayWrapper cannot have a content member
+-     * 
++     *
+      */
+     public static String MODEL_ARRAYWRAPPER_NO_CONTENT_MEMBER() {
+         return localizer.localize(localizableMODEL_ARRAYWRAPPER_NO_CONTENT_MEMBER());
+@@ -681,7 +686,7 @@
+ 
+     /**
+      * parts in wsdl:message "{0}", reference "{1}", they must reference unique global elements.
+-     * 
++     *
+      */
+     public static String MODEL_PART_NOT_UNIQUE(Object arg0, Object arg1) {
+         return localizer.localize(localizableMODEL_PART_NOT_UNIQUE(arg0, arg1));
+@@ -693,7 +698,7 @@
+ 
+     /**
+      * parent of fault "{0}" already set to "{1}", new value = "{2}"
+-     * 
++     *
+      */
+     public static String MODEL_PARENT_FAULT_ALREADY_SET(Object arg0, Object arg1, Object arg2) {
+         return localizer.localize(localizableMODEL_PARENT_FAULT_ALREADY_SET(arg0, arg1, arg2));
+--- old/src/share/classes/com/sun/tools/internal/ws/resources/ModelerMessages.java	Thu Jul 30 17:17:32 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/ModelerMessages.java	Thu Jul 30 17:17:31 2009
+@@ -31,7 +31,7 @@
+ 
+ /**
+  * Defines string formatting method for each constant in the resource file
+- * 
++ *
+  */
+ public final class ModelerMessages {
+ 
+@@ -44,7 +44,7 @@
+ 
+     /**
+      * Ignoring the mime:part. mime part: {0} can not be mapped to schema type: {1}
+-     * 
++     *
+      */
+     public static String MIMEMODELER_INVALID_MIME_CONTENT_INVALID_SCHEMA_TYPE(Object arg0, Object arg1) {
+         return localizer.localize(localizableMIMEMODELER_INVALID_MIME_CONTENT_INVALID_SCHEMA_TYPE(arg0, arg1));
+@@ -56,7 +56,7 @@
+ 
+     /**
+      * "{0}" specified in the parameterOrder attribute of operation "{1}" is not a valid part of the message.
+-     * 
++     *
+      */
+     public static String WSDLMODELER_INVALID_PARAMETERORDER_PARAMETER(Object arg0, Object arg1) {
+         return localizer.localize(localizableWSDLMODELER_INVALID_PARAMETERORDER_PARAMETER(arg0, arg1));
+@@ -68,7 +68,7 @@
+ 
+     /**
+      * soap:fault name not specified, wsdl:fault "{0}" in operation "{1}"
+-     * 
++     *
+      */
+     public static String WSDLMODELER_INVALID_BINDING_FAULT_NO_SOAP_FAULT_NAME(Object arg0, Object arg1) {
+         return localizer.localize(localizableWSDLMODELER_INVALID_BINDING_FAULT_NO_SOAP_FAULT_NAME(arg0, arg1));
+@@ -80,7 +80,7 @@
+ 
+     /**
+      * Non conforming WS-I WSDL used for wsdl:import
+-     * 
++     *
+      */
+     public static String WSDLMODELER_WARNING_NONCONFORMING_WSDL_IMPORT() {
+         return localizer.localize(localizableWSDLMODELER_WARNING_NONCONFORMING_WSDL_IMPORT());
+@@ -92,7 +92,7 @@
+ 
+     /**
+      * output message of binding operation "{0}" must specify a value for the "namespace" attribute
+-     * 
++     *
+      */
+     public static String WSDLMODELER_INVALID_BINDING_OPERATION_OUTPUT_SOAP_BODY_MISSING_NAMESPACE(Object arg0) {
+         return localizer.localize(localizableWSDLMODELER_INVALID_BINDING_OPERATION_OUTPUT_SOAP_BODY_MISSING_NAMESPACE(arg0));
+@@ -104,7 +104,7 @@
+ 
+     /**
+      * ignoring encoded fault "{0}" in literal binding operation "{1}"
+-     * 
++     *
+      */
+     public static String WSDLMODELER_INVALID_OPERATION_FAULT_NOT_LITERAL(Object arg0, Object arg1) {
+         return localizer.localize(localizableWSDLMODELER_INVALID_OPERATION_FAULT_NOT_LITERAL(arg0, arg1));
+@@ -116,7 +116,7 @@
+ 
+     /**
+      * input message of binding operation "{0}" does not have a SOAP body extension
+-     * 
++     *
+      */
+     public static String WSDLMODELER_INVALID_BINDING_OPERATION_INPUT_MISSING_SOAP_BODY(Object arg0) {
+         return localizer.localize(localizableWSDLMODELER_INVALID_BINDING_OPERATION_INPUT_MISSING_SOAP_BODY(arg0));
+@@ -128,7 +128,7 @@
+ 
+     /**
+      * ignoring SOAP port "{0}": unrecognized transport. try running wsimport with -extension switch.
+-     * 
++     *
+      */
+     public static String WSDLMODELER_WARNING_IGNORING_SOAP_BINDING_NON_HTTP_TRANSPORT(Object arg0) {
+         return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_SOAP_BINDING_NON_HTTP_TRANSPORT(arg0));
+@@ -140,7 +140,7 @@
+ 
+     /**
+      * in binding "{1}", operation "{0}" does not match any operation in the corresponding port type
+-     * 
++     *
+      */
+     public static String WSDLMODELER_INVALID_BINDING_OPERATION_NOT_FOUND(Object arg0, Object arg1) {
+         return localizer.localize(localizableWSDLMODELER_INVALID_BINDING_OPERATION_NOT_FOUND(arg0, arg1));
+@@ -152,7 +152,7 @@
+ 
+     /**
+      * WSDL MIME binding is not currently supported!
+-     * 
++     *
+      */
+     public static String WSDLMODELER_UNSUPPORTED_BINDING_MIME() {
+         return localizer.localize(localizableWSDLMODELER_UNSUPPORTED_BINDING_MIME());
+@@ -164,7 +164,7 @@
+ 
+     /**
+      * ignoring header fault part="{0}" message="{1}" of operation {2}
+-     * 
++     *
+      */
+     public static String WSDLMODELER_WARNING_IGNORING_HEADER_FAULT_NO_ELEMENT_ATTRIBUTE(Object arg0, Object arg1, Object arg2) {
+         return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_HEADER_FAULT_NO_ELEMENT_ATTRIBUTE(arg0, arg1, arg2));
+@@ -176,7 +176,7 @@
+ 
+     /**
+      * Invalid operation "{0}", can''t generate java method. Parameter: part "{2}" in wsdl:message "{1}", is a java keyword. Use customization to change the parameter name or change the wsdl:part name.
+-     * 
++     *
+      */
+     public static String WSDLMODELER_INVALID_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_NON_WRAPPER_STYLE(Object arg0, Object arg1, Object arg2) {
+         return localizer.localize(localizableWSDLMODELER_INVALID_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_NON_WRAPPER_STYLE(arg0, arg1, arg2));
+@@ -188,7 +188,7 @@
+ 
+     /**
+      * Invalid headerfault "{0}" of binding operation "{1}": not literal
+-     * 
++     *
+      */
+     public static String WSDLMODELER_INVALID_HEADERFAULT_NOT_LITERAL(Object arg0, Object arg1) {
+         return localizer.localize(localizableWSDLMODELER_INVALID_HEADERFAULT_NOT_LITERAL(arg0, arg1));
+@@ -200,7 +200,7 @@
+ 
+     /**
+      * Ignoring the mime:part. Invalid mime:part, the mime:content has different part attribute.
+-     * 
++     *
+      */
+     public static String MIMEMODELER_INVALID_MIME_CONTENT_DIFFERENT_PART() {
+         return localizer.localize(localizableMIMEMODELER_INVALID_MIME_CONTENT_DIFFERENT_PART());
+@@ -212,7 +212,7 @@
+ 
+     /**
+      * part "{1}" of operation "{0}" could not be resolved!
+-     * 
++     *
+      */
+     public static String WSDLMODELER_ERROR_PART_NOT_FOUND(Object arg0, Object arg1) {
+         return localizer.localize(localizableWSDLMODELER_ERROR_PART_NOT_FOUND(arg0, arg1));
+@@ -224,7 +224,7 @@
+ 
+     /**
+      * Invalid header "{0}" in operation {1}: part must specify a "element" attribute
+-     * 
++     *
+      */
+     public static String WSDLMODELER_INVALID_HEADER_MESSAGE_PART_MUST_HAVE_ELEMENT_DESCRIPTOR(Object arg0, Object arg1) {
+         return localizer.localize(localizableWSDLMODELER_INVALID_HEADER_MESSAGE_PART_MUST_HAVE_ELEMENT_DESCRIPTOR(arg0, arg1));
+@@ -236,7 +236,7 @@
+ 
+     /**
+      * Invalid operation "{0}", it''s java reserved word, can''t generate java method. Use customization to change the operation name.
+-     * 
++     *
+      */
+     public static String WSDLMODELER_INVALID_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_OPERATION_NAME(Object arg0) {
+         return localizer.localize(localizableWSDLMODELER_INVALID_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_OPERATION_NAME(arg0));
+@@ -248,7 +248,7 @@
+ 
+     /**
+      * fault "{0}" in operation "{1}" does not have a SOAP fault extension
+-     * 
++     *
+      */
+     public static String WSDLMODELER_INVALID_BINDING_FAULT_OUTPUT_MISSING_SOAP_FAULT(Object arg0, Object arg1) {
+         return localizer.localize(localizableWSDLMODELER_INVALID_BINDING_FAULT_OUTPUT_MISSING_SOAP_FAULT(arg0, arg1));
+@@ -260,7 +260,7 @@
+ 
+     /**
+      * ignoring operation "{0}": message part does not refer to a schema type declaration
+-     * 
++     *
+      */
+     public static String WSDLMODELER_WARNING_IGNORING_OPERATION_CANNOT_HANDLE_ELEMENT_MESSAGE_PART(Object arg0) {
+         return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_OPERATION_CANNOT_HANDLE_ELEMENT_MESSAGE_PART(arg0));
+@@ -272,7 +272,7 @@
+ 
+     /**
+      * The WSDL used has operations with literal and encoded use. -f:searchschema is not supported for this scenario.
+-     * 
++     *
+      */
+     public static String WSDLMODLER_WARNING_OPERATION_USE() {
+         return localizer.localize(localizableWSDLMODLER_WARNING_OPERATION_USE());
+@@ -284,7 +284,7 @@
+ 
+     /**
+      * ignoring port "{0}": not a standard SOAP port. try running wsimport with -extension switch.
+-     * 
++     *
+      */
+     public static String WSDLMODELER_WARNING_IGNORING_NON_SOAP_PORT(Object arg0) {
+         return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_NON_SOAP_PORT(arg0));
+@@ -296,7 +296,7 @@
+ 
+     /**
+      * fault "{0}" refers to message "{1}", but the message has more than one parts
+-     * 
++     *
+      */
+     public static String WSDLMODELER_INVALID_BINDING_FAULT_MESSAGE_HAS_MORE_THAN_ONE_PART(Object arg0, Object arg1) {
+         return localizer.localize(localizableWSDLMODELER_INVALID_BINDING_FAULT_MESSAGE_HAS_MORE_THAN_ONE_PART(arg0, arg1));
+@@ -308,7 +308,7 @@
+ 
+     /**
+      * WSDL document does not define any services
+-     * 
++     *
+      */
+     public static String WSDLMODELER_WARNING_NO_SERVICE_DEFINITIONS_FOUND() {
+         return localizer.localize(localizableWSDLMODELER_WARNING_NO_SERVICE_DEFINITIONS_FOUND());
+@@ -320,7 +320,7 @@
+ 
+     /**
+      * ignoring fault "{0}" of binding operation "{1}": cannot resolve message
+-     * 
++     *
+      */
+     public static String WSDLMODELER_WARNING_IGNORING_FAULT_CANT_RESOLVE_MESSAGE(Object arg0, Object arg1) {
+         return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_FAULT_CANT_RESOLVE_MESSAGE(arg0, arg1));
+@@ -331,8 +331,8 @@
+     }
+ 
+     /**
+-     * Schema descriptor {0} in message part "{1}" could not be bound to Java!
+-     * 
++     * Schema descriptor {0} in message part "{1}" is not defined and could not be bound to Java. Perhaps the schema descriptor {0} is not defined in the schema imported/included in the WSDL. You can either add such imports/includes or run wsimport and provide the schema location using -b switch.
++     *
+      */
+     public static String WSDLMODELER_JAXB_JAVATYPE_NOTFOUND(Object arg0, Object arg1) {
+         return localizer.localize(localizableWSDLMODELER_JAXB_JAVATYPE_NOTFOUND(arg0, arg1));
+@@ -344,7 +344,7 @@
+ 
+     /**
+      * not a WS-I BP1.1 compliant SOAP port "{0}": the wsdl binding has mixed style, it must be rpc-literal or document-literal operation!
+-     * 
++     *
+      */
+     public static String WSDLMODELER_WARNING_PORT_SOAP_BINDING_MIXED_STYLE(Object arg0) {
+         return localizer.localize(localizableWSDLMODELER_WARNING_PORT_SOAP_BINDING_MIXED_STYLE(arg0));
+@@ -356,7 +356,7 @@
+ 
+     /**
+      * Invalid wsdl:operation "{0}": its a document-literal operation,  message part must refer to a schema element declaration
+-     * 
++     *
+      */
+     public static String WSDLMODELER_INVALID_DOCLITOPERATION(Object arg0) {
+         return localizer.localize(localizableWSDLMODELER_INVALID_DOCLITOPERATION(arg0));
+@@ -368,7 +368,7 @@
+ 
+     /**
+      * modeler error: {0}
+-     * 
++     *
+      */
+     public static String MODELER_NESTED_MODEL_ERROR(Object arg0) {
+         return localizer.localize(localizableMODELER_NESTED_MODEL_ERROR(arg0));
+@@ -380,7 +380,7 @@
+ 
+     /**
+      * ignoring fault "{0}" of operation "{1}", soap:fault name "{2}" is not unique
+-     * 
++     *
+      */
+     public static String WSDLMODELER_DUPLICATE_FAULT_SOAP_NAME(Object arg0, Object arg1, Object arg2) {
+         return localizer.localize(localizableWSDLMODELER_DUPLICATE_FAULT_SOAP_NAME(arg0, arg1, arg2));
+@@ -392,7 +392,7 @@
+ 
+     /**
+      * name of soap:fault "{0}" doesn''t match the name of wsdl:fault "{1}" in operation "{2}"
+-     * 
++     *
+      */
+     public static String WSDLMODELER_INVALID_BINDING_FAULT_WRONG_SOAP_FAULT_NAME(Object arg0, Object arg1, Object arg2) {
+         return localizer.localize(localizableWSDLMODELER_INVALID_BINDING_FAULT_WRONG_SOAP_FAULT_NAME(arg0, arg1, arg2));
+@@ -404,7 +404,7 @@
+ 
+     /**
+      * ignoring document-style operation "{0}": parameters are not literal
+-     * 
++     *
+      */
+     public static String WSDLMODELER_WARNING_IGNORING_OPERATION_NOT_LITERAL(Object arg0) {
+         return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_OPERATION_NOT_LITERAL(arg0));
+@@ -416,7 +416,7 @@
+ 
+     /**
+      * ignoring operation "{0}": cannot handle document-style operations
+-     * 
++     *
+      */
+     public static String WSDLMODELER_WARNING_IGNORING_OPERATION_CANNOT_HANDLE_DOCUMENT_STYLE(Object arg0) {
+         return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_OPERATION_CANNOT_HANDLE_DOCUMENT_STYLE(arg0));
+@@ -428,7 +428,7 @@
+ 
+     /**
+      * ignoring encoded fault "{0}" of binding operation "{1}"
+-     * 
++     *
+      */
+     public static String WSDLMODELER_WARNING_IGNORING_FAULT_NOT_LITERAL(Object arg0, Object arg1) {
+         return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_FAULT_NOT_LITERAL(arg0, arg1));
+@@ -440,7 +440,7 @@
+ 
+     /**
+      * Invalid wsdl:operation "{0}": its a rpc-literal operation,  message part must refer to a schema type declaration
+-     * 
++     *
+      */
+     public static String WSDLMODELER_INVALID_RPCLITOPERATION(Object arg0) {
+         return localizer.localize(localizableWSDLMODELER_INVALID_RPCLITOPERATION(arg0));
+@@ -452,7 +452,7 @@
+ 
+     /**
+      * Invalid operation "{0}", can''t generate java method. Parameter,customized name "{1}"  is a java keyword.
+-     * 
++     *
+      */
+     public static String WSDLMODELER_INVALID_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_CUSTOM_NAME(Object arg0, Object arg1) {
+         return localizer.localize(localizableWSDLMODELER_INVALID_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_CUSTOM_NAME(arg0, arg1));
+@@ -464,7 +464,7 @@
+ 
+     /**
+      * Check the abstract operation "{0}" binding, part "{1}" has multiple binding. Will try to generated artiffacts anyway...
+-     * 
++     *
+      */
+     public static String WSDLMODELER_WARNING_BINDING_OPERATION_MULTIPLE_PART_BINDING(Object arg0, Object arg1) {
+         return localizer.localize(localizableWSDLMODELER_WARNING_BINDING_OPERATION_MULTIPLE_PART_BINDING(arg0, arg1));
+@@ -476,7 +476,7 @@
+ 
+     /**
+      * SOAP port "{0}": uses a non-standard SOAP 1.2 binding.
+-     * 
++     *
+      */
+     public static String WSDLMODELER_WARNING_PORT_SOAP_BINDING_12(Object arg0) {
+         return localizer.localize(localizableWSDLMODELER_WARNING_PORT_SOAP_BINDING_12(arg0));
+@@ -488,7 +488,7 @@
+ 
+     /**
+      * name attribute on wsdl:part in Operation "{0}" is ignored. Its not allowed as per WS-I AP 1.0.
+-     * 
++     *
+      */
+     public static String MIMEMODELER_INVALID_MIME_PART_NAME_NOT_ALLOWED(Object arg0) {
+         return localizer.localize(localizableMIMEMODELER_INVALID_MIME_PART_NAME_NOT_ALLOWED(arg0));
+@@ -500,7 +500,7 @@
+ 
+     /**
+      * ignoring mime:part, cannot find part "{0}" referenced by the mime:content in the wsdl:operation "{1}"
+-     * 
++     *
+      */
+     public static String WSDLMODELER_WARNING_IGNORING_MIME_PART_NOT_FOUND(Object arg0, Object arg1) {
+         return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_MIME_PART_NOT_FOUND(arg0, arg1));
+@@ -512,7 +512,7 @@
+ 
+     /**
+      * Ingoring operation "{0}": more than one part bound to body
+-     * 
++     *
+      */
+     public static String WSDLMODELER_WARNING_OPERATION_MORE_THAN_ONE_PART_IN_MESSAGE(Object arg0) {
+         return localizer.localize(localizableWSDLMODELER_WARNING_OPERATION_MORE_THAN_ONE_PART_IN_MESSAGE(arg0));
+@@ -524,7 +524,7 @@
+ 
+     /**
+      * Ignoring operation "{0}", can''t generate java method. Parameter: part "{2}" in wsdl:message "{1}", is a java keyword. Use customization to change the parameter name or change the wsdl:part name.
+-     * 
++     *
+      */
+     public static String WSDLMODELER_WARNING_IGNORING_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_NON_WRAPPER_STYLE(Object arg0, Object arg1, Object arg2) {
+         return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_NON_WRAPPER_STYLE(arg0, arg1, arg2));
+@@ -536,7 +536,7 @@
+ 
+     /**
+      * fault message "{0}" in binding operation "{1}" could not be resolved
+-     * 
++     *
+      */
+     public static String WSDLMODELER_INVALID_FAULT_CANT_RESOLVE_MESSAGE(Object arg0, Object arg1) {
+         return localizer.localize(localizableWSDLMODELER_INVALID_FAULT_CANT_RESOLVE_MESSAGE(arg0, arg1));
+@@ -548,7 +548,7 @@
+ 
+     /**
+      * fault "{0}" refers to message "{1}", but the message has no parts
+-     * 
++     *
+      */
+     public static String WSDLMODELER_INVALID_BINDING_FAULT_EMPTY_MESSAGE(Object arg0, Object arg1) {
+         return localizer.localize(localizableWSDLMODELER_INVALID_BINDING_FAULT_EMPTY_MESSAGE(arg0, arg1));
+@@ -559,8 +559,8 @@
+     }
+ 
+     /**
+-     * XML type "{0}" could not be resolved, XML to JAVA binding failed! Please check the wsdl:part "{1}" in the wsdl:message "{2}".    
+-     * 
++     * XML type "{0}" could not be resolved, XML to JAVA binding failed! Please check the wsdl:part "{1}" in the wsdl:message "{2}".
++     *
+      */
+     public static String WSDLMODELER_RPCLIT_UNKOWNSCHEMATYPE(Object arg0, Object arg1, Object arg2) {
+         return localizer.localize(localizableWSDLMODELER_RPCLIT_UNKOWNSCHEMATYPE(arg0, arg1, arg2));
+@@ -572,7 +572,7 @@
+ 
+     /**
+      * part "{1}" not found for the header fault "{0}", in binding "{2}"
+-     * 
++     *
+      */
+     public static String WSDLMODELER_HEADERFAULT_PART_NOT_FOUND(Object arg0, Object arg1, Object arg2) {
+         return localizer.localize(localizableWSDLMODELER_HEADERFAULT_PART_NOT_FOUND(arg0, arg1, arg2));
+@@ -584,12 +584,24 @@
+ 
+     /**
+      * ignoring operation "{0}": cannot handle "parts" attribute of "soap:body" element
+-     * 
++     *
+      */
+     public static String WSDLMODELER_WARNING_IGNORING_OPERATION_CANNOT_HANDLE_BODY_PARTS_ATTRIBUTE(Object arg0) {
+         return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_OPERATION_CANNOT_HANDLE_BODY_PARTS_ATTRIBUTE(arg0));
+     }
+ 
++    public static Localizable localizableWSDLMODELER_NON_UNIQUE_BODY_ERROR(Object arg0, Object arg1, Object arg2, Object arg3) {
++        return messageFactory.getMessage("wsdlmodeler.nonUnique.body.error", arg0, arg1, arg2, arg3);
++    }
++
++    /**
++     * Non unique body parts! In a port, as per BP 1.1 R2710 operations must have unique operation signaure on the wire for successful dispatch. In port {0}, Operations "{1}" and "{2}" have the same request body block {3}. Try running wsimport with -extension switch, runtime will try to dispatch using SOAPAction
++     *
++     */
++    public static String WSDLMODELER_NON_UNIQUE_BODY_ERROR(Object arg0, Object arg1, Object arg2, Object arg3) {
++        return localizer.localize(localizableWSDLMODELER_NON_UNIQUE_BODY_ERROR(arg0, arg1, arg2, arg3));
++    }
++
+     public static Localizable localizableWSDLMODELER_WARNING_IGNORING_SOAP_BINDING_MIXED_STYLE(Object arg0) {
+         return messageFactory.getMessage("wsdlmodeler.warning.ignoringSOAPBinding.mixedStyle", arg0);
+     }
+@@ -596,7 +608,7 @@
+ 
+     /**
+      * ignoring port "{0}", its not WS-I BP 1.1 compliant: the wsdl binding has mixed style, it must be rpc-literal or document-literal operation. try running wsimport with -extension switch.
+-     * 
++     *
+      */
+     public static String WSDLMODELER_WARNING_IGNORING_SOAP_BINDING_MIXED_STYLE(Object arg0) {
+         return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_SOAP_BINDING_MIXED_STYLE(arg0));
+@@ -608,7 +620,7 @@
+ 
+     /**
+      * Missing type attribute in mime:content in operation "{0}". part attribute must be present in mime:content declaration.
+-     * 
++     *
+      */
+     public static String MIMEMODELER_INVALID_MIME_CONTENT_MISSING_TYPE_ATTRIBUTE(Object arg0) {
+         return localizer.localize(localizableMIMEMODELER_INVALID_MIME_CONTENT_MISSING_TYPE_ATTRIBUTE(arg0));
+@@ -620,7 +632,7 @@
+ 
+     /**
+      * ignoring operation "{0}": input message is empty
+-     * 
++     *
+      */
+     public static String WSDLMODELER_WARNING_IGNORING_OPERATION_CANNOT_HANDLE_EMPTY_INPUT_MESSAGE(Object arg0) {
+         return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_OPERATION_CANNOT_HANDLE_EMPTY_INPUT_MESSAGE(arg0));
+@@ -632,7 +644,7 @@
+ 
+     /**
+      * Service "{0}" does not contain any usable ports. try running wsimport with -extension switch.
+-     * 
++     *
+      */
+     public static String WSDLMODELER_WARNING_NO_PORTS_IN_SERVICE(Object arg0) {
+         return localizer.localize(localizableWSDLMODELER_WARNING_NO_PORTS_IN_SERVICE(arg0));
+@@ -644,7 +656,7 @@
+ 
+     /**
+      * more than one part left out in the parameterOrder attribute of operation "{0}"
+-     * 
++     *
+      */
+     public static String WSDLMODELER_INVALID_PARAMETER_ORDER_TOO_MANY_UNMENTIONED_PARTS(Object arg0) {
+         return localizer.localize(localizableWSDLMODELER_INVALID_PARAMETER_ORDER_TOO_MANY_UNMENTIONED_PARTS(arg0));
+@@ -656,7 +668,7 @@
+ 
+     /**
+      * input message of binding operation "{0}" must specify a value for the "namespace" attribute
+-     * 
++     *
+      */
+     public static String WSDLMODELER_INVALID_BINDING_OPERATION_INPUT_SOAP_BODY_MISSING_NAMESPACE(Object arg0) {
+         return localizer.localize(localizableWSDLMODELER_INVALID_BINDING_OPERATION_INPUT_SOAP_BODY_MISSING_NAMESPACE(arg0));
+@@ -668,7 +680,7 @@
+ 
+     /**
+      * ignoring header "{0}" of binding operation "{1}"
+-     * 
++     *
+      */
+     public static String WSDLMODELER_WARNING_IGNORING_HEADER(Object arg0, Object arg1) {
+         return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_HEADER(arg0, arg1));
+@@ -680,7 +692,7 @@
+ 
+     /**
+      * wsimport failed to generate async response bean for operation: {0}
+-     * 
++     *
+      */
+     public static String WSDLMODELER_RESPONSEBEAN_NOTFOUND(Object arg0) {
+         return localizer.localize(localizableWSDLMODELER_RESPONSEBEAN_NOTFOUND(arg0));
+@@ -691,8 +703,8 @@
+     }
+ 
+     /**
+-     * rpc/encoded wsdl's are not supported in JAXWS 2.0. 
+-     * 
++     * rpc/encoded wsdl's are not supported in JAXWS 2.0.
++     *
+      */
+     public static String WSDLMODELER_20_RPCENC_NOT_SUPPORTED() {
+         return localizer.localize(localizableWSDLMODELER_20_RPCENC_NOT_SUPPORTED());
+@@ -704,7 +716,7 @@
+ 
+     /**
+      * ignoring operation "{0}": part "{1}" not found
+-     * 
++     *
+      */
+     public static String WSDLMODELER_WARNING_IGNORING_OPERATION_PART_NOT_FOUND(Object arg0, Object arg1) {
+         return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_OPERATION_PART_NOT_FOUND(arg0, arg1));
+@@ -716,7 +728,7 @@
+ 
+     /**
+      * in message "{0}", part "{1}" must specify a "element" attribute
+-     * 
++     *
+      */
+     public static String WSDLMODELER_INVALID_MESSAGE_PART_MUST_HAVE_ELEMENT_DESCRIPTOR(Object arg0, Object arg1) {
+         return localizer.localize(localizableWSDLMODELER_INVALID_MESSAGE_PART_MUST_HAVE_ELEMENT_DESCRIPTOR(arg0, arg1));
+@@ -728,7 +740,7 @@
+ 
+     /**
+      * parts "{0}" not found in the message "{1}", wrong WSDL
+-     * 
++     *
+      */
+     public static String WSDLMODELER_ERROR_PARTS_NOT_FOUND(Object arg0, Object arg1) {
+         return localizer.localize(localizableWSDLMODELER_ERROR_PARTS_NOT_FOUND(arg0, arg1));
+@@ -740,7 +752,7 @@
+ 
+     /**
+      * ignoring literal fault "{0}" of binding operation "{1}"
+-     * 
++     *
+      */
+     public static String WSDLMODELER_WARNING_IGNORING_FAULT_NOT_ENCODED(Object arg0, Object arg1) {
+         return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_FAULT_NOT_ENCODED(arg0, arg1));
+@@ -752,7 +764,7 @@
+ 
+     /**
+      * ignoring operation "{0}": not request-response or one-way
+-     * 
++     *
+      */
+     public static String WSDLMODELER_WARNING_IGNORING_OPERATION_NOT_SUPPORTED_STYLE(Object arg0) {
+         return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_OPERATION_NOT_SUPPORTED_STYLE(arg0));
+@@ -764,7 +776,7 @@
+ 
+     /**
+      * in message "{0}", part "{1}" must specify a "type" attribute
+-     * 
++     *
+      */
+     public static String WSDLMODELER_INVALID_MESSAGE_PART_MUST_HAVE_TYPE_DESCRIPTOR(Object arg0, Object arg1) {
+         return localizer.localize(localizableWSDLMODELER_INVALID_MESSAGE_PART_MUST_HAVE_TYPE_DESCRIPTOR(arg0, arg1));
+@@ -776,7 +788,7 @@
+ 
+     /**
+      * multiple "out" parameters in operation: {0}
+-     * 
++     *
+      */
+     public static String WSDLMODELER_MULTIPLE_OUTPUT_PARAMETERS(Object arg0) {
+         return localizer.localize(localizableWSDLMODELER_MULTIPLE_OUTPUT_PARAMETERS(arg0));
+@@ -788,7 +800,7 @@
+ 
+     /**
+      * abstract operation "{0}" binding, part "{1}" has multiple binding.
+-     * 
++     *
+      */
+     public static String WSDLMODELER_INVALID_BINDING_OPERATION_MULTIPLE_PART_BINDING(Object arg0, Object arg1) {
+         return localizer.localize(localizableWSDLMODELER_INVALID_BINDING_OPERATION_MULTIPLE_PART_BINDING(arg0, arg1));
+@@ -800,7 +812,7 @@
+ 
+     /**
+      * invalid WSDL document
+-     * 
++     *
+      */
+     public static String WSDLMODELER_INVALID() {
+         return localizer.localize(localizableWSDLMODELER_INVALID());
+@@ -812,24 +824,12 @@
+ 
+     /**
+      * in binding "{1}", operation "{0}" does not reference a unique operation in the corresponding port type
+-     * 
++     *
+      */
+     public static String WSDLMODELER_INVALID_BINDING_OPERATION_MULTIPLE_MATCHING_OPERATIONS(Object arg0, Object arg1) {
+         return localizer.localize(localizableWSDLMODELER_INVALID_BINDING_OPERATION_MULTIPLE_MATCHING_OPERATIONS(arg0, arg1));
+     }
+ 
+-    public static Localizable localizableWSDLMODELER_NON_UNIQUE_BODY(Object arg0, Object arg1, Object arg2, Object arg3) {
+-        return messageFactory.getMessage("wsdlmodeler.nonUnique.body", arg0, arg1, arg2, arg3);
+-    }
+-
+-    /**
+-     * Non unique body parts! In a port, operations must have unique operation signaure on the wire for successful dispatch. In port {0}, Operations "{1}" and "{2}" have the same request body block {3}
+-     * 
+-     */
+-    public static String WSDLMODELER_NON_UNIQUE_BODY(Object arg0, Object arg1, Object arg2, Object arg3) {
+-        return localizer.localize(localizableWSDLMODELER_NON_UNIQUE_BODY(arg0, arg1, arg2, arg3));
+-    }
+-
+     public static Localizable localizableWSDLMODELER_WARNING_IGNORING_HEADER_CANT_RESOLVE_MESSAGE(Object arg0, Object arg1) {
+         return messageFactory.getMessage("wsdlmodeler.warning.ignoringHeader.cant.resolve.message", arg0, arg1);
+     }
+@@ -836,7 +836,7 @@
+ 
+     /**
+      * ignoring header "{0}" of binding operation "{1}": cannot resolve message
+-     * 
++     *
+      */
+     public static String WSDLMODELER_WARNING_IGNORING_HEADER_CANT_RESOLVE_MESSAGE(Object arg0, Object arg1) {
+         return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_HEADER_CANT_RESOLVE_MESSAGE(arg0, arg1));
+@@ -848,7 +848,7 @@
+ 
+     /**
+      * Ignoring operation "{0}", can''t generate java method ,customized name "{1}" of the wsdl:operation is a java keyword.
+-     * 
++     *
+      */
+     public static String WSDLMODELER_WARNING_IGNORING_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_CUSTOMIZED_OPERATION_NAME(Object arg0, Object arg1) {
+         return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_CUSTOMIZED_OPERATION_NAME(arg0, arg1));
+@@ -860,7 +860,7 @@
+ 
+     /**
+      * ignoring header "{0}" of binding operation "{1}": not literal
+-     * 
++     *
+      */
+     public static String WSDLMODELER_WARNING_IGNORING_HEADER_NOT_LITERAL(Object arg0, Object arg1) {
+         return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_HEADER_NOT_LITERAL(arg0, arg1));
+@@ -872,7 +872,7 @@
+ 
+     /**
+      * input header "{1}" of binding operation "{0}" must specify a value for the "namespace" attribute
+-     * 
++     *
+      */
+     public static String WSDLMODELER_INVALID_BINDING_OPERATION_INPUT_HEADER_MISSING_NAMESPACE(Object arg0, Object arg1) {
+         return localizer.localize(localizableWSDLMODELER_INVALID_BINDING_OPERATION_INPUT_HEADER_MISSING_NAMESPACE(arg0, arg1));
+@@ -884,7 +884,7 @@
+ 
+     /**
+      * binding operation "{0}" must specify a name for its input message
+-     * 
++     *
+      */
+     public static String WSDLMODELER_INVALID_BINDING_OPERATION_MISSING_INPUT_NAME(Object arg0) {
+         return localizer.localize(localizableWSDLMODELER_INVALID_BINDING_OPERATION_MISSING_INPUT_NAME(arg0));
+@@ -896,7 +896,7 @@
+ 
+     /**
+      * ignoring port "{0}": no SOAP address specified. try running wsimport with -extension switch.
+-     * 
++     *
+      */
+     public static String WSDLMODELER_WARNING_IGNORING_NON_SOAP_PORT_NO_ADDRESS(Object arg0) {
+         return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_NON_SOAP_PORT_NO_ADDRESS(arg0));
+@@ -908,7 +908,7 @@
+ 
+     /**
+      * result is "inout" parameter in operation: {0}
+-     * 
++     *
+      */
+     public static String WSDLMODELER_RESULT_IS_IN_OUT_PARAMETER(Object arg0) {
+         return localizer.localize(localizableWSDLMODELER_RESULT_IS_IN_OUT_PARAMETER(arg0));
+@@ -920,7 +920,7 @@
+ 
+     /**
+      * header "{0}" of binding operation "{1}": not found
+-     * 
++     *
+      */
+     public static String WSDLMODELER_INVALID_HEADER_NOT_FOUND(Object arg0, Object arg1) {
+         return localizer.localize(localizableWSDLMODELER_INVALID_HEADER_NOT_FOUND(arg0, arg1));
+@@ -932,7 +932,7 @@
+ 
+     /**
+      * The mime:content part refers to wsdl:part "{0}", defined using element attribute. Please make sure the mime type: "{1}" is appropriate to serialize XML.
+-     * 
++     *
+      */
+     public static String MIMEMODELER_ELEMENT_PART_INVALID_ELEMENT_MIME_TYPE(Object arg0, Object arg1) {
+         return localizer.localize(localizableMIMEMODELER_ELEMENT_PART_INVALID_ELEMENT_MIME_TYPE(arg0, arg1));
+@@ -944,7 +944,7 @@
+ 
+     /**
+      * Invalid header "{0}" of binding operation "{1}": not literal
+-     * 
++     *
+      */
+     public static String WSDLMODELER_INVALID_HEADER_NOT_LITERAL(Object arg0, Object arg1) {
+         return localizer.localize(localizableWSDLMODELER_INVALID_HEADER_NOT_LITERAL(arg0, arg1));
+@@ -956,7 +956,7 @@
+ 
+     /**
+      * wsdl:part element referenced by mime:content part attribute: {0} must be defined using type attribute!
+-     * 
++     *
+      */
+     public static String MIMEMODELER_INVALID_MIME_CONTENT_MESAGE_PART_ELEMENT_KIND(Object arg0) {
+         return localizer.localize(localizableMIMEMODELER_INVALID_MIME_CONTENT_MESAGE_PART_ELEMENT_KIND(arg0));
+@@ -968,7 +968,7 @@
+ 
+     /**
+      * ignoring RPC-style operation "{0}": parameters are not encoded
+-     * 
++     *
+      */
+     public static String WSDLMODELER_WARNING_IGNORING_OPERATION_NOT_ENCODED(Object arg0) {
+         return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_OPERATION_NOT_ENCODED(arg0));
+@@ -980,7 +980,7 @@
+ 
+     /**
+      * Non conforming WS-I WSDL used for wsdl:types
+-     * 
++     *
+      */
+     public static String WSDLMODELER_WARNING_NONCONFORMING_WSDL_TYPES() {
+         return localizer.localize(localizableWSDLMODELER_WARNING_NONCONFORMING_WSDL_TYPES());
+@@ -992,7 +992,7 @@
+ 
+     /**
+      * ignoring operation "{0}": more than one part in input message
+-     * 
++     *
+      */
+     public static String WSDLMODELER_WARNING_IGNORING_OPERATION_CANNOT_HANDLE_MORE_THAN_ONE_PART_IN_INPUT_MESSAGE(Object arg0) {
+         return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_OPERATION_CANNOT_HANDLE_MORE_THAN_ONE_PART_IN_INPUT_MESSAGE(arg0));
+@@ -1004,7 +1004,7 @@
+ 
+     /**
+      * ignoring operation "{0}": output message is empty
+-     * 
++     *
+      */
+     public static String WSDLMODELER_WARNING_IGNORING_OPERATION_CANNOT_HANDLE_EMPTY_OUTPUT_MESSAGE(Object arg0) {
+         return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_OPERATION_CANNOT_HANDLE_EMPTY_OUTPUT_MESSAGE(arg0));
+@@ -1016,7 +1016,7 @@
+ 
+     /**
+      * R2716/R2726 WSI-BasicProfile ver. 1.0, namespace attribute not allowed in doc/lit or rpc/lit for {0}: "{1}"
+-     * 
++     *
+      */
+     public static String WSDLMODELER_WARNING_R_2716_R_2726(Object arg0, Object arg1) {
+         return localizer.localize(localizableWSDLMODELER_WARNING_R_2716_R_2726(arg0, arg1));
+@@ -1027,8 +1027,8 @@
+     }
+ 
+     /**
+-     * port "{0}" is not a SOAP port, it has no soap:address 
+-     * 
++     * port "{0}" is not a SOAP port, it has no soap:address
++     *
+      */
+     public static String WSDLMODELER_WARNING_NO_SOAP_ADDRESS(Object arg0) {
+         return localizer.localize(localizableWSDLMODELER_WARNING_NO_SOAP_ADDRESS(arg0));
+@@ -1040,7 +1040,7 @@
+ 
+     /**
+      * ignoring faults declared by operation "{0}"
+-     * 
++     *
+      */
+     public static String WSDLMODELER_WARNING_IGNORING_FAULTS(Object arg0) {
+         return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_FAULTS(arg0));
+@@ -1052,7 +1052,7 @@
+ 
+     /**
+      * fault "{0}" in operation "{1}" must specify a value for the "name" attribute
+-     * 
++     *
+      */
+     public static String WSDLMODELER_INVALID_BINDING_FAULT_MISSING_NAME(Object arg0, Object arg1) {
+         return localizer.localize(localizableWSDLMODELER_INVALID_BINDING_FAULT_MISSING_NAME(arg0, arg1));
+@@ -1064,7 +1064,7 @@
+ 
+     /**
+      * Headers not in root mime:part with soap:body, ignoring headers in operation "{0}"
+-     * 
++     *
+      */
+     public static String MIMEMODELER_WARNING_IGNORINGINVALID_HEADER_PART_NOT_DECLARED_IN_ROOT_PART(Object arg0) {
+         return localizer.localize(localizableMIMEMODELER_WARNING_IGNORINGINVALID_HEADER_PART_NOT_DECLARED_IN_ROOT_PART(arg0));
+@@ -1076,7 +1076,7 @@
+ 
+     /**
+      * Couldn't find class "{0}" for mime type "{1}"
+-     * 
++     *
+      */
+     public static String MIMEMODELER_INVALID_MIME_CONTENT_ERROR_LOADING_JAVA_CLASS() {
+         return localizer.localize(localizableMIMEMODELER_INVALID_MIME_CONTENT_ERROR_LOADING_JAVA_CLASS());
+@@ -1088,7 +1088,7 @@
+ 
+     /**
+      * in binding "{1}", operation "{0}" does not appear in the corresponding port type
+-     * 
++     *
+      */
+     public static String WSDLMODELER_INVALID_BINDING_OPERATION_NOT_IN_PORT_TYPE(Object arg0, Object arg1) {
+         return localizer.localize(localizableWSDLMODELER_INVALID_BINDING_OPERATION_NOT_IN_PORT_TYPE(arg0, arg1));
+@@ -1100,7 +1100,7 @@
+ 
+     /**
+      * ignoring operation "{0}": binding style and operation style are conflicting
+-     * 
++     *
+      */
+     public static String WSDLMODELER_WARNING_IGNORING_OPERATION_CONFLICT_STYLE_IN_WSI_MODE(Object arg0) {
+         return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_OPERATION_CONFLICT_STYLE_IN_WSI_MODE(arg0));
+@@ -1112,7 +1112,7 @@
+ 
+     /**
+      * Ignoring operation "{0}", missing part attribute in mime:content. part attribute must be present in mime:content declaration.
+-     * 
++     *
+      */
+     public static String MIMEMODELER_INVALID_MIME_CONTENT_MISSING_PART_ATTRIBUTE(Object arg0) {
+         return localizer.localize(localizableMIMEMODELER_INVALID_MIME_CONTENT_MISSING_PART_ATTRIBUTE(arg0));
+@@ -1124,7 +1124,7 @@
+ 
+     /**
+      * encountered {0} unrecognized type(s)
+-     * 
++     *
+      */
+     public static String WSDLMODELER_WARNING_SEARCH_SCHEMA_UNRECOGNIZED_TYPES(Object arg0) {
+         return localizer.localize(localizableWSDLMODELER_WARNING_SEARCH_SCHEMA_UNRECOGNIZED_TYPES(arg0));
+@@ -1136,7 +1136,7 @@
+ 
+     /**
+      * Invalid operation "{0}", can''t generate java method ,customized name "{1}" of the wsdl:operation is a java keyword.
+-     * 
++     *
+      */
+     public static String WSDLMODELER_INVALID_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_CUSTOMIZED_OPERATION_NAME(Object arg0, Object arg1) {
+         return localizer.localize(localizableWSDLMODELER_INVALID_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_CUSTOMIZED_OPERATION_NAME(arg0, arg1));
+@@ -1148,7 +1148,7 @@
+ 
+     /**
+      * header "{0}" of binding operation "{1}": cannot resolve message
+-     * 
++     *
+      */
+     public static String WSDLMODELER_INVALID_HEADER_CANT_RESOLVE_MESSAGE(Object arg0, Object arg1) {
+         return localizer.localize(localizableWSDLMODELER_INVALID_HEADER_CANT_RESOLVE_MESSAGE(arg0, arg1));
+@@ -1160,7 +1160,7 @@
+ 
+     /**
+      * fault "{0}" in operation "{1}" must specify a value for the "namespace" attribute
+-     * 
++     *
+      */
+     public static String WSDLMODELER_INVALID_BINDING_FAULT_MISSING_NAMESPACE(Object arg0, Object arg1) {
+         return localizer.localize(localizableWSDLMODELER_INVALID_BINDING_FAULT_MISSING_NAMESPACE(arg0, arg1));
+@@ -1172,7 +1172,7 @@
+ 
+     /**
+      * Ignoring operation "{0}". The Multipart/Related structure has invalid root part: more than one soap:body parts found
+-     * 
++     *
+      */
+     public static String MIMEMODELER_INVALID_MIME_PART_MORE_THAN_ONE_SOAP_BODY(Object arg0) {
+         return localizer.localize(localizableMIMEMODELER_INVALID_MIME_PART_MORE_THAN_ONE_SOAP_BODY(arg0));
+@@ -1184,7 +1184,7 @@
+ 
+     /**
+      * ignoring header "{0}" of operation "{1}": part not found
+-     * 
++     *
+      */
+     public static String WSDLMODELER_WARNING_IGNORING_HEADER_INCONSISTENT_DEFINITION(Object arg0, Object arg1) {
+         return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_HEADER_INCONSISTENT_DEFINITION(arg0, arg1));
+@@ -1196,7 +1196,7 @@
+ 
+     /**
+      * fault "{0}" in operation "{1}" does not match any fault in the corresponding port type operation
+-     * 
++     *
+      */
+     public static String WSDLMODELER_INVALID_BINDING_FAULT_NOT_FOUND(Object arg0, Object arg1) {
+         return localizer.localize(localizableWSDLMODELER_INVALID_BINDING_FAULT_NOT_FOUND(arg0, arg1));
+@@ -1208,7 +1208,7 @@
+ 
+     /**
+      * Ignoring operation "{0}", can''t generate java method. Parameter,customized name "{1}" is a java keyword.
+-     * 
++     *
+      */
+     public static String WSDLMODELER_WARNING_IGNORING_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_CUSTOM_NAME(Object arg0, Object arg1) {
+         return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_CUSTOM_NAME(arg0, arg1));
+@@ -1220,7 +1220,7 @@
+ 
+     /**
+      * ignoring schema element (unsupported version): {0}
+-     * 
++     *
+      */
+     public static String WSDLMODELER_WARNING_IGNORING_UNRECOGNIZED_SCHEMA_EXTENSION(Object arg0) {
+         return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_UNRECOGNIZED_SCHEMA_EXTENSION(arg0));
+@@ -1232,12 +1232,24 @@
+ 
+     /**
+      * ignoring header fault "{0}", cannot find part "{1}" in binding "{2}"
+-     * 
++     *
+      */
+     public static String WSDLMODELER_WARNING_IGNORING_HEADER_FAULT_NOT_FOUND(Object arg0, Object arg1, Object arg2) {
+         return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_HEADER_FAULT_NOT_FOUND(arg0, arg1, arg2));
+     }
+ 
++    public static Localizable localizableWSDLMODELER_NON_UNIQUE_BODY_WARNING(Object arg0, Object arg1, Object arg2, Object arg3) {
++        return messageFactory.getMessage("wsdlmodeler.nonUnique.body.warning", arg0, arg1, arg2, arg3);
++    }
++
++    /**
++     * Non unique body parts! In a port, as per BP 1.1 R2710 operations must have unique operation signaure on the wire for successful dispatch. In port {0}, Operations "{1}" and "{2}" have the same request body block {3}. Method dispatching may fail, runtime will try to dispatch using SOAPAction
++     *
++     */
++    public static String WSDLMODELER_NON_UNIQUE_BODY_WARNING(Object arg0, Object arg1, Object arg2, Object arg3) {
++        return localizer.localize(localizableWSDLMODELER_NON_UNIQUE_BODY_WARNING(arg0, arg1, arg2, arg3));
++    }
++
+     public static Localizable localizableWSDLMODELER_INVALID_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_WRAPPER_STYLE(Object arg0, Object arg1, Object arg2) {
+         return messageFactory.getMessage("wsdlmodeler.invalid.operation.javaReservedWordNotAllowed.wrapperStyle", arg0, arg1, arg2);
+     }
+@@ -1244,7 +1256,7 @@
+ 
+     /**
+      * Invalid operation "{0}", can''t generate java method parameter. Local name of the wrapper child "{1}" in the global element "{2}" is a java keyword. Use customization to change the parameter name.
+-     * 
++     *
+      */
+     public static String WSDLMODELER_INVALID_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_WRAPPER_STYLE(Object arg0, Object arg1, Object arg2) {
+         return localizer.localize(localizableWSDLMODELER_INVALID_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_WRAPPER_STYLE(arg0, arg1, arg2));
+@@ -1256,7 +1268,7 @@
+ 
+     /**
+      * Unknown schema type: {1} for mime:content part: {0}
+-     * 
++     *
+      */
+     public static String MIMEMODELER_INVALID_MIME_CONTENT_UNKNOWN_SCHEMA_TYPE(Object arg0, Object arg1) {
+         return localizer.localize(localizableMIMEMODELER_INVALID_MIME_CONTENT_UNKNOWN_SCHEMA_TYPE(arg0, arg1));
+@@ -1268,7 +1280,7 @@
+ 
+     /**
+      * R2716 WSI-BasicProfile ver. 1.0, namespace attribute not allowed in doc/lit for {0}: "{1}"
+-     * 
++     *
+      */
+     public static String WSDLMODELER_WARNING_R_2716(Object arg0, Object arg1) {
+         return localizer.localize(localizableWSDLMODELER_WARNING_R_2716(arg0, arg1));
+@@ -1280,7 +1292,7 @@
+ 
+     /**
+      * ignoring header "{0}" of binding operation "{1}": not found
+-     * 
++     *
+      */
+     public static String WSDLMODELER_WARNING_IGNORING_HEADER_NOT_FOUND(Object arg0, Object arg1) {
+         return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_HEADER_NOT_FOUND(arg0, arg1));
+@@ -1292,7 +1304,7 @@
+ 
+     /**
+      * ignoring operation "{0}": message part does not refer to a schema element declaration
+-     * 
++     *
+      */
+     public static String WSDLMODELER_WARNING_IGNORING_OPERATION_CANNOT_HANDLE_TYPE_MESSAGE_PART(Object arg0) {
+         return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_OPERATION_CANNOT_HANDLE_TYPE_MESSAGE_PART(arg0));
+@@ -1304,7 +1316,7 @@
+ 
+     /**
+      * parameterOrder attribute on operation "{0}" is invalid, ignoring parameterOrder hint
+-     * 
++     *
+      */
+     public static String WSDLMODELER_INVALID_PARAMETER_ORDER_INVALID_PARAMETER_ORDER(Object arg0) {
+         return localizer.localize(localizableWSDLMODELER_INVALID_PARAMETER_ORDER_INVALID_PARAMETER_ORDER(arg0));
+@@ -1316,7 +1328,7 @@
+ 
+     /**
+      * binding operation "{0}" must specify a name for its output message
+-     * 
++     *
+      */
+     public static String WSDLMODELER_INVALID_BINDING_OPERATION_MISSING_OUTPUT_NAME(Object arg0) {
+         return localizer.localize(localizableWSDLMODELER_INVALID_BINDING_OPERATION_MISSING_OUTPUT_NAME(arg0));
+@@ -1328,7 +1340,7 @@
+ 
+     /**
+      * invalid operation: {0}
+-     * 
++     *
+      */
+     public static String WSDLMODELER_INVALID_OPERATION(Object arg0) {
+         return localizer.localize(localizableWSDLMODELER_INVALID_OPERATION(arg0));
+@@ -1340,7 +1352,7 @@
+ 
+     /**
+      * output header "{1}" of binding operation "{0}" must specify a value for the "namespace" attribute
+-     * 
++     *
+      */
+     public static String WSDLMODELER_INVALID_BINDING_OPERATION_OUTPUT_HEADER_MISSING_NAMESPACE(Object arg0, Object arg1) {
+         return localizer.localize(localizableWSDLMODELER_INVALID_BINDING_OPERATION_OUTPUT_HEADER_MISSING_NAMESPACE(arg0, arg1));
+@@ -1352,7 +1364,7 @@
+ 
+     /**
+      * header part: "{0}" already bound by soapbind:body, illegal to bind the part twice
+-     * 
++     *
+      */
+     public static String WSDLMODELER_WARNING_IGNORING_HEADER_PART_FROM_BODY(Object arg0) {
+         return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_HEADER_PART_FROM_BODY(arg0));
+@@ -1364,7 +1376,7 @@
+ 
+     /**
+      * Invalid WSDL, wsdl:operation "{0}" in wsdl:portType "{1}": not request-response or one-way
+-     * 
++     *
+      */
+     public static String WSDLMODELER_INVALID_OPERATION_NOT_SUPPORTED_STYLE(Object arg0, Object arg1) {
+         return localizer.localize(localizableWSDLMODELER_INVALID_OPERATION_NOT_SUPPORTED_STYLE(arg0, arg1));
+@@ -1376,7 +1388,7 @@
+ 
+     /**
+      * Ignoring operation "{0}", it has illegal character ''{1}'' in its name. Its rpc-literal operation - jaxws won't be able to serialize it!
+-     * 
++     *
+      */
+     public static String WSDLMODELER_WARNING_IGNORING_OPERATION_NOT_NC_NAME(Object arg0, Object arg1) {
+         return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_OPERATION_NOT_NC_NAME(arg0, arg1));
+@@ -1388,7 +1400,7 @@
+ 
+     /**
+      * parameter "{0}" of operation "{1}" appears with different types in the input and output messages
+-     * 
++     *
+      */
+     public static String WSDLMODELER_INVALID_PARAMETER_DIFFERENT_TYPES(Object arg0, Object arg1) {
+         return localizer.localize(localizableWSDLMODELER_INVALID_PARAMETER_DIFFERENT_TYPES(arg0, arg1));
+@@ -1400,7 +1412,7 @@
+ 
+     /**
+      * ignoring fault "{0}" of document-style operation "{1}"
+-     * 
++     *
+      */
+     public static String WSDLMODELER_WARNING_IGNORING_FAULT_DOCUMENT_OPERATION(Object arg0, Object arg1) {
+         return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_FAULT_DOCUMENT_OPERATION(arg0, arg1));
+@@ -1412,7 +1424,7 @@
+ 
+     /**
+      * Processing WS-I non conforming operation "{0}" with RPC-Style and SOAP-encoded
+-     * 
++     *
+      */
+     public static String WSDLMODELER_WARNING_NONCONFORMING_WSDL_USE(Object arg0) {
+         return localizer.localize(localizableWSDLMODELER_WARNING_NONCONFORMING_WSDL_USE(arg0));
+@@ -1423,8 +1435,8 @@
+     }
+ 
+     /**
+-     * port "{0}": not a standard SOAP port. The generated artifacts may not work with JAXWS runtime. 
+-     * 
++     * port "{0}": not a standard SOAP port. The generated artifacts may not work with JAXWS runtime.
++     *
+      */
+     public static String WSDLMODELER_WARNING_NON_SOAP_PORT(Object arg0) {
+         return localizer.localize(localizableWSDLMODELER_WARNING_NON_SOAP_PORT(arg0));
+@@ -1436,7 +1448,7 @@
+ 
+     /**
+      * Invalid headerfault "{0}" for header {1} in operation {2}: part must specify a "element" attribute
+-     * 
++     *
+      */
+     public static String WSDLMODELER_INVALID_HEADERFAULT_MESSAGE_PART_MUST_HAVE_ELEMENT_DESCRIPTOR(Object arg0, Object arg1, Object arg2) {
+         return localizer.localize(localizableWSDLMODELER_INVALID_HEADERFAULT_MESSAGE_PART_MUST_HAVE_ELEMENT_DESCRIPTOR(arg0, arg1, arg2));
+@@ -1448,7 +1460,7 @@
+ 
+     /**
+      * invalid state while modeling operation: {0}
+-     * 
++     *
+      */
+     public static String WSDLMODELER_INVALID_STATE_MODELING_OPERATION(Object arg0) {
+         return localizer.localize(localizableWSDLMODELER_INVALID_STATE_MODELING_OPERATION(arg0));
+@@ -1460,7 +1472,7 @@
+ 
+     /**
+      * Ignoring operation "{0}", it''s java reserved word, can''t generate java method. Use customization to change the operation name.
+-     * 
++     *
+      */
+     public static String WSDLMODELER_WARNING_IGNORING_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_OPERATION_NAME(Object arg0) {
+         return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_OPERATION_NAME(arg0));
+@@ -1472,7 +1484,7 @@
+ 
+     /**
+      * ignoring header "{0}" of binding operation "{1}": not SOAP-encoded
+-     * 
++     *
+      */
+     public static String WSDLMODELER_WARNING_IGNORING_HEADER_NOT_ENCODED(Object arg0, Object arg1) {
+         return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_HEADER_NOT_ENCODED(arg0, arg1));
+@@ -1484,7 +1496,7 @@
+ 
+     /**
+      * ignoring fault "{0}" of operation "{1}", part name "{2}" is not unique
+-     * 
++     *
+      */
+     public static String WSDLMODELER_DUPLICATE_FAULT_PART_NAME(Object arg0, Object arg1, Object arg2) {
+         return localizer.localize(localizableWSDLMODELER_DUPLICATE_FAULT_PART_NAME(arg0, arg1, arg2));
+@@ -1496,7 +1508,7 @@
+ 
+     /**
+      * operation "{0}": more than one part bound to body
+-     * 
++     *
+      */
+     public static String WSDLMODELER_INVALID_OPERATION_MORE_THAN_ONE_PART_IN_MESSAGE(Object arg0) {
+         return localizer.localize(localizableWSDLMODELER_INVALID_OPERATION_MORE_THAN_ONE_PART_IN_MESSAGE(arg0));
+@@ -1509,7 +1521,7 @@
+     /**
+      * Ignoring SOAP port "{0}": it uses non-standard SOAP 1.2 binding.
+      * You must specify the "-extension" option to use this binding.
+-     * 
++     *
+      */
+     public static String WSDLMODELER_WARNING_IGNORING_SOAP_BINDING_12(Object arg0) {
+         return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_SOAP_BINDING_12(arg0));
+@@ -1521,7 +1533,7 @@
+ 
+     /**
+      * fault "{0}" in operation "{1}" matches more than one fault in the corresponding port type operation
+-     * 
++     *
+      */
+     public static String WSDLMODELER_INVALID_BINDING_FAULT_NOT_UNIQUE(Object arg0, Object arg1) {
+         return localizer.localize(localizableWSDLMODELER_INVALID_BINDING_FAULT_NOT_UNIQUE(arg0, arg1));
+@@ -1533,7 +1545,7 @@
+ 
+     /**
+      * output message of binding operation "{0}" does not have a SOAP body extension
+-     * 
++     *
+      */
+     public static String WSDLMODELER_INVALID_BINDING_OPERATION_OUTPUT_MISSING_SOAP_BODY(Object arg0) {
+         return localizer.localize(localizableWSDLMODELER_INVALID_BINDING_OPERATION_OUTPUT_MISSING_SOAP_BODY(arg0));
+@@ -1545,7 +1557,7 @@
+ 
+     /**
+      * ignoring header fault part="{0}" message="{1}" of operation {2}, use attribute MUST be "literal"
+-     * 
++     *
+      */
+     public static String WSDLMODELER_WARNING_IGNORING_HEADER_FAULT_NOT_LITERAL(Object arg0, Object arg1, Object arg2) {
+         return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_HEADER_FAULT_NOT_LITERAL(arg0, arg1, arg2));
+@@ -1557,7 +1569,7 @@
+ 
+     /**
+      * ignoring operation "{0}": more than one part in output message
+-     * 
++     *
+      */
+     public static String WSDLMODELER_WARNING_IGNORING_OPERATION_CANNOT_HANDLE_MORE_THAN_ONE_PART_IN_OUTPUT_MESSAGE(Object arg0) {
+         return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_OPERATION_CANNOT_HANDLE_MORE_THAN_ONE_PART_IN_OUTPUT_MESSAGE(arg0));
+@@ -1569,7 +1581,7 @@
+ 
+     /**
+      * Port "{0}" does not contain any usable operations
+-     * 
++     *
+      */
+     public static String WSDLMODELER_WARNING_NO_OPERATIONS_IN_PORT(Object arg0) {
+         return localizer.localize(localizableWSDLMODELER_WARNING_NO_OPERATIONS_IN_PORT(arg0));
+@@ -1581,7 +1593,7 @@
+ 
+     /**
+      * Ignoring operation "{0}", can''t generate java method parameter. Local name of the wrapper child "{1}" in the global element "{2}" is a java keyword. Use customization to change the parameter name.
+-     * 
++     *
+      */
+     public static String WSDLMODELER_WARNING_IGNORING_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_WRAPPER_STYLE(Object arg0, Object arg1, Object arg2) {
+         return localizer.localize(localizableWSDLMODELER_WARNING_IGNORING_OPERATION_JAVA_RESERVED_WORD_NOT_ALLOWED_WRAPPER_STYLE(arg0, arg1, arg2));
+@@ -1593,7 +1605,7 @@
+ 
+     /**
+      * the following naming conflicts occurred: {0}
+-     * 
++     *
+      */
+     public static String WSDLMODELER_UNSOLVABLE_NAMING_CONFLICTS(Object arg0) {
+         return localizer.localize(localizableWSDLMODELER_UNSOLVABLE_NAMING_CONFLICTS(arg0));
+--- old/src/share/classes/com/sun/tools/internal/ws/resources/ProcessorMessages.java	Thu Jul 30 17:17:36 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/ProcessorMessages.java	Thu Jul 30 17:17:36 2009
+@@ -31,7 +31,7 @@
+ 
+ /**
+  * Defines string formatting method for each constant in the resource file
+- * 
++ *
+  */
+ public final class ProcessorMessages {
+ 
+@@ -44,7 +44,7 @@
+ 
+     /**
+      * model is missing
+-     * 
++     *
+      */
+     public static String PROCESSOR_MISSING_MODEL() {
+         return localizer.localize(localizablePROCESSOR_MISSING_MODEL());
+--- old/src/share/classes/com/sun/tools/internal/ws/resources/UtilMessages.java	Thu Jul 30 17:17:40 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/UtilMessages.java	Thu Jul 30 17:17:39 2009
+@@ -31,7 +31,7 @@
+ 
+ /**
+  * Defines string formatting method for each constant in the resource file
+- * 
++ *
+  */
+ public final class UtilMessages {
+ 
+@@ -44,7 +44,7 @@
+ 
+     /**
+      * SAX2DOMEx.DomImplDoesntSupportCreateElementNs: {0}
+-     * 
++     *
+      */
+     public static String SAX_2_DOM_NOTSUPPORTED_CREATEELEMENT(Object arg0) {
+         return localizer.localize(localizableSAX_2_DOM_NOTSUPPORTED_CREATEELEMENT(arg0));
+@@ -56,7 +56,7 @@
+ 
+     /**
+      * Encountered error in wsdl. Check namespace of element <{0}>
+-     * 
++     *
+      */
+     public static String NULL_NAMESPACE_FOUND(Object arg0) {
+         return localizer.localize(localizableNULL_NAMESPACE_FOUND(arg0));
+@@ -68,7 +68,7 @@
+ 
+     /**
+      * Could not find the field in the Holder that contains the Holder''s value: {0}
+-     * 
++     *
+      */
+     public static String HOLDER_VALUEFIELD_NOT_FOUND(Object arg0) {
+         return localizer.localize(localizableHOLDER_VALUEFIELD_NOT_FOUND(arg0));
+--- old/src/share/classes/com/sun/tools/internal/ws/resources/WebserviceapMessages.java	Thu Jul 30 17:17:43 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/WebserviceapMessages.java	Thu Jul 30 17:17:43 2009
+@@ -31,7 +31,7 @@
+ 
+ /**
+  * Defines string formatting method for each constant in the resource file
+- * 
++ *
+  */
+ public final class WebserviceapMessages {
+ 
+@@ -38,184 +38,184 @@
+     private final static LocalizableMessageFactory messageFactory = new LocalizableMessageFactory("com.sun.tools.internal.ws.resources.webserviceap");
+     private final static Localizer localizer = new Localizer();
+ 
+-    public static Localizable localizableWEBSERVICEAP_RPC_LITERAL_MUST_NOT_BE_BARE(Object arg0) {
+-        return messageFactory.getMessage("webserviceap.rpc.literal.must.not.be.bare", arg0);
++    public static Localizable localizableWEBSERVICEAP_ENDPOINTINTERFACES_DO_NOT_MATCH(Object arg0, Object arg1) {
++        return messageFactory.getMessage("webserviceap.endpointinterfaces.do.not.match", arg0, arg1);
+     }
+ 
+     /**
+-     * RPC literal SOAPBindings must have parameterStyle WRAPPPED. Class: {0}.
+-     * 
++     * The endpoint interface {0} does not match the interface {1}.
++     *
+      */
+-    public static String WEBSERVICEAP_RPC_LITERAL_MUST_NOT_BE_BARE(Object arg0) {
+-        return localizer.localize(localizableWEBSERVICEAP_RPC_LITERAL_MUST_NOT_BE_BARE(arg0));
++    public static String WEBSERVICEAP_ENDPOINTINTERFACES_DO_NOT_MATCH(Object arg0, Object arg1) {
++        return localizer.localize(localizableWEBSERVICEAP_ENDPOINTINTERFACES_DO_NOT_MATCH(arg0, arg1));
+     }
+ 
+-    public static Localizable localizableWEBSERVICEAP_INVALID_SEI_ANNOTATION_ELEMENT_EXCLUDE(Object arg0, Object arg1, Object arg2) {
+-        return messageFactory.getMessage("webserviceap.invalid.sei.annotation.element.exclude", arg0, arg1, arg2);
++    public static Localizable localizableWEBSERVICEAP_INVALID_WEBMETHOD_ELEMENT_WITH_EXCLUDE(Object arg0, Object arg1, Object arg2) {
++        return messageFactory.getMessage("webserviceap.invalid.webmethod.element.with.exclude", arg0, arg1, arg2);
+     }
+ 
+     /**
+-     * The @javax.jws.WebMethod({0}) cannot be used on a service endpoint interface. Class: {1} method: {2}
+-     * 
++     * The @javax.jws.WebMethod.{0} element cannot be specified with the @javax.jws.WebMethod.exclude element. Class: {1} method: {2}
++     *
+      */
+-    public static String WEBSERVICEAP_INVALID_SEI_ANNOTATION_ELEMENT_EXCLUDE(Object arg0, Object arg1, Object arg2) {
+-        return localizer.localize(localizableWEBSERVICEAP_INVALID_SEI_ANNOTATION_ELEMENT_EXCLUDE(arg0, arg1, arg2));
++    public static String WEBSERVICEAP_INVALID_WEBMETHOD_ELEMENT_WITH_EXCLUDE(Object arg0, Object arg1, Object arg2) {
++        return localizer.localize(localizableWEBSERVICEAP_INVALID_WEBMETHOD_ELEMENT_WITH_EXCLUDE(arg0, arg1, arg2));
+     }
+ 
+-    public static Localizable localizableWEBSERVICEAP_WEBSERVICE_CLASS_IS_INNERCLASS_NOT_STATIC(Object arg0) {
+-        return messageFactory.getMessage("webserviceap.webservice.class.is.innerclass.not.static", arg0);
++    public static Localizable localizableWEBSERVICEAP_SEI_CANNOT_CONTAIN_CONSTANT_VALUES(Object arg0, Object arg1) {
++        return messageFactory.getMessage("webserviceap.sei.cannot.contain.constant.values", arg0, arg1);
+     }
+ 
+     /**
+-     * Inner classes annotated with @javax.jws.WebService must be static. Class: {0}
+-     * 
++     * An service endpoint interface cannot contain constant declaration: Interface: {0} field: {1}.
++     *
+      */
+-    public static String WEBSERVICEAP_WEBSERVICE_CLASS_IS_INNERCLASS_NOT_STATIC(Object arg0) {
+-        return localizer.localize(localizableWEBSERVICEAP_WEBSERVICE_CLASS_IS_INNERCLASS_NOT_STATIC(arg0));
++    public static String WEBSERVICEAP_SEI_CANNOT_CONTAIN_CONSTANT_VALUES(Object arg0, Object arg1) {
++        return localizer.localize(localizableWEBSERVICEAP_SEI_CANNOT_CONTAIN_CONSTANT_VALUES(arg0, arg1));
+     }
+ 
+-    public static Localizable localizableWEBSERVICEAP_WEBSERVICE_METHOD_IS_ABSTRACT(Object arg0, Object arg1) {
+-        return messageFactory.getMessage("webserviceap.webservice.method.is.abstract", arg0, arg1);
++    public static Localizable localizableWEBSERVICEAP_RPC_LITERAL_PARAMETERS_MUST_HAVE_WEBPARAM(Object arg0, Object arg1, Object arg2) {
++        return messageFactory.getMessage("webserviceap.rpc.literal.parameters.must.have.webparam", arg0, arg1, arg2);
+     }
+ 
+     /**
+-     * Classes annotated with @javax.jws.WebService must not have abstract methods. Class: {0} Method: {1}
+-     * 
++     * All rpc literal parameters must have a WebParam annotation.  Class: {0} method: {1} parameter {2}
++     *
+      */
+-    public static String WEBSERVICEAP_WEBSERVICE_METHOD_IS_ABSTRACT(Object arg0, Object arg1) {
+-        return localizer.localize(localizableWEBSERVICEAP_WEBSERVICE_METHOD_IS_ABSTRACT(arg0, arg1));
++    public static String WEBSERVICEAP_RPC_LITERAL_PARAMETERS_MUST_HAVE_WEBPARAM(Object arg0, Object arg1, Object arg2) {
++        return localizer.localize(localizableWEBSERVICEAP_RPC_LITERAL_PARAMETERS_MUST_HAVE_WEBPARAM(arg0, arg1, arg2));
+     }
+ 
+-    public static Localizable localizableWEBSERVICEAP_ONEWAY_OPERATION_CANNOT_HAVE_RETURN_TYPE(Object arg0, Object arg1) {
+-        return messageFactory.getMessage("webserviceap.oneway.operation.cannot.have.return.type", arg0, arg1);
++    public static Localizable localizableWEBSERVICEAP_METHOD_EXCEPTION_BEAN_NAME_NOT_UNIQUE(Object arg0, Object arg1) {
++        return messageFactory.getMessage("webserviceap.method.exception.bean.name.not.unique", arg0, arg1);
+     }
+ 
+     /**
+-     * The method {1} of class {0} is annotated @Oneway but has a return type.
+-     * 
++     * Exception bean names must be unique and must not clash with other generated classes.  Class: {0} exception {1}
++     *
+      */
+-    public static String WEBSERVICEAP_ONEWAY_OPERATION_CANNOT_HAVE_RETURN_TYPE(Object arg0, Object arg1) {
+-        return localizer.localize(localizableWEBSERVICEAP_ONEWAY_OPERATION_CANNOT_HAVE_RETURN_TYPE(arg0, arg1));
++    public static String WEBSERVICEAP_METHOD_EXCEPTION_BEAN_NAME_NOT_UNIQUE(Object arg0, Object arg1) {
++        return localizer.localize(localizableWEBSERVICEAP_METHOD_EXCEPTION_BEAN_NAME_NOT_UNIQUE(arg0, arg1));
+     }
+ 
+-    public static Localizable localizableWEBSERVICEAP_WARNING(Object arg0) {
+-        return messageFactory.getMessage("webserviceap.warning", arg0);
++    public static Localizable localizableWEBSERVICEAP_WEBSERVICE_AND_WEBSERVICEPROVIDER(Object arg0) {
++        return messageFactory.getMessage("webserviceap.webservice.and.webserviceprovider", arg0);
+     }
+ 
+     /**
+-     * warning: {0}
+-     * 
++     * Classes cannot be annotated with both @javax.jws.WebService and @javax.xml.ws.WebServiceProvider.  Class: {0}
++     *
+      */
+-    public static String WEBSERVICEAP_WARNING(Object arg0) {
+-        return localizer.localize(localizableWEBSERVICEAP_WARNING(arg0));
++    public static String WEBSERVICEAP_WEBSERVICE_AND_WEBSERVICEPROVIDER(Object arg0) {
++        return localizer.localize(localizableWEBSERVICEAP_WEBSERVICE_AND_WEBSERVICEPROVIDER(arg0));
+     }
+ 
+-    public static Localizable localizableWEBSERVICEAP_RPC_SOAPBINDING_NOT_ALLOWED_ON_METHOD(Object arg0, Object arg1) {
+-        return messageFactory.getMessage("webserviceap.rpc.soapbinding.not.allowed.on.method", arg0, arg1);
++    public static Localizable localizableWEBSERVICEAP_WEBSERVICE_NO_DEFAULT_CONSTRUCTOR(Object arg0) {
++        return messageFactory.getMessage("webserviceap.webservice.no.default.constructor", arg0);
+     }
+ 
+     /**
+-     * SOAPBinding.Style.RPC binding annotations are not allowed on methods.  Class: {0} Method: {1}
+-     * 
++     * Classes annotated with @javax.jws.WebService must have a public default constructor. Class: {0}
++     *
+      */
+-    public static String WEBSERVICEAP_RPC_SOAPBINDING_NOT_ALLOWED_ON_METHOD(Object arg0, Object arg1) {
+-        return localizer.localize(localizableWEBSERVICEAP_RPC_SOAPBINDING_NOT_ALLOWED_ON_METHOD(arg0, arg1));
++    public static String WEBSERVICEAP_WEBSERVICE_NO_DEFAULT_CONSTRUCTOR(Object arg0) {
++        return localizer.localize(localizableWEBSERVICEAP_WEBSERVICE_NO_DEFAULT_CONSTRUCTOR(arg0));
+     }
+ 
+-    public static Localizable localizableWEBSERVICEAP_COULD_NOT_FIND_HANDLERCHAIN(Object arg0, Object arg1) {
+-        return messageFactory.getMessage("webserviceap.could.not.find.handlerchain", arg0, arg1);
++    public static Localizable localizableWEBSERVICEAP_DOC_BARE_NO_OUT(Object arg0, Object arg1) {
++        return messageFactory.getMessage("webserviceap.doc.bare.no.out", arg0, arg1);
+     }
+ 
+     /**
+-     * Could not find the handlerchain {0} in the handler file {1}
+-     * 
++     * Document/literal bare methods with no return type or OUT/INOUT parameters must be annotated as @Oneway. Class: {0}, method: {1}
++     *
+      */
+-    public static String WEBSERVICEAP_COULD_NOT_FIND_HANDLERCHAIN(Object arg0, Object arg1) {
+-        return localizer.localize(localizableWEBSERVICEAP_COULD_NOT_FIND_HANDLERCHAIN(arg0, arg1));
++    public static String WEBSERVICEAP_DOC_BARE_NO_OUT(Object arg0, Object arg1) {
++        return localizer.localize(localizableWEBSERVICEAP_DOC_BARE_NO_OUT(arg0, arg1));
+     }
+ 
+-    public static Localizable localizableWEBSERVICEAP_NO_PACKAGE_CLASS_MUST_HAVE_TARGETNAMESPACE(Object arg0) {
+-        return messageFactory.getMessage("webserviceap.no.package.class.must.have.targetnamespace", arg0);
++    public static Localizable localizableWEBSERVICEAP_FAILED_TO_PARSE_HANDLERCHAIN_FILE(Object arg0, Object arg1) {
++        return messageFactory.getMessage("webserviceap.failed.to.parse.handlerchain.file", arg0, arg1);
+     }
+ 
+     /**
+-     * @javax.jws.Webservice annotated classes that do not belong to a package must have the @javax.jws.Webservice.targetNamespace element.  Class: {0}
+-     * 
++     * Failed to parse HandlerChain file. Class: {0}, file: {1}
++     *
+      */
+-    public static String WEBSERVICEAP_NO_PACKAGE_CLASS_MUST_HAVE_TARGETNAMESPACE(Object arg0) {
+-        return localizer.localize(localizableWEBSERVICEAP_NO_PACKAGE_CLASS_MUST_HAVE_TARGETNAMESPACE(arg0));
++    public static String WEBSERVICEAP_FAILED_TO_PARSE_HANDLERCHAIN_FILE(Object arg0, Object arg1) {
++        return localizer.localize(localizableWEBSERVICEAP_FAILED_TO_PARSE_HANDLERCHAIN_FILE(arg0, arg1));
+     }
+ 
+-    public static Localizable localizableWEBSERVICEAP_CLASS_NOT_FOUND(Object arg0) {
+-        return messageFactory.getMessage("webserviceap.class.not.found", arg0);
++    public static Localizable localizableWEBSERVICEAP_JAVA_TYPE_NOT_FOUND(Object arg0) {
++        return messageFactory.getMessage("webserviceap.java.typeNotFound", arg0);
+     }
+ 
+     /**
+-     * Class Not Found: {0}
+-     * 
++     * The type: {0} was not found in the mapping
++     *
+      */
+-    public static String WEBSERVICEAP_CLASS_NOT_FOUND(Object arg0) {
+-        return localizer.localize(localizableWEBSERVICEAP_CLASS_NOT_FOUND(arg0));
++    public static String WEBSERVICEAP_JAVA_TYPE_NOT_FOUND(Object arg0) {
++        return localizer.localize(localizableWEBSERVICEAP_JAVA_TYPE_NOT_FOUND(arg0));
+     }
+ 
+-    public static Localizable localizableWEBSERVICEAP_DOC_BARE_NO_RETURN_AND_NO_OUT(Object arg0, Object arg1) {
+-        return messageFactory.getMessage("webserviceap.doc.bare.no.return.and.no.out", arg0, arg1);
++    public static Localizable localizableWEBSERVICEAP_ONEWAY_OPERATION_CANNOT_DECLARE_EXCEPTIONS(Object arg0, Object arg1, Object arg2) {
++        return messageFactory.getMessage("webserviceap.oneway.operation.cannot.declare.exceptions", arg0, arg1, arg2);
+     }
+ 
+     /**
+-     * Document literal bare methods that do not have a return value must have a single OUT/INOUT parameter.  Class: {0} Method: {1} 
+-     * 
++     * The method {1} of class {0} is annotated @Oneway but declares the exception {2}
++     *
+      */
+-    public static String WEBSERVICEAP_DOC_BARE_NO_RETURN_AND_NO_OUT(Object arg0, Object arg1) {
+-        return localizer.localize(localizableWEBSERVICEAP_DOC_BARE_NO_RETURN_AND_NO_OUT(arg0, arg1));
++    public static String WEBSERVICEAP_ONEWAY_OPERATION_CANNOT_DECLARE_EXCEPTIONS(Object arg0, Object arg1, Object arg2) {
++        return localizer.localize(localizableWEBSERVICEAP_ONEWAY_OPERATION_CANNOT_DECLARE_EXCEPTIONS(arg0, arg1, arg2));
+     }
+ 
+-    public static Localizable localizableWEBSERVICEAP_DOCUMENT_LITERAL_BARE_METHOD_RETURN_NOT_UNIQUE(Object arg0, Object arg1, Object arg2, Object arg3) {
+-        return messageFactory.getMessage("webserviceap.document.literal.bare.method.return.not.unique", arg0, arg1, arg2, arg3);
++    public static Localizable localizableWEBSERVICEAP_WEBSERVICE_METHOD_IS_STATIC_OR_FINAL(Object arg0, Object arg1) {
++        return messageFactory.getMessage("webserviceap.webservice.method.is.static.or.final", arg0, arg1);
+     }
+ 
+     /**
+-     * Document literal bare methods must have a unique result name return type combination.  Class {0} method: {1}, result name: {2} return type: {3}
+-     * 
++     * Method annotated with @javax.jws.WebMethod must not be static or final. Class: {0} Method: {1}
++     *
+      */
+-    public static String WEBSERVICEAP_DOCUMENT_LITERAL_BARE_METHOD_RETURN_NOT_UNIQUE(Object arg0, Object arg1, Object arg2, Object arg3) {
+-        return localizer.localize(localizableWEBSERVICEAP_DOCUMENT_LITERAL_BARE_METHOD_RETURN_NOT_UNIQUE(arg0, arg1, arg2, arg3));
++    public static String WEBSERVICEAP_WEBSERVICE_METHOD_IS_STATIC_OR_FINAL(Object arg0, Object arg1) {
++        return localizer.localize(localizableWEBSERVICEAP_WEBSERVICE_METHOD_IS_STATIC_OR_FINAL(arg0, arg1));
+     }
+ 
+-    public static Localizable localizableWEBSERVICEAP_DOC_BARE_NO_OUT(Object arg0, Object arg1) {
+-        return messageFactory.getMessage("webserviceap.doc.bare.no.out", arg0, arg1);
++    public static Localizable localizableWEBSERVICEAP_ONEWAY_OPERATION_CANNOT_HAVE_RETURN_TYPE(Object arg0, Object arg1) {
++        return messageFactory.getMessage("webserviceap.oneway.operation.cannot.have.return.type", arg0, arg1);
+     }
+ 
+     /**
+-     * Document/literal bare methods with no return type or OUT/INOUT parameters must be annotated as @Oneway. Class: {0}, method: {1}
+-     * 
++     * The method {1} of class {0} is annotated @Oneway but has a return type.
++     *
+      */
+-    public static String WEBSERVICEAP_DOC_BARE_NO_OUT(Object arg0, Object arg1) {
+-        return localizer.localize(localizableWEBSERVICEAP_DOC_BARE_NO_OUT(arg0, arg1));
++    public static String WEBSERVICEAP_ONEWAY_OPERATION_CANNOT_HAVE_RETURN_TYPE(Object arg0, Object arg1) {
++        return localizer.localize(localizableWEBSERVICEAP_ONEWAY_OPERATION_CANNOT_HAVE_RETURN_TYPE(arg0, arg1));
+     }
+ 
+-    public static Localizable localizableWEBSERVICEAP_RPC_LITERAL_PARAMETERS_MUST_HAVE_WEBPARAM(Object arg0, Object arg1, Object arg2) {
+-        return messageFactory.getMessage("webserviceap.rpc.literal.parameters.must.have.webparam", arg0, arg1, arg2);
++    public static Localizable localizableWEBSERVICEAP_WARNING(Object arg0) {
++        return messageFactory.getMessage("webserviceap.warning", arg0);
+     }
+ 
+     /**
+-     * All rpc literal parameters must have a WebParam annotation.  Class: {0} method: {1} parameter {2}
+-     * 
++     * warning: {0}
++     *
+      */
+-    public static String WEBSERVICEAP_RPC_LITERAL_PARAMETERS_MUST_HAVE_WEBPARAM(Object arg0, Object arg1, Object arg2) {
+-        return localizer.localize(localizableWEBSERVICEAP_RPC_LITERAL_PARAMETERS_MUST_HAVE_WEBPARAM(arg0, arg1, arg2));
++    public static String WEBSERVICEAP_WARNING(Object arg0) {
++        return localizer.localize(localizableWEBSERVICEAP_WARNING(arg0));
+     }
+ 
+-    public static Localizable localizableWEBSERVICEAP_MODEL_ALREADY_EXISTS() {
+-        return messageFactory.getMessage("webserviceap.model.already.exists");
++    public static Localizable localizableWEBSERVICEAP_METHOD_RESPONSE_WRAPPER_BEAN_NAME_NOT_UNIQUE(Object arg0, Object arg1) {
++        return messageFactory.getMessage("webserviceap.method.response.wrapper.bean.name.not.unique", arg0, arg1);
+     }
+ 
+     /**
+-     * model already exists
+-     * 
++     * Response wrapper bean names must be unique and must not clash with other generated classes.  Class: {0} method {1}
++     *
+      */
+-    public static String WEBSERVICEAP_MODEL_ALREADY_EXISTS() {
+-        return localizer.localize(localizableWEBSERVICEAP_MODEL_ALREADY_EXISTS());
++    public static String WEBSERVICEAP_METHOD_RESPONSE_WRAPPER_BEAN_NAME_NOT_UNIQUE(Object arg0, Object arg1) {
++        return localizer.localize(localizableWEBSERVICEAP_METHOD_RESPONSE_WRAPPER_BEAN_NAME_NOT_UNIQUE(arg0, arg1));
+     }
+ 
+     public static Localizable localizableWEBSERVICEAP_ENDPOINTINTERFACE_ON_INTERFACE(Object arg0, Object arg1) {
+@@ -224,382 +224,382 @@
+ 
+     /**
+      * Service endpointpoint interface: {0} has cannot have a WebService.endpointInterface annotation: {1}
+-     * 
++     *
+      */
+     public static String WEBSERVICEAP_ENDPOINTINTERFACE_ON_INTERFACE(Object arg0, Object arg1) {
+         return localizer.localize(localizableWEBSERVICEAP_ENDPOINTINTERFACE_ON_INTERFACE(arg0, arg1));
+     }
+ 
+-    public static Localizable localizableWEBSERVICEAP_METHOD_NOT_ANNOTATED(Object arg0, Object arg1) {
+-        return messageFactory.getMessage("webserviceap.method.not.annotated", arg0, arg1);
++    public static Localizable localizableWEBSERVICEAP_NESTED_MODEL_ERROR(Object arg0) {
++        return messageFactory.getMessage("webserviceap.nestedModelError", arg0);
+     }
+ 
+     /**
+-     * The method {0} on class {1} is not annotated.
+-     * 
++     * modeler error: {0}
++     *
+      */
+-    public static String WEBSERVICEAP_METHOD_NOT_ANNOTATED(Object arg0, Object arg1) {
+-        return localizer.localize(localizableWEBSERVICEAP_METHOD_NOT_ANNOTATED(arg0, arg1));
++    public static String WEBSERVICEAP_NESTED_MODEL_ERROR(Object arg0) {
++        return localizer.localize(localizableWEBSERVICEAP_NESTED_MODEL_ERROR(arg0));
+     }
+ 
+-    public static Localizable localizableWEBSERVICEAP_NON_IN_PARAMETERS_MUST_BE_HOLDER(Object arg0, Object arg1, Object arg2) {
+-        return messageFactory.getMessage("webserviceap.non.in.parameters.must.be.holder", arg0, arg1, arg2);
++    public static Localizable localizableWEBSERVICEAP_ONEWAY_AND_OUT(Object arg0, Object arg1) {
++        return messageFactory.getMessage("webserviceap.oneway.and.out", arg0, arg1);
+     }
+ 
+     /**
+-     * Class: {0}, method: {1}, parameter: {2} is not WebParam.Mode.IN and is not of type javax.xml.ws.Holder. 
+-     * 
++     * @Oneway methods cannot have out parameters. Class: {0} method {1}
++     *
+      */
+-    public static String WEBSERVICEAP_NON_IN_PARAMETERS_MUST_BE_HOLDER(Object arg0, Object arg1, Object arg2) {
+-        return localizer.localize(localizableWEBSERVICEAP_NON_IN_PARAMETERS_MUST_BE_HOLDER(arg0, arg1, arg2));
++    public static String WEBSERVICEAP_ONEWAY_AND_OUT(Object arg0, Object arg1) {
++        return localizer.localize(localizableWEBSERVICEAP_ONEWAY_AND_OUT(arg0, arg1));
+     }
+ 
+-    public static Localizable localizableWEBSERVICEAP_FAILED_TO_FIND_HANDLERCHAIN_FILE(Object arg0, Object arg1) {
+-        return messageFactory.getMessage("webserviceap.failed.to.find.handlerchain.file", arg0, arg1);
++    public static Localizable localizableWEBSERVICEAP_RPC_LITERAL_WEBPARAMS_MUST_SPECIFY_NAME(Object arg0, Object arg1, Object arg2) {
++        return messageFactory.getMessage("webserviceap.rpc.literal.webparams.must.specify.name", arg0, arg1, arg2);
+     }
+ 
+     /**
+-     * Cannot find HandlerChain file. class: {0}, file: {1}
+-     * 
++     * All rpc literal WebParams must specify a name.  Class: {0} method {1} paramter {2}
++     *
+      */
+-    public static String WEBSERVICEAP_FAILED_TO_FIND_HANDLERCHAIN_FILE(Object arg0, Object arg1) {
+-        return localizer.localize(localizableWEBSERVICEAP_FAILED_TO_FIND_HANDLERCHAIN_FILE(arg0, arg1));
++    public static String WEBSERVICEAP_RPC_LITERAL_WEBPARAMS_MUST_SPECIFY_NAME(Object arg0, Object arg1, Object arg2) {
++        return localizer.localize(localizableWEBSERVICEAP_RPC_LITERAL_WEBPARAMS_MUST_SPECIFY_NAME(arg0, arg1, arg2));
+     }
+ 
+-    public static Localizable localizableWEBSERVICEAP_OPERATION_NAME_NOT_UNIQUE(Object arg0, Object arg1, Object arg2) {
+-        return messageFactory.getMessage("webserviceap.operation.name.not.unique", arg0, arg1, arg2);
++    public static Localizable localizableWEBSERVICEAP_INVALID_SEI_ANNOTATION_ELEMENT_EXCLUDE(Object arg0, Object arg1, Object arg2) {
++        return messageFactory.getMessage("webserviceap.invalid.sei.annotation.element.exclude", arg0, arg1, arg2);
+     }
+ 
+     /**
+-     * Operation names must be unique.  Class: {0} method: {1} operation name: {2}
+-     * 
++     * The @javax.jws.WebMethod({0}) cannot be used on a service endpoint interface. Class: {1} method: {2}
++     *
+      */
+-    public static String WEBSERVICEAP_OPERATION_NAME_NOT_UNIQUE(Object arg0, Object arg1, Object arg2) {
+-        return localizer.localize(localizableWEBSERVICEAP_OPERATION_NAME_NOT_UNIQUE(arg0, arg1, arg2));
++    public static String WEBSERVICEAP_INVALID_SEI_ANNOTATION_ELEMENT_EXCLUDE(Object arg0, Object arg1, Object arg2) {
++        return localizer.localize(localizableWEBSERVICEAP_INVALID_SEI_ANNOTATION_ELEMENT_EXCLUDE(arg0, arg1, arg2));
+     }
+ 
+-    public static Localizable localizableWEBSERVICEAP_METHOD_NOT_IMPLEMENTED(Object arg0, Object arg1, Object arg2) {
+-        return messageFactory.getMessage("webserviceap.method.not.implemented", arg0, arg1, arg2);
++    public static Localizable localizableWEBSERVICEAP_CLASS_NOT_FOUND(Object arg0) {
++        return messageFactory.getMessage("webserviceap.class.not.found", arg0);
+     }
+ 
+     /**
+-     * Methods in an endpointInterface must be implemented in the implementation class.  Interface Class:{0} Implementation Class:{1} Method: {2}
+-     * 
++     * Class Not Found: {0}
++     *
+      */
+-    public static String WEBSERVICEAP_METHOD_NOT_IMPLEMENTED(Object arg0, Object arg1, Object arg2) {
+-        return localizer.localize(localizableWEBSERVICEAP_METHOD_NOT_IMPLEMENTED(arg0, arg1, arg2));
++    public static String WEBSERVICEAP_CLASS_NOT_FOUND(Object arg0) {
++        return localizer.localize(localizableWEBSERVICEAP_CLASS_NOT_FOUND(arg0));
+     }
+ 
+-    public static Localizable localizableWEBSERVICEAP_HEADER_PARAMETERS_MUST_HAVE_WEBPARAM_NAME(Object arg0, Object arg1, Object arg2) {
+-        return messageFactory.getMessage("webserviceap.header.parameters.must.have.webparam.name", arg0, arg1, arg2);
++    public static Localizable localizableWEBSERVICEAP_ENDPOINTINTEFACE_PLUS_ELEMENT(Object arg0) {
++        return messageFactory.getMessage("webserviceap.endpointinteface.plus.element", arg0);
+     }
+ 
+     /**
+-     * All WebParam annotations on header parameters must specify a name.  Class: {0} method {1} paramter {2}
+-     * 
++     * The @javax.jws.WebService.{0} element cannot be used in with @javax.jws.WebService.endpointInterface element.
++     *
+      */
+-    public static String WEBSERVICEAP_HEADER_PARAMETERS_MUST_HAVE_WEBPARAM_NAME(Object arg0, Object arg1, Object arg2) {
+-        return localizer.localize(localizableWEBSERVICEAP_HEADER_PARAMETERS_MUST_HAVE_WEBPARAM_NAME(arg0, arg1, arg2));
++    public static String WEBSERVICEAP_ENDPOINTINTEFACE_PLUS_ELEMENT(Object arg0) {
++        return localizer.localize(localizableWEBSERVICEAP_ENDPOINTINTEFACE_PLUS_ELEMENT(arg0));
+     }
+ 
+-    public static Localizable localizableWEBSERVICEAP_INVALID_HANDLERCHAIN_FILE_NOHANDLER_CONFIG(Object arg0) {
+-        return messageFactory.getMessage("webserviceap.invalid.handlerchain.file.nohandler-config", arg0);
++    public static Localizable localizableWEBSERVICEAP_CANNOT_COMBINE_HANDLERCHAIN_SOAPMESSAGEHANDLERS() {
++        return messageFactory.getMessage("webserviceap.cannot.combine.handlerchain.soapmessagehandlers");
+     }
+ 
+     /**
+-     * The handlerchain file {0} is invalid, it does not contain a handler-config element
+-     * 
++     * You cannot specify both HanlderChain and SOAPMessageHandlers annotations
++     *
+      */
+-    public static String WEBSERVICEAP_INVALID_HANDLERCHAIN_FILE_NOHANDLER_CONFIG(Object arg0) {
+-        return localizer.localize(localizableWEBSERVICEAP_INVALID_HANDLERCHAIN_FILE_NOHANDLER_CONFIG(arg0));
++    public static String WEBSERVICEAP_CANNOT_COMBINE_HANDLERCHAIN_SOAPMESSAGEHANDLERS() {
++        return localizer.localize(localizableWEBSERVICEAP_CANNOT_COMBINE_HANDLERCHAIN_SOAPMESSAGEHANDLERS());
+     }
+ 
+-    public static Localizable localizableWEBSERVICEAP_ONEWAY_OPERATION_CANNOT_DECLARE_EXCEPTIONS(Object arg0, Object arg1, Object arg2) {
+-        return messageFactory.getMessage("webserviceap.oneway.operation.cannot.declare.exceptions", arg0, arg1, arg2);
++    public static Localizable localizableWEBSERVICEAP_WEBSERVICE_CLASS_IS_INNERCLASS_NOT_STATIC(Object arg0) {
++        return messageFactory.getMessage("webserviceap.webservice.class.is.innerclass.not.static", arg0);
+     }
+ 
+     /**
+-     * The method {1} of class {0} is annotated @Oneway but declares the exception {2}
+-     * 
++     * Inner classes annotated with @javax.jws.WebService must be static. Class: {0}
++     *
+      */
+-    public static String WEBSERVICEAP_ONEWAY_OPERATION_CANNOT_DECLARE_EXCEPTIONS(Object arg0, Object arg1, Object arg2) {
+-        return localizer.localize(localizableWEBSERVICEAP_ONEWAY_OPERATION_CANNOT_DECLARE_EXCEPTIONS(arg0, arg1, arg2));
++    public static String WEBSERVICEAP_WEBSERVICE_CLASS_IS_INNERCLASS_NOT_STATIC(Object arg0) {
++        return localizer.localize(localizableWEBSERVICEAP_WEBSERVICE_CLASS_IS_INNERCLASS_NOT_STATIC(arg0));
+     }
+ 
+-    public static Localizable localizableWEBSERVICEAP_ONEWAY_OPERATION_CANNOT_HAVE_HOLDERS(Object arg0, Object arg1) {
+-        return messageFactory.getMessage("webserviceap.oneway.operation.cannot.have.holders", arg0, arg1);
++    public static Localizable localizableWEBSERVICEAP_NON_IN_PARAMETERS_MUST_BE_HOLDER(Object arg0, Object arg1, Object arg2) {
++        return messageFactory.getMessage("webserviceap.non.in.parameters.must.be.holder", arg0, arg1, arg2);
+     }
+ 
+     /**
+-     * The method {1} of class {0} is annotated @Oneway but contains inout or out paramerters (javax.xml.ws.Holder)
+-     * 
++     * Class: {0}, method: {1}, parameter: {2} is not WebParam.Mode.IN and is not of type javax.xml.ws.Holder.
++     *
+      */
+-    public static String WEBSERVICEAP_ONEWAY_OPERATION_CANNOT_HAVE_HOLDERS(Object arg0, Object arg1) {
+-        return localizer.localize(localizableWEBSERVICEAP_ONEWAY_OPERATION_CANNOT_HAVE_HOLDERS(arg0, arg1));
++    public static String WEBSERVICEAP_NON_IN_PARAMETERS_MUST_BE_HOLDER(Object arg0, Object arg1, Object arg2) {
++        return localizer.localize(localizableWEBSERVICEAP_NON_IN_PARAMETERS_MUST_BE_HOLDER(arg0, arg1, arg2));
+     }
+ 
+-    public static Localizable localizableWEBSERVICEAP_ONEWAY_AND_NOT_ONE_IN(Object arg0, Object arg1) {
+-        return messageFactory.getMessage("webserviceap.oneway.and.not.one.in", arg0, arg1);
++    public static Localizable localizableWEBSERVICEAP_INVALID_SEI_ANNOTATION_ELEMENT(Object arg0, Object arg1) {
++        return messageFactory.getMessage("webserviceap.invalid.sei.annotation.element", arg0, arg1);
+     }
+ 
+     /**
+-     * Document literal bare methods annotated with @javax.jws.Oneway must have one non-header IN parameter.  Class: {0} Method: {1} 
+-     * 
++     * The @javax.jws.WebService.{0} element cannot be specified on a service endpoint interface. Class: {1}
++     *
+      */
+-    public static String WEBSERVICEAP_ONEWAY_AND_NOT_ONE_IN(Object arg0, Object arg1) {
+-        return localizer.localize(localizableWEBSERVICEAP_ONEWAY_AND_NOT_ONE_IN(arg0, arg1));
++    public static String WEBSERVICEAP_INVALID_SEI_ANNOTATION_ELEMENT(Object arg0, Object arg1) {
++        return localizer.localize(localizableWEBSERVICEAP_INVALID_SEI_ANNOTATION_ELEMENT(arg0, arg1));
+     }
+ 
+-    public static Localizable localizableWEBSERVICEAP_RPC_ENCODED_NOT_SUPPORTED(Object arg0) {
+-        return messageFactory.getMessage("webserviceap.rpc.encoded.not.supported", arg0);
++    public static Localizable localizableWEBSERVICEAP_SUCCEEDED() {
++        return messageFactory.getMessage("webserviceap.succeeded");
+     }
+ 
+     /**
+-     * The {0} class has a rpc/encoded SOAPBinding.  Rpc/encoded SOAPBindings are not supported in JAXWS 2.0.
+-     * 
++     * Success
++     *
+      */
+-    public static String WEBSERVICEAP_RPC_ENCODED_NOT_SUPPORTED(Object arg0) {
+-        return localizer.localize(localizableWEBSERVICEAP_RPC_ENCODED_NOT_SUPPORTED(arg0));
++    public static String WEBSERVICEAP_SUCCEEDED() {
++        return localizer.localize(localizableWEBSERVICEAP_SUCCEEDED());
+     }
+ 
+-    public static Localizable localizableWEBSERVICEAP_JAVA_TYPE_NOT_FOUND(Object arg0) {
+-        return messageFactory.getMessage("webserviceap.java.typeNotFound", arg0);
++    public static Localizable localizableWEBSERVICEAP_DOC_BARE_AND_NO_ONE_IN(Object arg0, Object arg1) {
++        return messageFactory.getMessage("webserviceap.doc.bare.and.no.one.in", arg0, arg1);
+     }
+ 
+     /**
+-     * The type: {0} was not found in the mapping
+-     * 
++     * Document literal bare methods must have one non-header, IN/INOUT parameter.  Class: {0} Method: {1}
++     *
+      */
+-    public static String WEBSERVICEAP_JAVA_TYPE_NOT_FOUND(Object arg0) {
+-        return localizer.localize(localizableWEBSERVICEAP_JAVA_TYPE_NOT_FOUND(arg0));
++    public static String WEBSERVICEAP_DOC_BARE_AND_NO_ONE_IN(Object arg0, Object arg1) {
++        return localizer.localize(localizableWEBSERVICEAP_DOC_BARE_AND_NO_ONE_IN(arg0, arg1));
+     }
+ 
+-    public static Localizable localizableWEBSERVICEAP_INVALID_SEI_ANNOTATION(Object arg0, Object arg1) {
+-        return messageFactory.getMessage("webserviceap.invalid.sei.annotation", arg0, arg1);
++    public static Localizable localizableWEBSERVICEAP_WEBSERVICE_METHOD_IS_ABSTRACT(Object arg0, Object arg1) {
++        return messageFactory.getMessage("webserviceap.webservice.method.is.abstract", arg0, arg1);
+     }
+ 
+     /**
+-     * The @{0} annotation cannot be used on a service endpoint interface. Class: {1} 
+-     * 
++     * Classes annotated with @javax.jws.WebService must not have abstract methods. Class: {0} Method: {1}
++     *
+      */
+-    public static String WEBSERVICEAP_INVALID_SEI_ANNOTATION(Object arg0, Object arg1) {
+-        return localizer.localize(localizableWEBSERVICEAP_INVALID_SEI_ANNOTATION(arg0, arg1));
++    public static String WEBSERVICEAP_WEBSERVICE_METHOD_IS_ABSTRACT(Object arg0, Object arg1) {
++        return localizer.localize(localizableWEBSERVICEAP_WEBSERVICE_METHOD_IS_ABSTRACT(arg0, arg1));
+     }
+ 
+-    public static Localizable localizableWEBSERVICEAP_NO_WEBSERVICE_ENDPOINT_FOUND() {
+-        return messageFactory.getMessage("webserviceap.no.webservice.endpoint.found");
++    public static Localizable localizableWEBSERVICEAP_DOCUMENT_LITERAL_BARE_METHOD_RETURN_NOT_UNIQUE(Object arg0, Object arg1, Object arg2, Object arg3) {
++        return messageFactory.getMessage("webserviceap.document.literal.bare.method.return.not.unique", arg0, arg1, arg2, arg3);
+     }
+ 
+     /**
+-     * A web service endpoint could not be found
+-     * 
++     * Document literal bare methods must have a unique result name return type combination.  Class {0} method: {1}, result name: {2} return type: {3}
++     *
+      */
+-    public static String WEBSERVICEAP_NO_WEBSERVICE_ENDPOINT_FOUND() {
+-        return localizer.localize(localizableWEBSERVICEAP_NO_WEBSERVICE_ENDPOINT_FOUND());
++    public static String WEBSERVICEAP_DOCUMENT_LITERAL_BARE_METHOD_RETURN_NOT_UNIQUE(Object arg0, Object arg1, Object arg2, Object arg3) {
++        return localizer.localize(localizableWEBSERVICEAP_DOCUMENT_LITERAL_BARE_METHOD_RETURN_NOT_UNIQUE(arg0, arg1, arg2, arg3));
+     }
+ 
+-    public static Localizable localizableWEBSERVICEAP_INVALID_WEBMETHOD_ELEMENT_WITH_EXCLUDE(Object arg0, Object arg1, Object arg2) {
+-        return messageFactory.getMessage("webserviceap.invalid.webmethod.element.with.exclude", arg0, arg1, arg2);
++    public static Localizable localizableWEBSERVICEAP_NO_WEBSERVICE_ENDPOINT_FOUND() {
++        return messageFactory.getMessage("webserviceap.no.webservice.endpoint.found");
+     }
+ 
+     /**
+-     * The @javax.jws.WebMethod.{0} element cannot be specified with the @javax.jws.WebMethod.exclude element. Class: {1} method: {2} 
+-     * 
++     * A web service endpoint could not be found
++     *
+      */
+-    public static String WEBSERVICEAP_INVALID_WEBMETHOD_ELEMENT_WITH_EXCLUDE(Object arg0, Object arg1, Object arg2) {
+-        return localizer.localize(localizableWEBSERVICEAP_INVALID_WEBMETHOD_ELEMENT_WITH_EXCLUDE(arg0, arg1, arg2));
++    public static String WEBSERVICEAP_NO_WEBSERVICE_ENDPOINT_FOUND() {
++        return localizer.localize(localizableWEBSERVICEAP_NO_WEBSERVICE_ENDPOINT_FOUND());
+     }
+ 
+-    public static Localizable localizableWEBSERVICEAP_COULD_NOT_FIND_TYPEDECL(Object arg0, Object arg1) {
+-        return messageFactory.getMessage("webserviceap.could.not.find.typedecl", arg0, arg1);
++    public static Localizable localizableWEBSERVICEAP_FILE_NOT_FOUND(Object arg0) {
++        return messageFactory.getMessage("webserviceap.fileNotFound", arg0);
+     }
+ 
+     /**
+-     * Could not get TypeDeclaration for: {0} in apt round: {1}
+-     * 
++     * error: file not found: {0}
++     *
+      */
+-    public static String WEBSERVICEAP_COULD_NOT_FIND_TYPEDECL(Object arg0, Object arg1) {
+-        return localizer.localize(localizableWEBSERVICEAP_COULD_NOT_FIND_TYPEDECL(arg0, arg1));
++    public static String WEBSERVICEAP_FILE_NOT_FOUND(Object arg0) {
++        return localizer.localize(localizableWEBSERVICEAP_FILE_NOT_FOUND(arg0));
+     }
+ 
+-    public static Localizable localizableWEBSERVICEAP_DOCUMENT_LITERAL_BARE_CANNOT_HAVE_MORE_THAN_ONE_OUT(Object arg0, Object arg1) {
+-        return messageFactory.getMessage("webserviceap.document.literal.bare.cannot.have.more.than.one.out", arg0, arg1);
++    public static Localizable localizableWEBSERVICEAP_INVALID_HANDLERCHAIN_FILE_NOHANDLER_CONFIG(Object arg0) {
++        return messageFactory.getMessage("webserviceap.invalid.handlerchain.file.nohandler-config", arg0);
+     }
+ 
+     /**
+-     * Document literal bare methods must have a return value or one out parameter.  Class: {0} Method: {1}
+-     * 
++     * The handlerchain file {0} is invalid, it does not contain a handler-config element
++     *
+      */
+-    public static String WEBSERVICEAP_DOCUMENT_LITERAL_BARE_CANNOT_HAVE_MORE_THAN_ONE_OUT(Object arg0, Object arg1) {
+-        return localizer.localize(localizableWEBSERVICEAP_DOCUMENT_LITERAL_BARE_CANNOT_HAVE_MORE_THAN_ONE_OUT(arg0, arg1));
++    public static String WEBSERVICEAP_INVALID_HANDLERCHAIN_FILE_NOHANDLER_CONFIG(Object arg0) {
++        return localizer.localize(localizableWEBSERVICEAP_INVALID_HANDLERCHAIN_FILE_NOHANDLER_CONFIG(arg0));
+     }
+ 
+-    public static Localizable localizableWEBSERVICE_ENCODED_NOT_SUPPORTED(Object arg0, Object arg1) {
+-        return messageFactory.getMessage("webservice.encoded.not.supported", arg0, arg1);
++    public static Localizable localizableWEBSERVICEAP_HEADER_PARAMETERS_MUST_HAVE_WEBPARAM_NAME(Object arg0, Object arg1, Object arg2) {
++        return messageFactory.getMessage("webserviceap.header.parameters.must.have.webparam.name", arg0, arg1, arg2);
+     }
+ 
+     /**
+-     * The {0} class has invalid SOAPBinding annotation. {1}/encoded SOAPBinding is not supported
+-     * 
++     * All WebParam annotations on header parameters must specify a name.  Class: {0} method {1} paramter {2}
++     *
+      */
+-    public static String WEBSERVICE_ENCODED_NOT_SUPPORTED(Object arg0, Object arg1) {
+-        return localizer.localize(localizableWEBSERVICE_ENCODED_NOT_SUPPORTED(arg0, arg1));
++    public static String WEBSERVICEAP_HEADER_PARAMETERS_MUST_HAVE_WEBPARAM_NAME(Object arg0, Object arg1, Object arg2) {
++        return localizer.localize(localizableWEBSERVICEAP_HEADER_PARAMETERS_MUST_HAVE_WEBPARAM_NAME(arg0, arg1, arg2));
+     }
+ 
+-    public static Localizable localizableWEBSERVICEAP_WEBSERVICE_CLASS_IS_FINAL(Object arg0) {
+-        return messageFactory.getMessage("webserviceap.webservice.class.is.final", arg0);
++    public static Localizable localizableWEBSERVICEAP_METHOD_RETURN_TYPE_CANNOT_IMPLEMENT_REMOTE(Object arg0, Object arg1, Object arg2) {
++        return messageFactory.getMessage("webserviceap.method.return.type.cannot.implement.remote", arg0, arg1, arg2);
+     }
+ 
+     /**
+-     * Classes annotated with @javax.jws.WebService must not be final. Class: {0}
+-     * 
++     * Method return types cannot implement java.rmi.Remote.  Class: {0} method: {1} return type: {2}
++     *
+      */
+-    public static String WEBSERVICEAP_WEBSERVICE_CLASS_IS_FINAL(Object arg0) {
+-        return localizer.localize(localizableWEBSERVICEAP_WEBSERVICE_CLASS_IS_FINAL(arg0));
++    public static String WEBSERVICEAP_METHOD_RETURN_TYPE_CANNOT_IMPLEMENT_REMOTE(Object arg0, Object arg1, Object arg2) {
++        return localizer.localize(localizableWEBSERVICEAP_METHOD_RETURN_TYPE_CANNOT_IMPLEMENT_REMOTE(arg0, arg1, arg2));
+     }
+ 
+-    public static Localizable localizableWEBSERVICEAP_WEBSERVICE_NO_DEFAULT_CONSTRUCTOR(Object arg0) {
+-        return messageFactory.getMessage("webserviceap.webservice.no.default.constructor", arg0);
++    public static Localizable localizableWEBSERVICEAP_ENDPOINTINTEFACE_PLUS_ANNOTATION(Object arg0) {
++        return messageFactory.getMessage("webserviceap.endpointinteface.plus.annotation", arg0);
+     }
+ 
+     /**
+-     * Classes annotated with @javax.jws.WebService must have a public default constructor. Class: {0}
+-     * 
++     * The @{0} annotation cannot be used in with @javax.jws.WebService.endpointInterface element.
++     *
+      */
+-    public static String WEBSERVICEAP_WEBSERVICE_NO_DEFAULT_CONSTRUCTOR(Object arg0) {
+-        return localizer.localize(localizableWEBSERVICEAP_WEBSERVICE_NO_DEFAULT_CONSTRUCTOR(arg0));
++    public static String WEBSERVICEAP_ENDPOINTINTEFACE_PLUS_ANNOTATION(Object arg0) {
++        return localizer.localize(localizableWEBSERVICEAP_ENDPOINTINTEFACE_PLUS_ANNOTATION(arg0));
+     }
+ 
+-    public static Localizable localizableWEBSERVICEAP_SEI_CANNOT_CONTAIN_CONSTANT_VALUES(Object arg0, Object arg1) {
+-        return messageFactory.getMessage("webserviceap.sei.cannot.contain.constant.values", arg0, arg1);
++    public static Localizable localizableWEBSERVICEAP_HOLDER_PARAMETERS_MUST_NOT_BE_IN_ONLY(Object arg0, Object arg1, Object arg2) {
++        return messageFactory.getMessage("webserviceap.holder.parameters.must.not.be.in.only", arg0, arg1, arg2);
+     }
+ 
+     /**
+-     * An service endpoint interface cannot contain constant declaration: Interface: {0} field: {1}.
+-     * 
++     * javax.xml.ws.Holder parameters must not be annotated with the WebParam.Mode.IN property.  Class: {0} method: {1} parameter: {2}
++     *
+      */
+-    public static String WEBSERVICEAP_SEI_CANNOT_CONTAIN_CONSTANT_VALUES(Object arg0, Object arg1) {
+-        return localizer.localize(localizableWEBSERVICEAP_SEI_CANNOT_CONTAIN_CONSTANT_VALUES(arg0, arg1));
++    public static String WEBSERVICEAP_HOLDER_PARAMETERS_MUST_NOT_BE_IN_ONLY(Object arg0, Object arg1, Object arg2) {
++        return localizer.localize(localizableWEBSERVICEAP_HOLDER_PARAMETERS_MUST_NOT_BE_IN_ONLY(arg0, arg1, arg2));
+     }
+ 
+-    public static Localizable localizableWEBSERVICEAP_ENDPOINTINTERFACE_CLASS_NOT_FOUND(Object arg0) {
+-        return messageFactory.getMessage("webserviceap.endpointinterface.class.not.found", arg0);
++    public static Localizable localizableWEBSERVICEAP_DOCUMENT_LITERAL_BARE_MUST_HAVE_ONLY_ONE_IN_PARAMETER(Object arg0, Object arg1, Object arg2) {
++        return messageFactory.getMessage("webserviceap.document.literal.bare.must.have.only.one.in.parameter", arg0, arg1, arg2);
+     }
+ 
+     /**
+-     * The endpointInterface class {0} could not be found
+-     * 
++     * Document literal bare methods must have no more than 1 non-header in parameter. Class: {0} method: {1} number of non-header parameters: {2}
++     *
+      */
+-    public static String WEBSERVICEAP_ENDPOINTINTERFACE_CLASS_NOT_FOUND(Object arg0) {
+-        return localizer.localize(localizableWEBSERVICEAP_ENDPOINTINTERFACE_CLASS_NOT_FOUND(arg0));
++    public static String WEBSERVICEAP_DOCUMENT_LITERAL_BARE_MUST_HAVE_ONLY_ONE_IN_PARAMETER(Object arg0, Object arg1, Object arg2) {
++        return localizer.localize(localizableWEBSERVICEAP_DOCUMENT_LITERAL_BARE_MUST_HAVE_ONLY_ONE_IN_PARAMETER(arg0, arg1, arg2));
+     }
+ 
+-    public static Localizable localizableWEBSERVICEAP_DOCUMENT_LITERAL_BARE_MUST_HAVE_ONLY_ONE_IN_PARAMETER(Object arg0, Object arg1, Object arg2) {
+-        return messageFactory.getMessage("webserviceap.document.literal.bare.must.have.only.one.in.parameter", arg0, arg1, arg2);
++    public static Localizable localizableWEBSERVICEAP_DOC_BARE_RETURN_AND_OUT(Object arg0, Object arg1) {
++        return messageFactory.getMessage("webserviceap.doc.bare.return.and.out", arg0, arg1);
+     }
+ 
+     /**
+-     * Document literal bare methods must have no more than 1 non-header in parameter. Class: {0} method: {1} number of non-header parameters: {2}
+-     * 
++     * Document/literal bare methods cannot have a return type and out parameters. Class: {0}, method: {1}
++     *
+      */
+-    public static String WEBSERVICEAP_DOCUMENT_LITERAL_BARE_MUST_HAVE_ONLY_ONE_IN_PARAMETER(Object arg0, Object arg1, Object arg2) {
+-        return localizer.localize(localizableWEBSERVICEAP_DOCUMENT_LITERAL_BARE_MUST_HAVE_ONLY_ONE_IN_PARAMETER(arg0, arg1, arg2));
++    public static String WEBSERVICEAP_DOC_BARE_RETURN_AND_OUT(Object arg0, Object arg1) {
++        return localizer.localize(localizableWEBSERVICEAP_DOC_BARE_RETURN_AND_OUT(arg0, arg1));
+     }
+ 
+-    public static Localizable localizableWEBSERVICEAP_INFO(Object arg0) {
+-        return messageFactory.getMessage("webserviceap.info", arg0);
++    public static Localizable localizableWEBSERVICEAP_METHOD_PARAMETER_TYPES_CANNOT_IMPLEMENT_REMOTE(Object arg0, Object arg1, Object arg2, Object arg3) {
++        return messageFactory.getMessage("webserviceap.method.parameter.types.cannot.implement.remote", arg0, arg1, arg2, arg3);
+     }
+ 
+     /**
+-     * info: {0}
+-     * 
++     * Method parameter types cannot implement java.rmi.Remote.  Class: {0} method: {1} parameter: {2} type: {3}
++     *
+      */
+-    public static String WEBSERVICEAP_INFO(Object arg0) {
+-        return localizer.localize(localizableWEBSERVICEAP_INFO(arg0));
++    public static String WEBSERVICEAP_METHOD_PARAMETER_TYPES_CANNOT_IMPLEMENT_REMOTE(Object arg0, Object arg1, Object arg2, Object arg3) {
++        return localizer.localize(localizableWEBSERVICEAP_METHOD_PARAMETER_TYPES_CANNOT_IMPLEMENT_REMOTE(arg0, arg1, arg2, arg3));
+     }
+ 
+-    public static Localizable localizableWEBSERVICEAP_HANDLERCLASS_NOTSPECIFIED(Object arg0) {
+-        return messageFactory.getMessage("webserviceap.handlerclass.notspecified", arg0);
++    public static Localizable localizableWEBSERVICEAP_COMPILATION_FAILED() {
++        return messageFactory.getMessage("webserviceap.compilationFailed");
+     }
+ 
+     /**
+-     * A handler in the HandlerChain file: {0} does not specify a handler-class
+-     * 
++     * compilation failed, errors should have been reported
++     *
+      */
+-    public static String WEBSERVICEAP_HANDLERCLASS_NOTSPECIFIED(Object arg0) {
+-        return localizer.localize(localizableWEBSERVICEAP_HANDLERCLASS_NOTSPECIFIED(arg0));
++    public static String WEBSERVICEAP_COMPILATION_FAILED() {
++        return localizer.localize(localizableWEBSERVICEAP_COMPILATION_FAILED());
+     }
+ 
+-    public static Localizable localizableWEBSERVICEAP_INVALID_SEI_ANNOTATION_ELEMENT(Object arg0, Object arg1) {
+-        return messageFactory.getMessage("webserviceap.invalid.sei.annotation.element", arg0, arg1);
++    public static Localizable localizableWEBSERVICEAP_MODEL_ALREADY_EXISTS() {
++        return messageFactory.getMessage("webserviceap.model.already.exists");
+     }
+ 
+     /**
+-     * The @javax.jws.WebService.{0} element cannot be specified on a service endpoint interface. Class: {1} 
+-     * 
++     * model already exists
++     *
+      */
+-    public static String WEBSERVICEAP_INVALID_SEI_ANNOTATION_ELEMENT(Object arg0, Object arg1) {
+-        return localizer.localize(localizableWEBSERVICEAP_INVALID_SEI_ANNOTATION_ELEMENT(arg0, arg1));
++    public static String WEBSERVICEAP_MODEL_ALREADY_EXISTS() {
++        return localizer.localize(localizableWEBSERVICEAP_MODEL_ALREADY_EXISTS());
+     }
+ 
+-    public static Localizable localizableWEBSERVICEAP_DOCUMENT_LITERAL_BARE_METHOD_NOT_UNIQUE(Object arg0, Object arg1, Object arg2) {
+-        return messageFactory.getMessage("webserviceap.document.literal.bare.method.not.unique", arg0, arg1, arg2);
++    public static Localizable localizableWEBSERVICEAP_COULD_NOT_FIND_TYPEDECL(Object arg0, Object arg1) {
++        return messageFactory.getMessage("webserviceap.could.not.find.typedecl", arg0, arg1);
+     }
+ 
+     /**
+-     * Document literal bare methods must have unique parameter names.  Class: {0} method: {1} parameter name: {2}
+-     * 
++     * Could not get TypeDeclaration for: {0} in apt round: {1}
++     *
+      */
+-    public static String WEBSERVICEAP_DOCUMENT_LITERAL_BARE_METHOD_NOT_UNIQUE(Object arg0, Object arg1, Object arg2) {
+-        return localizer.localize(localizableWEBSERVICEAP_DOCUMENT_LITERAL_BARE_METHOD_NOT_UNIQUE(arg0, arg1, arg2));
++    public static String WEBSERVICEAP_COULD_NOT_FIND_TYPEDECL(Object arg0, Object arg1) {
++        return localizer.localize(localizableWEBSERVICEAP_COULD_NOT_FIND_TYPEDECL(arg0, arg1));
+     }
+ 
+-    public static Localizable localizableWEBSERVICEAP_METHOD_EXCEPTION_BEAN_NAME_NOT_UNIQUE(Object arg0, Object arg1) {
+-        return messageFactory.getMessage("webserviceap.method.exception.bean.name.not.unique", arg0, arg1);
++    public static Localizable localizableWEBSERVICEAP_WEBSERVICE_CLASS_NOT_PUBLIC(Object arg0) {
++        return messageFactory.getMessage("webserviceap.webservice.class.not.public", arg0);
+     }
+ 
+     /**
+-     * Exception bean names must be unique and must not clash with other generated classes.  Class: {0} exception {1}
+-     * 
++     * Classes annotated with @javax.jws.WebService must be public. Class: {0}
++     *
+      */
+-    public static String WEBSERVICEAP_METHOD_EXCEPTION_BEAN_NAME_NOT_UNIQUE(Object arg0, Object arg1) {
+-        return localizer.localize(localizableWEBSERVICEAP_METHOD_EXCEPTION_BEAN_NAME_NOT_UNIQUE(arg0, arg1));
++    public static String WEBSERVICEAP_WEBSERVICE_CLASS_NOT_PUBLIC(Object arg0) {
++        return localizer.localize(localizableWEBSERVICEAP_WEBSERVICE_CLASS_NOT_PUBLIC(arg0));
+     }
+ 
+-    public static Localizable localizableWEBSERVICEAP_HOLDER_PARAMETERS_MUST_NOT_BE_IN_ONLY(Object arg0, Object arg1, Object arg2) {
+-        return messageFactory.getMessage("webserviceap.holder.parameters.must.not.be.in.only", arg0, arg1, arg2);
++    public static Localizable localizableWEBSERVICEAP_DOCUMENT_LITERAL_BARE_METHOD_NOT_UNIQUE(Object arg0, Object arg1, Object arg2) {
++        return messageFactory.getMessage("webserviceap.document.literal.bare.method.not.unique", arg0, arg1, arg2);
+     }
+ 
+     /**
+-     * javax.xml.ws.Holder parameters must not be annotated with the WebParam.Mode.IN property.  Class: {0} method: {1} parameter: {2}
+-     * 
++     * Document literal bare methods must have unique parameter names.  Class: {0} method: {1} parameter name: {2}
++     *
+      */
+-    public static String WEBSERVICEAP_HOLDER_PARAMETERS_MUST_NOT_BE_IN_ONLY(Object arg0, Object arg1, Object arg2) {
+-        return localizer.localize(localizableWEBSERVICEAP_HOLDER_PARAMETERS_MUST_NOT_BE_IN_ONLY(arg0, arg1, arg2));
++    public static String WEBSERVICEAP_DOCUMENT_LITERAL_BARE_METHOD_NOT_UNIQUE(Object arg0, Object arg1, Object arg2) {
++        return localizer.localize(localizableWEBSERVICEAP_DOCUMENT_LITERAL_BARE_METHOD_NOT_UNIQUE(arg0, arg1, arg2));
+     }
+ 
+-    public static Localizable localizableWEBSERVICEAP_DOC_BARE_AND_NO_ONE_IN(Object arg0, Object arg1) {
+-        return messageFactory.getMessage("webserviceap.doc.bare.and.no.one.in", arg0, arg1);
++    public static Localizable localizableWEBSERVICEAP_RPC_SOAPBINDING_NOT_ALLOWED_ON_METHOD(Object arg0, Object arg1) {
++        return messageFactory.getMessage("webserviceap.rpc.soapbinding.not.allowed.on.method", arg0, arg1);
+     }
+ 
+     /**
+-     * Document literal bare methods must have one non-header, IN/INOUT parameter.  Class: {0} Method: {1} 
+-     * 
++     * SOAPBinding.Style.RPC binding annotations are not allowed on methods.  Class: {0} Method: {1}
++     *
+      */
+-    public static String WEBSERVICEAP_DOC_BARE_AND_NO_ONE_IN(Object arg0, Object arg1) {
+-        return localizer.localize(localizableWEBSERVICEAP_DOC_BARE_AND_NO_ONE_IN(arg0, arg1));
++    public static String WEBSERVICEAP_RPC_SOAPBINDING_NOT_ALLOWED_ON_METHOD(Object arg0, Object arg1) {
++        return localizer.localize(localizableWEBSERVICEAP_RPC_SOAPBINDING_NOT_ALLOWED_ON_METHOD(arg0, arg1));
+     }
+ 
+-    public static Localizable localizableWEBSERVICEAP_RPC_LITERAL_WEBPARAMS_MUST_SPECIFY_NAME(Object arg0, Object arg1, Object arg2) {
+-        return messageFactory.getMessage("webserviceap.rpc.literal.webparams.must.specify.name", arg0, arg1, arg2);
++    public static Localizable localizableWEBSERVICEAP_NO_PACKAGE_CLASS_MUST_HAVE_TARGETNAMESPACE(Object arg0) {
++        return messageFactory.getMessage("webserviceap.no.package.class.must.have.targetnamespace", arg0);
+     }
+ 
+     /**
+-     * All rpc literal WebParams must specify a name.  Class: {0} method {1} paramter {2}
+-     * 
++     * @javax.jws.Webservice annotated classes that do not belong to a package must have the @javax.jws.Webservice.targetNamespace element.  Class: {0}
++     *
+      */
+-    public static String WEBSERVICEAP_RPC_LITERAL_WEBPARAMS_MUST_SPECIFY_NAME(Object arg0, Object arg1, Object arg2) {
+-        return localizer.localize(localizableWEBSERVICEAP_RPC_LITERAL_WEBPARAMS_MUST_SPECIFY_NAME(arg0, arg1, arg2));
++    public static String WEBSERVICEAP_NO_PACKAGE_CLASS_MUST_HAVE_TARGETNAMESPACE(Object arg0) {
++        return localizer.localize(localizableWEBSERVICEAP_NO_PACKAGE_CLASS_MUST_HAVE_TARGETNAMESPACE(arg0));
+     }
+ 
+     public static Localizable localizableWEBSERVICEAP_ENDPOINTINTERFACE_HAS_NO_WEBSERVICE_ANNOTATION(Object arg0) {
+@@ -608,286 +608,298 @@
+ 
+     /**
+      * The endpoint interface {0} must have a WebService annotation
+-     * 
++     *
+      */
+     public static String WEBSERVICEAP_ENDPOINTINTERFACE_HAS_NO_WEBSERVICE_ANNOTATION(Object arg0) {
+         return localizer.localize(localizableWEBSERVICEAP_ENDPOINTINTERFACE_HAS_NO_WEBSERVICE_ANNOTATION(arg0));
+     }
+ 
+-    public static Localizable localizableWEBSERVICEAP_CANNOT_COMBINE_HANDLERCHAIN_SOAPMESSAGEHANDLERS() {
+-        return messageFactory.getMessage("webserviceap.cannot.combine.handlerchain.soapmessagehandlers");
++    public static Localizable localizableWEBSERVICEAP_INFO(Object arg0) {
++        return messageFactory.getMessage("webserviceap.info", arg0);
+     }
+ 
+     /**
+-     * You cannot specify both HanlderChain and SOAPMessageHandlers annotations
+-     * 
++     * info: {0}
++     *
+      */
+-    public static String WEBSERVICEAP_CANNOT_COMBINE_HANDLERCHAIN_SOAPMESSAGEHANDLERS() {
+-        return localizer.localize(localizableWEBSERVICEAP_CANNOT_COMBINE_HANDLERCHAIN_SOAPMESSAGEHANDLERS());
++    public static String WEBSERVICEAP_INFO(Object arg0) {
++        return localizer.localize(localizableWEBSERVICEAP_INFO(arg0));
+     }
+ 
+-    public static Localizable localizableWEBSERVICEAP_NESTED_MODEL_ERROR(Object arg0) {
+-        return messageFactory.getMessage("webserviceap.nestedModelError", arg0);
++    public static Localizable localizableWEBSERVICEAP_RPC_LITERAL_MUST_NOT_BE_BARE(Object arg0) {
++        return messageFactory.getMessage("webserviceap.rpc.literal.must.not.be.bare", arg0);
+     }
+ 
+     /**
+-     * modeler error: {0}
+-     * 
++     * RPC literal SOAPBindings must have parameterStyle WRAPPPED. Class: {0}.
++     *
+      */
+-    public static String WEBSERVICEAP_NESTED_MODEL_ERROR(Object arg0) {
+-        return localizer.localize(localizableWEBSERVICEAP_NESTED_MODEL_ERROR(arg0));
++    public static String WEBSERVICEAP_RPC_LITERAL_MUST_NOT_BE_BARE(Object arg0) {
++        return localizer.localize(localizableWEBSERVICEAP_RPC_LITERAL_MUST_NOT_BE_BARE(arg0));
+     }
+ 
+-    public static Localizable localizableWEBSERVICEAP_METHOD_REQUEST_WRAPPER_BEAN_NAME_NOT_UNIQUE(Object arg0, Object arg1) {
+-        return messageFactory.getMessage("webserviceap.method.request.wrapper.bean.name.not.unique", arg0, arg1);
++    public static Localizable localizableWEBSERVICEAP_COULD_NOT_FIND_HANDLERCHAIN(Object arg0, Object arg1) {
++        return messageFactory.getMessage("webserviceap.could.not.find.handlerchain", arg0, arg1);
+     }
+ 
+     /**
+-     * Request wrapper bean names must be unique and must not clash with other generated classes.  Class: {0} method {1}
+-     * 
++     * Could not find the handlerchain {0} in the handler file {1}
++     *
+      */
+-    public static String WEBSERVICEAP_METHOD_REQUEST_WRAPPER_BEAN_NAME_NOT_UNIQUE(Object arg0, Object arg1) {
+-        return localizer.localize(localizableWEBSERVICEAP_METHOD_REQUEST_WRAPPER_BEAN_NAME_NOT_UNIQUE(arg0, arg1));
++    public static String WEBSERVICEAP_COULD_NOT_FIND_HANDLERCHAIN(Object arg0, Object arg1) {
++        return localizer.localize(localizableWEBSERVICEAP_COULD_NOT_FIND_HANDLERCHAIN(arg0, arg1));
+     }
+ 
+-    public static Localizable localizableWEBSERVICEAP_WEBSERVICE_CLASS_NOT_PUBLIC(Object arg0) {
+-        return messageFactory.getMessage("webserviceap.webservice.class.not.public", arg0);
++    public static Localizable localizableWEBSERVICEAP_RPC_ENCODED_NOT_SUPPORTED(Object arg0) {
++        return messageFactory.getMessage("webserviceap.rpc.encoded.not.supported", arg0);
+     }
+ 
+     /**
+-     * Classes annotated with @javax.jws.WebService must be public. Class: {0}
+-     * 
++     * The {0} class has a rpc/encoded SOAPBinding.  Rpc/encoded SOAPBindings are not supported in JAXWS 2.0.
++     *
+      */
+-    public static String WEBSERVICEAP_WEBSERVICE_CLASS_NOT_PUBLIC(Object arg0) {
+-        return localizer.localize(localizableWEBSERVICEAP_WEBSERVICE_CLASS_NOT_PUBLIC(arg0));
++    public static String WEBSERVICEAP_RPC_ENCODED_NOT_SUPPORTED(Object arg0) {
++        return localizer.localize(localizableWEBSERVICEAP_RPC_ENCODED_NOT_SUPPORTED(arg0));
+     }
+ 
+-    public static Localizable localizableWEBSERVICEAP_MIXED_BINDING_STYLE(Object arg0) {
+-        return messageFactory.getMessage("webserviceap.mixed.binding.style", arg0);
++    public static Localizable localizableWEBSERVICEAP_ERROR(Object arg0) {
++        return messageFactory.getMessage("webserviceap.error", arg0);
+     }
+ 
+     /**
+-     * Class: {0} contains mixed bindings.  SOAPBinding.Style.RPC and SOAPBinding.Style.DOCUMENT cannot be mixed.
+-     * 
++     * error: {0}
++     *
+      */
+-    public static String WEBSERVICEAP_MIXED_BINDING_STYLE(Object arg0) {
+-        return localizer.localize(localizableWEBSERVICEAP_MIXED_BINDING_STYLE(arg0));
++    public static String WEBSERVICEAP_ERROR(Object arg0) {
++        return localizer.localize(localizableWEBSERVICEAP_ERROR(arg0));
+     }
+ 
+-    public static Localizable localizableWEBSERVICEAP_FILE_NOT_FOUND(Object arg0) {
+-        return messageFactory.getMessage("webserviceap.fileNotFound", arg0);
++    public static Localizable localizableWEBSERVICEAP_ENDPOINTINTERFACE_CLASS_NOT_FOUND(Object arg0) {
++        return messageFactory.getMessage("webserviceap.endpointinterface.class.not.found", arg0);
+     }
+ 
+     /**
+-     * error: file not found: {0}
+-     * 
++     * The endpointInterface class {0} could not be found
++     *
+      */
+-    public static String WEBSERVICEAP_FILE_NOT_FOUND(Object arg0) {
+-        return localizer.localize(localizableWEBSERVICEAP_FILE_NOT_FOUND(arg0));
++    public static String WEBSERVICEAP_ENDPOINTINTERFACE_CLASS_NOT_FOUND(Object arg0) {
++        return localizer.localize(localizableWEBSERVICEAP_ENDPOINTINTERFACE_CLASS_NOT_FOUND(arg0));
+     }
+ 
+-    public static Localizable localizableWEBSERVICEAP_ONEWAY_AND_OUT(Object arg0, Object arg1) {
+-        return messageFactory.getMessage("webserviceap.oneway.and.out", arg0, arg1);
++    public static Localizable localizableWEBSERVICEAP_METHOD_NOT_IMPLEMENTED(Object arg0, Object arg1, Object arg2) {
++        return messageFactory.getMessage("webserviceap.method.not.implemented", arg0, arg1, arg2);
+     }
+ 
+     /**
+-     * @Oneway methods cannot have out parameters. Class: {0} method {1}
+-     * 
++     * Methods in an endpointInterface must be implemented in the implementation class.  Interface Class:{0} Implementation Class:{1} Method: {2}
++     *
+      */
+-    public static String WEBSERVICEAP_ONEWAY_AND_OUT(Object arg0, Object arg1) {
+-        return localizer.localize(localizableWEBSERVICEAP_ONEWAY_AND_OUT(arg0, arg1));
++    public static String WEBSERVICEAP_METHOD_NOT_IMPLEMENTED(Object arg0, Object arg1, Object arg2) {
++        return localizer.localize(localizableWEBSERVICEAP_METHOD_NOT_IMPLEMENTED(arg0, arg1, arg2));
+     }
+ 
+-    public static Localizable localizableWEBSERVICEAP_METHOD_RESPONSE_WRAPPER_BEAN_NAME_NOT_UNIQUE(Object arg0, Object arg1) {
+-        return messageFactory.getMessage("webserviceap.method.response.wrapper.bean.name.not.unique", arg0, arg1);
++    public static Localizable localizableWEBSERVICE_ENCODED_NOT_SUPPORTED(Object arg0, Object arg1) {
++        return messageFactory.getMessage("webservice.encoded.not.supported", arg0, arg1);
+     }
+ 
+     /**
+-     * Response wrapper bean names must be unique and must not clash with other generated classes.  Class: {0} method {1}
+-     * 
++     * The {0} class has invalid SOAPBinding annotation. {1}/encoded SOAPBinding is not supported
++     *
+      */
+-    public static String WEBSERVICEAP_METHOD_RESPONSE_WRAPPER_BEAN_NAME_NOT_UNIQUE(Object arg0, Object arg1) {
+-        return localizer.localize(localizableWEBSERVICEAP_METHOD_RESPONSE_WRAPPER_BEAN_NAME_NOT_UNIQUE(arg0, arg1));
++    public static String WEBSERVICE_ENCODED_NOT_SUPPORTED(Object arg0, Object arg1) {
++        return localizer.localize(localizableWEBSERVICE_ENCODED_NOT_SUPPORTED(arg0, arg1));
+     }
+ 
+-    public static Localizable localizableWEBSERVICEAP_COMPILATION_FAILED() {
+-        return messageFactory.getMessage("webserviceap.compilationFailed");
++    public static Localizable localizableWEBSERVICEAP_HANDLERCLASS_NOTSPECIFIED(Object arg0) {
++        return messageFactory.getMessage("webserviceap.handlerclass.notspecified", arg0);
+     }
+ 
+     /**
+-     * compilation failed, errors should have been reported
+-     * 
++     * A handler in the HandlerChain file: {0} does not specify a handler-class
++     *
+      */
+-    public static String WEBSERVICEAP_COMPILATION_FAILED() {
+-        return localizer.localize(localizableWEBSERVICEAP_COMPILATION_FAILED());
++    public static String WEBSERVICEAP_HANDLERCLASS_NOTSPECIFIED(Object arg0) {
++        return localizer.localize(localizableWEBSERVICEAP_HANDLERCLASS_NOTSPECIFIED(arg0));
+     }
+ 
+-    public static Localizable localizableWEBSERVICEAP_DOCUMENT_LITERAL_BARE_MUST_HAVE_ONE_IN_OR_OUT(Object arg0, Object arg1) {
+-        return messageFactory.getMessage("webserviceap.document.literal.bare.must.have.one.in.or.out", arg0, arg1);
++    public static Localizable localizableWEBSERVICEAP_FAILED_TO_FIND_HANDLERCHAIN_FILE(Object arg0, Object arg1) {
++        return messageFactory.getMessage("webserviceap.failed.to.find.handlerchain.file", arg0, arg1);
+     }
+ 
+     /**
+-     * Document literal bare methods must have at least one of: a return, an in parameter or an out parameter.  Class: {0} Method: {1}
+-     * 
++     * Cannot find HandlerChain file. class: {0}, file: {1}
++     *
+      */
+-    public static String WEBSERVICEAP_DOCUMENT_LITERAL_BARE_MUST_HAVE_ONE_IN_OR_OUT(Object arg0, Object arg1) {
+-        return localizer.localize(localizableWEBSERVICEAP_DOCUMENT_LITERAL_BARE_MUST_HAVE_ONE_IN_OR_OUT(arg0, arg1));
++    public static String WEBSERVICEAP_FAILED_TO_FIND_HANDLERCHAIN_FILE(Object arg0, Object arg1) {
++        return localizer.localize(localizableWEBSERVICEAP_FAILED_TO_FIND_HANDLERCHAIN_FILE(arg0, arg1));
+     }
+ 
+-    public static Localizable localizableWEBSERVICEAP_ENDPOINTINTEFACE_PLUS_ELEMENT(Object arg0) {
+-        return messageFactory.getMessage("webserviceap.endpointinteface.plus.element", arg0);
++    public static Localizable localizableWEBSERVICEAP_DOC_BARE_NO_RETURN_AND_NO_OUT(Object arg0, Object arg1) {
++        return messageFactory.getMessage("webserviceap.doc.bare.no.return.and.no.out", arg0, arg1);
+     }
+ 
+     /**
+-     * The @javax.jws.WebService.{0} element cannot be used in with @javax.jws.WebService.endpointInterface element. 
+-     * 
++     * Document literal bare methods that do not have a return value must have a single OUT/INOUT parameter.  Class: {0} Method: {1}
++     *
+      */
+-    public static String WEBSERVICEAP_ENDPOINTINTEFACE_PLUS_ELEMENT(Object arg0) {
+-        return localizer.localize(localizableWEBSERVICEAP_ENDPOINTINTEFACE_PLUS_ELEMENT(arg0));
++    public static String WEBSERVICEAP_DOC_BARE_NO_RETURN_AND_NO_OUT(Object arg0, Object arg1) {
++        return localizer.localize(localizableWEBSERVICEAP_DOC_BARE_NO_RETURN_AND_NO_OUT(arg0, arg1));
+     }
+ 
+-    public static Localizable localizableWEBSERVICEAP_DOC_BARE_RETURN_AND_OUT(Object arg0, Object arg1) {
+-        return messageFactory.getMessage("webserviceap.doc.bare.return.and.out", arg0, arg1);
++    public static Localizable localizableWEBSERVICEAP_WEBSERVICE_CLASS_IS_ABSTRACT(Object arg0) {
++        return messageFactory.getMessage("webserviceap.webservice.class.is.abstract", arg0);
+     }
+ 
+     /**
+-     * Document/literal bare methods cannot have a return type and out parameters. Class: {0}, method: {1}
+-     * 
++     * Classes annotated with @javax.jws.WebService must not be abstract. Class: {0}
++     *
+      */
+-    public static String WEBSERVICEAP_DOC_BARE_RETURN_AND_OUT(Object arg0, Object arg1) {
+-        return localizer.localize(localizableWEBSERVICEAP_DOC_BARE_RETURN_AND_OUT(arg0, arg1));
++    public static String WEBSERVICEAP_WEBSERVICE_CLASS_IS_ABSTRACT(Object arg0) {
++        return localizer.localize(localizableWEBSERVICEAP_WEBSERVICE_CLASS_IS_ABSTRACT(arg0));
+     }
+ 
+-    public static Localizable localizableWEBSERVICEAP_SUCCEEDED() {
+-        return messageFactory.getMessage("webserviceap.succeeded");
++    public static Localizable localizableWEBSERVICEAP_INIT_PARAM_FORMAT_ERROR() {
++        return messageFactory.getMessage("webserviceap.init_param.format.error");
+     }
+ 
+     /**
+-     * Success
+-     * 
++     * a <init-param> element must have exactly 1 <param-name> and 1 <param-value>
++     *
+      */
+-    public static String WEBSERVICEAP_SUCCEEDED() {
+-        return localizer.localize(localizableWEBSERVICEAP_SUCCEEDED());
++    public static String WEBSERVICEAP_INIT_PARAM_FORMAT_ERROR() {
++        return localizer.localize(localizableWEBSERVICEAP_INIT_PARAM_FORMAT_ERROR());
+     }
+ 
+-    public static Localizable localizableWEBSERVICEAP_DOCUMENT_BARE_HOLDER_PARAMETERS_MUST_NOT_BE_INOUT(Object arg0, Object arg1, Object arg2) {
+-        return messageFactory.getMessage("webserviceap.document.bare.holder.parameters.must.not.be.inout", arg0, arg1, arg2);
++    public static Localizable localizableWEBSERVICEAP_MIXED_BINDING_STYLE(Object arg0) {
++        return messageFactory.getMessage("webserviceap.mixed.binding.style", arg0);
+     }
+ 
+     /**
+-     * javax.xml.ws.Holder parameters in document bare operations must be WebParam.Mode.INOUT;  Class: {0} method: {1} parameter: {2}
+-     * 
++     * Class: {0} contains mixed bindings.  SOAPBinding.Style.RPC and SOAPBinding.Style.DOCUMENT cannot be mixed.
++     *
+      */
+-    public static String WEBSERVICEAP_DOCUMENT_BARE_HOLDER_PARAMETERS_MUST_NOT_BE_INOUT(Object arg0, Object arg1, Object arg2) {
+-        return localizer.localize(localizableWEBSERVICEAP_DOCUMENT_BARE_HOLDER_PARAMETERS_MUST_NOT_BE_INOUT(arg0, arg1, arg2));
++    public static String WEBSERVICEAP_MIXED_BINDING_STYLE(Object arg0) {
++        return localizer.localize(localizableWEBSERVICEAP_MIXED_BINDING_STYLE(arg0));
+     }
+ 
+-    public static Localizable localizableWEBSERVICEAP_WEBSERVICE_AND_WEBSERVICEPROVIDER(Object arg0) {
+-        return messageFactory.getMessage("webserviceap.webservice.and.webserviceprovider", arg0);
++    public static Localizable localizableWEBSERVICEAP_METHOD_NOT_ANNOTATED(Object arg0, Object arg1) {
++        return messageFactory.getMessage("webserviceap.method.not.annotated", arg0, arg1);
+     }
+ 
+     /**
+-     * Classes cannot be annotated with both @javax.jws.WebService and @javax.xml.ws.WebServiceProvider.  Class: {0}
+-     * 
++     * The method {0} on class {1} is not annotated.
++     *
+      */
+-    public static String WEBSERVICEAP_WEBSERVICE_AND_WEBSERVICEPROVIDER(Object arg0) {
+-        return localizer.localize(localizableWEBSERVICEAP_WEBSERVICE_AND_WEBSERVICEPROVIDER(arg0));
++    public static String WEBSERVICEAP_METHOD_NOT_ANNOTATED(Object arg0, Object arg1) {
++        return localizer.localize(localizableWEBSERVICEAP_METHOD_NOT_ANNOTATED(arg0, arg1));
+     }
+ 
+-    public static Localizable localizableWEBSERVICEAP_ENDPOINTINTERFACES_DO_NOT_MATCH(Object arg0, Object arg1) {
+-        return messageFactory.getMessage("webserviceap.endpointinterfaces.do.not.match", arg0, arg1);
++    public static Localizable localizableWEBSERVICEAP_ONEWAY_OPERATION_CANNOT_HAVE_HOLDERS(Object arg0, Object arg1) {
++        return messageFactory.getMessage("webserviceap.oneway.operation.cannot.have.holders", arg0, arg1);
+     }
+ 
+     /**
+-     * The endpoint interface {0} does not match the interface {1}.
+-     * 
++     * The method {1} of class {0} is annotated @Oneway but contains inout or out paramerters (javax.xml.ws.Holder)
++     *
+      */
+-    public static String WEBSERVICEAP_ENDPOINTINTERFACES_DO_NOT_MATCH(Object arg0, Object arg1) {
+-        return localizer.localize(localizableWEBSERVICEAP_ENDPOINTINTERFACES_DO_NOT_MATCH(arg0, arg1));
++    public static String WEBSERVICEAP_ONEWAY_OPERATION_CANNOT_HAVE_HOLDERS(Object arg0, Object arg1) {
++        return localizer.localize(localizableWEBSERVICEAP_ONEWAY_OPERATION_CANNOT_HAVE_HOLDERS(arg0, arg1));
+     }
+ 
+-    public static Localizable localizableWEBSERVICEAP_ENDPOINTINTEFACE_PLUS_ANNOTATION(Object arg0) {
+-        return messageFactory.getMessage("webserviceap.endpointinteface.plus.annotation", arg0);
++    public static Localizable localizableWEBSERVICEAP_DOCUMENT_LITERAL_BARE_CANNOT_HAVE_MORE_THAN_ONE_OUT(Object arg0, Object arg1) {
++        return messageFactory.getMessage("webserviceap.document.literal.bare.cannot.have.more.than.one.out", arg0, arg1);
+     }
+ 
+     /**
+-     * The @{0} annotation cannot be used in with @javax.jws.WebService.endpointInterface element. 
+-     * 
++     * Document literal bare methods must have a return value or one out parameter.  Class: {0} Method: {1}
++     *
+      */
+-    public static String WEBSERVICEAP_ENDPOINTINTEFACE_PLUS_ANNOTATION(Object arg0) {
+-        return localizer.localize(localizableWEBSERVICEAP_ENDPOINTINTEFACE_PLUS_ANNOTATION(arg0));
++    public static String WEBSERVICEAP_DOCUMENT_LITERAL_BARE_CANNOT_HAVE_MORE_THAN_ONE_OUT(Object arg0, Object arg1) {
++        return localizer.localize(localizableWEBSERVICEAP_DOCUMENT_LITERAL_BARE_CANNOT_HAVE_MORE_THAN_ONE_OUT(arg0, arg1));
+     }
+ 
+-    public static Localizable localizableWEBSERVICEAP_FAILED_TO_PARSE_HANDLERCHAIN_FILE(Object arg0, Object arg1) {
+-        return messageFactory.getMessage("webserviceap.failed.to.parse.handlerchain.file", arg0, arg1);
++    public static Localizable localizableWEBSERVICEAP_INVALID_SEI_ANNOTATION(Object arg0, Object arg1) {
++        return messageFactory.getMessage("webserviceap.invalid.sei.annotation", arg0, arg1);
+     }
+ 
+     /**
+-     * Failed to parse HandlerChain file. Class: {0}, file: {1}
+-     * 
++     * The @{0} annotation cannot be used on a service endpoint interface. Class: {1}
++     *
+      */
+-    public static String WEBSERVICEAP_FAILED_TO_PARSE_HANDLERCHAIN_FILE(Object arg0, Object arg1) {
+-        return localizer.localize(localizableWEBSERVICEAP_FAILED_TO_PARSE_HANDLERCHAIN_FILE(arg0, arg1));
++    public static String WEBSERVICEAP_INVALID_SEI_ANNOTATION(Object arg0, Object arg1) {
++        return localizer.localize(localizableWEBSERVICEAP_INVALID_SEI_ANNOTATION(arg0, arg1));
+     }
+ 
+-    public static Localizable localizableWEBSERVICEAP_METHOD_PARAMETER_TYPES_CANNOT_IMPLEMENT_REMOTE(Object arg0, Object arg1, Object arg2, Object arg3) {
+-        return messageFactory.getMessage("webserviceap.method.parameter.types.cannot.implement.remote", arg0, arg1, arg2, arg3);
++    public static Localizable localizableWEBSERVICEAP_OPERATION_NAME_NOT_UNIQUE(Object arg0, Object arg1, Object arg2) {
++        return messageFactory.getMessage("webserviceap.operation.name.not.unique", arg0, arg1, arg2);
+     }
+ 
+     /**
+-     * Method parameter types cannot implement java.rmi.Remote.  Class: {0} method: {1} parameter: {2} type: {3}
+-     * 
++     * Operation names must be unique.  Class: {0} method: {1} operation name: {2}
++     *
+      */
+-    public static String WEBSERVICEAP_METHOD_PARAMETER_TYPES_CANNOT_IMPLEMENT_REMOTE(Object arg0, Object arg1, Object arg2, Object arg3) {
+-        return localizer.localize(localizableWEBSERVICEAP_METHOD_PARAMETER_TYPES_CANNOT_IMPLEMENT_REMOTE(arg0, arg1, arg2, arg3));
++    public static String WEBSERVICEAP_OPERATION_NAME_NOT_UNIQUE(Object arg0, Object arg1, Object arg2) {
++        return localizer.localize(localizableWEBSERVICEAP_OPERATION_NAME_NOT_UNIQUE(arg0, arg1, arg2));
+     }
+ 
+-    public static Localizable localizableWEBSERVICEAP_METHOD_RETURN_TYPE_CANNOT_IMPLEMENT_REMOTE(Object arg0, Object arg1, Object arg2) {
+-        return messageFactory.getMessage("webserviceap.method.return.type.cannot.implement.remote", arg0, arg1, arg2);
++    public static Localizable localizableWEBSERVICEAP_WEBSERVICE_CLASS_IS_FINAL(Object arg0) {
++        return messageFactory.getMessage("webserviceap.webservice.class.is.final", arg0);
+     }
+ 
+     /**
+-     * Method return types cannot implement java.rmi.Remote.  Class: {0} method: {1} return type: {2}
+-     * 
++     * Classes annotated with @javax.jws.WebService must not be final. Class: {0}
++     *
+      */
+-    public static String WEBSERVICEAP_METHOD_RETURN_TYPE_CANNOT_IMPLEMENT_REMOTE(Object arg0, Object arg1, Object arg2) {
+-        return localizer.localize(localizableWEBSERVICEAP_METHOD_RETURN_TYPE_CANNOT_IMPLEMENT_REMOTE(arg0, arg1, arg2));
++    public static String WEBSERVICEAP_WEBSERVICE_CLASS_IS_FINAL(Object arg0) {
++        return localizer.localize(localizableWEBSERVICEAP_WEBSERVICE_CLASS_IS_FINAL(arg0));
+     }
+ 
+-    public static Localizable localizableWEBSERVICEAP_ERROR(Object arg0) {
+-        return messageFactory.getMessage("webserviceap.error", arg0);
++    public static Localizable localizableWEBSERVICEAP_DOCUMENT_LITERAL_BARE_MUST_HAVE_ONE_IN_OR_OUT(Object arg0, Object arg1) {
++        return messageFactory.getMessage("webserviceap.document.literal.bare.must.have.one.in.or.out", arg0, arg1);
+     }
+ 
+     /**
+-     * error: {0}
+-     * 
++     * Document literal bare methods must have at least one of: a return, an in parameter or an out parameter.  Class: {0} Method: {1}
++     *
+      */
+-    public static String WEBSERVICEAP_ERROR(Object arg0) {
+-        return localizer.localize(localizableWEBSERVICEAP_ERROR(arg0));
++    public static String WEBSERVICEAP_DOCUMENT_LITERAL_BARE_MUST_HAVE_ONE_IN_OR_OUT(Object arg0, Object arg1) {
++        return localizer.localize(localizableWEBSERVICEAP_DOCUMENT_LITERAL_BARE_MUST_HAVE_ONE_IN_OR_OUT(arg0, arg1));
+     }
+ 
+-    public static Localizable localizableWEBSERVICEAP_WEBSERVICE_CLASS_IS_ABSTRACT(Object arg0) {
+-        return messageFactory.getMessage("webserviceap.webservice.class.is.abstract", arg0);
++    public static Localizable localizableWEBSERVICEAP_METHOD_REQUEST_WRAPPER_BEAN_NAME_NOT_UNIQUE(Object arg0, Object arg1) {
++        return messageFactory.getMessage("webserviceap.method.request.wrapper.bean.name.not.unique", arg0, arg1);
+     }
+ 
+     /**
+-     * Classes annotated with @javax.jws.WebService must not be abstract. Class: {0}
+-     * 
++     * Request wrapper bean names must be unique and must not clash with other generated classes.  Class: {0} method {1}
++     *
+      */
+-    public static String WEBSERVICEAP_WEBSERVICE_CLASS_IS_ABSTRACT(Object arg0) {
+-        return localizer.localize(localizableWEBSERVICEAP_WEBSERVICE_CLASS_IS_ABSTRACT(arg0));
++    public static String WEBSERVICEAP_METHOD_REQUEST_WRAPPER_BEAN_NAME_NOT_UNIQUE(Object arg0, Object arg1) {
++        return localizer.localize(localizableWEBSERVICEAP_METHOD_REQUEST_WRAPPER_BEAN_NAME_NOT_UNIQUE(arg0, arg1));
+     }
+ 
+-    public static Localizable localizableWEBSERVICEAP_INIT_PARAM_FORMAT_ERROR() {
+-        return messageFactory.getMessage("webserviceap.init_param.format.error");
++    public static Localizable localizableWEBSERVICEAP_DOCUMENT_BARE_HOLDER_PARAMETERS_MUST_NOT_BE_INOUT(Object arg0, Object arg1, Object arg2) {
++        return messageFactory.getMessage("webserviceap.document.bare.holder.parameters.must.not.be.inout", arg0, arg1, arg2);
+     }
+ 
+     /**
+-     * a <init-param> element must have exactly 1 <param-name> and 1 <param-value>
+-     * 
++     * javax.xml.ws.Holder parameters in document bare operations must be WebParam.Mode.INOUT;  Class: {0} method: {1} parameter: {2}
++     *
+      */
+-    public static String WEBSERVICEAP_INIT_PARAM_FORMAT_ERROR() {
+-        return localizer.localize(localizableWEBSERVICEAP_INIT_PARAM_FORMAT_ERROR());
++    public static String WEBSERVICEAP_DOCUMENT_BARE_HOLDER_PARAMETERS_MUST_NOT_BE_INOUT(Object arg0, Object arg1, Object arg2) {
++        return localizer.localize(localizableWEBSERVICEAP_DOCUMENT_BARE_HOLDER_PARAMETERS_MUST_NOT_BE_INOUT(arg0, arg1, arg2));
+     }
+ 
++    public static Localizable localizableWEBSERVICEAP_ONEWAY_AND_NOT_ONE_IN(Object arg0, Object arg1) {
++        return messageFactory.getMessage("webserviceap.oneway.and.not.one.in", arg0, arg1);
++    }
++
++    /**
++     * Document literal bare methods annotated with @javax.jws.Oneway must have one non-header IN parameter.  Class: {0} Method: {1}
++     *
++     */
++    public static String WEBSERVICEAP_ONEWAY_AND_NOT_ONE_IN(Object arg0, Object arg1) {
++        return localizer.localize(localizableWEBSERVICEAP_ONEWAY_AND_NOT_ONE_IN(arg0, arg1));
++    }
++
+ }
+--- old/src/share/classes/com/sun/tools/internal/ws/resources/WscompileMessages.java	Thu Jul 30 17:17:48 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/WscompileMessages.java	Thu Jul 30 17:17:47 2009
+@@ -31,7 +31,7 @@
+ 
+ /**
+  * Defines string formatting method for each constant in the resource file
+- * 
++ *
+  */
+ public final class WscompileMessages {
+ 
+@@ -44,7 +44,7 @@
+ 
+     /**
+      * The class "{0}" is not an endpoint implementation class.
+-     * 
++     *
+      */
+     public static String WSGEN_CLASS_MUST_BE_IMPLEMENTATION_CLASS(Object arg0) {
+         return localizer.localize(localizableWSGEN_CLASS_MUST_BE_IMPLEMENTATION_CLASS(arg0));
+@@ -56,23 +56,47 @@
+ 
+     /**
+      * Class not found: "{0}"
+-     * 
++     *
+      */
+     public static String WSGEN_CLASS_NOT_FOUND(Object arg0) {
+         return localizer.localize(localizableWSGEN_CLASS_NOT_FOUND(arg0));
+     }
+ 
++    public static Localizable localizableWSIMPORT_HTTP_REDIRECT(Object arg0, Object arg1) {
++        return messageFactory.getMessage("wsimport.httpRedirect", arg0, arg1);
++    }
++
++    /**
++     * Server returned HTTP Status code: "{0}", retrying with "{1}"
++     *
++     */
++    public static String WSIMPORT_HTTP_REDIRECT(Object arg0, Object arg1) {
++        return localizer.localize(localizableWSIMPORT_HTTP_REDIRECT(arg0, arg1));
++    }
++
++    public static Localizable localizableWSIMPORT_AUTH_INFO_NEEDED(Object arg0, Object arg1, Object arg2) {
++        return messageFactory.getMessage("wsimport.authInfoNeeded", arg0, arg1, arg2);
++    }
++
++    /**
++     * {0},  "{1}" needs authorization, please provide authorization file with read access at {2} or use -Xauthfile to give the authorization file and on each line provide authorization information using this format : http[s]://user:password@host:port//<url-path>
++     *
++     */
++    public static String WSIMPORT_AUTH_INFO_NEEDED(Object arg0, Object arg1, Object arg2) {
++        return localizer.localize(localizableWSIMPORT_AUTH_INFO_NEEDED(arg0, arg1, arg2));
++    }
++
+     public static Localizable localizableWSGEN_USAGE_EXAMPLES() {
+         return messageFactory.getMessage("wsgen.usage.examples");
+     }
+ 
+     /**
+-     * 
++     *
+      * Examples:
+      *   wsgen -cp . example.Stock
+      *   wsgen -cp . example.Stock -wsdl -servicename '{http://mynamespace}MyService'
+-     * 
+-     * 
++     *
++     *
+      */
+     public static String WSGEN_USAGE_EXAMPLES() {
+         return localizer.localize(localizableWSGEN_USAGE_EXAMPLES());
+@@ -84,7 +108,7 @@
+ 
+     /**
+      * You are loading JAX-WS 2.0 API from {0} but this tool requires JAX-WS 2.1 API.
+-     * 
++     *
+      */
+     public static String WRAPPER_TASK_LOADING_20_API(Object arg0) {
+         return localizer.localize(localizableWRAPPER_TASK_LOADING_20_API(arg0));
+@@ -96,7 +120,7 @@
+ 
+     /**
+      * "{0}" is not a supported protocol.  Supported protocols include: {1}.
+-     * 
++     *
+      */
+     public static String WSGEN_INVALID_PROTOCOL(Object arg0, Object arg1) {
+         return localizer.localize(localizableWSGEN_INVALID_PROTOCOL(arg0, arg1));
+@@ -107,12 +131,12 @@
+     }
+ 
+     /**
+-     * 
++     *
+      * Examples:
+      *   wsimport stock.wsdl -b stock.xml -b stock.xjb
+      *   wsimport -d generated http://example.org/stock?wsdl
+-     * 
+-     * 
++     *
++     *
+      */
+     public static String WSIMPORT_USAGE_EXAMPLES() {
+         return localizer.localize(localizableWSIMPORT_USAGE_EXAMPLES());
+@@ -124,7 +148,7 @@
+ 
+     /**
+      * You are running on JDK6 which comes with JAX-WS 2.0 API, but this tool requires JAX-WS 2.1 API. Use the endorsed standards override mechanism (http://java.sun.com/javase/6/docs/technotes/guides/standards/), or use -Xendorsed option.
+-     * 
++     *
+      */
+     public static String INVOKER_NEED_ENDORSED() {
+         return localizer.localize(localizableINVOKER_NEED_ENDORSED());
+@@ -136,12 +160,33 @@
+ 
+     /**
+      * Missing WSDL_URI
+-     * 
++     *
+      */
+     public static String WSIMPORT_MISSING_FILE() {
+         return localizer.localize(localizableWSIMPORT_MISSING_FILE());
+     }
+ 
++    public static Localizable localizableWSIMPORT_USAGE_EXTENSIONS() {
++        return messageFactory.getMessage("wsimport.usage.extensions");
++    }
++
++    /**
++     *
++     * Extensions:
++     *   -XadditionalHeaders         map headers not bound to request or response message to
++     *                               Java method parameters
++     *   -Xauthfile                  file to carry authorization information in the format
++     *                               http://username:password@example.org/stock?wsdl
++     *   -Xdebug                     print debug information
++     *   -Xno-addressing-databinding enable binding of W3C EndpointReferenceType to Java
++     *   -Xnocompile                 do not compile generated Java files
++     *
++     *
++     */
++    public static String WSIMPORT_USAGE_EXTENSIONS() {
++        return localizer.localize(localizableWSIMPORT_USAGE_EXTENSIONS());
++    }
++
+     public static Localizable localizableWSIMPORT_USAGE(Object arg0) {
+         return messageFactory.getMessage("wsimport.usage", arg0);
+     }
+@@ -148,9 +193,9 @@
+ 
+     /**
+      * Usage: {0} [options] <WSDL_URI>
+-     * 
++     *
+      * Use "wsimport -help" for a detailed description of options.
+-     * 
++     *
+      */
+     public static String WSIMPORT_USAGE(Object arg0) {
+         return localizer.localize(localizableWSIMPORT_USAGE(arg0));
+@@ -162,9 +207,9 @@
+ 
+     /**
+      * specify "-extension" and "-wsdl:protocol XSoap1.2" switches. For example:
+-     * 
+-     * 
+-     * 
++     *
++     *
++     *
+      */
+     public static String PLEASE() {
+         return localizer.localize(localizablePLEASE());
+@@ -176,9 +221,9 @@
+ 
+     /**
+      * parsing WSDL...
+-     * 
+-     * 
+-     * 
++     *
++     *
++     *
+      */
+     public static String WSIMPORT_PARSING_WSDL() {
+         return localizer.localize(localizableWSIMPORT_PARSING_WSDL());
+@@ -190,7 +235,7 @@
+ 
+     /**
+      * Missing SEI
+-     * 
++     *
+      */
+     public static String WSGEN_MISSING_FILE() {
+         return localizer.localize(localizableWSGEN_MISSING_FILE());
+@@ -201,9 +246,9 @@
+     }
+ 
+     /**
+-     * 
++     *
+      * Usage: {0} [options] <WSDL_URI>
+-     * 
++     *
+      * where [options] include:
+      *   -b <path>                 specify jaxws/jaxb binding files or additional schemas
+      *                             (Each <path> must have its own -b)
+@@ -221,13 +266,13 @@
+      *   -p <pkg>                  specifies the target package
+      *   -quiet                    suppress wsimport output
+      *   -s <directory>            specify where to place generated source files
+-     *   -target <version>         generate code as per the given JAXWS specification version.
+-     *                             version 2.0 will generate compliant code for JAXWS 2.0 spec.
++     *   -target <version>         generate code as per the given JAXWS spec version
++     *                             e.g. 2.0 will generate compliant code for JAXWS 2.0 spec
+      *   -verbose                  output messages about what the compiler is doing
+      *   -version                  print version information
+      *   -wsdllocation <location>  @WebServiceClient.wsdlLocation value
+-     * 
+-     * 
++     *
++     *
+      */
+     public static String WSIMPORT_HELP(Object arg0) {
+         return localizer.localize(localizableWSIMPORT_HELP(arg0));
+@@ -239,12 +284,50 @@
+ 
+     /**
+      * error: {0}
+-     * 
++     *
+      */
+     public static String WSCOMPILE_ERROR(Object arg0) {
+         return localizer.localize(localizableWSCOMPILE_ERROR(arg0));
+     }
+ 
++    public static Localizable localizableWSGEN_PROTOCOL_WITHOUT_EXTENSION(Object arg0) {
++        return messageFactory.getMessage("wsgen.protocol.without.extension", arg0);
++    }
++
++    /**
++     * The optional protocol "{0}" must be used in conjunction with the "-extension" option.
++     *
++     */
++    public static String WSGEN_PROTOCOL_WITHOUT_EXTENSION(Object arg0) {
++        return localizer.localize(localizableWSGEN_PROTOCOL_WITHOUT_EXTENSION(arg0));
++    }
++
++    public static Localizable localizableWSIMPORT_COMPILING_CODE() {
++        return messageFactory.getMessage("wsimport.CompilingCode");
++    }
++
++    /**
++     *
++     * compiling code...
++     *
++     *
++     */
++    public static String WSIMPORT_COMPILING_CODE() {
++        return localizer.localize(localizableWSIMPORT_COMPILING_CODE());
++    }
++
++    public static Localizable localizableWSIMPORT_READING_AUTH_FILE(Object arg0) {
++        return messageFactory.getMessage("wsimport.readingAuthFile", arg0);
++    }
++
++    /**
++     * Trying to read authorization file : "{0}"...
++     *
++     */
++    public static String WSIMPORT_READING_AUTH_FILE(Object arg0) {
++        return localizer.localize(localizableWSIMPORT_READING_AUTH_FILE(arg0));
++    }
++
+     public static Localizable localizableWSGEN_NO_WEBSERVICES_CLASS(Object arg0) {
+         return messageFactory.getMessage("wsgen.no.webservices.class", arg0);
+     }
+@@ -251,7 +334,7 @@
+ 
+     /**
+      * wsgen did not find any class with @WebService annotation. Please specify @WebService annotation on {0}.
+-     * 
++     *
+      */
+     public static String WSGEN_NO_WEBSERVICES_CLASS(Object arg0) {
+         return localizer.localize(localizableWSGEN_NO_WEBSERVICES_CLASS(arg0));
+@@ -263,7 +346,7 @@
+ 
+     /**
+      * directory not found: {0}
+-     * 
++     *
+      */
+     public static String WSCOMPILE_NO_SUCH_DIRECTORY(Object arg0) {
+         return localizer.localize(localizableWSCOMPILE_NO_SUCH_DIRECTORY(arg0));
+@@ -275,12 +358,24 @@
+ 
+     /**
+      * info: {0}
+-     * 
++     *
+      */
+     public static String WSCOMPILE_INFO(Object arg0) {
+         return localizer.localize(localizableWSCOMPILE_INFO(arg0));
+     }
+ 
++    public static Localizable localizableWSIMPORT_MAX_REDIRECT_ATTEMPT() {
++        return messageFactory.getMessage("wsimport.maxRedirectAttempt");
++    }
++
++    /**
++     * Can not get a WSDL maximum number of redirects(5) reached
++     *
++     */
++    public static String WSIMPORT_MAX_REDIRECT_ATTEMPT() {
++        return localizer.localize(localizableWSIMPORT_MAX_REDIRECT_ATTEMPT());
++    }
++
+     public static Localizable localizableWSIMPORT_WARNING_MESSAGE(Object arg0) {
+         return messageFactory.getMessage("wsimport.WarningMessage", arg0);
+     }
+@@ -287,7 +382,7 @@
+ 
+     /**
+      * [WARNING] {0}
+-     * 
++     *
+      */
+     public static String WSIMPORT_WARNING_MESSAGE(Object arg0) {
+         return localizer.localize(localizableWSIMPORT_WARNING_MESSAGE(arg0));
+@@ -299,7 +394,7 @@
+ 
+     /**
+      * unrecognized parameter {0}
+-     * 
++     *
+      */
+     public static String WSCOMPILE_INVALID_OPTION(Object arg0) {
+         return localizer.localize(localizableWSCOMPILE_INVALID_OPTION(arg0));
+@@ -311,7 +406,7 @@
+ 
+     /**
+      * [ERROR] {0}
+-     * 
++     *
+      */
+     public static String WSIMPORT_ERROR_MESSAGE(Object arg0) {
+         return localizer.localize(localizableWSIMPORT_ERROR_MESSAGE(arg0));
+@@ -323,7 +418,8 @@
+ 
+     /**
+      * generating code...
+-     * 
++     *
++     *
+      */
+     public static String WSIMPORT_GENERATING_CODE() {
+         return localizer.localize(localizableWSIMPORT_GENERATING_CODE());
+@@ -335,7 +431,7 @@
+ 
+     /**
+      * -wsdl:protocol XSoap1.2 -extenson {1}
+-     * 
++     *
+      */
+     public static String WSGEN() {
+         return localizer.localize(localizableWSGEN());
+@@ -347,7 +443,7 @@
+ 
+     /**
+      * "{0}" is neither a file name nor an URL
+-     * 
++     *
+      */
+     public static String WSIMPORT_NOT_A_FILE_NOR_URL(Object arg0) {
+         return localizer.localize(localizableWSIMPORT_NOT_A_FILE_NOR_URL(arg0));
+@@ -359,7 +455,7 @@
+ 
+     /**
+      * warning: {0}
+-     * 
++     *
+      */
+     public static String WSCOMPILE_WARNING(Object arg0) {
+         return localizer.localize(localizableWSCOMPILE_WARNING(arg0));
+@@ -370,8 +466,8 @@
+     }
+ 
+     /**
+-     * You are running on JDK6 which comes with JAX-WS 2.0 API, but this tool requires JAX-WS 2.1 API. Use the endorsed standards override mechanism (http://java.sun.com/javase/6/docs/technotes/guides/standards/), or set xendorsed="true" on <{0}>. 
+-     * 
++     * You are running on JDK6 which comes with JAX-WS 2.0 API, but this tool requires JAX-WS 2.1 API. Use the endorsed standards override mechanism (http://java.sun.com/javase/6/docs/technotes/guides/standards/), or set xendorsed="true" on <{0}>.
++     *
+      */
+     public static String WRAPPER_TASK_NEED_ENDORSED(Object arg0) {
+         return localizer.localize(localizableWRAPPER_TASK_NEED_ENDORSED(arg0));
+@@ -383,12 +479,36 @@
+ 
+     /**
+      * no such JAXB option: {0}
+-     * 
++     *
+      */
+     public static String WSIMPORT_NO_SUCH_JAXB_OPTION(Object arg0) {
+         return localizer.localize(localizableWSIMPORT_NO_SUCH_JAXB_OPTION(arg0));
+     }
+ 
++    public static Localizable localizableWSIMPORT_AUTH_FILE_NOT_FOUND(Object arg0, Object arg1) {
++        return messageFactory.getMessage("wsimport.authFileNotFound", arg0, arg1);
++    }
++
++    /**
++     * Authorization file "{0}" not found. If the WSDL access needs Basic Authentication, please provide authorization file with read access at {1} or use -Xauthfile to give the authorization file and on each line provide authorization information using this format : http[s]://user:password@host:port//<url-path>
++     *
++     */
++    public static String WSIMPORT_AUTH_FILE_NOT_FOUND(Object arg0, Object arg1) {
++        return localizer.localize(localizableWSIMPORT_AUTH_FILE_NOT_FOUND(arg0, arg1));
++    }
++
++    public static Localizable localizableWSIMPORT_DEBUG_MESSAGE(Object arg0) {
++        return messageFactory.getMessage("wsimport.DebugMessage", arg0);
++    }
++
++    /**
++     * [DEBUG] {0}
++     *
++     */
++    public static String WSIMPORT_DEBUG_MESSAGE(Object arg0) {
++        return localizer.localize(localizableWSIMPORT_DEBUG_MESSAGE(arg0));
++    }
++
+     public static Localizable localizableWSGEN_COULD_NOT_CREATE_FILE(Object arg0) {
+         return messageFactory.getMessage("wsgen.could.not.create.file", arg0);
+     }
+@@ -395,7 +515,7 @@
+ 
+     /**
+      * "Could not create file: "{0}"
+-     * 
++     *
+      */
+     public static String WSGEN_COULD_NOT_CREATE_FILE(Object arg0) {
+         return localizer.localize(localizableWSGEN_COULD_NOT_CREATE_FILE(arg0));
+@@ -406,21 +526,21 @@
+     }
+ 
+     /**
+-     * The "{0}" option can only be in conjunction with the "-wsdl" option. 
+-     * 
++     * The "{0}" option can only be in conjunction with the "-wsdl" option.
++     *
+      */
+     public static String WSGEN_WSDL_ARG_NO_GENWSDL(Object arg0) {
+         return localizer.localize(localizableWSGEN_WSDL_ARG_NO_GENWSDL(arg0));
+     }
+ 
+-    public static Localizable localizableWSGEN_HELP(Object arg0) {
+-        return messageFactory.getMessage("wsgen.help", arg0);
++    public static Localizable localizableWSGEN_HELP(Object arg0, Object arg1, Object arg2) {
++        return messageFactory.getMessage("wsgen.help", arg0, arg1, arg2);
+     }
+ 
+     /**
+-     * 
++     *
+      * Usage: {0} [options] <SEI>
+-     * 
++     *
+      * where [options] include:
+      *   -classpath <path>          specify where to find input class files
+      *   -cp <path>                 same as -classpath <path>
+@@ -436,18 +556,20 @@
+      *   -s <directory>             specify where to place generated source files
+      *   -verbose                   output messages about what the compiler is doing
+      *   -version                   print version information
+-     *   -wsdl[:protocol]           generate a WSDL file.  The protocol is optional.
+-     *                              Valid protocols are soap1.1 and Xsoap1.2, the default
+-     *                              is soap1.1.  Xsoap1.2 is not standard and can only be
+-     *                              used in conjunction with the -extension option
++     *   -wsdl[:protocol]           generate a WSDL file. The protocol is optional.
++     *                              Valid protocols are {1},
++     *                              the default is soap1.1.
++     *                              The non stanadard protocols {2}
++     *                              can only be used in conjunction with the
++     *                              -extension option.
+      *   -servicename <name>        specify the Service name to use in the generated WSDL
+      *                              Used in conjunction with the -wsdl option.
+      *   -portname <name>           specify the Port name to use in the generated WSDL
+      *                              Used in conjunction with the -wsdl option.
+-     * 
++     *
+      */
+-    public static String WSGEN_HELP(Object arg0) {
+-        return localizer.localize(localizableWSGEN_HELP(arg0));
++    public static String WSGEN_HELP(Object arg0, Object arg1, Object arg2) {
++        return localizer.localize(localizableWSGEN_HELP(arg0, arg1, arg2));
+     }
+ 
+     public static Localizable localizableWSIMPORT_INFO_MESSAGE(Object arg0) {
+@@ -456,7 +578,7 @@
+ 
+     /**
+      * [INFO] {0}
+-     * 
++     *
+      */
+     public static String WSIMPORT_INFO_MESSAGE(Object arg0) {
+         return localizer.localize(localizableWSIMPORT_INFO_MESSAGE(arg0));
+@@ -468,12 +590,24 @@
+ 
+     /**
+      * The optional protocol "Xsoap1.2" must be used in conjunction with the "-extension" option.
+-     * 
++     *
+      */
+     public static String WSGEN_SOAP_12_WITHOUT_EXTENSION() {
+         return localizer.localize(localizableWSGEN_SOAP_12_WITHOUT_EXTENSION());
+     }
+ 
++    public static Localizable localizableWSIMPORT_ILLEGAL_AUTH_INFO(Object arg0) {
++        return messageFactory.getMessage("wsimport.ILLEGAL_AUTH_INFO", arg0);
++    }
++
++    /**
++     * "{0}" is not a valid authorization information format. The format is http[s]://user:password@host:port//<url-path>.
++     *
++     */
++    public static String WSIMPORT_ILLEGAL_AUTH_INFO(Object arg0) {
++        return localizer.localize(localizableWSIMPORT_ILLEGAL_AUTH_INFO(arg0));
++    }
++
+     public static Localizable localizableWSCOMPILE_COMPILATION_FAILED() {
+         return messageFactory.getMessage("wscompile.compilationFailed");
+     }
+@@ -480,7 +614,7 @@
+ 
+     /**
+      * compilation failed, errors should have been reported
+-     * 
++     *
+      */
+     public static String WSCOMPILE_COMPILATION_FAILED() {
+         return localizer.localize(localizableWSCOMPILE_COMPILATION_FAILED());
+@@ -492,7 +626,7 @@
+ 
+     /**
+      * option "{0}" requires an argument
+-     * 
++     *
+      */
+     public static String WSCOMPILE_MISSING_OPTION_ARGUMENT(Object arg0) {
+         return localizer.localize(localizableWSCOMPILE_MISSING_OPTION_ARGUMENT(arg0));
+@@ -504,7 +638,7 @@
+ 
+     /**
+      * wsgen can not generate WSDL for non-SOAP binding: {0} on Class {1}
+-     * 
++     *
+      */
+     public static String WSGEN_CANNOT_GEN_WSDL_FOR_NON_SOAP_BINDING(Object arg0, Object arg1) {
+         return localizer.localize(localizableWSGEN_CANNOT_GEN_WSDL_FOR_NON_SOAP_BINDING(arg0, arg1));
+@@ -516,7 +650,7 @@
+ 
+     /**
+      * duplicate option: {0}
+-     * 
++     *
+      */
+     public static String WSCOMPILE_DUPLICATE_OPTION(Object arg0) {
+         return localizer.localize(localizableWSCOMPILE_DUPLICATE_OPTION(arg0));
+@@ -528,7 +662,7 @@
+ 
+     /**
+      * Failed to parse "{0}": {1}
+-     * 
++     *
+      */
+     public static String WSIMPORT_FAILED_TO_PARSE(Object arg0, Object arg1) {
+         return localizer.localize(localizableWSIMPORT_FAILED_TO_PARSE(arg0, arg1));
+@@ -540,12 +674,24 @@
+ 
+     /**
+      * Failed to read the WSDL document: {0}, because 1) could not find the document; /2) the document could not be read; 3) the root element of the document is not <wsdl:definitions>.
+-     * 
++     *
+      */
+     public static String WSIMPORT_NO_WSDL(Object arg0) {
+         return localizer.localize(localizableWSIMPORT_NO_WSDL(arg0));
+     }
+ 
++    public static Localizable localizableWSIMPORT_AUTH_INFO_LINENO(Object arg0, Object arg1) {
++        return messageFactory.getMessage("wsimport.AUTH_INFO_LINENO", arg0, arg1);
++    }
++
++    /**
++     * "line {0} of {1}
++     *
++     */
++    public static String WSIMPORT_AUTH_INFO_LINENO(Object arg0, Object arg1) {
++        return localizer.localize(localizableWSIMPORT_AUTH_INFO_LINENO(arg0, arg1));
++    }
++
+     public static Localizable localizableWSGEN_USAGE(Object arg0) {
+         return messageFactory.getMessage("wsgen.usage", arg0);
+     }
+@@ -552,9 +698,9 @@
+ 
+     /**
+      * Usage: {0} [options] <SEI>
+-     * 
++     *
+      * Use "wsgen -help" for a detailed description of options.
+-     * 
++     *
+      */
+     public static String WSGEN_USAGE(Object arg0) {
+         return localizer.localize(localizableWSGEN_USAGE(arg0));
+@@ -566,7 +712,7 @@
+ 
+     /**
+      * The service name "{0}" is missing a localname.
+-     * 
++     *
+      */
+     public static String WSGEN_SERVICENAME_MISSING_LOCALNAME(Object arg0) {
+         return localizer.localize(localizableWSGEN_SERVICENAME_MISSING_LOCALNAME(arg0));
+@@ -578,7 +724,7 @@
+ 
+     /**
+      * The service name "{0}" is missing a namespace.
+-     * 
++     *
+      */
+     public static String WSGEN_SERVICENAME_MISSING_NAMESPACE(Object arg0) {
+         return localizer.localize(localizableWSGEN_SERVICENAME_MISSING_NAMESPACE(arg0));
+@@ -590,7 +736,7 @@
+ 
+     /**
+      * "{0}" is not a supported transport.  Supported transport include: {1}.
+-     * 
++     *
+      */
+     public static String WSGEN_INVALID_TRANSPORT(Object arg0, Object arg1) {
+         return localizer.localize(localizableWSGEN_INVALID_TRANSPORT(arg0, arg1));
+@@ -602,8 +748,8 @@
+ 
+     /**
+      * wsgen can not generate WSDL for SOAP 1.2 binding: {0} on class: {1}.
+-     * 
+-     * 
++     *
++     *
+      */
+     public static String WSGEN_CANNOT_GEN_WSDL_FOR_SOAP_12_BINDING(Object arg0, Object arg1) {
+         return localizer.localize(localizableWSGEN_CANNOT_GEN_WSDL_FOR_SOAP_12_BINDING(arg0, arg1));
+@@ -615,7 +761,7 @@
+ 
+     /**
+      * "{0}" is not a valid target version. "2.0" and "2.1" are supported.
+-     * 
++     *
+      */
+     public static String WSIMPORT_ILLEGAL_TARGET_VERSION(Object arg0) {
+         return localizer.localize(localizableWSIMPORT_ILLEGAL_TARGET_VERSION(arg0));
+@@ -627,7 +773,7 @@
+ 
+     /**
+      * The port name "{0}" is missing a localname.
+-     * 
++     *
+      */
+     public static String WSGEN_PORTNAME_MISSING_LOCALNAME(Object arg0) {
+         return localizer.localize(localizableWSGEN_PORTNAME_MISSING_LOCALNAME(arg0));
+@@ -639,7 +785,7 @@
+ 
+     /**
+      * The port name "{0}" is missing a namespace.
+-     * 
++     *
+      */
+     public static String WSGEN_PORTNAME_MISSING_NAMESPACE(Object arg0) {
+         return localizer.localize(localizableWSGEN_PORTNAME_MISSING_NAMESPACE(arg0));
+--- old/src/share/classes/com/sun/tools/internal/ws/resources/WsdlMessages.java	Thu Jul 30 17:17:51 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/WsdlMessages.java	Thu Jul 30 17:17:51 2009
+@@ -31,7 +31,7 @@
+ 
+ /**
+  * Defines string formatting method for each constant in the resource file
+- * 
++ *
+  */
+ public final class WsdlMessages {
+ 
+@@ -44,7 +44,7 @@
+ 
+     /**
+      * unexpected non-element found
+-     * 
++     *
+      */
+     public static String PARSING_ELEMENT_EXPECTED() {
+         return localizer.localize(localizablePARSING_ELEMENT_EXPECTED());
+@@ -55,35 +55,37 @@
+     }
+ 
+     /**
+-     * wsdl:binding "{0}" referenced by wsdl:port "{1}", but its not found in the wsdl
+-     * 
++     * wsdl:binding "{0}" referenced by wsdl:port "{1}", but it's not found in the wsdl
++     *
+      */
+     public static String ENTITY_NOT_FOUND_BINDING(Object arg0, Object arg1) {
+         return localizer.localize(localizableENTITY_NOT_FOUND_BINDING(arg0, arg1));
+     }
+ 
+-    public static Localizable localizablePARSING_PARSE_FAILED() {
+-        return messageFactory.getMessage("Parsing.ParseFailed");
++    public static Localizable localizablePARSING_UNABLE_TO_GET_METADATA(Object arg0, Object arg1) {
++        return messageFactory.getMessage("parsing.unableToGetMetadata", arg0, arg1);
+     }
+ 
+     /**
+-     * Failed to parse the WSDL.
+-     * 
++     * {0}
++     *
++     * {1}
++     *
+      */
+-    public static String PARSING_PARSE_FAILED() {
+-        return localizer.localize(localizablePARSING_PARSE_FAILED());
++    public static String PARSING_UNABLE_TO_GET_METADATA(Object arg0, Object arg1) {
++        return localizer.localize(localizablePARSING_UNABLE_TO_GET_METADATA(arg0, arg1));
+     }
+ 
+-    public static Localizable localizablePARSING_UNABLE_TO_GET_METADATA(Object arg0) {
+-        return messageFactory.getMessage("parsing.unableToGetMetadata", arg0);
++    public static Localizable localizablePARSING_PARSE_FAILED() {
++        return messageFactory.getMessage("Parsing.ParseFailed");
+     }
+ 
+     /**
+-     * Unable to get Metadata from: {0}
+-     * 
++     *  Failed to parse the WSDL.
++     *
+      */
+-    public static String PARSING_UNABLE_TO_GET_METADATA(Object arg0) {
+-        return localizer.localize(localizablePARSING_UNABLE_TO_GET_METADATA(arg0));
++    public static String PARSING_PARSE_FAILED() {
++        return localizer.localize(localizablePARSING_PARSE_FAILED());
+     }
+ 
+     public static Localizable localizableVALIDATION_INVALID_PREFIX(Object arg0) {
+@@ -92,7 +94,7 @@
+ 
+     /**
+      * undeclared namespace prefix: "{0}"
+-     * 
++     *
+      */
+     public static String VALIDATION_INVALID_PREFIX(Object arg0) {
+         return localizer.localize(localizableVALIDATION_INVALID_PREFIX(arg0));
+@@ -104,7 +106,7 @@
+ 
+     /**
+      * invalid value "{1}" for attribute "{0}"
+-     * 
++     *
+      */
+     public static String PARSING_INVALID_ATTRIBUTE_VALUE(Object arg0, Object arg1) {
+         return localizer.localize(localizablePARSING_INVALID_ATTRIBUTE_VALUE(arg0, arg1));
+@@ -116,7 +118,7 @@
+ 
+     /**
+      * invalid value "{1}" for attribute "{0}"
+-     * 
++     *
+      */
+     public static String VALIDATION_INVALID_ATTRIBUTE_VALUE(Object arg0, Object arg1) {
+         return localizer.localize(localizableVALIDATION_INVALID_ATTRIBUTE_VALUE(arg0, arg1));
+@@ -128,7 +130,7 @@
+ 
+     /**
+      * invalid range found (min: {0}, max: {1})
+-     * 
++     *
+      */
+     public static String VALIDATION_INVALID_RANGE(Object arg0, Object arg1) {
+         return localizer.localize(localizableVALIDATION_INVALID_RANGE(arg0, arg1));
+@@ -140,7 +142,7 @@
+ 
+     /**
+      * expected element "{1}", found "{0}"
+-     * 
++     *
+      */
+     public static String PARSING_INVALID_TAG(Object arg0, Object arg1) {
+         return localizer.localize(localizablePARSING_INVALID_TAG(arg0, arg1));
+@@ -151,8 +153,8 @@
+     }
+ 
+     /**
+-     * wsdl:portType "{0}" referenced by wsdl:binding "{1}", but its not found in the wsdl
+-     * 
++     * wsdl:portType "{0}" referenced by wsdl:binding "{1}", but it's not found in the wsdl
++     *
+      */
+     public static String ENTITY_NOT_FOUND_PORT_TYPE(Object arg0, Object arg1) {
+         return localizer.localize(localizableENTITY_NOT_FOUND_PORT_TYPE(arg0, arg1));
+@@ -164,7 +166,7 @@
+ 
+     /**
+      * missing required attribute "{1}" of element "{0}"
+-     * 
++     *
+      */
+     public static String PARSING_MISSING_REQUIRED_ATTRIBUTE(Object arg0, Object arg1) {
+         return localizer.localize(localizablePARSING_MISSING_REQUIRED_ATTRIBUTE(arg0, arg1));
+@@ -176,7 +178,7 @@
+ 
+     /**
+      * invalid element: "{0}" (in namespace "{1}")
+-     * 
++     *
+      */
+     public static String PARSING_INVALID_ELEMENT(Object arg0, Object arg1) {
+         return localizer.localize(localizablePARSING_INVALID_ELEMENT(arg0, arg1));
+@@ -188,7 +190,7 @@
+ 
+     /**
+      * invalid element: "{0}"
+-     * 
++     *
+      */
+     public static String VALIDATION_INVALID_ELEMENT(Object arg0) {
+         return localizer.localize(localizableVALIDATION_INVALID_ELEMENT(arg0));
+@@ -199,8 +201,8 @@
+     }
+ 
+     /**
+-     * Both jaxws:version and version are present
+-     * 
++     *  Both jaxws:version and version are present
++     *
+      */
+     public static String INTERNALIZER_TWO_VERSION_ATTRIBUTES() {
+         return localizer.localize(localizableINTERNALIZER_TWO_VERSION_ATTRIBUTES());
+@@ -211,9 +213,9 @@
+     }
+ 
+     /**
+-     * Invalid WSDL, duplicate parts in a wsdl:message is not allowed. 
+-     * wsdl:message {0} has duplicated part name: "{1}"
+-     * 
++     * Invalid WSDL, duplicate parts in a wsdl:message is not allowed.
++     * wsdl:message {0} has a duplicated part name: "{1}"
++     *
+      */
+     public static String VALIDATION_DUPLICATE_PART_NAME(Object arg0, Object arg1) {
+         return localizer.localize(localizableVALIDATION_DUPLICATE_PART_NAME(arg0, arg1));
+@@ -225,7 +227,7 @@
+ 
+     /**
+      * invalid WSDL element: "{0}"
+-     * 
++     *
+      */
+     public static String PARSING_INVALID_WSDL_ELEMENT(Object arg0) {
+         return localizer.localize(localizablePARSING_INVALID_WSDL_ELEMENT(arg0));
+@@ -237,7 +239,7 @@
+ 
+     /**
+      * invalid element: "{1}", has named complexType: "{0}"
+-     * 
++     *
+      */
+     public static String VALIDATION_INVALID_COMPLEX_TYPE_IN_ELEMENT(Object arg0, Object arg1) {
+         return localizer.localize(localizableVALIDATION_INVALID_COMPLEX_TYPE_IN_ELEMENT(arg0, arg1));
+@@ -248,8 +250,8 @@
+     }
+ 
+     /**
+-     * found unexpected non whitespace text: "{0}"
+-     * 
++     * found unexpected non-whitespace text: "{0}"
++     *
+      */
+     public static String PARSING_NON_WHITESPACE_TEXT_FOUND(Object arg0) {
+         return localizer.localize(localizablePARSING_NON_WHITESPACE_TEXT_FOUND(arg0));
+@@ -260,8 +262,8 @@
+     }
+ 
+     /**
+-     * No target found for the wsdlLocation: {0}
+-     * 
++     *  No target found for the wsdlLocation: {0}
++     *
+      */
+     public static String INTERNALIZER_TARGET_NOT_FOUND(Object arg0) {
+         return localizer.localize(localizableINTERNALIZER_TARGET_NOT_FOUND(arg0));
+@@ -273,7 +275,7 @@
+ 
+     /**
+      * not a simple type: "{0}"
+-     * 
++     *
+      */
+     public static String VALIDATION_NOT_SIMPLE_TYPE(Object arg0) {
+         return localizer.localize(localizableVALIDATION_NOT_SIMPLE_TYPE(arg0));
+@@ -285,7 +287,7 @@
+ 
+     /**
+      * invalid WSDL file! failed to parse document at "{0}"
+-     * 
++     *
+      */
+     public static String PARSING_SAX_EXCEPTION_WITH_SYSTEM_ID(Object arg0) {
+         return localizer.localize(localizablePARSING_SAX_EXCEPTION_WITH_SYSTEM_ID(arg0));
+@@ -297,7 +299,7 @@
+ 
+     /**
+      * unknown required extensibility element "{0}" (in namespace "{1}")
+-     * 
++     *
+      */
+     public static String PARSING_REQUIRED_EXTENSIBILITY_ELEMENT(Object arg0, Object arg1) {
+         return localizer.localize(localizablePARSING_REQUIRED_EXTENSIBILITY_ELEMENT(arg0, arg1));
+@@ -309,7 +311,7 @@
+ 
+     /**
+      * invalid entity id: "{0}"
+-     * 
++     *
+      */
+     public static String ENTITY_NOT_FOUND_BY_ID(Object arg0) {
+         return localizer.localize(localizableENTITY_NOT_FOUND_BY_ID(arg0));
+@@ -321,7 +323,7 @@
+ 
+     /**
+      * exclusive attributes: "{0}", "{1}"
+-     * 
++     *
+      */
+     public static String VALIDATION_EXCLUSIVE_ATTRIBUTES(Object arg0, Object arg1) {
+         return localizer.localize(localizableVALIDATION_EXCLUSIVE_ATTRIBUTES(arg0, arg1));
+@@ -333,7 +335,7 @@
+ 
+     /**
+      * missing required sub-entity "{0}" of element "{1}"
+-     * 
++     *
+      */
+     public static String VALIDATION_MISSING_REQUIRED_SUB_ENTITY(Object arg0, Object arg1) {
+         return localizer.localize(localizableVALIDATION_MISSING_REQUIRED_SUB_ENTITY(arg0, arg1));
+@@ -344,8 +346,8 @@
+     }
+ 
+     /**
+-     * JAXWS version attribute must be "2.0"
+-     * 
++     *  JAXWS version attribute must be "2.0"
++     *
+      */
+     public static String INTERNALIZER_INCORRECT_VERSION() {
+         return localizer.localize(localizableINTERNALIZER_INCORRECT_VERSION());
+@@ -357,7 +359,7 @@
+ 
+     /**
+      * {0}
+-     * 
++     *
+      */
+     public static String LOCALIZED_ERROR(Object arg0) {
+         return localizer.localize(localizableLOCALIZED_ERROR(arg0));
+@@ -369,7 +371,7 @@
+ 
+     /**
+      * duplicate "{0}" entity: "{1}"
+-     * 
++     *
+      */
+     public static String ENTITY_DUPLICATE_WITH_TYPE(Object arg0, Object arg1) {
+         return localizer.localize(localizableENTITY_DUPLICATE_WITH_TYPE(arg0, arg1));
+@@ -381,7 +383,7 @@
+ 
+     /**
+      * only one of the "element" or "type" attributes is allowed in part "{0}"
+-     * 
++     *
+      */
+     public static String PARSING_ONLY_ONE_OF_ELEMENT_OR_TYPE_REQUIRED(Object arg0) {
+         return localizer.localize(localizablePARSING_ONLY_ONE_OF_ELEMENT_OR_TYPE_REQUIRED(arg0));
+@@ -393,12 +395,26 @@
+ 
+     /**
+      * expected root element "{2}" (in namespace "{3}"), found element "{0}" (in namespace "{1}")
+-     * 
++     *
+      */
+     public static String PARSING_INCORRECT_ROOT_ELEMENT(Object arg0, Object arg1, Object arg2, Object arg3) {
+         return localizer.localize(localizablePARSING_INCORRECT_ROOT_ELEMENT(arg0, arg1, arg2, arg3));
+     }
+ 
++    public static Localizable localizableTRY_WITH_MEX(Object arg0) {
++        return messageFactory.getMessage("try.with.mex", arg0);
++    }
++
++    /**
++     * {0}
++     *
++     * retrying with MEX...
++     *
++     */
++    public static String TRY_WITH_MEX(Object arg0) {
++        return localizer.localize(localizableTRY_WITH_MEX(arg0));
++    }
++
+     public static Localizable localizableVALIDATION_MISSING_REQUIRED_ATTRIBUTE(Object arg0, Object arg1) {
+         return messageFactory.getMessage("validation.missingRequiredAttribute", arg0, arg1);
+     }
+@@ -405,7 +421,7 @@
+ 
+     /**
+      * missing required attribute "{0}" of element "{1}"
+-     * 
++     *
+      */
+     public static String VALIDATION_MISSING_REQUIRED_ATTRIBUTE(Object arg0, Object arg1) {
+         return localizer.localize(localizableVALIDATION_MISSING_REQUIRED_ATTRIBUTE(arg0, arg1));
+@@ -417,7 +433,7 @@
+ 
+     /**
+      * XPath evaluation of "{0}" results in too many ({1}) target nodes
+-     * 
++     *
+      */
+     public static String INTERNALIZER_X_PATH_EVAULATES_TO_TOO_MANY_TARGETS(Object arg0, Object arg1) {
+         return localizer.localize(localizableINTERNALIZER_X_PATH_EVAULATES_TO_TOO_MANY_TARGETS(arg0, arg1));
+@@ -429,7 +445,7 @@
+ 
+     /**
+      * parsing failed: {0}
+-     * 
++     *
+      */
+     public static String PARSING_IO_EXCEPTION(Object arg0) {
+         return localizer.localize(localizablePARSING_IO_EXCEPTION(arg0));
+@@ -440,8 +456,8 @@
+     }
+ 
+     /**
+-     * not an external binding file. The root element must be '{'http://java.sun.com/xml/ns/jaxws'}'bindings but it is '{'{0}'}'{1}
+-     * 
++     *  not an external binding file. The root element must be '{'http://java.sun.com/xml/ns/jaxws'}'bindings but it is '{'{0}'}'{1}
++     *
+      */
+     public static String PARSER_NOT_A_BINDING_FILE(Object arg0, Object arg1) {
+         return localizer.localize(localizablePARSER_NOT_A_BINDING_FILE(arg0, arg1));
+@@ -453,7 +469,7 @@
+ 
+     /**
+      * undeclared namespace prefix: "{0}"
+-     * 
++     *
+      */
+     public static String PARSING_UNKNOWN_NAMESPACE_PREFIX(Object arg0) {
+         return localizer.localize(localizablePARSING_UNKNOWN_NAMESPACE_PREFIX(arg0));
+@@ -465,7 +481,7 @@
+ 
+     /**
+      * invalid WSDL file! parsing failed: {0}
+-     * 
++     *
+      */
+     public static String PARSING_FACTORY_CONFIG_EXCEPTION(Object arg0) {
+         return localizer.localize(localizablePARSING_FACTORY_CONFIG_EXCEPTION(arg0));
+@@ -477,7 +493,7 @@
+ 
+     /**
+      * missing required property "{0}" of element "{1}"
+-     * 
++     *
+      */
+     public static String VALIDATION_MISSING_REQUIRED_PROPERTY(Object arg0, Object arg1) {
+         return localizer.localize(localizableVALIDATION_MISSING_REQUIRED_PROPERTY(arg0, arg1));
+@@ -489,7 +505,7 @@
+ 
+     /**
+      * operation "{0}" has an invalid style
+-     * 
++     *
+      */
+     public static String PARSING_INVALID_OPERATION_STYLE(Object arg0) {
+         return localizer.localize(localizablePARSING_INVALID_OPERATION_STYLE(arg0));
+@@ -501,7 +517,7 @@
+ 
+     /**
+      * XPath error: {0}
+-     * 
++     *
+      */
+     public static String INTERNALIZER_X_PATH_EVALUATION_ERROR(Object arg0) {
+         return localizer.localize(localizableINTERNALIZER_X_PATH_EVALUATION_ERROR(arg0));
+@@ -513,7 +529,7 @@
+ 
+     /**
+      * invalid token "{0}"
+-     * 
++     *
+      */
+     public static String VALIDATION_INVALID_TOKEN(Object arg0) {
+         return localizer.localize(localizableVALIDATION_INVALID_TOKEN(arg0));
+@@ -525,7 +541,7 @@
+ 
+     /**
+      * invalid sub-element "{0}" of element "{1}"
+-     * 
++     *
+      */
+     public static String VALIDATION_INVALID_SUB_ENTITY(Object arg0, Object arg1) {
+         return localizer.localize(localizableVALIDATION_INVALID_SUB_ENTITY(arg0, arg1));
+@@ -537,7 +553,7 @@
+ 
+     /**
+      * internal error ("{0}")
+-     * 
++     *
+      */
+     public static String VALIDATION_SHOULD_NOT_HAPPEN(Object arg0) {
+         return localizer.localize(localizableVALIDATION_SHOULD_NOT_HAPPEN(arg0));
+@@ -548,8 +564,8 @@
+     }
+ 
+     /**
+-     * Unable to parse "{0}" : {1}
+-     * 
++     *  Unable to parse "{0}" : {1}
++     *
+      */
+     public static String ABSTRACT_REFERENCE_FINDER_IMPL_UNABLE_TO_PARSE(Object arg0, Object arg1) {
+         return localizer.localize(localizableABSTRACT_REFERENCE_FINDER_IMPL_UNABLE_TO_PARSE(arg0, arg1));
+@@ -561,7 +577,7 @@
+ 
+     /**
+      * ignoring empty Action in "{0}" {1} element of "{2}" operation, using default instead
+-     * 
++     *
+      */
+     public static String WARNING_FAULT_EMPTY_ACTION(Object arg0, Object arg1, Object arg2) {
+         return localizer.localize(localizableWARNING_FAULT_EMPTY_ACTION(arg0, arg1, arg2));
+@@ -573,7 +589,7 @@
+ 
+     /**
+      * invalid extension element: "{0}" (in namespace "{1}")
+-     * 
++     *
+      */
+     public static String PARSING_INVALID_EXTENSION_ELEMENT(Object arg0, Object arg1) {
+         return localizer.localize(localizablePARSING_INVALID_EXTENSION_ELEMENT(arg0, arg1));
+@@ -585,7 +601,7 @@
+ 
+     /**
+      * XPath evaluation of "{0}" needs to result in an element.
+-     * 
++     *
+      */
+     public static String INTERNALIZER_X_PATH_EVALUATES_TO_NON_ELEMENT(Object arg0) {
+         return localizer.localize(localizableINTERNALIZER_X_PATH_EVALUATES_TO_NON_ELEMENT(arg0));
+@@ -596,8 +612,8 @@
+     }
+ 
+     /**
+-     * XPath evaluation of "{0}" results in empty target node
+-     * 
++     * XPath evaluation of "{0}" results in an empty target node
++     *
+      */
+     public static String INTERNALIZER_X_PATH_EVALUATES_TO_NO_TARGET(Object arg0) {
+         return localizer.localize(localizableINTERNALIZER_X_PATH_EVALUATES_TO_NO_TARGET(arg0));
+@@ -609,7 +625,7 @@
+ 
+     /**
+      * invalid WSDL file! parsing failed: {0}
+-     * 
++     *
+      */
+     public static String PARSING_SAX_EXCEPTION(Object arg0) {
+         return localizer.localize(localizablePARSING_SAX_EXCEPTION(arg0));
+@@ -620,8 +636,8 @@
+     }
+ 
+     /**
+-     * Ignoring customization: "{0}", it has no namespace. It must belong to the customization namespace.    
+-     * 
++     * Ignoring customization: "{0}", because it has no namespace. It must belong to the customization namespace.
++     *
+      */
+     public static String INVALID_CUSTOMIZATION_NAMESPACE(Object arg0) {
+         return localizer.localize(localizableINVALID_CUSTOMIZATION_NAMESPACE(arg0));
+@@ -633,7 +649,7 @@
+ 
+     /**
+      * invalid attribute "{0}" of element "{1}"
+-     * 
++     *
+      */
+     public static String VALIDATION_INVALID_ATTRIBUTE(Object arg0, Object arg1) {
+         return localizer.localize(localizableVALIDATION_INVALID_ATTRIBUTE(arg0, arg1));
+@@ -645,7 +661,7 @@
+ 
+     /**
+      * invalid WSDL file! parsing failed: {0}
+-     * 
++     *
+      */
+     public static String PARSING_PARSER_CONFIG_EXCEPTION(Object arg0) {
+         return localizer.localize(localizablePARSING_PARSER_CONFIG_EXCEPTION(arg0));
+@@ -657,7 +673,7 @@
+ 
+     /**
+      * only one "types" element allowed in "{0}"
+-     * 
++     *
+      */
+     public static String PARSING_ONLY_ONE_TYPES_ALLOWED(Object arg0) {
+         return localizer.localize(localizablePARSING_ONLY_ONE_TYPES_ALLOWED(arg0));
+@@ -669,7 +685,7 @@
+ 
+     /**
+      * invalid URI: {0}
+-     * 
++     *
+      */
+     public static String PARSING_INVALID_URI(Object arg0) {
+         return localizer.localize(localizablePARSING_INVALID_URI(arg0));
+@@ -681,34 +697,34 @@
+ 
+     /**
+      * target namespace is incorrect (expected: {1}, found: {0})
+-     * 
++     *
+      */
+     public static String VALIDATION_INCORRECT_TARGET_NAMESPACE(Object arg0, Object arg1) {
+         return localizer.localize(localizableVALIDATION_INCORRECT_TARGET_NAMESPACE(arg0, arg1));
+     }
+ 
+-    public static Localizable localizableENTITY_NOT_FOUND_BY_Q_NAME(Object arg0, Object arg1) {
+-        return messageFactory.getMessage("entity.notFoundByQName", arg0, arg1);
++    public static Localizable localizableENTITY_NOT_FOUND_BY_Q_NAME(Object arg0, Object arg1, Object arg2) {
++        return messageFactory.getMessage("entity.notFoundByQName", arg0, arg1, arg2);
+     }
+ 
+     /**
+-     * invalid entity name: "{0}" (in namespace: "{1}")
+-     * 
++     * {0} "{1}" not found in the wsdl: {2}
++     *
+      */
+-    public static String ENTITY_NOT_FOUND_BY_Q_NAME(Object arg0, Object arg1) {
+-        return localizer.localize(localizableENTITY_NOT_FOUND_BY_Q_NAME(arg0, arg1));
++    public static String ENTITY_NOT_FOUND_BY_Q_NAME(Object arg0, Object arg1, Object arg2) {
++        return localizer.localize(localizableENTITY_NOT_FOUND_BY_Q_NAME(arg0, arg1, arg2));
+     }
+ 
+-    public static Localizable localizableINVALID_WSDL(Object arg0) {
+-        return messageFactory.getMessage("invalid.wsdl", arg0);
++    public static Localizable localizableINVALID_WSDL(Object arg0, Object arg1, Object arg2, Object arg3) {
++        return messageFactory.getMessage("invalid.wsdl", arg0, arg1, arg2, arg3);
+     }
+ 
+     /**
+-     * "{0} does not look like a WSDL document, retrying with MEX..."
+-     * 
++     * Invalid WSDL {0}, expected {1} found {2} at (line {3})
++     *
+      */
+-    public static String INVALID_WSDL(Object arg0) {
+-        return localizer.localize(localizableINVALID_WSDL(arg0));
++    public static String INVALID_WSDL(Object arg0, Object arg1, Object arg2, Object arg3) {
++        return localizer.localize(localizableINVALID_WSDL(arg0, arg1, arg2, arg3));
+     }
+ 
+     public static Localizable localizableVALIDATION_UNSUPPORTED_SCHEMA_FEATURE(Object arg0) {
+@@ -717,7 +733,7 @@
+ 
+     /**
+      * unsupported XML Schema feature: "{0}"
+-     * 
++     *
+      */
+     public static String VALIDATION_UNSUPPORTED_SCHEMA_FEATURE(Object arg0) {
+         return localizer.localize(localizableVALIDATION_UNSUPPORTED_SCHEMA_FEATURE(arg0));
+@@ -729,7 +745,7 @@
+ 
+     /**
+      * imported document is of unknown type: {0}
+-     * 
++     *
+      */
+     public static String PARSING_UNKNOWN_IMPORTED_DOCUMENT_TYPE(Object arg0) {
+         return localizer.localize(localizablePARSING_UNKNOWN_IMPORTED_DOCUMENT_TYPE(arg0));
+@@ -741,7 +757,7 @@
+ 
+     /**
+      * failed to parse document at "{0}"
+-     * 
++     *
+      */
+     public static String PARSING_IO_EXCEPTION_WITH_SYSTEM_ID(Object arg0) {
+         return localizer.localize(localizablePARSING_IO_EXCEPTION_WITH_SYSTEM_ID(arg0));
+@@ -753,7 +769,7 @@
+ 
+     /**
+      * ambiguous operation name: "{0}"
+-     * 
++     *
+      */
+     public static String VALIDATION_AMBIGUOUS_NAME(Object arg0) {
+         return localizer.localize(localizableVALIDATION_AMBIGUOUS_NAME(arg0));
+@@ -765,7 +781,7 @@
+ 
+     /**
+      * default namespace must be "{0}"
+-     * 
++     *
+      */
+     public static String PARSING_WSDL_NOT_DEFAULT_NAMESPACE(Object arg0) {
+         return localizer.localize(localizablePARSING_WSDL_NOT_DEFAULT_NAMESPACE(arg0));
+@@ -777,7 +793,7 @@
+ 
+     /**
+      * duplicated element: "{0}"
+-     * 
++     *
+      */
+     public static String VALIDATION_DUPLICATED_ELEMENT(Object arg0) {
+         return localizer.localize(localizableVALIDATION_DUPLICATED_ELEMENT(arg0));
+@@ -788,8 +804,8 @@
+     }
+ 
+     /**
+-     * Target node is not an element
+-     * 
++     *  Target node is not an element
++     *
+      */
+     public static String INTERNALIZER_TARGET_NOT_AN_ELEMENT() {
+         return localizer.localize(localizableINTERNALIZER_TARGET_NOT_AN_ELEMENT());
+@@ -801,7 +817,7 @@
+ 
+     /**
+      * ignoring empty Action in {0} element of "{1}" operation, using default instead
+-     * 
++     *
+      */
+     public static String WARNING_INPUT_OUTPUT_EMPTY_ACTION(Object arg0, Object arg1) {
+         return localizer.localize(localizableWARNING_INPUT_OUTPUT_EMPTY_ACTION(arg0, arg1));
+@@ -813,7 +829,7 @@
+ 
+     /**
+      * Invalid WSDL at {4}: expected element "{2}" (in namespace "{3}"), found element "{0}" (in namespace "{1}")
+-     * 
++     *
+      */
+     public static String PARSING_INVALID_TAG_NS(Object arg0, Object arg1, Object arg2, Object arg3, Object arg4) {
+         return localizer.localize(localizablePARSING_INVALID_TAG_NS(arg0, arg1, arg2, arg3, arg4));
+@@ -825,7 +841,7 @@
+ 
+     /**
+      * "Not a WSDL document: {0}, it gives "{1}", retrying with MEX..."
+-     * 
++     *
+      */
+     public static String INVALID_WSDL_WITH_DOOC(Object arg0, Object arg1) {
+         return localizer.localize(localizableINVALID_WSDL_WITH_DOOC(arg0, arg1));
+@@ -837,7 +853,7 @@
+ 
+     /**
+      * Failed to get WSDL components, probably {0} is not a valid WSDL file.
+-     * 
++     *
+      */
+     public static String PARSING_NOT_AWSDL(Object arg0) {
+         return localizer.localize(localizablePARSING_NOT_AWSDL(arg0));
+@@ -849,7 +865,7 @@
+ 
+     /**
+      * duplicate entity: "{0}"
+-     * 
++     *
+      */
+     public static String ENTITY_DUPLICATE(Object arg0) {
+         return localizer.localize(localizableENTITY_DUPLICATE(arg0));
+@@ -860,8 +876,8 @@
+     }
+ 
+     /**
+-     * Not a WSI-BP compliant WSDL (R2001, R2004). xsd:import must not import XML Schema definition emmbedded inline within WSDLDocument.
+-     * 
++     * Not a WSI-BP compliant WSDL (R2001, R2004). xsd:import must not import XML Schema definitions embedded inline within the WSDL document.
++     *
+      */
+     public static String WARNING_WSI_R_2004() {
+         return localizer.localize(localizableWARNING_WSI_R_2004());
+@@ -872,8 +888,8 @@
+     }
+ 
+     /**
+-     * Not a WSI-BP compliant WSDL (R2003). xsd:import must only be used inside xsd:schema element.
+-     * 
++     * Not a WSI-BP compliant WSDL (R2003). xsd:import must only be used inside xsd:schema elements.
++     *
+      */
+     public static String WARNING_WSI_R_2003() {
+         return localizer.localize(localizableWARNING_WSI_R_2003());
+@@ -884,8 +900,8 @@
+     }
+ 
+     /**
+-     * Not a WSI-BP compliant WSDL (R2002). wsdl:import must not be used to import XML Schema embedded in the WSDL document. Expected wsdl namesapce: {0}, found: {1}
+-     * 
++     * Not a WSI-BP compliant WSDL (R2002). wsdl:import must not be used to import XML Schema embedded in the WSDL document. Expected wsdl namespace: {0}, found: {1}
++     *
+      */
+     public static String WARNING_WSI_R_2002(Object arg0, Object arg1) {
+         return localizer.localize(localizableWARNING_WSI_R_2002(arg0, arg1));
+@@ -897,24 +913,36 @@
+ 
+     /**
+      * warning: part {0} is ignored, either the "element" or the "type" attribute is required in part "{0}"
+-     * 
++     *
+      */
+     public static String PARSING_ELEMENT_OR_TYPE_REQUIRED(Object arg0) {
+         return localizer.localize(localizablePARSING_ELEMENT_OR_TYPE_REQUIRED(arg0));
+     }
+ 
+-    public static Localizable localizableWARNING_WSI_R_2001(Object arg0) {
+-        return messageFactory.getMessage("warning.wsi.r2001", arg0);
++    public static Localizable localizableWARNING_WSI_R_2001() {
++        return messageFactory.getMessage("warning.wsi.r2001");
+     }
+ 
+     /**
+-     * Not a WSI-BP compliant WSDL (R2001, R2002). wsdl:import must only import WSDL document. Its trying to import: "{0}"
+-     * 
++     * Not a WSI-BP compliant WSDL (R2001, R2002). wsdl:import must import only WSDL documents. It's trying to import: "{0}"
++     *
+      */
+-    public static String WARNING_WSI_R_2001(Object arg0) {
+-        return localizer.localize(localizableWARNING_WSI_R_2001(arg0));
++    public static String WARNING_WSI_R_2001() {
++        return localizer.localize(localizableWARNING_WSI_R_2001());
+     }
+ 
++    public static Localizable localizableFILE_NOT_FOUND(Object arg0) {
++        return messageFactory.getMessage("file.not.found", arg0);
++    }
++
++    /**
++     * {0} is unreachable
++     *
++     */
++    public static String FILE_NOT_FOUND(Object arg0) {
++        return localizer.localize(localizableFILE_NOT_FOUND(arg0));
++    }
++
+     public static Localizable localizableVALIDATION_INVALID_SIMPLE_TYPE_IN_ELEMENT(Object arg0, Object arg1) {
+         return messageFactory.getMessage("validation.invalidSimpleTypeInElement", arg0, arg1);
+     }
+@@ -921,7 +949,7 @@
+ 
+     /**
+      * invalid element: "{1}", has named simpleType: "{0}"
+-     * 
++     *
+      */
+     public static String VALIDATION_INVALID_SIMPLE_TYPE_IN_ELEMENT(Object arg0, Object arg1) {
+         return localizer.localize(localizableVALIDATION_INVALID_SIMPLE_TYPE_IN_ELEMENT(arg0, arg1));
+@@ -933,7 +961,7 @@
+ 
+     /**
+      * only one "documentation" element allowed in "{0}"
+-     * 
++     *
+      */
+     public static String PARSING_ONLY_ONE_DOCUMENTATION_ALLOWED(Object arg0) {
+         return localizer.localize(localizablePARSING_ONLY_ONE_DOCUMENTATION_ALLOWED(arg0));
+@@ -944,13 +972,27 @@
+     }
+ 
+     /**
+-     * JAXWS version attribute must be present
+-     * 
++     *  JAXWS version attribute must be present
++     *
+      */
+     public static String INTERNALIZER_VERSION_NOT_PRESENT() {
+         return localizer.localize(localizableINTERNALIZER_VERSION_NOT_PRESENT());
+     }
+ 
++    public static Localizable localizableFAILED_NOSERVICE(Object arg0) {
++        return messageFactory.getMessage("failed.noservice", arg0);
++    }
++
++    /**
++     * failed.noservice=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.
++     *
++     */
++    public static String FAILED_NOSERVICE(Object arg0) {
++        return localizer.localize(localizableFAILED_NOSERVICE(arg0));
++    }
++
+     public static Localizable localizablePARSING_TOO_MANY_ELEMENTS(Object arg0, Object arg1, Object arg2) {
+         return messageFactory.getMessage("parsing.tooManyElements", arg0, arg1, arg2);
+     }
+@@ -957,7 +999,7 @@
+ 
+     /**
+      * too many "{0}" elements under "{1}" element "{2}"
+-     * 
++     *
+      */
+     public static String PARSING_TOO_MANY_ELEMENTS(Object arg0, Object arg1, Object arg2) {
+         return localizer.localize(localizablePARSING_TOO_MANY_ELEMENTS(arg0, arg1, arg2));
+@@ -968,8 +1010,8 @@
+     }
+ 
+     /**
+-     * "{0}" is not a part of this compilation. Is this a mistake for "{1}"?
+-     * 
++     *  "{0}" is not a part of this compilation. Is this a mistake for "{1}"?
++     *
+      */
+     public static String INTERNALIZER_INCORRECT_SCHEMA_REFERENCE(Object arg0, Object arg1) {
+         return localizer.localize(localizableINTERNALIZER_INCORRECT_SCHEMA_REFERENCE(arg0, arg1));
+--- old/src/share/classes/com/sun/tools/internal/ws/resources/configuration.properties	Thu Jul 30 17:17:55 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/configuration.properties	Thu Jul 30 17:17:55 2009
+@@ -25,4 +25,3 @@
+ 
+ configuration.invalidElement=invalid element \"{2}\" in file \"{0}\" (line {1})
+ configuration.notBindingFile=Ignoring: binding file "\"{0}\". It is not a jaxws or a jaxb binding file.
+- 
+--- old/src/share/classes/com/sun/tools/internal/ws/resources/generator.properties	Thu Jul 30 17:17:59 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/generator.properties	Thu Jul 30 17:17:58 2009
+@@ -32,4 +32,5 @@
+ 
+ #IndentingWriter
+ generator.indentingwriter.charset.cantencode=WSDL has some characters which native java encoder can''t encode: \"{0}\"
+- 
++generator.sei.classAlreadyExist=Could not generate SEI, class: {0} already exists. Rename wsdl:portType \"{1}\" using JAX-WS customization
++generator.service.classAlreadyExist=Could not generate Service, class: {0} already exists. Rename wsdl:Service \"{1}\" using JAX-WS customization
+--- old/src/share/classes/com/sun/tools/internal/ws/resources/javacompiler.properties	Thu Jul 30 17:18:02 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/javacompiler.properties	Thu Jul 30 17:18:01 2009
+@@ -29,4 +29,3 @@
+ javacompiler.classpath.error={0} is not available in the classpath, requires Sun's JDK version 5.0 or latter.
+ javacompiler.nosuchmethod.error=There is no such method {0} available, requires Sun's JDK version 5.0 or latter.
+ javacompiler.error=error : {0}.
+- 
+--- old/src/share/classes/com/sun/tools/internal/ws/resources/model.properties	Thu Jul 30 17:18:05 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/model.properties	Thu Jul 30 17:18:05 2009
+@@ -58,7 +58,6 @@
+ 
+ model.uniqueness=uniqueness constraint violation
+ model.part.notUnique=parts in wsdl:message \"{0}\", reference \"{1}\", they must reference unique global elements.
+-model.parameter.notunique=Failed to generate Java signature: duplicate parameter names {0}. Use JAXWS binding customization to rename the wsdl:part \"{1}\"
+ model.exception.notunique=Failed to generate Java signature: duplicate exception names {0}. Use JAXWS binding customization to rename the wsdl:part \"{1}\"
+ model.uniqueness.javastructuretype=uniqueness constraint violation, duplicate member \"{0}\" added to JavaStructureType \"{1}\"
+ model.parent.type.already.set=parent of type \"{0}\" already set to \"{1}\", new value = \"{2}\"
+@@ -78,15 +77,16 @@
+ model.arraywrapper.no.subtypes=LiteralArrayWrapper cannot have subtypes
+ model.arraywrapper.no.content.member=LiteralArrayWrapper cannot have a content member
+ model.complexType.simpleContent.reservedName=invalid attribute name: "_value" in complexType: \"{0}\", _value is JAXWS reserved name, this name is generated in the generated javabean class to hold content value in the generated javabean class for complexType/simpleContent.
++model.parameter.notunique.wrapper=Failed to generate Java signature: duplicate parameter name \"{0}\". Try one of these\n\t1. Use JAXWS binding customization to rename the wsdl:part \"{1}\"\n\t2. Run wsimport with -extension switch.\n\t3. This is wrapper style operation, to resolve parameter name conflict, you can also try disabling wrapper style by using <jaxws:enableWrapperStyle>false</jaxws:enableWrapperStyle> wsdl customization.
++model.parameter.notunique=Failed to generate Java signature: duplicate parameter name \"{0}\". Try one of these\n\t1. Use JAXWS binding customization to rename the wsdl:part \"{1}\"\n\t2. Run wsimport with -extension switch.
+ 
+-//JAXWS 2.0
++#JAXWS 2.0
+ model.schema.elementNotFound=Element \"{0}\" not found.
+ model.schema.jaxbException.message="{0}"
+ model.saxparser.exception:{0}\n{1}
+ 
+ ConsoleErrorReporter.UnknownLocation = \
+-	unknown location
++        unknown location
+ 
+ ConsoleErrorReporter.LineXOfY = \
+-	\ \ line {0} of {1}
+- 
++        \ \ line {0} of {1}
+--- old/src/share/classes/com/sun/tools/internal/ws/resources/modeler.properties	Thu Jul 30 17:18:09 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/modeler.properties	Thu Jul 30 17:18:08 2009
+@@ -65,9 +65,9 @@
+ wsdlmodeler.warning.noPortsInService=Service \"{0}\" does not contain any usable ports. try running wsimport with -extension switch.
+ wsdlmodeler.warning.noOperationsInPort=Port \"{0}\" does not contain any usable operations
+ wsdlmodeler.warning.ignoringNonSOAPPort=ignoring port \"{0}\": not a standard SOAP port. try running wsimport with -extension switch.
+-wsdlmodeler.warning.nonSOAPPort=port \"{0}\": not a standard SOAP port. The generated artifacts may not work with JAXWS runtime. 
++wsdlmodeler.warning.nonSOAPPort=port \"{0}\": not a standard SOAP port. The generated artifacts may not work with JAXWS runtime.
+ wsdlmodeler.warning.ignoringNonSOAPPort.noAddress=ignoring port \"{0}\": no SOAP address specified. try running wsimport with -extension switch.
+-wsdlmodeler.warning.noSOAPAddress=port \"{0}\" is not a SOAP port, it has no soap:address 
++wsdlmodeler.warning.noSOAPAddress=port \"{0}\" is not a SOAP port, it has no soap:address
+ wsdlmodeler.warning.ignoringSOAPBinding.nonHTTPTransport:ignoring SOAP port \"{0}\": unrecognized transport. try running wsimport with -extension switch.
+ 
+ #BP1.1 R2705
+@@ -189,7 +189,7 @@
+ mimemodeler.invalidMimePart.nameNotAllowed=name attribute on wsdl:part in Operation \"{0}\" is ignored. Its not allowed as per WS-I AP 1.0.
+ 
+ 
+-wsdlmodeler20.rpcenc.not.supported=rpc/encoded wsdl's are not supported in JAXWS 2.0. 
++wsdlmodeler20.rpcenc.not.supported=rpc/encoded wsdl's are not supported in JAXWS 2.0.
+ wsdlmodeler.warning.ignoringOperation.notNCName=Ignoring operation \"{0}\", it has illegal character ''{1}'' in its name. Its rpc-literal operation - jaxws won't be able to serialize it!
+ 
+ wsdlmodeler.warning.ignoringOperation.javaReservedWordNotAllowed.nonWrapperStyle=Ignoring operation \"{0}\", can''t generate java method. Parameter: part "{2}\" in wsdl:message \"{1}\", is a java keyword. Use customization to change the parameter name or change the wsdl:part name.
+@@ -207,11 +207,12 @@
+ wsdlmodeler.warning.ignoringOperation.javaReservedWordNotAllowed.customizedOperationName=Ignoring operation \"{0}\", can''t generate java method ,customized name \"{1}\" of the wsdl:operation is a java keyword.
+ wsdlmodeler.invalid.operation.javaReservedWordNotAllowed.customizedOperationName=Invalid operation \"{0}\", can''t generate java method ,customized name \"{1}\" of the wsdl:operation is a java keyword.
+ 
+-wsdlmodeler.jaxb.javatype.notfound=Schema descriptor {0} in message part \"{1}\" could not be bound to Java!
++wsdlmodeler.jaxb.javatype.notfound=Schema descriptor {0} in message part \"{1}\" is not defined and could not be bound to Java. Perhaps the schema descriptor {0} is not defined in the schema imported/included in the WSDL. You can either add such imports/includes or run wsimport and provide the schema location using -b switch.
+ wsdlmodeler.unsupportedBinding.mime=WSDL MIME binding is not currently supported!
+ 
+-wsdlmodeler.nonUnique.body=Non unique body parts! In a port, operations must have unique operation signaure on the wire for successful dispatch. In port {0}, Operations \"{1}\" and \"{2}\" have the same request body block {3}
+-wsdlmodeler.rpclit.unkownschematype=XML type \"{0}\" could not be resolved, XML to JAVA binding failed! Please check the wsdl:part \"{1}\" in the wsdl:message \"{2}\".    
++wsdlmodeler.nonUnique.body.error=Non unique body parts! In a port, as per BP 1.1 R2710 operations must have unique operation signaure on the wire for successful dispatch. In port {0}, Operations \"{1}\" and \"{2}\" have the same request body block {3}. Try running wsimport with -extension switch, runtime will try to dispatch using SOAPAction
++wsdlmodeler.nonUnique.body.warning=Non unique body parts! In a port, as per BP 1.1 R2710 operations must have unique operation signaure on the wire for successful dispatch. In port {0}, Operations \"{1}\" and \"{2}\" have the same request body block {3}. Method dispatching may fail, runtime will try to dispatch using SOAPAction
+ 
++wsdlmodeler.rpclit.unkownschematype=XML type \"{0}\" could not be resolved, XML to JAVA binding failed! Please check the wsdl:part \"{1}\" in the wsdl:message \"{2}\".
++
+ wsdlmodeler.responsebean.notfound=wsimport failed to generate async response bean for operation: {0}
+- 
+--- old/src/share/classes/com/sun/tools/internal/ws/resources/processor.properties	Thu Jul 30 17:18:13 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/processor.properties	Thu Jul 30 17:18:12 2009
+@@ -24,4 +24,3 @@
+ #
+ 
+ processor.missing.model=model is missing
+- 
+--- old/src/share/classes/com/sun/tools/internal/ws/resources/util.properties	Thu Jul 30 17:18:16 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/util.properties	Thu Jul 30 17:18:15 2009
+@@ -26,4 +26,3 @@
+ holder.valuefield.not.found=Could not find the field in the Holder that contains the Holder''s value: {0}
+ null.namespace.found=Encountered error in wsdl. Check namespace of element <{0}>
+ sax2dom.notsupported.createelement=SAX2DOMEx.DomImplDoesntSupportCreateElementNs: {0}
+- 
+--- old/src/share/classes/com/sun/tools/internal/ws/resources/webserviceap.properties	Thu Jul 30 17:18:20 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/webserviceap.properties	Thu Jul 30 17:18:19 2009
+@@ -50,7 +50,7 @@
+ webserviceap.oneway.operation.cannot.have.holders=The method {1} of class {0} is annotated @Oneway but contains inout or out paramerters (javax.xml.ws.Holder)
+ 
+ webserviceap.oneway.operation.cannot.declare.exceptions=The method {1} of class {0} is annotated @Oneway but declares the exception {2}
+-  
++
+ webserviceap.cannot.combine.handlerchain.soapmessagehandlers=You cannot specify both HanlderChain and SOAPMessageHandlers annotations
+ 
+ webserviceap.invalid.handlerchain.file.nohandler-config=The handlerchain file {0} is invalid, it does not contain a handler-config element
+@@ -109,19 +109,19 @@
+ 
+ webserviceap.mixed.binding.style=Class\: {0} contains mixed bindings.  SOAPBinding.Style.RPC and SOAPBinding.Style.DOCUMENT cannot be mixed.
+ 
+-webserviceap.endpointinteface.plus.annotation=The @{0} annotation cannot be used in with @javax.jws.WebService.endpointInterface element. 
++webserviceap.endpointinteface.plus.annotation=The @{0} annotation cannot be used in with @javax.jws.WebService.endpointInterface element.
+ 
+-webserviceap.endpointinteface.plus.element=The @javax.jws.WebService.{0} element cannot be used in with @javax.jws.WebService.endpointInterface element. 
++webserviceap.endpointinteface.plus.element=The @javax.jws.WebService.{0} element cannot be used in with @javax.jws.WebService.endpointInterface element.
+ 
+-webserviceap.non.in.parameters.must.be.holder=Class:\ {0}, method: {1}, parameter: {2} is not WebParam.Mode.IN and is not of type javax.xml.ws.Holder. 
++webserviceap.non.in.parameters.must.be.holder=Class:\ {0}, method: {1}, parameter: {2} is not WebParam.Mode.IN and is not of type javax.xml.ws.Holder.
+ 
+-webserviceap.invalid.sei.annotation.element=The @javax.jws.WebService.{0} element cannot be specified on a service endpoint interface. Class\: {1} 
++webserviceap.invalid.sei.annotation.element=The @javax.jws.WebService.{0} element cannot be specified on a service endpoint interface. Class\: {1}
+ 
+-webserviceap.invalid.sei.annotation=The @{0} annotation cannot be used on a service endpoint interface. Class\: {1} 
++webserviceap.invalid.sei.annotation=The @{0} annotation cannot be used on a service endpoint interface. Class\: {1}
+ 
+ webserviceap.invalid.sei.annotation.element.exclude=The @javax.jws.WebMethod({0}) cannot be used on a service endpoint interface. Class\: {1} method\: {2}
+ 
+-webserviceap.invalid.webmethod.element.with.exclude=The @javax.jws.WebMethod.{0} element cannot be specified with the @javax.jws.WebMethod.exclude element. Class\: {1} method\: {2} 
++webserviceap.invalid.webmethod.element.with.exclude=The @javax.jws.WebMethod.{0} element cannot be specified with the @javax.jws.WebMethod.exclude element. Class\: {1} method\: {2}
+ 
+ webserviceap.doc.bare.no.out=Document/literal bare methods with no return type or OUT/INOUT parameters must be annotated as @Oneway. Class\: {0}, method: {1}
+ webserviceap.doc.bare.return.and.out=Document/literal bare methods cannot have a return type and out parameters. Class\: {0}, method: {1}
+@@ -137,15 +137,17 @@
+ 
+ webserviceap.webservice.method.is.abstract=Classes annotated with @javax.jws.WebService must not have abstract methods. Class\: {0} Method: {1}
+ 
+-#webserviceap.doc.bare.return.and.out=Document literal bare methods must not have a return value and an OUT/INOUT parameter.  Class\: {0} Method\: {1} 
++webserviceap.webservice.method.is.static.or.final=Method annotated with @javax.jws.WebMethod must not be static or final. Class\: {0} Method: {1}
+ 
++#webserviceap.doc.bare.return.and.out=Document literal bare methods must not have a return value and an OUT/INOUT parameter.  Class\: {0} Method\: {1}
++
+ webserviceap.webservice.no.default.constructor=Classes annotated with @javax.jws.WebService must have a public default constructor. Class\: {0}
+ 
+-webserviceap.oneway.and.not.one.in=Document literal bare methods annotated with @javax.jws.Oneway must have one non-header IN parameter.  Class\: {0} Method\: {1} 
++webserviceap.oneway.and.not.one.in=Document literal bare methods annotated with @javax.jws.Oneway must have one non-header IN parameter.  Class\: {0} Method\: {1}
+ 
+-webserviceap.doc.bare.no.return.and.no.out=Document literal bare methods that do not have a return value must have a single OUT/INOUT parameter.  Class\: {0} Method\: {1} 
++webserviceap.doc.bare.no.return.and.no.out=Document literal bare methods that do not have a return value must have a single OUT/INOUT parameter.  Class\: {0} Method\: {1}
+ 
+-webserviceap.doc.bare.and.no.one.in=Document literal bare methods must have one non-header, IN/INOUT parameter.  Class\: {0} Method\: {1} 
++webserviceap.doc.bare.and.no.one.in=Document literal bare methods must have one non-header, IN/INOUT parameter.  Class\: {0} Method\: {1}
+ 
+ webserviceap.method.not.implemented=Methods in an endpointInterface must be implemented in the implementation class.  Interface Class\:{0} Implementation Class\:{1} Method\: {2}
+ 
+@@ -152,4 +154,3 @@
+ webserviceap.no.package.class.must.have.targetnamespace=@javax.jws.Webservice annotated classes that do not belong to a package must have the @javax.jws.Webservice.targetNamespace element.  Class\: {0}
+ 
+ webserviceap.webservice.and.webserviceprovider=Classes cannot be annotated with both @javax.jws.WebService and @javax.xml.ws.WebServiceProvider.  Class\: {0}
+- 
+--- old/src/share/classes/com/sun/tools/internal/ws/resources/wscompile.properties	Thu Jul 30 17:18:23 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/wscompile.properties	Thu Jul 30 17:18:23 2009
+@@ -44,13 +44,23 @@
+ \  -p <pkg>                  specifies the target package\n\
+ \  -quiet                    suppress wsimport output\n\
+ \  -s <directory>            specify where to place generated source files\n\
+-\  -target <version>         generate code as per the given JAXWS specification version.\n\
+-\                            version 2.0 will generate compliant code for JAXWS 2.0 spec.\n\
++\  -target <version>         generate code as per the given JAXWS spec version\n\
++\                            e.g. 2.0 will generate compliant code for JAXWS 2.0 spec\n\
+ \  -verbose                  output messages about what the compiler is doing\n\
+ \  -version                  print version information\n\
+ \  -wsdllocation <location>  @WebServiceClient.wsdlLocation value\n\
+ 
++wsimport.usage.extensions=\n\
++\Extensions:\n\
++\  -XadditionalHeaders         map headers not bound to request or response message to \n\
++\                              Java method parameters\n\
++\  -Xauthfile                  file to carry authorization information in the format \n\
++\                              http://username:password@example.org/stock?wsdl\n\
++\  -Xdebug                     print debug information\n\
++\  -Xno-addressing-databinding enable binding of W3C EndpointReferenceType to Java\n\
++\  -Xnocompile                 do not compile generated Java files\n\
+ 
++
+ wsimport.usage.examples=\n\
+ \Examples:\n\
+ \  wsimport stock.wsdl -b stock.xml -b stock.xjb\n\
+@@ -76,15 +86,18 @@
+ \  -s <directory>             specify where to place generated source files\n\
+ \  -verbose                   output messages about what the compiler is doing\n\
+ \  -version                   print version information\n\
+-\  -wsdl[:protocol]           generate a WSDL file.  The protocol is optional.\n\
+-\                             Valid protocols are soap1.1 and Xsoap1.2, the default\n\
+-\                             is soap1.1.  Xsoap1.2 is not standard and can only be\n\
+-\                             used in conjunction with the -extension option\n\
++\  -wsdl[:protocol]           generate a WSDL file. The protocol is optional.\n\
++\                             Valid protocols are {1},\n\
++\                             the default is soap1.1.\n\
++\                             The non stanadard protocols {2}\n\
++\                             can only be used in conjunction with the\n\
++\                             -extension option.\n\
+ \  -servicename <name>        specify the Service name to use in the generated WSDL\n\
+ \                             Used in conjunction with the -wsdl option.\n\
+ \  -portname <name>           specify the Port name to use in the generated WSDL\n\
+ \                             Used in conjunction with the -wsdl option.
+ 
++
+ wsgen.usage.examples=\n\
+ \Examples:\n\
+ \  wsgen -cp . example.Stock\n\
+@@ -93,7 +106,7 @@
+ wrapperTask.needEndorsed=\
+ You are running on JDK6 which comes with JAX-WS 2.0 API, but this tool requires JAX-WS 2.1 API. \
+ Use the endorsed standards override mechanism (http://java.sun.com/javase/6/docs/technotes/guides/standards/), \
+-or set xendorsed="true" on <{0}>. 
++or set xendorsed="true" on <{0}>.
+ 
+ wrapperTask.loading20Api=\
+ You are loading JAX-WS 2.0 API from {0} but this tool requires JAX-WS 2.1 API.
+@@ -126,7 +139,8 @@
+ wsgen.could.not.create.file="Could not create file: "\{0}\"
+ wsgen.missingFile=Missing SEI
+ wsgen.soap12.without.extension=The optional protocol \"Xsoap1.2\" must be used in conjunction with the \"-extension\" option.
+-wsgen.wsdl.arg.no.genwsdl=The \"{0}\" option can only be in conjunction with the "-wsdl" option. 
++wsgen.protocol.without.extension=The optional protocol \"{0}\" must be used in conjunction with the \"-extension\" option.
++wsgen.wsdl.arg.no.genwsdl=The \"{0}\" option can only be in conjunction with the "-wsdl" option.
+ wsgen.servicename.missing.namespace=The service name \"{0}\" is missing a namespace.
+ wsgen.servicename.missing.localname=The service name \"{0}\" is missing a localname.
+ wsgen.portname.missing.namespace=The port name \"{0}\" is missing a namespace.
+@@ -151,17 +165,41 @@
+     Failed to parse "{0}": {1}
+ 
+ wsimport.ParsingWSDL=parsing WSDL...\n\n
+-wsimport.GeneratingCode=generating code...
+-
++wsimport.GeneratingCode=generating code...\n
++wsimport.CompilingCode=\ncompiling code...\n
+ wsimport.ILLEGAL_TARGET_VERSION = \
+     "{0}" is not a valid target version. "2.0" and "2.1" are supported.
+ 
++wsimport.ILLEGAL_AUTH_INFO = \
++    "{0}" is not a valid authorization information format. The format is http[s]://user:password@host:port//<url-path>.
++
++wsimport.readingAuthFile = \
++  Trying to read authorization file : "{0}"...
++
++wsimport.authFileNotFound = \
++  Authorization file "{0}" not found. If the WSDL access needs Basic Authentication, please provide authorization file with read access at {1} or use -Xauthfile to give the authorization file and on each line provide authorization information using this format : http[s]://user:password@host:port//<url-path>
++
++wsimport.authInfoNeeded = \
++  {0},  "{1}" needs authorization, please provide authorization file with read access at {2} or use -Xauthfile to give the authorization file and on each line provide authorization information using this format : http[s]://user:password@host:port//<url-path>
++
++wsimport.AUTH_INFO_LINENO = \
++  "line {0} of {1}
++
++
+ wsimport.ErrorMessage = \
+-	[ERROR] {0}
++        [ERROR] {0}
+ 
+ wsimport.WarningMessage = \
+-	[WARNING] {0}
++        [WARNING] {0}
+ 
+ wsimport.InfoMessage = \
+-	[INFO] {0}
+- 
++        [INFO] {0}
++
++wsimport.DebugMessage = \
++        [DEBUG] {0}
++
++wsimport.httpRedirect = \
++  Server returned HTTP Status code: "{0}", retrying with "{1}"
++
++wsimport.maxRedirectAttempt = \
++  Can not get a WSDL maximum number of redirects(5) reached
+--- old/src/share/classes/com/sun/tools/internal/ws/resources/wsdl.properties	Thu Jul 30 17:18:27 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/resources/wsdl.properties	Thu Jul 30 17:18:26 2009
+@@ -41,7 +41,6 @@
+ parsing.unknownNamespacePrefix=undeclared namespace prefix: \"{0}\"
+ parsing.invalidURI=invalid URI: {0}
+ parsing.ioExceptionWithSystemId=failed to parse document at \"{0}\"
+-parsing.unableToGetMetadata= Unable to get Metadata from: {0}
+ parsing.ioException=parsing failed: {0}
+ parsing.saxExceptionWithSystemId=invalid WSDL file! failed to parse document at \"{0}\"
+ parsing.saxException=invalid WSDL file! parsing failed: {0}
+@@ -52,7 +51,7 @@
+ parsing.missingRequiredAttribute=missing required attribute \"{1}\" of element \"{0}\"
+ parsing.invalidTag=expected element \"{1}\", found \"{0}\"
+ parsing.invalidTagNS=Invalid WSDL at {4}: expected element \"{2}\" (in namespace \"{3}\"), found element \"{0}\" (in namespace \"{1}\")
+-parsing.nonWhitespaceTextFound=found unexpected non whitespace text: \"{0}\"
++parsing.nonWhitespaceTextFound=found unexpected non-whitespace text: \"{0}\"
+ parsing.elementExpected=unexpected non-element found
+ #
+ entity.duplicate=duplicate entity: \"{0}\"
+@@ -59,9 +58,9 @@
+ entity.duplicateWithType=duplicate \"{0}\" entity: \"{1}\"
+ 
+ entity.notFoundByID=invalid entity id: \"{0}\"
+-entity.notFoundByQName=invalid entity name: \"{0}\" (in namespace: \"{1}\")
+-entity.notFound.portType=wsdl:portType \"{0}\" referenced by wsdl:binding \"{1}\", but its not found in the wsdl
+-entity.notFound.binding=wsdl:binding \"{0}" referenced by wsdl:port \"{1}\", but its not found in the wsdl
++entity.notFoundByQName={0} \"{1}\" not found in the wsdl: {2}
++entity.notFound.portType=wsdl:portType \"{0}\" referenced by wsdl:binding \"{1}\", but it's not found in the wsdl
++entity.notFound.binding=wsdl:binding \"{0}" referenced by wsdl:port \"{1}\", but it's not found in the wsdl
+ 
+ #
+ validation.missingRequiredAttribute=missing required attribute \"{0}\" of element \"{1}\"
+@@ -71,7 +70,7 @@
+ validation.invalidComplexTypeInElement=invalid element: \"{1}\", has named complexType: \"{0}\"
+ validation.invalidSimpleTypeInElement=invalid element: \"{1}\", has named simpleType: \"{0}\"
+ validation.duplicatedElement=duplicated element: \"{0}\"
+-validation.duplicatePartName=Invalid WSDL, duplicate parts in a wsdl:message is not allowed. \nwsdl:message {0} has duplicated part name: \"{1}\"
++validation.duplicatePartName=Invalid WSDL, duplicate parts in a wsdl:message is not allowed. \nwsdl:message {0} has a duplicated part name: \"{1}\"
+ validation.invalidSubEntity=invalid sub-element \"{0}\" of element \"{1}\"
+ validation.invalidAttribute=invalid attribute \"{0}\" of element \"{1}\"
+ validation.invalidAttributeValue=invalid value \"{1}\" for attribute \"{0}\"
+@@ -88,51 +87,54 @@
+ warning.inputOutputEmptyAction=ignoring empty Action in {0} element of \"{1}\" operation, using default instead
+ 
+ #wsi compliant WSDL warnings
+-warning.wsi.r2001=Not a WSI-BP compliant WSDL (R2001, R2002). wsdl:import must only import WSDL document. Its trying to import: \"{0}\"
+-warning.wsi.r2002=Not a WSI-BP compliant WSDL (R2002). wsdl:import must not be used to import XML Schema embedded in the WSDL document. Expected wsdl namesapce: {0}, found: {1}
+-warning.wsi.r2003=Not a WSI-BP compliant WSDL (R2003). xsd:import must only be used inside xsd:schema element.
+-warning.wsi.r2004=Not a WSI-BP compliant WSDL (R2001, R2004). xsd:import must not import XML Schema definition emmbedded inline within WSDLDocument.
++warning.wsi.r2001=Not a WSI-BP compliant WSDL (R2001, R2002). wsdl:import must import only WSDL documents. It's trying to import: \"{0}\"
++warning.wsi.r2002=Not a WSI-BP compliant WSDL (R2002). wsdl:import must not be used to import XML Schema embedded in the WSDL document. Expected wsdl namespace: {0}, found: {1}
++warning.wsi.r2003=Not a WSI-BP compliant WSDL (R2003). xsd:import must only be used inside xsd:schema elements.
++warning.wsi.r2004=Not a WSI-BP compliant WSDL (R2001, R2004). xsd:import must not import XML Schema definitions embedded inline within the WSDL document.
+ 
+ #Parser
+ Parsing.ParseFailed = \
+-	Failed to parse the WSDL.
++\tFailed to parse the WSDL.
+ 
+ Parsing.NotAWSDL=Failed to get WSDL components, probably {0} is not a valid WSDL file.
+ 
+ AbstractReferenceFinderImpl.UnableToParse = \
+-	Unable to parse "{0}" : {1}
++\tUnable to parse "{0}" : {1}
+ 
+ Parser.NotABindingFile = \
+-	not an external binding file. The root element must be '{'http://java.sun.com/xml/ns/jaxws'}'bindings but it is '{'{0}'}'{1}
++\tnot an external binding file. The root element must be '{'http://java.sun.com/xml/ns/jaxws'}'bindings but it is '{'{0}'}'{1}
+ 
+ 
+ #Internalizer
+ Internalizer.TwoVersionAttributes = \
+-	Both jaxws:version and version are present
++\tBoth jaxws:version and version are present
+ Internalizer.IncorrectVersion = \
+-	JAXWS version attribute must be "2.0"
++\tJAXWS version attribute must be "2.0"
+ 
+ Internalizer.VersionNotPresent = \
+-	JAXWS version attribute must be present
++\tJAXWS version attribute must be present
+ 
+ internalizer.targetNotAnElement= \
+-    Target node is not an element
++\tTarget node is not an element
+ internalizer.targetNotFound= \
+-    No target found for the wsdlLocation: {0}
++\tNo target found for the wsdlLocation: {0}
+ 
+ Internalizer.IncorrectSchemaReference= \
+-	"{0}" is not a part of this compilation. Is this a mistake for "{1}"?
++\t"{0}" is not a part of this compilation. Is this a mistake for "{1}"?
+ 
+ internalizer.XPathEvaluationError = \
+     XPath error: {0}
+ internalizer.XPathEvaluatesToNoTarget = \
+-    XPath evaluation of "{0}" results in empty target node
++    XPath evaluation of "{0}" results in an empty target node
+ internalizer.XPathEvaulatesToTooManyTargets = \
+     XPath evaluation of "{0}" results in too many ({1}) target nodes
+ internalizer.XPathEvaluatesToNonElement = \
+     XPath evaluation of "{0}" needs to result in an element.
+-invalid.customization.namespace=Ignoring customization: \"{0}\", it has no namespace. It must belong to the customization namespace.    
++invalid.customization.namespace=Ignoring customization: \"{0}\", because it has no namespace. It must belong to the customization namespace.
+ 
+ invalid.wsdl.with.dooc="Not a WSDL document: {0}, it gives \"{1}\", retrying with MEX..."
+-invalid.wsdl="{0} does not look like a WSDL document, retrying with MEX..."
+- 
++invalid.wsdl=Invalid WSDL {0}, expected {1} found {2} at (line {3})
++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.
+--- old/src/share/classes/com/sun/tools/internal/ws/spi/WSToolsObjectFactory.java	Thu Jul 30 17:18:30 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/spi/WSToolsObjectFactory.java	Thu Jul 30 17:18:30 2009
+@@ -84,7 +84,7 @@
+      * @return true if there is no error, otherwise false
+      */
+     public abstract boolean wsgen(OutputStream logStream, Container container, String[] args);
+-    
++
+     /**
+      * Invokes wsgen on the endpoint implementation, and generates the necessary
+      * artifacts like wrapper, exception bean classes etc.
+--- old/src/share/classes/com/sun/tools/internal/ws/spi/package-info.java	Thu Jul 30 17:18:34 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/spi/package-info.java	Thu Jul 30 17:18:33 2009
+@@ -27,6 +27,6 @@
+  *
+  * <P>This document describes the SPI for the JAX-WS 2.0.1 tools.
+  *  The WSToolsObjectFactory is used to create instances of WsGen
+- *  and WsImport that other applications can use. 
++ *  and WsImport that other applications can use.
+ */
+ package com.sun.tools.internal.ws.spi;
+--- old/src/share/classes/com/sun/tools/internal/ws/util/WSToolsObjectFactoryImpl.java	Thu Jul 30 17:18:37 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/util/WSToolsObjectFactoryImpl.java	Thu Jul 30 17:18:37 2009
+@@ -37,13 +37,13 @@
+  * @author JAX-WS Development Team
+  */
+ public class WSToolsObjectFactoryImpl extends WSToolsObjectFactory {
+-    
++
+     @Override
+     public boolean wsimport(OutputStream logStream, Container container, String[] args) {
+         WsimportTool tool = new WsimportTool(logStream, container);
+         return tool.run(args);
+     }
+-    
++
+     @Override
+     public boolean wsgen(OutputStream logStream, Container container, String[] args) {
+         WsgenTool tool = new WsgenTool(logStream, container);
+--- old/src/share/classes/com/sun/tools/internal/ws/version.properties	Thu Jul 30 17:18:41 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/version.properties	Thu Jul 30 17:18:40 2009
+@@ -23,7 +23,7 @@
+ # have any questions.
+ #
+ 
+-build-id=JAX-WS RI 2.1.1
+-build-version=JAX-WS RI 2.1.1
+-major-version=2.1.1
+- 
++#Fri May 15 16:16:14 CEST 2009
++build-id=JAX-WS RI 2.1.6
++major-version=2.1.6
++build-version=JAX-WS RI 2.1.6
+--- old/src/share/classes/com/sun/tools/internal/ws/wscompile/AbortException.java	Thu Jul 30 17:18:44 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/wscompile/AbortException.java	Thu Jul 30 17:18:44 2009
+@@ -24,7 +24,6 @@
+  */
+ 
+ 
+-
+ package com.sun.tools.internal.ws.wscompile;
+ 
+ /**
+--- old/src/share/classes/com/sun/tools/internal/ws/wscompile/BadCommandLineException.java	Thu Jul 30 17:18:48 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/wscompile/BadCommandLineException.java	Thu Jul 30 17:18:47 2009
+@@ -24,7 +24,6 @@
+  */
+ 
+ 
+-
+ package com.sun.tools.internal.ws.wscompile;
+ 
+ import com.sun.istack.internal.Nullable;
+--- old/src/share/classes/com/sun/tools/internal/ws/wscompile/ErrorReceiver.java	Thu Jul 30 17:18:51 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/wscompile/ErrorReceiver.java	Thu Jul 30 17:18:50 2009
+@@ -24,7 +24,6 @@
+  */
+ 
+ 
+-
+ package com.sun.tools.internal.ws.wscompile;
+ 
+ import com.sun.istack.internal.Nullable;
+@@ -126,6 +125,8 @@
+         info( new SAXParseException(msg,null) );
+     }
+ 
++    public abstract void debug(SAXParseException exception);
++
+ //
+ //
+ // convenience methods for derived classes
+@@ -145,7 +146,7 @@
+           return ModelMessages.CONSOLE_ERROR_REPORTER_LINE_X_OF_Y(line==-1?"?":Integer.toString( line ),
+               getShortName( e.getSystemId()));
+       } else {
+-          return ModelMessages.CONSOLE_ERROR_REPORTER_UNKNOWN_LOCATION();
++          return ""; //for unkown location just return empty string
+       }
+   }
+ 
+--- old/src/share/classes/com/sun/tools/internal/ws/wscompile/ErrorReceiverFilter.java	Thu Jul 30 17:18:55 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/wscompile/ErrorReceiverFilter.java	Thu Jul 30 17:18:54 2009
+@@ -24,7 +24,6 @@
+  */
+ 
+ 
+-
+ package com.sun.tools.internal.ws.wscompile;
+ 
+ import com.sun.tools.internal.xjc.api.ErrorListener;
+@@ -56,7 +55,7 @@
+ 
+     /**
+      * Resets the error state its currently in. It allows to ignore the error reported by
+-     * any sub-system. 
++     * any sub-system.
+      */
+     public void reset(){
+         hadError = false;
+@@ -66,6 +65,10 @@
+         if(core!=null)  core.info(exception);
+     }
+ 
++    public void debug(SAXParseException exception) {
++
++    }
++
+     public void warning(SAXParseException exception) {
+         if(core!=null)  core.warning(exception);
+     }
+@@ -81,4 +84,3 @@
+     }
+ 
+ }
+-
+--- old/src/share/classes/com/sun/tools/internal/ws/wscompile/FilerCodeWriter.java	Thu Jul 30 17:18:58 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/wscompile/FilerCodeWriter.java	Thu Jul 30 17:18:57 2009
+@@ -33,7 +33,7 @@
+ 
+ /**
+  * Writes all the source files using the specified Filer.
+- * 
++ *
+  * @author WS Development Team
+  */
+ public class FilerCodeWriter extends WSCodeWriter {
+@@ -40,22 +40,22 @@
+ 
+     /** The Filer used to create files. */
+     private final Filer filer;
+-    
++
+     private Writer w;
+-    
++
+     public FilerCodeWriter(File outDir, WsgenOptions options) throws IOException {
+         super(outDir, options);
+         this.filer = options.filer;
+     }
+-    
+-    
++
++
+     public Writer openSource(JPackage pkg, String fileName) throws IOException {
+         String tmp = fileName.substring(0, fileName.length()-5);
+         w = filer.createSourceFile(pkg.name()+"."+tmp);
+         return w;
+     }
+-    
+ 
++
+     public void close() throws IOException {
+         super.close();
+         if (w != null)
+--- old/src/share/classes/com/sun/tools/internal/ws/wscompile/JavaCompilerHelper.java	Thu Jul 30 17:19:01 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/wscompile/JavaCompilerHelper.java	Thu Jul 30 17:19:01 2009
+@@ -35,6 +35,7 @@
+ import java.lang.reflect.Method;
+ import java.net.MalformedURLException;
+ import java.net.URL;
++import java.net.URISyntaxException;
+ 
+ /**
+  * A helper class to invoke javac.
+@@ -43,9 +44,10 @@
+  */
+ class JavaCompilerHelper{
+     static File getJarFile(Class clazz) {
++        URL url = null;
+         try {
+-            URL url = ParallelWorldClassLoader.toJarUrl(clazz.getResource('/'+clazz.getName().replace('.','/')+".class"));
+-            return new File(url.getPath());   // this code is assuming that url is a file URL
++            url = ParallelWorldClassLoader.toJarUrl(clazz.getResource('/'+clazz.getName().replace('.','/')+".class"));
++            return new File(url.toURI());
+         } catch (ClassNotFoundException e) {
+             // if we can't figure out where JAXB/JAX-WS API are, we couldn't have been executing this code.
+             throw new Error(e);
+@@ -52,6 +54,9 @@
+         } catch (MalformedURLException e) {
+             // if we can't figure out where JAXB/JAX-WS API are, we couldn't have been executing this code.
+             throw new Error(e);
++        } catch (URISyntaxException e) {
++            // url.toURI() is picky and doesn't like ' ' in URL, so this is the fallback
++            return new File(url.getPath());
+         }
+     }
+ 
+@@ -84,6 +89,6 @@
+         }
+         return false;
+     }
+-    
++
+     private static final Class[] compileMethodSignature = {String[].class, PrintWriter.class};
+ }
+--- old/src/share/classes/com/sun/tools/internal/ws/wscompile/Options.java	Thu Jul 30 17:19:05 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/wscompile/Options.java	Thu Jul 30 17:19:04 2009
+@@ -24,7 +24,6 @@
+  */
+ 
+ 
+-
+ package com.sun.tools.internal.ws.wscompile;
+ 
+ import com.sun.tools.internal.ws.resources.WscompileMessages;
+@@ -59,8 +58,8 @@
+      */
+     public boolean keep;
+ 
+-    
+ 
++
+     /**
+      * -d
+      */
+@@ -150,6 +149,10 @@
+ 
+ 
+     public boolean debug = false;
++
++    /**
++     * -Xdebug - gives complete stack trace
++     */
+     public boolean debugMode = false;
+ 
+ 
+@@ -174,7 +177,7 @@
+                 file.delete();
+             }
+         }
+-        generatedFiles.clear();        
++        generatedFiles.clear();
+     }
+ 
+     /**
+@@ -206,7 +209,7 @@
+      * @exception BadCommandLineException
+      *      thrown when there's a problem in the command-line arguments
+      */
+-    public final void parseArguments( String[] args ) throws BadCommandLineException {
++    public void parseArguments( String[] args ) throws BadCommandLineException {
+ 
+         for (int i = 0; i < args.length; i++) {
+             if(args[i].length()==0)
+--- old/src/share/classes/com/sun/tools/internal/ws/wscompile/WsgenOptions.java	Thu Jul 30 17:19:08 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/wscompile/WsgenOptions.java	Thu Jul 30 17:19:08 2009
+@@ -24,18 +24,20 @@
+  */
+ 
+ 
+-
+ package com.sun.tools.internal.ws.wscompile;
+ 
+ import com.sun.mirror.apt.Filer;
+ 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.xml.internal.ws.api.BindingID;
++import com.sun.xml.internal.ws.util.ServiceFinder;
++import com.sun.xml.internal.ws.binding.SOAPBindingImpl;
+ 
+ import javax.jws.WebService;
+ import javax.xml.namespace.QName;
+ import java.io.File;
+-import java.util.ArrayList;
+-import java.util.List;
++import java.util.*;
+ 
+ /**
+  * @author Vivek Pandey
+@@ -66,8 +68,10 @@
+      * protocol value
+      */
+     public String protocol = "soap1.1";
+-    public String transport;
+ 
++    public Set<String> protocols = new LinkedHashSet<String>();
++    public Map<String, String> nonstdProtocols = new LinkedHashMap<String, String>();
++
+     /**
+      * -XwsgenReport
+      */
+@@ -92,8 +96,22 @@
+     private static final String SOAP11 = "soap1.1";
+     public static final String X_SOAP12 = "Xsoap1.2";
+ 
++    public WsgenOptions() {
++        protocols.add(SOAP11);
++        protocols.add(X_SOAP12);
++        nonstdProtocols.put(X_SOAP12, SOAPBindingImpl.X_SOAP12HTTP_BINDING);
++        ServiceFinder<WsgenExtension> extn = ServiceFinder.find(WsgenExtension.class);
++        for(WsgenExtension ext : extn) {
++            Class clazz = ext.getClass();
++            WsgenProtocol pro = (WsgenProtocol)clazz.getAnnotation(WsgenProtocol.class);
++            protocols.add(pro.token());
++            nonstdProtocols.put(pro.token(), pro.lexical());
++        }
++    }
++
+     @Override
+     protected int parseArguments(String[] args, int i) throws BadCommandLineException {
++
+         int j = super.parseArguments(args, i);
+         if (args[i].equals(SERVICENAME_OPTION)) {
+             serviceName = QName.valueOf(requireArgument(SERVICENAME_OPTION, args, ++i));
+@@ -132,10 +150,8 @@
+                 index = value.indexOf('/');
+                 if (index == -1) {
+                     protocol = value;
+-                    transport = HTTP;
+                 } else {
+                     protocol = value.substring(0, index);
+-                    transport = value.substring(index + 1);
+                 }
+                 protocolSet = true;
+             }
+@@ -168,13 +184,9 @@
+     public void validate() throws BadCommandLineException {
+         if(nonclassDestDir == null)
+             nonclassDestDir = destDir;
+-        if (!protocol.equalsIgnoreCase(SOAP11) &&
+-                !protocol.equalsIgnoreCase(X_SOAP12)) {
+-            throw new BadCommandLineException(WscompileMessages.WSGEN_INVALID_PROTOCOL(protocol, SOAP11 + ", " + X_SOAP12));
+-        }
+ 
+-        if (transport != null && !transport.equalsIgnoreCase(HTTP)) {
+-            throw new BadCommandLineException(WscompileMessages.WSGEN_INVALID_TRANSPORT(transport, HTTP));
++        if (!protocols.contains(protocol)) {
++            throw new BadCommandLineException(WscompileMessages.WSGEN_INVALID_PROTOCOL(protocol, protocols));
+         }
+ 
+         if (endpoints.isEmpty()) {
+@@ -184,6 +196,10 @@
+             throw new BadCommandLineException(WscompileMessages.WSGEN_SOAP_12_WITHOUT_EXTENSION());
+         }
+ 
++        if (nonstdProtocols.containsKey(protocol) && !isExtensionMode()) {
++            throw new BadCommandLineException(WscompileMessages.WSGEN_PROTOCOL_WITHOUT_EXTENSION(protocol));
++        }
++
+         validateEndpointClass();
+         validateArguments();
+     }
+@@ -245,12 +261,13 @@
+         }
+     }
+ 
+-    public static BindingID getBindingID(String protocol) {
++    BindingID getBindingID(String protocol) {
+         if (protocol.equals(SOAP11))
+             return BindingID.SOAP11_HTTP;
+         if (protocol.equals(X_SOAP12))
+             return BindingID.SOAP12_HTTP;
+-        return null;
++        String lexical = nonstdProtocols.get(protocol);
++        return (lexical != null) ? BindingID.parse(lexical) : null;
+     }
+ 
+ 
+--- old/src/share/classes/com/sun/tools/internal/ws/wscompile/WsgenTool.java	Thu Jul 30 17:19:12 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/wscompile/WsgenTool.java	Thu Jul 30 17:19:11 2009
+@@ -24,7 +24,6 @@
+  */
+ 
+ 
+-
+ package com.sun.tools.internal.ws.wscompile;
+ 
+ import com.sun.mirror.apt.AnnotationProcessor;
+@@ -32,6 +31,8 @@
+ import com.sun.mirror.apt.AnnotationProcessorFactory;
+ import com.sun.mirror.declaration.AnnotationTypeDeclaration;
+ import com.sun.tools.internal.ws.ToolVersion;
++import com.sun.tools.internal.ws.api.WsgenExtension;
++import com.sun.tools.internal.ws.api.WsgenProtocol;
+ import com.sun.tools.internal.ws.processor.modeler.annotation.AnnotationProcessorContext;
+ import com.sun.tools.internal.ws.processor.modeler.annotation.WebServiceAP;
+ import com.sun.tools.internal.ws.processor.modeler.wsdl.ConsoleErrorReporter;
+@@ -46,11 +47,13 @@
+ 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.binding.SOAPBindingImpl;
+ import com.sun.xml.internal.ws.model.AbstractSEIModelImpl;
+ import com.sun.xml.internal.ws.model.RuntimeModeler;
+ import com.sun.xml.internal.ws.util.ServiceFinder;
+ import com.sun.xml.internal.ws.wsdl.writer.WSDLGenerator;
+ import com.sun.xml.internal.ws.wsdl.writer.WSDLResolver;
++import com.sun.istack.internal.tools.ParallelWorldClassLoader;
+ import org.xml.sax.SAXParseException;
+ 
+ import javax.xml.bind.annotation.XmlSeeAlso;
+@@ -110,14 +113,16 @@
+                 return false;
+             }
+         }catch (Options.WeAreDone done){
+-            usage(done.getOptions());
++            usage((WsgenOptions)done.getOptions());
+         }catch (BadCommandLineException e) {
+             if(e.getMessage()!=null) {
+                 System.out.println(e.getMessage());
+                 System.out.println();
+             }
+-            usage(e.getOptions());
++            usage((WsgenOptions)e.getOptions());
+             return false;
++        }catch(AbortException e){
++            //error might have been reported
+         }finally{
+             if(!options.keep){
+                 options.removeGeneratedFiles();
+@@ -161,12 +166,27 @@
+         }
+     }
+ 
++    /*
++     * 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"));
++            return true;
++        } catch(Exception e) {
++            return false;
++        }
++    }
++
++
+     public boolean buildModel(String endpoint, Listener listener) throws BadCommandLineException {
+         final ErrorReceiverFilter errReceiver = new ErrorReceiverFilter(listener);
+         context = new AnnotationProcessorContext();
+         webServiceAP = new WebServiceAP(options, context, errReceiver, out);
+ 
+-        String[] args = new String[9];
++        boolean bootCP = useBootClasspath(EndpointReference.class) || useBootClasspath(XmlSeeAlso.class);
++
++        String[] args = new String[8 + (bootCP ? 1 :0)];
+         args[0] = "-d";
+         args[1] = options.destDir.getAbsolutePath();
+         args[2] = "-classpath";
+@@ -175,7 +195,9 @@
+         args[5] = options.sourceDir.getAbsolutePath();
+         args[6] = "-XclassesAsDecls";
+         args[7] = endpoint;
+-        args[8] = "-Xbootclasspath/p:"+JavaCompilerHelper.getJarFile(EndpointReference.class)+File.pathSeparator+JavaCompilerHelper.getJarFile(XmlSeeAlso.class);
++        if (bootCP) {
++            args[8] = "-Xbootclasspath/p:"+JavaCompilerHelper.getJarFile(EndpointReference.class)+File.pathSeparator+JavaCompilerHelper.getJarFile(XmlSeeAlso.class);
++        }
+ 
+         // Workaround for bug 6499165: issue with javac debug option
+         workAroundJavacDebug();
+@@ -195,11 +217,12 @@
+                 throw new BadCommandLineException(WscompileMessages.WSGEN_CLASS_NOT_FOUND(endpoint));
+             }
+ 
+-            BindingID bindingID = WsgenOptions.getBindingID(options.protocol);
++            BindingID bindingID = options.getBindingID(options.protocol);
+             if (!options.protocolSet) {
+                 bindingID = BindingID.parse(endpointClass);
+             }
+-            RuntimeModeler rtModeler = new RuntimeModeler(endpointClass, options.serviceName, bindingID);
++            WebServiceFeatureList wsfeatures = new WebServiceFeatureList(endpointClass);
++            RuntimeModeler rtModeler = new RuntimeModeler(endpointClass, options.serviceName, bindingID, wsfeatures.toArray());
+             rtModeler.setClassLoader(classLoader);
+             if (options.portName != null)
+                 rtModeler.setPortName(options.portName);
+@@ -207,7 +230,7 @@
+ 
+             final File[] wsdlFileName = new File[1]; // used to capture the generated WSDL file.
+             final Map<String,File> schemaFiles = new HashMap<String,File>();
+-            WebServiceFeatureList wsfeatures = new WebServiceFeatureList(endpointClass);
++
+             WSDLGenerator wsdlGenerator = new WSDLGenerator(rtModel,
+                     new WSDLResolver() {
+                         private File toFile(String suggestedFilename) {
+@@ -327,8 +350,12 @@
+         }
+     }
+ 
+-    protected void usage(Options options) {
+-        System.out.println(WscompileMessages.WSGEN_HELP("WSGEN"));
++    protected void usage(WsgenOptions 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());
+     }
+ 
+--- old/src/share/classes/com/sun/tools/internal/ws/wscompile/WsimportListener.java	Thu Jul 30 17:19:15 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/wscompile/WsimportListener.java	Thu Jul 30 17:19:15 2009
+@@ -24,7 +24,6 @@
+  */
+ 
+ 
+-
+ package com.sun.tools.internal.ws.wscompile;
+ 
+ import com.sun.tools.internal.xjc.api.ErrorListener;
+@@ -58,7 +57,7 @@
+      * The callee is expected to add '\n'.
+      */
+     public void message(String msg) {}
+-    
++
+     public void error(SAXParseException exception) {
+ 
+     }
+@@ -75,9 +74,11 @@
+ 
+     }
+ 
++    public void debug(SAXParseException exception){}
++
+     /**
+      * wsimport will periodically invoke this method to see if it should cancel a compilation.
+-     * 
++     *
+      * @return
+      *      true if the {@link com.sun.tools.internal.ws.wscompile.WsimportListener} wants to abort the processing.
+      * @since 2.1
+--- old/src/share/classes/com/sun/tools/internal/ws/wscompile/WsimportOptions.java	Thu Jul 30 17:19:19 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/wscompile/WsimportOptions.java	Thu Jul 30 17:19:18 2009
+@@ -24,7 +24,6 @@
+  */
+ 
+ 
+-
+ package com.sun.tools.internal.ws.wscompile;
+ 
+ import com.sun.codemodel.internal.JCodeModel;
+@@ -50,6 +49,7 @@
+ import javax.xml.stream.XMLStreamReader;
+ import java.io.File;
+ import java.io.IOException;
++import java.net.Authenticator;
+ import java.net.MalformedURLException;
+ import java.net.URL;
+ import java.util.ArrayList;
+@@ -78,11 +78,27 @@
+     public String defaultPackage = null;
+ 
+     /**
++     * -XadditionalHeaders
++     */
++    public boolean additionalHeaders;
++
++    /**
++     * Setting disableSSLHostVerification to true disables the SSL Hostname verification while fetching the wsdls.
++     * -XdisableSSLHostVerification
++     */
++    public boolean disableSSLHostnameVerification;
++
++    /**
+      * JAXB's {@link SchemaCompiler} to be used for handling the schema portion.
+      * This object is also configured through options.
+      */
+     private SchemaCompiler schemaCompiler = XJC.createSchemaCompiler();
+ 
++    /**
++     * Authentication file
++     */
++    public File authFile;
++
+     public JCodeModel getCodeModel() {
+         if(codeModel == null)
+             codeModel = new JCodeModel();
+@@ -101,6 +117,50 @@
+ 
+     private JCodeModel codeModel;
+ 
++    /**
++     * This captures jars passed on the commandline and passes them to XJC and puts them in the classpath for compilation
++     */
++    public List<String> cmdlineJars = new ArrayList<String>();
++
++    /**
++     * Parses arguments and fill fields of this object.
++     *
++     * @exception BadCommandLineException
++     *      thrown when there's a problem in the command-line arguments
++     */
++    @Override
++    public final void parseArguments( String[] args ) throws BadCommandLineException {
++
++        for (int i = 0; i < args.length; i++) {
++            if(args[i].length()==0)
++                throw new BadCommandLineException();
++            if (args[i].charAt(0) == '-') {
++                int j = parseArguments(args,i);
++                if(j==0)
++                    throw new BadCommandLineException(WscompileMessages.WSCOMPILE_INVALID_OPTION(args[i]));
++                i += (j-1);
++            } else {
++                if(args[i].endsWith(".jar")) {
++
++                    try {
++                cmdlineJars.add(args[i]);
++                schemaCompiler.getOptions().scanEpisodeFile(new File(args[i]));
++
++            } catch (com.sun.tools.internal.xjc.BadCommandLineException e) {
++                //Driver.usage(jaxbOptions,false);
++                throw new BadCommandLineException(e.getMessage(), e);
++            }
++                } else{
++                    addFile(args[i]);
++                }
++            }
++        }
++        if(destDir == null)
++            destDir = new File(".");
++        if(sourceDir == null)
++            sourceDir = destDir;
++    }
++
+     /** -Xno-addressing-databinding option to disable addressing namespace data binding. This is
+      * experimental switch and will be working as a temporary workaround till
+      * jaxb can provide a better way to selelctively disable compiling of an
+@@ -119,6 +179,12 @@
+         } else if (args[i].equals("-wsdllocation")) {
+             wsdlLocation = requireArgument("-wsdllocation", args, ++i);
+             return 2;
++        } else if (args[i].equals("-XadditionalHeaders")) {
++            additionalHeaders = true;
++            return 1;
++        } else if (args[i].equals("-XdisableSSLHostnameVerification")) {
++            disableSSLHostnameVerification = true;
++            return 1;
+         } else if (args[i].equals("-p")) {
+             defaultPackage = requireArgument("-p", args, ++i);
+             return 2;
+@@ -173,6 +239,10 @@
+                 //Driver.usage(jaxbOptions,false);
+                 throw new BadCommandLineException(e.getMessage(),e);
+             }
++        } else if (args[i].equals("-Xauthfile")) {
++            String authfile = requireArgument("-Xauthfile", args, ++i);
++            authFile = new File(authfile);
++            return 2;
+         }
+ 
+         return 0; // what's this option?
+@@ -182,12 +252,12 @@
+         if (wsdls.isEmpty()) {
+             throw new BadCommandLineException(WscompileMessages.WSIMPORT_MISSING_FILE());
+         }
++
+         if(wsdlLocation == null){
+             wsdlLocation = wsdls.get(0).getSystemId();
+         }
+     }
+ 
+-
+     @Override
+     protected void addFile(String arg) throws BadCommandLineException {
+         addFile(arg, wsdls, "*.wsdl");
+@@ -360,5 +430,4 @@
+             }
+         }
+     }
+-
+ }
+--- old/src/share/classes/com/sun/tools/internal/ws/wscompile/WsimportTool.java	Thu Jul 30 17:19:22 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/wscompile/WsimportTool.java	Thu Jul 30 17:19:22 2009
+@@ -24,7 +24,6 @@
+  */
+ 
+ 
+-
+ package com.sun.tools.internal.ws.wscompile;
+ 
+ import com.sun.codemodel.internal.CodeWriter;
+@@ -42,6 +41,7 @@
+ import com.sun.tools.internal.xjc.util.NullStream;
+ import com.sun.xml.internal.ws.api.server.Container;
+ import com.sun.xml.internal.ws.util.ServiceFinder;
++import com.sun.istack.internal.tools.ParallelWorldClassLoader;
+ import org.xml.sax.EntityResolver;
+ import org.xml.sax.SAXParseException;
+ 
+@@ -53,6 +53,7 @@
+ import java.io.PrintStream;
+ import java.util.ArrayList;
+ import java.util.List;
++import java.net.Authenticator;
+ 
+ /**
+  * @author Vivek Pandey
+@@ -76,7 +77,6 @@
+         this.container = container;
+     }
+ 
+-
+     public boolean run(String[] args) {
+         class Listener extends WsimportListener {
+             ConsoleErrorReporter cer = new ConsoleErrorReporter(out == null ? new PrintStream(new NullStream()) : out);
+@@ -107,6 +107,11 @@
+             }
+ 
+             @Override
++            public void debug(SAXParseException exception) {
++                cer.debug(exception);
++            }
++
++            @Override
+             public void info(SAXParseException exception) {
+                 cer.info(exception);
+             }
+@@ -132,6 +137,13 @@
+                 if (listener.isCanceled())
+                     throw new AbortException();
+             }
++
++            @Override
++            public void debug(SAXParseException exception){
++                if(options.debugMode){
++                    listener.debug(exception);
++                }
++            }
+         };
+ 
+         for (String arg : args) {
+@@ -151,6 +163,11 @@
+                 if( !options.quiet )
+                     listener.message(WscompileMessages.WSIMPORT_PARSING_WSDL());
+ 
++                //set auth info
++                //if(options.authFile != null)
++                    Authenticator.setDefault(new DefaultAuthenticator(receiver, options.authFile));
++
++
+                 WSDLModeler wsdlModeler = new WSDLModeler(options, receiver);
+                 Model wsdlModel = wsdlModeler.buildModel();
+                 if (wsdlModel == null) {
+@@ -161,14 +178,17 @@
+                 //generated code
+                 if( !options.quiet )
+                     listener.message(WscompileMessages.WSIMPORT_GENERATING_CODE());
+-                
++
+                 TJavaGeneratorExtension[] genExtn = ServiceFinder.find(TJavaGeneratorExtension.class).toArray();
+                 CustomExceptionGenerator.generate(wsdlModel,  options, receiver);
+                 SeiGenerator.generate(wsdlModel, options, receiver, genExtn);
++                if(receiver.hadError()){
++                    throw new AbortException();
++                }
+                 ServiceGenerator.generate(wsdlModel, options, receiver);
+                 CodeWriter cw = new WSCodeWriter(options.sourceDir, options);
+                 if (options.verbose)
+-                    cw = new ProgressCodeWriter(cw, System.out);
++                    cw = new ProgressCodeWriter(cw, out);
+                 options.getCodeModel().build(cw);
+             } catch(AbortException e){
+                 //error might have been reported
+@@ -177,7 +197,7 @@
+             }
+ 
+             if (!options.nocompile){
+-                if(!compileGeneratedClasses(receiver)){
++                if(!compileGeneratedClasses(receiver, listener)){
+                     listener.message(WscompileMessages.WSCOMPILE_COMPILATION_FAILED());
+                     return false;
+                 }
+@@ -204,7 +224,20 @@
+         this.options.entityResolver = resolver;
+     }
+ 
+-    protected boolean compileGeneratedClasses(ErrorReceiver receiver){
++    /*
++     * 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"));
++            return true;
++        } catch(Exception e) {
++            return false;
++        }
++    }
++
++
++    protected boolean compileGeneratedClasses(ErrorReceiver receiver, WsimportListener listener){
+         List<String> sourceFiles = new ArrayList<String>();
+ 
+         for (File f : options.getGeneratedFiles()) {
+@@ -216,14 +249,18 @@
+         if (sourceFiles.size() > 0) {
+             String classDir = options.destDir.getAbsolutePath();
+             String classpathString = createClasspathString();
+-            String[] args = new String[5 + (options.debug ? 1 : 0)
++            boolean bootCP = useBootClasspath(EndpointReference.class) || useBootClasspath(XmlSeeAlso.class);
++            String[] args = new String[4 + (bootCP ? 1 : 0) + (options.debug ? 1 : 0)
+                     + sourceFiles.size()];
+             args[0] = "-d";
+             args[1] = classDir;
+             args[2] = "-classpath";
+             args[3] = classpathString;
+-            args[4] = "-Xbootclasspath/p:"+JavaCompilerHelper.getJarFile(EndpointReference.class)+File.pathSeparator+JavaCompilerHelper.getJarFile(XmlSeeAlso.class);
+-            int baseIndex = 5;
++            int baseIndex = 4;
++            if (bootCP) {
++                args[baseIndex++] = "-Xbootclasspath/p:"+JavaCompilerHelper.getJarFile(EndpointReference.class)+File.pathSeparator+JavaCompilerHelper.getJarFile(XmlSeeAlso.class);
++            }
++
+             if (options.debug) {
+                 args[baseIndex++] = "-g";
+             }
+@@ -231,6 +268,15 @@
+                 args[baseIndex + i] = sourceFiles.get(i);
+             }
+ 
++            listener.message(WscompileMessages.WSIMPORT_COMPILING_CODE());
++            if(options.verbose){
++                StringBuffer argstr = new StringBuffer();
++                for(String arg:args){
++                    argstr.append(arg).append(" ");
++                }
++                listener.message("javac "+ argstr.toString());
++            }
++
+             return JavaCompilerHelper.compile(args, out, receiver);
+         }
+         //there are no files to compile, so return true?
+@@ -238,11 +284,16 @@
+     }
+ 
+     private String createClasspathString() {
+-        return System.getProperty("java.class.path");
++        String classpathStr = System.getProperty("java.class.path");
++        for(String s: options.cmdlineJars) {
++            classpathStr = classpathStr+File.pathSeparator+new File(s);
++        }
++        return classpathStr;
+     }
+ 
+     protected void usage(Options options) {
+         System.out.println(WscompileMessages.WSIMPORT_HELP(WSIMPORT));
++        System.out.println(WscompileMessages.WSIMPORT_USAGE_EXTENSIONS());
+         System.out.println(WscompileMessages.WSIMPORT_USAGE_EXAMPLES());
+     }
+ }
+--- old/src/share/classes/com/sun/tools/internal/ws/wsdl/document/Input.java	Thu Jul 30 17:19:26 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/Input.java	Thu Jul 30 17:19:25 2009
+@@ -101,7 +101,7 @@
+     public void validateThis() {
+         if (_message == null) {
+             errorReceiver.error(getLocator(), WsdlMessages.VALIDATION_MISSING_REQUIRED_ATTRIBUTE("name", "wsdl:message"));
+-            throw new AbortException();            
++            throw new AbortException();
+         }
+     }
+ 
+--- old/src/share/classes/com/sun/tools/internal/ws/wsdl/document/Message.java	Thu Jul 30 17:19:29 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/Message.java	Thu Jul 30 17:19:29 2009
+@@ -53,8 +53,11 @@
+             throw new AbortException();
+         }
+ 
+-        _partsByName.put(part.getName(), part);
+-        _parts.add(part);
++        if(part.getDescriptor() != null && part.getDescriptorKind() != null) {
++            _partsByName.put(part.getName(), part);
++            _parts.add(part);
++        } else
++            errorReceiver.warning(part.getLocator(), WsdlMessages.PARSING_ELEMENT_OR_TYPE_REQUIRED(part.getName()));
+     }
+ 
+     public Iterator<MessagePart> parts() {
+--- old/src/share/classes/com/sun/tools/internal/ws/wsdl/document/Operation.java	Thu Jul 30 17:19:33 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/Operation.java	Thu Jul 30 17:19:32 2009
+@@ -189,7 +189,7 @@
+             }
+             if (_faults != null && _faults.size() != 0) {
+                 failValidation("validation.invalidSubEntity", "fault");
+-            }            
++            }
+         } else if (_style == OperationStyle.NOTIFICATION) {
+             if (_parameterOrder != null) {
+                 failValidation("validation.invalidAttribute", "parameterOrder");
+--- old/src/share/classes/com/sun/tools/internal/ws/wsdl/document/Output.java	Thu Jul 30 17:19:36 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/Output.java	Thu Jul 30 17:19:36 2009
+@@ -122,7 +122,7 @@
+     public TWSDLExtensible getParent() {
+         return parent;
+     }
+-    
++
+     public void setParent(TWSDLExtensible parent) {
+         this.parent = parent;
+     }
+--- old/src/share/classes/com/sun/tools/internal/ws/wsdl/document/jaxws/JAXWSBinding.java	Thu Jul 30 17:19:40 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/jaxws/JAXWSBinding.java	Thu Jul 30 17:19:39 2009
+@@ -65,7 +65,7 @@
+         // TODO Auto-generated method stub
+         return JAXWSBindingsConstants.JAXWS_BINDINGS;
+     }
+-    
++
+     public QName getWSDLElementName() {
+         return getElementName();
+     }
+@@ -232,15 +232,6 @@
+         this.isProvider = isProvider;
+     }
+ 
+-    /* (non-Javadoc)
+-     * @see Entity#getProperty(java.lang.String)
+-     */
+-    public Object getProperty(String key) {
+-        if(key.equals(JAXWSBindingsConstants.JAXB_BINDINGS))
+-            return jaxbBindings;
+-        return null;
+-    }
+-
+     /**
+      * @return Returns the methodName.
+      */
+--- old/src/share/classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPConstants.java	Thu Jul 30 17:19:43 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPConstants.java	Thu Jul 30 17:19:43 2009
+@@ -59,7 +59,7 @@
+     public static final QName QNAME_OPERATION =
+         new QName(NS_WSDL_SOAP, "operation");
+     public static final QName QNAME_MUSTUNDERSTAND =
+-        new QName(URI_ENVELOPE, "mustUnderstand");   
++        new QName(URI_ENVELOPE, "mustUnderstand");
+ 
+ 
+     // SOAP encoding QNames
+@@ -255,5 +255,5 @@
+     // SOAP attributes with non-colonized names
+     public static final QName QNAME_ATTR_ID = new QName("", "id");
+     public static final QName QNAME_ATTR_HREF = new QName("", "href");
+-    
++
+ }
+--- old/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/AbstractDocument.java	Thu Jul 30 17:19:47 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/framework/AbstractDocument.java	Thu Jul 30 17:19:46 2009
+@@ -134,26 +134,11 @@
+         }
+     }
+ 
+-    public void undefine(GloballyKnown e) {
+-        Map map = getMap(e.getKind());
+-        if (e.getName() == null)
+-            return;
+-        QName name =
+-            new QName(e.getDefining().getTargetNamespaceURI(), e.getName());
+-
+-        if (map.containsKey(name)){
+-            errReceiver.error(e.getLocator(), WsdlMessages.ENTITY_NOT_FOUND_BY_Q_NAME(e.getElementName().getLocalPart(), e.getElementName().getNamespaceURI()));
+-            throw new AbortException();
+-        } else{
+-            map.remove(name);
+-        }
+-    }
+-
+     public GloballyKnown find(Kind k, QName name) {
+         Map map = getMap(k);
+         Object result = map.get(name);
+         if (result == null){
+-            errReceiver.error(new LocatorImpl(), WsdlMessages.ENTITY_NOT_FOUND_BY_Q_NAME(name.getLocalPart(), name.getNamespaceURI()));
++            errReceiver.error(null, WsdlMessages.ENTITY_NOT_FOUND_BY_Q_NAME(k.getName(), name, _systemId));
+             throw new AbortException();
+         }
+         return (GloballyKnown) result;
+--- old/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/AbstractReferenceFinderImpl.java	Thu Jul 30 17:19:50 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/AbstractReferenceFinderImpl.java	Thu Jul 30 17:19:50 2009
+@@ -24,7 +24,6 @@
+  */
+ 
+ 
+-
+ package com.sun.tools.internal.ws.wsdl.parser;
+ 
+ import com.sun.istack.internal.SAXParseException2;
+--- old/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/DOMBuilder.java	Thu Jul 30 17:19:54 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/DOMBuilder.java	Thu Jul 30 17:19:53 2009
+@@ -24,7 +24,6 @@
+  */
+ 
+ 
+-
+ package com.sun.tools.internal.ws.wsdl.parser;
+ 
+ import com.sun.tools.internal.ws.wsdl.document.jaxws.JAXWSBindingsConstants;
+@@ -102,4 +101,3 @@
+         super.endElement(namespaceURI, localName, qName);
+     }
+ }
+-
+--- old/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/DOMForest.java	Thu Jul 30 17:19:57 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/DOMForest.java	Thu Jul 30 17:19:57 2009
+@@ -24,22 +24,23 @@
+  */
+ 
+ 
+-
+ 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.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.ws.resources.WscompileMessages;
+ 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;
+ import org.xml.sax.ContentHandler;
+-import org.xml.sax.InputSource;
+-import org.xml.sax.SAXException;
+-import org.xml.sax.XMLReader;
++import org.xml.sax.*;
+ import org.xml.sax.helpers.XMLFilterImpl;
+ 
+ import javax.xml.parsers.DocumentBuilder;
+@@ -51,17 +52,15 @@
+ 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;
+ import java.io.OutputStreamWriter;
+-import java.net.URI;
+-import java.net.URISyntaxException;
+-import java.util.ArrayList;
+-import java.util.HashMap;
+-import java.util.HashSet;
+-import java.util.List;
+-import java.util.Map;
+-import java.util.Set;
++import java.net.*;
++import java.util.*;
+ 
+ /**
+  * @author Vivek Pandey
+@@ -134,10 +133,9 @@
+         return inlinedSchemaElements;
+     }
+ 
+-    public Document parse(InputSource source, boolean root) throws SAXException {
++    public @NotNull Document parse(InputSource source, boolean root) throws SAXException, IOException {
+         if (source.getSystemId() == null)
+             throw new IllegalArgumentException();
+-
+         return parse(source.getSystemId(), source, root);
+     }
+ 
+@@ -148,7 +146,7 @@
+      *
+      * @return the parsed DOM document object.
+      */
+-    public Document parse(String systemId, boolean root) throws SAXException, IOException {
++    public Document parse(String systemId, boolean root) throws SAXException, IOException{
+ 
+         systemId = normalizeSystemId(systemId);
+ 
+@@ -165,7 +163,7 @@
+         if (core.containsKey(systemId)) {
+             // this document has already been parsed. Just ignore.
+             return core.get(systemId);
+-        }        
++        }
+ 
+         if(!root)
+             addExternalReferences(systemId);
+@@ -179,13 +177,11 @@
+      *
+      * @return null if there was a parse error. otherwise non-null.
+      */
+-    public Document parse(String systemId, InputSource inputSource, boolean root) throws SAXException {
++    public @NotNull Document parse(String systemId, InputSource inputSource, boolean root) throws SAXException, IOException{
+         Document dom = documentBuilder.newDocument();
+ 
+         systemId = normalizeSystemId(systemId);
+ 
+-        boolean retryMex = false;
+-        Exception exception = null;
+         // put into the map before growing a tree, to
+         // prevent recursive reference from causing infinite loop.
+         core.put(systemId, dom);
+@@ -201,8 +197,70 @@
+                 reader.setErrorHandler(errorReceiver);
+             if (options.entityResolver != null)
+                 reader.setEntityResolver(options.entityResolver);
++
++            InputStream is = null;
++            if(inputSource.getByteStream() != null){
++                is = inputSource.getByteStream();
++            }
++            if(is == null){
++                int redirects=0;
++                boolean redirect;
++                URL url = JAXWSUtils.getFileOrURL(inputSource.getSystemId());
++                URLConnection conn = url.openConnection();
++                if (conn instanceof HttpsURLConnection) {
++                    if (options.disableSSLHostnameVerification) {
++                        ((HttpsURLConnection) conn).setHostnameVerifier(new HttpClientVerifier());
++                    }
++                }
++
++                do {
++                    redirect = false;
++                    try {
++                        is = conn.getInputStream();
++                        //is = sun.net.www.protocol.http.HttpURLConnection.openConnectionCheckRedirects(conn);
++                    } catch (IOException e) {
++                        if (conn instanceof HttpURLConnection) {
++                            HttpURLConnection httpConn = ((HttpURLConnection) conn);
++                            int code = httpConn.getResponseCode();
++                            if (code == 401) {
++                                errorReceiver.error(new SAXParseException(WscompileMessages.WSIMPORT_AUTH_INFO_NEEDED(e.getMessage(), systemId, DefaultAuthenticator.defaultAuthfile), null, e));
++                                throw new AbortException();
++                            }
++                            //FOR other code we will retry with MEX
++                        }
++                        throw e;
++                    }
++
++                    //handle 302 or 303, JDK does not seem to handle 302 very well.
++                    //Need to redesign this a bit as we need to throw better error message for IOException in this case
++                    if (conn instanceof HttpURLConnection) {
++                        HttpURLConnection httpConn = ((HttpURLConnection) conn);
++                        int code = httpConn.getResponseCode();
++                        if (code == 302 || code == 303) {
++                            //retry with the value in Location header
++                            List<String> seeOther = httpConn.getHeaderFields().get("Location");
++                            if (seeOther != null && seeOther.size() > 0) {
++                                URL newurl = new URL(url, seeOther.get(0));
++                                if (!newurl.equals(url)){
++                                    errorReceiver.info(new SAXParseException(WscompileMessages.WSIMPORT_HTTP_REDIRECT(code, seeOther.get(0)), null));
++                                    url = newurl;
++                                    httpConn.disconnect();
++                                    if(redirects >= 5){
++                                        errorReceiver.error(new SAXParseException(WscompileMessages.WSIMPORT_MAX_REDIRECT_ATTEMPT(), null));
++                                        throw new AbortException();
++                                    }
++                                    conn = url.openConnection();
++                                    redirects++;
++                                    redirect = true;
++                                }
++                            }
++                        }
++                    }
++                } while (redirect);
++            }
++            inputSource.setByteStream(is);
+             reader.parse(inputSource);
+-             Element doc = dom.getDocumentElement();
++            Element doc = dom.getDocumentElement();
+             if (doc == null) {
+                 return null;
+             }
+@@ -211,18 +269,10 @@
+                 inlinedSchemaElements.add((Element) schemas.item(i));
+             }
+         } catch (ParserConfigurationException e) {
+-            exception = e;
+-        } catch (IOException e) {
+-            exception = e;
+-        } catch (SAXException e) {
+-            exception = e;
++            errorReceiver.error(e);
++            throw new SAXException(e.getMessage());
+         }
+ 
+-        if (exception != null) {
+-            errorReceiver.error(WscompileMessages.WSIMPORT_NO_WSDL(systemId), exception);
+-            core.remove(systemId);
+-            rootDocuments.remove(systemId);
+-        }
+         return dom;
+     }
+ 
+@@ -236,6 +286,14 @@
+         return externalReferences;
+     }
+ 
++    // overide default SSL HttpClientVerifier to always return true
++    // effectively overiding Hostname client verification when using SSL
++    private static class HttpClientVerifier implements HostnameVerifier {
++        public boolean verify(String s, SSLSession sslSession) {
++            return true;
++        }
++    }
++
+     public interface Handler extends ContentHandler {
+         /**
+          * Gets the DOM that was built.
+@@ -384,7 +442,7 @@
+         if(rootDocuments.isEmpty()) return null;
+         return rootDocuments.iterator().next();
+     }
+-    
++
+     public Set<String> getRootDocuments() {
+         return rootDocuments;
+     }
+--- old/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/DOMForestScanner.java	Thu Jul 30 17:20:01 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/DOMForestScanner.java	Thu Jul 30 17:20:00 2009
+@@ -24,7 +24,6 @@
+  */
+ 
+ 
+-
+ package com.sun.tools.internal.ws.wsdl.parser;
+ 
+ import com.sun.xml.internal.bind.unmarshaller.DOMScanner;
+--- old/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/InternalizationLogic.java	Thu Jul 30 17:20:04 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/InternalizationLogic.java	Thu Jul 30 17:20:04 2009
+@@ -24,7 +24,6 @@
+  */
+ 
+ 
+-
+ package com.sun.tools.internal.ws.wsdl.parser;
+ 
+ import org.w3c.dom.Element;
+@@ -107,4 +106,3 @@
+     Element refineWSDLTarget( Element target );
+ 
+ }
+-
+--- old/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/Internalizer.java	Thu Jul 30 17:20:08 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/Internalizer.java	Thu Jul 30 17:20:07 2009
+@@ -33,9 +33,14 @@
+ import com.sun.tools.internal.ws.wsdl.document.jaxws.JAXWSBindingsConstants;
+ import com.sun.tools.internal.xjc.util.DOMUtils;
+ import com.sun.xml.internal.bind.v2.util.EditDistance;
+-import com.sun.xml.internal.ws.util.JAXWSUtils;
+ import com.sun.xml.internal.ws.util.DOMUtil;
+-import org.w3c.dom.*;
++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 org.xml.sax.SAXParseException;
+ 
+ import javax.xml.namespace.NamespaceContext;
+@@ -45,11 +50,17 @@
+ import javax.xml.xpath.XPathFactory;
+ import java.net.MalformedURLException;
+ import java.net.URL;
+-import java.util.*;
++import java.util.ArrayList;
++import java.util.HashMap;
++import java.util.HashSet;
++import java.util.Iterator;
++import java.util.Map;
++import java.util.Set;
+ 
+ 
+ /**
+  * Internalizes external binding declarations.
++ *
+  * @author Vivek Pandey
+  */
+ public class Internalizer {
+@@ -66,13 +77,13 @@
+         this.errorReceiver = errorReceiver;
+     }
+ 
+-    public void transform(){
+-        Map<Element,Node> targetNodes = new HashMap<Element,Node>();
+-        for(Element jaxwsBinding : forest.outerMostBindings){
+-            buildTargetNodeMap(jaxwsBinding, jaxwsBinding, targetNodes );
++    public void transform() {
++        Map<Element, Node> targetNodes = new HashMap<Element, Node>();
++        for (Element jaxwsBinding : forest.outerMostBindings) {
++            buildTargetNodeMap(jaxwsBinding, jaxwsBinding, targetNodes);
+         }
+-        for(Element jaxwsBinding : forest.outerMostBindings){
+-            move(jaxwsBinding, targetNodes );
++        for (Element jaxwsBinding : forest.outerMostBindings) {
++            move(jaxwsBinding, targetNodes);
+         }
+     }
+ 
+@@ -79,15 +90,15 @@
+     /**
+      * Validates attributes of a &lt;JAXWS:bindings> element.
+      */
+-    private void validate( Element bindings ) {
++    private void validate(Element bindings) {
+         NamedNodeMap atts = bindings.getAttributes();
+-        for( int i=0; i<atts.getLength(); i++ ) {
+-            Attr a = (Attr)atts.item(i);
+-            if( a.getNamespaceURI()!=null )
++        for (int i = 0; i < atts.getLength(); i++) {
++            Attr a = (Attr) atts.item(i);
++            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
+@@ -99,7 +110,7 @@
+      * by using the inherited target node, then put
+      * the result into the "result" map.
+      */
+-    private void buildTargetNodeMap( Element bindings, Node inheritedTarget, Map<Element, Node> result ) {
++    private void buildTargetNodeMap(Element bindings, Node inheritedTarget, Map<Element, Node> result) {
+         // start by the inherited target
+         Node target = inheritedTarget;
+ 
+@@ -106,22 +117,27 @@
+         validate(bindings); // validate this node
+ 
+         // look for @wsdlLocation
+-        if( bindings.getAttributeNode("wsdlLocation")!=null ) {
+-            String wsdlLocation = bindings.getAttribute("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));
++                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 = wsdlDocuments.get(wsdlLocation);
+             target = forest.get(wsdlLocation);
+-            if(target==null) {
++
++            if (target == null) {
+                 reportError(bindings, WsdlMessages.INTERNALIZER_INCORRECT_SCHEMA_REFERENCE(wsdlLocation, EditDistance.findNearest(wsdlLocation, forest.listSystemIDs())));
+                 return; // abort processing this <JAXWS:bindings>
+             }
+@@ -134,7 +150,7 @@
+         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){
++            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);
+@@ -149,46 +165,51 @@
+         }
+ 
+ 
+-        boolean hasNode = true;        
+-        if((isJAXWSBindings(bindings) || isJAXBBindings(bindings)) && bindings.getAttributeNode("node")!=null ) {
++        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)) {
++        } else
++        if (isJAXWSBindings(bindings) && (bindings.getAttributeNode("node") == null) && !isTopLevelBinding(bindings)) {
+             hasNode = false;
+-        }else if(isGlobalBinding(bindings) && !isWSDLDefinition(target) && isTopLevelBinding(bindings.getParentNode())){
++        } 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)
++        if (target == null)
+             return;
+ 
+         // update the result map
+-        if(hasNode)
+-            result.put( bindings, target );
++        if (hasNode)
++            result.put(bindings, target);
+ 
+         // look for child <JAXWS:bindings> and process them recursively
+-        Element[] children = getChildElements( bindings);
++        Element[] children = getChildElements(bindings);
+         for (Element child : children)
+             buildTargetNodeMap(child, target, result);
+     }
+ 
+-    private Node getWSDLDefintionNode(Node bindings, Node target){
++    private Node getWSDLDefintionNode(Node bindings, Node target) {
+         return evaluateXPathNode(bindings, target, "wsdl:definitions",
+-            new NamespaceContext(){
+-                public String getNamespaceURI(String prefix){
+-                    return "http://schemas.xmlsoap.org/wsdl/";
+-                }
+-                public String getPrefix(String nsURI){
+-                    throw new UnsupportedOperationException();
+-                }
+-                public Iterator getPrefixes(String namespaceURI) {
+-                    throw new UnsupportedOperationException();
+-                }});
++                new NamespaceContext() {
++                    public String getNamespaceURI(String prefix) {
++                        return "http://schemas.xmlsoap.org/wsdl/";
++                    }
++
++                    public String getPrefix(String nsURI) {
++                        throw new UnsupportedOperationException();
++                    }
++
++                    public Iterator getPrefixes(String namespaceURI) {
++                        throw new UnsupportedOperationException();
++                    }
++                });
+     }
+ 
+-    private boolean isWSDLDefinition(Node target){
+-        if(target == null)
++    private boolean isWSDLDefinition(Node target) {
++        if (target == null)
+             return false;
+         String localName = target.getLocalName();
+         String nsURI = target.getNamespaceURI();
+@@ -195,43 +216,41 @@
+         return fixNull(localName).equals("definitions") && fixNull(nsURI).equals("http://schemas.xmlsoap.org/wsdl/");
+     }
+ 
+-    private boolean isTopLevelBinding(Node node){
+-        if(node instanceof Document)
+-            node = ((Document)node).getDocumentElement();
+-        return ((node != null) && (((Element)node).getAttributeNode("wsdlLocation") != null));
++    private boolean isTopLevelBinding(Node node) {
++        return node.getOwnerDocument().getDocumentElement() == node;
+     }
+ 
+-    private boolean isJAXWSBindings(Node bindings){
++    private boolean isJAXWSBindings(Node bindings) {
+         return (bindings.getNamespaceURI().equals(JAXWSBindingsConstants.NS_JAXWS_BINDINGS) && bindings.getLocalName().equals("bindings"));
+     }
+ 
+-    private boolean isJAXBBindings(Node bindings){
++    private boolean isJAXBBindings(Node bindings) {
+         return (bindings.getNamespaceURI().equals(JAXWSBindingsConstants.NS_JAXB_BINDINGS) && bindings.getLocalName().equals("bindings"));
+     }
+ 
+-    private boolean isGlobalBinding(Node bindings){
+-        if(bindings.getNamespaceURI() == null){
++    private boolean isGlobalBinding(Node bindings) {
++        if (bindings.getNamespaceURI() == null) {
+             errorReceiver.warning(forest.locatorTable.getStartLocation((Element) bindings), WsdlMessages.INVALID_CUSTOMIZATION_NAMESPACE(bindings.getLocalName()));
+             return false;
+         }
+-        return  (bindings.getNamespaceURI().equals(JAXWSBindingsConstants.NS_JAXWS_BINDINGS) &&
++        return (bindings.getNamespaceURI().equals(JAXWSBindingsConstants.NS_JAXWS_BINDINGS) &&
+                 (bindings.getLocalName().equals("package") ||
+-                bindings.getLocalName().equals("enableAsyncMapping") ||
+-                bindings.getLocalName().equals("enableAdditionalSOAPHeaderMapping") ||
+-                bindings.getLocalName().equals("enableWrapperStyle") ||
+-                bindings.getLocalName().equals("enableMIMEContent")));
++                        bindings.getLocalName().equals("enableAsyncMapping") ||
++                        bindings.getLocalName().equals("enableAdditionalSOAPHeaderMapping") ||
++                        bindings.getLocalName().equals("enableWrapperStyle") ||
++                        bindings.getLocalName().equals("enableMIMEContent")));
+     }
+ 
+     private static Element[] getChildElements(Element parent) {
+         ArrayList<Element> a = new ArrayList<Element>();
+         NodeList children = parent.getChildNodes();
+-        for( int i=0; i<children.getLength(); i++ ) {
++        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()) ||
++            if (JAXWSBindingsConstants.NS_JAXWS_BINDINGS.equals(item.getNamespaceURI()) ||
+                     JAXWSBindingsConstants.NS_JAXB_BINDINGS.equals(item.getNamespaceURI()))
+-                a.add((Element)item);
++                a.add((Element) item);
+         }
+         return a.toArray(new Element[a.size()]);
+     }
+@@ -240,24 +259,24 @@
+         NodeList nlst;
+         try {
+             xpath.setNamespaceContext(namespaceContext);
+-            nlst = (NodeList)xpath.evaluate(expression, target, XPathConstants.NODESET);
++            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 <jaxb:bindings>
+         }
+ 
+-        if( nlst.getLength()==0 ) {
++        if (nlst.getLength() == 0) {
+             reportError((Element) bindings, WsdlMessages.INTERNALIZER_X_PATH_EVALUATES_TO_NO_TARGET(expression));
+             return null; // abort
+         }
+ 
+-        if( nlst.getLength()!=1 ) {
++        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 )) {
++        if (!(rnode instanceof Element)) {
+             reportError((Element) bindings, WsdlMessages.INTERNALIZER_X_PATH_EVALUATES_TO_NON_ELEMENT(expression));
+             return null; // abort
+         }
+@@ -267,9 +286,9 @@
+     /**
+      * Moves JAXWS customizations under their respective target nodes.
+      */
+-    private void move( Element bindings, Map<Element, Node> targetNodes ) {
++    private void move(Element bindings, Map<Element, Node> targetNodes) {
+         Node target = targetNodes.get(bindings);
+-        if(target==null)
++        if (target == null)
+             // this must be the result of an error on the external binding.
+             // recover from the error by ignoring this node
+             return;
+@@ -277,27 +296,27 @@
+         Element[] children = DOMUtils.getChildElements(bindings);
+ 
+         for (Element item : children) {
+-            if ("bindings".equals(item.getLocalName())){
+-            // process child <jaxws:bindings> recursively
++            if ("bindings".equals(item.getLocalName())) {
++                // process child <jaxws:bindings> recursively
+                 move(item, targetNodes);
+-            }else if(isGlobalBinding(item)){
++            } else if (isGlobalBinding(item)) {
+                 target = targetNodes.get(item);
+-                moveUnder(item,(Element)target);
+-            }else {
++                moveUnder(item, (Element) target);
++            } else {
+                 if (!(target instanceof Element)) {
+                     return; // abort
+                 }
+                 // move this node under the target
+-                moveUnder(item,(Element)target);
++                moveUnder(item, (Element) target);
+             }
+         }
+     }
+ 
+-    private boolean isJAXBBindingElement(Element e){
++    private boolean isJAXBBindingElement(Element e) {
+         return fixNull(e.getNamespaceURI()).equals(JAXWSBindingsConstants.NS_JAXB_BINDINGS);
+     }
+ 
+-    private boolean isJAXWSBindingElement(Element e){
++    private boolean isJAXWSBindingElement(Element e) {
+         return fixNull(e.getNamespaceURI()).equals(JAXWSBindingsConstants.NS_JAXWS_BINDINGS);
+     }
+ 
+@@ -304,25 +323,22 @@
+     /**
+      * Moves the "decl" node under the "target" node.
+      *
+-     * @param decl
+-     *      A JAXWS customization element (e.g., &lt;JAXWS:class>)
+-     *
+-     * @param target
+-     *      XML wsdl element under which the declaration should move.
+-     *      For example, &lt;xs:element>
++     * @param decl   A JAXWS customization element (e.g., &lt;JAXWS:class>)
++     * @param target XML wsdl element under which the declaration should move.
++     *               For example, &lt;xs:element>
+      */
+-    private void moveUnder( Element decl, Element target ) {
++    private void moveUnder(Element decl, Element target) {
+ 
+         //if there is @node on decl and has a child element jaxb:bindings, move it under the target
+         //Element jaxb = getJAXBBindingElement(decl);
+-        if(isJAXBBindingElement(decl)){
++        if (isJAXBBindingElement(decl)) {
+             //add jaxb namespace declaration
+-            if(!target.hasAttributeNS(Constants.NS_XMLNS, "jaxb")){
++            if (!target.hasAttributeNS(Constants.NS_XMLNS, "jaxb")) {
+                 target.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(!target.hasAttributeNS(JAXWSBindingsConstants.NS_JAXB_BINDINGS, "version")){
++            if (!target.hasAttributeNS(JAXWSBindingsConstants.NS_JAXB_BINDINGS, "version")) {
+                 target.setAttributeNS(JAXWSBindingsConstants.NS_JAXB_BINDINGS, "jaxb:version", JAXWSBindingsConstants.JAXB_BINDING_VERSION);
+             }
+ 
+@@ -334,7 +350,7 @@
+             // it can't support user-defined extensions. This needs more careful thought.
+ 
+             //JAXB doesn't allow writing jaxb:extensionbindingPrefix anywhere other than root element so lets write only on <xs:schema>
+-            if(target.getLocalName().equals("schema") && target.getNamespaceURI().equals(Constants.NS_XSD)&& !target.hasAttributeNS(JAXWSBindingsConstants.NS_JAXB_BINDINGS, "extensionBindingPrefixes")){
++            if (target.getLocalName().equals("schema") && target.getNamespaceURI().equals(Constants.NS_XSD) && !target.hasAttributeNS(JAXWSBindingsConstants.NS_JAXB_BINDINGS, "extensionBindingPrefixes")) {
+                 target.setAttributeNS(JAXWSBindingsConstants.NS_JAXB_BINDINGS, "jaxb:extensionBindingPrefixes", "xjc");
+                 target.setAttributeNS(Constants.NS_XMLNS, "xmlns:xjc", JAXWSBindingsConstants.NS_XJC_BINDINGS);
+             }
+@@ -342,9 +358,9 @@
+             //insert xs:annotation/xs:appinfo where in jaxb:binding will be put
+             target = refineSchemaTarget(target);
+             copyInscopeNSAttributes(decl);
+-        }else if(isJAXWSBindingElement(decl)){
++        } else if (isJAXWSBindingElement(decl)) {
+             //add jaxb namespace declaration
+-            if(!target.hasAttributeNS(Constants.NS_XMLNS, "JAXWS")){
++            if (!target.hasAttributeNS(Constants.NS_XMLNS, "JAXWS")) {
+                 target.setAttributeNS(Constants.NS_XMLNS, "xmlns:JAXWS", JAXWSBindingsConstants.NS_JAXWS_BINDINGS);
+             }
+ 
+@@ -351,59 +367,59 @@
+             //insert xs:annotation/xs:appinfo where in jaxb:binding will be put
+             target = refineWSDLTarget(target);
+             copyInscopeNSAttributes(decl);
+-        }else{
++        } else {
+             return;
+         }
+ 
+         // finally move the declaration to the target node.
+-        if( target.getOwnerDocument()!=decl.getOwnerDocument() ) {
++        if (target.getOwnerDocument() != decl.getOwnerDocument()) {
+             // if they belong to different DOM documents, we need to clone them
+-            decl = (Element)target.getOwnerDocument().importNode(decl,true);
++            decl = (Element) target.getOwnerDocument().importNode(decl, true);
+ 
+         }
+ 
+-        target.appendChild( decl );
++        target.appendChild(decl);
+     }
+ 
+     /**
+-     *  Copy in-scope namespace declarations of the decl node
+-     *  to the decl node itself so that this move won't change
+-     *  the in-scope namespace bindings.
++     * Copy in-scope namespace declarations of the decl node
++     * to the decl node itself so that this move won't change
++     * the in-scope namespace bindings.
+      */
+-    private void copyInscopeNSAttributes(Element e){
++    private void copyInscopeNSAttributes(Element e) {
+         Element p = e;
+         Set<String> inscopes = new HashSet<String>();
+-        while(true) {
++        while (true) {
+             NamedNodeMap atts = p.getAttributes();
+-            for( int i=0; i<atts.getLength(); i++ ) {
+-                Attr a = (Attr)atts.item(i);
+-                if( Constants.NS_XMLNS.equals(a.getNamespaceURI()) ) {
++            for (int i = 0; i < atts.getLength(); i++) {
++                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 (inscopes.add(prefix) && p != e) {
+                         // if this is the first time we see this namespace bindings,
+                         // copy the declaration.
+                         // if p==decl, there's no need to. Note that
+                         // we want to add prefix to inscopes even if p==Decl
+ 
+-                        e.setAttributeNodeNS( (Attr)a.cloneNode(true) );
++                        e.setAttributeNodeNS((Attr) a.cloneNode(true));
+                     }
+                 }
+             }
+ 
+-            if( p.getParentNode() instanceof Document )
++            if (p.getParentNode() instanceof Document)
+                 break;
+ 
+-            p = (Element)p.getParentNode();
++            p = (Element) p.getParentNode();
+         }
+ 
+-        if( !inscopes.contains("") ) {
++        if (!inscopes.contains("")) {
+             // if the default namespace was undeclared in the context of decl,
+             // it must be explicitly set to "" since the new environment might
+             // have a different default namespace URI.
+-            e.setAttributeNS(Constants.NS_XMLNS,"xmlns","");
++            e.setAttributeNS(Constants.NS_XMLNS, "xmlns", "");
+         }
+     }
+ 
+@@ -410,15 +426,15 @@
+     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" );
++            annotation = insertXMLSchemaElement(target, "annotation");
+ 
+         // then look for appinfo
+-        Element appinfo = DOMUtils.getFirstChildElement(annotation, Constants.NS_XSD, "appinfo" );
+-        if(appinfo==null)
++        Element appinfo = DOMUtils.getFirstChildElement(annotation, Constants.NS_XSD, "appinfo");
++        if (appinfo == null)
+             // none exists. need to make one
+-            appinfo = insertXMLSchemaElement( annotation, "appinfo" );
++            appinfo = insertXMLSchemaElement(annotation, "appinfo");
+ 
+         return appinfo;
+     }
+@@ -426,9 +442,9 @@
+     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" );
++            JAXWSBindings = insertJAXWSBindingsElement(target, "bindings");
+         return JAXWSBindings;
+     }
+ 
+@@ -436,63 +452,63 @@
+      * Creates a new XML Schema element of the given local name
+      * and insert it as the first child of the given parent node.
+      *
+-     * @return
+-     *      Newly create element.
++     * @return Newly create element.
+      */
+-    private Element insertXMLSchemaElement( Element parent, String localName ) {
++    private Element insertXMLSchemaElement(Element parent, String localName) {
+         // use the same prefix as the parent node to avoid modifying
+         // 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 );
++        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
+-            parent.insertBefore( child, children.item(0) );
++            parent.insertBefore(child, children.item(0));
+ 
+         return child;
+     }
+ 
+-    private Element insertJAXWSBindingsElement( Element parent, String localName ) {
+-        String qname = "JAXWS:"+localName;
++    private Element insertJAXWSBindingsElement(Element parent, String localName) {
++        String qname = "JAXWS:" + localName;
+ 
+-        Element child = parent.getOwnerDocument().createElementNS(JAXWSBindingsConstants.NS_JAXWS_BINDINGS, qname );
++        Element child = parent.getOwnerDocument().createElementNS(JAXWSBindingsConstants.NS_JAXWS_BINDINGS, qname);
+ 
+         NodeList children = parent.getChildNodes();
+ 
+-        if( children.getLength()==0 )
++        if (children.getLength() == 0)
+             parent.appendChild(child);
+         else
+-            parent.insertBefore( child, children.item(0) );
++            parent.insertBefore(child, children.item(0));
+ 
+         return child;
+     }
+ 
+-    private static @NotNull String fixNull(@Nullable String s) {
+-        if(s==null) return "";
+-        else        return s;
++    private static
++    @NotNull
++    String fixNull(@Nullable String s) {
++        if (s == null) return "";
++        else return s;
+     }
+ 
+ 
+-    private void reportError( Element errorSource, String formattedMsg ) {
+-        reportError( errorSource, formattedMsg, null );
++    private void reportError(Element errorSource, String formattedMsg) {
++        reportError(errorSource, formattedMsg, null);
+     }
+ 
+-    private void reportError( Element errorSource,
+-        String formattedMsg, Exception nestedException ) {
++    private void reportError(Element errorSource,
++                             String formattedMsg, Exception nestedException) {
+ 
+-        SAXParseException e = new SAXParseException2( formattedMsg,
+-            forest.locatorTable.getStartLocation(errorSource),
+-            nestedException );
++        SAXParseException e = new SAXParseException2(formattedMsg,
++                forest.locatorTable.getStartLocation(errorSource),
++                nestedException);
+         errorReceiver.error(e);
+     }
+ 
+ 
+-
+ }
+--- old/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/MemberSubmissionAddressingExtensionHandler.java	Thu Jul 30 17:20:12 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/MemberSubmissionAddressingExtensionHandler.java	Thu Jul 30 17:20:11 2009
+@@ -22,9 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * $Id: MemberSubmissionAddressingExtensionHandler.java,v 1.1.2.6 2006/10/31 19:52:07 vivekp Exp $
+- */
+ 
+ package com.sun.tools.internal.ws.wsdl.parser;
+ 
+--- old/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/MetadataFinder.java	Thu Jul 30 17:20:15 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/MetadataFinder.java	Thu Jul 30 17:20:14 2009
+@@ -24,9 +24,11 @@
+  */
+ 
+ 
+-
+ package com.sun.tools.internal.ws.wsdl.parser;
+ 
++import com.sun.istack.internal.NotNull;
++import com.sun.istack.internal.Nullable;
++import com.sun.tools.internal.ws.resources.WscompileMessages;
+ import com.sun.tools.internal.ws.resources.WsdlMessages;
+ import com.sun.tools.internal.ws.wscompile.ErrorReceiver;
+ import com.sun.tools.internal.ws.wscompile.WsimportOptions;
+@@ -38,8 +40,6 @@
+ import com.sun.xml.internal.ws.api.wsdl.parser.ServiceDescriptor;
+ import com.sun.xml.internal.ws.util.DOMUtil;
+ import com.sun.xml.internal.ws.util.ServiceFinder;
+-import com.sun.istack.internal.Nullable;
+-import com.sun.istack.internal.NotNull;
+ import org.w3c.dom.Document;
+ import org.w3c.dom.Element;
+ import org.w3c.dom.Node;
+@@ -46,16 +46,17 @@
+ import org.w3c.dom.NodeList;
+ import org.xml.sax.InputSource;
+ import org.xml.sax.SAXException;
+-import org.xml.sax.helpers.LocatorImpl;
++import org.xml.sax.SAXParseException;
+ 
+ import javax.xml.transform.Source;
+ import javax.xml.transform.dom.DOMSource;
++import java.io.FileNotFoundException;
++import java.io.IOException;
+ import java.net.URI;
+ import java.net.URISyntaxException;
++import java.util.HashSet;
+ import java.util.List;
+ import java.util.Set;
+-import java.util.HashSet;
+-import java.io.IOException;
+ 
+ /**
+  * @author Vivek Pandey
+@@ -72,36 +73,47 @@
+ 
+     }
+ 
+-    public void parseWSDL() throws SAXException, IOException {
++    public void parseWSDL(){
+         // parse source grammars
+         for (InputSource value : options.getWSDLs()) {
+             String systemID = value.getSystemId();
+             errorReceiver.pollAbort();
+ 
++            Document dom ;
++            Element doc = null;
++
++            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);
++                dom = parse(value, true);
+ 
++                doc = dom.getDocumentElement();
++                if (doc == null) {
++                    continue;
++                }
++                //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));
++                }
++            } catch(FileNotFoundException e){
++                errorReceiver.error(WsdlMessages.FILE_NOT_FOUND(systemID), e);
++                return;
++            } catch (IOException e) {
++                doc = getFromMetadataResolver(systemID, e);
++            } catch (SAXParseException e) {
++                doc = getFromMetadataResolver(systemID, e);
++            } catch (SAXException e) {
++                doc = getFromMetadataResolver(systemID, e);
++            }
+ 
+-            Document dom = parse(value, true);
+-            if (dom == null)
+-                continue;
+-            Element doc = dom.getDocumentElement();
+             if (doc == null) {
+                 continue;
+             }
+-            //if its not a WSDL document, retry with MEX
+-            if (doc.getNamespaceURI() == null || !doc.getNamespaceURI().equals(WSDLConstants.NS_WSDL) || !doc.getLocalName().equals("definitions")) {
+-                core.remove(systemID);
+-                rootDocuments.remove(systemID);
+-                errorReceiver.warning(locatorTable.getStartLocation(doc), WsdlMessages.INVALID_WSDL_WITH_DOOC(systemID, "{" + fixNull(doc.getNamespaceURI()) + "}" + doc.getLocalName()));
+-                dom = getFromMetadataResolver(systemID);
+-                if(dom == null)
+-                    continue;
+-                doc = dom.getDocumentElement();
+-            }
++
+             NodeList schemas = doc.getElementsByTagNameNS(SchemaConstants.NS_XSD, "schema");
+             for (int i = 0; i < schemas.getLength(); i++) {
+                 if(!inlinedSchemaElements.contains(schemas.item(i)))
+@@ -137,7 +149,7 @@
+             Document doc = get(location);
+             if(doc!=null){
+                 Element definition = doc.getDocumentElement();
+-                if(definition == null)
++                if(definition == null || definition.getLocalName() == null || definition.getNamespaceURI() == null)
+                     continue;
+                 if(definition.getNamespaceURI().equals(WSDLConstants.NS_WSDL) && definition.getLocalName().equals("definitions")){
+                     rootWsdls.add(location);
+@@ -151,17 +163,17 @@
+                 }
+             }
+         }
++        //no wsdl with wsdl:service found, throw error
++        if(rootWSDL == null){
++            StringBuffer strbuf = new StringBuffer();
++            for(String str : rootWsdls){
++                strbuf.append(str);
++                strbuf.append('\n');
++            }
++            errorReceiver.error(null, WsdlMessages.FAILED_NOSERVICE(strbuf.toString()));
++        }
+     }
+ 
+-
+-
+-
+-    private String fixNull(String s) {
+-        if (s == null) return "";
+-        else return s;
+-    }
+-
+-
+     /*
+     * If source and target namespace are also passed in,
+     * then if the mex resolver is found and it cannot get
+@@ -170,10 +182,9 @@
+     * This behavior should only happen when trying a
+     * mex request first.
+     */
+-    private Document getFromMetadataResolver(String systemId) {
+-
++    private @Nullable Element getFromMetadataResolver(String systemId, Exception ex) {
+         //try MEX
+-        MetaDataResolver resolver = null;
++        MetaDataResolver resolver;
+         ServiceDescriptor serviceDescriptor = null;
+         for (MetadataResolverFactory resolverFactory : ServiceFinder.find(MetadataResolverFactory.class)) {
+             resolver = resolverFactory.metadataResolver(options.entityResolver);
+@@ -188,14 +199,15 @@
+         }
+ 
+         if (serviceDescriptor != null) {
++            errorReceiver.warning(new SAXParseException(WsdlMessages.TRY_WITH_MEX(ex.getMessage()), null, ex));
+             return parseMetadata(systemId, serviceDescriptor);
+         } else {
+-            errorReceiver.error(new LocatorImpl(), WsdlMessages.PARSING_UNABLE_TO_GET_METADATA(systemId));
++            errorReceiver.error(null, WsdlMessages.PARSING_UNABLE_TO_GET_METADATA(ex.getMessage(), WscompileMessages.WSIMPORT_NO_WSDL(systemId)), ex);
+         }
+         return null;
+     }
+ 
+-    private Document parseMetadata(String systemId, ServiceDescriptor serviceDescriptor) {
++    private Element parseMetadata(@NotNull String systemId, @NotNull ServiceDescriptor serviceDescriptor) {
+         List<? extends Source> mexWsdls = serviceDescriptor.getWSDLs();
+         List<? extends Source> mexSchemas = serviceDescriptor.getSchemas();
+         Document root = null;
+@@ -220,8 +232,8 @@
+                     }
+                 }
+                 NodeList nl = doc.getDocumentElement().getElementsByTagNameNS(WSDLConstants.NS_WSDL, "import");
+-                if (nl.getLength() > 0) {
+-                    Element imp = (Element) nl.item(0);
++                for(int i = 0; i < nl.getLength(); i++){
++                    Element imp = (Element) nl.item(i);
+                     String loc = imp.getAttribute("location");
+                     if (loc != null) {
+                         if (!externalReferences.contains(loc))
+@@ -247,6 +259,6 @@
+             //TODO:handle SAXSource
+             //TODO:handler StreamSource
+         }
+-        return root;
++        return root.getDocumentElement();
+     }
+ }
+--- old/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/NamespaceContextImpl.java	Thu Jul 30 17:20:19 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/NamespaceContextImpl.java	Thu Jul 30 17:20:18 2009
+@@ -2,7 +2,7 @@
+  * reserved comment block
+  * DO NOT REMOVE OR ALTER!
+  */
+-/*
++ /*
+  * Portions Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+  *
+@@ -29,6 +29,22 @@
+  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
+  */
+ 
++/*
++ * Copyright 1999-2004 The Apache Software Foundation.
++ *
++ * Licensed under the Apache License, Version 2.0 (the "License");
++ * you may not use this file except in compliance with the License.
++ * You may obtain a copy of the License at
++ *
++ *     http://www.apache.org/licenses/LICENSE-2.0
++ *
++ * Unless required by applicable law or agreed to in writing, software
++ * distributed under the License is distributed on an "AS IS" BASIS,
++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++ * See the License for the specific language governing permissions and
++ * limitations under the License.
++ */
++
+ package com.sun.tools.internal.ws.wsdl.parser;
+ 
+ import com.sun.xml.internal.bind.v2.WellKnownNamespace;
+@@ -47,21 +63,6 @@
+         this.e = e;
+     }
+ 
+-    /*
+-     * Copyright 1999-2004 The Apache Software Foundation.
+-     *
+-     * Licensed under the Apache License, Version 2.0 (the "License");
+-     * you may not use this file except in compliance with the License.
+-     * You may obtain a copy of the License at
+-     *
+-     *     http://www.apache.org/licenses/LICENSE-2.0
+-     *
+-     * Unless required by applicable law or agreed to in writing, software
+-     * distributed under the License is distributed on an "AS IS" BASIS,
+-     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-     * See the License for the specific language governing permissions and
+-     * limitations under the License.
+-     */
+     public String getNamespaceURI(String prefix) {
+         Node parent = e;
+         String namespace = null;
+--- old/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/SOAP12ExtensionHandler.java	Thu Jul 30 17:20:22 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/SOAP12ExtensionHandler.java	Thu Jul 30 17:20:21 2009
+@@ -38,7 +38,7 @@
+         super(extensionHandlerMap);
+     }
+ 
+-    /* 
++    /*
+      * @see SOAPExtensionHandler#getNamespaceURI()
+      */
+     @Override
+@@ -46,7 +46,7 @@
+         return Constants.NS_WSDL_SOAP12;
+     }
+ 
+-    /* 
++    /*
+      * @see SOAPExtensionHandler#getAddressQName()
+      */
+     @Override
+@@ -54,7 +54,7 @@
+         return SOAP12Constants.QNAME_ADDRESS;
+     }
+ 
+-    /* 
++    /*
+      * @see SOAPExtensionHandler#getBindingQName()
+      */
+     @Override
+@@ -74,7 +74,7 @@
+         return SOAP12Constants.QNAME_BODY;
+     }
+ 
+-    /* 
++    /*
+      * @see SOAPExtensionHandler#getFaultQName()
+      */
+     @Override
+@@ -82,7 +82,7 @@
+         return SOAP12Constants.QNAME_FAULT;
+     }
+ 
+-    /* 
++    /*
+      * @see SOAPExtensionHandler#getHeaderfaultQName()
+      */
+     @Override
+@@ -90,7 +90,7 @@
+         return SOAP12Constants.QNAME_HEADERFAULT;
+     }
+ 
+-    /* 
++    /*
+      * @see SOAPExtensionHandler#getHeaderQName()
+      */
+     @Override
+@@ -98,7 +98,7 @@
+         return SOAP12Constants.QNAME_HEADER;
+     }
+ 
+-    /* 
++    /*
+      * @see SOAPExtensionHandler#getOperationQName()
+      */
+     @Override
+--- old/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/VersionChecker.java	Thu Jul 30 17:20:26 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/VersionChecker.java	Thu Jul 30 17:20:25 2009
+@@ -24,7 +24,6 @@
+  */
+ 
+ 
+-
+ package com.sun.tools.internal.ws.wsdl.parser;
+ 
+ import com.sun.tools.internal.ws.resources.WsdlMessages;
+@@ -107,7 +106,7 @@
+         if( JAXWSBindingsConstants.NS_JAXWS_BINDINGS.equals(namespaceURI)){
+             seenBindings = true;
+             if(version == null)
+-                version = "2.0";            
++                version = "2.0";
+         }
+ 
+     }
+@@ -136,4 +135,3 @@
+     private static final Set<String> VERSIONS = new HashSet<String>(Arrays.asList("2.0","2.1"));
+ 
+ }
+-
+--- old/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/W3CAddressingExtensionHandler.java	Thu Jul 30 17:20:29 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/W3CAddressingExtensionHandler.java	Thu Jul 30 17:20:28 2009
+@@ -22,9 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * $Id: W3CAddressingExtensionHandler.java,v 1.1.2.9 2007/02/06 00:33:38 kohsuke Exp $
+- */
+ 
+ package com.sun.tools.internal.ws.wsdl.parser;
+ 
+--- old/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/WSDLInternalizationLogic.java	Thu Jul 30 17:20:32 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/WSDLInternalizationLogic.java	Thu Jul 30 17:20:32 2009
+@@ -24,7 +24,6 @@
+  */
+ 
+ 
+-
+ package com.sun.tools.internal.ws.wsdl.parser;
+ 
+ import com.sun.tools.internal.ws.wsdl.document.WSDLConstants;
+@@ -56,9 +55,14 @@
+                     //TODO: add support for importing schema using wsdl:import
+                 }
+                 return atts.getValue("location");
+-            }else if(SchemaConstants.NS_XSD.equals(nsURI) && "import".equals(localName)){
++            }
++            /*
++            We don't need to do this anymore, JAXB handles the schema imports, includes etc.
++
++            else if(SchemaConstants.NS_XSD.equals(nsURI) && "import".equals(localName)){
+                 return atts.getValue("schemaLocation");
+             }
++            */
+             return null;
+         }
+     }
+@@ -84,7 +88,7 @@
+             appinfo = insertXMLSchemaElement( annotation, "appinfo" );
+ 
+         return appinfo;
+-        
++
+     }
+ 
+     public Element refineWSDLTarget(Element target){
+@@ -110,8 +114,8 @@
+ 
+         return child;
+     }
+-    
+ 
++
+     /**
+      * Creates a new XML Schema element of the given local name
+      * and insert it as the first child of the given parent node.
+--- old/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/WSDLParser.java	Thu Jul 30 17:20:36 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/WSDLParser.java	Thu Jul 30 17:20:35 2009
+@@ -29,9 +29,8 @@
+ import com.sun.tools.internal.ws.api.wsdl.TWSDLExtensionHandler;
+ 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.wscompile.WsimportOptions;
+ import com.sun.tools.internal.ws.wscompile.ErrorReceiverFilter;
++import com.sun.tools.internal.ws.wscompile.WsimportOptions;
+ import com.sun.tools.internal.ws.wsdl.document.Binding;
+ import com.sun.tools.internal.ws.wsdl.document.BindingFault;
+ import com.sun.tools.internal.ws.wsdl.document.BindingInput;
+@@ -68,11 +67,11 @@
+ import org.xml.sax.Locator;
+ import org.xml.sax.SAXException;
+ 
++import java.io.IOException;
+ import java.util.ArrayList;
+ import java.util.HashMap;
+ import java.util.Iterator;
+ import java.util.Map;
+-import java.io.IOException;
+ 
+ /**
+  * A parser for WSDL documents. This parser is used only at the tool time.
+@@ -135,7 +134,7 @@
+         // parse external binding files
+         for (InputSource value : options.getWSDLBindings()) {
+             errReceiver.pollAbort();
+-            Document root = forest.parse(value, true); // TODO: I think this should be false - KK
++            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)
+@@ -168,7 +167,7 @@
+     private WSDLDocument buildWSDLDocument(){
+         /**
+          * Currently we are working off first WSDL document
+-         * TODO: add support of creating WSDLDocument from collection of WSDL documents
++         * TODO: add support of creating WSDLDocument from fromjava.collection of WSDL documents
+          */
+ 
+         String location = forest.getRootWSDL();
+--- old/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/WhitespaceStripper.java	Thu Jul 30 17:20:40 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/WhitespaceStripper.java	Thu Jul 30 17:20:39 2009
+@@ -24,7 +24,6 @@
+  */
+ 
+ 
+-
+ package com.sun.tools.internal.ws.wsdl.parser;
+ 
+ import com.sun.xml.internal.bind.WhiteSpaceProcessor;
+@@ -122,4 +121,3 @@
+         // ignore completely.
+     }
+ }
+-
+--- old/src/share/classes/com/sun/tools/internal/xjc/AbortException.java	Thu Jul 30 17:20:43 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/AbortException.java	Thu Jul 30 17:20:43 2009
+@@ -34,7 +34,7 @@
+  * <p>
+  * This exception should be only thrown from {@link ErrorReceiver}
+  * for the consistent error handling.
+- * 
++ *
+  * @author Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+ public class AbortException extends RuntimeException {
+@@ -41,4 +41,3 @@
+     public AbortException() {
+     }
+ }
+-    
+--- old/src/share/classes/com/sun/tools/internal/xjc/ConsoleErrorReporter.java	Thu Jul 30 17:20:47 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/ConsoleErrorReporter.java	Thu Jul 30 17:20:46 2009
+@@ -31,7 +31,7 @@
+ 
+ /**
+  * {@link ErrorReceiver} that prints to a {@link PrintStream}.
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+@@ -41,7 +41,7 @@
+      * Errors, warnings are sent to this output.
+      */
+     private PrintStream output;
+-    
++
+     private boolean hadError = false;
+ 
+     public ConsoleErrorReporter( PrintStream out) {
+@@ -51,21 +51,21 @@
+         this(new PrintStream(out));
+     }
+     public ConsoleErrorReporter() { this(System.out); }
+-    
++
+     public void warning(SAXParseException e) {
+         print(Messages.WARNING_MSG,e);
+     }
+-    
++
+     public void error(SAXParseException e) {
+         hadError = true;
+         print(Messages.ERROR_MSG,e);
+     }
+-    
++
+     public void fatalError(SAXParseException e) {
+         hadError = true;
+         print(Messages.ERROR_MSG,e);
+     }
+-    
++
+     public void info(SAXParseException e) {
+         print(Messages.INFO_MSG,e);
+     }
+--- old/src/share/classes/com/sun/tools/internal/xjc/Driver.java	Thu Jul 30 17:20:50 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/Driver.java	Thu Jul 30 17:20:50 2009
+@@ -24,6 +24,7 @@
+  */
+ package com.sun.tools.internal.xjc;
+ 
++import java.io.File;
+ import java.io.FileOutputStream;
+ import java.io.IOException;
+ import java.io.OutputStream;
+@@ -101,7 +102,7 @@
+ 
+     private static void _main( String[] args ) throws Exception {
+         try {
+-            System.exit(run( args, System.err, System.out ));
++            System.exit(run( args, System.out, System.out ));
+         } catch (BadCommandLineException e) {
+             // there was an error in the command line.
+             // print usage and abort.
+@@ -240,6 +241,8 @@
+                 listener.message(Messages.format(Messages.PARSING_SCHEMA));
+             }
+ 
++            final boolean[] hadWarning = new boolean[1];
++
+             ErrorReceiver receiver = new ErrorReceiverFilter(listener) {
+                 public void info(SAXParseException exception) {
+                     if(opt.verbose)
+@@ -246,6 +249,7 @@
+                         super.info(exception);
+                 }
+                 public void warning(SAXParseException exception) {
++                    hadWarning[0] = true;
+                     if(!opt.quiet)
+                         super.warning(exception);
+                 }
+@@ -294,7 +298,7 @@
+                 }
+                 return -1;
+             }
+-            
++
+             Model model = ModelLoader.load( opt, new JCodeModel(), receiver );
+ 
+             if (model == null) {
+@@ -367,6 +371,15 @@
+                 assert false;
+             }
+ 
++            if(opt.debugMode) {
++                try {
++                    new FileOutputStream(new File(opt.targetDir,hadWarning[0]?"hadWarning":"noWarning")).close();
++                } catch (IOException e) {
++                    receiver.error(e);
++                    return -1;
++                }
++            }
++
+             return 0;
+         } catch( StackOverflowError e ) {
+             if(opt.verbose)
+@@ -410,10 +423,10 @@
+         GBIND
+     }
+ 
+-    
++
+     /**
+      * Command-line arguments processor.
+-     * 
++     *
+      * <p>
+      * This class contains options that only make sense
+      * for the command line interface.
+@@ -422,10 +435,10 @@
+     {
+         /** Operation mode. */
+         protected Mode mode = Mode.CODE;
+-        
++
+         /** A switch that determines the behavior in the BGM mode. */
+         public boolean noNS = false;
+-        
++
+         /** Parse XJC-specific options. */
+         public int parseArgument(String[] args, int i) throws BadCommandLineException {
+             if (args[i].equals("-noNS")) {
+@@ -482,7 +495,7 @@
+         } else {
+             System.out.println(Messages.format(Messages.DRIVER_PUBLIC_USAGE));
+         }
+-        
++
+         if( opts!=null && opts.getAllPlugins().size()!=0 ) {
+             System.out.println(Messages.format(Messages.ADDON_USAGE));
+             for (Plugin p : opts.getAllPlugins()) {
+--- old/src/share/classes/com/sun/tools/internal/xjc/ErrorReceiver.java	Thu Jul 30 17:20:54 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/ErrorReceiver.java	Thu Jul 30 17:20:53 2009
+@@ -38,11 +38,11 @@
+ /**
+  * Implemented by the driver of the compiler engine to handle
+  * errors found during the compiliation.
+- * 
++ *
+  * <p>
+  * This class implements {@link ErrorHandler} so it can be
+  * passed to anywhere where {@link ErrorHandler} is expected.
+- * 
++ *
+  * <p>
+  * However, to make the error handling easy (and make it work
+  * with visitor patterns nicely),
+@@ -49,11 +49,11 @@
+  * none of the methods on thi class throws {@link org.xml.sax.SAXException}.
+  * Instead, when the compilation needs to be aborted,
+  * it throws {@link AbortException}, which is unchecked.
+- * 
++ *
+  * <p>
+  * This also implements the externally visible {@link ErrorListener}
+  * so that we can reuse our internal implementation for testing and such.
+- * 
++ *
+  * @author Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+ public abstract class ErrorReceiver  implements ErrorHandler, ErrorListener {
+@@ -61,8 +61,8 @@
+ //
+ //
+ // convenience methods for callers
+-//    
+ //
++//
+     /**
+      * @param loc
+      *      can be null if the location is unknown
+@@ -90,7 +90,7 @@
+     public final void warning( Locator loc, String msg ) {
+         warning( new SAXParseException(msg,loc) );
+     }
+-    
++
+ //
+ //
+ // ErrorHandler implementation, but can't throw SAXException
+@@ -109,7 +109,7 @@
+ 
+     /**
+      * Reports verbose messages to users.
+-     * 
++     *
+      * This method can be used to report additional non-essential
+      * messages. The implementation usually discards them
+      * unless some specific debug option is turned on.
+@@ -118,7 +118,7 @@
+ 
+     /**
+      * Reports a debug message to users.
+-     * 
++     *
+      * @see #info(SAXParseException)
+      */
+     public final void debug( String msg ) {
+@@ -130,12 +130,12 @@
+ // convenience methods for derived classes
+ //
+ //
+-    
++
+   /**
+-   * Returns the human readable string representation of the 
++   * Returns the human readable string representation of the
+    * {@link org.xml.sax.Locator} part of the specified
+    * {@link SAXParseException}.
+-   * 
++   *
+    * @return  non-null valid object.
+    */
+   protected final String getLocationString( SAXParseException e ) {
+@@ -144,14 +144,14 @@
+           return Messages.format( Messages.LINE_X_OF_Y,
+               line==-1?"?":Integer.toString( line ),
+               getShortName( e.getSystemId() ) );
+-      } else {        
++      } else {
+           return Messages.format( Messages.UNKNOWN_LOCATION );
+       }
+   }
+-    
++
+   /** Computes a short name of a given URL for display. */
+   private String getShortName( String url ) {
+-      if(url==null)  
++      if(url==null)
+           return Messages.format( Messages.UNKNOWN_FILE );
+ 
+ // sometimes the user deals with a set of schems that reference each other
+@@ -166,8 +166,7 @@
+ //      if(idx!=-1)     return url.substring(idx+1);
+ //      idx = url.lastIndexOf('\\');
+ //      if(idx!=-1)     return url.substring(idx+1);
+-        
++
+       return url;
+   }
+ }
+-
+--- old/src/share/classes/com/sun/tools/internal/xjc/Language.java	Thu Jul 30 17:20:57 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/Language.java	Thu Jul 30 17:20:57 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc;
+ 
+ /**
+--- old/src/share/classes/com/sun/tools/internal/xjc/MessageBundle.properties	Thu Jul 30 17:21:01 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/MessageBundle.properties	Thu Jul 30 17:21:00 2009
+@@ -24,20 +24,20 @@
+ #
+ 
+ ConsoleErrorReporter.UnknownLocation = \
+-	unknown location
+-	
++        unknown location
++
+ ConsoleErrorReporter.LineXOfY = \
+-	\ \ line {0} of {1}
++        \ \ line {0} of {1}
+ 
+ ConsoleErrorReporter.UnknownFile = \
+-	unknown file
+-	
++        unknown file
++
+ Driver.Private.Usage = \
+ Usage: xjc [-options ...] <schema file/URL/dir/jar> ... [-b <bindinfo>] ...\n\
+ If dir is specified, all schema files in it will be compiled.\n\
+ If jar is specified, /META-INF/sun-jaxb.episode binding file will be compiled.\n\
+ Options:\n\
+-\ \ -debug             :  run in the debug mode\n\
++\ \ -debug             :  run in debug mode (includes -verbose)\n\
+ \ \ -nv                :  do not perform strict validation of the input schema(s)\n\
+ \ \ -extension         :  allow vendor extensions - do not strictly follow the\n\
+ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Compatibility Rules and App E.2 from the JAXB Spec\n\
+@@ -106,27 +106,30 @@
+ Driver.AddonUsage = \nExtensions:
+ 
+ Driver.ExperimentalLanguageWarning = \
+-	Are you trying to compile {0}? Support for {0} is experimental. \
+-	You may enable it by using the {1} option.
++        Are you trying to compile {0}? Support for {0} is experimental. \
++        You may enable it by using the {1} option.
+ 
+ Driver.NonExistentDir = \
+     cowardly refuses to write to a non-existent directory "{0}"
+-	
++
+ Driver.MissingRuntimePackageName = \
+-	the -use-runtime option is missing a package name
+-	
++        the -use-runtime option is missing a package name
++
+ Driver.MissingModeOperand = \
+-	the -mode option is missing an operand
+-	
++        the -mode option is missing an operand
++
+ Driver.MissingCompatibilityOperand = \
+-	the -compatibility option is missing an operand
++        the -compatibility option is missing an operand
+ 
++Driver.MissingOperand = \
++        an operand is missing
++
+ Driver.MissingProxyHost = \
+-	either the -host option is missing an operand \n\
++        either the -host option is missing an operand \n\
+         or -port was specified but not -host
+-	
++
+ Driver.MissingProxyPort = \
+-	either the -port option is missing an operand \n\
++        either the -port option is missing an operand \n\
+         or -host was specified but not -port
+ 
+ Driver.ILLEGAL_PROXY = \
+@@ -145,77 +148,80 @@
+     "{0}" is not a valid proxy format. The format is [user[:password]@]proxyHost:proxyPort
+ 
+ Driver.UnrecognizedMode = \
+-	unrecognized mode {0}
++        unrecognized mode {0}
+ 
+ Driver.UnrecognizedParameter = \
+-	unrecognized parameter {0}
+-	
++        unrecognized parameter {0}
++
+ Driver.MissingGrammar = \
+-	grammar is not specified
++        grammar is not specified
+ 
+ Driver.NotABindingFile = \
+-	not an external binding file. The root element must be '{'http://java.sun.com/xml/ns/jaxb'}'bindings but it is '{'{0}'}'{1}
+-		
++        not an external binding file. The root element must be '{'http://java.sun.com/xml/ns/jaxb'}'bindings but it is '{'{0}'}'{1}
++
+ Driver.ParsingSchema = \
+-	parsing a schema...
+-	
++        parsing a schema...
++
+ Driver.ParseFailed = \
+-	Failed to parse a schema.
++        Failed to parse a schema.
+ 
+ Driver.StackOverflow = \
+-	Stack overflow. Either you are compiling a large schema that requires more resource, or \
+-	XJC has a bug. First, please extend the stack size by using the -Xss JVM option. If this \
+-	doesn'''t solve the problem, please use the -debug option to obtain the stack trace and \
+-	contact Sun. 
+-		
++        Stack overflow. Either you are compiling a large schema that requires more resources, or \
++        XJC has a bug. First, please extend the stack size by using the -Xss JVM option. If this \
++        doesn'''t solve the problem, please use the -debug option to obtain the stack trace and \
++        contact Sun.
++
+ Driver.CompilingSchema = \
+-	compiling a schema...
++        compiling a schema...
+ 
+ Driver.FailedToGenerateCode = \
+-	Failed to produce code.
++        Failed to produce code.
+ 
+-# DO NOT localize the JAXB 2.1.3 in JDK string - it is a token for an ant <replaceFilter>	
++# DO NOT localize the JAXB 2.1.10 string - it is a token for an ant <replaceFilter>
+ Driver.FilePrologComment = \
+-	This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK \n\
+-	See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \n\
+-	Any modifications to this file will be lost upon recompilation of the source schema. \n\
+-	Generated on: {0} \n
++        This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 \n\
++        See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> \n\
++        Any modifications to this file will be lost upon recompilation of the source schema. \n\
++        Generated on: {0} \n
+ 
+ Driver.Version = \
+-	xjc version "JAXB 2.1.3" \n\
+-	JavaTM Architecture for XML Binding(JAXB) Reference Implementation, (build JAXB 2.1.3 in JDK)	
++        xjc version "JAXB 2.1.10" \n\
++        JavaTM Architecture for XML Binding(JAXB) Reference Implementation, (build JAXB 2.1.10)
+ 
+-Driver.BuildID = JAXB 2.1.3 in JDK
+-	
++Driver.BuildID = JAXB 2.1.10
++
++# for JDK integration - include version in source zip
++jaxb.jdk.version=2.1.10
++
+ # see java.text.SimpleDateFormat for format syntax
+ Driver.DateFormat = \
+-	yyyy.MM.dd
++        yyyy.MM.dd
+ 
+ # see java.text.SimpleDateFormat for format syntax
+ Driver.TimeFormat = \
+-	hh:mm:ss a z
++        hh:mm:ss a z
+ 
+-# as in: "generated on <date> at <time>"	
++# as in: "generated on <date> at <time>"
+ Driver.At = \
+-	at
++        at
+ 
+ Driver.ErrorMessage = \
+-	[ERROR] {0}
++        [ERROR] {0}
+ 
+ Driver.WarningMessage = \
+-	[WARNING] {0}
++        [WARNING] {0}
+ 
+ Driver.InfoMessage = \
+-	[INFO] {0}
++        [INFO] {0}
+ 
+ ModelLoader.TooManySchema = \
+-	Too many schema files for this schema language. Compile one file at a time.
++        Too many schema files for this schema language. Compile one file at a time.
+ 
+ ModelLoader.BindingFileNotSupportedForRNC = \
+     External binding files are not supported for the RELAX NG compact syntax.
+ 
+ Driver.DefaultVersion = \
+-	Defaulting the version to JAXB 2.0
++        Defaulting the version to JAXB 2.0
+ 
+ Driver.DefaultPackageWarning = \
+     Default Java package specified.  You will not be able to access the generated code from classes in any other package.
+@@ -227,10 +233,10 @@
+     Failed to parse "{0}": {1}
+ 
+ Driver.NotAFileNorURL = \
+-    "{0}" is neither a file name nor an URL
++    "{0}" is neither a file name nor a URL
+ 
+ FIELD_RENDERER_CONFLICT = \
+-    "-{0}" and "-{1}" are mutually exclusive since both affect the code generation 
++    "-{0}" and "-{1}" are mutually exclusive since both affect the code generation
+ 
+ NAME_CONVERTER_CONFLICT = \
+     "-{0}" and "-{1}" are mutually exclusive since both affect the code generation
+@@ -241,4 +247,3 @@
+ PLUGIN_LOAD_FAILURE = \
+     Failure to load a plugin: "{0}". Use the system property ''-Dcom.sun.tools.internal.xjc.Options.findServices=true'' to \
+     diagnose it further
+- 
+--- old/src/share/classes/com/sun/tools/internal/xjc/Messages.java	Thu Jul 30 17:21:04 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/Messages.java	Thu Jul 30 17:21:04 2009
+@@ -38,7 +38,7 @@
+         String text = ResourceBundle.getBundle(Messages.class.getPackage().getName() +".MessageBundle").getString(property);
+         return MessageFormat.format(text,args);
+     }
+-    
++
+ //
+ //
+ // Message resources
+@@ -46,10 +46,10 @@
+ //
+     static final String UNKNOWN_LOCATION = // 0 args
+         "ConsoleErrorReporter.UnknownLocation";
+-       
++
+     static final String LINE_X_OF_Y = // 2 args
+         "ConsoleErrorReporter.LineXOfY";
+-        
++
+     static final String UNKNOWN_FILE = // 0 args
+         "ConsoleErrorReporter.UnknownFile";
+ 
+@@ -58,16 +58,16 @@
+ 
+     static final String DRIVER_PRIVATE_USAGE = // 0 args
+         "Driver.Private.Usage";
+-    
++
+     static final String ADDON_USAGE = // 0 args
+         "Driver.AddonUsage";
+ 
+     static final String EXPERIMENTAL_LANGUAGE_WARNING = // 2 arg
+         "Driver.ExperimentalLanguageWarning";
+-    
++
+     static final String NON_EXISTENT_DIR = // 1 arg
+         "Driver.NonExistentDir";
+-        
++
+     static final String MISSING_RUNTIME_PACKAGENAME = // 0 args
+         "Driver.MissingRuntimePackageName";
+ 
+@@ -76,7 +76,7 @@
+ 
+     static final String MISSING_COMPATIBILITY_OPERAND = // 0 args
+         "Driver.MissingCompatibilityOperand";
+-    
++
+     static final String MISSING_PROXY = // 0 args
+         "Driver.MISSING_PROXY";
+ 
+@@ -97,37 +97,37 @@
+ 
+     static final String MISSING_PROXYHOST = // 0 args
+         "Driver.MissingProxyHost";
+-        
++
+     static final String MISSING_PROXYPORT = // 0 args
+         "Driver.MissingProxyPort";
+ 
+     static final String STACK_OVERFLOW = // 0 arg
+         "Driver.StackOverflow";
+-        
++
+     static final String UNRECOGNIZED_MODE = // 1 arg
+         "Driver.UnrecognizedMode";
+-        
++
+     static final String UNRECOGNIZED_PARAMETER = // 1 arg
+         "Driver.UnrecognizedParameter";
+ 
+     static final String MISSING_GRAMMAR = // 0 args
+         "Driver.MissingGrammar";
+-        
++
+     static final String PARSING_SCHEMA = // 0 args
+         "Driver.ParsingSchema";
+-        
++
+     static final String PARSE_FAILED = // 0 args
+         "Driver.ParseFailed";
+-        
++
+     static final String COMPILING_SCHEMA = // 0 args
+         "Driver.CompilingSchema";
+ 
+     static final String FAILED_TO_GENERATE_CODE = // 0 args
+         "Driver.FailedToGenerateCode";
+-        
++
+     static final String FILE_PROLOG_COMMENT = // 1 arg
+         "Driver.FilePrologComment";
+-        
++
+     static final String DATE_FORMAT = // 0 args
+         "Driver.DateFormat";
+ 
+@@ -136,25 +136,25 @@
+ 
+     static final String AT = // 0 args
+         "Driver.At";
+-        
++
+     static final String VERSION = // 0 args
+         "Driver.Version";
+-        
++
+     static final String BUILD_ID = // 0 args
+         "Driver.BuildID";
+-        
++
+     static final String ERROR_MSG = // 1:arg
+         "Driver.ErrorMessage";
+ 
+     static final String WARNING_MSG = // 1:arg
+         "Driver.WarningMessage";
+-        
++
+     static final String INFO_MSG = // 1:arg
+         "Driver.InfoMessage";
+-    
++
+     static final String ERR_NOT_A_BINDING_FILE = // 2 arg
+         "Driver.NotABindingFile";
+-    
++
+     static final String ERR_TOO_MANY_SCHEMA = // 0 args
+         "ModelLoader.TooManySchema";
+ 
+--- old/src/share/classes/com/sun/tools/internal/xjc/ModelLoader.java	Thu Jul 30 17:21:08 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/ModelLoader.java	Thu Jul 30 17:21:07 2009
+@@ -35,8 +35,8 @@
+ import com.sun.tools.internal.xjc.reader.internalizer.DOMForest;
+ import com.sun.tools.internal.xjc.reader.internalizer.DOMForestScanner;
+ import com.sun.tools.internal.xjc.reader.internalizer.InternalizationLogic;
+-import com.sun.tools.internal.xjc.reader.internalizer.VersionChecker;
+ import com.sun.tools.internal.xjc.reader.internalizer.SCDBasedBindingSet;
++import com.sun.tools.internal.xjc.reader.internalizer.VersionChecker;
+ import com.sun.tools.internal.xjc.reader.relaxng.RELAXNGCompiler;
+ import com.sun.tools.internal.xjc.reader.relaxng.RELAXNGInternalizationLogic;
+ import com.sun.tools.internal.xjc.reader.xmlschema.BGMBuilder;
+@@ -77,15 +77,15 @@
+ 
+ /**
+  * Builds a {@link Model} object.
+- * 
++ *
+  * This is an utility class that makes it easy to load a grammar object
+  * from various sources.
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+ public final class ModelLoader {
+-    
++
+     private final Options opt;
+     private final ErrorReceiverFilter errorReceiver;
+     private final JCodeModel codeModel;
+@@ -94,7 +94,7 @@
+      */
+     private SCDBasedBindingSet scdBasedBindingSet;
+ 
+-    
++
+     /**
+      * A convenience method to load schemas into a {@link Model}.
+      */
+@@ -101,8 +101,8 @@
+     public static Model load( Options opt, JCodeModel codeModel, ErrorReceiver er ) {
+         return new ModelLoader(opt,codeModel,er).load();
+     }
+-    
+-    
++
++
+     public ModelLoader(Options _opt, JCodeModel _codeModel, ErrorReceiver er) {
+         this.opt = _opt;
+         this.codeModel = _codeModel;
+@@ -114,8 +114,8 @@
+ 
+         if(!sanityCheck())
+             return null;
+-        
+-        
++
++
+         try {
+             switch (opt.getSchemaLanguage()) {
+             case DTD :
+@@ -155,7 +155,7 @@
+             case XMLSCHEMA:
+                 grammar = annotateXMLSchema( loadXMLSchema() );
+                 break;
+-            
++
+             default :
+                 throw new AssertionError(); // assertion failed
+             }
+@@ -197,7 +197,7 @@
+     private boolean sanityCheck() {
+         if( opt.getSchemaLanguage()==Language.XMLSCHEMA ) {
+             Language guess = opt.guessSchemaLanguage();
+-            
++
+             String[] msg = null;
+             switch(guess) {
+             case DTD:
+@@ -225,7 +225,7 @@
+ 
+     /**
+      * {@link XMLParser} implementation that adds additional processors into the chain.
+-     * 
++     *
+      * <p>
+      * This parser will parse a DOM forest as:
+      * DOMForestParser -->
+@@ -235,11 +235,11 @@
+      */
+     private class XMLSchemaParser implements XMLParser {
+         private final XMLParser baseParser;
+-        
++
+         private XMLSchemaParser(XMLParser baseParser) {
+             this.baseParser = baseParser;
+         }
+-        
++
+         public void parse(InputSource source, ContentHandler handler,
+             ErrorHandler errorHandler, EntityResolver entityResolver ) throws SAXException, IOException {
+             // set up the chain of handlers.
+@@ -260,19 +260,19 @@
+             return filter;
+         }
+     }
+-    
+ 
+ 
+ 
+ 
++
+     private void checkTooManySchemaErrors() {
+         if( opt.getGrammars().length!=1 )
+             errorReceiver.error(null,Messages.format(Messages.ERR_TOO_MANY_SCHEMA));
+     }
+-    
++
+     /**
+      * Parses a DTD file into an annotated grammar.
+-     * 
++     *
+      * @param   source
+      *      DTD file
+      * @param   bindFile
+@@ -294,22 +294,22 @@
+      * @throws SAXException
+      *      when a fatal happe
+      */
+-    public DOMForest buildDOMForest( InternalizationLogic logic ) 
++    public DOMForest buildDOMForest( InternalizationLogic logic )
+         throws SAXException {
+-    
++
+         // parse into DOM forest
+         DOMForest forest = new DOMForest(logic);
+-        
++
+         forest.setErrorHandler(errorReceiver);
+         if(opt.entityResolver!=null)
+         forest.setEntityResolver(opt.entityResolver);
+-        
++
+         // parse source grammars
+         for (InputSource value : opt.getGrammars()) {
+             errorReceiver.pollAbort();
+             forest.parse(value, true);
+         }
+-        
++
+         // parse external binding files
+         for (InputSource value : opt.getBindFiles()) {
+             errorReceiver.pollAbort();
+@@ -363,23 +363,23 @@
+         DOMForest forest = buildDOMForest( new XMLSchemaInternalizationLogic() );
+         return createXSOM(forest, scdBasedBindingSet);
+     }
+-    
++
+     /**
+      * Parses a set of schemas inside a WSDL file.
+-     * 
++     *
+      * A WSDL file may contain multiple &lt;xsd:schema> elements.
+      */
+     private XSSchemaSet loadWSDL()
+         throws SAXException {
+ 
+-        
++
+         // build DOMForest just like we handle XML Schema
+         DOMForest forest = buildDOMForest( new XMLSchemaInternalizationLogic() );
+-        
++
+         DOMForestScanner scanner = new DOMForestScanner(forest);
+-        
++
+         XSOMParser xsomParser = createXSOMParser( forest );
+-        
++
+         // find <xsd:schema>s and parse them individually
+         for( InputSource grammar : opt.getGrammars() ) {
+             Document wsdlDom = forest.get( grammar.getSystemId() );
+@@ -390,10 +390,10 @@
+         }
+         return xsomParser.getResult();
+     }
+-    
++
+     /**
+      * Annotates the obtained schema set.
+-     * 
++     *
+      * @return
+      *      null if an error happens. In that case, the error messages
+      *      will be properly reported to the controller by this method.
+@@ -489,6 +489,9 @@
+ 
+     /**
+      * Parses a {@link DOMForest} into a {@link XSSchemaSet}.
++     *
++     * @return
++     *      null if the parsing failed.
+      */
+     public XSSchemaSet createXSOM(DOMForest forest, SCDBasedBindingSet scdBasedBindingSet) throws SAXException {
+         // set up other parameters to XSOMParser
+@@ -504,11 +507,12 @@
+ 
+         XSSchemaSet result = reader.getResult();
+ 
+-        scdBasedBindingSet.apply(result,errorReceiver);
++        if(result!=null)
++            scdBasedBindingSet.apply(result,errorReceiver);
+ 
+         return result;
+     }
+-    
++
+     /**
+      * Parses a RELAX NG grammar into an annotated grammar.
+      */
+--- old/src/share/classes/com/sun/tools/internal/xjc/Options.java	Thu Jul 30 17:21:11 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/Options.java	Thu Jul 30 17:21:11 2009
+@@ -33,6 +33,7 @@
+ import java.io.PrintWriter;
+ import java.io.StringWriter;
+ import java.lang.reflect.Array;
++import java.lang.reflect.InvocationTargetException;
+ import java.net.MalformedURLException;
+ import java.net.URL;
+ import java.net.URLClassLoader;
+@@ -47,6 +48,7 @@
+ import java.util.regex.Pattern;
+ 
+ import com.sun.codemodel.internal.CodeWriter;
++import com.sun.codemodel.internal.JPackage;
+ import com.sun.codemodel.internal.writer.FileCodeWriter;
+ import com.sun.codemodel.internal.writer.PrologCodeWriter;
+ import com.sun.org.apache.xml.internal.resolver.CatalogManager;
+@@ -63,7 +65,7 @@
+ 
+ /**
+  * Global options.
+- * 
++ *
+  * <p>
+  * This class stores invocation configuration for XJC.
+  * The configuration in this class shoule be abstract enough so that
+@@ -73,10 +75,10 @@
+ {
+     /** If "-debug" is specified. */
+     public boolean debugMode;
+-    
++
+     /** If the "-verbose" option is specified. */
+     public boolean verbose;
+-    
++
+     /** If the "-quiet" option is specified. */
+     public boolean quiet;
+ 
+@@ -85,7 +87,7 @@
+ 
+     /** No file header comment (to be more friendly with diff.) */
+     public boolean noFileHeader;
+-    
++
+     /**
+      * Check the source schemas with extra scrutiny.
+      * The exact meaning depends on the schema language.
+@@ -103,7 +105,7 @@
+      * If true, try to resolve name conflicts automatically by assigning mechanical numbers.
+      */
+     public boolean automaticNameConflictResolution = false;
+-    
++
+     /**
+      * strictly follow the compatibility rules and reject schemas that
+      * contain features from App. E.2, use vendor binding extensions
+@@ -114,7 +116,7 @@
+      * binding extensions
+      */
+     public static final int EXTENSION = 2;
+-    
++
+     /**
+      * this switch determines how carefully the compiler will follow
+      * the compatibility rules in the spec. Either <code>STRICT</code>
+@@ -129,12 +131,34 @@
+     /**
+      * Generates output for the specified version of the runtime.
+      */
+-    public SpecVersion target = SpecVersion.V2_1;
++    public SpecVersion target = SpecVersion.LATEST;
+ 
++    private boolean is2_2 = true;
+ 
+-    /** Target direcoty when producing files. */
++    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;
++            }
++        }
++    }
++
++    /**
++     * Target directory when producing files.
++     * <p>
++     * This field is not used when XJC is driven through the XJC API.
++     * Plugins that need to generate extra files should do so by using
++     * {@link JPackage#addResourceFile(JResourceFile)}.
++     */
+     public File targetDir = new File(".");
+-    
++
+     /**
+      * Actually stores {@link CatalogResolver}, but the field
+      * type is made to {@link EntityResolver} so that XJC can be
+@@ -147,7 +171,7 @@
+      * constants.
+      */
+     private Language schemaLanguage = null;
+-    
++
+     /**
+      * The -p option that should control the default Java package that
+      * will contain the generated code. Null if unspecified.
+@@ -164,9 +188,9 @@
+      * Input schema files as a list of {@link InputSource}s.
+      */
+     private final List<InputSource> grammars = new ArrayList<InputSource>();
+-    
++
+     private final List<InputSource> bindFiles = new ArrayList<InputSource>();
+-    
++
+     // Proxy setting.
+     private String proxyHost = null;
+     private String proxyPort = null;
+@@ -328,12 +352,12 @@
+     public void setSchemaLanguage(Language _schemaLanguage) {
+         this.schemaLanguage = _schemaLanguage;
+     }
+-    
++
+     /** Input schema files. */
+     public InputSource[] getGrammars() {
+         return grammars.toArray(new InputSource[grammars.size()]);
+     }
+-    
++
+     /**
+      * Adds a new input schema.
+      */
+@@ -379,7 +403,7 @@
+         // absolutize all the system IDs in the input,
+         // so that we can map system IDs to DOM trees.
+         try {
+-            URL baseURL = new File(".").getCanonicalFile().toURL(); 
++            URL baseURL = new File(".").getCanonicalFile().toURL();
+             is.setSystemId( new URL(baseURL,is.getSystemId()).toExternalForm() );
+         } catch( IOException e ) {
+             // ignore
+@@ -387,7 +411,7 @@
+         return is;
+     }
+ 
+-    
++
+     /** Input external binding files. */
+     public InputSource[] getBindFiles() {
+         return bindFiles.toArray(new InputSource[bindFiles.size()]);
+@@ -424,11 +448,11 @@
+                 classpaths.toArray(new URL[classpaths.size()]),parent);
+     }
+ 
+-    
++
+     /**
+      * Parses an option <code>args[i]</code> and return
+      * the number of tokens consumed.
+-     * 
++     *
+      * @return
+      *      0 if the argument is not understood. Returning 0
+      *      will let the caller report an error.
+@@ -437,12 +461,15 @@
+      */
+     public int parseArgument( String[] args, int i ) throws BadCommandLineException {
+         if (args[i].equals("-classpath") || args[i].equals("-cp")) {
+-            File file = new File(requireArgument(args[i],args,++i));
+-            try {
+-                classpaths.add(file.toURL());
+-            } catch (MalformedURLException e) {
+-                throw new BadCommandLineException(
+-                    Messages.format(Messages.NOT_A_VALID_FILENAME,file),e);
++            String a = requireArgument(args[i], args, ++i);
++            for (String p : a.split(File.pathSeparator)) {
++                File file = new File(p);
++                try {
++                    classpaths.add(file.toURL());
++                } catch (MalformedURLException e) {
++                    throw new BadCommandLineException(
++                        Messages.format(Messages.NOT_A_VALID_FILENAME,file),e);
++                }
+             }
+             return 2;
+         }
+@@ -633,7 +660,7 @@
+                 throw new BadCommandLineException(e.getMessage(),e);
+             }
+         }
+-        
++
+         return 0;   // unrecognized
+     }
+ 
+@@ -706,10 +733,10 @@
+         }
+         ((CatalogResolver)entityResolver).getCatalog().parseCatalog(catalogFile.getPath());
+     }
+-    
++
+     /**
+      * Parses arguments and fill fields of this object.
+-     * 
++     *
+      * @exception BadCommandLineException
+      *      thrown when there's a problem in the command-line arguments
+      */
+@@ -731,7 +758,7 @@
+                     addFile(args[i],grammars,".xsd");
+             }
+         }
+-        
++
+         // configure proxy
+         if (proxyHost != null || proxyPort != null) {
+             if (proxyHost != null && proxyPort != null) {
+@@ -756,10 +783,15 @@
+         if (grammars.size() == 0)
+             throw new BadCommandLineException(
+                 Messages.format(Messages.MISSING_GRAMMAR));
+-        
++
+         if( schemaLanguage==null )
+             schemaLanguage = guessSchemaLanguage();
+ 
++//        if(target==SpecVersion.V2_2 && !isExtensionMode())
++//            throw new BadCommandLineException(
++//                "Currently 2.2 is still not finalized yet, so using it requires the -extension switch." +
++//                "NOTE THAT 2.2 SPEC MAY CHANGE BEFORE IT BECOMES FINAL.");
++
+         if(pluginLoadFailure!=null)
+             throw new BadCommandLineException(
+                 Messages.format(Messages.PLUGIN_LOAD_FAILURE,pluginLoadFailure));
+@@ -768,7 +800,7 @@
+     /**
+      * Finds the <tt>META-INF/sun-jaxb.episode</tt> file to add as a binding customization.
+      */
+-    private void scanEpisodeFile(File jar) throws BadCommandLineException {
++    public void scanEpisodeFile(File jar) throws BadCommandLineException {
+         try {
+             URLClassLoader ucl = new URLClassLoader(new URL[]{jar.toURL()});
+             Enumeration<URL> resources = ucl.findResources("META-INF/sun-jaxb.episode");
+@@ -787,18 +819,21 @@
+      * Guesses the schema language.
+      */
+     public Language guessSchemaLanguage() {
++
+         // otherwise, use the file extension.
+         // not a good solution, but very easy.
+-        String name = grammars.get(0).getSystemId().toLowerCase();
++        if ((grammars != null) && (grammars.size() > 0)) {
++            String name = grammars.get(0).getSystemId().toLowerCase();
+ 
+-        if (name.endsWith(".rng"))
+-            return Language.RELAXNG;
+-        if (name.endsWith(".rnc"))
+-            return Language.RELAXNG_COMPACT;
+-        if (name.endsWith(".dtd"))
+-            return Language.DTD;
+-        if (name.endsWith(".wsdl"))
+-            return Language.WSDL;
++            if (name.endsWith(".rng"))
++                return Language.RELAXNG;
++            if (name.endsWith(".rnc"))
++                return Language.RELAXNG_COMPACT;
++            if (name.endsWith(".dtd"))
++                return Language.DTD;
++            if (name.endsWith(".wsdl"))
++                return Language.WSDL;
++        }
+ 
+         // by default, assume XML Schema
+         return Language.XMLSCHEMA;
+@@ -853,6 +888,36 @@
+         // if true, print debug output
+         final boolean debug = com.sun.tools.internal.xjc.util.Util.getSystemProperty(Options.class,"findServices")!=null;
+ 
++        // if we are running on Mustang or Dolphin, use ServiceLoader
++        // so that we can take advantage of JSR-277 module system.
++        try {
++            Class<?> serviceLoader = Class.forName("java.util.ServiceLoader");
++            if(debug)
++                System.out.println("Using java.util.ServiceLoader");
++            Iterable<T> itr = (Iterable<T>)serviceLoader.getMethod("load",Class.class,ClassLoader.class).invoke(null,clazz,classLoader);
++            List<T> r = new ArrayList<T>();
++            for (T t : itr)
++                r.add(t);
++            return r.toArray((T[])Array.newInstance(clazz,r.size()));
++        } catch (ClassNotFoundException e) {
++            // fall through
++        } catch (IllegalAccessException e) {
++            Error x = new IllegalAccessError();
++            x.initCause(e);
++            throw x;
++        } catch (InvocationTargetException e) {
++            Throwable x = e.getTargetException();
++            if (x instanceof RuntimeException)
++                throw (RuntimeException) x;
++            if (x instanceof Error)
++                throw (Error) x;
++            throw new Error(x);
++        } catch (NoSuchMethodException e) {
++            Error x = new NoSuchMethodError();
++            x.initCause(e);
++            throw x;
++        }
++
+         String serviceId = "META-INF/services/" + clazz.getName();
+ 
+         // used to avoid creating the same instance twice
+--- old/src/share/classes/com/sun/tools/internal/xjc/Plugin.java	Thu Jul 30 17:21:15 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/Plugin.java	Thu Jul 30 17:21:14 2009
+@@ -38,11 +38,11 @@
+ 
+ /**
+  * Add-on that works on the generated source code.
+- * 
++ *
+  * <p>
+  * This add-on will be called after the default bean generation
+  * has finished.
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  *
+@@ -221,13 +221,13 @@
+      * <p>
+      * Note that this method is invoked only when a {@link Plugin}
+      * is activated.
+-     * 
++     *
+      * @param outline
+      *      This object allows access to various generated code.
+-     * 
++     *
+      * @param errorHandler
+      *      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
+--- old/src/share/classes/com/sun/tools/internal/xjc/ProgressCodeWriter.java	Thu Jul 30 17:21:18 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/ProgressCodeWriter.java	Thu Jul 30 17:21:18 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc;
+ 
+ import java.io.File;
+--- old/src/share/classes/com/sun/tools/internal/xjc/SchemaCache.java	Thu Jul 30 17:21:22 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/SchemaCache.java	Thu Jul 30 17:21:21 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc;
+ 
+ import java.lang.reflect.Field;
+--- old/src/share/classes/com/sun/tools/internal/xjc/XJCListener.java	Thu Jul 30 17:21:25 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/XJCListener.java	Thu Jul 30 17:21:25 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc;
+ 
+ import java.io.PrintStream;
+@@ -80,7 +81,7 @@
+      * will be reported through this method.
+      *
+      * This method is used like {@link PrintStream#println(String)}.
+-     * The callee is expected to add '\n'. 
++     * The callee is expected to add '\n'.
+      */
+     public void message(String msg) {}
+ 
+@@ -106,7 +107,7 @@
+      * Note that despite all the efforts to check this method frequently, XJC may still fail to
+      * invoke this method for a long time. Such scenario would include network related problems
+      * or other I/O block (you can't even interrupt the thread while I/O is blocking.)
+-     * So just beware that this is not a cure-all. 
++     * So just beware that this is not a cure-all.
+      *
+      * @return
+      *      true if the {@link XJCListener} wants to abort the processing.
+--- old/src/share/classes/com/sun/tools/internal/xjc/addon/at_generated/PluginImpl.java	Thu Jul 30 17:21:29 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/addon/at_generated/PluginImpl.java	Thu Jul 30 17:21:28 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.addon.at_generated;
+ 
+ import java.text.SimpleDateFormat;
+--- old/src/share/classes/com/sun/tools/internal/xjc/addon/code_injector/Const.java	Thu Jul 30 17:21:32 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/addon/code_injector/Const.java	Thu Jul 30 17:21:31 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.addon.code_injector;
+ 
+ /**
+--- old/src/share/classes/com/sun/tools/internal/xjc/addon/code_injector/PluginImpl.java	Thu Jul 30 17:21:35 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/addon/code_injector/PluginImpl.java	Thu Jul 30 17:21:35 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.addon.code_injector;
+ 
+ import java.util.Collections;
+--- old/src/share/classes/com/sun/tools/internal/xjc/addon/episode/PluginImpl.java	Thu Jul 30 17:21:39 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/addon/episode/PluginImpl.java	Thu Jul 30 17:21:38 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.addon.episode;
+ 
+ import java.io.File;
+--- old/src/share/classes/com/sun/tools/internal/xjc/addon/episode/package-info.java	Thu Jul 30 17:21:42 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/addon/episode/package-info.java	Thu Jul 30 17:21:42 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ @XmlNamespace(Const.JAXB_NSURI)
+ package com.sun.tools.internal.xjc.addon.episode;
+ 
+--- old/src/share/classes/com/sun/tools/internal/xjc/addon/locator/SourceLocationAddOn.java	Thu Jul 30 17:21:46 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/addon/locator/SourceLocationAddOn.java	Thu Jul 30 17:21:45 2009
+@@ -45,7 +45,7 @@
+ 
+ /**
+  * Generates JAXB objects that implement {@link Locatable}.
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+@@ -69,7 +69,7 @@
+         Outline outline,
+         Options opt,
+         ErrorHandler errorHandler ) {
+-        
++
+         for( ClassOutline ci : outline.getClasses() ) {
+             JDefinedClass impl = ci.implClass;
+             if (ci.getSuperClass() == null) {
+@@ -80,13 +80,13 @@
+                 impl._implements(Locatable.class);
+ 
+                 impl.method(JMod.PUBLIC, Locator.class, "sourceLocation").body()._return($loc);
+-                
++
+                 JMethod setter = impl.method(JMod.PUBLIC, Void.TYPE, "setSourceLocation");
+                 JVar $newLoc = setter.param(Locator.class, "newLocator");
+                 setter.body().assign($loc, $newLoc);
+             }
+         }
+-        
++
+         return true;
+     }
+ }
+--- old/src/share/classes/com/sun/tools/internal/xjc/addon/sync/SynchronizedMethodAddOn.java	Thu Jul 30 17:21:49 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/addon/sync/SynchronizedMethodAddOn.java	Thu Jul 30 17:21:49 2009
+@@ -37,7 +37,7 @@
+ 
+ /**
+  * Generates synchronized methods.
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+@@ -59,10 +59,10 @@
+ 
+         for( ClassOutline co : model.getClasses() )
+             augument(co);
+-        
++
+         return true;
+     }
+-    
++
+     /**
+      * Adds "synchoronized" to all the methods.
+      */
+--- old/src/share/classes/com/sun/tools/internal/xjc/api/ClassNameAllocator.java	Thu Jul 30 17:21:53 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/ClassNameAllocator.java	Thu Jul 30 17:21:52 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.api;
+ 
+ /**
+--- old/src/share/classes/com/sun/tools/internal/xjc/api/ErrorListener.java	Thu Jul 30 17:21:56 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/ErrorListener.java	Thu Jul 30 17:21:56 2009
+@@ -30,7 +30,7 @@
+ /**
+  * Implemented by the driver of the compiler engine to handle
+  * errors found during the compiliation.
+- * 
++ *
+  * <p>
+  * This class implements {@link ErrorHandler} so it can be
+  * passed to anywhere where {@link ErrorHandler} is expected.
+@@ -39,7 +39,7 @@
+  * However, to make the error handling easy (and make it work
+  * with visitor patterns nicely), this interface is not allowed
+  * to abort the processing. It merely receives errors.
+- * 
++ *
+  * @author Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+ public interface ErrorListener extends com.sun.xml.internal.bind.api.ErrorListener {
+--- old/src/share/classes/com/sun/tools/internal/xjc/api/J2SJAXBModel.java	Thu Jul 30 17:22:00 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/J2SJAXBModel.java	Thu Jul 30 17:21:59 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.api;
+ 
+ import java.io.IOException;
+--- old/src/share/classes/com/sun/tools/internal/xjc/api/JAXBModel.java	Thu Jul 30 17:22:03 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/JAXBModel.java	Thu Jul 30 17:22:02 2009
+@@ -30,7 +30,7 @@
+ 
+ /**
+  * The in-memory representation of the JAXB binding.
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+--- old/src/share/classes/com/sun/tools/internal/xjc/api/JavaCompiler.java	Thu Jul 30 17:22:06 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/JavaCompiler.java	Thu Jul 30 17:22:06 2009
+@@ -34,12 +34,12 @@
+ 
+ /**
+  * Java-to-Schema compiler.
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+ public interface JavaCompiler {
+-    
++
+     /**
+      * Compiles the given annotated Java source code.
+      *
+--- old/src/share/classes/com/sun/tools/internal/xjc/api/Property.java	Thu Jul 30 17:22:10 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/Property.java	Thu Jul 30 17:22:09 2009
+@@ -30,12 +30,12 @@
+ 
+ /**
+  * Represents a property of a wrapper-style element.
+- * 
++ *
+  * <p>
+  * Carrys information about one property of a wrapper-style
+  * element. This interface is solely intended for the use by
+  * the JAX-RPC and otherwise the use is discouraged.
+- * 
++ *
+  * <p>
+  * REVISIT: use CodeModel.
+  *
+@@ -46,11 +46,11 @@
+ public interface Property {
+     /**
+      * The name of the property.
+-     * 
++     *
+      * <p>
+      * This method returns a valid identifier suitable for
+      * the use as a variable name.
+-     * 
++     *
+      * @return
+      *      always non-null. Camel-style name like "foo" or "barAndZot".
+      *      Note that it may contain non-ASCII characters (CJK, etc.)
+@@ -58,10 +58,10 @@
+      *      wants to print this as a variable name.
+      */
+     String name();
+-    
++
+     /**
+      * The Java type of the property.
+-     * 
++     *
+      * @return
+      *      always non-null.
+      *      {@link JType} is a representation of a Java type in a codeModel.
+@@ -68,14 +68,14 @@
+      *      If you just need the fully-qualified class name, call {@link JType#fullName()}.
+      */
+     JType type();
+-    
++
+     /**
+      * Name of the XML element that corresponds to the property.
+-     * 
++     *
+      * <p>
+      * Each child of a wrapper style element corresponds with an
+      * element, and this method returns that name.
+-     * 
++     *
+      * @return
+      *      always non-null valid {@link QName}.
+      */
+--- old/src/share/classes/com/sun/tools/internal/xjc/api/Reference.java	Thu Jul 30 17:22:13 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/Reference.java	Thu Jul 30 17:22:13 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.api;
+ 
+ import com.sun.mirror.apt.AnnotationProcessorEnvironment;
+--- old/src/share/classes/com/sun/tools/internal/xjc/api/S2JJAXBModel.java	Thu Jul 30 17:22:17 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/S2JJAXBModel.java	Thu Jul 30 17:22:16 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.api;
+ 
+ import java.util.Collection;
+--- old/src/share/classes/com/sun/tools/internal/xjc/api/SchemaCompiler.java	Thu Jul 30 17:22:20 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/SchemaCompiler.java	Thu Jul 30 17:22:20 2009
+@@ -37,21 +37,21 @@
+ 
+ /**
+  * Schema-to-Java compiler.
+- * 
++ *
+  * <p>
+  * The caller can parse multiple schema documents,
+  * JAXB external binding files (or potentially WSDL
+  * and JSR-109.next mapping files in the future).
+- * 
++ *
+  * <p>
+  * All the errors found during this process will be sent
+  * to the registered {@link ErrorListener}.
+- * 
++ *
+  * <p>
+  * Once all the documents are parsed, call the {@link #bind()}
+  * method to get the compiled {@link JAXBModel} object.
+- * 
+- * 
++ *
++ *
+  * <h2>Tips: namespace URI -> package customization</h2>
+  * <p>
+  * The caller can feed the following synthesized schema
+@@ -70,7 +70,7 @@
+  * </xmp></pre>
+  * Feed this synthesized schema document for each namespace URI
+  * you need to map.
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+@@ -79,18 +79,18 @@
+      * Parses schemas or external bindings
+      * through SAX events by feeding events into
+      * SAX {@link ContentHandler}.
+-     * 
++     *
+      * @param systemId
+      *      The system ID of the document to be read in.
+-     * 
++     *
+      * @see #parseSchema(String, XMLStreamReader)
+      */
+     ContentHandler getParserHandler( String systemId );
+-    
++
+     /**
+      * Parses a schema or an external binding file
+      * from an external source.
+-     * 
++     *
+      * @param source
+      *      Its system Id must be set to an absolute URI.
+      */
+@@ -105,20 +105,20 @@
+      * @since 2.1 EA2
+      */
+     void setTargetVersion( SpecVersion version );
+-    
++
+     /**
+      * Parses a schema or an external binding file
+      * from the specified DOM element.
+-     * 
++     *
+      * <p>
+      * The given DOM element is treated as if it's the root of a
+      * virtual document.
+-     * 
++     *
+      * <p>
+      * XJC will not be able to print location information for
+      * errors found in this document, since DOM doesn't have them.
+      * For this reason, use of this method is strongly discouraged.
+-     * 
++     *
+      * @param systemId
+      *      We need an absolute system ID that uniquely designates the virtual
+      *      document. This should be different from the system ID of
+@@ -130,30 +130,30 @@
+      *      can use an unique identifier like "foo.wsdl#types"
+      */
+     void parseSchema( String systemId, Element element );
+-    
++
+     /**
+      * Parses a schema or an external binding file
+      * from the given source.
+-     * 
++     *
+      * <p>
+      * A stream reader must be pointing at the element or
+      * at the start of the document.
+      * XML is parsed until the corresponding end tag, then the
+      * sub tree is processed as a schema document.
+-     * 
++     *
+      * <p>
+      * When this method returns successfully, the parser is at
+      * the next token of the end element.
+-     * 
++     *
+      * @param systemId
+      *      The absolute system ID of the document that is being parsed.
+      *      This information is necessary to avoid double-inclusion
+      *      and etc.
+-     * 
++     *
+      *      Note that {@link XMLStreamReader#getLocation()} only
+      *      returns the system ID of the entity it is parsing, not
+      *      necessarily the system ID of the document itself.
+-     * 
++     *
+      * @throws XMLStreamException
+      *      If an error happens while parsing a document.
+      *      Note that not only the parser but also the XJC itself
+@@ -161,7 +161,7 @@
+      *      for example.)
+      */
+     void parseSchema( String systemId, XMLStreamReader reader ) throws XMLStreamException;
+-    
++
+     void setErrorListener( ErrorListener errorListener );
+     void setEntityResolver( EntityResolver entityResolver );
+ 
+@@ -220,10 +220,10 @@
+ 
+     /**
+      * Obtains the compiled schema object model.
+-     * 
++     *
+      * Once this method is called, no other method should be
+      * invoked on the {@link SchemaCompiler}.
+-     * 
++     *
+      * @return
+      *      null if the compilation fails. The errors should have been
+      *      delivered to the registered error handler in such a case.
+@@ -238,6 +238,10 @@
+      * then tweak settings on it. The updated settings will be used when the
+      * {@link #bind()} method is invoked.
+      *
++     * <p>
++     * The returned {@link Options} object is useful for example to specify
++     * command-line arguments.
++     *
+      * @since 2.0.2
+      * @deprecated
+      *      This method is not really "deprecated" (in the sense of being removed
+--- old/src/share/classes/com/sun/tools/internal/xjc/api/SpecVersion.java	Thu Jul 30 17:22:24 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/SpecVersion.java	Thu Jul 30 17:22:23 2009
+@@ -22,15 +22,16 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.api;
+ 
+ /**
+- * Represents the spec version constant. 
++ * Represents the spec version constant.
+  *
+  * @author Kohsuke Kawaguchi
+  */
+ public enum SpecVersion {
+-    V2_0, V2_1;
++    V2_0, V2_1, V2_2;
+ 
+     /**
+      * Returns true if this version is equal or later than the given one.
+@@ -40,7 +41,7 @@
+     }
+ 
+     /**
+-     * Parses "2.0" and "2.1" into the {@link SpecVersion} object.
++     * Parses "2.0", "2.1", and "2.2" into the {@link SpecVersion} object.
+      *
+      * @return null for parsing failure.
+      */
+@@ -47,11 +48,12 @@
+     public static SpecVersion parse(String token) {
+         if(token.equals("2.0"))
+             return V2_0;
+-        else
+         if(token.equals("2.1"))
+             return V2_1;
++        if(token.equals("2.2"))
++            return V2_2;
+         return null;
+     }
+ 
+-    public static final SpecVersion LATEST = V2_1;
++    public static final SpecVersion LATEST = V2_2;
+ }
+--- old/src/share/classes/com/sun/tools/internal/xjc/api/TypeAndAnnotation.java	Thu Jul 30 17:22:27 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/TypeAndAnnotation.java	Thu Jul 30 17:22:26 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.api;
+ 
+ import com.sun.codemodel.internal.JAnnotatable;
+--- old/src/share/classes/com/sun/tools/internal/xjc/api/XJC.java	Thu Jul 30 17:22:31 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/XJC.java	Thu Jul 30 17:22:30 2009
+@@ -38,7 +38,7 @@
+ public final class XJC {
+     /**
+      * Gets a fresh {@link JavaCompiler}.
+-     * 
++     *
+      * @return
+      *      always return non-null object.
+      */
+@@ -48,7 +48,7 @@
+ 
+     /**
+      * Gets a fresh {@link SchemaCompiler}.
+-     * 
++     *
+      * @return
+      *      always return non-null object.
+      */
+--- old/src/share/classes/com/sun/tools/internal/xjc/api/impl/j2s/JAXBModelImpl.java	Thu Jul 30 17:22:34 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/impl/j2s/JAXBModelImpl.java	Thu Jul 30 17:22:33 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.api.impl.j2s;
+ 
+ import java.io.IOException;
+--- old/src/share/classes/com/sun/tools/internal/xjc/api/impl/j2s/JavaCompilerImpl.java	Thu Jul 30 17:22:40 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/impl/j2s/JavaCompilerImpl.java	Thu Jul 30 17:22:40 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.api.impl.j2s;
+ 
+ import java.util.Collection;
+--- old/src/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/AbstractMappingImpl.java	Thu Jul 30 17:22:44 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/AbstractMappingImpl.java	Thu Jul 30 17:22:43 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.api.impl.s2j;
+ 
+ import java.util.ArrayList;
+--- old/src/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/BeanMappingImpl.java	Thu Jul 30 17:22:47 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/BeanMappingImpl.java	Thu Jul 30 17:22:47 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.api.impl.s2j;
+ 
+ import java.util.List;
+--- old/src/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/DowngradingErrorHandler.java	Thu Jul 30 17:22:51 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/DowngradingErrorHandler.java	Thu Jul 30 17:22:50 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.api.impl.s2j;
+ 
+ import org.xml.sax.ErrorHandler;
+--- old/src/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/ElementAdapter.java	Thu Jul 30 17:22:54 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/ElementAdapter.java	Thu Jul 30 17:22:53 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.api.impl.s2j;
+ 
+ import javax.xml.bind.JAXBElement;
+--- old/src/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/ElementCollectionAdapter.java	Thu Jul 30 17:22:58 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/ElementCollectionAdapter.java	Thu Jul 30 17:22:57 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.api.impl.s2j;
+ 
+ import java.util.ArrayList;
+--- old/src/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/ElementMappingImpl.java	Thu Jul 30 17:23:01 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/ElementMappingImpl.java	Thu Jul 30 17:23:00 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.api.impl.s2j;
+ 
+ import java.util.List;
+--- old/src/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/ElementSingleAdapter.java	Thu Jul 30 17:23:04 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/ElementSingleAdapter.java	Thu Jul 30 17:23:04 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.api.impl.s2j;
+ 
+ import javax.xml.bind.JAXBElement;
+--- old/src/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/JAXBModelImpl.java	Thu Jul 30 17:23:08 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/JAXBModelImpl.java	Thu Jul 30 17:23:07 2009
+@@ -49,7 +49,7 @@
+ 
+ /**
+  * {@link JAXBModel} implementation.
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+--- old/src/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/PropertyImpl.java	Thu Jul 30 17:23:11 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/PropertyImpl.java	Thu Jul 30 17:23:11 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.api.impl.s2j;
+ 
+ import javax.xml.namespace.QName;
+--- old/src/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/SchemaCompilerImpl.java	Thu Jul 30 17:23:15 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/SchemaCompilerImpl.java	Thu Jul 30 17:23:14 2009
+@@ -62,12 +62,12 @@
+ 
+ /**
+  * {@link SchemaCompiler} implementation.
+- * 
++ *
+  * This class builds a {@link DOMForest} until the {@link #bind()} method,
+  * then this method does the rest of the hard work.
+- * 
++ *
+  * @see ModelLoader
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+@@ -130,7 +130,7 @@
+                 e.getMessage(), null, systemId,-1,-1, e));
+         }
+     }
+-    
++
+     public void parseSchema(InputSource source) {
+         checkAbsoluteness(source.getSystemId());
+         try {
+@@ -174,7 +174,7 @@
+ 
+     public void setEntityResolver(EntityResolver entityResolver) {
+         forest.setEntityResolver(entityResolver);
+-        opts.entityResolver = entityResolver; 
++        opts.entityResolver = entityResolver;
+     }
+ 
+     public void setDefaultPackageName(String packageName) {
+@@ -200,7 +200,12 @@
+         // this has been problematic. turn it off.
+ //        if(!forest.checkSchemaCorrectness(this))
+ //            return null;
+-        
++
++        // parse all the binding files given via XJC -b options.
++        // this also takes care of the binding files given in the -episode option.
++        for (InputSource is : opts.getBindFiles())
++            parseSchema(is);
++
+         // internalization
+         SCDBasedBindingSet scdBasedBindingSet = forest.transform(opts.isExtensionMode());
+ 
+@@ -283,7 +288,7 @@
+ 
+     static {
+         try {
+-            NO_CORRECTNESS_CHECK = Boolean.getBoolean(SchemaCompilerImpl.class+".noCorrectnessCheck");
++            NO_CORRECTNESS_CHECK = Boolean.getBoolean(SchemaCompilerImpl.class.getName()+".noCorrectnessCheck");
+         } catch( Throwable t) {
+             // ignore
+         }
+--- old/src/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/TypeAndAnnotationImpl.java	Thu Jul 30 17:23:18 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/TypeAndAnnotationImpl.java	Thu Jul 30 17:23:18 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.api.impl.s2j;
+ 
+ import javax.xml.bind.annotation.XmlAttachmentRef;
+--- old/src/share/classes/com/sun/tools/internal/xjc/api/package.html	Thu Jul 30 17:23:22 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/package.html	Thu Jul 30 17:23:21 2009
+@@ -58,4 +58,4 @@
+ <h2>Implementation Note</h2>
+ <p>
+ This package shouldn't contain any implementation code.
+-</body></html> 
++</body></html>
+--- old/src/share/classes/com/sun/tools/internal/xjc/api/util/APTClassLoader.java	Thu Jul 30 17:23:25 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/util/APTClassLoader.java	Thu Jul 30 17:23:24 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.api.util;
+ 
+ import java.io.ByteArrayOutputStream;
+@@ -144,4 +145,3 @@
+         }
+     }
+ }
+-
+--- old/src/share/classes/com/sun/tools/internal/xjc/api/util/FilerCodeWriter.java	Thu Jul 30 17:23:28 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/util/FilerCodeWriter.java	Thu Jul 30 17:23:28 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.api.util;
+ 
+ import java.io.File;
+--- old/src/share/classes/com/sun/tools/internal/xjc/api/util/Messages.properties	Thu Jul 30 17:23:32 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/util/Messages.properties	Thu Jul 30 17:23:31 2009
+@@ -25,5 +25,3 @@
+ 
+ TOOLS_JAR_NOT_FOUND = \
+     JDK''s tools.jar was not found in {0}. Usually this means you are running JRE, not JDK. Please use the java command in JDK 5.0 or later (not JRE.)
+- 
+- 
+--- old/src/share/classes/com/sun/tools/internal/xjc/api/util/ToolsJarNotFoundException.java	Thu Jul 30 17:23:35 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/util/ToolsJarNotFoundException.java	Thu Jul 30 17:23:34 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.api.util;
+ 
+ import java.io.File;
+--- old/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlElementRefWriter.java	Thu Jul 30 17:23:38 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlElementRefWriter.java	Thu Jul 30 17:23:38 2009
+@@ -41,4 +41,6 @@
+ 
+     XmlElementRefWriter namespace(String value);
+ 
++    XmlElementRefWriter required(boolean value);
++
+ }
+--- old/src/share/classes/com/sun/tools/internal/xjc/generator/bean/BeanGenerator.java	Thu Jul 30 17:23:42 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/BeanGenerator.java	Thu Jul 30 17:23:41 2009
+@@ -101,6 +101,7 @@
+ import com.sun.xml.internal.bind.v2.runtime.SwaRefAdapter;
+ import com.sun.xml.internal.xsom.XmlString;
+ import com.sun.istack.internal.NotNull;
++import com.sun.tools.internal.xjc.model.CReferencePropertyInfo;
+ 
+ /**
+  * Generates fields and accessors.
+@@ -109,12 +110,12 @@
+ {
+     /** Simplifies class/interface creation and collision detection. */
+     private final CodeModelClassFactory codeModelClassFactory;
+-    
++
+     private final ErrorReceiver errorReceiver;
+ 
+     /** all {@link PackageOutline}s keyed by their {@link PackageOutline#_package}. */
+     private final Map<JPackage,PackageOutlineImpl> packageContexts = new HashMap<JPackage,PackageOutlineImpl>();
+-    
++
+     /** all {@link ClassOutline}s keyed by their {@link ClassOutline#target}. */
+     private final Map<CClassInfo,ClassOutlineImpl> classes = new HashMap<CClassInfo,ClassOutlineImpl>();
+ 
+@@ -128,7 +129,7 @@
+ 
+     /** the model object which we are processing. */
+     private final Model model;
+-    
++
+     private final JCodeModel codeModel;
+ 
+     /**
+@@ -146,7 +147,7 @@
+     /**
+      * Generates beans into code model according to the BGM,
+      * and produces the reflection model.
+-     * 
++     *
+      * @param _errorReceiver
+      *      This object will receive all the errors discovered
+      *      during the back-end stage.
+@@ -158,7 +159,7 @@
+      *      reported to the error recevier.)
+      */
+     public static Outline generate(Model model, ErrorReceiver _errorReceiver) {
+-        
++
+         try {
+             return new BeanGenerator(model, _errorReceiver);
+         } catch( AbortException e ) {
+@@ -165,8 +166,8 @@
+             return null;
+         }
+     }
+-    
+-    
++
++
+     private BeanGenerator(Model _model, ErrorReceiver _errorReceiver) {
+ 
+         this.model = _model;
+@@ -371,7 +372,7 @@
+     }
+ 
+     public ErrorReceiver getErrorReceiver() { return errorReceiver; }
+-    
++
+     public CodeModelClassFactory getClassFactory() { return codeModelClassFactory; }
+ 
+     public PackageOutlineImpl getPackageContext( JPackage p ) {
+@@ -405,7 +406,7 @@
+             usr._extends(r.implementation);
+             implRef = usr;
+         } else
+-        	implRef = r.implementation;
++                implRef = r.implementation;
+ 
+         return new ClassOutlineImpl(this,bean,r.exposed,r.implementation,implRef);
+     }
+@@ -451,12 +452,11 @@
+ 
+     /**
+      * Generates the body of a class.
+-     * 
++     *
+      */
+     private void generateClassBody( ClassOutlineImpl cc ) {
+         CClassInfo target = cc.target;
+ 
+-
+         // if serialization support is turned on, generate
+         // [RESULT]
+         // class ... implements Serializable {
+@@ -509,7 +509,10 @@
+         if(target.isOrdered()) {
+             for(CPropertyInfo p : target.getProperties() ) {
+                 if( ! (p instanceof CAttributePropertyInfo )) {
+-                    xtw.propOrder(p.getName(false));
++                    if (!( (p instanceof CReferencePropertyInfo) &&
++                           ((CReferencePropertyInfo)p).isDummy())) {
++                        xtw.propOrder(p.getName(false));
++                    }
+                 }
+             }
+         } else {
+@@ -612,8 +615,8 @@
+ 
+         XmlEnumWriter xew = type.annotate2(XmlEnumWriter.class);
+         xew.value(baseExposedType);
+-        
+ 
++
+         boolean needsValue = e.needsValueField();
+ 
+         // for each member <m>,
+@@ -720,7 +723,7 @@
+     /**
+      * Determines the FieldRenderer used for the given FieldUse,
+      * then generates the field declaration and accessor methods.
+-     * 
++     *
+      * The <code>fields</code> map will be updated with the newly
+      * created FieldRenderer.
+      */
+@@ -730,10 +733,9 @@
+             // none is specified. use the default factory
+             fr = model.options.getFieldRendererFactory().getDefault();
+ 
+-        FieldOutline field = fr.generate(cc,prop);
++        FieldOutline field = fr.generate(cc, prop);
+         fields.put(prop,field);
+-       
+-   
++
+         return field;
+     }
+ 
+--- old/src/share/classes/com/sun/tools/internal/xjc/generator/bean/ClassOutlineImpl.java	Thu Jul 30 17:23:46 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/ClassOutlineImpl.java	Thu Jul 30 17:23:45 2009
+@@ -32,7 +32,7 @@
+ /**
+  * {@link ClassOutline} enhanced with schema2java specific
+  * information.
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+@@ -43,7 +43,7 @@
+     public MethodWriter createMethodWriter() {
+         return _parent.getModel().strategy.createMethodWriter(this);
+     }
+-    
++
+     /**
+      * Gets {@link #_package} as {@link PackageOutlineImpl},
+      * since it's guaranteed to be of that type.
+--- old/src/share/classes/com/sun/tools/internal/xjc/generator/bean/DualObjectFactoryGenerator.java	Thu Jul 30 17:23:49 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/DualObjectFactoryGenerator.java	Thu Jul 30 17:23:48 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.generator.bean;
+ 
+ import com.sun.codemodel.internal.JDefinedClass;
+--- old/src/share/classes/com/sun/tools/internal/xjc/generator/bean/ElementOutlineImpl.java	Thu Jul 30 17:23:52 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/ElementOutlineImpl.java	Thu Jul 30 17:23:52 2009
+@@ -22,8 +22,10 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.generator.bean;
+ 
++
+ import javax.xml.bind.JAXBElement;
+ import javax.xml.namespace.QName;
+ 
+@@ -31,6 +33,7 @@
+ import com.sun.codemodel.internal.JCodeModel;
+ import com.sun.codemodel.internal.JExpr;
+ import com.sun.codemodel.internal.JExpression;
++import com.sun.codemodel.internal.JFieldVar;
+ import com.sun.codemodel.internal.JInvocation;
+ import com.sun.codemodel.internal.JMethod;
+ import com.sun.codemodel.internal.JMod;
+@@ -71,15 +74,24 @@
+             if(ei.getScope()!=null)
+                 scope = parent.getClazz(ei.getScope()).implRef;
+             JExpression scopeClass = scope==null?JExpr._null():scope.dotclass();
++            JFieldVar valField = implClass.field(JMod.PROTECTED|JMod.FINAL|JMod.STATIC,QName.class,"NAME",createQName(cm,ei.getElementName()));
+ 
+             // take this opportunity to generate a constructor in the element class
+             JMethod cons = implClass.constructor(JMod.PUBLIC);
+             cons.body().invoke("super")
+-                .arg(implClass.field(JMod.PROTECTED|JMod.FINAL|JMod.STATIC,QName.class,"NAME",createQName(cm,ei.getElementName())))
++                .arg(valField)
+                 .arg(declaredType)
+                 .arg(scopeClass)
+                 .arg(cons.param(implType,"value"));
+ 
++            // generate no-arg constructor in the element class (bug #391; section 5.6.2 in JAXB spec 2.1)
++            JMethod noArgCons = implClass.constructor(JMod.PUBLIC);
++            noArgCons.body().invoke("super")
++                .arg(valField)
++                .arg(declaredType)
++                .arg(scopeClass)
++                .arg(JExpr._null());
++
+         }
+     }
+ 
+--- old/src/share/classes/com/sun/tools/internal/xjc/generator/bean/ImplStructureStrategy.java	Thu Jul 30 17:23:56 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/ImplStructureStrategy.java	Thu Jul 30 17:23:55 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ /*
+  * Use is subject to the license terms.
+  */
+--- old/src/share/classes/com/sun/tools/internal/xjc/generator/bean/MessageBundle.properties	Thu Jul 30 17:23:59 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/MessageBundle.properties	Thu Jul 30 17:23:59 2009
+@@ -24,14 +24,14 @@
+ #
+ 
+ METHOD_COLLISION = \
+-	The "{0}" method is defined on both "{1}" and "{2}" and is causing a collision.
++        The "{0}" method is defined on both "{1}" and "{2}" and is causing a collision.
+ 
+ ERR_UNUSABLE_NAME = \
+-	Cannot derive a valid Java identifier from "{0}". Specify a customization to change the name.
++        Cannot derive a valid Java identifier from "{0}". Specify a customization to change the name.
+ 
+ ERR_NAME_COLLISION = \
+-	Type-safe enum has more than one values that share the same name "{0}". \
+-	Use a typesafeEnumMemberName customization to resolve this conflict.
++        Type-safe enum has more than one values that share the same name "{0}". \
++        Use a typesafeEnumMemberName customization to resolve this conflict.
+ 
+ ILLEGAL_CONSTRUCTOR_PARAM = \
+     Illegal constructor parameter {0}
+@@ -40,5 +40,4 @@
+     Two declarations cause a collision in the ObjectFactory class.
+ 
+ OBJECT_FACTORY_CONFLICT_RELATED = \
+-    (Related to above error) This is the other declaration.   
+- 
++    (Related to above error) This is the other declaration.
+--- old/src/share/classes/com/sun/tools/internal/xjc/generator/bean/MethodWriter.java	Thu Jul 30 17:24:03 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/MethodWriter.java	Thu Jul 30 17:24:02 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ /*
+  * Use is subject to the license terms.
+  */
+@@ -41,12 +42,12 @@
+  * <p>
+  * This class hides those details and allow callers to declare
+  * methods just once.
+- * 
++ *
+  * @author Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+ public abstract class MethodWriter {
+     protected final JCodeModel codeModel;
+-    
++
+     protected MethodWriter(ClassOutline context) {
+         this.codeModel = context.parent().getCodeModel();
+     }
+@@ -53,17 +54,17 @@
+ 
+     /**
+      * Declares a method in both the interface and the implementation.
+-     * 
++     *
+      * @return
+      *      JMethod object that represents a newly declared method
+      *      on the implementation class.
+      */
+     public abstract JMethod declareMethod( JType returnType, String methodName );
+-    
++
+     public final JMethod declareMethod( Class returnType, String methodName ) {
+         return declareMethod( codeModel.ref(returnType), methodName );
+     }
+-    
++
+     /**
+      * To generate javadoc for the previously declared method, use this method
+      * to obtain a {@link JDocComment} object. This may return a value
+@@ -71,16 +72,16 @@
+      */
+     public abstract JDocComment javadoc();
+ 
+-            
++
+     /**
+      * Adds a parameter to the previously declared method.
+-     * 
++     *
+      * @return
+      *      JVar object that represents a newly added parameter
+      *      on the implementation class.
+      */
+     public abstract JVar addParameter( JType type, String name );
+-    
++
+     public final JVar addParameter( Class type, String name ) {
+         return addParameter( codeModel.ref(type), name );
+     }
+--- old/src/share/classes/com/sun/tools/internal/xjc/generator/bean/ObjectFactoryGeneratorImpl.java	Thu Jul 30 17:24:06 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/ObjectFactoryGeneratorImpl.java	Thu Jul 30 17:24:06 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.generator.bean;
+ 
+ import java.util.Collection;
+@@ -29,6 +30,7 @@
+ import java.util.Map;
+ 
+ import javax.xml.bind.JAXBException;
++import javax.xml.bind.annotation.XmlInlineBinaryData;
+ import javax.xml.namespace.QName;
+ 
+ import com.sun.codemodel.internal.JClass;
+@@ -157,7 +159,7 @@
+ 
+         JClass scope=null;
+         if(ei.getScope()!=null)
+-            scope = outline.getClazz(ei.getScope()).implRef;
++            scope = outline.getClazz(ei.getScope()).implClass;
+ 
+ 
+         JMethod m;
+@@ -244,7 +246,10 @@
+         if(ei.getDefaultValue()!=null)
+             xemw.defaultValue(ei.getDefaultValue());
+ 
+-        // if the element is adapter, put that annotation on the factory method
++        if(ei.getProperty().inlineBinaryData())
++            m.annotate(XmlInlineBinaryData.class);
++
++                    // if the element is adapter, put that annotation on the factory method
+         outline.generateAdapterIfNecessary(ei.getProperty(),m);
+     }
+ 
+--- old/src/share/classes/com/sun/tools/internal/xjc/generator/bean/PackageOutlineImpl.java	Thu Jul 30 17:24:10 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/PackageOutlineImpl.java	Thu Jul 30 17:24:09 2009
+@@ -53,7 +53,7 @@
+ /**
+  * {@link PackageOutline} enhanced with schema2java specific
+  * information.
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+@@ -216,6 +216,11 @@
+      * Iterate through the hash map looking for the namespace used
+      * most frequently.  Ties are arbitrarily broken by the order
+      * in which the map keys are iterated over.
++     *
++     * <p>
++     * Because JAX-WS often reassigns the "" namespace URI,
++     * and when that happens it unintentionally also renames (normally
++     * unqualified) local elements, prefer non-"" URI when there's a tie.
+      */
+     private String getMostUsedURI(HashMap<String, Integer> map) {
+         String mostPopular = null;
+@@ -228,7 +233,7 @@
+                 mostPopular = uri;
+                 count = uriCount;
+             } else {
+-                if (uriCount > count) {
++                if (uriCount > count || (uriCount==count && mostPopular.equals(""))) {
+                     mostPopular = uri;
+                     count = uriCount;
+                 }
+--- old/src/share/classes/com/sun/tools/internal/xjc/generator/bean/PrivateObjectFactoryGenerator.java	Thu Jul 30 17:24:13 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/PrivateObjectFactoryGenerator.java	Thu Jul 30 17:24:13 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.generator.bean;
+ 
+ import javax.xml.bind.JAXBContext;
+--- old/src/share/classes/com/sun/tools/internal/xjc/generator/bean/PublicObjectFactoryGenerator.java	Thu Jul 30 17:24:17 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/PublicObjectFactoryGenerator.java	Thu Jul 30 17:24:16 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.generator.bean;
+ 
+ import com.sun.codemodel.internal.JPackage;
+--- old/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/AbstractField.java	Thu Jul 30 17:24:20 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/AbstractField.java	Thu Jul 30 17:24:19 2009
+@@ -33,6 +33,7 @@
+ import javax.xml.bind.annotation.XmlMixed;
+ import javax.xml.bind.annotation.XmlNsForm;
+ import javax.xml.bind.annotation.XmlValue;
++import javax.xml.bind.annotation.XmlInlineBinaryData;
+ import javax.xml.namespace.QName;
+ 
+ import com.sun.codemodel.internal.JAnnotatable;
+@@ -67,11 +68,14 @@
+ import com.sun.tools.internal.xjc.outline.FieldAccessor;
+ import com.sun.tools.internal.xjc.outline.FieldOutline;
+ import com.sun.tools.internal.xjc.reader.TypeUtil;
++import com.sun.tools.internal.xjc.Options;
++import com.sun.tools.internal.xjc.api.SpecVersion;
++import com.sun.xml.internal.bind.api.impl.NameConverter;
+ import com.sun.xml.internal.bind.v2.TODO;
+ 
+ /**
+  * Useful base class for implementing {@link FieldOutline}.
+- * 
++ *
+  * <p>
+  * This class just provides a few utility methods and keep some
+  * important variables so that they can be readily accessed any time.
+@@ -80,11 +84,11 @@
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+ abstract class AbstractField implements FieldOutline {
+-    
++
+     protected final ClassOutlineImpl outline;
+-    
++
+     protected final CPropertyInfo prop;
+-    
++
+     protected final JCodeModel codeModel;
+ 
+     /**
+@@ -148,6 +152,9 @@
+             field.annotate2(XmlSchemaTypeWriter.class)
+                 .name(st.getLocalPart())
+                 .namespace(st.getNamespaceURI());
++
++        if(prop.inlineBinaryData())
++            field.annotate(XmlInlineBinaryData.class);
+     }
+ 
+     private void annotateReference(JAnnotatable field) {
+@@ -165,6 +172,8 @@
+             refw.name(e.getElementName().getLocalPart())
+                 .namespace(e.getElementName().getNamespaceURI())
+                 .type(e.getType().toType(outline.parent(),IMPLEMENTATION));
++            if(getOptions().target.isLaterThan(SpecVersion.V2_2))
++                refw.required(rp.isRequired());
+         } else
+         if(elements.size()>1) {
+             XmlElementRefsWriter refsw = field.annotate2(XmlElementRefsWriter.class);
+@@ -173,6 +182,8 @@
+                 refw.name(e.getElementName().getLocalPart())
+                     .namespace(e.getElementName().getNamespaceURI())
+                     .type(e.getType().toType(outline.parent(),IMPLEMENTATION));
++                if(getOptions().target.isLaterThan(SpecVersion.V2_2))
++                    refw.required(rp.isRequired());
+             }
+         }
+ 
+@@ -244,9 +255,15 @@
+ 
+         // these values are used to determine how to optimize the generated annotation
+         XmlNsForm formDefault = parent()._package().getElementFormDefault();
+-        String mostUsedURI = parent()._package().getMostUsedNamespaceURI();
+         String propName = prop.getName(false);
+ 
++        String enclosingTypeNS;
++
++        if(parent().target.getTypeName()==null)
++            enclosingTypeNS = parent()._package().getMostUsedNamespaceURI();
++        else
++            enclosingTypeNS = parent().target.getTypeName().getNamespaceURI();
++
+         // generate the name property?
+         String generatedName = ctype.getTagName().getLocalPart();
+         if(!generatedName.equals(propName)) {
+@@ -256,7 +273,7 @@
+ 
+         // generate the namespace property?
+         String generatedNS = ctype.getTagName().getNamespaceURI();
+-        if (((formDefault == XmlNsForm.QUALIFIED) && !generatedNS.equals(mostUsedURI)) ||
++        if (((formDefault == XmlNsForm.QUALIFIED) && !generatedNS.equals(enclosingTypeNS)) ||
+                 ((formDefault == XmlNsForm.UNQUALIFIED) && !generatedNS.equals(""))) {
+             if(xew == null) xew = getXew(checkWrapper, field);
+             xew.namespace(generatedNS);
+@@ -281,7 +298,7 @@
+         // when generating code for 1.4, the runtime can't infer that ArrayList<Foo> derives
+         // from Collection<Foo> (because List isn't parameterized), so always expclitly
+         // generate @XmlElement(type=...)
+-        if( !jtype.equals(exposedType) || (parent().parent().getModel().options.runtime14 && prop.isCollection())) {
++        if( !jtype.equals(exposedType) || (getOptions().runtime14 && prop.isCollection())) {
+             if(xew == null) xew = getXew(checkWrapper, field);
+             xew.type(jtype);
+         }
+@@ -300,6 +317,13 @@
+         }
+     }
+ 
++    /**
++     * Gets the {@link Options} in the current compilation context.
++     */
++    protected final Options getOptions() {
++        return parent().parent().getModel().options;
++    }
++
+     // ugly hack to lazily create
+     private XmlElementsWriter xesw = null;
+ 
+@@ -330,8 +354,9 @@
+         final String generatedName = attName.getLocalPart();
+         final String generatedNS = attName.getNamespaceURI();
+ 
++        // Issue 570; always force generating name="" when do it when globalBindings underscoreBinding is set to non default value
+         // generate name property?
+-        if(!generatedName.equals(ap.getName(false))) {
++        if(!generatedName.equals(ap.getName(false)) || (outline.parent().getModel().getNameConverter() != NameConverter.standard)) {
+             xaw.name(generatedName);
+         }
+ 
+@@ -355,7 +380,7 @@
+          * Evaluates to the target object this accessor should access.
+          */
+         protected final JExpression $target;
+-        
++
+         protected Accessor( JExpression $target ) {
+             this.$target = $target;
+         }
+@@ -368,8 +393,8 @@
+             return prop;
+         }
+     }
+-    
+-    
++
++
+ //
+ //
+ //     utility methods
+--- old/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/AbstractFieldWithVar.java	Thu Jul 30 17:24:24 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/AbstractFieldWithVar.java	Thu Jul 30 17:24:23 2009
+@@ -31,23 +31,24 @@
+ 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;
+ 
+ /**
+- * 
+- * 
++ *
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+ abstract class AbstractFieldWithVar extends AbstractField {
+-    
++
+     /**
+      * Field declaration of the actual list object that we use
+      * to store data.
+      */
+     private JFieldVar field;
+-    
++
+     /**
+      * Invoke {@link #createField()} after calling the
+      * constructor.
+@@ -55,7 +56,7 @@
+     AbstractFieldWithVar( ClassOutlineImpl outline, CPropertyInfo prop ) {
+         super(outline,prop);
+     }
+-    
++
+     protected final void createField() {
+         field = outline.implClass.field( JMod.PROTECTED,
+             getFieldType(), prop.getName(false) );
+@@ -71,7 +72,13 @@
+      * {@code isXXXX} as the method name.
+      */
+     protected String getGetterMethod() {
+-        return (getFieldType().boxify().getPrimitiveType()==codeModel.BOOLEAN?"is":"get")+prop.getName(true);
++        if (getOptions().target.isLaterThan(SpecVersion.V2_2)) {
++            return ((getFieldType().isPrimitive() &&
++                     getFieldType().boxify().getPrimitiveType()==codeModel.BOOLEAN) ?
++                         "is":"get") + prop.getName(true);
++        } else {
++            return (getFieldType().boxify().getPrimitiveType()==codeModel.BOOLEAN?"is":"get")+prop.getName(true);
++        }
+     }
+ 
+     /**
+@@ -84,14 +91,14 @@
+     public final JType getRawType() {
+         return exposedType;
+     }
+-    
++
+     protected abstract class Accessor extends AbstractField.Accessor {
+-    
++
+         protected Accessor(JExpression $target) {
+             super($target);
+             this.$ref = $target.ref(AbstractFieldWithVar.this.ref());
+         }
+-        
++
+         /**
+          * Reference to the field bound by the target object.
+          */
+@@ -98,7 +105,11 @@
+         protected final JFieldRef $ref;
+ 
+         public final void toRawValue(JBlock block, JVar $var) {
+-            block.assign($var,$target.invoke(getGetterMethod()));
++            if (getOptions().target.isLaterThan(SpecVersion.V2_2)) {
++                block.assign($var,$target.invoke(getGetterMethod()));
++            } else {
++                block.assign($var,$target.invoke(getGetterMethod()));
++            }
+         }
+ 
+         public final void fromRawValue(JBlock block, String uniqueName, JExpression $var) {
+--- old/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/AbstractListField.java	Thu Jul 30 17:24:27 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/AbstractListField.java	Thu Jul 30 17:24:27 2009
+@@ -43,11 +43,11 @@
+ /**
+  * Common code for property renderer that generates a List as
+  * its underlying data structure.
+- * 
++ *
+  * <p>
+- * For performance reaons, the actual list object used to store
++ * For performance reasons, the actual list object used to store
+  * data is lazily created.
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+@@ -54,7 +54,7 @@
+ abstract class AbstractListField extends AbstractField {
+     /** The field that stores the list. */
+     protected JFieldVar field;
+-    
++
+     /**
+      * a method that lazily initializes a List.
+      * Lazily created.
+@@ -101,7 +101,7 @@
+         } else
+             primitiveType = null;
+     }
+-    
++
+     protected final void generate() {
+ 
+         // for the collectionType customization to take effect, the field needs to be strongly typed,
+@@ -136,46 +136,46 @@
+             .assign(field,newCoreList());
+     }
+ 
+-    public final JType getRawType() {
++    public JType getRawType() {
+         return codeModel.ref(List.class).narrow(exposedType.boxify());
+     }
+-    
++
+     private JExpression newCoreList() {
+         return JExpr._new(getCoreListType());
+     }
+-    
++
+     /**
+      * Concrete class that implements the List interface.
+      * Used as the actual data storage.
+      */
+     protected abstract JClass getCoreListType();
+-    
+-    
++
++
+     /** Generates accessor methods. */
+     protected abstract void generateAccessors();
+-    
+-    
+-    
++
++
++
+     /**
+-     * 
+-     * 
++     *
++     *
+      * @author
+      *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+      */
+     protected abstract class Accessor extends AbstractField.Accessor {
+-        
++
+         /**
+          * Reference to the {@link AbstractListField#field}
+          * of the target object.
+          */
+         protected final JFieldRef field;
+-        
++
+         protected Accessor( JExpression $target ) {
+             super($target);
+             field = $target.ref(AbstractListField.this.field);
+         }
+-        
+-        
++
++
+         protected final JExpression unbox( JExpression exp ) {
+             if(primitiveType==null) return exp;
+             else                    return primitiveType.unwrap(exp);
+@@ -184,13 +184,13 @@
+             if(primitiveType==null) return exp;
+             else                    return primitiveType.wrap(exp);
+         }
+-        
++
+         /**
+          * Returns a reference to the List field that stores the data.
+          * <p>
+          * Using this method hides the fact that the list is lazily
+          * created.
+-         * 
++         *
+          * @param canBeNull
+          *      if true, the returned expression may be null (this is
+          *      when the list is still not constructed.) This could be
+@@ -197,7 +197,7 @@
+          *      useful when the caller can deal with null more efficiently.
+          *      When the list is null, it should be treated as if the list
+          *      is empty.
+-         * 
++         *
+          *      if false, the returned expression will never be null.
+          *      This is the behavior users would see.
+          */
+@@ -212,7 +212,7 @@
+         public JExpression count() {
+             return JOp.cond( field.eq(JExpr._null()), JExpr.lit(0), field.invoke("size") );
+         }
+-        
++
+         public void unsetValues( JBlock body ) {
+             body.assign(field,JExpr._null());
+         }
+@@ -220,5 +220,5 @@
+             return field.ne(JExpr._null()).cand(field.invoke("isEmpty").not());
+         }
+     }
+-    
++
+ }
+--- old/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/ArrayField.java	Thu Jul 30 17:24:31 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/ArrayField.java	Thu Jul 30 17:24:30 2009
+@@ -24,10 +24,8 @@
+  */
+ package com.sun.tools.internal.xjc.generator.bean.field;
+ 
+-import java.util.ArrayList;
+-import java.util.Arrays;
++import com.sun.codemodel.internal.JAssignmentTarget;
+ import java.util.List;
+-
+ import com.sun.codemodel.internal.JBlock;
+ import com.sun.codemodel.internal.JClass;
+ import com.sun.codemodel.internal.JExpr;
+@@ -34,6 +32,7 @@
+ import com.sun.codemodel.internal.JExpression;
+ import com.sun.codemodel.internal.JForLoop;
+ import com.sun.codemodel.internal.JMethod;
++import com.sun.codemodel.internal.JMod;
+ import com.sun.codemodel.internal.JOp;
+ import com.sun.codemodel.internal.JType;
+ import com.sun.codemodel.internal.JVar;
+@@ -44,7 +43,7 @@
+ /**
+  * Realizes a property as an "indexed property"
+  * as specified in the JAXB spec.
+- * 
++ *
+  * <p>
+  * We will generate the following set of methods:
+  * <pre>
+@@ -53,50 +52,64 @@
+  * void setX(T[] values);
+  * void setX( int idx, T value );
+  * </pre>
+- * 
++ *
+  * We still use List as our back storage.
+  * This renderer also handles boxing/unboxing if
+  * T is a boxed type.
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+ final class ArrayField extends AbstractListField {
+-    
++
+     class Accessor extends AbstractListField.Accessor {
+         protected Accessor( JExpression $target ) {
+             super($target);
+         }
+-        
++
+         public void toRawValue(JBlock block, JVar $var) {
+-            block.assign($var,codeModel.ref(Arrays.class).staticInvoke("asList").arg($target.invoke($getAll)));
++            block.assign($var,$target.invoke($getAll));
+         }
+ 
+         public void fromRawValue(JBlock block, String uniqueName, JExpression $var) {
+-            block.invoke($target,$setAll).arg($var.invoke("toArray").arg(JExpr.newArray(exposedType,$var.invoke("size"))));
++            block.invoke($target,$setAll).arg($var);
+         }
++
++        @Override
++        public JExpression hasSetValue() {
++            return field.ne(JExpr._null()).cand(field.ref("length").gt(JExpr.lit(0)));
++        }
++
+     }
+-    
++
+     private JMethod $setAll;
+-    
++
+     private JMethod $getAll;
+-    
++
+     ArrayField(ClassOutlineImpl context, CPropertyInfo prop) {
+         super(context,prop,false);
+-        generate();
++        generateArray();
+     }
+-    
++
++    protected final void generateArray() {
++        field = outline.implClass.field( JMod.PROTECTED, getCoreListType(), prop.getName(false) );
++        annotate(field);
++
++        // generate the rest of accessors
++        generateAccessors();
++    }
++
+     public void generateAccessors() {
+-        
++
+         MethodWriter writer = outline.createMethodWriter();
+         Accessor acc = create(JExpr._this());
+-        
+         JVar $idx,$value; JBlock body;
+-        JType arrayType = exposedType.array();
+-        
++
+         // [RESULT] T[] getX() {
+         //     if( <var>==null )    return new T[0];
+-        //     return (T[]) <var>.toArray(new T[<var>.size()]);
++        //     T[] retVal = new T[this._return.length] ;
++        //     System.arraycopy(this._return, 0, "retVal", 0, this._return.length);
++        //     return (retVal);
+         // }
+         $getAll = writer.declareMethod( exposedType.array(),"get"+prop.getName(true));
+         writer.javadoc().append(prop.javadoc);
+@@ -104,29 +117,16 @@
+ 
+         body._if( acc.ref(true).eq(JExpr._null()) )._then()
+             ._return(JExpr.newArray(exposedType,0));
++        JVar var = body.decl(exposedType.array(), "retVal", JExpr.newArray(implType,acc.ref(true).ref("length")));
++        body.add(codeModel.ref(System.class).staticInvoke("arraycopy")
++                        .arg(acc.ref(true)).arg(JExpr.lit(0))
++                        .arg(var)
++                        .arg(JExpr.lit(0)).arg(acc.ref(true).ref("length")));
++        body._return(JExpr.direct("retVal"));
+ 
+-        if(primitiveType==null) {
+-            body._return(JExpr.cast(arrayType,
+-                acc.ref(true).invoke("toArray").arg( JExpr.newArray(implType,acc.ref(true).invoke("size")) )));
+-        } else {
+-            // need to copy them manually to unbox values
+-            // [RESULT]
+-            // T[] r = new T[<ref>.size()];
+-            // for( int i=0; i<r.length; i++ )
+-            //     r[i] = unbox(<ref>.get(i));
+-            JVar $r = body.decl(exposedType.array(),"r",JExpr.newArray(exposedType, acc.ref(true).invoke("size")));
+-            JForLoop loop = body._for();
+-            JVar $i = loop.init(codeModel.INT,"__i",JExpr.lit(0));
+-            loop.test($i.lt($r.ref("length")));
+-            loop.update($i.incr());
+-            loop.body().assign( $r.component($i),
+-                primitiveType.unwrap(acc.ref(true).invoke("get").arg($i)) );
+-            body._return($r);
+-        }
+-
+         List<Object> returnTypes = listPossibleTypes(prop);
+         writer.javadoc().addReturn().append("array of\n").append(returnTypes);
+-                        
++
+         // [RESULT]
+         // ET getX(int idx) {
+         //     if( <var>==null )    throw new IndexOutOfBoundsException();
+@@ -139,47 +139,50 @@
+             ._throw(JExpr._new(codeModel.ref(IndexOutOfBoundsException.class)));
+ 
+         writer.javadoc().append(prop.javadoc);
+-        $get.body()._return(acc.unbox(acc.ref(true).invoke("get").arg($idx) ));
++        $get.body()._return(acc.ref(true).component($idx));
+ 
+         writer.javadoc().addReturn().append("one of\n").append(returnTypes);
+ 
+-                        
+         // [RESULT] int getXLength() {
+         //     if( <var>==null )    throw new IndexOutOfBoundsException();
+-        //     return <ref>.size();
++        //     return <ref>.length;
+         // }
+         JMethod $getLength = writer.declareMethod(codeModel.INT,"get"+prop.getName(true)+"Length");
+         $getLength.body()._if(acc.ref(true).eq(JExpr._null()))._then()
+                 ._return(JExpr.lit(0));
+-        $getLength.body()._return(acc.ref(true).invoke("size"));
+-        
+-                        
++        $getLength.body()._return(acc.ref(true).ref("length"));
++
+         // [RESULT] void setX(ET[] values) {
+-        //     clear();
+         //     int len = values.length;
+         //     for( int i=0; i<len; i++ )
+-        //         <ref>.add(values[i]);
++        //         <ref>[i] = values[i];
+         // }
+         $setAll = writer.declareMethod(
+             codeModel.VOID,
+             "set"+prop.getName(true));
+-        
++
+         writer.javadoc().append(prop.javadoc);
+-        
+         $value = writer.addParameter(exposedType.array(),"values");
+-        $setAll.body().invoke(acc.ref(false),"clear");
+         JVar $len = $setAll.body().decl(codeModel.INT,"len", $value.ref("length"));
++
++        $setAll.body().assign(
++                (JAssignmentTarget) acc.ref(true),
++                castToImplTypeArray(JExpr.newArray(
++                    codeModel.ref(exposedType.erasure().fullName()),
++                    $len)));
++
+         JForLoop _for = $setAll.body()._for();
+         JVar $i = _for.init( codeModel.INT, "i", JExpr.lit(0) );
+         _for.test( JOp.lt($i,$len) );
+         _for.update( $i.incr() );
+-        _for.body().invoke(acc.ref(true),"add").arg(castToImplType(acc.box($value.component($i))));
++        _for.body().assign(acc.ref(true).component($i), castToImplType(acc.box($value.component($i))));
+ 
+         writer.javadoc().addParam($value)
+             .append("allowed objects are\n")
+             .append(returnTypes);
+-                        
+-        // [RESULT] ET setX(int,ET)
++
++        // [RESULT] ET setX(int idx, ET value)
++        // <ref>[idx] = value
+         JMethod $set = writer.declareMethod(
+             exposedType,
+             "set"+prop.getName(true));
+@@ -187,21 +190,35 @@
+         $value = writer.addParameter( exposedType, "value" );
+ 
+         writer.javadoc().append(prop.javadoc);
+-                        
++
+         body = $set.body();
+-        body._return( acc.unbox(
+-            acc.ref(true).invoke("set").arg($idx).arg(castToImplType(acc.box($value)))));
++        body._return( JExpr.assign(acc.ref(true).component($idx),
++                                   castToImplType(acc.box($value))));
+ 
+         writer.javadoc().addParam($value)
+             .append("allowed object is\n")
+             .append(returnTypes);
++
+     }
+-    
++
++    @Override
++    public JType getRawType() {
++        return exposedType.array();
++    }
++
+     protected JClass getCoreListType() {
+-        return codeModel.ref(ArrayList.class).narrow(exposedType.boxify());
++        return exposedType.array();
+     }
+-    
++
+     public Accessor create(JExpression targetObject) {
+         return new Accessor(targetObject);
+     }
++
++    /**
++     * Case from {@link #exposedType} to array of {@link #implType} .
++     */
++    protected final JExpression castToImplTypeArray( JExpression exp ) {
++        return JExpr.cast(implType.array(), exp);
++    }
++
+ }
+--- old/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/ConstField.java	Thu Jul 30 17:24:34 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/ConstField.java	Thu Jul 30 17:24:34 2009
+@@ -40,7 +40,7 @@
+  * Realizes a property as a "public static final" property on the interface.
+  * This class can handle both boxed/unboxed types and both
+  * single/colllection.
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+@@ -70,22 +70,22 @@
+         $ref = outline.ref.field(JMod.PUBLIC|JMod.STATIC|JMod.FINAL,
+             ptype!=null?ptype:implType, prop.getName(true), defaultValue );
+         $ref.javadoc().append(prop.javadoc);
+-        
++
+         annotate($ref);
+     }
+-    
++
+     public JType getRawType() {
+ //        if( isCollection )      return getInfo().array();
+         return exposedType;
+     }
+-    
+-    
++
++
+     public FieldAccessor create(JExpression target) {
+         return new Accessor(target);
+     }
+-    
++
+     private class Accessor extends AbstractField.Accessor {
+-        
++
+         Accessor( JExpression $target ) {
+             super($target);
+         }
+--- old/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/ConstFieldRenderer.java	Thu Jul 30 17:24:38 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/ConstFieldRenderer.java	Thu Jul 30 17:24:37 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.generator.bean.field;
+ 
+ import com.sun.tools.internal.xjc.generator.bean.ClassOutlineImpl;
+@@ -48,7 +49,7 @@
+ 
+     public FieldOutline generate(ClassOutlineImpl outline, CPropertyInfo prop) {
+         if(prop.defaultValue.compute(outline.parent())==null)
+-            return fallback.generate(outline,prop);
++            return fallback.generate(outline, prop);
+         else
+             return new ConstField(outline,prop);
+     }
+--- old/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/DefaultFieldRenderer.java	Thu Jul 30 17:24:41 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/DefaultFieldRenderer.java	Thu Jul 30 17:24:41 2009
+@@ -27,8 +27,12 @@
+ import java.util.ArrayList;
+ 
+ import com.sun.tools.internal.xjc.generator.bean.ClassOutlineImpl;
++import com.sun.tools.internal.xjc.model.CElement;
+ import com.sun.tools.internal.xjc.model.CPropertyInfo;
++import com.sun.tools.internal.xjc.model.CReferencePropertyInfo;
+ import com.sun.tools.internal.xjc.outline.FieldOutline;
++import java.io.Serializable;
++import java.util.Set;
+ 
+ /**
+  * Default implementation of the FieldRendererFactory
+@@ -44,7 +48,7 @@
+ final class DefaultFieldRenderer implements FieldRenderer {
+ 
+     private final FieldRendererFactory frf;
+-    
++
+     /**
+      * Use {@link FieldRendererFactory#getDefault()}.
+      */
+@@ -56,7 +60,7 @@
+         this.frf = frf;
+         this.defaultCollectionFieldRenderer = defaultCollectionFieldRenderer;
+     }
+-    
++
+     private FieldRenderer defaultCollectionFieldRenderer;
+ 
+ 
+@@ -63,8 +67,19 @@
+     public FieldOutline generate(ClassOutlineImpl outline, CPropertyInfo prop) {
+         return decideRenderer(outline,prop).generate(outline,prop);
+     }
+-    
+-    private FieldRenderer decideRenderer(ClassOutlineImpl outline,CPropertyInfo prop) {
++
++    private FieldRenderer decideRenderer(ClassOutlineImpl outline, CPropertyInfo prop) {
++
++        if (prop instanceof CReferencePropertyInfo) {
++            CReferencePropertyInfo p = (CReferencePropertyInfo)prop;
++            if (p.isDummy()) {
++                return frf.getDummyList(outline.parent().getCodeModel().ref(ArrayList.class));
++            }
++            if (p.isContent() && (p.isMixedExtendedCust())) {
++                return frf.getContentList(outline.parent().getCodeModel().ref(ArrayList.class).narrow(Serializable.class));
++            }
++        }
++
+         if(!prop.isCollection()) {
+             // non-collection field
+ 
+@@ -77,11 +92,11 @@
+                 // otherwise use the default non-collection field
+                 return frf.getSingle();
+         }
+-        
++
+         if( defaultCollectionFieldRenderer==null ) {
+             return frf.getList(outline.parent().getCodeModel().ref(ArrayList.class));
+         }
+-        
++
+         // this field is a collection field.
+         // use untyped list as the default. This is consistent
+         // to the JAXB spec.
+--- old/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/FieldRenderer.java	Thu Jul 30 17:24:45 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/FieldRenderer.java	Thu Jul 30 17:24:44 2009
+@@ -32,24 +32,24 @@
+ 
+ /**
+  * Abstract model of one field in a generated class.
+- * 
++ *
+  * <p>
+  * Responsible for "realizing" a Java property by actually generating
+  * members(s) to store the property value and a set of methods
+  * to manipulate them.
+- * 
++ *
+  * <p>
+  * Objects that implement this interface also encapsulates the
+  * <b>internal</b> access to the field.
+- * 
++ *
+  * <p>
+  * For discussion of the model this interface is representing, see
+  * the "field meta model" design document.
+- * 
++ *
+  * REVISIT:
+  *  refactor this to two interfaces that provide
+  *  (1) internal access and (2) external access.
+- * 
++ *
+  * @author
+  *  Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+@@ -59,8 +59,8 @@
+      * class, then return {@link FieldOutline} for accessing
+      * the generated field.
+      */
+-    public FieldOutline generate( ClassOutlineImpl context, CPropertyInfo prop );
+-    
++    public FieldOutline generate( ClassOutlineImpl context, CPropertyInfo prop);
++
+ //    //
+ //    // field renderers
+ //    //
+--- old/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/FieldRendererFactory.java	Thu Jul 30 17:24:48 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/FieldRendererFactory.java	Thu Jul 30 17:24:47 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.generator.bean.field;
+ 
+ import com.sun.tools.internal.xjc.Options;
+@@ -67,6 +68,12 @@
+     public FieldRenderer getList(JClass coreList) {
+         return new UntypedListFieldRenderer(coreList);
+     }
++    public FieldRenderer getContentList(JClass coreList) {
++        return new UntypedListFieldRenderer(coreList, false, true);
++    }
++    public FieldRenderer getDummyList(JClass coreList) {
++        return new UntypedListFieldRenderer(coreList, true, false);
++    }
+     public FieldRenderer getConst(FieldRenderer fallback) {
+         return new ConstFieldRenderer(fallback);
+     }
+--- old/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/GenericFieldRenderer.java	Thu Jul 30 17:24:51 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/GenericFieldRenderer.java	Thu Jul 30 17:24:51 2009
+@@ -32,14 +32,14 @@
+ import com.sun.tools.internal.xjc.outline.FieldOutline;
+ 
+ /**
+- * Creates 
+- * 
++ * Creates
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+ public final class GenericFieldRenderer implements FieldRenderer {
+     private Constructor constructor;
+-    
++
+     public GenericFieldRenderer( Class fieldClass ) {
+         try {
+             constructor = fieldClass.getDeclaredConstructor(new Class[]{ClassOutlineImpl.class,CPropertyInfo.class});
+@@ -47,7 +47,7 @@
+             throw new NoSuchMethodError(e.getMessage());
+         }
+     }
+-    
++
+     public FieldOutline generate(ClassOutlineImpl context, CPropertyInfo prop) {
+         try {
+             return (FieldOutline)constructor.newInstance(new Object[]{context,prop});
+@@ -61,10 +61,10 @@
+                 throw (RuntimeException)t;
+             if(t instanceof Error)
+                 throw (Error)t;
+-            
++
+             // impossible
+             throw new AssertionError(t);
+         }
+     }
+-    
++
+ }
+--- old/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/IsSetField.java	Thu Jul 30 17:24:55 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/IsSetField.java	Thu Jul 30 17:24:54 2009
+@@ -37,8 +37,8 @@
+ import com.sun.tools.internal.xjc.outline.FieldOutline;
+ 
+ /**
+- * 
+- * 
++ *
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+@@ -55,19 +55,19 @@
+         this.core = core;
+         this.generateIsSetMethod = issetMethod;
+         this.generateUnSetMethod = unsetMethod;
+-        
++
+         generate(outline,prop);
+     }
+-    
+-    
++
++
+     private void generate( ClassOutlineImpl outline, CPropertyInfo prop ) {
+         // add isSetXXX and unsetXXX.
+         MethodWriter writer = outline.createMethodWriter();
+-        
++
+         JCodeModel codeModel = outline.parent().getCodeModel();
+-        
++
+         FieldAccessor acc = core.create(JExpr._this());
+-        
++
+         if( generateIsSetMethod ) {
+             // [RESULT] boolean isSetXXX()
+             JExpression hasSetValue = acc.hasSetValue();
+@@ -79,7 +79,7 @@
+             writer.declareMethod(codeModel.BOOLEAN,"isSet"+this.prop.getName(true))
+                 .body()._return( hasSetValue );
+         }
+-        
++
+         if( generateUnSetMethod ) {
+             // [RESULT] void unsetXXX()
+             acc.unsetValues(
+@@ -90,21 +90,21 @@
+     public JType getRawType() {
+         return core.getRawType();
+     }
+-    
++
+     public FieldAccessor create(JExpression targetObject) {
+         return new Accessor(targetObject);
+     }
+-    
++
+     private class Accessor extends AbstractField.Accessor {
+-        
++
+         private final FieldAccessor core;
+-        
++
+         Accessor( JExpression $target ) {
+             super($target);
+             this.core = IsSetField.this.core.create($target);
+         }
+-        
+ 
++
+         public void unsetValues( JBlock body ) {
+             core.unsetValues(body);
+         }
+--- old/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/IsSetFieldRenderer.java	Thu Jul 30 17:24:58 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/IsSetFieldRenderer.java	Thu Jul 30 17:24:58 2009
+@@ -31,12 +31,12 @@
+ /**
+  * FieldRenderer that wraps another field generator
+  * and produces isSetXXX unsetXXX methods.
+- * 
++ *
+  * <p>
+  * This follows the decorator design pattern so that
+  * the caller of FieldRenderer can forget about details
+  * of the method generation.
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+@@ -44,11 +44,11 @@
+     private final FieldRenderer core;
+     private final boolean generateUnSetMethod;
+     private final boolean generateIsSetMethod;
+-    
+-    public IsSetFieldRenderer( 
++
++    public IsSetFieldRenderer(
+         FieldRenderer core,
+         boolean generateUnSetMethod, boolean generateIsSetMethod ) {
+-        
++
+         this.core = core;
+         this.generateUnSetMethod = generateUnSetMethod;
+         this.generateIsSetMethod = generateIsSetMethod;
+@@ -56,7 +56,7 @@
+ 
+     public FieldOutline generate(ClassOutlineImpl context, CPropertyInfo prop) {
+         return new IsSetField(context,prop,
+-            core.generate(context,prop),
++            core.generate(context, prop),
+             generateUnSetMethod,generateIsSetMethod);
+     }
+ }
+--- old/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/MessageBundle.properties	Thu Jul 30 17:25:02 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/MessageBundle.properties	Thu Jul 30 17:25:01 2009
+@@ -28,4 +28,3 @@
+ 
+ DEFAULT_GETTER_JAVADOC = \
+         Gets the value of the {0} property.
+- 
+--- old/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/Messages.java	Thu Jul 30 17:25:05 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/Messages.java	Thu Jul 30 17:25:05 2009
+@@ -31,7 +31,7 @@
+ /**
+  * Message resources
+  */
+-enum Messages {
++public enum Messages {
+     DEFAULT_GETTER_JAVADOC,     // 1 arg
+     DEFAULT_SETTER_JAVADOC,     // 1 arg
+     ;
+--- old/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/SingleField.java	Thu Jul 30 17:25:09 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/SingleField.java	Thu Jul 30 17:25:08 2009
+@@ -42,7 +42,7 @@
+ /**
+  * Realizes a property through one getter and one setter.
+  * This renders:
+- * 
++ *
+  * <pre>
+  * T' field;
+  * T getXXX() { ... }
+@@ -55,7 +55,7 @@
+  *
+  * This realization is only applicable to fields with (1,1)
+  * or (0,1) multiplicity.
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+@@ -74,9 +74,9 @@
+     protected SingleField(ClassOutlineImpl context, CPropertyInfo prop, boolean forcePrimitiveAccess ) {
+         super(context, prop);
+         assert !exposedType.isPrimitive() && !implType.isPrimitive();
+-        
++
+         createField();
+-        
++
+         MethodWriter writer = context.createMethodWriter();
+         NameConverter nc = context.parent().getModel().getNameConverter();
+ 
+@@ -119,7 +119,7 @@
+         writer.javadoc().addReturn()
+             .append("possible object is\n")
+             .append(possibleTypes);
+-         
++
+         // [RESULT]
+         // void setXXX(Type newVal) {
+         //     this.value = newVal;
+@@ -131,10 +131,8 @@
+         JBlock body = $set.body();
+         body.assign(JExpr._this().ref(ref()),castToImplType($value));
+ 
+-        javadoc = prop.javadoc;
+-        if(javadoc.length()==0)
+-            javadoc = Messages.DEFAULT_SETTER_JAVADOC.format(nc.toVariableName(prop.getName(true)));
+-        writer.javadoc().append(javadoc);
++        // setter always get the default javadoc. See issue #381
++        writer.javadoc().append(Messages.DEFAULT_SETTER_JAVADOC.format(nc.toVariableName(prop.getName(true))));
+         writer.javadoc().addParam($value)
+             .append("allowed object is\n")
+             .append(possibleTypes);
+@@ -147,12 +145,12 @@
+     public FieldAccessor create(JExpression targetObject) {
+         return new Accessor(targetObject);
+     }
+-    
++
+     protected class Accessor extends AbstractFieldWithVar.Accessor {
+         protected Accessor(JExpression $target) {
+             super($target);
+         }
+-        
++
+         public void unsetValues( JBlock body ) {
+             body.assign( $ref, JExpr._null() );
+         }
+--- old/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/SinglePrimitiveAccessField.java	Thu Jul 30 17:25:12 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/SinglePrimitiveAccessField.java	Thu Jul 30 17:25:12 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.generator.bean.field;
+ 
+ import com.sun.tools.internal.xjc.generator.bean.ClassOutlineImpl;
+@@ -29,7 +30,7 @@
+ 
+ /**
+  * {@link SingleField} that forces the primitive accessor type.
+- * 
++ *
+  * @author Kohsuke Kawaguchi
+  */
+ public class SinglePrimitiveAccessField extends SingleField {
+--- old/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/UnboxedField.java	Thu Jul 30 17:25:16 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/UnboxedField.java	Thu Jul 30 17:25:15 2009
+@@ -40,7 +40,7 @@
+ 
+ /**
+  * A required primitive property.
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+@@ -59,7 +59,7 @@
+ 
+         ptype = (JPrimitiveType) implType;
+         assert ptype!=null;
+-        
++
+         createField();
+ 
+         // apparently a required attribute can be still defaulted.
+@@ -70,7 +70,7 @@
+         NameConverter nc = outline.parent().getModel().getNameConverter();
+ 
+         JBlock body;
+-        
++
+         // [RESULT]
+         // Type getXXX() {
+         //     return value;
+@@ -92,10 +92,8 @@
+         JVar $value = writer.addParameter( ptype, "value" );
+         body = $set.body();
+         body.assign(JExpr._this().ref(ref()),$value);
+-        javadoc = prop.javadoc;
+-        if(javadoc.length()==0)
+-            javadoc = Messages.DEFAULT_SETTER_JAVADOC.format(nc.toVariableName(prop.getName(true)));
+-        writer.javadoc().append(javadoc);
++        // setter always get the default javadoc. See issue #381
++        writer.javadoc().append(Messages.DEFAULT_SETTER_JAVADOC.format(nc.toVariableName(prop.getName(true))));
+ 
+     }
+ 
+@@ -109,11 +107,11 @@
+ 
+     public FieldAccessor create(JExpression targetObject) {
+         return new Accessor(targetObject) {
+-            
++
+             public void unsetValues( JBlock body ) {
+                 // you can't unset a value
+             }
+-            
++
+             public JExpression hasSetValue() {
+                 return JExpr.TRUE;
+             }
+--- old/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/UntypedListField.java	Thu Jul 30 17:25:19 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/UntypedListField.java	Thu Jul 30 17:25:18 2009
+@@ -40,11 +40,11 @@
+ 
+ /**
+  * Realizes a property as an untyped {@link List}.
+- * 
++ *
+  * <pre>
+  * List getXXX();
+  * </pre>
+- * 
++ *
+  * <h2>Default value handling</h2>
+  * <p>
+  * Since unmarshaller just adds new values into the storage,
+@@ -56,14 +56,14 @@
+  * When the getXXX method is called, we'll check if the storage is
+  * modified in anyway. If it is modified, it must mean that the values
+  * are found in the document, so we just return it.
+- * 
++ *
+  * Otherwise we will fill in default values and return it to the user.
+- * 
++ *
+  * <p>
+  * When a list has default values, its dirty flag is set to true.
+  * Marshaller will check this and treat it appropriately.
+- * 
+- * 
++ *
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+--- old/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/UntypedListFieldRenderer.java	Thu Jul 30 17:25:23 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/UntypedListFieldRenderer.java	Thu Jul 30 17:25:22 2009
+@@ -30,8 +30,8 @@
+ import com.sun.tools.internal.xjc.outline.FieldOutline;
+ 
+ /**
+- * 
+- * 
++ *
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+@@ -38,12 +38,26 @@
+ public final class UntypedListFieldRenderer implements FieldRenderer {
+ 
+     private JClass coreList;
++    private boolean dummy;
++    private boolean content;
+ 
+-    protected UntypedListFieldRenderer( JClass coreList ) {
++    protected UntypedListFieldRenderer( JClass coreList) {
++        this(coreList, false, false);
++    }
++
++    protected UntypedListFieldRenderer( JClass coreList, boolean dummy, boolean content) {
+         this.coreList = coreList;
++        this.dummy = dummy;
++        this.content = content;
+     }
+-    
++
+     public FieldOutline generate(ClassOutlineImpl context, CPropertyInfo prop) {
+-        return new UntypedListField(context,prop,coreList);
++        if (dummy) {
++            return new DummyListField(context, prop, coreList);
++        }
++        if (content) {
++            return new ContentListField(context, prop, coreList);
++        }
++        return new UntypedListField(context, prop, coreList);
+     }
+ }
+--- old/src/share/classes/com/sun/tools/internal/xjc/generator/package-info.java	Thu Jul 30 17:25:26 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/package-info.java	Thu Jul 30 17:25:25 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ /**
+  * <h1>Code Generator</h1>.
+  *
+--- old/src/share/classes/com/sun/tools/internal/xjc/generator/util/BlockReference.java	Thu Jul 30 17:25:29 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/util/BlockReference.java	Thu Jul 30 17:25:29 2009
+@@ -28,11 +28,11 @@
+ 
+ /**
+  * Holds a reference to a {@link JBlock} object.
+- * 
++ *
+  * <p>
+  * This interface is usually used when one wants to create
+  * a new JBlock object lazily.
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+@@ -40,7 +40,7 @@
+     /**
+      * @param create
+      *      If false, the method will return null if the block is
+-     *      not yet created.  
++     *      not yet created.
+      */
+     JBlock get(boolean create);
+ }
+--- old/src/share/classes/com/sun/tools/internal/xjc/generator/util/ExistingBlockReference.java	Thu Jul 30 17:25:33 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/util/ExistingBlockReference.java	Thu Jul 30 17:25:32 2009
+@@ -27,17 +27,17 @@
+ import com.sun.codemodel.internal.JBlock;
+ 
+ /**
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+ public class ExistingBlockReference implements BlockReference {
+     private final JBlock block;
+-    
++
+     public ExistingBlockReference( JBlock _block ) {
+         this.block = _block;
+     }
+-    
++
+     public JBlock get(boolean create) {
+         return block;
+     }
+--- old/src/share/classes/com/sun/tools/internal/xjc/generator/util/LazyBlockReference.java	Thu Jul 30 17:25:36 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/util/LazyBlockReference.java	Thu Jul 30 17:25:36 2009
+@@ -28,20 +28,20 @@
+ 
+ /**
+  * Lazy block reference.
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+ public abstract class LazyBlockReference implements BlockReference {
+-    
++
+     private JBlock block = null;
+-    
++
+     /**
+      * Called when a block needs to be created.
+      * Only called once in the whole life time of this object.
+      */
+     protected abstract JBlock create();
+-    
++
+     public JBlock get(boolean create) {
+         if(!create)     return block;
+         if(block==null)
+--- old/src/share/classes/com/sun/tools/internal/xjc/generator/util/WhitespaceNormalizer.java	Thu Jul 30 17:25:40 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/util/WhitespaceNormalizer.java	Thu Jul 30 17:25:39 2009
+@@ -38,20 +38,20 @@
+     /**
+      * Generates the expression that normalizes
+      * the given expression (which evaluates to java.lang.String).
+-     * 
++     *
+      * @param codeModel
+      *      The owner code model object under which a new expression
+-     *      will be created. 
++     *      will be created.
+      */
+     public abstract JExpression generate( JCodeModel codeModel, JExpression literal );
+-    
++
+     /**
+      * Parses "preserve","replace" or "collapse" into
+      * the corresponding WhitespaceNormalizer object.
+-     * 
++     *
+      * @param method
+      *      Either "preserve", "replace", or "collapse"
+-     * 
++     *
+      * @exception    IllegalArgumentException
+      *        when the specified method is invalid.
+      */
+@@ -58,22 +58,22 @@
+     public static WhitespaceNormalizer parse( String method ) {
+         if( method.equals("preserve") )
+             return PRESERVE;
+-        
++
+         if( method.equals("replace") )
+             return REPLACE;
+-        
++
+         if( method.equals("collapse") )
+             return COLLAPSE;
+-        
++
+         throw new IllegalArgumentException(method);
+     }
+-    
++
+     public static final WhitespaceNormalizer PRESERVE = new WhitespaceNormalizer() {
+         public JExpression generate( JCodeModel codeModel, JExpression literal ) {
+             return literal;
+         }
+     };
+-    
++
+     public static final WhitespaceNormalizer REPLACE = new WhitespaceNormalizer() {
+         public JExpression generate( JCodeModel codeModel, JExpression literal ) {
+             // WhitespaceProcessor.replace(<literal>);
+@@ -85,7 +85,7 @@
+                     .staticInvoke("replace").arg(literal);
+         }
+     };
+-    
++
+     public static final WhitespaceNormalizer COLLAPSE = new WhitespaceNormalizer() {
+         public JExpression generate( JCodeModel codeModel, JExpression literal ) {
+             // WhitespaceProcessor.replace(<literal>);
+--- old/src/share/classes/com/sun/tools/internal/xjc/model/AbstractCElement.java	Thu Jul 30 17:25:43 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/AbstractCElement.java	Thu Jul 30 17:25:43 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.model;
+ 
+ import javax.xml.bind.annotation.XmlTransient;
+@@ -32,7 +33,7 @@
+ 
+ /**
+  * Partial default implementation of {@link CElement}.
+- * 
++ *
+  * @author Kohsuke Kawaguchi
+  */
+ abstract class AbstractCElement extends AbstractCTypeInfoImpl implements CElement {
+--- old/src/share/classes/com/sun/tools/internal/xjc/model/AbstractCTypeInfoImpl.java	Thu Jul 30 17:25:47 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/AbstractCTypeInfoImpl.java	Thu Jul 30 17:25:46 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.model;
+ 
+ import javax.activation.MimeType;
+--- old/src/share/classes/com/sun/tools/internal/xjc/model/AutoClassNameAllocator.java	Thu Jul 30 17:25:50 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/AutoClassNameAllocator.java	Thu Jul 30 17:25:49 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.model;
+ 
+ import java.util.Set;
+@@ -33,7 +34,7 @@
+ 
+ /**
+  * {@link ClassNameAllocator} filter that performs automatic name conflict resolution.
+- * 
++ *
+  * @author Kohsuke Kawaguchi
+  */
+ public class AutoClassNameAllocator implements ClassNameAllocator {
+--- old/src/share/classes/com/sun/tools/internal/xjc/model/CAdapter.java	Thu Jul 30 17:25:53 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CAdapter.java	Thu Jul 30 17:25:53 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.model;
+ 
+ import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
+--- old/src/share/classes/com/sun/tools/internal/xjc/model/CArrayInfo.java	Thu Jul 30 17:25:57 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CArrayInfo.java	Thu Jul 30 17:25:56 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.model;
+ 
+ import javax.xml.namespace.QName;
+@@ -38,7 +39,12 @@
+ import org.xml.sax.Locator;
+ 
+ /**
+- * TODO: Because s2j doesn't generate the array binding, this is unnecessary.
++ * Because XJC doesn't generate the array binding, this class will
++ * never show up in the model constructed by XJC.
++ *
++ * <p>
++ * This class is nevertheless defined to make the type checker happy.
++ *
+  * @author Kohsuke Kawaguchi
+  */
+ public final class CArrayInfo extends AbstractCTypeInfoImpl implements ArrayInfo<NType,NClass>, CNonElement, NType {
+--- old/src/share/classes/com/sun/tools/internal/xjc/model/CAttributePropertyInfo.java	Thu Jul 30 17:26:00 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CAttributePropertyInfo.java	Thu Jul 30 17:26:00 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.model;
+ 
+ import javax.xml.namespace.QName;
+--- old/src/share/classes/com/sun/tools/internal/xjc/model/CBuiltinLeafInfo.java	Thu Jul 30 17:26:04 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CBuiltinLeafInfo.java	Thu Jul 30 17:26:03 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.model;
+ 
+ import java.awt.*;
+@@ -261,7 +262,9 @@
+         }
+     };
+     // XMLGregorianCalendar is mutable, so we can't support default values anyhow.
+-    public static final CBuiltinLeafInfo CALENDAR = new NoConstantBuiltin(XMLGregorianCalendar.class,"dateTime");
++        // For CALENAR we are uses a most unlikely name so as to avoid potential name
++        // conflicts in the furture.
++        public static final CBuiltinLeafInfo CALENDAR = new NoConstantBuiltin(XMLGregorianCalendar.class,"\u0000");
+     public static final CBuiltinLeafInfo DURATION = new NoConstantBuiltin(Duration.class,"duration");
+ 
+     public static final CBuiltinLeafInfo BIG_INTEGER = new Builtin(BigInteger.class,"integer") {
+@@ -302,10 +305,10 @@
+ 
+     /**
+      * boolean restricted to 0 or 1.
+-     */ 
++     */
+     public static final TypeUse BOOLEAN_ZERO_OR_ONE =
+             STRING.makeAdapted(ZeroOneBooleanAdapter.class,true);
+-    
++
+     /**
+      * IDREF.
+      *
+--- old/src/share/classes/com/sun/tools/internal/xjc/model/CClass.java	Thu Jul 30 17:26:07 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CClass.java	Thu Jul 30 17:26:07 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.model;
+ 
+ /**
+@@ -31,5 +32,5 @@
+  */
+ public interface CClass extends CNonElement, CElement {
+     // how can anything be CNonElement and CElement at the same time, you may ask.
+-    
++
+ }
+--- old/src/share/classes/com/sun/tools/internal/xjc/model/CClassInfo.java	Thu Jul 30 17:26:11 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CClassInfo.java	Thu Jul 30 17:26:10 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.model;
+ 
+ import java.util.ArrayList;
+@@ -41,10 +42,15 @@
+ import com.sun.codemodel.internal.JCodeModel;
+ import com.sun.codemodel.internal.JPackage;
+ import com.sun.istack.internal.Nullable;
++import com.sun.tools.internal.xjc.Language;
++import com.sun.tools.internal.xjc.Options;
+ 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.tools.internal.xjc.reader.Ring;
++import com.sun.tools.internal.xjc.reader.xmlschema.BGMBuilder;
++import com.sun.tools.internal.xjc.reader.xmlschema.bindinfo.BIFactoryMethod;
+ import com.sun.xml.internal.bind.v2.model.core.ClassInfo;
+ import com.sun.xml.internal.bind.v2.model.core.Element;
+ import com.sun.xml.internal.xsom.XSComponent;
+@@ -84,6 +90,11 @@
+     private final QName typeName;
+ 
+     /**
++     * Custom {@link #getSqueezedName() squeezed name}, if any.
++     */
++    private /*almost final*/ @Nullable String squeezedName;
++
++    /**
+      * If this class also gets {@link XmlRootElement}, the class name.
+      */
+     private final @Nullable QName elementName;
+@@ -136,6 +147,16 @@
+         this.typeName = typeName;
+         this.elementName = elementName;
+ 
++        Language schemaLanguage = model.options.getSchemaLanguage();
++        if ((schemaLanguage != null) &&
++            (schemaLanguage.equals(Language.XMLSCHEMA) || schemaLanguage.equals(Language.WSDL))) {
++            BIFactoryMethod factoryMethod = Ring.get(BGMBuilder.class).getBindInfo(source).get(BIFactoryMethod.class);
++            if(factoryMethod!=null) {
++                factoryMethod.markAsAcknowledged();
++                this.squeezedName = factoryMethod.name;
++            }
++        }
++
+         model.add(this);
+     }
+ 
+@@ -182,7 +203,7 @@
+      */
+     public boolean inheritsAttributeWildcard() {
+         for( CClassInfo c=getBaseClass(); c!=null; c=c.getBaseClass() ) {
+-            if(hasAttributeWildcard)
++            if(c.hasAttributeWildcard)
+                 return true;
+         }
+         return false;
+@@ -215,6 +236,7 @@
+      */
+     @XmlElement
+     public String getSqueezedName() {
++        if (squeezedName != null)  return squeezedName;
+         return calcSqueezedName.onBean(this);
+     }
+ 
+@@ -269,7 +291,7 @@
+     public CNonElement getInfo() {
+         return this;
+     }
+-    
++
+     public Element<NType,NClass> asElement() {
+         if(isElement())
+             return this;
+@@ -375,7 +397,7 @@
+             return null;
+         }
+     }
+-    
++
+     public CClassRef getRefBaseClass() {
+         if (baseClass instanceof CClassRef) {
+             return (CClassRef) baseClass;
+--- old/src/share/classes/com/sun/tools/internal/xjc/model/CClassInfoParent.java	Thu Jul 30 17:26:14 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CClassInfoParent.java	Thu Jul 30 17:26:14 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.model;
+ 
+ import com.sun.codemodel.internal.JPackage;
+--- old/src/share/classes/com/sun/tools/internal/xjc/model/CClassRef.java	Thu Jul 30 17:26:18 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CClassRef.java	Thu Jul 30 17:26:17 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.model;
+ 
+ import javax.xml.namespace.QName;
+@@ -105,7 +106,7 @@
+     public CNonElement getInfo() {
+         return this;
+     }
+-    
++
+ // are these going to bite us?
+ //    we can compute some of them, but not all.
+ 
+--- old/src/share/classes/com/sun/tools/internal/xjc/model/CCustomizable.java	Thu Jul 30 17:26:21 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CCustomizable.java	Thu Jul 30 17:26:21 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.model;
+ 
+ import com.sun.tools.internal.xjc.Plugin;
+--- old/src/share/classes/com/sun/tools/internal/xjc/model/CCustomizations.java	Thu Jul 30 17:26:25 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CCustomizations.java	Thu Jul 30 17:26:24 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.model;
+ 
+ import java.util.ArrayList;
+@@ -69,7 +70,7 @@
+ //        // loop check
+ //        for( CCustomizations c = model.customizations; c!=null; c=c.next )
+ //            assert c!=this;
+-        
++
+         this.next = model.customizations;
+         model.customizations = this;
+         assert owner!=null;
+--- old/src/share/classes/com/sun/tools/internal/xjc/model/CDefaultValue.java	Thu Jul 30 17:26:28 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CDefaultValue.java	Thu Jul 30 17:26:27 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.model;
+ 
+ import com.sun.codemodel.internal.JExpression;
+--- old/src/share/classes/com/sun/tools/internal/xjc/model/CElement.java	Thu Jul 30 17:26:31 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CElement.java	Thu Jul 30 17:26:31 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.model;
+ 
+ import com.sun.tools.internal.xjc.model.nav.NClass;
+--- old/src/share/classes/com/sun/tools/internal/xjc/model/CElementInfo.java	Thu Jul 30 17:26:35 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CElementInfo.java	Thu Jul 30 17:26:34 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.model;
+ 
+ import java.util.Collection;
+@@ -44,6 +45,10 @@
+ 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.reader.xmlschema.bindinfo.BIInlineBinaryData;
++import com.sun.tools.internal.xjc.reader.xmlschema.bindinfo.BIFactoryMethod;
++import com.sun.tools.internal.xjc.reader.xmlschema.BGMBuilder;
++import com.sun.tools.internal.xjc.reader.Ring;
+ import com.sun.xml.internal.bind.v2.model.core.ElementInfo;
+ import com.sun.xml.internal.xsom.XSElementDecl;
+ import com.sun.xml.internal.xsom.XmlString;
+@@ -100,6 +105,11 @@
+     private CElementPropertyInfo property;
+ 
+     /**
++     * Custom {@link #getSqueezedName() squeezed name}, if any.
++     */
++    private /*almost final*/ @Nullable String squeezedName;
++
++    /**
+      * Creates an element in the given parent.
+      *
+      * <p>
+@@ -143,10 +153,18 @@
+                 contentType.getExpectedMimeType(),
+                 source,null,getLocator(),true);
+         this.property.setAdapter(contentType.getAdapterUse());
++        BIInlineBinaryData.handle(source,property);
+         property.getTypes().add(new CTypeRef(contentType.getInfo(),tagName,CTypeRef.getSimpleTypeName(source), true,defaultValue));
+         this.type = NavigatorImpl.createParameterizedType(
+             NavigatorImpl.theInstance.ref(JAXBElement.class),
+             getContentInMemoryType() );
++
++        BIFactoryMethod factoryMethod = Ring.get(BGMBuilder.class).getBindInfo(source).get(BIFactoryMethod.class);
++        if(factoryMethod!=null) {
++            factoryMethod.markAsAcknowledged();
++            this.squeezedName = factoryMethod.name;
++        }
++
+     }
+ 
+     public final String getDefaultValue() {
+@@ -208,6 +226,8 @@
+      */
+     @XmlElement
+     public String getSqueezedName() {
++        if(squeezedName!=null)  return squeezedName;
++
+         StringBuilder b = new StringBuilder();
+         CClassInfo s = getScope();
+         if(s!=null)
+--- old/src/share/classes/com/sun/tools/internal/xjc/model/CElementPropertyInfo.java	Thu Jul 30 17:26:39 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CElementPropertyInfo.java	Thu Jul 30 17:26:39 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.model;
+ 
+ import java.util.AbstractList;
+--- old/src/share/classes/com/sun/tools/internal/xjc/model/CEnumConstant.java	Thu Jul 30 17:26:43 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CEnumConstant.java	Thu Jul 30 17:26:42 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.model;
+ 
+ import com.sun.tools.internal.xjc.model.nav.NClass;
+--- old/src/share/classes/com/sun/tools/internal/xjc/model/CEnumLeafInfo.java	Thu Jul 30 17:26:46 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CEnumLeafInfo.java	Thu Jul 30 17:26:46 2009
+@@ -48,10 +48,10 @@
+ 
+ /**
+  * Transducer that converts a string into an "enumeration class."
+- * 
++ *
+  * The structure of the generated class needs to precisely
+  * follow the JAXB spec.
+- * 
++ *
+  * @author
+  *    <a href="mailto:kohsuke.kawaguchi@sun.com">Kohsuke KAWAGUCHI</a>
+  */
+--- old/src/share/classes/com/sun/tools/internal/xjc/model/CNonElement.java	Thu Jul 30 17:26:50 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CNonElement.java	Thu Jul 30 17:26:49 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.model;
+ 
+ import com.sun.tools.internal.xjc.model.nav.NClass;
+--- old/src/share/classes/com/sun/tools/internal/xjc/model/CPluginCustomization.java	Thu Jul 30 17:26:53 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CPluginCustomization.java	Thu Jul 30 17:26:53 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.model;
+ 
+ import com.sun.tools.internal.xjc.Plugin;
+--- old/src/share/classes/com/sun/tools/internal/xjc/model/CPropertyInfo.java	Thu Jul 30 17:26:57 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CPropertyInfo.java	Thu Jul 30 17:26:56 2009
+@@ -22,14 +22,15 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.model;
+ 
++import java.lang.annotation.Annotation;
+ import java.util.Collection;
+ import java.util.Map;
+-import java.lang.annotation.Annotation;
+ 
+-import javax.xml.bind.annotation.XmlTransient;
+ import javax.xml.bind.annotation.XmlSchemaType;
++import javax.xml.bind.annotation.XmlTransient;
+ import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+ import javax.xml.namespace.QName;
+ 
+@@ -41,12 +42,11 @@
+ import com.sun.tools.internal.xjc.model.nav.NClass;
+ import com.sun.tools.internal.xjc.model.nav.NType;
+ 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;
+ import com.sun.xml.internal.bind.v2.runtime.RuntimeUtil;
+-import com.sun.xml.internal.bind.v2.WellKnownNamespace;
+ import com.sun.xml.internal.xsom.XSComponent;
+ 
+-import org.xml.sax.ErrorHandler;
+ import org.xml.sax.Locator;
+ 
+ /**
+@@ -82,8 +82,13 @@
+     public String javadoc="";
+ 
+     /**
+-     * Specifies how the field is generated by the backedn.
++     * Property with {@link @XmlInlineBinaryData}.
+      */
++    public boolean inlineBinaryData;
++
++    /**
++     * Specifies how the field is generated by the backend.
++     */
+     @XmlJavaTypeAdapter(RuntimeUtil.ToStringAdapter.class)
+     public FieldRenderer realization;
+ 
+@@ -165,7 +170,7 @@
+      *
+      * @deprecated
+      *      marked as deprecated so that we can spot the use of this method.
+-     * 
++     *
+      * @see #getName(boolean)
+      */
+     public String getName() {
+@@ -271,11 +276,8 @@
+         return customizations;
+     }
+ 
+-    /**
+-     * @deprecated if you are calling this method directly, there's something wrong.
+-     */
+     public boolean inlineBinaryData() {
+-        return false;
++        return inlineBinaryData;
+     }
+ 
+     public abstract <V> V accept( CPropertyVisitor<V> visitor );
+--- old/src/share/classes/com/sun/tools/internal/xjc/model/CPropertyVisitor.java	Thu Jul 30 17:27:00 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CPropertyVisitor.java	Thu Jul 30 17:27:00 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.model;
+ 
+ /**
+--- old/src/share/classes/com/sun/tools/internal/xjc/model/CReferencePropertyInfo.java	Thu Jul 30 17:27:04 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CReferencePropertyInfo.java	Thu Jul 30 17:27:03 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.model;
+ 
+ import java.util.Collection;
+@@ -52,6 +53,11 @@
+ public final class CReferencePropertyInfo extends CPropertyInfo implements ReferencePropertyInfo<NType,NClass> {
+ 
+     /**
++     * True if this property can never be absent legally.
++     */
++    private final boolean required;
++
++    /**
+      * List of referenced elements.
+      */
+     private final Set<CElement> elements = new HashSet<CElement>();
+@@ -58,11 +64,18 @@
+ 
+     private final boolean isMixed;
+     private WildcardMode wildcard;
++    private boolean dummy;
++    private boolean content;
++    private boolean isMixedExtendedCust = false;
+ 
+-    public CReferencePropertyInfo(String name, boolean collection, boolean isMixed, XSComponent source,
+-                                  CCustomizations customizations, Locator locator) {
+-        super(name, collection||isMixed, source, customizations, locator );
++    public CReferencePropertyInfo(String name, boolean collection, boolean required, boolean isMixed, XSComponent source,
++                                  CCustomizations customizations, Locator locator, boolean dummy, boolean content, boolean isMixedExtended) {   // 'dummy' and 'content' here for NHIN fix - a hack in order to be able to handle extended mixed types better
++        super(name, (collection||isMixed) && (!dummy), source, customizations, locator);
+         this.isMixed = isMixed;
++        this.required = required;
++        this.dummy = dummy;
++        this.content = content;
++        this.isMixedExtendedCust = isMixedExtended;
+     }
+ 
+     public Set<? extends CTypeInfo> ref() {
+@@ -108,7 +121,6 @@
+         if(isMixed())
+             r.add(CBuiltinLeafInfo.STRING);
+ 
+-
+         return r;
+     }
+ 
+@@ -120,6 +132,18 @@
+         return isMixed;
+     }
+ 
++    public boolean isDummy() {
++        return dummy;
++    }
++
++    public boolean isContent() {
++        return content;
++    }
++
++    public boolean isMixedExtendedCust() {
++        return isMixedExtendedCust;
++    }
++
+     /**
+      * We'll never use a wrapper element in XJC. Always return null.
+      */
+@@ -182,7 +206,7 @@
+     public MimeType getExpectedMimeType() {
+         return null;
+     }
+-    
++
+     public boolean isCollectionNillable() {
+         // in XJC, we never recognize a nillable collection pattern, so this is always false.
+         return false;
+@@ -198,6 +222,10 @@
+         return null;
+     }
+ 
++    public boolean isRequired() {
++        return required;
++    }
++
+     @Override
+     public QName collectElementNames(Map<QName, CPropertyInfo> table) {
+         for (CElement e : elements) {
+--- old/src/share/classes/com/sun/tools/internal/xjc/model/CSingleTypePropertyInfo.java	Thu Jul 30 17:27:07 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CSingleTypePropertyInfo.java	Thu Jul 30 17:27:07 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.model;
+ 
+ import java.util.Collections;
+@@ -30,7 +31,6 @@
+ import javax.activation.MimeType;
+ import javax.xml.namespace.QName;
+ 
+-import com.sun.xml.internal.bind.v2.WellKnownNamespace;
+ import com.sun.xml.internal.bind.v2.model.core.ID;
+ import com.sun.xml.internal.xsom.XSComponent;
+ 
+--- old/src/share/classes/com/sun/tools/internal/xjc/model/CTypeInfo.java	Thu Jul 30 17:27:11 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CTypeInfo.java	Thu Jul 30 17:27:10 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.model;
+ 
+ import com.sun.codemodel.internal.JClass;
+--- old/src/share/classes/com/sun/tools/internal/xjc/model/CTypeRef.java	Thu Jul 30 17:27:14 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CTypeRef.java	Thu Jul 30 17:27:14 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.model;
+ 
+ import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+@@ -39,7 +40,7 @@
+ 
+ /**
+  * {@link TypeRef} for XJC.
+- * 
++ *
+  * TODO: do we need the source schema component support here?
+  *
+  * @author Kohsuke Kawaguchi
+@@ -48,7 +49,7 @@
+     /**
+      * In-memory type.
+      *
+-     * This is the type used when 
++     * This is the type used when
+      */
+     @XmlJavaTypeAdapter(RuntimeUtil.ToStringAdapter.class)
+     private final CNonElement type;
+@@ -101,7 +102,7 @@
+ 
+     /**
+      * Inside XJC, use {@link #defaultValue} that has context information.
+-     * This method is to override the one defined in the runtime model. 
++     * This method is to override the one defined in the runtime model.
+      *
+      * @see #defaultValue
+      */
+--- old/src/share/classes/com/sun/tools/internal/xjc/model/CValuePropertyInfo.java	Thu Jul 30 17:27:18 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CValuePropertyInfo.java	Thu Jul 30 17:27:17 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.model;
+ 
+ import javax.xml.namespace.QName;
+@@ -36,7 +37,7 @@
+ 
+ /**
+  * {@link ValuePropertyInfo} implementation for XJC.
+- * 
++ *
+  * @author Kohsuke Kawaguchi
+  */
+ public final class CValuePropertyInfo extends CSingleTypePropertyInfo implements ValuePropertyInfo<NType,NClass> {
+--- old/src/share/classes/com/sun/tools/internal/xjc/model/CWildcardTypeInfo.java	Thu Jul 30 17:27:21 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/CWildcardTypeInfo.java	Thu Jul 30 17:27:20 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.model;
+ 
+ import com.sun.codemodel.internal.JType;
+--- old/src/share/classes/com/sun/tools/internal/xjc/model/ClassNameAllocatorWrapper.java	Thu Jul 30 17:27:25 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/ClassNameAllocatorWrapper.java	Thu Jul 30 17:27:24 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.model;
+ 
+ import com.sun.codemodel.internal.JPackage;
+--- old/src/share/classes/com/sun/tools/internal/xjc/model/Constructor.java	Thu Jul 30 17:27:28 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/Constructor.java	Thu Jul 30 17:27:27 2009
+@@ -26,11 +26,11 @@
+ 
+ /**
+  * Constructor declaration.
+- * 
++ *
+  * <p>
+  * a constructor declaration consists of a set of fields to be initialized.
+  * For example, if a class is defined as:
+- * 
++ *
+  * <pre>
+  * Class: Foo
+  *   Field: String a
+@@ -37,19 +37,19 @@
+  *   Field: int b
+  *   Field: BigInteger c
+  * </pre>
+- * 
++ *
+  * Then a constructor declaration of {"a","c"} will conceptually
+  * generate the following consturctor:
+- * 
++ *
+  * <pre>
+  * Foo( String _a, BigInteger _c ) {
+  *   a=_a; c=_c;
+  * }
+  * </pre>
+- * 
++ *
+  * (Only conceptually, because Foo will likely to become an interface
+  * so we can't simply generate a constructor like this.)
+- * 
++ *
+  * @author
+  *    <a href="mailto:kohsuke.kawaguchi@sun.com">Kohsuke KAWAGUCHI</a>
+  */
+@@ -58,7 +58,7 @@
+     // Since Constructor is typically built when there is no FieldItem
+     // nor FieldUse, we need to rely on Strings.
+     public Constructor( String[] _fields ) { this.fields = _fields; }
+-    
++
+     /** array of field names to be initialized. */
+     public final String[] fields;
+ }
+--- old/src/share/classes/com/sun/tools/internal/xjc/model/Model.java	Thu Jul 30 17:27:31 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/Model.java	Thu Jul 30 17:27:31 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.model;
+ 
+ import java.util.Collections;
+--- old/src/share/classes/com/sun/tools/internal/xjc/model/Multiplicity.java	Thu Jul 30 17:27:35 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/Multiplicity.java	Thu Jul 30 17:27:34 2009
+@@ -28,14 +28,14 @@
+ 
+ /**
+  * represents a possible number of occurence.
+- * 
++ *
+  * Usually, denoted by a pair of integers like (1,1) or (5,10).
+  * A special value "unbounded" is allowed as the upper bound.
+- * 
++ *
+  * <p>
+  * For example, (0,unbounded) corresponds to the '*' occurence of DTD.
+  * (0,1) corresponds to the '?' occurence of DTD.
+- * 
++ *
+  * @author
+  *    <a href="mailto:kohsuke.kawaguchi@sun.com">Kohsuke KAWAGUCHI</a>
+  */
+@@ -81,25 +81,25 @@
+         if(max==null)    return false;
+         return min==1 && max==1;
+     }
+-    
++
+     /** returns true if the multiplicity is (0,1) */
+     public boolean isOptional() {
+         if(max==null) return false;
+         return min==0 && max==1;
+     }
+-        
++
+     /** returns true if the multiplicity is (0,1) or (1,1). */
+     public boolean isAtMostOnce() {
+         if(max==null)    return false;
+         return max<=1;
+     }
+-    
++
+     /** returns true if the multiplicity is (0,0). */
+     public boolean isZero() {
+         if(max==null)    return false;
+         return max==0;
+     }
+-    
++
+     /**
+      * Returns true if the multiplicity represented by this object
+      * completely includes the multiplicity represented by the
+@@ -121,7 +121,7 @@
+         if(max==null)       return "unbounded";
+         else                return max.toString();
+     }
+-    
++
+     /** gets the string representation.
+      * mainly debug purpose.
+      */
+@@ -128,13 +128,13 @@
+     public String toString() {
+         return "("+min+','+getMaxString()+')';
+     }
+-    
++
+     /** the constant representing the (0,0) multiplicity. */
+     public static final Multiplicity ZERO = new Multiplicity(0,0);
+-    
++
+     /** the constant representing the (1,1) multiplicity. */
+     public static final Multiplicity ONE = new Multiplicity(1,1);
+-    
++
+     /** the constant representing the (0,1) multiplicity. */
+     public static final Multiplicity OPTIONAL = new Multiplicity(0,1);
+ 
+@@ -192,4 +192,3 @@
+         return create(min,null);
+     }
+ }
+-    
+--- old/src/share/classes/com/sun/tools/internal/xjc/model/Populatable.java	Thu Jul 30 17:27:38 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/Populatable.java	Thu Jul 30 17:27:38 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.model;
+ 
+ import com.sun.tools.internal.xjc.outline.Outline;
+--- old/src/share/classes/com/sun/tools/internal/xjc/model/SymbolSpace.java	Thu Jul 30 17:27:42 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/SymbolSpace.java	Thu Jul 30 17:27:41 2009
+@@ -29,19 +29,19 @@
+ 
+ /**
+  * Symbol space for ID/IDREF.
+- * 
++ *
+  * In XJC, the whole ID space is considered to be splitted into
+  * one or more "symbol space". For an IDREF to match an ID, we impose
+  * additional restriction to the one stated in the XML rec.
+- * 
++ *
+  * <p>
+  * That is, XJC'll require that the IDREF belongs to the same symbol
+  * space as the ID. Having this concept allows us to assign more
+  * specific type to IDREF.
+- * 
++ *
+  * <p>
+  * See the design document for detail.
+- * 
++ *
+  * @author
+  *    <a href="mailto:kohsuke.kawaguchi@sun.com">Kohsuke KAWAGUCHI</a>
+  */
+@@ -49,14 +49,14 @@
+ {
+     private JType type;
+     private final JCodeModel codeModel;
+-    
++
+     public SymbolSpace( JCodeModel _codeModel ) {
+         this.codeModel = _codeModel;
+     }
+-    
++
+     /**
+      * Gets the Java type of this symbol space.
+-     * 
++     *
+      * <p>
+      * A symbol space is said to have a Java type X if all classes
+      * pointed by IDs belonging to this symbol space are assignable
+@@ -66,12 +66,12 @@
+         if(type==null)  return codeModel.ref(Object.class);
+         return type;
+     }
+-    
++
+     public void setType( JType _type ) {
+         if( this.type==null )
+             this.type = _type;
+     }
+-    
++
+     public String toString() {
+         if(type==null)  return "undetermined";
+         else            return type.name();
+--- old/src/share/classes/com/sun/tools/internal/xjc/model/TypeUse.java	Thu Jul 30 17:27:45 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/TypeUse.java	Thu Jul 30 17:27:45 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.model;
+ 
+ import javax.activation.MimeType;
+--- old/src/share/classes/com/sun/tools/internal/xjc/model/TypeUseFactory.java	Thu Jul 30 17:27:49 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/TypeUseFactory.java	Thu Jul 30 17:27:48 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.model;
+ 
+ import javax.activation.MimeType;
+--- old/src/share/classes/com/sun/tools/internal/xjc/model/TypeUseImpl.java	Thu Jul 30 17:27:52 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/TypeUseImpl.java	Thu Jul 30 17:27:52 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.model;
+ 
+ import javax.activation.MimeType;
+--- old/src/share/classes/com/sun/tools/internal/xjc/model/nav/EagerNClass.java	Thu Jul 30 17:27:56 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/nav/EagerNClass.java	Thu Jul 30 17:27:55 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.model.nav;
+ 
+ import java.lang.reflect.Modifier;
+--- old/src/share/classes/com/sun/tools/internal/xjc/model/nav/EagerNType.java	Thu Jul 30 17:27:59 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/nav/EagerNType.java	Thu Jul 30 17:27:59 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.model.nav;
+ 
+ import java.lang.reflect.Type;
+--- old/src/share/classes/com/sun/tools/internal/xjc/model/nav/NClass.java	Thu Jul 30 17:28:03 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/nav/NClass.java	Thu Jul 30 17:28:02 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.model.nav;
+ 
+ import com.sun.codemodel.internal.JClass;
+--- old/src/share/classes/com/sun/tools/internal/xjc/model/nav/NClassByJClass.java	Thu Jul 30 17:28:06 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/nav/NClassByJClass.java	Thu Jul 30 17:28:06 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.model.nav;
+ 
+ import com.sun.codemodel.internal.JClass;
+--- old/src/share/classes/com/sun/tools/internal/xjc/model/nav/NParameterizedType.java	Thu Jul 30 17:28:10 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/nav/NParameterizedType.java	Thu Jul 30 17:28:09 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.model.nav;
+ 
+ import com.sun.codemodel.internal.JClass;
+--- old/src/share/classes/com/sun/tools/internal/xjc/model/nav/NType.java	Thu Jul 30 17:28:13 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/nav/NType.java	Thu Jul 30 17:28:13 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.model.nav;
+ 
+ import com.sun.codemodel.internal.JType;
+@@ -32,7 +33,7 @@
+  * A type.
+  *
+  * See the package documentaion for details.
+- * 
++ *
+  * @author Kohsuke Kawaguchi
+  */
+ public interface NType {
+--- old/src/share/classes/com/sun/tools/internal/xjc/model/nav/NavigatorImpl.java	Thu Jul 30 17:28:17 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/nav/NavigatorImpl.java	Thu Jul 30 17:28:16 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.model.nav;
+ 
+ import java.lang.reflect.Type;
+--- old/src/share/classes/com/sun/tools/internal/xjc/model/package-info.java	Thu Jul 30 17:28:20 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/model/package-info.java	Thu Jul 30 17:28:20 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ /**
+  * Implementation of the {@link com.sun.xml.internal.bind.v2.model.core} package for XJC.
+  *
+--- old/src/share/classes/com/sun/tools/internal/xjc/outline/Aspect.java	Thu Jul 30 17:28:24 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/outline/Aspect.java	Thu Jul 30 17:28:23 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.outline;
+ 
+ import com.sun.tools.internal.xjc.generator.bean.ImplStructureStrategy;
+--- old/src/share/classes/com/sun/tools/internal/xjc/outline/ClassOutline.java	Thu Jul 30 17:28:27 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/outline/ClassOutline.java	Thu Jul 30 17:28:27 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ /*
+  * Use is subject to the license terms.
+  */
+@@ -38,9 +39,9 @@
+ /**
+  * Outline object that provides per-{@link CClassInfo} information
+  * for filling in methods/fields for a bean.
+- * 
++ *
+  * This interface is accessible from {@link Outline}
+- * 
++ *
+  * @author Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+ public abstract class ClassOutline {
+@@ -81,7 +82,7 @@
+     /**
+      * The implementation class that shall be used for reference.
+      * <p>
+-     * Usually this field holds the same value as the impl method,
++     * Usually this field holds the same value as the {@link #implClass} method,
+      * but sometimes it holds the user-specified implementation class
+      * when it is specified.
+      * <p>
+--- old/src/share/classes/com/sun/tools/internal/xjc/outline/ElementOutline.java	Thu Jul 30 17:28:31 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/outline/ElementOutline.java	Thu Jul 30 17:28:30 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.outline;
+ 
+ import com.sun.codemodel.internal.JDefinedClass;
+@@ -35,7 +36,7 @@
+  * not created for all {@link CElementInfo}s.
+  * It is only for those {@link CElementInfo} that has a class.
+  * (IOW, {@link CElementInfo#hasClass()}
+- * 
++ *
+  * @author Kohsuke Kawaguchi
+  */
+ public abstract class ElementOutline {
+--- old/src/share/classes/com/sun/tools/internal/xjc/outline/EnumConstantOutline.java	Thu Jul 30 17:28:34 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/outline/EnumConstantOutline.java	Thu Jul 30 17:28:33 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.outline;
+ 
+ import com.sun.codemodel.internal.JEnumConstant;
+--- old/src/share/classes/com/sun/tools/internal/xjc/outline/EnumOutline.java	Thu Jul 30 17:28:38 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/outline/EnumOutline.java	Thu Jul 30 17:28:37 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.outline;
+ 
+ import java.util.ArrayList;
+--- old/src/share/classes/com/sun/tools/internal/xjc/outline/FieldAccessor.java	Thu Jul 30 17:28:41 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/outline/FieldAccessor.java	Thu Jul 30 17:28:41 2009
+@@ -31,7 +31,7 @@
+ 
+ /**
+  * Encapsulates the access on a field.
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+@@ -39,10 +39,10 @@
+ 
+     /**
+      * Dumps everything in this field into the given variable.
+-     * 
++     *
+      * <p>
+      * This generates code that accesses the field from outside.
+-     * 
++     *
+      * @param block
+      *      The code will be generated into this block.
+      * @param $var
+@@ -49,13 +49,13 @@
+      *      Variable whose type is {@link FieldOutline#getRawType()}
+      */
+     void toRawValue( JBlock block, JVar $var );
+-    
++
+     /**
+      * Sets the value of the field from the specified expression.
+-     * 
++     *
+      * <p>
+      * This generates code that accesses the field from outside.
+-     * 
++     *
+      * @param block
+      *      The code will be generated into this block.
+      * @param uniqueName
+@@ -62,7 +62,7 @@
+      *      Identifier that the caller guarantees to be unique in
+      *      the given block. When the callee needs to produce additional
+      *      variables, it can do so by adding suffixes to this unique
+-     *      name. For example, if the uniqueName is "abc", then the 
++     *      name. For example, if the uniqueName is "abc", then the
+      *      caller guarantees that any identifier "abc.*" is unused
+      *      in this block.
+      * @param $var
+@@ -70,22 +70,22 @@
+      *      {@link FieldOutline#getRawType()}.
+      */
+     void fromRawValue( JBlock block, String uniqueName, JExpression $var );
+-    
++
+     /**
+      * Generates a code fragment to remove any "set" value
+      * and move this field to the "unset" state.
+-     * 
++     *
+      * @param body
+      *      The code will be appended at the end of this block.
+      */
+     void unsetValues( JBlock body );
+-    
++
+     /**
+      * Return an expression that evaluates to true only when
+      * this field has a set value(s).
+-     * 
++     *
+      * @return null
+-     *      if the isSetXXX/unsetXXX method does not make sense 
++     *      if the isSetXXX/unsetXXX method does not make sense
+      *      for the given field.
+      */
+     JExpression hasSetValue();
+--- old/src/share/classes/com/sun/tools/internal/xjc/outline/FieldOutline.java	Thu Jul 30 17:28:45 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/outline/FieldOutline.java	Thu Jul 30 17:28:44 2009
+@@ -30,7 +30,7 @@
+ 
+ /**
+  * Representation of a field of {@link ClassOutline}.
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+@@ -43,10 +43,10 @@
+ 
+     /** Gets the corresponding model object. */
+     CPropertyInfo getPropertyInfo();
+-    
++
+     /**
+      * Gets the type of the "raw value".
+-     * 
++     *
+      * <p>
+      * This type can represent the entire value of this field.
+      * For fields that can carry multiple values, this is an array.
+@@ -56,11 +56,11 @@
+      * to set/get values from a property.
+      */
+     JType getRawType();
+-    
++
+     /**
+      * Creates a new {@link FieldAccessor} of this field
+      * for the specified object.
+-     * 
++     *
+      * @param targetObject
+      *      Evaluates to an object, and the field on this object
+      *      will be accessed.
+--- old/src/share/classes/com/sun/tools/internal/xjc/outline/Outline.java	Thu Jul 30 17:28:48 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/outline/Outline.java	Thu Jul 30 17:28:48 2009
+@@ -64,13 +64,13 @@
+ 
+     /** Gets the object that wraps the generated field for a given {@link CPropertyInfo}. */
+     FieldOutline getField( CPropertyInfo fu );
+-    
++
+     /**
+      * Gets per-package context information.
+-     * 
++     *
+      * This method works for every visible package
+      * (those packages which are supposed to be used by client applications.)
+-     * 
++     *
+      * @return
+      *      If this grammar doesn't produce anything in the specified
+      *      package, return null.
+@@ -102,13 +102,13 @@
+ 
+     /** Gets all package-wise contexts at once. */
+     Iterable<? extends PackageOutline> getAllPackageContexts();
+-   
++
+     /**
+      * Gets a reference to
+      * <code>new CodeModelClassFactory(getErrorHandler())</code>.
+      */
+     CodeModelClassFactory getClassFactory();
+-    
++
+     /**
+      * Any error during the back-end proccessing should be
+      * sent to this object.
+--- old/src/share/classes/com/sun/tools/internal/xjc/outline/PackageOutline.java	Thu Jul 30 17:28:52 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/outline/PackageOutline.java	Thu Jul 30 17:28:51 2009
+@@ -35,14 +35,14 @@
+ 
+ /**
+  * Outline object that provides per-package information.
+- * 
++ *
+  * This interface is accessible from {@link Outline}.
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+ public interface PackageOutline {
+-    
++
+     /**
+      * The exposed package this context is representing.
+      *
+@@ -55,7 +55,7 @@
+ 
+     /**
+      * Generated ObjectFactory from package.
+-     * 
++     *
+      * This method allows a caller to obtain a reference to such
+      * ObjectFactory from its package.
+      *
+--- old/src/share/classes/com/sun/tools/internal/xjc/package-info.java	Thu Jul 30 17:28:55 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/package-info.java	Thu Jul 30 17:28:55 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ /**
+  * <h1>Schema to Java compiler</h1>.
+  *
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/AbstractExtensionBindingChecker.java	Thu Jul 30 17:28:59 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/AbstractExtensionBindingChecker.java	Thu Jul 30 17:28:58 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.reader;
+ 
+ import java.util.Set;
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/Const.java	Thu Jul 30 17:29:02 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/Const.java	Thu Jul 30 17:29:01 2009
+@@ -24,29 +24,29 @@
+  */
+ package com.sun.tools.internal.xjc.reader;
+ 
++import com.sun.xml.internal.bind.v2.WellKnownNamespace;
+ 
+ 
+-
+ /**
+  * Useful constant values.
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+ public class Const {
+-    
++
+     /** XML namespace URI. */
+     public final static String XMLNS_URI =
+         "http://www.w3.org/2000/xmlns/";
+-    
++
+     /** JAXB customization URI. */
+     public final static String JAXB_NSURI =
+         "http://java.sun.com/xml/ns/jaxb";
+-    
++
+     /** XJC vendor extension namespace URI. */
+     public final static String XJC_EXTENSION_URI =
+         "http://java.sun.com/xml/ns/jaxb/xjc";
+-    
++
+     /** RELAX NG namespace URI. */
+     public static final String RELAXNG_URI =
+         "http://relaxng.org/ns/structure/1.0";
+@@ -53,5 +53,12 @@
+ 
+     /** URI to represent DTD. */
+     public static final String DTD = "DTD";
+-}
+ 
++    /**
++     * Attribute name of the expected media type.
++     *
++     * @see WellKnownNamespace#XML_MIME_URI
++     * @see http://www.w3.org/TR/xml-media-types/
++     */
++    public static final String EXPECTED_CONTENT_TYPES = "expectedContentTypes";
++}
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/ExtensionBindingChecker.java	Thu Jul 30 17:29:06 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/ExtensionBindingChecker.java	Thu Jul 30 17:29:05 2009
+@@ -36,7 +36,7 @@
+ /**
+  * This filter checks jaxb:extensionBindingPrefix and
+  * pass/filter extension bindings.
+- * 
++ *
+  * <p>
+  * This filter also remembers enabled extension namespaces
+  * and filters out any extension namespaces that doesn't belong
+@@ -46,7 +46,7 @@
+  * <p>
+  * Note that we can't just filter out all foreign namespaces,
+  * as we need to use user-defined tags in documentations to generate javadoc.
+- * 
++ *
+  * <p>
+  * The class needs to know the list of extension binding namespaces
+  * that the RI recognizes.
+@@ -77,7 +77,7 @@
+             return false;
+         if( enabledExtensions.contains(uri) )
+             return false;
+-        
++
+         // we don't need to prune something unless
+         // the rest of the processor recognizes it as something special.
+         // this allows us to send the documentation and other harmless
+@@ -93,7 +93,7 @@
+ 
+     public void startElement(String namespaceURI, String localName, String qName, Attributes atts)
+         throws SAXException {
+-        
++
+         if(!isCutting()) {
+             String v = atts.getValue(Const.JAXB_NSURI,"extensionBindingPrefixes");
+             if(v!=null) {
+@@ -116,7 +116,7 @@
+                         checkAndEnable(uri);
+                 }
+             }
+-            
++
+             if( needsToBePruned(namespaceURI) ) {
+                 // start pruning the tree. Call the super class method directly.
+                 if( isRecognizableExtension(namespaceURI) ) {
+@@ -128,7 +128,7 @@
+             } else
+                 verifyTagName(namespaceURI, localName, qName);
+         }
+-        
++
+         count++;
+         super.startElement(namespaceURI, localName, qName, atts);
+     }
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/MessageBundle.properties	Thu Jul 30 17:29:09 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/MessageBundle.properties	Thu Jul 30 17:29:08 2009
+@@ -30,30 +30,30 @@
+ 
+ 
+ ERR_UNDECLARED_PREFIX = \
+-	Prefix "{0}" is undeclared
++        Prefix "{0}" is undeclared
+ 
+ ERR_UNEXPECTED_EXTENSION_BINDING_PREFIXES = \
+-	extensionBindingPrefixes attribute must be declared at the root element
++        extensionBindingPrefixes attribute must be declared at the root element
+ 
+ ERR_VENDOR_EXTENSION_DISALLOWED_IN_STRICT_MODE = \
+     vendor extension bindings (jaxb:extensionBindingPrefixes) are not allowed in the strict mode. Use -extension.
+ 
+ ERR_UNSUPPORTED_EXTENSION = \
+-	Unsupported binding namespace "{0}". Perhaps you meant "{1}"?
++        Unsupported binding namespace "{0}". Perhaps you meant "{1}"?
+ 
+ ERR_SUPPORTED_EXTENSION_IGNORED = \
+-	Binding declaration namespace "{0}" will be ignored because it is \
+-	not designated by the jaxb:extensionBindingPrefixes attribute.
++        Binding declaration namespace "{0}" will be ignored because it is \
++        not designated by the jaxb:extensionBindingPrefixes attribute.
+ 
+ ERR_RELEVANT_LOCATION = \
+-	The following location is relevant to the above error
++        The following location is relevant to the above error
+ 
+ 
+ ERR_CLASS_NOT_FOUND = \
+-	Unable to find type "{0}". Without knowing the proper inheritance hierarchy of this type, \
+-	XJC may fail to generate some signatures correctly. \
+-	Make this class available via the -classpath option.
+-	
++        Unable to find type "{0}". Without knowing the proper inheritance hierarchy of this type, \
++        XJC may fail to generate some signatures correctly. \
++        Make this class available via the -classpath option.
++
+ DUPLICATE_PROPERTY = \
+     Property "{0}" is already defined. Use &lt;jaxb:property> to resolve this conflict.
+ 
+@@ -71,4 +71,3 @@
+ 
+ ERR_PLUGIN_NOT_ENABLED = \
+     Using "{1}" customizations requires the "-{0}" switch to enable this plug-in.
+- 
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/ModelChecker.java	Thu Jul 30 17:29:13 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/ModelChecker.java	Thu Jul 30 17:29:12 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.reader;
+ 
+ import java.util.List;
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/RawTypeSet.java	Thu Jul 30 17:29:16 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/RawTypeSet.java	Thu Jul 30 17:29:15 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.reader;
+ 
+ import java.util.HashSet;
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/Ring.java	Thu Jul 30 17:29:20 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/Ring.java	Thu Jul 30 17:29:19 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.reader;
+ 
+ import java.lang.reflect.Constructor;
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/TypeUtil.java	Thu Jul 30 17:29:23 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/TypeUtil.java	Thu Jul 30 17:29:22 2009
+@@ -44,16 +44,16 @@
+ 
+ /**
+  * Type-related utility methods.
+- * 
++ *
+  * @author
+  *    <a href="mailto:kohsuke.kawaguchi@sun.com">Kohsuke KAWAGUCHI</a>
+  */
+ public class TypeUtil {
+-    
+-    
++
++
+     /**
+      * Computes the common base type of two types.
+-     * 
++     *
+      * @param types
+      *      set of {@link JType} objects.
+      */
+@@ -63,11 +63,11 @@
+ 
+     /**
+      * Computes the common base type of types.
+-     * 
++     *
+      * TODO: this is a very interesting problem. Since one type has possibly
+      * multiple base types, it's not an easy problem.
+      * The current implementation is very naive.
+-     * 
++     *
+      * To make the result deterministic across differente JVMs, we have to
+      * use a Set whose ordering is deterministic.
+      */
+@@ -210,7 +210,7 @@
+     /**
+      * Returns the set of all classes/interfaces that a given type
+      * implements/extends, including itself.
+-     * 
++     *
+      * For example, if you pass java.io.FilterInputStream, then the returned
+      * set will contain java.lang.Object, java.lang.InputStream, and
+      * java.lang.FilterInputStream.
+@@ -227,7 +227,7 @@
+         JClass _super = t._extends();
+         if(_super!=null)
+             getAssignableTypes(_super,s);
+-        
++
+         // recursively process all implemented interfaces
+         Iterator<JClass> itr = t._implements();
+         while(itr.hasNext())
+@@ -254,7 +254,7 @@
+             return codeModel.directClass(typeName);
+         }
+     }
+-    
++
+     /**
+      * Compares {@link JType} objects by their names.
+      */
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/Block.java	Thu Jul 30 17:29:27 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/Block.java	Thu Jul 30 17:29:26 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.reader.dtd;
+ 
+ import java.util.LinkedHashSet;
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/Element.java	Thu Jul 30 17:29:30 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/Element.java	Thu Jul 30 17:29:29 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.reader.dtd;
+ 
+ import java.util.ArrayList;
+@@ -221,7 +222,7 @@
+ 
+         switch(contentModelType) {
+         case DTDEventListener.CONTENT_MODEL_ANY:
+-            CReferencePropertyInfo rp = new CReferencePropertyInfo("Content",true,true,null,null/*TODO*/,locator);
++            CReferencePropertyInfo rp = new CReferencePropertyInfo("Content",true,false,true,null,null/*TODO*/,locator, false, false, false);
+             rp.setWildcard(WildcardMode.SKIP);
+             ci.addProperty(rp);
+             return;
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/MessageBundle.properties	Thu Jul 30 17:29:34 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/MessageBundle.properties	Thu Jul 30 17:29:33 2009
+@@ -24,26 +24,25 @@
+ #
+ 
+ TDTDReader.NoRootElement = \
+-	No root element was specified.
++        No root element was specified.
+ 
+ TDTDReader.UndefinedElementInBindInfo = \
+-	Binding information contains element "{0}", but it's not defined in DTD.
++        Binding information contains element "{0}", but it's not defined in DTD.
+ 
+ TDTDReader.ConversionForNonValueElement = \
+-	Conversion declaration is specified for the element "{0}", but \
+-	the content model of this element is not #PCDATA.
++        Conversion declaration is specified for the element "{0}", but \
++        the content model of this element is not #PCDATA.
+ 
+ TDTDReader.ContentProperty.ParticleMismatch = \
+-	The content model of the element "{0}" does not match \
+-	the content-property declaration of the specified binding information.
++        The content model of the element "{0}" does not match \
++        the content-property declaration of the specified binding information.
+ 
+ TDTDReader.ContentProperty.DeclarationTooShort = \
+-	The content-property declaration for the element "{0}" is too short.
++        The content-property declaration for the element "{0}" is too short.
+ 
+ TDTDReader.BindInfo.NonExistentElementDeclaration = \
+-	DTD does not contain the element "{0}"
++        DTD does not contain the element "{0}"
+ 
+ TDTDReader.BindInfo.NonExistentInterfaceMember = \
+-	"{0}" is specified as a member of an interface, \
+-	but there is no such class nor interface.
+- 
++        "{0}" is specified as a member of an interface, \
++        but there is no such class nor interface.
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/Messages.java	Thu Jul 30 17:29:37 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/Messages.java	Thu Jul 30 17:29:37 2009
+@@ -38,8 +38,8 @@
+         String text = ResourceBundle.getBundle(Messages.class.getPackage().getName() + ".MessageBundle").getString(property);
+         return MessageFormat.format(text,args);
+     }
+-    
+ 
++
+     public static final String ERR_NO_ROOT_ELEMENT = // arg:0
+         "TDTDReader.NoRootElement";
+ 
+@@ -54,11 +54,11 @@
+ 
+     public static final String ERR_CONTENT_PROPERTY_DECLARATION_TOO_SHORT = // arg:1
+         "TDTDReader.ContentProperty.DeclarationTooShort";
+-    
++
+     public static final String ERR_BINDINFO_NON_EXISTENT_ELEMENT_DECLARATION = // arg:1
+         "TDTDReader.BindInfo.NonExistentElementDeclaration";
+ 
+     public static final String ERR_BINDINFO_NON_EXISTENT_INTERFACE_MEMBER = // arg:1
+         "TDTDReader.BindInfo.NonExistentInterfaceMember";
+-        
++
+ }
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/ModelGroup.java	Thu Jul 30 17:29:41 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/ModelGroup.java	Thu Jul 30 17:29:40 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.reader.dtd;
+ 
+ import java.util.ArrayList;
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/Occurence.java	Thu Jul 30 17:29:44 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/Occurence.java	Thu Jul 30 17:29:44 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.reader.dtd;
+ 
+ import java.util.List;
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/TDTDReader.java	Thu Jul 30 17:29:48 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/TDTDReader.java	Thu Jul 30 17:29:47 2009
+@@ -71,7 +71,7 @@
+ 
+ /**
+  * Parses DTD grammar along with binding information into BGM.
+- * 
++ *
+  * @author
+  *    <a href="mailto:kohsuke.kawaguchi@sun.com">Kohsuke KAWAGUCHI</a>
+  */
+@@ -79,11 +79,11 @@
+ {
+     /**
+      * Parses DTD grammar and a binding information into BGM.
+-     * 
++     *
+      * <p>
+      * This method is just a utility method that covers 80% of the use
+      * cases.
+-     * 
++     *
+      * @param    bindingInfo
+      *        binding information file, if any. Can be null.
+      */
+@@ -149,7 +149,7 @@
+ 
+     /**
+      * binding information.
+-     * 
++     *
+      * <p>
+      * This is always non-null even if no binding information was specified.
+      * (In that case, a dummy object will be provided.)
+@@ -159,7 +159,7 @@
+     final Model model = Ring.get(Model.class);
+ 
+     private final CodeModelClassFactory classFactory;
+-    
++
+     private final ErrorReceiverFilter errorReceiver;
+ 
+     /**
+@@ -170,7 +170,7 @@
+ 
+     public void startDTD(InputEntity entity) throws SAXException {
+     }
+-    
++
+     public void endDTD() throws SAXException {
+ 
+         // bind them all.
+@@ -196,8 +196,8 @@
+ //        // performs annotation
+ //        Annotator.annotate(model, this);
+ //        FieldCollisionChecker.check( model, this );
+-        
+-        
++
++
+         processConstructorDeclarations();
+     }
+ 
+@@ -249,7 +249,7 @@
+                 acc.implement(c);
+             }
+         }
+-        
++
+         // TODO: check the cyclic interface definition
+     }
+ 
+@@ -261,12 +261,12 @@
+     JPackage getTargetPackage() {
+         return bindInfo.getTargetPackage();
+     }
+-    
+-    
++
++
+     /**
+      * Creates constructor declarations as specified in the
+      * binding information.
+-     * 
++     *
+      * <p>
+      * Also checks that the binding file does not contain
+      * declarations for non-existent elements.
+@@ -279,11 +279,11 @@
+                     Messages.ERR_BINDINFO_NON_EXISTENT_ELEMENT_DECLARATION,decl.name());
+                 continue;   // continue to process next declaration
+             }
+-            
++
+             if(!decl.isClass())
+                 // only element-class declaration has constructor definitions
+                 continue;
+-            
++
+             decl.declareConstructors(e.getClassInfo());
+         }
+     }
+@@ -458,5 +458,5 @@
+         errorReceiver.error(loc,Messages.format(prop,args));
+     }
+ 
+-    
++
+ }
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/Term.java	Thu Jul 30 17:29:51 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/Term.java	Thu Jul 30 17:29:51 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.reader.dtd;
+ 
+ import java.util.List;
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/BIAttribute.java	Thu Jul 30 17:29:55 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/BIAttribute.java	Thu Jul 30 17:29:55 2009
+@@ -44,7 +44,7 @@
+         this.parent = _parent;
+         this.element = _e;
+     }
+-    
++
+     private final BIElement parent;
+     private final Element element;
+ 
+@@ -52,11 +52,11 @@
+     public final String name() {
+         return element.getAttribute("name");
+     }
+-    
+-    
++
++
+     /**
+      * Gets the conversion method for this attribute, if any.
+-     * 
++     *
+      * @return
+      *        If the convert attribute is not specified, this
+      *        method returns null.
+@@ -71,7 +71,7 @@
+ 
+     /**
+      * Gets the realization of this particle, if any.
+-     * 
++     *
+      * @return
+      *      null if the "collection" attribute was not specified.
+      */
+@@ -78,7 +78,7 @@
+     public final FieldRenderer getRealization() {
+         Attr a = element.getAttributeNode("collection");
+         if(a==null)     return null;
+-        
++
+         String v = element.getAttribute("collection").trim();
+ 
+         FieldRendererFactory frf = parent.parent.model.options.getFieldRendererFactory();
+@@ -86,15 +86,15 @@
+         if(v.equals("list"))
+             return frf.getList(
+                 parent.parent.codeModel.ref(ArrayList.class));
+-        
+-        // the correctness of the attribute value must be 
++
++        // the correctness of the attribute value must be
+         // checked by the validator.
+         throw new InternalError("unexpected collection value: "+v);
+     }
+-    
++
+     /**
+      * Gets the property name for this attribute.
+-     * 
++     *
+      * @return
+      *      always a non-null, valid string.
+      */
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/BIConstructor.java	Thu Jul 30 17:29:59 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/BIConstructor.java	Thu Jul 30 17:29:58 2009
+@@ -35,11 +35,11 @@
+ 
+ /**
+  * &lt;constructor> declaration in the binding file.
+- * 
++ *
+  * <p>
+  * Since JAXB will generate both interfaces and implementations,
+  * A constructor declaration will create:
+- * 
++ *
+  * <ul>
+  *  <li> a method declaration in the factory interface
+  *  <li> a method implementation in the factory implementation class
+@@ -50,28 +50,28 @@
+ {
+     BIConstructor( Element _node ) {
+         this.dom = _node;
+-        
++
+         StringTokenizer tokens = new StringTokenizer(
+             DOMUtil.getAttribute(_node,"properties"));
+-        
++
+         List<String> vec = new ArrayList<String>();
+         while(tokens.hasMoreTokens())
+             vec.add(tokens.nextToken());
+         properties = vec.toArray(new String[0]);
+-        
++
+         if( properties.length==0 )
+             throw new AssertionError("this error should be catched by the validator");
+     }
+-    
++
+     /** &lt;constructor> element in the source binding file. */
+     private final Element dom;
+-    
++
+     /** properties specified by @properties. */
+     private final String[] properties;
+-    
++
+     /**
+      * Creates a constructor declaration into the ClassItem.
+-     * 
++     *
+      * @param   cls
+      *      ClassItem object that corresponds to the
+      *      element declaration that contains this declaration.
+@@ -84,6 +84,6 @@
+     public Locator getSourceLocation() {
+         return DOMLocator.getLocationInfo(dom);
+     }
+-    
+ 
++
+ }
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/BIContent.java	Thu Jul 30 17:30:02 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/BIContent.java	Thu Jul 30 17:30:02 2009
+@@ -34,13 +34,13 @@
+ 
+ /**
+  * Particles in the &lt;content> declaration in the binding file.
+- * 
++ *
+  */
+ public class BIContent
+ {
+     /**
+      * Wraps a given particle.
+-     * 
++     *
+      * <p>
+      * This object should be created through
+      * the {@link #create(Element, BIElement)} method.
+@@ -50,18 +50,18 @@
+         this.parent = _parent;
+         this.opts = parent.parent.model.options;
+     }
+-    
++
+     /** The particle element which this object is wrapping. */
+     protected final Element element;
+-    
++
+     /** The parent object.*/
+     protected final BIElement parent;
+ 
+     private final Options opts;
+-    
++
+     /**
+      * Gets the realization of this particle, if any.
+-     * 
++     *
+      * @return
+      *      null if the "collection" attribute was not specified.
+      */
+@@ -68,27 +68,27 @@
+     public final FieldRenderer getRealization() {
+         String v = DOMUtil.getAttribute(element,"collection");
+         if(v==null)     return null;
+-        
++
+         v = v.trim();
+         if(v.equals("array"))   return opts.getFieldRendererFactory().getArray();
+         if(v.equals("list"))
+             return opts.getFieldRendererFactory().getList(
+                 parent.parent.codeModel.ref(ArrayList.class));
+-        
+-        // the correctness of the attribute value must be 
++
++        // the correctness of the attribute value must be
+         // checked by the validator.
+         throw new InternalError("unexpected collection value: "+v);
+     }
+-    
++
+     /**
+      * Gets the property name of this particle.
+-     * 
++     *
+      * @return
+      *      always a non-null, valid string.
+      */
+     public final String getPropertyName() {
+         String r = DOMUtil.getAttribute(element,"property");
+-        
++
+         // in case of <element-ref>, @property is optional and
+         // defaults to @name.
+         // in all other cases, @property is mandatory.
+@@ -95,12 +95,12 @@
+         if(r!=null)     return r;
+         return DOMUtil.getAttribute(element,"name");
+     }
+-    
++
+     /**
+      * Gets the type of this property, if any.
+      * <p>
+      * &lt;element-ref> particle doesn't have the type.
+-     * 
++     *
+      * @return
+      *      null if none is specified.
+      */
+@@ -108,7 +108,7 @@
+         try {
+             String type = DOMUtil.getAttribute(element,"supertype");
+             if(type==null)     return null;
+-            
++
+             // TODO: does this attribute defaults to the current package?
+             int idx = type.lastIndexOf('.');
+             if(idx<0)   return parent.parent.codeModel.ref(type);
+@@ -119,10 +119,10 @@
+         }
+     }
+ 
+-    
+-    
+-    
+-    
++
++
++
++
+     /**
+      * Creates an appropriate subclass of BIContent
+      * by sniffing the tag name.
+@@ -132,6 +132,6 @@
+     static BIContent create( Element e, BIElement _parent ) {
+         return new BIContent(e,_parent);
+     }
+-    
+-    
++
++
+ }
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/BIConversion.java	Thu Jul 30 17:30:06 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/BIConversion.java	Thu Jul 30 17:30:05 2009
+@@ -33,7 +33,7 @@
+ {
+     /** Gets the conversion name. */
+     String name();
+-    
++
+     /** Gets a transducer for this conversion. */
+     TypeUse getTransducer();
+ }
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/BIElement.java	Thu Jul 30 17:30:09 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/BIElement.java	Thu Jul 30 17:30:09 2009
+@@ -45,7 +45,7 @@
+ {
+     /**
+      * Wraps a given &lt;element> element in the binding file.
+-     * 
++     *
+      * <p>
+      * Should be created only from {@link BindInfo}.
+      */
+@@ -52,7 +52,7 @@
+     BIElement( BindInfo bi, Element _e ) {
+         this.parent = bi;
+         this.e = _e;
+-        
++
+         {
+             Element c = DOMUtil.getElement(e,"content");
+             if(c!=null) {
+@@ -70,13 +70,13 @@
+                 }
+             }
+         }
+-        
++
+         // parse <attribute>s
+         for( Element atr : DOMUtil.getChildElements(e,"attribute") ) {
+             BIAttribute a = new BIAttribute( this, atr );
+             attributes.put(a.name(),a);
+         }
+-        
++
+         if(isClass()) {
+             // if this is a class-declaration, create JClass object now
+             String className = DOMUtil.getAttribute(e,"class");
+@@ -88,7 +88,7 @@
+             // this is not an element-class declaration
+             className = null;
+         }
+-        
++
+         // process conversion declarations
+         for( Element conv : DOMUtil.getChildElements(e,"conversion") ) {
+             BIConversion c = new BIUserConversion(bi,conv);
+@@ -98,7 +98,7 @@
+             BIConversion c = BIEnumeration.create(en,this);
+             conversions.put(c.name(),c);
+         }
+-        
++
+         // parse <constructor>s
+         for( Element c : DOMUtil.getChildElements(e,"constructor") ) {
+             constructors.add( new BIConstructor(c) );
+@@ -120,7 +120,7 @@
+ 
+     /** The parent {@link BindInfo} object to which this object belongs. */
+     final BindInfo parent;
+-    
++
+     /** &lt;element> element which this object is wrapping. */
+     private final Element e;
+ 
+@@ -135,10 +135,10 @@
+      * This vector will be empty if no content-property declaration is made.
+      */
+     private final List<BIContent> contents = new ArrayList<BIContent>();
+-    
++
+     /** Conversion declarations. */
+     private final Map<String,BIConversion> conversions = new HashMap<String,BIConversion>();
+-    
++
+     /**
+      * The "rest" content-property declaration.
+      * <p>
+@@ -145,13 +145,13 @@
+      * This field is null when there was no "rest" declaration.
+      */
+     private BIContent rest;
+-    
++
+     /** Attribute-property declarations. */
+     private final Map<String,BIAttribute> attributes = new HashMap<String,BIAttribute>();
+-    
++
+     /** Constructor declarations. */
+     private final List<BIConstructor> constructors = new ArrayList<BIConstructor>();
+-    
++
+     /**
+      * the class which is generated by this declaration.
+      * This field will be null if this declaration is an element-property
+@@ -159,11 +159,11 @@
+      */
+     private final String className;
+ 
+-    
+-    
++
++
+     /** Gets the element name. */
+     public String name() { return DOMUtil.getAttribute(e,"name"); }
+-    
++
+     /**
+      * Checks if the element type is "class".
+      * If false, that means this element will be a value.
+@@ -171,7 +171,7 @@
+     public boolean isClass() {
+         return "class".equals(e.getAttribute("type"));
+     }
+-    
++
+     /**
+      * Checks if this element is designated as a root element.
+      */
+@@ -178,10 +178,10 @@
+     public boolean isRoot() {
+         return "true".equals(e.getAttribute("root"));
+     }
+-    
++
+     /**
+      * Gets the JClass object that represents this declaration.
+-     * 
++     *
+      * <p>
+      * This method returns null if this declaration
+      * is an element-property declaration.
+@@ -189,14 +189,14 @@
+     public String getClassName() {
+         return className;
+     }
+-    
++
+     /**
+      * Creates constructor declarations for this element.
+-     * 
++     *
+      * <p>
+      * This method should only be called by DTDReader <b>after</b>
+      * the normalization has completed.
+-     * 
++     *
+      * @param   src
+      *      The ClassItem object that corresponds to this declaration
+      */
+@@ -204,14 +204,14 @@
+         for( BIConstructor c : constructors )
+             c.createDeclaration(src);
+     }
+-    
++
+     /**
+      * Gets the conversion method for this element.
+-     * 
++     *
+      * <p>
+      * This method can be called only when this element
+      * declaration is designated as element-value.
+-     * 
++     *
+      * @return
+      *        If the convert attribute is not specified, this
+      *        method returns null.
+@@ -219,16 +219,16 @@
+     public BIConversion getConversion() {
+           String cnv = DOMUtil.getAttribute(e,"convert");
+           if(cnv==null)        return null;
+-          
++
+           return conversion(cnv);
+     }
+ 
+     /**
+      * Resolves the conversion name to the conversion declaration.
+-     * 
++     *
+      * <p>
+      * Element-local declarations are checked first.
+-     * 
++     *
+      * @return
+      *        A non-null valid BIConversion object.
+      */
+@@ -235,12 +235,12 @@
+     public BIConversion conversion( String name ) {
+         BIConversion r = conversions.get(name);
+         if(r!=null)     return r;
+-        
++
+         // check the global conversion declarations
+         return parent.conversion(name);
+     }
+-    
+-    
++
++
+     /**
+      * Iterates all content-property declarations (except 'rest').
+      */
+@@ -250,7 +250,7 @@
+ 
+     /**
+      * Gets the attribute-property declaration, if any.
+-     * 
++     *
+      * @return
+      *      null if attribute declaration was not given by that name.
+      */
+@@ -257,7 +257,7 @@
+     public BIAttribute attribute( String name ) {
+         return attributes.get(name);
+     }
+-    
++
+     /**
+      * Gets the 'rest' content-property declaration, if any.
+      * @return
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/BIEnumeration.java	Thu Jul 30 17:30:13 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/BIEnumeration.java	Thu Jul 30 17:30:12 2009
+@@ -47,20 +47,20 @@
+         this.e = _e;
+         this.xducer = _xducer;
+     }
+-    
++
+     /** &lt;enumeration> element in DOM. */
+     private final Element e;
+-    
++
+     private final TypeUse xducer;
+-    
++
+     public String name() { return DOMUtil.getAttribute(e,"name"); }
+-    
++
+     /** Returns a transducer for this enumeration declaration. */
+     public TypeUse getTransducer() { return xducer; }
+-    
+-    
+-    
+-    
++
++
++
++
+     /** Creates a global enumeration declaration. */
+     static BIEnumeration create( Element dom, BindInfo parent ) {
+         // create a class in the target package.
+@@ -76,7 +76,7 @@
+                 null, null/*TODO*/,
+                 DOMLocator.getLocationInfo(dom)));
+     }
+-    
++
+     /** Creates an element-local enumeration declaration. */
+     static BIEnumeration create( Element dom, BIElement parent ) {
+         // create a class as a nested class
+@@ -92,13 +92,13 @@
+                 null, null/*TODO*/,
+                 DOMLocator.getLocationInfo(dom) ));
+     }
+-    
++
+     private static List<CEnumConstant> buildMemberList( Model model, Element dom ) {
+         List<CEnumConstant> r = new ArrayList<CEnumConstant>();
+ 
+         String members = DOMUtil.getAttribute(dom,"members");
+         if(members==null) members="";   // TODO: error handling
+-        
++
+         StringTokenizer tokens = new StringTokenizer(members);
+         while(tokens.hasMoreTokens()) {
+             String token = tokens.nextToken();
+@@ -105,7 +105,7 @@
+             r.add(new CEnumConstant(model.getNameConverter().toConstantName(token),
+                     null,token,null));
+         }
+-        
++
+         return r;
+     }
+ }
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/BIInterface.java	Thu Jul 30 17:30:16 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/BIInterface.java	Thu Jul 30 17:30:16 2009
+@@ -38,7 +38,7 @@
+         this.dom = e;
+         name = DOMUtil.getAttribute(e,"name");
+         members = parseTokens(DOMUtil.getAttribute(e,"members"));
+-        
++
+         if(DOMUtil.getAttribute(e,"properties")!=null) {
+             fields = parseTokens(DOMUtil.getAttribute(e,"properties"));
+             throw new AssertionError("//interface/@properties is not supported");
+@@ -45,51 +45,51 @@
+         } else    // no property was specified
+             fields = new String[0];
+     }
+-    
++
+     /** &lt;interface> element in the binding file. */
+     private final Element dom;
+-    
++
+     /** Name of the generated Java interface. */
+     private final String name;
+-    
++
+     /**
+      * Gets the name of this interface.
+      * This name should also used as the class name.
+      */
+     public String name() { return name; }
+-    
+-    
++
++
+     private final String[] members;
+-    
++
+     /**
+      * Gets the names of interfaces/classes that implement
+      * this interface.
+      */
+     public String[] members() { return members; }
+-    
+-    
++
++
+     private final String[] fields;
+-    
++
+     /** Gets the names of fields in this interface. */
+     public String[] fields() { return fields; }
+-    
+-    
++
++
+     /** Gets the location where this declaration is declared. */
+     public Locator getSourceLocation() {
+         return DOMLocator.getLocationInfo(dom);
+     }
+-    
+-    
+-    
++
++
++
+     /** splits a list into an array of strings. */
+     private static String[] parseTokens( String value ) {
+         StringTokenizer tokens = new StringTokenizer(value);
+-        
++
+         String[] r = new String[tokens.countTokens()];
+         int i=0;
+         while(tokens.hasMoreTokens())
+             r[i++] = tokens.nextToken();
+-        
++
+         return r;
+     }
+ }
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/BIUserConversion.java	Thu Jul 30 17:30:20 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/BIUserConversion.java	Thu Jul 30 17:30:19 2009
+@@ -67,11 +67,11 @@
+         this.owner = bi;
+         this.e = _e;
+     }
+-    
++
+     private static void add( Map<String,BIConversion> m, BIConversion c ) {
+         m.put( c.name(), c );
+     }
+-    
++
+     /** Adds all built-in conversions into the given map. */
+     static void addBuiltinConversions( BindInfo bi, Map<String,BIConversion> m ) {
+         add( m, new BIUserConversion( bi, parse("<conversion name='boolean' type='java.lang.Boolean' parse='getBoolean' />")));
+@@ -101,7 +101,7 @@
+ 
+     /** The owner {@link BindInfo} object to which this object belongs. */
+     private final BindInfo owner;
+-    
++
+     /** &lt;conversion> element which this object is wrapping. */
+     private final Element e;
+ 
+@@ -111,13 +111,13 @@
+     public Locator getSourceLocation() {
+         return DOMLocator.getLocationInfo(e);
+     }
+-    
++
+     /** Gets the conversion name. */
+     public String name() { return DOMUtil.getAttribute(e,"name"); }
+-    
++
+     /** Gets a transducer for this conversion. */
+     public TypeUse getTransducer() {
+-        
++
+         String ws = DOMUtil.getAttribute(e,"whitespace");
+         if(ws==null)    ws = "collapse";
+ 
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/BindInfo.java	Thu Jul 30 17:30:24 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/BindInfo.java	Thu Jul 30 17:30:23 2009
+@@ -73,11 +73,11 @@
+      * precedence over the value specified in the binding file.
+      */
+     private final String defaultPackage;
+-    
++
+     public BindInfo(Model model, InputSource source, ErrorReceiver _errorReceiver) throws AbortException {
+         this( model, parse(model,source,_errorReceiver), _errorReceiver);
+     }
+-    
++
+     public BindInfo(Model model, Document _dom, ErrorReceiver _errorReceiver) {
+         this.model = model;
+         this.dom = _dom.getDocumentElement();
+@@ -99,7 +99,7 @@
+ 
+         // add built-in conversions
+         BIUserConversion.addBuiltinConversions(this,conversions);
+-        
++
+         // process conversion declarations
+         for( Element cnv : DOMUtil.getChildElements(dom,"conversion")) {
+             BIConversion c = new BIUserConversion(this,cnv);
+@@ -110,8 +110,8 @@
+             conversions.put(c.name(),c);
+         }
+         // TODO: check the uniquness of conversion name
+-        
+-        
++
++
+         // process interface definitions
+         for( Element itf : DOMUtil.getChildElements(dom,"interface")) {
+             BIInterface c = new BIInterface(itf);
+@@ -118,11 +118,11 @@
+             interfaces.put(c.name(),c);
+         }
+     }
+-    
+-    
++
++
+     /** CodeModel object that is used by this binding file. */
+     final JCodeModel codeModel;
+-    
++
+     /** Wrap the codeModel object and automate error reporting. */
+     final CodeModelClassFactory classFactory;
+ 
+@@ -134,14 +134,14 @@
+ 
+     /** Element declarations keyed by names. */
+     private final Map<String,BIElement> elements = new HashMap<String,BIElement>();
+-    
++
+     /** interface declarations keyed by names. */
+     private final Map<String,BIInterface> interfaces = new HashMap<String,BIInterface>();
+-  
+-    
++
++
+     /** XJC extension namespace. */
+     private static final String XJC_NS = Const.XJC_EXTENSION_URI;
+-    
++
+ //
+ //
+ //    Exposed public methods
+@@ -156,7 +156,7 @@
+         if(v==null) v="1";
+         return new Long(v);
+     }
+-    
++
+     /** Gets the xjc:superClass customization if it's turned on. */
+     public JClass getSuperClass() {
+         Element sc = DOMUtil.getElement(dom,XJC_NS,"superClass");
+@@ -214,7 +214,7 @@
+ 
+     /**
+      * Gets the conversion declaration from the binding info.
+-     * 
++     *
+      * @return
+      *        A non-null valid BIConversion object.
+      */
+@@ -224,10 +224,10 @@
+             throw new AssertionError("undefined conversion name: this should be checked by the validator before we read it");
+         return r;
+     }
+-    
++
+     /**
+      * Gets the element declaration from the binding info.
+-     * 
++     *
+      * @return
+      *        If there is no declaration with a given name,
+      *        this method returns null.
+@@ -239,7 +239,7 @@
+     public Collection<BIElement> elements() {
+         return elements.values();
+     }
+-    
++
+     /** Returns all {@link BIInterface}s in a read-only set. */
+     public Collection<BIInterface> interfaces() {
+         return interfaces.values();
+@@ -261,17 +261,17 @@
+         if(r==null)     r = CCustomizations.EMPTY;
+         return new CCustomizations(r);
+     }
+-    
+-    
+-    
+-    
++
++
++
++
+ //
+ //
+ //    Internal utility methods
+ //
+ //
+-    
+-    
++
++
+     /** Gets the value from the option element. */
+     private String getOption(String attName, String defaultValue) {
+         Element opt = DOMUtil.getElement(dom,"options");
+@@ -315,7 +315,7 @@
+             reader.setContentHandler(new ForkContentHandler(checker,builder));
+ 
+             reader.parse(is);
+-            
++
+             if(controller.hadError())   throw new AbortException();
+             return (Document)builder.getDOM();
+         } catch( IOException e ) {
+@@ -325,7 +325,7 @@
+         } catch( ParserConfigurationException e ) {
+             receiver.error( new SAXParseException2(e.getMessage(),null,e) );
+         }
+-        
++
+         throw new AbortException();
+     }
+ }
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/DOMBuilder.java	Thu Jul 30 17:30:27 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/DOMBuilder.java	Thu Jul 30 17:30:27 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.reader.dtd.bindinfo;
+ 
+ import javax.xml.parsers.ParserConfigurationException;
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/DOMLocator.java	Thu Jul 30 17:30:31 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/DOMLocator.java	Thu Jul 30 17:30:30 2009
+@@ -34,7 +34,7 @@
+     private static final String systemId    = "systemid";
+     private static final String column      = "column";
+     private static final String line        = "line";
+-    
++
+     /** Sets the location information to a specified element. */
+     public static void setLocationInfo( Element e, Locator loc ) {
+         e.setAttributeNS(locationNamespace,"loc:"+systemId,loc.getSystemId());
+@@ -41,10 +41,10 @@
+         e.setAttributeNS(locationNamespace,"loc:"+column,Integer.toString(loc.getLineNumber()));
+         e.setAttributeNS(locationNamespace,"loc:"+line,Integer.toString(loc.getColumnNumber()));
+     }
+-    
++
+     /**
+      * Gets the location information from an element.
+-     * 
++     *
+      * <p>
+      * For this method to work, the setLocationInfo method has to be
+      * called before.
+@@ -52,7 +52,7 @@
+     public static Locator getLocationInfo( final Element e ) {
+         if(DOMUtil.getAttribute(e,locationNamespace,systemId)==null)
+             return null;    // no location information
+-        
++
+         return new Locator(){
+             public int getLineNumber() {
+                 return Integer.parseInt(DOMUtil.getAttribute(e,locationNamespace,line));
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/DOMUtil.java	Thu Jul 30 17:30:35 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/DOMUtil.java	Thu Jul 30 17:30:34 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.reader.dtd.bindinfo;
+ 
+ import java.util.ArrayList;
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/DTDExtensionBindingChecker.java	Thu Jul 30 17:30:38 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/DTDExtensionBindingChecker.java	Thu Jul 30 17:30:38 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.reader.dtd.bindinfo;
+ 
+ import com.sun.tools.internal.xjc.Options;
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/MessageBundle.properties	Thu Jul 30 17:30:42 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/MessageBundle.properties	Thu Jul 30 17:30:41 2009
+@@ -24,6 +24,5 @@
+ #
+ 
+ BIConstructor.UndefinedField = \
+-	Property "{0}" is declared in the <constructor> declaration \
+-	but is not defined in DTD
+- 
++        Property "{0}" is declared in the <constructor> declaration \
++        but is not defined in DTD
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/Messages.java	Thu Jul 30 17:30:45 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/Messages.java	Thu Jul 30 17:30:45 2009
+@@ -38,9 +38,9 @@
+         String text = ResourceBundle.getBundle(Messages.class.getPackage().getName() + ".MessageBundle").getString(property);
+         return MessageFormat.format(text,args);
+     }
+-    
+ 
++
+     static final String ERR_UNDEFINED_FIELD = // arg:1
+         "BIConstructor.UndefinedField";
+-        
++
+ }
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/bindingfile.rng	Thu Jul 30 17:30:49 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/bindingfile.rng	Thu Jul 30 17:30:48 2009
+@@ -25,7 +25,6 @@
+ -->
+ <!--
+ DTD binding information file which is supported by this version of XJC.
+-$Id: bindingfile.rng,v 1.1 2005/04/15 20:09:43 kohsuke Exp $
+ 
+ - Changes from the EA1 is marked by "CHANGE:"
+ - "ref:key" and "ref:keyref" are used to specify cross-reference
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/bindingfile.xsd	Thu Jul 30 17:30:53 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/bindingfile.xsd	Thu Jul 30 17:30:52 2009
+@@ -23,9 +23,10 @@
+  CA 95054 USA or visit www.sun.com if you need additional information or
+  have any questions.
+ -->
++
++
+ <!--
+   DTD binding information file which is supported by this version of XJC.
+-  $Id: bindingfile.xsd,v 1.1 2005/04/29 18:11:05 kohsuke Exp $
+   
+   - Changes from the EA1 is marked by "CHANGE:"
+   - "ref:key" and "ref:keyref" are used to specify cross-reference
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/xjc.xsd	Thu Jul 30 17:30:56 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/xjc.xsd	Thu Jul 30 17:30:56 2009
+@@ -23,6 +23,8 @@
+  CA 95054 USA or visit www.sun.com if you need additional information or
+  have any questions.
+ -->
++
++
+ <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://java.sun.com/xml/ns/jaxb/xjc" xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc">
+   <xs:import schemaLocation="bindingfile.xsd"/>
+   <xs:element name="serializable">
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/gbind/Choice.java	Thu Jul 30 17:31:00 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/gbind/Choice.java	Thu Jul 30 17:30:59 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.reader.gbind;
+ 
+ /**
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/gbind/ConnectedComponent.java	Thu Jul 30 17:31:03 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/gbind/ConnectedComponent.java	Thu Jul 30 17:31:03 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.reader.gbind;
+ 
+ import java.util.ArrayList;
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/gbind/Element.java	Thu Jul 30 17:31:07 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/gbind/Element.java	Thu Jul 30 17:31:06 2009
+@@ -22,8 +22,10 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.reader.gbind;
+ 
++import java.util.ArrayList;
+ import java.util.Collections;
+ import java.util.Iterator;
+ import java.util.LinkedHashSet;
+@@ -37,7 +39,7 @@
+  * Since this package is about a regular expression over element declarations,
+  * this represents an XML element declaration (hence the name.)
+  *
+- * Element needs to be interned, meaning one {@link Element} per one tag name. 
++ * Element needs to be interned, meaning one {@link Element} per one tag name.
+  *
+  * <p>
+  * Implements {@link ElementSet} to represent a self.
+@@ -144,7 +146,19 @@
+      * all into the given set.
+      */
+     public void buildStronglyConnectedComponents(List<ConnectedComponent> ccs) {
++
++        // store visited elements - loop detection
++        List<Element> visitedElements = new ArrayList<Element>();
++
+         for(Element cur=this; cur!=cur.prevPostOrder; cur=cur.prevPostOrder) {
++
++            if(visitedElements.contains(cur)) {
++                // if I've already processed cur element, I'm in a loop
++                break;
++            } else {
++                visitedElements.add(cur);
++            }
++
+             if(cur.belongsToSCC())
+                 continue;
+ 
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/gbind/ElementSet.java	Thu Jul 30 17:31:10 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/gbind/ElementSet.java	Thu Jul 30 17:31:10 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.reader.gbind;
+ 
+ import java.util.Collections;
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/gbind/ElementSets.java	Thu Jul 30 17:31:14 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/gbind/ElementSets.java	Thu Jul 30 17:31:13 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.reader.gbind;
+ 
+ import java.util.LinkedHashSet;
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/gbind/Expression.java	Thu Jul 30 17:31:17 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/gbind/Expression.java	Thu Jul 30 17:31:17 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.reader.gbind;
+ 
+ import java.util.Set;
+@@ -63,10 +64,6 @@
+         void buildDAG(ElementSet incoming) {
+             // noop
+         }
+-
+-        void assignElementNumber(Set<Element> allElements) {
+-            // noop
+-        }
+ 
+         public String toString() {
+             return "-";
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/gbind/Graph.java	Thu Jul 30 17:31:21 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/gbind/Graph.java	Thu Jul 30 17:31:20 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.reader.gbind;
+ 
+ import java.util.ArrayList;
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/gbind/OneOrMore.java	Thu Jul 30 17:31:25 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/gbind/OneOrMore.java	Thu Jul 30 17:31:24 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.reader.gbind;
+ 
+ /**
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/gbind/Sequence.java	Thu Jul 30 17:31:28 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/gbind/Sequence.java	Thu Jul 30 17:31:27 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.reader.gbind;
+ 
+ /**
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/gbind/SinkNode.java	Thu Jul 30 17:31:32 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/gbind/SinkNode.java	Thu Jul 30 17:31:31 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.reader.gbind;
+ 
+ /**
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/gbind/SourceNode.java	Thu Jul 30 17:31:35 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/gbind/SourceNode.java	Thu Jul 30 17:31:34 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.reader.gbind;
+ 
+ /**
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/AbstractReferenceFinderImpl.java	Thu Jul 30 17:31:39 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/AbstractReferenceFinderImpl.java	Thu Jul 30 17:31:38 2009
+@@ -40,25 +40,25 @@
+ /**
+  * XMLFilter that finds references to other schema files from
+  * SAX events.
+- * 
++ *
+  * This implementation is a base implementation for typical case
+  * where we just need to look for a particular attribute which
+  * contains an URL to another schema file.
+- * 
++ *
+  * @author
+  *  Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+ public abstract class AbstractReferenceFinderImpl extends XMLFilterImpl {
+     protected final DOMForest parent;
+-        
++
+     protected AbstractReferenceFinderImpl( DOMForest _parent ) {
+         this.parent = _parent;
+     }
+-    
++
+     /**
+      * IF the given element contains a reference to an external resource,
+      * return its URL.
+-     * 
++     *
+      * @param nsURI
+      *      Namespace URI of the current element
+      * @param localName
+@@ -67,14 +67,14 @@
+      *      It's OK to return a relative URL.
+      */
+     protected abstract String findExternalResource( String nsURI, String localName, Attributes atts);
+-    
++
+     public void startElement(String namespaceURI, String localName, String qName, Attributes atts)
+         throws SAXException {
+         super.startElement(namespaceURI, localName, qName, atts);
+-        
++
+         String relativeRef = findExternalResource(namespaceURI,localName,atts);
+         if(relativeRef==null)   return; // non found
+-        
++
+         try {
+             // absolutize URL.
+             String ref = new URI(locator.getSystemId()).resolve(new URI(relativeRef)).toString();
+@@ -103,9 +103,9 @@
+             throw spe;
+         }
+     }
+-        
++
+     private Locator locator;
+-        
++
+     public void setDocumentLocator(Locator locator) {
+         super.setDocumentLocator(locator);
+         this.locator = locator;
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/ContentHandlerNamespacePrefixAdapter.java	Thu Jul 30 17:31:42 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/ContentHandlerNamespacePrefixAdapter.java	Thu Jul 30 17:31:42 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.reader.internalizer;
+ 
+ import javax.xml.XMLConstants;
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/DOMBuilder.java	Thu Jul 30 17:31:46 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/DOMBuilder.java	Thu Jul 30 17:31:45 2009
+@@ -37,11 +37,11 @@
+ 
+ /**
+  * Builds DOM while keeping the location information.
+- * 
++ *
+  * <p>
+  * This class also looks for outer most &lt;jaxb:bindings>
+  * customizations.
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+@@ -49,7 +49,7 @@
+     /**
+      * Grows a DOM tree under the given document, and
+      * stores location information to the given table.
+-     * 
++     *
+      * @param outerMostBindings
+      *      This set will receive newly found outermost
+      *      jaxb:bindings customizations.
+@@ -59,30 +59,30 @@
+         this.locatorTable = ltable;
+         this.outerMostBindings = outerMostBindings;
+     }
+-    
++
+     /** Location information will be stored into this object. */
+     private final LocatorTable locatorTable;
+-    
++
+     private final Set outerMostBindings;
+-    
++
+     private Locator locator;
+-    
++
+     public void setDocumentLocator(Locator locator) {
+         this.locator = locator;
+         super.setDocumentLocator(locator);
+     }
+-    
+ 
++
+     public void startElement(String namespaceURI, String localName, String qName, Attributes atts) {
+         super.startElement(namespaceURI, localName, qName, atts);
+-        
++
+         Element e = getCurrentElement();
+         locatorTable.storeStartLocation( e, locator );
+-        
++
+         // check if this element is an outer-most <jaxb:bindings>
+         if( Const.JAXB_NSURI.equals(e.getNamespaceURI())
+         &&  "bindings".equals(e.getLocalName()) ) {
+-            
++
+             // if this is the root node (meaning that this file is an
+             // external binding file) or if the parent is XML Schema element
+             // (meaning that this is an "inlined" external binding)
+@@ -93,7 +93,7 @@
+             }
+         }
+     }
+-    
++
+     public void endElement(String namespaceURI, String localName, String qName) {
+         locatorTable.storeEndLocation( getCurrentElement(), locator );
+         super.endElement(namespaceURI, localName, qName);
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/DOMForest.java	Thu Jul 30 17:31:49 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/DOMForest.java	Thu Jul 30 17:31:49 2009
+@@ -78,19 +78,19 @@
+ /**
+  * Builds a DOM forest and maintains association from
+  * system IDs to DOM trees.
+- * 
++ *
+  * <p>
+  * A forest is a transitive reflexive closure of referenced documents.
+  * IOW, if a document is in a forest, all the documents referenced from
+  * it is in a forest, too. To support this semantics, {@link DOMForest}
+  * uses {@link InternalizationLogic} to find referenced documents.
+- * 
++ *
+  * <p>
+  * Some documents are marked as "root"s, meaning those documents were
+  * put into a forest explicitly, not because it is referenced from another
+  * document. (However, a root document can be referenced from other
+  * documents, too.)
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+@@ -103,35 +103,35 @@
+      * which documents (of the forest) were given as the root
+      * documents, and which of them are read as included/imported
+      * documents.
+-     * 
++     *
+      * <p>
+      * Set of system ids as strings.
+      */
+     private final Set<String> rootDocuments = new HashSet<String>();
+-    
++
+     /** Stores location information for all the trees in this forest. */
+     public final LocatorTable locatorTable = new LocatorTable();
+-    
++
+     /** Stores all the outer-most &lt;jaxb:bindings> customizations. */
+     public final Set<Element> outerMostBindings = new HashSet<Element>();
+-    
++
+     /** Used to resolve references to other schema documents. */
+     private EntityResolver entityResolver = null;
+-    
++
+     /** Errors encountered during the parsing will be sent to this object. */
+     private ErrorReceiver errorReceiver = null;
+-    
++
+     /** Schema language dependent part of the processing. */
+     protected final InternalizationLogic logic;
+-    
+-    private final SAXParserFactory parserFactory;    
++
++    private final SAXParserFactory parserFactory;
+     private final DocumentBuilder documentBuilder;
+-    
+-    
++
++
+     public DOMForest(
+         SAXParserFactory parserFactory, DocumentBuilder documentBuilder,
+         InternalizationLogic logic ) {
+-        
++
+         this.parserFactory = parserFactory;
+         this.documentBuilder = documentBuilder;
+         this.logic = logic;
+@@ -142,16 +142,16 @@
+             DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+             dbf.setNamespaceAware(true);
+             this.documentBuilder = dbf.newDocumentBuilder();
+-                
++
+             this.parserFactory = SAXParserFactory.newInstance();
+             this.parserFactory.setNamespaceAware(true);
+         } catch( ParserConfigurationException e ) {
+             throw new AssertionError(e);
+         }
+-        
++
+         this.logic = logic;
+     }
+-    
++
+     /**
+      * Gets the DOM tree associated with the specified system ID,
+      * or null if none is found.
+@@ -158,13 +158,13 @@
+      */
+     public Document get( String systemId ) {
+         Document doc = core.get(systemId);
+-        
++
+         if( doc==null && systemId.startsWith("file:/") && !systemId.startsWith("file://") ) {
+             // As of JDK1.4, java.net.URL.toExternal method returns URLs like
+             // "file:/abc/def/ghi" which is an incorrect file protocol URL according to RFC1738.
+             // Some other correctly functioning parts return the correct URLs ("file:///abc/def/ghi"),
+             // and this descripancy breaks DOM look up by system ID.
+-            
++
+             // this extra check solves this problem.
+             doc = core.get( "file://"+systemId.substring(5) );
+         }
+@@ -259,7 +259,7 @@
+     public Document parse( InputSource source, boolean root ) throws SAXException {
+         if( source.getSystemId()==null )
+             throw new IllegalArgumentException();
+-        
++
+         return parse( source.getSystemId(), source, root );
+     }
+ 
+@@ -267,7 +267,7 @@
+      * Parses an XML at the given location (
+      * and XMLs referenced by it) into DOM trees
+      * and stores them to this forest.
+-     * 
++     *
+      * @return the parsed DOM document object.
+      */
+     public Document parse( String systemId, boolean root ) throws SAXException, IOException {
+@@ -277,26 +277,26 @@
+         if( core.containsKey(systemId) )
+             // this document has already been parsed. Just ignore.
+             return core.get(systemId);
+-        
++
+         InputSource is=null;
+-        
++
+         // allow entity resolver to find the actual byte stream.
+         if( entityResolver!=null )
+             is = entityResolver.resolveEntity(null,systemId);
+         if( is==null )
+             is = new InputSource(systemId);
+-        
++
+         // but we still use the original system Id as the key.
+         return parse( systemId, is, root );
+     }
+-    
++
+     /**
+      * Returns a {@link ContentHandler} to feed SAX events into.
+-     * 
++     *
+      * <p>
+      * The client of this class can feed SAX events into the handler
+      * to parse a document into this DOM forest.
+-     * 
++     *
+      * This version requires that the DOM object to be created and registered
+      * to the map beforehand.
+      */
+@@ -317,7 +317,7 @@
+ 
+         return f;
+     }
+-    
++
+     public interface Handler extends ContentHandler {
+         /**
+          * Gets the DOM that was built.
+@@ -324,13 +324,13 @@
+          */
+         public Document getDocument();
+     }
+-    
++
+     private static abstract class HandlerImpl extends XMLFilterImpl implements Handler {
+     }
+-    
++
+     /**
+      * Returns a {@link ContentHandler} to feed SAX events into.
+-     * 
++     *
+      * <p>
+      * The client of this class can feed SAX events into the handler
+      * to parse a document into this DOM forest.
+@@ -340,9 +340,9 @@
+         core.put( systemId, dom );
+         if(root)
+             rootDocuments.add(systemId);
+-       
++
+         ContentHandler handler = getParserHandler(dom);
+-        
++
+         // we will register the DOM to the map once the system ID becomes available.
+         // but the SAX allows the event source to not to provide that information,
+         // so be prepared for such case.
+@@ -352,7 +352,7 @@
+             }
+         };
+         x.setContentHandler(handler);
+-        
++
+         return x;
+    }
+ 
+@@ -372,7 +372,7 @@
+         core.put( systemId, dom );
+         if(root)
+             rootDocuments.add(systemId);
+-        
++
+         try {
+             XMLReader reader = parserFactory.newSAXParser().getXMLReader();
+             reader.setContentHandler(getParserHandler(dom));
+@@ -393,7 +393,7 @@
+             rootDocuments.remove(systemId);
+             return null;
+         }
+-        
++
+         return dom;
+     }
+ 
+@@ -413,19 +413,19 @@
+ 
+         if(root)
+             rootDocuments.add(systemId);
+-        
++
+         if(systemId==null)
+             throw new IllegalArgumentException("system id cannot be null");
+         core.put( systemId, dom );
+-        
++
+         new XMLStreamReaderToContentHandler(parser,getParserHandler(dom),false,false).bridge();
+-        
++
+         return dom;
+     }
+-    
++
+     /**
+      * Performs internalization.
+-     * 
++     *
+      * This method should be called only once, only after all the
+      * schemas are parsed.
+      *
+@@ -514,7 +514,7 @@
+     /**
+      * Creates {@link XMLParser} for XSOM which reads documents from
+      * this DOMForest rather than doing a fresh parse.
+-     * 
++     *
+      * The net effect is that XSOM will read transformed XML Schemas
+      * instead of the original documents.
+      */
+@@ -521,9 +521,9 @@
+     public XMLParser createParser() {
+         return new DOMForestParser(this,new JAXPParser());
+     }
+-    
+-    
+-    
++
++
++
+     public EntityResolver getEntityResolver() {
+         return entityResolver;
+     }
+@@ -531,7 +531,7 @@
+     public void setEntityResolver(EntityResolver entityResolver) {
+         this.entityResolver = entityResolver;
+     }
+-    
++
+     public ErrorReceiver getErrorHandler() {
+         return errorReceiver;
+     }
+@@ -539,7 +539,7 @@
+     public void setErrorHandler(ErrorReceiver errorHandler) {
+         this.errorReceiver = errorHandler;
+     }
+-    
++
+     /**
+      * Gets all the parsed documents.
+      */
+@@ -546,7 +546,7 @@
+     public Document[] listDocuments() {
+         return core.values().toArray(new Document[core.size()]);
+     }
+-    
++
+     /**
+      * Gets all the system IDs of the documents.
+      */
+@@ -553,10 +553,10 @@
+     public String[] listSystemIDs() {
+         return core.keySet().toArray(new String[core.keySet().size()]);
+     }
+-    
++
+     /**
+      * Dumps the contents of the forest to the specified stream.
+-     * 
++     *
+      * This is a debug method. As such, error handling is sloppy.
+      */
+     public void dump( OutputStream out ) throws IOException {
+@@ -571,7 +571,7 @@
+                 dw.setIndentStep("  ");
+                 it.transform( new DOMSource(e.getValue()),
+                     new SAXResult(dw));
+-                
++
+                 out.write( "\n\n\n".getBytes() );
+             }
+         } catch( TransformerException e ) {
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/DOMForestParser.java	Thu Jul 30 17:31:53 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/DOMForestParser.java	Thu Jul 30 17:31:52 2009
+@@ -37,23 +37,23 @@
+ 
+ 
+ /**
+- * {@link XMLParser} implementation that 
++ * {@link XMLParser} implementation that
+  * parses XML from a DOM forest instead of parsing it from
+  * its original location.
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+ class DOMForestParser implements XMLParser {
+-    
++
+     /** DOM forest to be "parsed". */
+     private final DOMForest forest;
+-    
++
+     /** Scanner object will do the actual SAX events generation. */
+     private final DOMForestScanner scanner;
+-    
++
+     private final XMLParser fallbackParser;
+-    
++
+     /**
+      * @param fallbackParser
+      *      This parser will be used when DOMForestParser needs to parse
+@@ -71,10 +71,10 @@
+         ErrorHandler errorHandler,
+         EntityResolver entityResolver )
+         throws SAXException, IOException {
+-        
++
+         String systemId = source.getSystemId();
+         Document dom = forest.get(systemId);
+-        
++
+         if(dom==null) {
+             // if no DOM tree is built for it,
+             // let the fall back parser parse the original document.
+@@ -84,7 +84,7 @@
+             fallbackParser.parse( source, contentHandler, errorHandler, entityResolver );
+             return;
+         }
+-        
++
+         scanner.scan( dom, contentHandler );
+     }
+ }
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/DOMForestScanner.java	Thu Jul 30 17:31:57 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/DOMForestScanner.java	Thu Jul 30 17:31:56 2009
+@@ -40,21 +40,21 @@
+ /**
+  * Produces a complete series of SAX events from any DOM node
+  * in the DOMForest.
+- * 
++ *
+  * <p>
+  * This class hides a logic of re-associating {@link Locator}
+  * to the generated SAX event stream.
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+ public class DOMForestScanner {
+-    
++
+     private final DOMForest forest;
+ 
+     /**
+      * Scans DOM nodes of the given forest.
+-     * 
++     *
+      * DOM node parameters to the scan method must be a part of
+      * this forest.
+      */
+@@ -61,7 +61,7 @@
+     public DOMForestScanner( DOMForest _forest ) {
+         this.forest = _forest;
+     }
+-    
++
+     /**
+      * Generates the whole set of SAX events by treating
+      * element e as if it's a root element.
+@@ -68,16 +68,16 @@
+      */
+     public void scan( Element e, ContentHandler contentHandler ) throws SAXException {
+         DOMScanner scanner = new DOMScanner();
+-        
++
+         // insert the location resolver into the pipe line
+         LocationResolver resolver = new LocationResolver(scanner);
+-        resolver.setContentHandler(contentHandler);    
++        resolver.setContentHandler(contentHandler);
+ 
+         // parse this DOM.
+         scanner.setContentHandler(resolver);
+         scanner.scan(e);
+     }
+-    
++
+     /**
+      * Generates the whole set of SAX events from the given Document
+      * in the DOMForest.
+@@ -84,12 +84,12 @@
+      */
+     public void scan( Document d, ContentHandler contentHandler ) throws SAXException {
+         scan( d.getDocumentElement(), contentHandler );
+-    }    
++    }
+ 
+     /**
+      * Intercepts the invocation of the setDocumentLocator method
+      * and passes itself as the locator.
+-     * 
++     *
+      * If the client calls one of the methods on the Locator interface,
+      * use the LocatorTable to resolve the source location.
+      */
+@@ -97,28 +97,28 @@
+         LocationResolver( DOMScanner _parent ) {
+             this.parent = _parent;
+         }
+-        
++
+         private final DOMScanner parent;
+-        
++
+         /**
+          * Flag that tells us whether we are processing a start element event
+          * or an end element event.
+-         * 
++         *
+          * DOMScanner's getCurrentLocation method doesn't tell us which, but
+          * this information is necessary to return the correct source line information.
+-         * 
++         *
+          * Thus we set this flag appropriately before we pass an event to
+          * the next ContentHandler, thereby making it possible to figure
+          * out which location to return.
+          */
+         private boolean inStart = false;
+-        
++
+         public void setDocumentLocator(Locator locator) {
+             // ignore one set by the parent.
+-            
++
+             super.setDocumentLocator(this);
+         }
+-        
++
+         public void endElement(String namespaceURI, String localName, String qName) throws SAXException {
+             inStart = false;
+             super.endElement(namespaceURI, localName, qName);
+@@ -129,10 +129,10 @@
+             inStart = true;
+             super.startElement(namespaceURI, localName, qName, atts);
+         }
+-        
+-        
+-        
+-        
++
++
++
++
+         private Locator findLocator() {
+             Node n = parent.getCurrentLocation();
+             if( n instanceof Element ) {
+@@ -144,18 +144,18 @@
+             }
+             return null;
+         }
+-        
++
+         //
+         //
+         // Locator methods
+         //
+-        // 
++        //
+         public int getColumnNumber() {
+             Locator l = findLocator();
+             if(l!=null)     return l.getColumnNumber();
+             return          -1;
+         }
+-        
++
+         public int getLineNumber() {
+             Locator l = findLocator();
+             if(l!=null)     return l.getLineNumber();
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/InternalizationLogic.java	Thu Jul 30 17:32:00 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/InternalizationLogic.java	Thu Jul 30 17:32:00 2009
+@@ -29,11 +29,11 @@
+ 
+ /**
+  * Encapsulates schema-language dependent internalization logic.
+- * 
++ *
+  * {@link Internalizer} and {@link DOMForest} are responsible for
+  * doing schema language independent part, and this object is responsible
+  * for schema language dependent part.
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+@@ -41,20 +41,20 @@
+     /**
+      * Creates a new instance of XMLFilter that can be used to
+      * find references to external schemas.
+-     * 
++     *
+      * <p>
+      * Schemas that are included/imported need to be a part of
+      * {@link DOMForest}, and this filter will be expected to
+      * find such references.
+-     * 
++     *
+      * <p>
+      * Once such a reference is found, the filter is expected to
+      * call the parse method of DOMForest.
+-     * 
++     *
+      * <p>
+      * {@link DOMForest} will register ErrorHandler to the returned
+      * object, so any error should be sent to that error handler.
+-     * 
++     *
+      * @return
+      *      This method returns {@link XMLFilterImpl} because
+      *      the filter has to be usable for two directions
+@@ -61,11 +61,11 @@
+      *      (wrapping a reader and wrapping a ContentHandler)
+      */
+     XMLFilterImpl createExternalReferenceFinder( DOMForest parent );
+-    
++
+     /**
+      * Checks if the specified element is a valid target node
+      * to attach a customization.
+-     * 
++     *
+      * @param parent
+      *      The owner DOMForest object. Probably useful only
+      *      to obtain context information, such as error handler.
+@@ -75,15 +75,15 @@
+      *      true if it's OK, false if not.
+      */
+     boolean checkIfValidTargetNode( DOMForest parent, Element bindings, Element target );
+-    
++
+     /**
+      * Prepares an element that actually receives customizations.
+-     * 
++     *
+      * <p>
+      * For example, in XML Schema, target nodes can be any schema
+      * element but it is always the &lt;xsd:appinfo> element that
+      * receives customization.
+-     * 
++     *
+      * @param target
+      *      The target node designated by the customization.
+      * @return
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/Internalizer.java	Thu Jul 30 17:32:04 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/Internalizer.java	Thu Jul 30 17:32:03 2009
+@@ -61,7 +61,7 @@
+  *
+  * <p>
+  * The {@link #transform(DOMForest,boolean)} method is the entry point.
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+@@ -85,18 +85,18 @@
+         return new Internalizer( forest, enableSCD ).transform();
+     }
+ 
+-    
++
+     private Internalizer( DOMForest forest, boolean enableSCD ) {
+         this.errorHandler = forest.getErrorHandler();
+         this.forest = forest;
+         this.enableSCD = enableSCD;
+     }
+-    
++
+     /**
+      * DOMForest object currently being processed.
+      */
+     private final DOMForest forest;
+-    
++
+     /**
+      * All errors found during the transformation is sent to this object.
+      */
+@@ -106,8 +106,8 @@
+      * If true, the SCD-based target selection is supported.
+      */
+     private boolean enableSCD;
+-    
+-    
++
++
+     private SCDBasedBindingSet transform() {
+ 
+         // either target nodes are conventional DOM nodes (as per spec),
+@@ -114,7 +114,7 @@
+         Map<Element,Node> targetNodes = new HashMap<Element,Node>();
+         // ... or it will be schema components by means of SCD (RI extension)
+         SCDBasedBindingSet scd = new SCDBasedBindingSet(forest);
+-        
++
+         //
+         // identify target nodes for all <jaxb:bindings>
+         //
+@@ -122,7 +122,7 @@
+             // initially, the inherited context is itself
+             buildTargetNodeMap(jaxbBindings, jaxbBindings, null, targetNodes, scd);
+         }
+-        
++
+         //
+         // then move them to their respective positions.
+         //
+@@ -132,7 +132,7 @@
+ 
+         return scd;
+     }
+-    
++
+     /**
+      * Validates attributes of a &lt;jaxb:bindings> element.
+      */
+@@ -152,7 +152,7 @@
+             // TODO: flag error for this undefined attribute
+         }
+     }
+-    
++
+     /**
+      * Determines the target node of the "bindings" element
+      * by using the inherited target node, then put
+@@ -171,13 +171,13 @@
+                                      Map<Element,Node> result, SCDBasedBindingSet scdResult ) {
+         // start by the inherited target
+         Node target = inheritedTarget;
+-        
++
+         validate(bindings); // validate this node
+-        
++
+         // look for @schemaLocation
+         if( bindings.getAttributeNode("schemaLocation")!=null ) {
+             String schemaLocation = bindings.getAttribute("schemaLocation");
+-            
++
+             try {
+                 // absolutize this URI.
+                 // TODO: use the URI class
+@@ -188,7 +188,7 @@
+             } catch( MalformedURLException e ) {
+                 // continue with the original schemaLocation value
+             }
+-            
++
+             target = forest.get(schemaLocation);
+             if(target==null) {
+                 reportError( bindings,
+@@ -195,17 +195,17 @@
+                     Messages.format(Messages.ERR_INCORRECT_SCHEMA_REFERENCE,
+                         schemaLocation,
+                         EditDistance.findNearest(schemaLocation,forest.listSystemIDs())));
+-                
++
+                 return; // abort processing this <jaxb:bindings>
+             }
+ 
+             target = ((Document)target).getDocumentElement();
+         }
+-        
++
+         // look for @node
+         if( bindings.getAttributeNode("node")!=null ) {
+             String nodeXPath = bindings.getAttribute("node");
+-            
++
+             // evaluate this XPath
+             NodeList nlst;
+             try {
+@@ -216,19 +216,19 @@
+                     Messages.format(Messages.ERR_XPATH_EVAL,e.getMessage()), e );
+                 return; // abort processing this <jaxb:bindings>
+             }
+-            
++
+             if( nlst.getLength()==0 ) {
+                 reportError( bindings,
+                     Messages.format(Messages.NO_XPATH_EVAL_TO_NO_TARGET, nodeXPath) );
+                 return; // abort
+             }
+-            
++
+             if( nlst.getLength()!=1 ) {
+                 reportError( bindings,
+                     Messages.format(Messages.NO_XPATH_EVAL_TOO_MANY_TARGETS, nodeXPath,nlst.getLength()) );
+                 return; // abort
+             }
+-            
++
+             Node rnode = nlst.item(0);
+             if(!(rnode instanceof Element )) {
+                 reportError( bindings,
+@@ -235,7 +235,7 @@
+                     Messages.format(Messages.NO_XPATH_EVAL_TO_NON_ELEMENT, nodeXPath) );
+                 return; // abort
+             }
+-            
++
+             if( !forest.logic.checkIfValidTargetNode(forest,bindings,(Element)rnode) ) {
+                 reportError( bindings,
+                     Messages.format(Messages.XPATH_EVAL_TO_NON_SCHEMA_ELEMENT,
+@@ -242,7 +242,7 @@
+                         nodeXPath, rnode.getNodeName() ) );
+                 return; // abort
+             }
+-            
++
+             target = rnode;
+         }
+ 
+@@ -271,13 +271,13 @@
+             inheritedSCD.addBinidng(bindings);
+         else
+             result.put( bindings, target );
+-        
++
+         // look for child <jaxb:bindings> and process them recursively
+         Element[] children = DOMUtils.getChildElements( bindings, Const.JAXB_NSURI, "bindings" );
+         for (Element value : children)
+             buildTargetNodeMap(value, target, inheritedSCD, result, scdResult);
+     }
+-    
++
+     /**
+      * Moves JAXB customizations under their respective target nodes.
+      */
+@@ -316,13 +316,13 @@
+             }
+         }
+     }
+-    
++
+     /**
+      * Moves the "decl" node under the "target" node.
+-     * 
++     *
+      * @param decl
+      *      A JAXB customization element (e.g., &lt;jaxb:class>)
+-     * 
++     *
+      * @param target
+      *      XML Schema element under which the declaration should move.
+      *      For example, &lt;xs:element>
+@@ -329,9 +329,9 @@
+      */
+     private void moveUnder( Element decl, Element target ) {
+         Element realTarget = forest.logic.refineTarget(target);
+-        
++
+         declExtensionNamespace( decl, target );
+-        
++
+         // copy in-scope namespace declarations of the decl node
+         // to the decl node itself so that this move won't change
+         // the in-scope namespace bindings.
+@@ -345,24 +345,24 @@
+                     String prefix;
+                     if( a.getName().indexOf(':')==-1 )  prefix = "";
+                     else                                prefix = a.getLocalName();
+-                    
++
+                     if( inscopes.add(prefix) && p!=decl ) {
+                         // if this is the first time we see this namespace bindings,
+                         // copy the declaration.
+                         // if p==decl, there's no need to. Note that
+                         // we want to add prefix to inscopes even if p==Decl
+-                        
++
+                         decl.setAttributeNodeNS( (Attr)a.cloneNode(true) );
+                     }
+                 }
+             }
+-            
++
+             if( p.getParentNode() instanceof Document )
+                 break;
+-            
++
+             p = (Element)p.getParentNode();
+         }
+-        
++
+         if( !inscopes.contains("") ) {
+             // if the default namespace was undeclared in the context of decl,
+             // it must be explicitly set to "" since the new environment might
+@@ -376,15 +376,15 @@
+             // if they belong to different DOM documents, we need to clone them
+             Element original = decl;
+             decl = (Element)realTarget.getOwnerDocument().importNode(decl,true);
+-            
++
+             // this effectively clones a ndoe,, so we need to copy locators.
+             copyLocators( original, decl );
+         }
+-        
+-        
++
++
+         realTarget.appendChild( decl );
+     }
+-    
++
+     /**
+      * Recursively visits sub-elements and declare all used namespaces.
+      * TODO: the fact that we recognize all namespaces in the extension
+@@ -395,7 +395,7 @@
+         // @extensionBindingPrefixes.
+         if( !Const.JAXB_NSURI.equals(decl.getNamespaceURI()) )
+             declareExtensionNamespace( target, decl.getNamespaceURI() );
+-        
++
+         NodeList lst = decl.getChildNodes();
+         for( int i=0; i<lst.getLength(); i++ ) {
+             Node n = lst.item(i);
+@@ -407,7 +407,7 @@
+ 
+     /** Attribute name. */
+     private static final String EXTENSION_PREFIXES = "extensionBindingPrefixes";
+-    
++
+     /**
+      * Adds the specified namespace URI to the jaxb:extensionBindingPrefixes
+      * attribute of the target document.
+@@ -423,13 +423,13 @@
+                 Const.JAXB_NSURI,jaxbPrefix+':'+EXTENSION_PREFIXES);
+             root.setAttributeNodeNS(att);
+         }
+-        
++
+         String prefix = allocatePrefix(root,nsUri);
+         if( att.getValue().indexOf(prefix)==-1 )
+             // avoid redeclaring the same namespace twice.
+             att.setValue( att.getValue()+' '+prefix);
+     }
+-    
++
+     /**
+      * Declares a new prefix on the given element and associates it
+      * with the specified namespace URI.
+@@ -444,24 +444,24 @@
+             Attr a = (Attr)atts.item(i);
+             if( Const.XMLNS_URI.equals(a.getNamespaceURI()) ) {
+                 if( a.getName().indexOf(':')==-1 )  continue;
+-                
++
+                 if( a.getValue().equals(nsUri) )
+                     return a.getLocalName();    // found one
+             }
+         }
+-        
++
+         // none found. allocate new.
+         while(true) {
+             String prefix = "p"+(int)(Math.random()*1000000)+'_';
+             if(e.getAttributeNodeNS(Const.XMLNS_URI,prefix)!=null)
+                 continue;   // this prefix is already allocated.
+-            
++
+             e.setAttributeNS(Const.XMLNS_URI,"xmlns:"+prefix,nsUri);
+             return prefix;
+         }
+     }
+-    
+-    
++
++
+     /**
+      * Copies location information attached to the "src" node to the "dst" node.
+      */
+@@ -470,23 +470,23 @@
+             dst, forest.locatorTable.getStartLocation(src) );
+         forest.locatorTable.storeEndLocation(
+             dst, forest.locatorTable.getEndLocation(src) );
+-        
++
+         // recursively process child elements
+         Element[] srcChilds = DOMUtils.getChildElements(src);
+         Element[] dstChilds = DOMUtils.getChildElements(dst);
+-        
++
+         for( int i=0; i<srcChilds.length; i++ )
+             copyLocators( srcChilds[i], dstChilds[i] );
+     }
+-    
+ 
++
+     private void reportError( Element errorSource, String formattedMsg ) {
+         reportError( errorSource, formattedMsg, null );
+     }
+-    
++
+     private void reportError( Element errorSource,
+         String formattedMsg, Exception nestedException ) {
+-        
++
+         SAXParseException e = new SAXParseException2( formattedMsg,
+             forest.locatorTable.getStartLocation(errorSource),
+             nestedException );
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/LocatorTable.java	Thu Jul 30 17:32:07 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/LocatorTable.java	Thu Jul 30 17:32:07 2009
+@@ -33,7 +33,7 @@
+ 
+ /**
+  * Stores {@link Locator} objects for every {@link Element}.
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+@@ -40,22 +40,22 @@
+ public final class LocatorTable {
+     /** Locations of the start element. */
+     private final Map startLocations = new HashMap();
+-    
++
+     /** Locations of the end element. */
+     private final Map endLocations = new HashMap();
+-    
++
+     public void storeStartLocation( Element e, Locator loc ) {
+         startLocations.put(e,new LocatorImpl(loc));
+     }
+-    
++
+     public void storeEndLocation( Element e, Locator loc ) {
+         endLocations.put(e,new LocatorImpl(loc));
+     }
+-    
++
+     public Locator getStartLocation( Element e ) {
+         return (Locator)startLocations.get(e);
+     }
+-    
++
+     public Locator getEndLocation( Element e ) {
+         return (Locator)endLocations.get(e);
+     }
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/MessageBundle.properties	Thu Jul 30 17:32:11 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/MessageBundle.properties	Thu Jul 30 17:32:10 2009
+@@ -29,44 +29,44 @@
+ 
+ 
+ AbstractReferenceFinderImpl.UnableToParse = \
+-	Unable to parse "{0}" : {1}
++        Unable to parse "{0}" : {1}
+ 
+-	
+ 
+ 
++
+ Internalizer.IncorrectSchemaReference = \
+-	"{0}" is not a part of this compilation. Is this a mistake for "{1}"?
++        "{0}" is not a part of this compilation. Is this a mistake for "{1}"?
+ 
+ Internalizer.XPathEvaluationError = \
+-	XPath error: {0}
++        XPath error: {0}
+ 
+ Internalizer.XPathEvaluatesToNoTarget = \
+-	XPath evaluation of "{0}" results in empty target node
++        XPath evaluation of "{0}" results in empty target node
+ 
+ Internalizer.XPathEvaulatesToTooManyTargets = \
+-	XPath evaluation of "{0}" results in too many ({1}) target nodes
++        XPath evaluation of "{0}" results in too many ({1}) target nodes
+ 
+ Internalizer.XPathEvaluatesToNonElement = \
+-	XPath evaluation of "{0}" needs to result in an element.
++        XPath evaluation of "{0}" needs to result in an element.
+ 
+ Internalizer.XPathEvaluatesToNonSchemaElement = \
+-	XPath evaluation of "{0}" needs to result in an element of the schema language, \
+-	but it results in {1}
++        XPath evaluation of "{0}" needs to result in an element of the schema language, \
++        but it results in {1}
+ 
+ Internalizer.ContextNodeIsNotElement = \
+-	Context node is not an element.
++        Context node is not an element.
+ 
+ Internalizer.OrphanedCustomization = \
+-	The "{0}" customization is not associated with any schema element.
++        The "{0}" customization is not associated with any schema element.
+ 
+ Internalizer.IncorrectVersion = \
+-	JAXB version attribute must be "1.0"
++        JAXB version attribute must be "1.0"
+ 
+ Internalizer.VersionNotPresent = \
+-	JAXB version attribute must be present
++        JAXB version attribute must be present
+ 
+ Internalizer.TwoVersionAttributes = \
+-	Both jaxb:version and version are present
++        Both jaxb:version and version are present
+ 
+ ERR_GENERAL_SCHEMA_CORRECTNESS_ERROR = \
+     We were unable to ensure the correctness of the schema: {0}
+@@ -91,4 +91,3 @@
+ 
+ ERR_FILENAME_IS_NOT_URI = \
+     File name is not an URI.
+- 
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/Messages.java	Thu Jul 30 17:32:14 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/Messages.java	Thu Jul 30 17:32:14 2009
+@@ -38,7 +38,7 @@
+         String text = ResourceBundle.getBundle(Messages.class.getPackage().getName() +".MessageBundle").getString(property);
+         return MessageFormat.format(text,args);
+     }
+-    
++
+     static final String ERR_INCORRECT_SCHEMA_REFERENCE = // args:2
+         "Internalizer.IncorrectSchemaReference";
+     static final String ERR_XPATH_EVAL = // arg:1
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/NamespaceContextImpl.java	Thu Jul 30 17:32:18 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/NamespaceContextImpl.java	Thu Jul 30 17:32:17 2009
+@@ -2,7 +2,7 @@
+  * reserved comment block
+  * DO NOT REMOVE OR ALTER!
+  */
+-/*
++ /*
+  * Portions Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+  *
+@@ -28,6 +28,23 @@
+  *
+  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
+  */
++
++/*
++ * Copyright 1999-2004 The Apache Software Foundation.
++ *
++ * Licensed under the Apache License, Version 2.0 (the "License");
++ * you may not use this file except in compliance with the License.
++ * You may obtain a copy of the License at
++ *
++ *     http://www.apache.org/licenses/LICENSE-2.0
++ *
++ * Unless required by applicable law or agreed to in writing, software
++ * distributed under the License is distributed on an "AS IS" BASIS,
++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++ * See the License for the specific language governing permissions and
++ * limitations under the License.
++ */
++
+ package com.sun.tools.internal.xjc.reader.internalizer;
+ 
+ import java.util.Iterator;
+@@ -53,21 +70,6 @@
+         this.e = e;
+     }
+ 
+-    /*
+-     * Copyright 1999-2004 The Apache Software Foundation.
+-     *
+-     * Licensed under the Apache License, Version 2.0 (the "License");
+-     * you may not use this file except in compliance with the License.
+-     * You may obtain a copy of the License at
+-     *
+-     *     http://www.apache.org/licenses/LICENSE-2.0
+-     *
+-     * Unless required by applicable law or agreed to in writing, software
+-     * distributed under the License is distributed on an "AS IS" BASIS,
+-     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-     * See the License for the specific language governing permissions and
+-     * limitations under the License.
+-     */
+     public String getNamespaceURI(String prefix) {
+         Node parent = e;
+         String namespace = null;
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/SCDBasedBindingSet.java	Thu Jul 30 17:32:21 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/SCDBasedBindingSet.java	Thu Jul 30 17:32:21 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.reader.internalizer;
+ 
+ import java.util.ArrayList;
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/VersionChecker.java	Thu Jul 30 17:32:25 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/VersionChecker.java	Thu Jul 30 17:32:24 2009
+@@ -43,10 +43,10 @@
+ 
+ /**
+  * Checks the jaxb:version attribute on a XML Schema document.
+- * 
++ *
+  * jaxb:version is optional if no binding customization is used,
+  * but if present, its value must be "1.0".
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+@@ -57,40 +57,40 @@
+      * when we hit the root element.
+      */
+     private String version = null ;
+-    
++
+     /** Will be set to true once we hit the root element. */
+     private boolean seenRoot = false;
+-    
++
+     /** Will be set to true once we hit a binding declaration. */
+     private boolean seenBindings = false;
+-    
++
+     private Locator locator;
+-    
++
+     /**
+      * Stores the location of the start tag of the root tag.
+      */
+     private Locator rootTagStart;
+-    
++
+     public VersionChecker( XMLReader parent ) {
+         setParent(parent);
+     }
+-    
++
+     public VersionChecker( ContentHandler handler,ErrorHandler eh,EntityResolver er ) {
+         setContentHandler(handler);
+         if(eh!=null)    setErrorHandler(eh);
+         if(er!=null)    setEntityResolver(er);
+     }
+-    
++
+     public void startElement(String namespaceURI, String localName, String qName, Attributes atts)
+         throws SAXException {
+-        
++
+         super.startElement(namespaceURI, localName, qName, atts);
+-        
++
+         if(!seenRoot) {
+             // if this is the root element
+             seenRoot = true;
+             rootTagStart = new LocatorImpl(locator);
+-            
++
+             version = atts.getValue(Const.JAXB_NSURI,"version");
+             if( namespaceURI.equals(Const.JAXB_NSURI) ) {
+                 String version2 = atts.getValue("","version");
+@@ -103,9 +103,9 @@
+                 if( version==null )
+                     version = version2;
+             }
+-            
++
+         }
+-        
++
+         if( Const.JAXB_NSURI.equals(namespaceURI) )
+             seenBindings = true;
+     }
+@@ -112,7 +112,7 @@
+ 
+     public void endDocument() throws SAXException {
+         super.endDocument();
+-        
++
+         if( seenBindings && version==null ) {
+             // if we see a binding declaration but not version attribute
+             SAXParseException e = new SAXParseException(
+@@ -119,8 +119,8 @@
+                 Messages.format(Messages.ERR_VERSION_NOT_FOUND),rootTagStart);
+             getErrorHandler().error(e);
+         }
+-        
+-        // if present, the value must be either 1.0 or 2.0 
++
++        // if present, the value must be either 1.0 or 2.0
+         if( version!=null && !VERSIONS.contains(version) ) {
+             SAXParseException e = new SAXParseException(
+                 Messages.format(Messages.ERR_INCORRECT_VERSION),rootTagStart);
+@@ -127,7 +127,7 @@
+             getErrorHandler().error(e);
+         }
+     }
+-    
++
+     public void setDocumentLocator(Locator locator) {
+         super.setDocumentLocator(locator);
+         this.locator = locator;
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/WhitespaceStripper.java	Thu Jul 30 17:32:29 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/internalizer/WhitespaceStripper.java	Thu Jul 30 17:32:28 2009
+@@ -22,11 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * @(#)$Id: WhitespaceStripper.java,v 1.2 2005/04/29 19:56:57 kohsuke Exp $
+- */
+-
+-
+ package com.sun.tools.internal.xjc.reader.internalizer;
+ 
+ import com.sun.xml.internal.bind.WhiteSpaceProcessor;
+@@ -41,11 +36,11 @@
+ 
+ /**
+  * Strips ignorable whitespace from SAX event stream.
+- * 
++ *
+  * <p>
+  * This filter works only when the event stream doesn't
+  * contain any mixed content.
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+@@ -52,10 +47,10 @@
+ class WhitespaceStripper extends XMLFilterImpl {
+ 
+     private int state = 0;
+-    
++
+     private char[] buf = new char[1024];
+     private int bufLen = 0;
+-    
++
+     private static final int AFTER_START_ELEMENT = 1;
+     private static final int AFTER_END_ELEMENT = 2;
+ 
+@@ -110,7 +105,7 @@
+         super.endElement(uri, localName, qName);
+         state = AFTER_END_ELEMENT;
+     }
+-    
++
+     /**
+      * Forwars the buffered characters if it contains any non-whitespace
+      * character.
+@@ -124,7 +119,7 @@
+                }
+         }
+     }
+-    
++
+     public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException {
+         // ignore completely.
+     }
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/relaxng/BindStyle.java	Thu Jul 30 17:32:32 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/relaxng/BindStyle.java	Thu Jul 30 17:32:32 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.reader.relaxng;
+ 
+ /**
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/relaxng/ContentModelBinder.java	Thu Jul 30 17:32:36 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/relaxng/ContentModelBinder.java	Thu Jul 30 17:32:36 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.reader.relaxng;
+ 
+ import javax.xml.namespace.QName;
+@@ -101,7 +102,7 @@
+             clazz.addProperty(prop);
+         } else {
+             CReferencePropertyInfo prop = new CReferencePropertyInfo(
+-                    calcName(p),true,false/*TODO*/,null,null,p.getLocation());
++                    calcName(p),true,!optional,false/*TODO*/,null,null,p.getLocation(), false, false, false);
+             rts.addTo(prop);
+             clazz.addProperty(prop);
+         }
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/relaxng/DatatypeLib.java	Thu Jul 30 17:32:40 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/relaxng/DatatypeLib.java	Thu Jul 30 17:32:39 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.reader.relaxng;
+ 
+ import java.util.HashMap;
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/relaxng/DefineFinder.java	Thu Jul 30 17:32:43 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/relaxng/DefineFinder.java	Thu Jul 30 17:32:43 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.reader.relaxng;
+ 
+ import java.util.HashSet;
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/relaxng/NameCalculator.java	Thu Jul 30 17:32:47 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/relaxng/NameCalculator.java	Thu Jul 30 17:32:46 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.reader.relaxng;
+ 
+ import com.sun.xml.internal.rngom.digested.DPatternWalker;
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/relaxng/RELAXNGCompiler.java	Thu Jul 30 17:32:50 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/relaxng/RELAXNGCompiler.java	Thu Jul 30 17:32:50 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.reader.relaxng;
+ 
+ import java.util.ArrayList;
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/relaxng/RawTypeSetBuilder.java	Thu Jul 30 17:32:54 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/relaxng/RawTypeSetBuilder.java	Thu Jul 30 17:32:53 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.reader.relaxng;
+ 
+ import java.util.HashSet;
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/relaxng/TypePatternBinder.java	Thu Jul 30 17:32:57 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/relaxng/TypePatternBinder.java	Thu Jul 30 17:32:57 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.reader.relaxng;
+ 
+ import java.util.HashSet;
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/relaxng/TypeUseBinder.java	Thu Jul 30 17:33:01 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/relaxng/TypeUseBinder.java	Thu Jul 30 17:33:00 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.reader.relaxng;
+ 
+ import com.sun.tools.internal.xjc.model.CBuiltinLeafInfo;
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/Abstractifier.java	Thu Jul 30 17:33:04 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/Abstractifier.java	Thu Jul 30 17:33:04 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.reader.xmlschema;
+ 
+ import com.sun.tools.internal.xjc.model.CElement;
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/BGMBuilder.java	Thu Jul 30 17:33:08 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/BGMBuilder.java	Thu Jul 30 17:33:07 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.reader.xmlschema;
+ 
+ import java.util.ArrayList;
+@@ -73,9 +74,9 @@
+ 
+ /**
+  * Root of the XML Schema binder.
+- * 
++ *
+  * <div><img src="doc-files/binding_chart.png"/></div>
+- * 
++ *
+  * @author Kohsuke Kawaguchi
+  */
+ public class BGMBuilder extends BindingComponent {
+@@ -247,7 +248,7 @@
+      */
+     public @NotNull BIGlobalBinding getGlobalBinding() { return globalBinding; }
+ 
+-    
++
+     private ParticleBinder particleBinder;
+ 
+     /**
+@@ -435,6 +436,9 @@
+      * Gets the {@link BIDom} object that applies to the given particle.
+      */
+     protected final BIDom getLocalDomCustomization( XSParticle p ) {
++        if (p == null) {
++            return null;
++        }
+         BIDom dom = getBindInfo(p).get(BIDom.class);
+         if(dom!=null)  return dom;
+ 
+@@ -549,4 +553,12 @@
+ 
+         return name;
+     }
++
++    public boolean isGenerateMixedExtensions() {
++        if (globalBinding != null) {
++            return globalBinding.isGenerateMixedExtensions();
++        }
++        return false;
++    }
++
+ }
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/BindBlue.java	Thu Jul 30 17:33:12 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/BindBlue.java	Thu Jul 30 17:33:11 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.reader.xmlschema;
+ 
+ import com.sun.xml.internal.xsom.XSAttGroupDecl;
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/BindGreen.java	Thu Jul 30 17:33:15 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/BindGreen.java	Thu Jul 30 17:33:14 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.reader.xmlschema;
+ 
+ import java.util.Iterator;
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/BindPurple.java	Thu Jul 30 17:33:19 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/BindPurple.java	Thu Jul 30 17:33:18 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.reader.xmlschema;
+ 
+ import com.sun.tools.internal.xjc.model.CClassInfo;
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/BindRed.java	Thu Jul 30 17:33:22 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/BindRed.java	Thu Jul 30 17:33:21 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.reader.xmlschema;
+ 
+ import com.sun.tools.internal.xjc.reader.Ring;
+@@ -48,21 +49,10 @@
+ 
+     private final ComplexTypeFieldBuilder ctBuilder = Ring.get(ComplexTypeFieldBuilder.class);
+ 
+-
+-
+-
+-
+-
+-
+-
+-
+-
+     public void complexType(XSComplexType ct) {
+         ctBuilder.build(ct);
+     }
+ 
+-
+-
+     public void wildcard(XSWildcard xsWildcard) {
+         // TODO: implement this method later
+         // I guess we might allow this to be mapped to a generic element property ---
+@@ -85,8 +75,6 @@
+         stb.refererStack.pop();
+     }
+ 
+-
+-
+ /*
+     Components that can never be mapped to a class
+ */
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/BindYellow.java	Thu Jul 30 17:33:26 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/BindYellow.java	Thu Jul 30 17:33:25 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.reader.xmlschema;
+ 
+ import com.sun.xml.internal.xsom.XSAttGroupDecl;
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/BindingComponent.java	Thu Jul 30 17:33:29 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/BindingComponent.java	Thu Jul 30 17:33:29 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.reader.xmlschema;
+ 
+ import com.sun.tools.internal.xjc.reader.Ring;
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ClassBinderFilter.java	Thu Jul 30 17:33:33 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ClassBinderFilter.java	Thu Jul 30 17:33:32 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.reader.xmlschema;
+ 
+ import com.sun.tools.internal.xjc.model.CElement;
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/CollisionInfo.java	Thu Jul 30 17:33:36 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/CollisionInfo.java	Thu Jul 30 17:33:36 2009
+@@ -22,11 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * @(#)$Id: CollisionInfo.java,v 1.1 2005/04/15 20:09:53 kohsuke Exp $
+- */
+-
+-
+ package com.sun.tools.internal.xjc.reader.xmlschema;
+ 
+ import org.xml.sax.Locator;
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ColorBinder.java	Thu Jul 30 17:33:40 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ColorBinder.java	Thu Jul 30 17:33:39 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.reader.xmlschema;
+ 
+ import com.sun.tools.internal.xjc.model.CClassInfo;
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/DefaultParticleBinder.java	Thu Jul 30 17:33:43 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/DefaultParticleBinder.java	Thu Jul 30 17:33:43 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.reader.xmlschema;
+ 
+ import java.util.ArrayList;
+@@ -58,9 +59,9 @@
+         if(checker.hasNameCollision()) {
+             CReferencePropertyInfo prop = new CReferencePropertyInfo(
+                 getCurrentBean().getBaseClass()==null?"Content":"Rest",
+-                true, false, p,
++                true, false, false, p,
+                 builder.getBindInfo(p).toCustomizationList(),
+-                p.getLocator() );
++                p.getLocator(), false, false, false);
+             RawTypeSetBuilder.build(p,false).addTo(prop);
+             prop.javadoc = Messages.format( Messages.MSG_FALLBACK_JAVADOC,
+                     checker.getCollisionInfo().toString() );
+@@ -170,6 +171,12 @@
+         }
+ 
+         public void modelGroup(XSModelGroup mg) {
++            // choice gets mapped to a property
++            if(mg.getCompositor()== XSModelGroup.Compositor.CHOICE && builder.getGlobalBinding().isChoiceContentPropertyEnabled()) {
++                mark(outerParticle);
++                return;
++            }
++
+             for( XSParticle child : mg.getChildren() )
+                 particle(child);
+         }
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ExpressionBuilder.java	Thu Jul 30 17:33:47 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ExpressionBuilder.java	Thu Jul 30 17:33:46 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.reader.xmlschema;
+ 
+ import java.util.HashMap;
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ExpressionParticleBinder.java	Thu Jul 30 17:33:50 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ExpressionParticleBinder.java	Thu Jul 30 17:33:50 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.reader.xmlschema;
+ 
+ import java.util.Collection;
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/GElement.java	Thu Jul 30 17:33:54 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/GElement.java	Thu Jul 30 17:33:53 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.reader.xmlschema;
+ 
+ import java.util.HashSet;
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/GElementImpl.java	Thu Jul 30 17:33:57 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/GElementImpl.java	Thu Jul 30 17:33:57 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.reader.xmlschema;
+ 
+ import javax.xml.namespace.QName;
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/GWildcardElement.java	Thu Jul 30 17:34:01 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/GWildcardElement.java	Thu Jul 30 17:34:00 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.reader.xmlschema;
+ 
+ import com.sun.tools.internal.xjc.reader.gbind.Element;
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/MessageBundle.properties	Thu Jul 30 17:34:04 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/MessageBundle.properties	Thu Jul 30 17:34:04 2009
+@@ -30,61 +30,66 @@
+ 
+ 
+ BGMBuilder.NoGlobalElement = \
+-	Schema contains no global element declaration.
++        Schema contains no global element declaration.
+ 
++UnusedCustomizationChecker.WarnUnusedExpectedContentTypes = \
++    An xmime:expectedContentTypes attribute is present on an incorrect element
++
+ BGMBuilder.MultipleSchemaBindings = \
+-	Multiple <schemaBindings> are defined for the target namespace "{0}"
++        Multiple <schemaBindings> are defined for the target namespace "{0}"
+ 
+ BGMBuilder.MultipleSchemaBindings.Location = \
+-	Another <schemaBindings> is defined here
++        Another <schemaBindings> is defined here
+ 
+ 
+ 
+ ClassSelector.ClassNameIsRequired = \
+-	Cannot derive a name from schema. A name attribute specified to the <class> customization.
++        Cannot derive a name from schema. A name attribute specified to the <class> customization.
+ 
+ ClassSelector.IncorrectClassName = \
+-	Specified name ''{0}'' is not a valid Java identifier.
++        Specified name ''{0}'' is not a valid Java identifier.
+ 
+ ClassSelector.IncorrectPackageName = \
+-	The package name ''{1}'' used for this schema is not a valid package name.
++        The package name ''{1}'' used for this schema is not a valid package name.
+ 
+ ClassSelector.JavadocHeading = \
+-	<p>Java class for {0}.\n\n<p>The following schema fragment specifies the expected \
+-	content contained within this class.
++        <p>Java class for {0}.\n\n<p>The following schema fragment specifies the expected \
++        content contained within this class.
+ 
+ ClassSelector.JavadocLineUnknown = \
+-	unknown
++        unknown
+ 
+ ClassSelector.ReservedClassName = \
+-	Attempt to create a class having the same name as the reserved word "{0}".
++        Attempt to create a class having the same name as the reserved word "{0}".
+ 
+ 
+ CollisionInfo.CollisionInfo = \
+-	The field name "{0}" is used by two different parts of a schema. See: \n\
+-	{1}\n\
+-	{2}
++        The field name "{0}" is used by two different parts of a schema. See: \n\
++        {1}\n\
++        {2}
+ 
+ CollisionInfo.UnknownFile = \
+-	unknown file
++        unknown file
+ 
+ CollisionInfo.LineXOfY = \
+-	line {0} of {1}
++        line {0} of {1}
+ 
+ 
+ ConversionFinder.CannotBeTypeSafeEnum = \
+-	A type safe enum customization is specified to a simple type that cannot \
+-	be mapped to a type safe enum.
++        A type safe enum customization is specified to a simple type that cannot \
++        be mapped to a type safe enum.
+ ConversionFinder.CannotBeTypeSafeEnum.Location = \
+-	Ths relevant simple type declaration is specified at this location
++        Ths relevant simple type declaration is specified at this location
+ ConversionFinder.NoEnumNameAvailable = \
+-	A name attribute is required to customize an anonymous simple type to type-safe enum.
++        A name attribute is required to customize an anonymous simple type to type-safe enum.
++ConversionFinder.NoEnumFacet= \
++    enum class customization is specified on a type that has no enumeration facet.
+ ERR_ILLEGAL_EXPECTED_MIME_TYPE = \
+-    Unable to parse the expected MIME type "{0}". {1}. 
++    Unable to parse the expected MIME type "{0}". {1}.
+ 
+ 
+ DatatypeBuilder.DatatypeError = \
+-	Simple type error: {0}
++        Simple type error: {0}
+ 
+ 
+ 
+@@ -92,17 +97,17 @@
+ 
+ 
+ DefaultParticleBinder.UnableToGenerateNameFromModelGroup = \
+-	Unable to generate a property name from a model group. A customization is required.
++        Unable to generate a property name from a model group. A customization is required.
+ 
+ DefaultParticleBinder.FallbackJavadoc = \
+-	Gets the rest of the content model. \n\
+-	\n\
+-	<p>\n\
+-	You are getting this "catch-all" property because of the following reason: \n\
+-	{0}\n\
+-	<p>\n\
+-	To get rid of this property, apply a property customization to one \n\
+-	of both of the following declarations to change their names: \n
++        Gets the rest of the content model. \n\
++        \n\
++        <p>\n\
++        You are getting this "catch-all" property because of the following reason: \n\
++        {0}\n\
++        <p>\n\
++        To get rid of this property, apply a property customization to one \n\
++        of both of the following declarations to change their names: \n
+ 
+ 
+ 
+@@ -111,30 +116,30 @@
+ 
+ 
+ FieldBuilder.IncorrectFixedValue = \
+-	The value specified in the fixed attribute "{0}" is not a valid value for the datatype
++        The value specified in the fixed attribute "{0}" is not a valid value for the datatype
+ 
+ FieldBuilder.IncorrectDefaultValue = \
+-	The value specified in the default attribute "{0}" is not a valid value for the datatype
++        The value specified in the default attribute "{0}" is not a valid value for the datatype
+ 
+ FieldBuilder.ConflictBetweenUserTypeAndActualType.AttUse = \
+-	"{0}" is specified by a customization but this attribute has incompatible type "{1}"
++        "{0}" is specified by a customization but this attribute has incompatible type "{1}"
+ 
+ FieldBuilder.ConflictBetweenUserTypeAndActualType.AttUse.Source = \
+-	The relevant customization is specified	at this location
++        The relevant customization is specified at this location
+ 
+ FieldBuilder.Javadoc.NilProperty = \
+-	This property is used to control \
+-	<a href="http://www.w3.org/TR/2001/REC-xmlschema-0-20010502/#Nils">the xsi:nil feature</a> \
+-	of W3C XML Schema. \nSetting this property to true will cause \
+-	the output to be &lt;{0} xsi:nil="true" /> regardless of the \
+-	values of the other properties.
++        This property is used to control \
++        <a href="http://www.w3.org/TR/2001/REC-xmlschema-0-20010502/#Nils">the xsi:nil feature</a> \
++        of W3C XML Schema. \nSetting this property to true will cause \
++        the output to be &lt;{0} xsi:nil="true" /> regardless of the \
++        values of the other properties.
+ 
+ FieldBuilder.Javadoc.ValueObject = \
+-	get/set the complex type value associated with this element.\n \
+-	when you unmarshal a document that contains xsi:type, the get{1} method \
+-	would return an instance of derived classes of '{'@link {0}'}'. Similarly, if you set \
+-	an instance of derived classes, then you would get the instance with xsi:type \
+-	when you marshal out to XML.
++        get/set the complex type value associated with this element.\n \
++        when you unmarshal a document that contains xsi:type, the get{1} method \
++        would return an instance of derived classes of '{'@link {0}'}'. Similarly, if you set \
++        an instance of derived classes, then you would get the instance with xsi:type \
++        when you marshal out to XML.
+ 
+ 
+ SimpleTypeBuilder.UnnestedJavaTypeCustomization = \
+@@ -146,11 +151,11 @@
+     \t</property>
+ 
+ UnusedCustomizationChecker.UnacknolwedgedCustomization = \
+-	compiler was unable to honor this {0} customization. It is attached to a wrong place, \
+-	or it's inconsistent with other bindings.
++        compiler was unable to honor this {0} customization. It is attached to a wrong place, \
++        or it's inconsistent with other bindings.
+ 
+ UnusedCustomizationChecker.UnacknolwedgedCustomization.Relevant = \
+-	(the above customization is attached to the following location in the schema)
++        (the above customization is attached to the following location in the schema)
+ 
+ ERR_ENUM_MEMBER_NAME_COLLISION = \
+     Two enum members yield the same constant name {0}
+@@ -160,7 +165,7 @@
+ 
+ ERR_CANNOT_GENERATE_ENUM_NAME = \
+     Cannot generate a constant name from the enumeration value "{0}". \
+-    Use <jaxb:typesafeEnumMember name="..."/> to specify one. 
++    Use <jaxb:typesafeEnumMember name="..."/> to specify one.
+ 
+ ERR_MULTIPLE_GLOBAL_BINDINGS = \
+     only one globalBindings customization is allowed in a whole compilation
+@@ -178,4 +183,3 @@
+ 
+ ERR_REFERENCE_TO_NONEXPORTED_CLASS_REFERER = \
+     (related to above) The problematic schema component is referenced from this component: {0}
+- 
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/Messages.java	Thu Jul 30 17:34:08 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/Messages.java	Thu Jul 30 17:34:07 2009
+@@ -43,6 +43,9 @@
+     static final String WARN_NO_GLOBAL_ELEMENT =
+         "BGMBuilder.NoGlobalElement";
+ 
++    public static final String WARN_UNUSED_EXPECTED_CONTENT_TYPES =
++        "UnusedCustomizationChecker.WarnUnusedExpectedContentTypes";
++
+     static final String ERR_MULTIPLE_SCHEMA_BINDINGS =
+         "BGMBuilder.MultipleSchemaBindings"; // arg:1
+ 
+@@ -73,6 +76,9 @@
+     static final String ERR_NO_ENUM_NAME_AVAILABLE =
+         "ConversionFinder.NoEnumNameAvailable"; // arg:0
+ 
++    static final String ERR_NO_ENUM_FACET =
++        "ConversionFinder.NoEnumFacet"; // arg:0
++
+     static final String ERR_ILLEGAL_EXPECTED_MIME_TYPE =
+         "ERR_ILLEGAL_EXPECTED_MIME_TYPE"; // args:2
+ 
+@@ -102,7 +108,7 @@
+ 
+     static final String JAVADOC_LINE_UNKNOWN = // 0 args
+         "ClassSelector.JavadocLineUnknown";
+-    
++
+     static final String JAVADOC_VALUEOBJECT_PROPERTY =
+         "FieldBuilder.Javadoc.ValueObject"; // args:2
+ 
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/MultiplicityCounter.java	Thu Jul 30 17:34:11 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/MultiplicityCounter.java	Thu Jul 30 17:34:11 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.reader.xmlschema;
+ 
+ import com.sun.tools.internal.xjc.model.Multiplicity;
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/RawTypeSetBuilder.java	Thu Jul 30 17:34:15 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/RawTypeSetBuilder.java	Thu Jul 30 17:34:14 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.reader.xmlschema;
+ 
+ import java.util.HashSet;
+@@ -275,7 +276,12 @@
+             if(parent.refs.size() > 1 && p.getAdapter() != null)
+                 return RawTypeSet.Mode.MUST_BE_REFERENCE;
+ 
+-            return RawTypeSet.Mode.SHOULD_BE_TYPEREF;
++            if(target.hasClass())
++                // if the CElementInfo was explicitly bound to a class (which happen if and only if
++                // the user requested so, then map that to reference property so that the user sees a class
++                return RawTypeSet.Mode.CAN_BE_TYPEREF;
++            else
++                return RawTypeSet.Mode.SHOULD_BE_TYPEREF;
+         }
+ 
+         protected boolean isListOfValues() {
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/RefererFinder.java	Thu Jul 30 17:34:18 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/RefererFinder.java	Thu Jul 30 17:34:18 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.reader.xmlschema;
+ 
+ import java.util.HashMap;
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/SimpleTypeBuilder.java	Thu Jul 30 17:34:22 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/SimpleTypeBuilder.java	Thu Jul 30 17:34:21 2009
+@@ -51,6 +51,7 @@
+ import com.sun.tools.internal.xjc.model.Model;
+ import com.sun.tools.internal.xjc.model.TypeUse;
+ import com.sun.tools.internal.xjc.model.TypeUseFactory;
++import com.sun.tools.internal.xjc.reader.Const;
+ import com.sun.tools.internal.xjc.reader.Ring;
+ import com.sun.tools.internal.xjc.reader.xmlschema.bindinfo.BIConversion;
+ import com.sun.tools.internal.xjc.reader.xmlschema.bindinfo.BIEnum;
+@@ -122,6 +123,13 @@
+     public final Stack<XSComponent> refererStack = new Stack<XSComponent>();
+ 
+     /**
++     * Records what xmime:expectedContentTypes annotations we honored and processed,
++     * so that we can later check if the user had these annotations in the places
++     * where we didn't anticipate them.
++     */
++    private final Set<XSComponent> acknowledgedXmimeContentTypes = new HashSet<XSComponent>();
++
++    /**
+      * The type that was originally passed to this {@link SimpleTypeBuilder#build(XSSimpleType)}.
+      * Never null.
+      */
+@@ -289,7 +297,7 @@
+         public TypeUse unionSimpleType(XSUnionSimpleType type) {
+             boolean isCollection = false;
+             for( int i=0; i<type.getMemberSize(); i++ )
+-                if(type.getMember(i).getVariety()==XSVariety.LIST) {
++                if(type.getMember(i).getVariety()==XSVariety.LIST || type.getMember(i).getVariety()==XSVariety.UNION) {
+                     isCollection = true;
+                     break;
+                 }
+@@ -369,6 +377,15 @@
+         }
+ 
+ 
++//        // Issue 558 .. ugly fix; see https://wsit-docs.dev.java.net/releases/1-0-FCS/DataBinding5.html and https://jaxb.dev.java.net/issues/show_bug.cgi?id=558
++//        // need to check specification
++//        if (type.isSimpleType() && builder.getGlobalBinding().isSimpleTypeSubstitution() &&
++//                type.isGlobal() && type.getName() != null &&
++//                (type.getName().equals("unsignedInt") || type.getName().equals("unsignedShort") || type.getName().equals("unsignedByte"))) {
++//                // !type.getName().equals("anySimpleType") && !type.getName().equals("string")) {
++//            return (CNonElement) getClassSelector()._bindToClass(type, type.getSimpleBaseType(), false);
++//        }
++
+         // if the type is built in, look for the default binding
+         if(type.getTargetNamespace().equals(WellKnownNamespace.XML_SCHEMA)) {
+             String name = type.getName();
+@@ -584,6 +601,10 @@
+                 break;
+             }
+         }
++        if(memberList.isEmpty()) {
++            getErrorReporter().error( loc, Messages.ERR_NO_ENUM_FACET );
++            return null;
++        }
+ 
+         // use the name of the simple type as the name of the class.
+         CClassInfoParent scope;
+@@ -616,10 +637,15 @@
+     private List<CEnumConstant> buildCEnumConstants(XSRestrictionSimpleType type, boolean needsToGenerateMemberName, Map<String, BIEnumMember> members, XSFacet[] errorRef) {
+         List<CEnumConstant> memberList = new ArrayList<CEnumConstant>();
+         int idx=1;
++        Set<String> enums = new HashSet<String>(); // to avoid duplicates. See issue #366
++
+         for( XSFacet facet : type.getDeclaredFacets(XSFacet.FACET_ENUMERATION)) {
+             String name=null;
+-            String mdoc=null;
++            String mdoc=builder.getBindInfo(facet).getDocumentation();
+ 
++            if(!enums.add(facet.getValue().value))
++                continue;   // ignore the 2nd occasion
++
+             if( needsToGenerateMemberName ) {
+                 // generate names for all member names.
+                 // this will even override names specified by the user. that's crazy.
+@@ -739,8 +765,9 @@
+      */
+     private TypeUse lookupBinaryTypeBinding() {
+         XSComponent referer = getReferer();
+-        String emt = referer.getForeignAttribute(XML_MIME_URI,"expectedContentTypes");
++        String emt = referer.getForeignAttribute(XML_MIME_URI, Const.EXPECTED_CONTENT_TYPES);
+         if(emt!=null) {
++            acknowledgedXmimeContentTypes.add(referer);
+             try {
+                 // see http://www.xml.com/lpt/a/2004/07/21/dive.html
+                 List<MimeTypeRange> types = MimeTypeRange.parseRanges(emt);
+@@ -772,6 +799,10 @@
+         return CBuiltinLeafInfo.BASE64_BYTE_ARRAY;
+     }
+ 
++    public boolean isAcknowledgedXmimeContentTypes(XSComponent c) {
++        return acknowledgedXmimeContentTypes.contains(c);
++    }
++
+     /**
+      * Returns true if the specified sub-type is an XML type.
+      */
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/UnusedCustomizationChecker.java	Thu Jul 30 17:34:26 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/UnusedCustomizationChecker.java	Thu Jul 30 17:34:25 2009
+@@ -29,8 +29,10 @@
+ import java.util.Map;
+ import java.util.Set;
+ 
++import com.sun.tools.internal.xjc.reader.Const;
+ import com.sun.tools.internal.xjc.reader.Ring;
+ import com.sun.tools.internal.xjc.reader.xmlschema.bindinfo.BIDeclaration;
++import com.sun.xml.internal.bind.v2.WellKnownNamespace;
+ import com.sun.xml.internal.xsom.XSAnnotation;
+ import com.sun.xml.internal.xsom.XSAttContainer;
+ import com.sun.xml.internal.xsom.XSAttGroupDecl;
+@@ -59,12 +61,18 @@
+ 
+ /**
+  * Reports all unacknowledged customizations as errors.
+- * 
++ *
++ * <p>
++ * Since we scan the whole content tree, we use this to check for unused
++ * <tt>xmime:expectedContentTypes</tt> attributes. TODO: if we find this kind of error checks more
++ * common, use the visitors so that we don't have to mix everything in one class.
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+ class UnusedCustomizationChecker extends BindingComponent implements XSVisitor, XSSimpleTypeVisitor {
+     private final BGMBuilder builder = Ring.get(BGMBuilder.class);
++    private final SimpleTypeBuilder stb = Ring.get(SimpleTypeBuilder.class);
+ 
+     private final Set<XSComponent> visitedComponents = new HashSet<XSComponent>();
+ 
+@@ -83,7 +91,7 @@
+             run( s.getSimpleTypes() );
+         }
+     }
+-    
++
+     private void run( Map<String,? extends XSComponent> col ) {
+         for( XSComponent c : col.values() )
+             c.visit(this);
+@@ -102,9 +110,24 @@
+         for( BIDeclaration decl : builder.getBindInfo(c).getDecls() )
+             check(decl, c);
+ 
++        checkExpectedContentTypes(c);
++
+         return true;
+     }
+ 
++    private void checkExpectedContentTypes(XSComponent c) {
++        if(c.getForeignAttribute(WellKnownNamespace.XML_MIME_URI, Const.EXPECTED_CONTENT_TYPES)==null)
++            return; // no such attribute
++        if(c instanceof XSParticle)
++            return; // particles get the same foreign attributes as local element decls,
++                    // so we need to skip them
++
++        if(!stb.isAcknowledgedXmimeContentTypes(c)) {
++            // this is not used
++            getErrorReporter().warning(c.getLocator(),Messages.WARN_UNUSED_EXPECTED_CONTENT_TYPES);
++        }
++    }
++
+     private void check(BIDeclaration decl, XSComponent c) {
+         if( !decl.isAcknowledged() ) {
+             getErrorReporter().error(
+@@ -125,7 +148,7 @@
+ 
+ 
+     public void annotation(XSAnnotation ann) {}
+-    
++
+     public void attGroupDecl(XSAttGroupDecl decl) {
+         if(check(decl))
+             attContainer(decl);
+@@ -149,14 +172,14 @@
+             attContainer(type);
+         }
+     }
+-    
++
+     private void attContainer( XSAttContainer cont ) {
+         for( Iterator itr = cont.iterateAttGroups(); itr.hasNext(); )
+             ((XSAttGroupDecl)itr.next()).visit(this);
+-            
++
+         for( Iterator itr = cont.iterateDeclaredAttributeUses(); itr.hasNext(); )
+             ((XSAttributeUse)itr.next()).visit(this);
+-        
++
+         XSWildcard wc = cont.getAttributeWildcard();
+         if(wc!=null)        wc.visit(this);
+     }
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/AbstractDeclarationImpl.java	Thu Jul 30 17:34:29 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/AbstractDeclarationImpl.java	Thu Jul 30 17:34:28 2009
+@@ -37,13 +37,13 @@
+ 
+ /**
+  * Abstract partial implementation of {@link BIDeclaration}
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+ abstract class AbstractDeclarationImpl implements BIDeclaration {
+ 
+-    @Deprecated // eventually delete this in favor of using JAXB    
++    @Deprecated // eventually delete this in favor of using JAXB
+     protected AbstractDeclarationImpl(Locator loc) {
+         this.loc = loc;
+     }
+@@ -54,7 +54,7 @@
+     @XmlLocation
+     Locator loc;    // set by JAXB
+     public Locator getLocation() { return loc; }
+-    
++
+     protected BindInfo parent;
+     public void setParent(BindInfo p) { this.parent=p; }
+ 
+@@ -70,7 +70,7 @@
+ 
+ 
+     private boolean isAcknowledged = false;
+-    
++
+     public final boolean isAcknowledged() { return isAcknowledged; }
+ 
+     public void onSetOwner() {
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/AnnotationParserFactoryImpl.java	Thu Jul 30 17:34:33 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/AnnotationParserFactoryImpl.java	Thu Jul 30 17:34:32 2009
+@@ -31,11 +31,11 @@
+ import javax.xml.validation.ValidatorHandler;
+ 
+ import com.sun.tools.internal.xjc.Options;
+-import com.sun.tools.internal.xjc.SchemaCache;
+ import com.sun.tools.internal.xjc.reader.Const;
+ import com.sun.xml.internal.xsom.parser.AnnotationContext;
+ import com.sun.xml.internal.xsom.parser.AnnotationParser;
+ import com.sun.xml.internal.xsom.parser.AnnotationParserFactory;
++import com.sun.xml.internal.bind.v2.WellKnownNamespace;
+ 
+ import org.xml.sax.Attributes;
+ import org.xml.sax.ContentHandler;
+@@ -42,12 +42,13 @@
+ import org.xml.sax.EntityResolver;
+ import org.xml.sax.ErrorHandler;
+ import org.xml.sax.SAXException;
++import org.xml.sax.SAXParseException;
+ import org.xml.sax.helpers.XMLFilterImpl;
+ 
+ /**
+  * Implementation of XSOM {@link AnnotationParserFactory} that
+  * parses JAXB customization declarations.
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+@@ -102,11 +103,22 @@
+                             validator.setErrorHandler(errorHandler);
+                             startForking(uri,localName,qName,atts,new ValidatorProtecter(validator));
+                         }
++
++                        // check for xmime:expectedContentTypes attributes in annotations and report them
++                        for( int i=atts.getLength()-1; i>=0; i-- ) {
++                            if(atts.getURI(i).equals(WellKnownNamespace.XML_MIME_URI)
++                            && atts.getLocalName(i).equals(Const.EXPECTED_CONTENT_TYPES))
++                                errorHandler.warning(new SAXParseException(
++                                    com.sun.tools.internal.xjc.reader.xmlschema.Messages.format(
++                                        com.sun.tools.internal.xjc.reader.xmlschema.Messages.WARN_UNUSED_EXPECTED_CONTENT_TYPES),
++                                    getDocumentLocator()
++                                ));
++                        }
+                     }
+                 };
+             }
+ 
+-            public Object getResult( Object existing ) {
++            public BindInfo getResult( Object existing ) {
+                 if(handler==null)
+                     // interface contract violation.
+                     // the getContentHandler method must have been called.
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BIClass.java	Thu Jul 30 17:34:40 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BIClass.java	Thu Jul 30 17:34:39 2009
+@@ -35,13 +35,13 @@
+ 
+ /**
+  * Class declaration.
+- * 
++ *
+  * This customization turns arbitrary schema component into a Java
+  * content interface.
+- * 
++ *
+  * <p>
+  * This customization is acknowledged by the ClassSelector.
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+@@ -121,4 +121,3 @@
+     /** Name of this declaration. */
+     public static final QName NAME = new QName( Const.JAXB_NSURI, "class" );
+ }
+-
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BIConversion.java	Thu Jul 30 17:34:43 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BIConversion.java	Thu Jul 30 17:34:43 2009
+@@ -58,11 +58,11 @@
+ 
+ /**
+  * Conversion declaration.
+- * 
++ *
+  * <p>
+  * A conversion declaration specifies how an XML type gets mapped
+  * to a Java type.
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+@@ -89,7 +89,7 @@
+     public abstract TypeUse getTypeUse( XSSimpleType owner );
+ 
+     public QName getName() { return NAME; }
+-    
++
+     /** Name of the conversion declaration. */
+     public static final QName NAME = new QName(
+         Const.JAXB_NSURI, "conversion" );
+@@ -233,7 +233,7 @@
+ 
+                 // RESULT: <value>.<method>()
+                 inv = $value.invoke(printMethod);
+-                
++
+                 // check value is not null ... if(value == null) return null;
+                 JConditional jcon = marshal.body()._if($value.eq(JExpr._null()));
+                 jcon._then()._return(JExpr._null());
+@@ -254,9 +254,11 @@
+         private String printMethodFor(XSSimpleType owner) {
+             if(printMethod!=null)   return printMethod;
+ 
+-            String method = getConversionMethod("print",owner);
+-            if(method!=null)
+-                return method;
++            if(inMemoryType.unboxify().isPrimitive()) {
++                String method = getConversionMethod("print",owner);
++                if(method!=null)
++                    return method;
++            }
+ 
+             return "toString";
+         }
+@@ -264,10 +266,12 @@
+         private String parseMethodFor(XSSimpleType owner) {
+             if(parseMethod!=null)   return parseMethod;
+ 
+-            String method = getConversionMethod("parse", owner);
+-            if(method!=null) {
+-                // this cast is necessary for conversion between primitive Java types
+-                return '('+inMemoryType.unboxify().fullName()+')'+method;
++            if(inMemoryType.unboxify().isPrimitive()) {
++                String method = getConversionMethod("parse", owner);
++                if(method!=null) {
++                    // this cast is necessary for conversion between primitive Java types
++                    return '('+inMemoryType.unboxify().fullName()+')'+method;
++                }
+             }
+ 
+             return "new";
+@@ -342,4 +346,3 @@
+         }
+     }
+ }
+-
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BIDeclaration.java	Thu Jul 30 17:34:47 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BIDeclaration.java	Thu Jul 30 17:34:46 2009
+@@ -34,16 +34,16 @@
+ 
+ /**
+  * Base interface for all binding customization declarations.
+- * 
++ *
+  * <p>
+  * Because of the setParent method, one customization declaration
+  * can be attached to one component alone.
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+ public interface BIDeclaration {
+-    
++
+     /**
+      * Sets the parent BindInfo object of this declaration.
+      * A declaration object can use this pointer to access
+@@ -56,13 +56,13 @@
+      * populated {@link BIDeclaration}.
+      */
+     void setParent( BindInfo parent );
+-    
++
+     /**
+      * Gets the name of this binding declaration,
+      * which is the same as the tag name of the binding element.
+      */
+     QName getName();
+-    
++
+     /**
+      * Gets the source location where this declaration was written.
+      * For declarations that are generated by XJC itself,
+@@ -69,18 +69,18 @@
+      * this method returns null.
+      */
+     Locator getLocation();
+-    
++
+     /**
+      * Marks this declaration to be acknowledged -- either actually
+      * used or the existence is admitted (for example when
+      * a property customization is given at the point of definition.)
+-     * 
++     *
+      * <p>
+      * Declarations that are not acknowledged will be considered
+      * as an error.
+      */
+     void markAsAcknowledged();
+-    
++
+     /**
+      * Checks if this declaration was acknowledged.
+      */
+@@ -102,4 +102,3 @@
+      */
+     Collection<BIDeclaration> getChildren();
+ }
+-
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BIDom.java	Thu Jul 30 17:34:50 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BIDom.java	Thu Jul 30 17:34:50 2009
+@@ -44,7 +44,7 @@
+     String type;
+ 
+     public final QName getName() { return NAME; }
+-    
++
+     /** Name of the conversion declaration. */
+     public static final QName NAME = new QName(Const.JAXB_NSURI,"dom");
+ }
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BIEnum.java	Thu Jul 30 17:34:54 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BIEnum.java	Thu Jul 30 17:34:53 2009
+@@ -41,16 +41,16 @@
+  * <p>
+  * This customization binds a simple type to a type-safe enum class.
+  * The actual binding process takes place in {@link SimpleTypeBuilder}.
+- * 
++ *
+  * <p>
+  * This customization is acknowledged by {@link SimpleTypeBuilder}.
+- * 
++ *
+  * @author
+  *  Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+ @XmlRootElement(name="typesafeEnumClass")
+ public final class BIEnum extends AbstractDeclarationImpl {
+-    
++
+     /**
+      * If false, it means not to bind to a type-safe enum.
+      *
+@@ -90,7 +90,7 @@
+     public final Map<String,BIEnumMember> members = new HashMap<String,BIEnumMember>();
+ 
+     public QName getName() { return NAME; }
+-    
++
+     public void setParent(BindInfo p) {
+         super.setParent(p);
+         for( BIEnumMember mem : members.values() )
+@@ -101,7 +101,7 @@
+         if(ref!=null)
+             markAsAcknowledged();
+     }
+-    
++
+     /** Name of this declaration. */
+     public static final QName NAME = new QName(
+         Const.JAXB_NSURI, "enum" );
+@@ -126,4 +126,3 @@
+         String value;
+     }
+ }
+-
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BIEnumMember.java	Thu Jul 30 17:34:57 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BIEnumMember.java	Thu Jul 30 17:34:57 2009
+@@ -33,7 +33,7 @@
+ 
+ /**
+  * Enumeration member customization.
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BIGlobalBinding.java	Thu Jul 30 17:35:01 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BIGlobalBinding.java	Thu Jul 30 17:35:00 2009
+@@ -56,19 +56,19 @@
+ 
+ /**
+  * Global binding customization. The code is highly temporary.
+- * 
++ *
+  * <p>
+  * One of the information contained in a global customization
+  * is the default binding for properties. This object contains a
+  * BIProperty object to keep this information.
+- * 
++ *
+  * @author
+  *  Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+ @XmlRootElement(name="globalBindings")
+ public final class BIGlobalBinding extends AbstractDeclarationImpl {
+-    
+ 
++
+     /**
+      * Gets the name converter that will govern the XML->Java
+      * name conversion process for this compilation.
+@@ -120,6 +120,10 @@
+         return generateElementClass;
+     }
+ 
++    public boolean isGenerateMixedExtensions() {
++        return generateMixedExtensions;
++    }
++
+     public boolean isChoiceContentPropertyEnabled() {
+         return choiceContentProperty;
+     }
+@@ -199,7 +203,7 @@
+     /*package*/ boolean isJavaNamingConventionEnabled = true;
+ 
+     /**
+-     * True to generate classes for every simple type. 
++     * True to generate classes for every simple type.
+      */
+     @XmlAttribute(name="mapSimpleTypeDef")
+     boolean simpleTypeSubstitution = false;
+@@ -285,6 +289,9 @@
+     @XmlAttribute
+     boolean generateElementClass = false;
+ 
++    @XmlAttribute
++    boolean generateMixedExtensions = false;
++
+     @XmlElement(namespace=Const.XJC_EXTENSION_URI)
+     Boolean generateElementProperty = null;
+ 
+@@ -384,7 +391,7 @@
+      */
+     public BIGlobalBinding() {
+     }
+-    
++
+     public void setParent(BindInfo parent) {
+         super.setParent(parent);
+         // fill in the remaining default values
+@@ -405,7 +412,7 @@
+ 
+             QName name = e.getKey();
+             BIConversion conv = e.getValue();
+-            
++
+             XSSimpleType st = schema.getSimpleType(name.getNamespaceURI(),name.getLocalPart());
+             if(st==null) {
+                 Ring.get(ErrorReceiver.class).error(
+@@ -414,16 +421,16 @@
+                 );
+                 continue; // abort
+             }
+-            
++
+             getBuilder().getOrCreateBindInfo(st).addDecl(conv);
+         }
+     }
+-    
+-    
++
++
+     /**
+      * Checks if the given XML Schema built-in type can be mapped to
+      * a type-safe enum class.
+-     * 
++     *
+      * @param typeName
+      */
+     public boolean canBeMappedToTypeSafeEnum( QName typeName ) {
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BIProperty.java	Thu Jul 30 17:35:04 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BIProperty.java	Thu Jul 30 17:35:04 2009
+@@ -77,10 +77,10 @@
+ 
+ /**
+  * Property customization.
+- * 
++ *
+  * This customization turns an arbitrary schema component
+  * into a Java property (some restrictions apply.)
+- * 
++ *
+  * <p>
+  * All the getter methods (such as <code>getBaseType</code> or
+  * <code>getBindStyle</code>) honors the delegation chain of
+@@ -88,27 +88,27 @@
+  * if two property customizations are attached to an attribute
+  * use and an attribute decl, then anything unspecified in the
+  * attribute use defaults to attribute decl.
+- * 
++ *
+  * <p>
+  * Property customizations are acknowledged
+  * (1) when they are actually used, and
+  * (2) when they are given at the component, which is mapped to a class.
+  *     (so-called "point of declaration" customization)
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+ @XmlRootElement(name="property")
+ public final class BIProperty extends AbstractDeclarationImpl {
+-    
++
+     // can be null
+     @XmlAttribute
+     private String name = null;
+-    
++
+     // can be null
+     @XmlElement
+     private String javadoc = null;
+-    
++
+     // can be null
+     @XmlElement
+     private BaseTypeBean baseType = null;
+@@ -150,21 +150,21 @@
+             baseType.conv.setParent(parent);
+     }
+ 
+-    
+-    
++
++
+     /**
+      * Returns the customized property name.
+-     * 
++     *
+      * This method honors the "enableJavaNamingConvention" customization
+      * and formats the property name accordingly if necessary.
+-     * 
++     *
+      * Thus the caller should <em>NOT</em> apply the XML-to-Java name
+      * conversion algorithm to the value returned from this method.
+-     * 
++     *
+      * @param forConstant
+      *      If the property name is intended for a constant property name,
+      *      set to true. This will change the result
+-     * 
++     *
+      * @return
+      *      This method can return null if the customization doesn't
+      *      specify the name.
+@@ -184,10 +184,10 @@
+         if(next!=null)  return next.getPropertyName(forConstant);
+         else            return null;
+     }
+-    
++
+     /**
+      * Gets the associated javadoc.
+-     * 
++     *
+      * @return
+      *      null if none is specfieid.
+      */
+@@ -194,7 +194,7 @@
+     public String getJavadoc() {
+         return javadoc;
+     }
+-    
++
+     // can be null
+     public JType getBaseType() {
+         if(baseType!=null && baseType.name!=null) {
+@@ -206,8 +206,8 @@
+         if(next!=null)  return next.getBaseType();
+         else            return null;
+     }
+-    
+-    
++
++
+     // can be null
+     @XmlAttribute
+     private CollectionTypeAttribute collectionType = null;
+@@ -257,22 +257,22 @@
+     private Boolean isConstantProperty;
+     /**
+      * Gets the inherited value of the "fixedAttrToConstantProperty" customization.
+-     * 
++     *
+      * <p>
+      * Note that returning true from this method doesn't necessarily mean
+      * that a property needs to be mapped to a constant property.
+      * It just means that it's mapped to a constant property
+      * <b>if an attribute use carries a fixed value.</b>
+-     * 
++     *
+      * <p>
+      * I don't like this semantics but that's what the spec implies.
+      */
+     public boolean isConstantProperty() {
+         if(isConstantProperty!=null)    return isConstantProperty;
+-        
++
+         BIProperty next = getDefault();
+         if(next!=null)      return next.isConstantProperty();
+-        
++
+         // globalBinding always has true or false in this property,
+         // so this can't happen
+         throw new AssertionError();
+@@ -291,7 +291,9 @@
+                 name = JJavaName.getPluralForm(name);
+         }
+ 
+-        return wrapUp(new CValuePropertyInfo(name, source,getCustomizations(source),source.getLocator(), tu, typeName ),source);
++        CValuePropertyInfo prop = wrapUp(new CValuePropertyInfo(name, source, getCustomizations(source), source.getLocator(), tu, typeName), source);
++        BIInlineBinaryData.handle(source, prop);
++        return prop;
+     }
+ 
+     public CAttributePropertyInfo createAttributeProperty( XSAttributeUse use, TypeUse tu ) {
+@@ -320,8 +322,8 @@
+     }
+ 
+     /**
+-     * 
+      *
++     *
+      * @param defaultName
+      *      If the name is not customized, this name will be used
+      *      as the default. Note that the name conversion <b>MUST</b>
+@@ -353,17 +355,48 @@
+ 
+         types.addTo(prop);
+ 
++        BIInlineBinaryData.handle(source.getTerm(), prop);
+         return prop;
+     }
+ 
++    public CReferencePropertyInfo createDummyExtendedMixedReferenceProperty(
++            String defaultName, XSComponent source, RawTypeSet types) {
++            return createReferenceProperty(
++                    defaultName,
++                    false,
++                    source,
++                    types,
++                    true,
++                    true,
++                    false,
++                    true);
++    }
++
++    public CReferencePropertyInfo createContentExtendedMixedReferenceProperty(
++            String defaultName, XSComponent source, RawTypeSet types) {
++            return createReferenceProperty(
++                    defaultName,
++                    false,
++                    source,
++                    types,
++                    true,
++                    false,
++                    true,
++                    true);
++    }
++
+     public CReferencePropertyInfo createReferenceProperty(
+             String defaultName, boolean forConstant, XSComponent source,
+-            RawTypeSet types, boolean isMixed) {
++            RawTypeSet types, boolean isMixed, boolean dummy, boolean content, boolean isMixedExtended) {
+ 
+-        if(!types.refs.isEmpty())
+-            // if this property is empty, don't acknowleedge the customization
+-            // this allows pointless property customization to be reported as an error
+-            markAsAcknowledged();
++        if (types == null) {    // this is a special case where we need to generate content because potential subtypes would need to be able to override what's store inside
++            content = true;
++        } else {
++            if(!types.refs.isEmpty())
++                // if this property is empty, don't acknowleedge the customization
++                // this allows pointless property customization to be reported as an error
++                markAsAcknowledged();
++        }
+         constantPropertyErrorCheck();
+ 
+         String name = getPropertyName(forConstant);
+@@ -371,15 +404,19 @@
+             name = defaultName;
+ 
+         CReferencePropertyInfo prop = wrapUp(
+-            new CReferencePropertyInfo(
+-                name,
+-                types.getCollectionMode().isRepeated()||isMixed,
+-                isMixed, source,
+-                getCustomizations(source), source.getLocator() ),
+-            source);
++                                            new CReferencePropertyInfo(
++                                                name,
++                                                (types == null) ? true : types.getCollectionMode().isRepeated()||isMixed,
++                                                (types == null) ? false : types.isRequired(),
++                                                isMixed,
++                                                source,
++                                                getCustomizations(source), source.getLocator(), dummy, content, isMixedExtended),
++                                        source);
++        if (types != null) {
++            types.addTo(prop);
++        }
+ 
+-        types.addTo(prop);
+-
++        BIInlineBinaryData.handle(source, prop);
+         return prop;
+     }
+ 
+@@ -407,7 +444,7 @@
+         }
+ 
+         if(generateRef) {
+-            return createReferenceProperty(defaultName,forConstant,source,types, false);
++            return createReferenceProperty(defaultName,forConstant,source,types, false, false, false, false);
+         } else {
+             return createElementProperty(defaultName,forConstant,source,types);
+         }
+@@ -522,14 +559,14 @@
+ 
+     public void markAsAcknowledged() {
+         if( isAcknowledged() )  return;
+-        
++
+         // mark the parent as well.
+         super.markAsAcknowledged();
+-        
++
+         BIProperty def = getDefault();
+         if(def!=null)   def.markAsAcknowledged();
+     }
+-    
++
+     private void constantPropertyErrorCheck() {
+         if( isConstantProperty!=null && getOwner()!=null ) {
+             // run additional check on the isCOnstantProperty value.
+@@ -539,7 +576,7 @@
+             // the setParent method associates a customization with the rest of
+             // XSOM object graph, so this is the earliest possible moment where
+             // we can test this.
+-            
++
+             if( !hasFixedValue.find(getOwner()) ) {
+                 Ring.get(ErrorReceiver.class).error(
+                     getLocation(),
+@@ -563,7 +600,7 @@
+         public Boolean attributeUse(XSAttributeUse use) {
+             return use.getFixedValue()!=null;
+         }
+-        
++
+         public Boolean schema(XSSchema s) {
+             // we allow globalBindings to have isConstantProperty==true,
+             // so this method returns true to allow this.
+@@ -570,10 +607,10 @@
+             return true;
+         }
+     };
+-    
++
+     /**
+      * Finds a BIProperty which this object should delegate to.
+-     * 
++     *
+      * @return
+      *      always return non-null for normal BIProperties.
+      *      If this object is contained in the BIGlobalBinding, then
+@@ -585,7 +622,7 @@
+         if(next==this)  return null;    // global.
+         else            return next;
+     }
+-    
++
+     private static BIProperty getDefault( BGMBuilder builder, XSComponent c ) {
+         while(c!=null) {
+             c = c.apply(defaultCustomizationFinder);
+@@ -594,35 +631,35 @@
+                 if(prop!=null)  return prop;
+             }
+         }
+-        
++
+         // default to the global one
+         return builder.getGlobalBinding().getDefaultProperty();
+     }
+-    
+-    
++
++
+     /**
+      * Finds a property customization that describes how the given
+      * component should be mapped to a property (if it's mapped to
+      * a property at all.)
+-     * 
++     *
+      * <p>
+      * Consider an attribute use that does NOT carry a property
+      * customization. This schema component is nonetheless considered
+      * to carry a (sort of) implicit property customization, whose values
+      * are defaulted.
+-     * 
++     *
+      * <p>
+      * This method can be think of the method that returns this implied
+      * property customization.
+-     * 
++     *
+      * <p>
+      * Note that this doesn't mean the given component needs to be
+      * mapped to a property. But if it does map to a property, it needs
+      * to follow this customization.
+-     * 
++     *
+      * I think this semantics is next to non-sense but I couldn't think
+      * of any other way to follow the spec.
+-     * 
++     *
+      * @param c
+      *      A customization effective on this component will be returned.
+      *      Can be null just to get the global customization.
+@@ -637,11 +674,11 @@
+             BIProperty prop = builder.getBindInfo(c).get(BIProperty.class);
+             if(prop!=null)  return prop;
+         }
+-        
++
+         // if no such thing exists, defeault.
+         return getDefault(builder,c);
+     }
+-    
++
+     private final static XSFunction<XSComponent> defaultCustomizationFinder = new XSFunction<XSComponent>() {
+ 
+         public XSComponent attributeUse(XSAttributeUse use) {
+@@ -675,16 +712,16 @@
+         public XSComponent identityConstraint(XSIdentityConstraint x) { throw new IllegalStateException(); }
+         public XSComponent xpath(XSXPath xsxPath) { throw new IllegalStateException(); }
+     };
+-    
+-    
++
++
+     private static String concat( String s1, String s2 ) {
+         if(s1==null)    return s2;
+         if(s2==null)    return s1;
+         return s1+"\n\n"+s2;
+     }
+-    
++
+     public QName getName() { return NAME; }
+-    
++
+     /** Name of this declaration. */
+     public static final QName NAME = new QName(
+         Const.JAXB_NSURI, "property" );
+@@ -714,4 +751,3 @@
+         String name;
+     }
+ }
+-
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BISchemaBinding.java	Thu Jul 30 17:35:08 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BISchemaBinding.java	Thu Jul 30 17:35:08 2009
+@@ -40,7 +40,7 @@
+ 
+ /**
+  * Schema-wide binding customization.
+- * 
++ *
+  * @author
+  *  Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+@@ -89,11 +89,11 @@
+      * Default naming rule, that doesn't change the name.
+      */
+     private static final NamingRule defaultNamingRule = new NamingRule("","");
+-    
+ 
++
+     /**
+      * Default naming rules of the generated interfaces.
+-     * 
++     *
+      * It simply adds prefix and suffix to the name, but
+      * the caller shouldn't care how the name mangling is
+      * done.
+@@ -103,7 +103,7 @@
+         private String prefix = "";
+         @XmlAttribute
+         private String suffix = "";
+-        
++
+         public NamingRule( String _prefix, String _suffix ) {
+             this.prefix = _prefix;
+             this.suffix = _suffix;
+@@ -117,14 +117,14 @@
+             return prefix+originalName+suffix;
+         }
+     }
+-    
++
+     /**
+      * Transforms the default name produced from XML name
+      * by following the customization.
+-     * 
++     *
+      * This shouldn't be applied to a class name specified
+      * by a customization.
+-     * 
++     *
+      * @param cmp
+      *      The schema component from which the default name is derived.
+      */
+@@ -137,20 +137,20 @@
+             return nameXmlTransform.attributeName.mangle(name);
+         if( cmp instanceof XSModelGroup || cmp instanceof XSModelGroupDecl )
+             return nameXmlTransform.modelGroupName.mangle(name);
+-        
++
+         // otherwise no modification
+         return name;
+     }
+-    
++
+     public String mangleAnonymousTypeClassName( String name ) {
+         return nameXmlTransform.anonymousTypeName.mangle(name);
+     }
+-    
+-    
++
++
+     public String getPackageName() { return packageInfo.name; }
+-    
++
+     public String getJavadoc() { return packageInfo.javadoc; }
+-    
++
+     public QName getName() { return NAME; }
+     public static final QName NAME = new QName(
+         Const.JAXB_NSURI, "schemaBinding" );
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BISerializable.java	Thu Jul 30 17:35:12 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BISerializable.java	Thu Jul 30 17:35:11 2009
+@@ -31,7 +31,7 @@
+  * This customization will enable serialization support on XJC.
+  * This is used as a child of a {@link BIGlobalBinding} object,
+  * and this doesn't implement BIDeclaration by itself.
+- * 
++ *
+  * @author
+  *  Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BIXDom.java	Thu Jul 30 17:35:15 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BIXDom.java	Thu Jul 30 17:35:15 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.reader.xmlschema.bindinfo;
+ 
+ import javax.xml.bind.annotation.XmlAttribute;
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BIXPluginCustomization.java	Thu Jul 30 17:35:19 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BIXPluginCustomization.java	Thu Jul 30 17:35:18 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.reader.xmlschema.bindinfo;
+ 
+ import javax.xml.namespace.QName;
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BIXSubstitutable.java	Thu Jul 30 17:35:22 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BIXSubstitutable.java	Thu Jul 30 17:35:22 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.reader.xmlschema.bindinfo;
+ 
+ import javax.xml.bind.annotation.XmlRootElement;
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BindInfo.java	Thu Jul 30 17:35:26 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BindInfo.java	Thu Jul 30 17:35:25 2009
+@@ -29,7 +29,6 @@
+ import java.io.StringWriter;
+ import java.io.Writer;
+ import java.util.ArrayList;
+-import java.util.Collections;
+ import java.util.Iterator;
+ import java.util.List;
+ 
+@@ -53,7 +52,6 @@
+ import com.sun.tools.internal.xjc.reader.Ring;
+ import com.sun.tools.internal.xjc.reader.xmlschema.BGMBuilder;
+ import com.sun.xml.internal.bind.annotation.XmlLocation;
+-import com.sun.xml.internal.bind.api.TypeReference;
+ 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;
+@@ -78,11 +76,11 @@
+ 
+     @XmlLocation
+     private Locator location;
+-    
++
+     /**
+-     * Documentation taken from &lt;xs:documentation>s. 
++     * Documentation taken from &lt;xs:documentation>s.
+      */
+-    @XmlElement
++    @XmlElement(namespace=WellKnownNamespace.XML_SCHEMA)
+     private Documentation documentation;
+ 
+     /**
+@@ -146,7 +144,7 @@
+ 
+ 
+     // only used by JAXB
+-    @XmlElement
++    @XmlElement(namespace=WellKnownNamespace.XML_SCHEMA)
+     void setAppinfo(AppInfo aib) {
+         aib.addTo(this);
+     }
+@@ -155,7 +153,7 @@
+ 
+     /**
+      * Gets the location of this annotation in the source file.
+-     * 
++     *
+      * @return
+      *      If the declarations are in fact specified in the source
+      *      code, a non-null valid object will be returned.
+@@ -163,8 +161,8 @@
+      *      null will be returned.
+      */
+     public Locator getSourceLocation() { return location; }
+-    
+-    
++
++
+     private XSComponent owner;
+     /**
+      * Sets the owner schema component and a reference to BGMBuilder.
+@@ -178,7 +176,7 @@
+             d.onSetOwner();
+     }
+     public XSComponent getOwner() { return owner; }
+-    
++
+     /**
+      * Back pointer to the BGMBuilder which is building
+      * a BGM from schema components including this customization.
+@@ -191,7 +189,7 @@
+         decl.setParent(this);
+         decls.add(decl);
+     }
+-    
++
+     /**
+      * Gets the first declaration with a given name, or null
+      * if none is found.
+@@ -204,10 +202,10 @@
+         }
+         return null; // not found
+     }
+-   
++
+     /**
+      * Gets all the declarations
+-     */ 
++     */
+     public BIDeclaration[] getDecls() {
+         return decls.toArray(new BIDeclaration[decls.size()]);
+     }
+@@ -272,10 +270,10 @@
+         else
+             this.documentation.addAll(bi.documentation);
+     }
+-    
++
+     /** Gets the number of declarations. */
+     public int size() { return decls.size(); }
+-    
++
+     public BIDeclaration get( int idx ) { return decls.get(idx); }
+ 
+     public Iterator<BIDeclaration> iterator() {
+@@ -318,7 +316,7 @@
+         synchronized(AnnotationParserFactoryImpl.class) {
+             try {
+                 if(customizationContext==null)
+-                    customizationContext = new JAXBContextImpl(
++                    customizationContext = new JAXBContextImpl.JAXBContextBuilder().setClasses(
+                         new Class[] {
+                             BindInfo.class, // for xs:annotation
+                             BIClass.class,
+@@ -325,6 +323,8 @@
+                             BIConversion.User.class,
+                             BIConversion.UserAdapter.class,
+                             BIDom.class,
++                            BIFactoryMethod.class,
++                            BIInlineBinaryData.class,
+                             BIXDom.class,
+                             BIXSubstitutable.class,
+                             BIEnum.class,
+@@ -332,8 +332,7 @@
+                             BIGlobalBinding.class,
+                             BIProperty.class,
+                             BISchemaBinding.class
+-                        }, Collections.<TypeReference>emptyList(),
+-                            Collections.<Class,Class>emptyMap(), null, false, null, false, false);
++                        }).build();
+                 return customizationContext;
+             } catch (JAXBException e) {
+                 throw new AssertionError(e);
+@@ -346,4 +345,3 @@
+      */
+     public static final SchemaCache bindingFileSchema = new SchemaCache(BindInfo.class.getResource("binding.xsd"));
+ }
+-
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/CollectionTypeAttribute.java	Thu Jul 30 17:35:29 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/CollectionTypeAttribute.java	Thu Jul 30 17:35:29 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.reader.xmlschema.bindinfo;
+ 
+ import javax.xml.bind.annotation.XmlTransient;
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/DomHandlerEx.java	Thu Jul 30 17:35:33 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/DomHandlerEx.java	Thu Jul 30 17:35:32 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.reader.xmlschema.bindinfo;
+ 
+ import javax.xml.bind.ValidationEventHandler;
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/EnumMemberMode.java	Thu Jul 30 17:35:36 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/EnumMemberMode.java	Thu Jul 30 17:35:36 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.reader.xmlschema.bindinfo;
+ 
+ import javax.xml.bind.annotation.XmlEnum;
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/ForkingFilter.java	Thu Jul 30 17:35:40 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/ForkingFilter.java	Thu Jul 30 17:35:39 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.reader.xmlschema.bindinfo;
+ 
+ import java.util.ArrayList;
+@@ -80,6 +81,10 @@
+         this.loc = locator;
+     }
+ 
++    public Locator getDocumentLocator() {
++        return loc;
++    }
++
+     public void startDocument() throws SAXException {
+         reset();
+         super.startDocument();
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/LocalScoping.java	Thu Jul 30 17:35:43 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/LocalScoping.java	Thu Jul 30 17:35:43 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.reader.xmlschema.bindinfo;
+ 
+ import javax.xml.bind.annotation.XmlEnumValue;
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/MessageBundle.properties	Thu Jul 30 17:35:47 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/MessageBundle.properties	Thu Jul 30 17:35:46 2009
+@@ -29,25 +29,24 @@
+ 
+ 
+ NGCCRuntimeEx.Unimplemented = \
+-	The "{0}" feature is not implemented yet
++        The "{0}" feature is not implemented yet
+ 
+ NGCCRuntimeEx.Unsupported = \
+-	The "{0}" feature is an unsupported optional feature
++        The "{0}" feature is an unsupported optional feature
+ 
+ NGCCRuntimeEx.UndefinedPrefix = \
+-	Prefix "{0}" is undefined
++        Prefix "{0}" is undefined
+ 
+ 
+ 
+ MagicTransducer.AttributeRequired = \
+-	parseMethod/printMethod attributes are both required.
++        parseMethod/printMethod attributes are both required.
+ 
+ ERR_ILLEGAL_FIXEDATTR = \
+-	fixedAttributeAsConstantProperty is allowed only with attributes with a fixed value constraint.
++        fixedAttributeAsConstantProperty is allowed only with attributes with a fixed value constraint.
+ 
+ ERR_UNDEFINED_SIMPLE_TYPE = \
+-	undefined simple type "{0}".
++        undefined simple type "{0}".
+ 
+ ERR_CANNOT_BE_BOUND_TO_SIMPLETYPE = \
+     Simple type "{0}" is not allowed by the spec to be bound to a type-safe enum.
+- 
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/OptionalPropertyMode.java	Thu Jul 30 17:35:50 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/OptionalPropertyMode.java	Thu Jul 30 17:35:50 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.reader.xmlschema.bindinfo;
+ 
+ import javax.xml.bind.annotation.XmlEnumValue;
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/binding.rng	Thu Jul 30 17:35:54 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/binding.rng	Thu Jul 30 17:35:53 2009
+@@ -215,6 +215,7 @@
+       private boolean xSimpleMode;
+       private boolean generateValueClass = true;
+       private boolean generateElementClass = false;
++      private boolean generateMixedExtensions = false;
+ 
+       public BIGlobalBinding makeResult() {
+         if( enumBaseTypes.size()==0 )
+@@ -359,6 +360,12 @@
+         </attribute>
+       </optional>
+ 
++      <optional>
++        <attribute name="generateMixedExtensions">
++          value = <data type="boolean"/>
++          generateMixedExtensions = $runtime.parseBoolean(value);
++        </attribute>
++      </optional>
+ 
+       <!-- unimplemented attributes -->
+       <optional>
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/binding.xsd	Thu Jul 30 17:35:58 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/binding.xsd	Thu Jul 30 17:35:57 2009
+@@ -23,8 +23,16 @@
+  CA 95054 USA or visit www.sun.com if you need additional information or
+  have any questions.
+ -->
++
++
+ <!-- THIS IS A GENERATED FILE. DO NOT MODIFY. -->
+ <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://java.sun.com/xml/ns/jaxb" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc">
++  <xs:annotation>
++    <xs:documentation>
++      JAXB customization schema
++    </xs:documentation>
++  </xs:annotation>
++  
+   <xs:import namespace="http://java.sun.com/xml/ns/jaxb/xjc" schemaLocation="xjc.xsd"/>
+   <xs:import namespace="http://www.w3.org/2001/XMLSchema" schemaLocation="xs.xsd"/>
+   <xs:element name="bindings">
+@@ -38,6 +46,11 @@
+   </xs:element>
+   <xs:element name="declaration" abstract="true"/>
+   <xs:element name="globalBindings" substitutionGroup="jaxb:declaration">
++    <xs:annotation>
++      <xs:documentation>
++        Defines global customization. Only one of this is allowed per compilation.
++      </xs:documentation>
++    </xs:annotation>
+     <xs:complexType>
+       <xs:choice minOccurs="0" maxOccurs="unbounded">
+         <xs:element name="javaType">
+@@ -122,6 +135,7 @@
+       <xs:attribute name="choiceContentProperty" type="xs:boolean"/>
+       <xs:attribute name="generateValueClass" type="xs:boolean"/>
+       <xs:attribute name="generateElementClass" type="xs:boolean"/>
++      <xs:attribute name="generateMixedExtensions" type="xs:boolean"/>
+       <xs:attribute name="generateElementProperty" type="xs:boolean"/>
+       <xs:attribute name="enableValidation" type="xs:boolean"/>
+       <xs:attribute name="enableFailFastCheck" type="xs:boolean"/>
+@@ -277,6 +291,28 @@
+       <xs:attribute name="type" default="w3c"/>
+     </xs:complexType>
+   </xs:element>
++
++  <xs:element name="inlineBinaryData">
++    <xs:annotation><xs:documentation><![CDATA[
++      Disable binary optimization.
++
++      Used on elements like <xs:element name="foo" type="xs:base64Binary"/> to indicate
++      that this base64 binary data is always inlined and never subjected to the binary
++      transfer optimization (such as XOP/MTOM)
++    ]]></xs:documentation></xs:annotation>
++    <xs:complexType />
++  </xs:element>
++
++  <xs:element name="factoryMethod">
++    <xs:annotation><xs:documentation><![CDATA[
++      Controls the name of the factory method on ObjectFactory. 
++    ]]></xs:documentation></xs:annotation>
++    <xs:complexType>
++      <xs:sequence />
++      <xs:attribute name="name" type="xs:string" use="required" />
++    </xs:complexType>
++  </xs:element>
++
+   <xs:group name="anyContents">
+     <xs:sequence>
+       <xs:any minOccurs="0" maxOccurs="unbounded" processContents="skip"/>
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/package-info.java	Thu Jul 30 17:36:01 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/package-info.java	Thu Jul 30 17:36:01 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ @XmlSchema(elementFormDefault = QUALIFIED, namespace=Const.JAXB_NSURI)
+ package com.sun.tools.internal.xjc.reader.xmlschema.bindinfo;
+ 
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/package.html	Thu Jul 30 17:36:05 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/package.html	Thu Jul 30 17:36:04 2009
+@@ -26,8 +26,8 @@
+ Object Model that represents customization declarations.
+ 
+ <p>
+-	<a href="http://relaxngcc.sourceforge.net/">RelaxNGCC</a> is used to parse
+-	XML syntax into this representation, and the other parts of XJC will use
+-	this object model.
++        <a href="http://relaxngcc.sourceforge.net/">RelaxNGCC</a> is used to parse
++        XML syntax into this representation, and the other parts of XJC will use
++        this object model.
+ </p>
+ </body>
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/xjc.xsd	Thu Jul 30 17:36:08 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/xjc.xsd	Thu Jul 30 17:36:08 2009
+@@ -23,6 +23,8 @@
+  CA 95054 USA or visit www.sun.com if you need additional information or
+  have any questions.
+ -->
++
++
+ <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://java.sun.com/xml/ns/jaxb/xjc" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc">
+   <xs:import namespace="http://java.sun.com/xml/ns/jaxb" schemaLocation="binding.xsd"/>
+   <xs:import namespace="http://www.w3.org/2001/XMLSchema" schemaLocation="xs.xsd"/>
+@@ -80,6 +82,8 @@
+     </xs:sequence>
+   </xs:group>
+ 
++  <xs:element name="allowMixedTypeExtensions" type="xs:boolean" />
++  
+   <xs:element name="generateElementProperty" type="xs:boolean" />
+   <xs:element name="dom">
+     <xs:complexType>
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/xs.xsd	Thu Jul 30 17:36:12 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/xs.xsd	Thu Jul 30 17:36:11 2009
+@@ -23,6 +23,8 @@
+  CA 95054 USA or visit www.sun.com if you need additional information or
+  have any questions.
+ -->
++
++
+ <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://www.w3.org/2001/XMLSchema" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc">
+   <xs:import namespace="http://java.sun.com/xml/ns/jaxb" schemaLocation="binding.xsd"/>
+   <xs:import namespace="http://java.sun.com/xml/ns/jaxb/xjc" schemaLocation="xjc.xsd"/>
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ct/ChoiceContentComplexTypeBuilder.java	Thu Jul 30 17:36:15 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ct/ChoiceContentComplexTypeBuilder.java	Thu Jul 30 17:36:15 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.reader.xmlschema.ct;
+ 
+ import java.util.Collections;
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ct/ComplexTypeBindingMode.java	Thu Jul 30 17:36:19 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ct/ComplexTypeBindingMode.java	Thu Jul 30 17:36:18 2009
+@@ -47,7 +47,14 @@
+      * If a complex type has falled back to the rest content and
+      * it is not NOMOREEXTENSION.
+      */
+-    FALLBACK_REST
++    FALLBACK_REST,
++
++    /**
++     * If a complex type has fallen to the dummy property in order
++     * to override previously inherited content.
++     */
++    FALLBACK_EXTENSION
++
+ //
+ //    /**
+ //     * If a complex type is derived by restriction from a complex type
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ct/ComplexTypeFieldBuilder.java	Thu Jul 30 17:36:22 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ct/ComplexTypeFieldBuilder.java	Thu Jul 30 17:36:22 2009
+@@ -48,7 +48,8 @@
+      * Builders are tried in this order, to put specific ones first.
+      */
+     private final CTBuilder[] complexTypeBuilders = new CTBuilder[]{
+-        new ChoiceContentComplexTypeBuilder(),
++//        new ChoiceContentComplexTypeBuilder(),
++        new MixedExtendedComplexTypeBuilder(),
+         new MixedComplexTypeBuilder(),
+         new FreshComplexTypeBuilder(),
+         new ExtendedComplexTypeBuilder(),
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ct/ExtendedComplexTypeBuilder.java	Thu Jul 30 17:36:26 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ct/ExtendedComplexTypeBuilder.java	Thu Jul 30 17:36:25 2009
+@@ -24,28 +24,12 @@
+  */
+ package com.sun.tools.internal.xjc.reader.xmlschema.ct;
+ 
+-import java.util.HashMap;
+-import java.util.Iterator;
+-import java.util.Map;
+ 
+-import com.sun.tools.internal.xjc.model.CClassInfo;
+ import com.sun.tools.internal.xjc.model.CClass;
+-import com.sun.tools.internal.xjc.reader.xmlschema.WildcardNameClassBuilder;
+-import com.sun.xml.internal.xsom.XSAttributeUse;
+ import com.sun.xml.internal.xsom.XSComplexType;
+ import com.sun.xml.internal.xsom.XSContentType;
+-import com.sun.xml.internal.xsom.XSDeclaration;
+-import com.sun.xml.internal.xsom.XSElementDecl;
+-import com.sun.xml.internal.xsom.XSModelGroup;
+-import com.sun.xml.internal.xsom.XSModelGroupDecl;
+-import com.sun.xml.internal.xsom.XSParticle;
+ import com.sun.xml.internal.xsom.XSType;
+-import com.sun.xml.internal.xsom.XSWildcard;
+-import com.sun.xml.internal.xsom.visitor.XSTermFunction;
+ 
+-import com.sun.xml.internal.rngom.nc.ChoiceNameClass;
+-import com.sun.xml.internal.rngom.nc.NameClass;
+-import com.sun.xml.internal.rngom.nc.SimpleNameClass;
+ 
+ /**
+  * Binds a complex type derived from another complex type by extension.
+@@ -53,15 +37,8 @@
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+-final class ExtendedComplexTypeBuilder extends CTBuilder {
++final class ExtendedComplexTypeBuilder extends AbstractExtendedComplexTypeBuilder {
+ 
+-    /**
+-     * Map from {@link XSComplexType} to {@link NameClass}[2] that
+-     * represents the names used in its child elements [0] and
+-     * attributes [1].
+-     */
+-    private final Map<XSComplexType,NameClass[]> characteristicNameClasses = new HashMap<XSComplexType,NameClass[]>();
+-
+     public boolean isApplicable(XSComplexType ct) {
+         XSType baseType = ct.getBaseType();
+         return baseType!=schemas.getAnyType()
+@@ -73,8 +50,8 @@
+         XSComplexType baseType = ct.getBaseType().asComplexType();
+ 
+         // build the base class
+-        CClass baseClass = selector.bindToType(baseType,ct,true);
+-        assert baseClass!=null;   // global complex type must map to a class
++        CClass baseClass = selector.bindToType(baseType, ct, true);
++        assert baseClass != null;   // global complex type must map to a class
+ 
+         selector.getCurrentBean().setBaseClass(baseClass);
+ 
+@@ -83,26 +60,23 @@
+ 
+         XSContentType explicitContent = ct.getExplicitContent();
+ 
+-        if(!checkIfExtensionSafe(baseType,ct)) {
++        if (!checkIfExtensionSafe(baseType, ct)) {
+             // error. We can't handle any further extension
+-            errorReceiver.error( ct.getLocator(),
+-                Messages.ERR_NO_FURTHER_EXTENSION.format(
++            errorReceiver.error(ct.getLocator(),
++                    Messages.ERR_NO_FURTHER_EXTENSION.format(
+                     baseType.getName(), ct.getName() )
+             );
+             return;
+         }
+ 
+-
+         // explicit content is always either empty or a particle.
+-        if( explicitContent!=null && explicitContent.asParticle()!=null ) {
+-
+-            if( baseTypeFlag==ComplexTypeBindingMode.NORMAL) {
++        if (explicitContent != null && explicitContent.asParticle() != null) {
++            if (baseTypeFlag == ComplexTypeBindingMode.NORMAL) {
+                 // if we have additional explicit content, process them.
+-
+                 builder.recordBindingMode(ct,
+-                    bgmBuilder.getParticleBinder().checkFallback(explicitContent.asParticle())
+-                    ?ComplexTypeBindingMode.FALLBACK_REST
+-                    :ComplexTypeBindingMode.NORMAL);
++                        bgmBuilder.getParticleBinder().checkFallback(explicitContent.asParticle())
++                        ? ComplexTypeBindingMode.FALLBACK_REST
++                        : ComplexTypeBindingMode.NORMAL);
+ 
+                 bgmBuilder.getParticleBinder().build(explicitContent.asParticle());
+ 
+@@ -113,7 +87,7 @@
+             }
+         } else {
+             // if it's empty, no additional processing is necessary
+-            builder.recordBindingMode(ct, baseTypeFlag );
++            builder.recordBindingMode(ct, baseTypeFlag);
+         }
+ 
+         // adds attributes and we are through.
+@@ -120,158 +94,4 @@
+         green.attContainer(ct);
+     }
+ 
+-    /**
+-     * Checks if this new extension is safe.
+-     *
+-     * UGLY.
+-     * <p>
+-     * If you have ctA extending ctB and ctB restricting ctC, our
+-     * Java classes will look like CtAImpl extending CtBImpl
+-     * extending CtCImpl.
+-     *
+-     * <p>
+-     * Since a derived class unmarshaller uses the base class unmarshaller,
+-     * this could potentially result in incorrect unmarshalling.
+-     * We used to just reject such a case, but then we found that
+-     * there are schemas that are using it.
+-     *
+-     * <p>
+-     * One generalized observation that we reached is that if the extension
+-     * is only adding new elements/attributes which has never been used
+-     * in any of its base class (IOW, if none of the particle / attribute use /
+-     * attribute wildcard can match the name of newly added elements/attributes)
+-     * then it is safe to add them.
+-     *
+-     * <p>
+-     * This function checks if the derivation chain to this type is
+-     * not using restriction, and if it is, then checks if it is safe
+-     * according to the above condition.
+-     *
+-     * @return false
+-     *      If this complex type needs to be rejected.
+-     */
+-    private boolean checkIfExtensionSafe( XSComplexType baseType, XSComplexType thisType ) {
+-        XSComplexType lastType = getLastRestrictedType(baseType);
+-
+-        if(lastType==null)
+-            return true;    // no restriction in derivation chain
+-
+-        NameClass anc = NameClass.NULL;
+-        // build name class for attributes in new complex type
+-        Iterator itr = thisType.iterateDeclaredAttributeUses();
+-        while( itr.hasNext() )
+-            anc = new ChoiceNameClass( anc, getNameClass(((XSAttributeUse)itr.next()).getDecl()) );
+-        // TODO: attribute wildcard
+-
+-        NameClass enc = getNameClass(thisType.getExplicitContent());
+-
+-        // check against every base type ... except the root anyType
+-        while(lastType!=lastType.getBaseType()) {
+-            if(checkCollision(anc,enc,lastType))
+-                return false;
+-
+-            if(lastType.getBaseType().isSimpleType())
+-                // if the base type is a simple type, there won't be
+-                // any further name collision.
+-                return true;
+-
+-            lastType = lastType.getBaseType().asComplexType();
+-        }
+-
+-
+-
+-        return true;    // OK
+-    }
+-
+-    /**
+-     * Checks if the particles/attributes defined in the type parameter
+-     * collides with the name classes of anc/enc.
+-     *
+-     * @return true if there's a collision.
+-     */
+-    private boolean checkCollision(NameClass anc, NameClass enc, XSComplexType type) {
+-        NameClass[] chnc = characteristicNameClasses.get(type);
+-        if(chnc==null) {
+-            chnc = new NameClass[2];
+-            chnc[0] = getNameClass(type.getContentType());
+-
+-            // build attribute name classes
+-            NameClass nc = NameClass.NULL;
+-            Iterator itr = type.iterateAttributeUses();
+-            while( itr.hasNext() )
+-                anc = new ChoiceNameClass( anc, getNameClass(((XSAttributeUse)itr.next()).getDecl()) );
+-            XSWildcard wc = type.getAttributeWildcard();
+-            if(wc!=null)
+-                nc = new ChoiceNameClass( nc, WildcardNameClassBuilder.build(wc) );
+-            chnc[1] = nc;
+-
+-            characteristicNameClasses.put(type,chnc);
+-        }
+-
+-        return chnc[0].hasOverlapWith(enc) || chnc[1].hasOverlapWith(anc);
+-    }
+-
+-    /**
+-     * Gets a {@link NameClass} that represents all the terms in the given content type.
+-     * If t is not a particle, just return an empty name class.
+-     */
+-    private NameClass getNameClass( XSContentType t ) {
+-        if(t==null) return NameClass.NULL;
+-        XSParticle p = t.asParticle();
+-        if(p==null) return NameClass.NULL;
+-        else        return p.getTerm().apply(contentModelNameClassBuilder);
+-    }
+-
+-    /**
+-     * Gets a {@link SimpleNameClass} from the name of a {@link XSDeclaration}.
+-     */
+-    private NameClass getNameClass( XSDeclaration decl ) {
+-        return new SimpleNameClass(decl.getTargetNamespace(),decl.getName());
+-    }
+-
+-    /**
+-     * Computes a name class that represents everything in a given content model.
+-     */
+-    private final XSTermFunction<NameClass> contentModelNameClassBuilder = new XSTermFunction<NameClass>() {
+-        public NameClass wildcard(XSWildcard wc) {
+-            return WildcardNameClassBuilder.build(wc);
+-        }
+-
+-        public NameClass modelGroupDecl(XSModelGroupDecl decl) {
+-            return modelGroup(decl.getModelGroup());
+-        }
+-
+-        public NameClass modelGroup(XSModelGroup group) {
+-            NameClass nc = NameClass.NULL;
+-            for( int i=0; i<group.getSize(); i++ )
+-                nc = new ChoiceNameClass(nc,group.getChild(i).getTerm().apply(this));
+-            return nc;
+-        }
+-
+-        public NameClass elementDecl(XSElementDecl decl) {
+-            return getNameClass(decl);
+-        }
+-    };
+-
+-
+-    /**
+-     * Looks for the derivation chain t_1 > t_2 > ... > t
+-     * and find t_i such that t_i derives by restriction but
+-     * for every j>i, t_j derives by extension.
+-     *
+-     * @return null
+-     *      If there's no such t_i or if t_i is any type.
+-     */
+-    private XSComplexType getLastRestrictedType( XSComplexType t ) {
+-        if( t.getBaseType()==schemas.getAnyType() )
+-            return null;   // we don't count the restriction from anyType
+-        if( t.getDerivationMethod()==XSType.RESTRICTION )
+-            return t;
+-
+-        XSComplexType baseType = t.getBaseType().asComplexType();
+-        if(baseType!=null)
+-            return getLastRestrictedType(baseType);
+-        else
+-            return null;
+-    }
+ }
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ct/MessageBundle.properties	Thu Jul 30 17:36:30 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ct/MessageBundle.properties	Thu Jul 30 17:36:29 2009
+@@ -27,4 +27,3 @@
+     Base complex type "{0}" is derived by restriction, while this complex type "{1}" \
+     is derived by extension. This is not currently handled by XJC, but we are \
+     seeking input on this issue. Please report this to the JAXB team.
+- 
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ct/Messages.java	Thu Jul 30 17:36:33 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ct/Messages.java	Thu Jul 30 17:36:32 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.reader.xmlschema.ct;
+ 
+ import java.text.MessageFormat;
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ct/MixedComplexTypeBuilder.java	Thu Jul 30 17:36:36 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ct/MixedComplexTypeBuilder.java	Thu Jul 30 17:36:36 2009
+@@ -22,9 +22,11 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.reader.xmlschema.ct;
+ 
+ import com.sun.tools.internal.xjc.model.CBuiltinLeafInfo;
++import com.sun.tools.internal.xjc.model.CClass;
+ import com.sun.tools.internal.xjc.model.CPropertyInfo;
+ import com.sun.tools.internal.xjc.reader.RawTypeSet;
+ import com.sun.tools.internal.xjc.reader.xmlschema.RawTypeSetBuilder;
+@@ -33,6 +35,7 @@
+ import com.sun.xml.internal.xsom.XSComplexType;
+ import com.sun.xml.internal.xsom.XSContentType;
+ import com.sun.xml.internal.xsom.XSType;
++import java.util.List;
+ 
+ /**
+  * @author Kohsuke Kawaguchi
+@@ -44,12 +47,16 @@
+         if(bt ==schemas.getAnyType() && ct.isMixed())
+             return true;    // fresh mixed complex type
+ 
+-        // see issue 148. handle complex type extended from another and added mixed=true.
+-        // the current implementation only works when the base type doesn't define
+-        // any elements, and we should ideally warn it.
+-        if(bt.isComplexType() && !bt.asComplexType().isMixed()
+-        && ct.isMixed() && ct.getDerivationMethod()==XSType.EXTENSION)
+-            return true;
++        // there's no complex type in the inheritance tree yet
++        if (bt.isComplexType() &&
++            !bt.asComplexType().isMixed() &&
++            ct.isMixed() &&
++            ct.getDerivationMethod() == XSType.EXTENSION) {
++                if (!bgmBuilder.isGenerateMixedExtensions() && (ct.getContentType().asParticle() == null)) {
++                    return false;
++                }
++                return true;
++        }
+ 
+         return false;
+     }
+@@ -57,18 +64,45 @@
+     public void build(XSComplexType ct) {
+         XSContentType contentType = ct.getContentType();
+ 
+-        // if mixed, we fallback immediately
+-        builder.recordBindingMode(ct,FALLBACK_CONTENT);
++        boolean generateMixedExtensions = bgmBuilder.isGenerateMixedExtensions();
++        if (generateMixedExtensions) {
++            if (!(ct.getBaseType() == schemas.getAnyType() && ct.isMixed())) {
++                XSComplexType baseType = ct.getBaseType().asComplexType();
++                // build the base class
++                CClass baseClass = selector.bindToType(baseType, ct, true);
++                selector.getCurrentBean().setBaseClass(baseClass);
++            }
++        }
+ 
++        builder.recordBindingMode(ct, FALLBACK_CONTENT);
+         BIProperty prop = BIProperty.getCustomization(ct);
+ 
+         CPropertyInfo p;
+ 
+-        if(contentType.asEmpty()!=null) {
+-            p = prop.createValueProperty("Content",false,ct,CBuiltinLeafInfo.STRING,null);
++        if (generateMixedExtensions) {
++            List<XSComplexType> cType = ct.getSubtypes();
++            boolean isSubtyped = (cType != null) && (cType.size() > 0);
++
++            if (contentType.asEmpty() != null) {
++                if (isSubtyped) {
++                    p = prop.createContentExtendedMixedReferenceProperty("Content", ct, null);
++                } else {
++                    p = prop.createValueProperty("Content",false,ct,CBuiltinLeafInfo.STRING,null);
++                }
++            } else if (contentType.asParticle() == null) {
++                p = prop.createContentExtendedMixedReferenceProperty("Content", ct, null);
++            } else {
++                RawTypeSet ts = RawTypeSetBuilder.build(contentType.asParticle(), false);
++                p = prop.createContentExtendedMixedReferenceProperty("Content", ct, ts);
++            }
++
+         } else {
+-            RawTypeSet ts = RawTypeSetBuilder.build(contentType.asParticle(),false);
+-            p = prop.createReferenceProperty("Content",false,ct,ts, true);
++            if(contentType.asEmpty()!=null) {
++                p = prop.createValueProperty("Content",false,ct,CBuiltinLeafInfo.STRING,null);
++            } else {
++                RawTypeSet ts = RawTypeSetBuilder.build(contentType.asParticle(),false);
++                p = prop.createReferenceProperty("Content", false, ct, ts, true, false, true, false);
++            }
+         }
+ 
+         selector.getCurrentBean().addProperty(p);
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ct/RestrictedComplexTypeBuilder.java	Thu Jul 30 17:36:40 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ct/RestrictedComplexTypeBuilder.java	Thu Jul 30 17:36:39 2009
+@@ -25,7 +25,13 @@
+ package com.sun.tools.internal.xjc.reader.xmlschema.ct;
+ 
+ import com.sun.tools.internal.xjc.model.CClass;
++import com.sun.tools.internal.xjc.model.CPropertyInfo;
++import com.sun.tools.internal.xjc.reader.RawTypeSet;
++import com.sun.tools.internal.xjc.reader.xmlschema.RawTypeSetBuilder;
++import com.sun.tools.internal.xjc.reader.xmlschema.bindinfo.BIGlobalBinding;
++import com.sun.tools.internal.xjc.reader.xmlschema.bindinfo.BIProperty;
+ import com.sun.xml.internal.xsom.XSComplexType;
++import com.sun.xml.internal.xsom.XSParticle;
+ import com.sun.xml.internal.xsom.XSType;
+ 
+ /**
+@@ -45,13 +51,13 @@
+     }
+ 
+     public void build(XSComplexType ct) {
+-        if(bgmBuilder.getGlobalBinding().isRestrictionFreshType()) {
++
++        if (bgmBuilder.getGlobalBinding().isRestrictionFreshType()) {
+             // handle derivation-by-restriction like a whole new type
+             new FreshComplexTypeBuilder().build(ct);
+             return;
+         }
+ 
+-
+         XSComplexType baseType = ct.getBaseType().asComplexType();
+ 
+         // build the base class
+@@ -60,7 +66,29 @@
+ 
+         selector.getCurrentBean().setBaseClass(baseClass);
+ 
+-        // determine the binding of this complex type.
+-        builder.recordBindingMode(ct,builder.getBindingMode(baseType));
++        if (bgmBuilder.isGenerateMixedExtensions()) {
++            boolean forceFallbackInExtension = baseType.isMixed() &&
++                                               ct.isMixed() &&
++                                               (ct.getExplicitContent() != null) &&
++                                               bgmBuilder.inExtensionMode;
++            if (forceFallbackInExtension) {
++                builder.recordBindingMode(ct, ComplexTypeBindingMode.NORMAL);
++
++                BIProperty prop = BIProperty.getCustomization(ct);
++                CPropertyInfo p;
++
++                XSParticle particle = ct.getContentType().asParticle();
++                if (particle != null) {
++                    RawTypeSet ts = RawTypeSetBuilder.build(particle, false);
++                    p = prop.createDummyExtendedMixedReferenceProperty("Content", ct, ts);
++                    selector.getCurrentBean().addProperty(p);
++                }
++            } else {
++                // determine the binding of this complex type.
++                builder.recordBindingMode(ct,builder.getBindingMode(baseType));
++            }
++        } else {
++            builder.recordBindingMode(ct,builder.getBindingMode(baseType));
++        }
+     }
+ }
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/parser/CustomizationContextChecker.java	Thu Jul 30 17:36:44 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/parser/CustomizationContextChecker.java	Thu Jul 30 17:36:43 2009
+@@ -42,21 +42,21 @@
+ 
+ /**
+  * Checks if binding declarations are placed where they are allowed.
+- * 
++ *
+  * <p>
+  * For example, if a &lt;jaxb:property> customization is given under
+  * the &lt;xs:simpleContent> element, this class raises an error.
+- * 
++ *
+  * <p>
+  * our main checkpoint of misplaced customizations are in BGMBuilder.
+  * There, we mark a customization whenever we use it. At the end of the
+  * day, we look for unmarked customizations and raise errors for them.
+- * 
++ *
+  * <p>
+  * Between this approach and the JAXB spec 1.0 is a problem that
+  * the spec allows/prohibits customizations at schema element level,
+  * while BGMBuilder and XSOM works on schema component levels.
+- * 
++ *
+  * <p>
+  * For example, a property customization is allowed on a complex type
+  * schema component, but it's only allowed on the &lt;complexType>
+@@ -63,63 +63,63 @@
+  * element. The spec team informed us that they would consider resolving
+  * this discrepancy in favor of RI, but meanwhile we need to detect
+  * errors correctly.
+- * 
++ *
+  * <p>
+  * This filter is implemented for this purpose.
+- * 
+- * 
++ *
++ *
+  * <h2>Customization and allowed locations</h2>
+- * 
++ *
+  * - globalBinding/schemaBinding
+  *     schema
+- * 
++ *
+  * - class
+  *     complexType(*), modelGroupDecl, modelGroup, element
+- * 
++ *
+  * - property
+  *     attribute, element, any, modelGroup, modelGroupRef, complexType(*)
+- * 
++ *
+  * - javaType
+  *     simpleType(*)
+- * 
++ *
+  * - typesafeEnumClass
+  *     simpleType(*)
+- * 
++ *
+  * - typesafeEnumMember
+  *     simpleType(*), enumeration
+- * 
++ *
+  * Components marked with '*' needs a check by this component
+  * since more than one schema element corresponds to one schema component
+  * of that type.
+- * 
++ *
+  * <p>
+  * For simple types, customizations are allowed only under the &lt;xs:simpleType>
+  * element, and for complex types they are allowed only under the
+  * &lt;xs:cimplexType> element.
+- * 
++ *
+  * <p>
+- * So the bottom line is that it would be suffice if we just make sure 
+- * that no customization will be attached under other elements of 
++ * So the bottom line is that it would be suffice if we just make sure
++ * that no customization will be attached under other elements of
+  * simple types and complex types. Those are:
+- * 
++ *
+  * - simpleType/restriction
+  * - list
+  * - union
+  * - complexType/(simple or complex)Content
+  * - complexType/(simple or complex)Content/(restriction of extension)
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+ public class CustomizationContextChecker extends XMLFilterImpl {
+-    
++
+     /** Keep names of all the ancestor elements. */
+     private final Stack<QName> elementNames = new Stack<QName>();
+-    
++
+     private final ErrorHandler errorHandler;
+-    
++
+     private Locator locator;
+-    
++
+     /** Set of element names that cannot have JAXB customizations. */
+     private static final Set<String> prohibitedSchemaElementNames = new HashSet<String>();
+ 
+@@ -130,7 +130,7 @@
+     public CustomizationContextChecker( ErrorHandler _errorHandler ) {
+         this.errorHandler = _errorHandler;
+     }
+-    
++
+     static {
+         prohibitedSchemaElementNames.add("restriction");
+         prohibitedSchemaElementNames.add("extension");
+@@ -139,18 +139,18 @@
+         prohibitedSchemaElementNames.add("list");
+         prohibitedSchemaElementNames.add("union");
+     }
+-    
+-    
+-    
+-    
++
++
++
++
+     /** Gets the stack top. */
+     private QName top() {
+         return elementNames.peek();
+     }
+-    
++
+     public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException {
+         QName newElement = new QName(namespaceURI,localName);
+-        
++
+         if( newElement.getNamespaceURI().equals(Const.JAXB_NSURI)
+          && top().getNamespaceURI().equals(WellKnownNamespace.XML_SCHEMA) ) {
+             // we hit a JAXB customization. the stack top should be
+@@ -168,20 +168,20 @@
+                         locator ) );
+                 }
+             }
+-            
+-            
++
++
+         }
+-        
++
+         elementNames.push(newElement);
+-        
++
+         super.startElement(namespaceURI, localName, qName, atts );
+     }
+ 
+     public void endElement(String namespaceURI, String localName, String qName)
+         throws SAXException {
+-            
++
+         super.endElement(namespaceURI, localName, qName);
+-        
++
+         elementNames.pop();
+     }
+ 
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/parser/IncorrectNamespaceURIChecker.java	Thu Jul 30 17:36:47 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/parser/IncorrectNamespaceURIChecker.java	Thu Jul 30 17:36:46 2009
+@@ -35,30 +35,30 @@
+ 
+ /**
+  * This filter detects the use of incorrect JAXB namespace URI.
+- * 
++ *
+  * When the binding compiler looks at a schema file, it always look
+  * for the namespace URI of the elements (which is correct, BTW.)
+- * 
++ *
+  * <p>
+  * However, one unfortunate downside of this philosophically correct
+  * behavior is that there is no provision or safety check when an user
+  * misspelled JAXB binding customization namespace.
+- * 
++ *
+  * <p>
+  * This checker inspects the input document and look for the use of the
+  * prefix "jaxb". If the document doesn't associate any prefix to the
+  * JAXB customization URI and if it does associate the jaxb prefix,
+  * this checker will issue a warning.
+- * 
++ *
+  * <p>
+  * This warning can happen to completely correct schema (because
+  * nothing prevents you from using the prefix "jaxb" for other purpose
+  * while using a JAXB compiler on the same schema) but in practice
+  * this would be quite unlikely.
+- * 
++ *
+  * <p>
+  * This justifies the use of this filter.
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+@@ -67,16 +67,16 @@
+     public IncorrectNamespaceURIChecker( ErrorHandler handler ) {
+         this.errorHandler = handler;
+     }
+-    
++
+     private ErrorHandler errorHandler;
+-    
++
+     private Locator locator = null;
+-    
++
+     /** Sets to true once we see the jaxb prefix in use. */
+     private boolean isJAXBPrefixUsed = false;
+-    /** Sets to true once we see the JAXB customization namespace URI. */ 
++    /** Sets to true once we see the JAXB customization namespace URI. */
+     private boolean isCustomizationUsed = false;
+-    
++
+     public void endDocument() throws SAXException {
+         if( isJAXBPrefixUsed && !isCustomizationUsed ) {
+             SAXParseException e = new SAXParseException(
+@@ -84,7 +84,7 @@
+                 locator );
+             errorHandler.warning(e);
+         }
+-        
++
+         super.endDocument();
+     }
+ 
+@@ -93,7 +93,7 @@
+             isJAXBPrefixUsed = true;
+         if( uri.equals(Const.JAXB_NSURI) )
+             isCustomizationUsed = true;
+-        
++
+         super.startPrefixMapping(prefix, uri);
+     }
+ 
+@@ -100,12 +100,12 @@
+     public void startElement(String namespaceURI, String localName, String qName, Attributes atts)
+         throws SAXException {
+         super.startElement(namespaceURI, localName, qName, atts);
+-        
++
+         // I'm not sure if this is necessary (SAX might report the change of the default prefix
+         // through the startPrefixMapping method, and I think it does indeed.)
+-        // 
++        //
+         // but better safe than sorry.
+-        
++
+         if( namespaceURI.equals(Const.JAXB_NSURI) )
+             isCustomizationUsed = true;
+     }
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/parser/LSInputSAXWrapper.java	Thu Jul 30 17:36:51 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/parser/LSInputSAXWrapper.java	Thu Jul 30 17:36:50 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.reader.xmlschema.parser;
+ 
+ import java.io.InputStream;
+@@ -32,7 +33,7 @@
+ 
+ /**
+  * LSInput implementation that wraps a SAX InputSource
+- * 
++ *
+  * @author Ryan.Shoemaker@Sun.COM
+  */
+ public class LSInputSAXWrapper implements LSInput {
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/parser/MessageBundle.properties	Thu Jul 30 17:36:54 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/parser/MessageBundle.properties	Thu Jul 30 17:36:54 2009
+@@ -30,7 +30,7 @@
+ 
+ 
+ CustomizationContextChecker.UnacknolwedgedCustomization = \
+-	Specified {0} customization is not used.
++        Specified {0} customization is not used.
+ 
+ 
+ SchemaConstraintChecker.UnableToCheckCorrectness = \
+@@ -37,17 +37,11 @@
+     Unable to check the correctness of the schema due to OutOfMemoryError. \
+     This typically happens when your schema contains constructs like maxOccurs="999". \
+     In the future compilation, add the '-nv' option to skip the correctness check \
+-    for faster compilation. 
++    for faster compilation.
+ 
+ 
+ 
+ 
+ IncorrectNamespaceURIChecker.WarnIncorrectURI = \
+-	No JAXB customization was detected in the schema but the prefix "jaxb" is used for \
+-	other namespace URIs. If you did intend to use JAXB customization, make sure the namespace URI is "{0}"
+-
+-	
+-
+-
+-	
+- 
++        No JAXB customization was detected in the schema but the prefix "jaxb" is used for \
++        other namespace URIs. If you did intend to use JAXB customization, make sure the namespace URI is "{0}"
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/parser/Messages.java	Thu Jul 30 17:36:58 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/parser/Messages.java	Thu Jul 30 17:36:57 2009
+@@ -38,9 +38,9 @@
+         String text = ResourceBundle.getBundle(Messages.class.getPackage().getName() +".MessageBundle").getString(property);
+         return MessageFormat.format(text,args);
+     }
+-    
+-    
+-    
++
++
++
+     static final String ERR_UNACKNOWLEDGED_CUSTOMIZATION =
+         "CustomizationContextChecker.UnacknolwedgedCustomization"; // arg:1
+ 
+--- old/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/parser/XMLSchemaInternalizationLogic.java	Thu Jul 30 17:37:01 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/parser/XMLSchemaInternalizationLogic.java	Thu Jul 30 17:37:00 2009
+@@ -37,7 +37,7 @@
+ 
+ /**
+  * XML Schema specific internalization logic.
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+@@ -51,7 +51,7 @@
+         ReferenceFinder( DOMForest parent ) {
+             super(parent);
+         }
+-        
++
+         protected String findExternalResource( String nsURI, String localName, Attributes atts) {
+             if( WellKnownNamespace.XML_SCHEMA.equals(nsURI)
+             && ("import".equals(localName) || "include".equals(localName) ) )
+@@ -75,13 +75,13 @@
+         if(annotation==null)
+             // none exists. need to make one
+             annotation = insertXMLSchemaElement( target, "annotation" );
+-        
++
+         // then look for appinfo
+         Element appinfo = DOMUtils.getFirstChildElement(annotation, WellKnownNamespace.XML_SCHEMA, "appinfo" );
+         if(appinfo==null)
+             // none exists. need to make one
+             appinfo = insertXMLSchemaElement( annotation, "appinfo" );
+-        
++
+         return appinfo;
+     }
+ 
+@@ -88,7 +88,7 @@
+     /**
+      * Creates a new XML Schema element of the given local name
+      * and insert it as the first child of the given parent node.
+-     * 
++     *
+      * @return
+      *      Newly create element.
+      */
+@@ -99,16 +99,16 @@
+         int idx = qname.indexOf(':');
+         if(idx==-1)     qname = localName;
+         else            qname = qname.substring(0,idx+1)+localName;
+-        
++
+         Element child = parent.getOwnerDocument().createElementNS( WellKnownNamespace.XML_SCHEMA, qname );
+-        
++
+         NodeList children = parent.getChildNodes();
+-        
++
+         if( children.getLength()==0 )
+             parent.appendChild(child);
+         else
+             parent.insertBefore( child, children.item(0) );
+-        
++
+         return child;
+     }
+ }
+--- old/src/share/classes/com/sun/tools/internal/xjc/runtime/JAXBContextFactory.java	Thu Jul 30 17:37:05 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/runtime/JAXBContextFactory.java	Thu Jul 30 17:37:04 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.runtime;
+ 
+ import java.util.ArrayList;
+--- old/src/share/classes/com/sun/tools/internal/xjc/runtime/ZeroOneBooleanAdapter.java	Thu Jul 30 17:37:08 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/runtime/ZeroOneBooleanAdapter.java	Thu Jul 30 17:37:08 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.runtime;
+ 
+ import javax.xml.bind.DatatypeConverter;
+--- old/src/share/classes/com/sun/tools/internal/xjc/util/CodeModelClassFactory.java	Thu Jul 30 17:37:12 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/util/CodeModelClassFactory.java	Thu Jul 30 17:37:11 2009
+@@ -38,27 +38,27 @@
+ /**
+  * Create new {@link JDefinedClass} and report class collision errors,
+  * if necessary.
+- * 
++ *
+  * This is just a helper class that simplifies the class name collision
+  * detection. This object maintains no state, so it is OK to use
+  * multiple instances of this.
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+ public final class CodeModelClassFactory {
+-    
++
+     /** errors are reported to this object. */
+     private ErrorReceiver errorReceiver;
+-    
++
+     /** unique id generator. */
+     private int ticketMaster = 0;
+-    
+-    
++
++
+     public CodeModelClassFactory( ErrorReceiver _errorReceiver ) {
+         this.errorReceiver = _errorReceiver;
+     }
+-    
++
+     public JDefinedClass createClass( JClassContainer parent, String name, Locator source ) {
+         return createClass( parent, JMod.PUBLIC, name, source );
+     }
+@@ -65,7 +65,7 @@
+     public JDefinedClass createClass( JClassContainer parent, int mod, String name, Locator source ) {
+         return createClass(parent,mod,name,source,ClassType.CLASS);
+     }
+-        
++
+     public JDefinedClass createInterface( JClassContainer parent, String name, Locator source ) {
+         return createInterface( parent, JMod.PUBLIC, name, source );
+     }
+@@ -95,12 +95,12 @@
+             // use the metadata field to store the source location,
+             // so that we can report class name collision errors.
+             r.metadata = source;
+-            
++
+             return r;
+         } catch( JClassAlreadyExistsException e ) {
+             // class collision.
+             JDefinedClass cls = e.getExistingClass();
+-            
++
+             // report the error
+             errorReceiver.error( new SAXParseException(
+                 Messages.format( Messages.ERR_CLASSNAME_COLLISION, cls.fullName() ),
+@@ -108,7 +108,7 @@
+             errorReceiver.error( new SAXParseException(
+                 Messages.format( Messages.ERR_CLASSNAME_COLLISION_SOURCE, name ),
+                 source ));
+-            
++
+             if( !name.equals(cls.name()) ) {
+                 // on Windows, FooBar and Foobar causes name collision
+                 errorReceiver.error( new SAXParseException(
+--- old/src/share/classes/com/sun/tools/internal/xjc/util/DOMUtils.java	Thu Jul 30 17:37:15 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/util/DOMUtils.java	Thu Jul 30 17:37:14 2009
+@@ -43,7 +43,7 @@
+ 
+ 
+ /**
+- * 
++ *
+  * @author  Vivek Pandey
+  * @version 1.0
+  *
+@@ -55,7 +55,7 @@
+         for( int i=0; i<children.getLength(); i++ ) {
+             Node item = children.item(i);
+             if(!(item instanceof Element ))     continue;
+-            
++
+             if(nsUri.equals(item.getNamespaceURI())
+             && localPart.equals(item.getLocalName()) )
+                 return (Element)item;
+@@ -62,7 +62,7 @@
+         }
+         return null;
+     }
+-    
++
+     /** Gets the child elements of the given name. */
+     public static Element[] getChildElements(Element parent, String nsUri, String localPart ) {
+         ArrayList a = new ArrayList();
+@@ -70,7 +70,7 @@
+         for( int i=0; i<children.getLength(); i++ ) {
+             Node item = children.item(i);
+             if(!(item instanceof Element ))     continue;
+-            
++
+             if(nsUri.equals(item.getNamespaceURI())
+             && localPart.equals(item.getLocalName()) )
+                 a.add(item);
+@@ -77,7 +77,7 @@
+         }
+         return (Element[]) a.toArray(new Element[a.size()]);
+     }
+-    
++
+     /** Gets all the child elements. */
+     public static Element[] getChildElements( Element parent ) {
+         ArrayList a = new ArrayList();
+@@ -85,18 +85,18 @@
+         for( int i=0; i<children.getLength(); i++ ) {
+             Node item = children.item(i);
+             if(!(item instanceof Element ))     continue;
+-            
++
+             a.add(item);
+         }
+         return (Element[]) a.toArray(new Element[a.size()]);
+     }
+-    
+-    
++
++
+   public static String getElementText(Element element) throws DOMException{
+     for (Node child = element.getFirstChild(); child != null;
+      child = child.getNextSibling()) {
+       if(child.getNodeType() == Node.TEXT_NODE)
+-    return child.getNodeValue();      
++    return child.getNodeValue();
+     }
+     return element.getNodeValue();
+   }
+@@ -115,7 +115,7 @@
+     return null;
+   }
+ 
+-  public static Element getElement(Document parent, String namespaceURI, 
++  public static Element getElement(Document parent, String namespaceURI,
+                        String localName) {
+     NodeList children = parent.getElementsByTagNameNS(namespaceURI, localName);
+     if(children.getLength() >= 1)
+@@ -131,7 +131,7 @@
+ //    return getElements(children);
+ //  }
+ //
+-//  public static Element[] getChildElements(Element parent, String namespaceURI, 
++//  public static Element[] getChildElements(Element parent, String namespaceURI,
+ //                       String localName) {
+ //    NodeList children = parent.getElementsByTagNameNS(namespaceURI, localName);
+ //    return getElements(children);
+@@ -141,7 +141,7 @@
+ //    NodeList children = parent.getElementsByTagName(name);
+ //    return getElements(children);
+ //  }
+-  
++
+     public static Element[] getElements(NodeList children) {
+         Element[] elements = null;
+         int len = 0;
+--- old/src/share/classes/com/sun/tools/internal/xjc/util/ErrorReceiverFilter.java	Thu Jul 30 17:37:19 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/util/ErrorReceiverFilter.java	Thu Jul 30 17:37:18 2009
+@@ -31,9 +31,9 @@
+ 
+ /**
+  * Filter implementation of the ErrorReceiver.
+- * 
++ *
+  * If an error is encountered, this filter sets a flag.
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+--- old/src/share/classes/com/sun/tools/internal/xjc/util/ForkContentHandler.java	Thu Jul 30 17:37:22 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/util/ForkContentHandler.java	Thu Jul 30 17:37:21 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.util;
+ 
+ import org.xml.sax.Attributes;
+@@ -34,95 +35,94 @@
+  * two ContentHandlers.
+  *
+  *
+- * @version	$Id: ForkContentHandler.java,v 1.1 2005/05/23 17:04:58 kohsuke Exp $
+  * @author  <a href="mailto:kohsuke.kawaguchi@sun.com">Kohsuke KAWAGUCHI</a>
+  */
+ public class ForkContentHandler implements ContentHandler {
+ 
+-	/**
+-	 * Creates a ForkContentHandler.
+-	 *
+-	 * @param first
+-	 *     This handler will receive a SAX event first.
+-	 * @param second
+-	 *     This handler will receive a SAX event after the first handler
+-	 *     receives it.
+-	 */
+-	public ForkContentHandler( ContentHandler first, ContentHandler second ) {
+-		lhs = first;
+-		rhs = second;
+-	}
++        /**
++         * Creates a ForkContentHandler.
++         *
++         * @param first
++         *     This handler will receive a SAX event first.
++         * @param second
++         *     This handler will receive a SAX event after the first handler
++         *     receives it.
++         */
++        public ForkContentHandler( ContentHandler first, ContentHandler second ) {
++                lhs = first;
++                rhs = second;
++        }
+ 
+-	/**
+-	 * Creates ForkContentHandlers so that the specified handlers
+-	 * will receive SAX events in the order of the array.
+-	 */
+-	public static ContentHandler create( ContentHandler[] handlers ) {
+-		if(handlers.length==0)
+-			throw new IllegalArgumentException();
++        /**
++         * Creates ForkContentHandlers so that the specified handlers
++         * will receive SAX events in the order of the array.
++         */
++        public static ContentHandler create( ContentHandler[] handlers ) {
++                if(handlers.length==0)
++                        throw new IllegalArgumentException();
+ 
+-		ContentHandler result = handlers[0];
+-		for( int i=1; i<handlers.length; i++ )
+-			result = new ForkContentHandler( result, handlers[i] );
+-		return result;
+-	}
++                ContentHandler result = handlers[0];
++                for( int i=1; i<handlers.length; i++ )
++                        result = new ForkContentHandler( result, handlers[i] );
++                return result;
++        }
+ 
+ 
+-	private final ContentHandler lhs,rhs;
++        private final ContentHandler lhs,rhs;
+ 
+-	public void setDocumentLocator (Locator locator) {
+-		lhs.setDocumentLocator(locator);
+-		rhs.setDocumentLocator(locator);
+-	}
++        public void setDocumentLocator (Locator locator) {
++                lhs.setDocumentLocator(locator);
++                rhs.setDocumentLocator(locator);
++        }
+ 
+-	public void startDocument() throws SAXException {
+-		lhs.startDocument();
+-		rhs.startDocument();
+-	}
++        public void startDocument() throws SAXException {
++                lhs.startDocument();
++                rhs.startDocument();
++        }
+ 
+-	public void endDocument () throws SAXException {
+-		lhs.endDocument();
+-		rhs.endDocument();
+-	}
++        public void endDocument () throws SAXException {
++                lhs.endDocument();
++                rhs.endDocument();
++        }
+ 
+-	public void startPrefixMapping (String prefix, String uri) throws SAXException {
+-		lhs.startPrefixMapping(prefix,uri);
+-		rhs.startPrefixMapping(prefix,uri);
+-	}
++        public void startPrefixMapping (String prefix, String uri) throws SAXException {
++                lhs.startPrefixMapping(prefix,uri);
++                rhs.startPrefixMapping(prefix,uri);
++        }
+ 
+-	public void endPrefixMapping (String prefix) throws SAXException {
+-		lhs.endPrefixMapping(prefix);
+-		rhs.endPrefixMapping(prefix);
+-	}
++        public void endPrefixMapping (String prefix) throws SAXException {
++                lhs.endPrefixMapping(prefix);
++                rhs.endPrefixMapping(prefix);
++        }
+ 
+-	public void startElement (String uri, String localName, String qName, Attributes attributes) throws SAXException {
+-		lhs.startElement(uri,localName,qName,attributes);
+-		rhs.startElement(uri,localName,qName,attributes);
+-	}
++        public void startElement (String uri, String localName, String qName, Attributes attributes) throws SAXException {
++                lhs.startElement(uri,localName,qName,attributes);
++                rhs.startElement(uri,localName,qName,attributes);
++        }
+ 
+-	public void endElement (String uri, String localName, String qName) throws SAXException {
+-		lhs.endElement(uri,localName,qName);
+-		rhs.endElement(uri,localName,qName);
+-	}
++        public void endElement (String uri, String localName, String qName) throws SAXException {
++                lhs.endElement(uri,localName,qName);
++                rhs.endElement(uri,localName,qName);
++        }
+ 
+-	public void characters (char ch[], int start, int length) throws SAXException {
+-		lhs.characters(ch,start,length);
+-		rhs.characters(ch,start,length);
+-	}
++        public void characters (char ch[], int start, int length) throws SAXException {
++                lhs.characters(ch,start,length);
++                rhs.characters(ch,start,length);
++        }
+ 
+-	public void ignorableWhitespace (char ch[], int start, int length) throws SAXException {
+-		lhs.ignorableWhitespace(ch,start,length);
+-		rhs.ignorableWhitespace(ch,start,length);
+-	}
++        public void ignorableWhitespace (char ch[], int start, int length) throws SAXException {
++                lhs.ignorableWhitespace(ch,start,length);
++                rhs.ignorableWhitespace(ch,start,length);
++        }
+ 
+-	public void processingInstruction (String target, String data) throws SAXException {
+-		lhs.processingInstruction(target,data);
+-		rhs.processingInstruction(target,data);
+-	}
++        public void processingInstruction (String target, String data) throws SAXException {
++                lhs.processingInstruction(target,data);
++                rhs.processingInstruction(target,data);
++        }
+ 
+-	public void skippedEntity (String name) throws SAXException {
+-		lhs.skippedEntity(name);
+-		rhs.skippedEntity(name);
+-	}
++        public void skippedEntity (String name) throws SAXException {
++                lhs.skippedEntity(name);
++                rhs.skippedEntity(name);
++        }
+ 
+ }
+--- old/src/share/classes/com/sun/tools/internal/xjc/util/ForkEntityResolver.java	Thu Jul 30 17:37:26 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/util/ForkEntityResolver.java	Thu Jul 30 17:37:25 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.util;
+ 
+ import java.io.IOException;
+--- old/src/share/classes/com/sun/tools/internal/xjc/util/MessageBundle.properties	Thu Jul 30 17:37:29 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/util/MessageBundle.properties	Thu Jul 30 17:37:28 2009
+@@ -30,11 +30,11 @@
+ 
+ 
+ CodeModelClassFactory.ClassNameCollision = \
+-	A class/interface with the same name "{0}" is already in use. \
++        A class/interface with the same name "{0}" is already in use. \
+     Use a class customization to resolve this conflict.
+ 
+ CodeModelClassFactory.ClassNameCollision.Source = \
+-	(Relevant to above error) another "{0}" is generated from here.
++        (Relevant to above error) another "{0}" is generated from here.
+ 
+ ERR_INVALID_CLASSNAME = \
+     Invalid class name "{0}". Either XJC has failed to derive a class name \
+@@ -42,8 +42,8 @@
+     to override a name.
+ 
+ CodeModelClassFactory.CaseSensitivityCollision = \
+-	This error is caused because on Windows you cannot have both "{0}.java" and "{1}.java" \
+-	in the same directory.
++        This error is caused because on Windows you cannot have both "{0}.java" and "{1}.java" \
++        in the same directory.
+ 
+ ERR_CHAMELEON_SCHEMA_GONE_WILD = \
+     (Relevant to above error) This confusing error happened most likely because the schema uses a technique called \
+@@ -50,4 +50,3 @@
+     "chameleon schema", which causes a single definition to be loaded multiple times into \
+     different namespaces. See http://forums.java.net/jive/thread.jspa?threadID=18631 for \
+     more about this.
+- 
+--- old/src/share/classes/com/sun/tools/internal/xjc/util/Messages.java	Thu Jul 30 17:37:33 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/util/Messages.java	Thu Jul 30 17:37:32 2009
+@@ -38,8 +38,8 @@
+         String text = ResourceBundle.getBundle(Messages.class.getPackage().getName() +".MessageBundle").getString(property);
+         return MessageFormat.format(text,args);
+     }
+-    
+ 
++
+     static final String ERR_CLASSNAME_COLLISION =
+         "CodeModelClassFactory.ClassNameCollision";
+ 
+--- old/src/share/classes/com/sun/tools/internal/xjc/util/MimeTypeRange.java	Thu Jul 30 17:37:36 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/util/MimeTypeRange.java	Thu Jul 30 17:37:35 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.util;
+ 
+ import java.text.ParseException;
+@@ -130,7 +131,7 @@
+         StringBuilder sb = new StringBuilder(majorType+'/'+subType);
+         if(q!=1)
+             sb.append("; q=").append(q);
+-        
++
+         for( Map.Entry<String,String> p : parameters.entrySet() ) {
+             // I'm too lazy to quote the value
+             sb.append("; ").append(p.getKey()).append('=').append(p.getValue());
+--- old/src/share/classes/com/sun/tools/internal/xjc/util/NamespaceContextAdapter.java	Thu Jul 30 17:37:40 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/util/NamespaceContextAdapter.java	Thu Jul 30 17:37:39 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.util;
+ 
+ import java.util.Collections;
+--- old/src/share/classes/com/sun/tools/internal/xjc/util/NullStream.java	Thu Jul 30 17:37:43 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/util/NullStream.java	Thu Jul 30 17:37:42 2009
+@@ -29,7 +29,7 @@
+ 
+ /**
+  * Just consumes the byte stream. Kind of like /dev/null.
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+@@ -37,7 +37,7 @@
+ 
+     public void write(int b) throws IOException {
+     }
+-    
++
+     public void close() throws IOException {
+     }
+ 
+--- old/src/share/classes/com/sun/tools/internal/xjc/util/ReadOnlyAdapter.java	Thu Jul 30 17:37:46 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/util/ReadOnlyAdapter.java	Thu Jul 30 17:37:46 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.util;
+ 
+ import javax.xml.bind.annotation.adapters.XmlAdapter;
+--- old/src/share/classes/com/sun/tools/internal/xjc/util/StringCutter.java	Thu Jul 30 17:37:50 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/util/StringCutter.java	Thu Jul 30 17:37:49 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.util;
+ 
+ import java.text.ParseException;
+--- old/src/share/classes/com/sun/tools/internal/xjc/util/SubtreeCutter.java	Thu Jul 30 17:37:54 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/util/SubtreeCutter.java	Thu Jul 30 17:37:53 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.tools.internal.xjc.util;
+ 
+ import org.xml.sax.helpers.XMLFilterImpl;
+--- old/src/share/classes/com/sun/tools/internal/xjc/util/Util.java	Thu Jul 30 17:37:57 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/util/Util.java	Thu Jul 30 17:37:56 2009
+@@ -28,8 +28,8 @@
+ 
+ 
+ /**
+- * Other miscellaneous utility methods. 
+- * 
++ * Other miscellaneous utility methods.
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+--- old/src/share/classes/com/sun/tools/internal/xjc/writer/SignatureWriter.java	Thu Jul 30 17:38:00 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/writer/SignatureWriter.java	Thu Jul 30 17:38:00 2009
+@@ -46,18 +46,18 @@
+ /**
+  * Dumps an annotated grammar in a simple format that
+  * makes signature check easy.
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+ public class SignatureWriter {
+-    
++
+     public static void write( Outline model, Writer out )
+         throws IOException {
+-        
++
+         new SignatureWriter(model,out).dump();
+     }
+-    
++
+     private SignatureWriter( Outline model, Writer out ) {
+         this.out = out;
+         this.classes = model.getClasses();
+@@ -65,12 +65,12 @@
+         for( ClassOutline ci : classes )
+             classSet.put( ci.ref, ci );
+     }
+-    
++
+     /** All the ClassItems in this grammar. */
+     private final Collection<? extends ClassOutline> classes;
+     /** Map from content interfaces to ClassItem. */
+     private final Map<JDefinedClass,ClassOutline> classSet = new HashMap<JDefinedClass,ClassOutline>();
+-    
++
+     private final Writer out;
+     private int indent=0;
+     private void printIndent() throws IOException {
+@@ -82,9 +82,9 @@
+         out.write(s);
+         out.write('\n');
+     }
+-    
++
+     private void dump() throws IOException {
+-        
++
+         // collect packages used in the class.
+         Set<JPackage> packages = new TreeSet<JPackage>(new Comparator<JPackage>() {
+             public int compare(JPackage lhs, JPackage rhs) {
+@@ -96,10 +96,10 @@
+ 
+         for( JPackage pkg : packages )
+             dump( pkg );
+-        
++
+         out.flush();
+     }
+-    
++
+     private void dump( JPackage pkg ) throws IOException {
+         println("package "+pkg.name()+" {");
+         indent++;
+@@ -107,7 +107,7 @@
+         indent--;
+         println("}");
+     }
+-    
++
+     private void dumpChildren( JClassContainer cont ) throws IOException {
+         Iterator itr = cont.classes();
+         while(itr.hasNext()) {
+@@ -117,7 +117,7 @@
+                 dump(ci);
+         }
+     }
+-    
++
+     private void dump( ClassOutline ci ) throws IOException {
+         JDefinedClass cls = ci.implClass;
+ 
+@@ -124,7 +124,7 @@
+         StringBuilder buf = new StringBuilder();
+         buf.append("interface ");
+         buf.append(cls.name());
+-        
++
+         boolean first=true;
+         Iterator itr = cls._implements();
+         while(itr.hasNext()) {
+@@ -139,19 +139,19 @@
+         buf.append(" {");
+         println(buf.toString());
+         indent++;
+-        
++
+         // dump the field
+         for( FieldOutline fo : ci.getDeclaredFields() ) {
+             String type = printName(fo.getRawType());
+             println(type+' '+fo.getPropertyInfo().getName(true)+';');
+         }
+-        
++
+         dumpChildren(cls);
+-        
++
+         indent--;
+         println("}");
+     }
+-    
++
+     /** Get the display name of a type. */
+     private String printName( JType t ) {
+         String name = t.fullName();
+--- old/src/share/classes/com/sun/xml/internal/bind/AccessorFactory.java	Thu Jul 30 17:38:04 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/AccessorFactory.java	Thu Jul 30 17:38:03 2009
+@@ -31,12 +31,12 @@
+ import javax.xml.bind.JAXBException;
+ 
+ /**
+- * A means to allow the user to provide customized Accessor  
+- * to be used by JAXB. 
++ * A means to allow the user to provide customized Accessor
++ * to be used by JAXB.
+  */
+ public interface AccessorFactory {
+     /**
+-     * Access a field of the class. 
++     * Access a field of the class.
+      *
+      * @param bean the class to be processed.
+      * @param f the field within the class to be accessed.
+@@ -46,7 +46,7 @@
+      * @throws JAXBException reports failures of the method.
+      */
+     Accessor createFieldAccessor(Class bean, Field f, boolean readOnly) throws JAXBException;
+-    
++
+     /**
+      * Access a property of the class.
+      *
+@@ -55,7 +55,7 @@
+      * @param setter the setter method to be accessed. The value can be null.
+      * @return Accessor the accessor for these methods
+      *
+-     * @throws JAXBException reports failures of the method.     
++     * @throws JAXBException reports failures of the method.
+      */
+     Accessor createPropertyAccessor(Class bean, Method getter, Method setter) throws JAXBException;
+ }
+--- old/src/share/classes/com/sun/xml/internal/bind/AccessorFactoryImpl.java	Thu Jul 30 17:38:07 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/AccessorFactoryImpl.java	Thu Jul 30 17:38:07 2009
+@@ -27,24 +27,25 @@
+ 
+ import java.lang.reflect.Field;
+ import java.lang.reflect.Method;
++
++import javax.xml.bind.JAXBException;
++
+ import com.sun.xml.internal.bind.v2.runtime.reflect.Accessor;
+-import com.sun.xml.internal.bind.api.AccessorException;
+ 
+ public class AccessorFactoryImpl implements AccessorFactory {
+ 
+-    private static AccessorFactoryImpl instance = null;
++    private static AccessorFactoryImpl instance = new AccessorFactoryImpl();
+     private AccessorFactoryImpl(){}
+-    public static synchronized AccessorFactoryImpl getInstance(){
+-        if (instance == null)
+-            instance = new AccessorFactoryImpl();
++
++    public static AccessorFactoryImpl getInstance(){
+         return instance;
+     }
+-    
++
+     /**
+-     * Access a field of the class. 
++     * Access a field of the class.
+      *
+      * @param bean the class to be processed.
+-     * @param f the field within the class to be accessed.
++     * @param field the field within the class to be accessed.
+      * @param readOnly  the isStatic value of the field's modifier.
+      * @return Accessor the accessor for this field
+      *
+@@ -66,7 +67,7 @@
+      *
+      * @throws JAXBException reports failures of the method.
+      */
+-    public Accessor createPropertyAccessor(Class bean, Method getter, Method setter) {    
++    public Accessor createPropertyAccessor(Class bean, Method getter, Method setter) {
+         if (getter == null) {
+             return new Accessor.SetterOnlyReflection(setter);
+         }
+--- old/src/share/classes/com/sun/xml/internal/bind/AnyTypeAdapter.java	Thu Jul 30 17:38:11 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/AnyTypeAdapter.java	Thu Jul 30 17:38:10 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind;
+ 
+ import javax.xml.bind.annotation.adapters.XmlAdapter;
+--- old/src/share/classes/com/sun/xml/internal/bind/CycleRecoverable.java	Thu Jul 30 17:38:14 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/CycleRecoverable.java	Thu Jul 30 17:38:14 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind;
+ 
+ import javax.xml.bind.Marshaller;
+--- old/src/share/classes/com/sun/xml/internal/bind/DatatypeConverterImpl.java	Thu Jul 30 17:38:18 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/DatatypeConverterImpl.java	Thu Jul 30 17:38:17 2009
+@@ -40,7 +40,7 @@
+ import com.sun.xml.internal.bind.v2.TODO;
+ 
+ /**
+- * This class is the JAXB RI's default implementation of the 
++ * This class is the JAXB RI's default implementation of the
+  * {@link DatatypeConverterInterface}.
+  *
+  * <p>
+@@ -52,19 +52,18 @@
+  * This class is responsible for whitespace normalization.
+  *
+  * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li></ul>
+- * @version $Revision: 1.9 $
+  * @since JAXB1.0
+  */
+ public final class DatatypeConverterImpl implements DatatypeConverterInterface {
+-    
++
+     /**
+      * To avoid re-creating instances, we cache one instance.
+      */
+     public static final DatatypeConverterInterface theInstance = new DatatypeConverterImpl();
+-        
++
+     protected DatatypeConverterImpl() {
+     }
+-    
++
+     public String parseString(String lexicalXSDString) {
+         return lexicalXSDString;
+     }
+@@ -117,7 +116,7 @@
+                 sign = -1;
+             } else
+             if(ch=='+') {
+-                ; // noop
++                // noop
+             } else
+                 throw new NumberFormatException("Not a number: "+s);
+         }
+@@ -137,7 +136,7 @@
+         return _parseShort(lexicalXSDShort);
+     }
+ 
+-    public static final short _parseShort(CharSequence s) {
++    public static short _parseShort(CharSequence s) {
+         return (short)_parseInt(s);
+     }
+ 
+@@ -156,9 +155,9 @@
+         content = WhiteSpaceProcessor.trim(content);
+ 
+         return new BigDecimal(content.toString());
+-        
++
+         // from purely XML Schema perspective,
+-        // this implementation has a problem, since 
++        // this implementation has a problem, since
+         // in xs:decimal "1.0" and "1" is equal whereas the above
+         // code will return different values for those two forms.
+         //
+@@ -167,7 +166,7 @@
+         // could take non-trivial time.
+         //
+         // also, from the user's point of view, one might be surprised if
+-        // 1 (not 1.0) is returned from "1.000" 
++        // 1 (not 1.0) is returned from "1.000"
+     }
+ 
+     public float parseFloat(String lexicalXSDFloat) {
+@@ -209,7 +208,7 @@
+     }
+ 
+     public static String _printFloat(float v) {
+-        if( v==Float.NaN )                  return "NaN";
++        if( Float.isNaN(v) )                return "NaN";
+         if( v==Float.POSITIVE_INFINITY )    return "INF";
+         if( v==Float.NEGATIVE_INFINITY )    return "-INF";
+         return String.valueOf(v);
+@@ -242,16 +241,18 @@
+         return _parseBoolean(lexicalXSDBoolean);
+     }
+ 
+-    public static boolean _parseBoolean(CharSequence literal) {
++    public static Boolean _parseBoolean(CharSequence literal) {
+         int i=0;
+         int len = literal.length();
+         char ch;
++        if (literal.length() <= 0) {
++            return null;
++        }
+         do {
+             ch = literal.charAt(i++);
+         } while(WhiteSpaceProcessor.isWhiteSpace(ch) && i<len);
+ 
+         // if we are strict about errors, check i==len. and report an error
+-
+         if( ch=='t' || ch=='1' )        return true;
+         if( ch=='f' || ch=='0' )        return false;
+         TODO.checkSpec("issue #42");
+@@ -264,7 +265,7 @@
+     public static String _printBoolean(boolean val) {
+         return val?"true":"false";
+     }
+-    
++
+     public byte parseByte(String lexicalXSDByte) {
+         return _parseByte(lexicalXSDByte);
+     }
+@@ -358,7 +359,8 @@
+         final int len = s.length();
+ 
+         // "111" is not a valid hex encoding.
+-        if( len%2 != 0 )    return null;
++        if( len%2 != 0 )
++            throw new IllegalArgumentException("hexBinary needs to be even-length: "+s);
+ 
+         byte[] out = new byte[len/2];
+ 
+@@ -366,7 +368,7 @@
+             int h = hexToBin(s.charAt(i  ));
+             int l = hexToBin(s.charAt(i+1));
+             if( h==-1 || l==-1 )
+-                return null;    // illegal character
++                throw new IllegalArgumentException("contains illegal character for hexBinary: "+s);
+ 
+             out[i/2] = (byte)(h*16+l);
+         }
+@@ -454,7 +456,7 @@
+     }
+ 
+     public static String _printDecimal(BigDecimal val) {
+-        return val.toString();
++        return val.toPlainString();
+     }
+ 
+     public String printDouble(double v) {
+@@ -462,7 +464,7 @@
+     }
+ 
+     public static String _printDouble(double v) {
+-        if( v==Double.NaN )                    return "NaN";
++        if(Double.isNaN(v))                  return "NaN";
+         if( v==Double.POSITIVE_INFINITY )    return "INF";
+         if( v==Double.NEGATIVE_INFINITY )    return "-INF";
+         return String.valueOf(v);
+@@ -477,7 +479,7 @@
+         String qname;
+         String prefix = nsc.getPrefix( val.getNamespaceURI() );
+         String localPart = val.getLocalPart();
+-        
++
+         if( prefix == null || prefix.length()==0 ) { // be defensive
+             qname = localPart;
+         } else {
+@@ -498,8 +500,8 @@
+     public String printAnySimpleType(String val) {
+         return val;
+     }
+-    
+-    
++
++
+     /**
+      * Just return the string passed as a parameter but
+      * installs an instance of this class as the DatatypeConverter
+@@ -884,11 +886,11 @@
+             if (tz == null)      return;
+ 
+             // otherwise print out normally.
+-            int offset;
+-            if (tz.inDaylightTime(cal.getTime())) {
+-                offset = tz.getRawOffset() + (tz.useDaylightTime()?3600000:0);
+-            } else {
+-                offset = tz.getRawOffset();
++            int offset = tz.getOffset(cal.getTime().getTime());
++
++            if(offset==0) {
++                buf.append('Z');
++                return;
+             }
+ 
+             if (offset >= 0)
+@@ -906,7 +908,7 @@
+         }
+ 
+         /** formats Integer into two-character-wide string. */
+-        private static final void formatTwoDigits(int n,StringBuilder buf) {
++        private static void formatTwoDigits(int n,StringBuilder buf) {
+             // n is always non-negative.
+             if (n < 10) buf.append('0');
+             buf.append(n);
+--- old/src/share/classes/com/sun/xml/internal/bind/IDResolver.java	Thu Jul 30 17:38:21 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/IDResolver.java	Thu Jul 30 17:38:21 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind;
+ 
+ import java.util.concurrent.Callable;
+--- old/src/share/classes/com/sun/xml/internal/bind/Locatable.java	Thu Jul 30 17:38:25 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/Locatable.java	Thu Jul 30 17:38:24 2009
+@@ -22,11 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * @(#)$Id: Locatable.java,v 1.1 2005/04/15 20:03:41 kohsuke Exp $
+- */
+-
+-
+ package com.sun.xml.internal.bind;
+ 
+ import com.sun.xml.internal.bind.annotation.XmlLocation;
+--- old/src/share/classes/com/sun/xml/internal/bind/Util.java	Thu Jul 30 17:38:28 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/Util.java	Thu Jul 30 17:38:28 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind;
+ 
+ import java.util.logging.Logger;
+--- old/src/share/classes/com/sun/xml/internal/bind/ValidationEventLocatorEx.java	Thu Jul 30 17:38:32 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/ValidationEventLocatorEx.java	Thu Jul 30 17:38:31 2009
+@@ -22,11 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * @(#)$Id: ValidationEventLocatorEx.java,v 1.1 2005/04/15 20:03:42 kohsuke Exp $
+- */
+-
+-
+ package com.sun.xml.internal.bind;
+ 
+ import javax.xml.bind.ValidationEventLocator;
+@@ -40,7 +35,7 @@
+  * <em>DO NOT IMPLEMENT THIS INTERFACE BY YOUR CODE</em> because
+  * we might add more methods on this interface in the future release
+  * of the RI.
+- * 
++ *
+  * <h2>Usage</h2>
+  * <p>
+  * If you obtain a reference to {@link javax.xml.bind.ValidationEventLocator},
+@@ -56,7 +51,7 @@
+  *     }
+  * }
+  * </pre>
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+@@ -66,10 +61,10 @@
+      * <p>
+      * This method always returns null when you are doing
+      * a validation during unmarshalling.
+-     * 
++     *
+      * When not null, the field name indicates the field of the object
+      * designated by the {@link #getObject()} method where the error
+-     * occured. 
++     * occured.
+      */
+     String getFieldName();
+ }
+--- old/src/share/classes/com/sun/xml/internal/bind/WhiteSpaceProcessor.java	Thu Jul 30 17:38:35 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/WhiteSpaceProcessor.java	Thu Jul 30 17:38:35 2009
+@@ -26,7 +26,7 @@
+ 
+ /**
+  * Processes white space normalization.
+- * 
++ *
+  * @since 1.0
+  */
+ public abstract class WhiteSpaceProcessor {
+@@ -62,7 +62,7 @@
+         // look for the first whitespace char.
+         while( i>=0 && !isWhiteSpaceExceptSpace(text.charAt(i)) )
+             i--;
+-        
++
+         if( i<0 )
+             // no such whitespace. replace(text)==text.
+             return text;
+@@ -100,7 +100,7 @@
+         else
+             return text.subSequence(start,end+1);
+     }
+-    
++
+     public static String collapse(String text) {
+         return collapse( (CharSequence)text ).toString();
+     }
+@@ -112,7 +112,7 @@
+      */
+     public static CharSequence collapse(CharSequence text) {
+         int len = text.length();
+-        
++
+         // most of the texts are already in the collapsed form.
+         // so look for the first whitespace in the hope that we will
+         // never see it.
+@@ -122,21 +122,21 @@
+                 break;
+             s++;
+         }
+-        if(s==len) 
++        if(s==len)
+             // the input happens to be already collapsed.
+             return text;
+-        
++
+         // we now know that the input contains spaces.
+-        // let's sit down and do the collapsing normally. 
+-        
++        // let's sit down and do the collapsing normally.
++
+         StringBuilder result = new StringBuilder(len /*allocate enough size to avoid re-allocation*/ );
+-        
++
+         if(s!=0) {
+             for( int i=0; i<s; i++ )
+                 result.append(text.charAt(i));
+             result.append(' ');
+         }
+-            
++
+         boolean inStripMode = true;
+         for (int i = s+1; i < len; i++) {
+             char ch = text.charAt(i);
+@@ -177,7 +177,7 @@
+         // 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;
+-        
++
+         // other than we have to do four comparisons.
+         return ch == 0x9 || ch == 0xA || ch == 0xD || ch == 0x20;
+     }
+@@ -190,9 +190,8 @@
+         // 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;
+-        
++
+         // other than we have to do four comparisons.
+         return ch == 0x9 || ch == 0xA || ch == 0xD;
+     }
+ }
+-
+--- old/src/share/classes/com/sun/xml/internal/bind/XmlAccessorFactory.java	Thu Jul 30 17:38:39 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/XmlAccessorFactory.java	Thu Jul 30 17:38:39 2009
+@@ -22,7 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-
+ package com.sun.xml.internal.bind;
+ 
+ import static java.lang.annotation.ElementType.PACKAGE;
+--- old/src/share/classes/com/sun/xml/internal/bind/annotation/XmlIsSet.java	Thu Jul 30 17:38:43 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/annotation/XmlIsSet.java	Thu Jul 30 17:38:42 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.annotation;
+ 
+ import java.lang.annotation.Retention;
+--- old/src/share/classes/com/sun/xml/internal/bind/annotation/XmlLocation.java	Thu Jul 30 17:38:46 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/annotation/XmlLocation.java	Thu Jul 30 17:38:46 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.annotation;
+ 
+ import java.lang.annotation.Retention;
+--- old/src/share/classes/com/sun/xml/internal/bind/api/AccessorException.java	Thu Jul 30 17:38:50 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/api/AccessorException.java	Thu Jul 30 17:38:49 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.api;
+ 
+ 
+--- old/src/share/classes/com/sun/xml/internal/bind/api/Bridge.java	Thu Jul 30 17:38:54 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/api/Bridge.java	Thu Jul 30 17:38:53 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.api;
+ 
+ import java.io.InputStream;
+--- old/src/share/classes/com/sun/xml/internal/bind/api/BridgeContext.java	Thu Jul 30 17:38:57 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/api/BridgeContext.java	Thu Jul 30 17:38:56 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.api;
+ 
+ import javax.xml.bind.ValidationEventHandler;
+@@ -54,7 +55,7 @@
+  */
+ public abstract class BridgeContext {
+     protected BridgeContext() {}
+-    
++
+     /**
+      * Registers the error handler that receives unmarshalling/marshalling errors.
+      *
+--- old/src/share/classes/com/sun/xml/internal/bind/api/ClassResolver.java	Thu Jul 30 17:39:01 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/api/ClassResolver.java	Thu Jul 30 17:39:00 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.api;
+ 
+ import javax.xml.bind.JAXBContext;
+--- old/src/share/classes/com/sun/xml/internal/bind/api/CompositeStructure.java	Thu Jul 30 17:39:04 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/api/CompositeStructure.java	Thu Jul 30 17:39:03 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.api;
+ 
+ /**
+@@ -35,7 +36,7 @@
+  * <p>
+  * This object allows you to treat multiple unrelated JAXB beans as a single tree.
+  * This in turn allows you to marshal this tree in one marshal method invocation,
+- * which is faster than multiple invocations of the marshal method. 
++ * which is faster than multiple invocations of the marshal method.
+  *
+  * <p>
+  * The binding of this class is always known to {@link JAXBRIContext}, so it can be
+--- old/src/share/classes/com/sun/xml/internal/bind/api/ErrorListener.java	Thu Jul 30 17:39:07 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/api/ErrorListener.java	Thu Jul 30 17:39:07 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.api;
+ 
+ import org.xml.sax.ErrorHandler;
+--- old/src/share/classes/com/sun/xml/internal/bind/api/JAXBRIContext.java	Thu Jul 30 17:39:11 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/api/JAXBRIContext.java	Thu Jul 30 17:39:10 2009
+@@ -45,6 +45,7 @@
+ import com.sun.xml.internal.bind.v2.ContextFactory;
+ 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;
+ 
+ /**
+  * {@link JAXBContext} enhanced with JAXB RI specific functionalities.
+@@ -51,7 +52,7 @@
+  *
+  * <p>
+  * <b>Subject to change without notice</b>.
+- * 
++ *
+  * @since 2.0 EA1
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+@@ -86,13 +87,13 @@
+      *      Can be null.
+      * @since JAXB 2.1 EA2
+      */
+-    public static JAXBRIContext newInstance(@NotNull Class[] classes, 
+-       @Nullable Collection<TypeReference> typeRefs, 
+-       @Nullable Map<Class,Class> subclassReplacements, 
+-       @Nullable String defaultNamespaceRemap, boolean c14nSupport, 
++    public static JAXBRIContext newInstance(@NotNull Class[] classes,
++       @Nullable Collection<TypeReference> typeRefs,
++       @Nullable Map<Class,Class> subclassReplacements,
++       @Nullable String defaultNamespaceRemap, boolean c14nSupport,
+        @Nullable RuntimeAnnotationReader ar) throws JAXBException {
+-        return ContextFactory.createContext(classes, typeRefs, subclassReplacements, 
+-                defaultNamespaceRemap, c14nSupport, ar, false, false);
++        return ContextFactory.createContext(classes, typeRefs, subclassReplacements,
++                defaultNamespaceRemap, c14nSupport, ar, false, false, false);
+     }
+ 
+     /**
+@@ -102,7 +103,7 @@
+     public static JAXBRIContext newInstance(@NotNull Class[] classes,
+         @Nullable Collection<TypeReference> typeRefs,
+         @Nullable String defaultNamespaceRemap, boolean c14nSupport ) throws JAXBException {
+-        return newInstance(classes,typeRefs, Collections.<Class,Class>emptyMap(), 
++        return newInstance(classes,typeRefs, Collections.<Class,Class>emptyMap(),
+                 defaultNamespaceRemap,c14nSupport,null);
+     }
+ 
+@@ -128,6 +129,15 @@
+     public abstract @Nullable QName getElementName(@NotNull Object o) throws JAXBException;
+ 
+     /**
++     * Allows to retrieve the element name based on Class.
++     * @param o
++     * @return
++     * @throws javax.xml.bind.JAXBException
++     * @since 2.1.10
++     */
++    public abstract @Nullable QName getElementName(@NotNull Class o) throws JAXBException;
++
++    /**
+      * Creates a mini-marshaller/unmarshaller that can process a {@link TypeReference}.
+      *
+      * @return
+@@ -220,6 +230,7 @@
+      * @throws IOException
+      *      if {@link SchemaOutputResolver} throws an {@link IOException}.
+      */
++    @Override
+     public abstract void generateSchema(@NotNull SchemaOutputResolver outputResolver) throws IOException;
+ 
+     /**
+@@ -235,7 +246,7 @@
+      *      in the {@link JAXBRIContext#newInstance} method.
+      *
+      * @return null
+-     *      if the referenced type is an anonymous and therefore doesn't have a name. 
++     *      if the referenced type is an anonymous and therefore doesn't have a name.
+      */
+     public abstract QName getTypeName(@NotNull TypeReference tr);
+ 
+@@ -264,6 +275,17 @@
+     public abstract void generateEpisode(Result output);
+ 
+     /**
++     * Allows you to access the runtime model information of the JAXB XML/Java binding.
++     *
++     * <p>
++     * This is useful for doing a deeper integration with the JAXB RI.
++     * For more information about the model, see https://jaxb2-reflection.dev.java.net/
++     *
++     * @since 2.1.10
++     */
++    public abstract RuntimeTypeInfoSet getRuntimeTypeInfoSet();
++
++    /**
+      * Computes a Java identifier from a local name.
+      *
+      * <p>
+@@ -409,7 +431,7 @@
+      * to specify specific classes that replace the reference to generic classes.
+      *
+      * <p>
+-     * See the release notes for more details about this feature. 
++     * See the release notes for more details about this feature.
+      *
+      * @since 2.1 EA2
+      */
+@@ -423,4 +445,11 @@
+      */
+     public static final String XMLACCESSORFACTORY_SUPPORT = "com.sun.xml.internal.bind.XmlAccessorFactory";
+ 
++    /**
++     * Retains references to PropertyInfos.
++     *
++     * @since 2.1.10
++     */
++    public static final String RETAIN_REFERENCE_TO_INFO = "retainReferenceToInfo";
++
+ }
+--- old/src/share/classes/com/sun/xml/internal/bind/api/RawAccessor.java	Thu Jul 30 17:39:15 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/api/RawAccessor.java	Thu Jul 30 17:39:14 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.api;
+ 
+ 
+--- old/src/share/classes/com/sun/xml/internal/bind/api/TypeReference.java	Thu Jul 30 17:39:18 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/api/TypeReference.java	Thu Jul 30 17:39:17 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.api;
+ 
+ import java.lang.annotation.Annotation;
+@@ -65,9 +66,18 @@
+     public final Annotation[] annotations;
+ 
+     public TypeReference(QName tagName, Type type, Annotation... annotations) {
+-        if(tagName==null || type==null || annotations==null)
+-            throw new IllegalArgumentException();
++        if(tagName==null || type==null || annotations==null) {
++            String nullArgs = "";
+ 
++            if(tagName == null)     nullArgs = "tagName";
++            if(type == null)        nullArgs += (nullArgs.length() > 0 ? ", type" : "type");
++            if(annotations == null) nullArgs += (nullArgs.length() > 0 ? ", annotations" : "annotations");
++
++            Messages.ARGUMENT_CANT_BE_NULL.format(nullArgs);
++
++            throw new IllegalArgumentException(Messages.ARGUMENT_CANT_BE_NULL.format(nullArgs));
++        }
++
+         this.tagName = new QName(tagName.getNamespaceURI().intern(), tagName.getLocalPart().intern(), tagName.getPrefix());
+         this.type = type;
+         this.annotations = annotations;
+@@ -91,7 +101,7 @@
+      * Otherwise returns an identical type.
+      */
+     public TypeReference toItemType() {
+-        // if we are to reinstitute this check, check JAXB annotations only 
++        // 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);
+--- old/src/share/classes/com/sun/xml/internal/bind/api/impl/NameConverter.java	Thu Jul 30 17:39:21 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/api/impl/NameConverter.java	Thu Jul 30 17:39:21 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.api.impl;
+ 
+ import java.util.ArrayList;
+--- old/src/share/classes/com/sun/xml/internal/bind/api/impl/NameUtil.java	Thu Jul 30 17:39:25 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/api/impl/NameUtil.java	Thu Jul 30 17:39:24 2009
+@@ -22,11 +22,13 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.api.impl;
+ 
+ import java.util.ArrayList;
+ import java.util.HashSet;
+ import java.util.List;
++import java.util.Locale;
+ 
+ /**
+  * Methods that convert strings into various formats.
+@@ -59,6 +61,18 @@
+         return c >= 'A' && c <= 'Z' || c >= 'a' && c <= 'z' || Character.isLetter(c);
+     }
+ 
++    private String toLowerCase(String s) {
++        return s.toLowerCase(Locale.ENGLISH);
++    }
++
++    private String toUpperCase(char c) {
++        return String.valueOf(c).toUpperCase(Locale.ENGLISH);
++    }
++
++    private String toUpperCase(String s) {
++        return s.toUpperCase(Locale.ENGLISH);
++    }
++
+     /**
+      * Capitalizes the first character of the specified string,
+      * and de-capitalize the rest of characters.
+@@ -67,8 +81,8 @@
+         if (!isLower(s.charAt(0)))
+             return s;
+         StringBuilder sb = new StringBuilder(s.length());
+-        sb.append(Character.toUpperCase(s.charAt(0)));
+-        sb.append(s.substring(1).toLowerCase());
++        sb.append(toUpperCase(s.charAt(0)));
++        sb.append(toLowerCase(s.substring(1)));
+         return sb.toString();
+     }
+ 
+@@ -209,7 +223,7 @@
+     protected String toMixedCaseName(List<String> ss, boolean startUpper) {
+         StringBuilder sb = new StringBuilder();
+         if(!ss.isEmpty()) {
+-            sb.append(startUpper ? ss.get(0) : ss.get(0).toLowerCase());
++            sb.append(startUpper ? ss.get(0) : toLowerCase(ss.get(0)));
+             for (int i = 1; i < ss.size(); i++)
+                 sb.append(ss.get(i));
+         }
+@@ -224,7 +238,7 @@
+                 ss[i] = capitalize(ss[i]);
+         StringBuilder sb = new StringBuilder();
+         if( ss.length>0 ) {
+-            sb.append(startUpper ? ss[0] : ss[0].toLowerCase());
++            sb.append(startUpper ? ss[0] : toLowerCase(ss[0]));
+             for (int i = 1; i < ss.length; i++)
+                 sb.append(ss[i]);
+         }
+@@ -253,10 +267,10 @@
+     public String toConstantName(List<String> ss) {
+         StringBuilder sb = new StringBuilder();
+         if( !ss.isEmpty() ) {
+-            sb.append(ss.get(0).toUpperCase());
++            sb.append(toUpperCase(ss.get(0)));
+             for (int i = 1; i < ss.size(); i++) {
+                 sb.append('_');
+-                sb.append(ss.get(i).toUpperCase());
++                sb.append(toUpperCase(ss.get(i)));
+             }
+         }
+         return sb.toString();
+--- old/src/share/classes/com/sun/xml/internal/bind/api/package-info.java	Thu Jul 30 17:39:29 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/api/package-info.java	Thu Jul 30 17:39:28 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ /**
+  * <h1>Runtime API for the JAX-WS RI</h1>.
+  *
+--- old/src/share/classes/com/sun/xml/internal/bind/marshaller/CharacterEscapeHandler.java	Thu Jul 30 17:39:32 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/marshaller/CharacterEscapeHandler.java	Thu Jul 30 17:39:31 2009
+@@ -30,13 +30,13 @@
+ /**
+  * Performs character escaping and write the result
+  * to the output.
+- * 
++ *
+  * @since 1.0.1
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+ public interface CharacterEscapeHandler {
+-    
++
+     /**
+      * @param ch The array of characters.
+      * @param start The starting position.
+@@ -43,6 +43,6 @@
+      * @param length The number of characters to use.
+      * @param isAttVal true if this is an attribute value literal.
+      */
+-    void escape( char[] ch, int start, int length, boolean isAttVal, Writer out ) throws IOException; 
++    void escape( char[] ch, int start, int length, boolean isAttVal, Writer out ) throws IOException;
+ 
+ }
+--- old/src/share/classes/com/sun/xml/internal/bind/marshaller/DataWriter.java	Thu Jul 30 17:39:36 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/marshaller/DataWriter.java	Thu Jul 30 17:39:35 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ //@@3RD PARTY CODE@@
+ 
+ // DataWriter.java - XML writer for data-oriented files.
+@@ -99,7 +100,7 @@
+ {
+ 
+ 
+-
++
+     ////////////////////////////////////////////////////////////////////
+     // Constructors.
+     ////////////////////////////////////////////////////////////////////
+@@ -110,7 +111,7 @@
+      *
+      * @param writer The character stream where the XML document
+      *        will be written.
+-     * @param encoding 
++     * @param encoding
+      *      If non-null string is specified, it is written as a part
+      *      of the XML declaration.
+      */
+@@ -121,11 +122,11 @@
+ 
+ 
+     public DataWriter (Writer writer, String encoding ) {
+-        this( writer, encoding, DumbEscapeHandler.theInstance ); 
++        this( writer, encoding, DumbEscapeHandler.theInstance );
+     }
+ 
+ 
+-
++
+     ////////////////////////////////////////////////////////////////////
+     // Accessors and setters.
+     ////////////////////////////////////////////////////////////////////
+@@ -141,7 +142,7 @@
+      * @return The number of spaces in each indentation step,
+      *         or 0 or less for no indentation.
+      * @see #setIndentStep(int)
+-     * 
++     *
+      * @deprecated
+      *      Only return the length of the indent string.
+      */
+@@ -157,7 +158,7 @@
+      * @param indentStep The new indent step (0 or less for no
+      *        indentation).
+      * @see #getIndentStep()
+-     * 
++     *
+      * @deprecated
+      *      Should use the version that takes string.
+      */
+@@ -168,13 +169,13 @@
+             buf.append(' ');
+         setIndentStep(buf.toString());
+     }
+-    
++
+     public void setIndentStep(String s) {
+         this.indentStep = s;
+     }
+ 
+ 
+-
++
+     ////////////////////////////////////////////////////////////////////
+     // Override methods from XMLWriter.
+     ////////////////////////////////////////////////////////////////////
+@@ -326,7 +327,7 @@
+     }
+ 
+ 
+-
++
+     ////////////////////////////////////////////////////////////////////
+     // Internal methods.
+     ////////////////////////////////////////////////////////////////////
+@@ -350,7 +351,7 @@
+     }
+ 
+ 
+-
++
+     ////////////////////////////////////////////////////////////////////
+     // Constants.
+     ////////////////////////////////////////////////////////////////////
+@@ -360,7 +361,7 @@
+     private final static Object SEEN_DATA = new Object();
+ 
+ 
+-
++
+     ////////////////////////////////////////////////////////////////////
+     // Internal state.
+     ////////////////////////////////////////////////////////////////////
+--- old/src/share/classes/com/sun/xml/internal/bind/marshaller/DumbEscapeHandler.java	Thu Jul 30 17:39:39 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/marshaller/DumbEscapeHandler.java	Thu Jul 30 17:39:38 2009
+@@ -30,19 +30,19 @@
+ /**
+  * Escape everything above the US-ASCII code range.
+  * A fallback position.
+- * 
++ *
+  * Works with any JDK, any encoding.
+- * 
++ *
+  * @since 1.0.1
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+ public class DumbEscapeHandler implements CharacterEscapeHandler {
+-    
++
+     private DumbEscapeHandler() {}  // no instanciation please
+-    
+-    public static final CharacterEscapeHandler theInstance = new DumbEscapeHandler(); 
+-    
++
++    public static final CharacterEscapeHandler theInstance = new DumbEscapeHandler();
++
+     public void escape(char[] ch, int start, int length, boolean isAttVal, Writer out) throws IOException {
+         int limit = start+length;
+         for (int i = start; i < limit; i++) {
+--- old/src/share/classes/com/sun/xml/internal/bind/marshaller/Messages.java	Thu Jul 30 17:39:43 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/marshaller/Messages.java	Thu Jul 30 17:39:42 2009
+@@ -30,7 +30,7 @@
+ 
+ /**
+  * Formats error messages.
+- * 
++ *
+  * @since JAXB1.0
+  */
+ public class Messages
+@@ -38,27 +38,27 @@
+     public static String format( String property ) {
+         return format( property, null );
+     }
+-    
++
+     public static String format( String property, Object arg1 ) {
+         return format( property, new Object[]{arg1} );
+     }
+-    
++
+     public static String format( String property, Object arg1, Object arg2 ) {
+         return format( property, new Object[]{arg1,arg2} );
+     }
+-    
++
+     public static String format( String property, Object arg1, Object arg2, Object arg3 ) {
+         return format( property, new Object[]{arg1,arg2,arg3} );
+     }
+-    
++
+     // add more if necessary.
+-    
++
+     /** Loads a string resource and formats it with specified arguments. */
+     static String format( String property, Object[] args ) {
+         String text = ResourceBundle.getBundle(Messages.class.getName()).getString(property);
+         return MessageFormat.format(text,args);
+     }
+-    
++
+ //
+ //
+ // Message resources
+@@ -66,32 +66,32 @@
+ //
+     public static final String NOT_MARSHALLABLE = // 0 args
+         "MarshallerImpl.NotMarshallable";
+-        
++
+     public static final String UNSUPPORTED_RESULT = // 0 args
+         "MarshallerImpl.UnsupportedResult";
+-        
++
+     public static final String UNSUPPORTED_ENCODING = // 1 arg
+         "MarshallerImpl.UnsupportedEncoding";
+-    
++
+     public static final String NULL_WRITER = // 0 args
+         "MarshallerImpl.NullWriterParam";
+-    
++
+     public static final String ASSERT_FAILED = // 0 args
+         "SAXMarshaller.AssertFailed";
+-    
++
+     /**
+      * @deprecated use ERR_MISSING_OBJECT2
+      */
+     public static final String ERR_MISSING_OBJECT = // 0 args
+         "SAXMarshaller.MissingObject";
+-    
++
+     /**
+      * @deprecated
+-     *  use {@link com.sun.xml.internal.bind.v2.runtime.XMLSerializer#reportMissingObjectError(String)} 
++     *  use {@link com.sun.xml.internal.bind.v2.runtime.XMLSerializer#reportMissingObjectError(String)}
+      */
+     public static final String ERR_MISSING_OBJECT2 = // 1 arg
+         "SAXMarshaller.MissingObject2";
+-    
++
+     /**
+      * @deprecated only used from 1.0
+      */
+--- old/src/share/classes/com/sun/xml/internal/bind/marshaller/Messages.properties	Thu Jul 30 17:39:46 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/marshaller/Messages.properties	Thu Jul 30 17:39:45 2009
+@@ -28,32 +28,31 @@
+ #
+ 
+ MarshallerImpl.NotMarshallable = \
+-	the object parameter to marshal() is not marshallable
+-	
++        the object parameter to marshal() is not marshallable
++
+ MarshallerImpl.UnsupportedResult = \
+-	unsupported javax.xml.parser.transform.Result parameter
+-	
++        unsupported javax.xml.parser.transform.Result parameter
++
+ MarshallerImpl.UnsupportedEncoding = \
+-	unsupported encoding: {0}
+-	
++        unsupported encoding: {0}
++
+ MarshallerImpl.NullWriterParam = \
+-	StAX writer parameter must not be null
+-	
++        StAX writer parameter must not be null
++
+ SAXMarshaller.AssertFailed = \
+-	assertion failed
+-	 
++        assertion failed
++
+ SAXMarshaller.MissingObject = \
+-	a required object is missing
+-	 
++        a required object is missing
++
+ SAXMarshaller.MissingObject2 = \
+-	a required field "{0}" is missing an object
++        a required field "{0}" is missing an object
+ 
+ SAXMarshaller.DanglingIDREF = \
+-	A tree contains a reference to ID "{0}" but it's not a part of the object graph
++        A tree contains a reference to ID "{0}" but it's not a part of the object graph
+ 
+ SAXMarshaller.NotIdentifiable = \
+-	An object is referenced as IDREF but its ID field is null
++        An object is referenced as IDREF but its ID field is null
+ 
+ SAX2DOMEx.DomImplDoesntSupportCreateElementNs = \
+-	DOM implementation ({0} from {1}) is broken. It does not support the createElementNS method.
+- 
++        DOM implementation ({0} from {1}) is broken. It does not support the createElementNS method.
+--- old/src/share/classes/com/sun/xml/internal/bind/marshaller/MinimumEscapeHandler.java	Thu Jul 30 17:39:49 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/marshaller/MinimumEscapeHandler.java	Thu Jul 30 17:39:49 2009
+@@ -22,11 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * @(#)$Id: MinimumEscapeHandler.java,v 1.1 2005/04/15 20:03:47 kohsuke Exp $
+- */
+-
+-
+ package com.sun.xml.internal.bind.marshaller;
+ 
+ import java.io.IOException;
+@@ -35,16 +30,16 @@
+ /**
+  * Performs no character escaping. Usable only when the output encoding
+  * is UTF, but this handler gives the maximum performance.
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+ public class MinimumEscapeHandler implements CharacterEscapeHandler {
+-    
++
+     private MinimumEscapeHandler() {}  // no instanciation please
+-    
+-    public static final CharacterEscapeHandler theInstance = new MinimumEscapeHandler(); 
+-    
++
++    public static final CharacterEscapeHandler theInstance = new MinimumEscapeHandler();
++
+     public void escape(char[] ch, int start, int length, boolean isAttVal, Writer out) throws IOException {
+         // avoid calling the Writerwrite method too much by assuming
+         // that the escaping occurs rarely.
+@@ -52,27 +47,27 @@
+         int limit = start+length;
+         for (int i = start; i < limit; i++) {
+             char c = ch[i];
+-            if( c=='&' || c=='<' || c=='>' || (c=='\"' && isAttVal) ) {
++                if(c == '&' || c == '<' || c == '>' || c == '\r' || (c == '\"' && isAttVal) ) {
+                 if(i!=start)
+                     out.write(ch,start,i-start);
+                 start = i+1;
+                 switch (ch[i]) {
+-                case '&' :
+-                    out.write("&amp;");
+-                    break;
+-                case '<' :
+-                    out.write("&lt;");
+-                    break;
+-                case '>' :
+-                    out.write("&gt;");
+-                    break;
+-                case '\"' :
+-                    out.write("&quot;");
+-                    break;
++                    case '&':
++                        out.write("&amp;");
++                        break;
++                    case '<':
++                        out.write("&lt;");
++                        break;
++                    case '>':
++                        out.write("&gt;");
++                        break;
++                    case '\"':
++                        out.write("&quot;");
++                        break;
+                 }
+             }
+         }
+-        
++
+         if( start!=limit )
+             out.write(ch,start,limit-start);
+     }
+--- old/src/share/classes/com/sun/xml/internal/bind/marshaller/NamespacePrefixMapper.java	Thu Jul 30 17:39:53 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/marshaller/NamespacePrefixMapper.java	Thu Jul 30 17:39:52 2009
+@@ -26,6 +26,7 @@
+ 
+ import java.io.OutputStream;
+ 
++import javax.xml.bind.JAXBContext;
+ import javax.xml.stream.XMLEventWriter;
+ import javax.xml.stream.XMLStreamWriter;
+ import javax.xml.transform.dom.DOMResult;
+@@ -44,11 +45,11 @@
+ /**
+  * Implemented by the user application to determine URI -> prefix
+  * mapping.
+- * 
++ *
+  * This is considered as an interface, though it's implemented
+  * as an abstract class to make it easy to add new methods in
+- * a future. 
+- * 
++ * a future.
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+@@ -58,9 +59,29 @@
+ 
+     /**
+      * Returns a preferred prefix for the given namespace URI.
+-     * 
++     *
+      * This method is intended to be overrided by a derived class.
+-     * 
++     *
++     *
++     * <p>
++     * As noted in the return value portion of the javadoc, there
++     * are several cases where the preference cannot be honored.
++     * Specifically, as of JAXB RI 2.0 and onward:
++     *
++     * <ol>
++     * <li>
++     * If the prefix returned is already in use as one of the in-scope
++     * namespace bindings. This is partly necessary for correctness
++     * (so that we don't unexpectedly change the meaning of QNames
++     * bound to {@link String}), partly to simplify the marshaller.
++     * <li>
++     * If the prefix returned is "" yet the current {@link JAXBContext}
++     * includes classes that use the empty namespace URI. This allows
++     * the JAXB RI to reserve the "" prefix for the empty namespace URI,
++     * which is the only possible prefix for the URI.
++     * This restriction is also to simplify the marshaller.
++     * </ol>
++     *
+      * @param namespaceUri
+      *      The namespace URI for which the prefix needs to be found.
+      *      Never be null. "" is used to denote the default namespace.
+@@ -70,27 +91,27 @@
+      *      parameter. Typicall this value comes from the QName.getPrefix
+      *      to show the preference of the content tree. This parameter
+      *      may be null, and this parameter may represent an already
+-     *      occupied prefix. 
++     *      occupied prefix.
+      * @param requirePrefix
+      *      If this method is expected to return non-empty prefix.
+      *      When this flag is true, it means that the given namespace URI
+      *      cannot be set as the default namespace.
+-     * 
++     *
+      * @return
+      *      null if there's no prefered prefix for the namespace URI.
+      *      In this case, the system will generate a prefix for you.
+-     * 
++     *
+      *      Otherwise the system will try to use the returned prefix,
+      *      but generally there's no guarantee if the prefix will be
+      *      actually used or not.
+-     * 
++     *
+      *      return "" to map this namespace URI to the default namespace.
+      *      Again, there's no guarantee that this preference will be
+      *      honored.
+-     * 
++     *
+      *      If this method returns "" when requirePrefix=true, the return
+      *      value will be ignored and the system will generate one.
+-     * 
++     *
+      * @since JAXB 1.0.1
+      */
+     public abstract String getPreferredPrefix(String namespaceUri, String suggestion, boolean requirePrefix);
+@@ -112,7 +133,7 @@
+      *   <ns3:child xmlns:ns3="urn:foo"> ... </ns3:child>
+      *   ...
+      * </root>
+-     * <xmp></pre>
++     * </xmp></pre>
+      *
+      * <p>
+      * The JAXB RI 2.x mostly doesn't exhibit this behavior any more,
+@@ -139,19 +160,19 @@
+      *   <ns1:child> ... </ns1:child>
+      *   ...
+      * </root>
+-     * <xmp></pre>
++     * </xmp></pre>
+      * <p>
+      * To control prefixes assigned to those namespace URIs, use the
+-     * {@link #getPreferredPrefix(String, String, boolean)} method. 
+-     * 
++     * {@link #getPreferredPrefix(String, String, boolean)} method.
++     *
+      * @return
+      *      A list of namespace URIs as an array of {@link String}s.
+      *      This method can return a length-zero array but not null.
+      *      None of the array component can be null. To represent
+      *      the empty namespace, use the empty string <code>""</code>.
+-     * 
++     *
+      * @since
+-     *      JAXB RI 1.0.2 
++     *      JAXB RI 1.0.2
+      */
+     public String[] getPreDeclaredNamespaceUris() {
+         return EMPTY_STRING;
+--- old/src/share/classes/com/sun/xml/internal/bind/marshaller/NioEscapeHandler.java	Thu Jul 30 17:39:56 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/marshaller/NioEscapeHandler.java	Thu Jul 30 17:39:56 2009
+@@ -31,19 +31,19 @@
+ 
+ /**
+  * Uses JDK1.4 NIO functionality to escape characters smartly.
+- * 
++ *
+  * @since 1.0.1
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+ public class NioEscapeHandler implements CharacterEscapeHandler {
+-    
++
+     private final CharsetEncoder encoder;
+-    
++
+     // exposing those variations upset javac 1.3.1, since it needs to
+     // know about those classes to determine which overloaded version
+     // of the method it wants to use. So comment it out for the compatibility.
+-    
++
+ //    public NioEscapeHandler(CharsetEncoder _encoder) {
+ //        this.encoder = _encoder;
+ //        if(encoder==null)
+@@ -53,12 +53,12 @@
+ //    public NioEscapeHandler(Charset charset) {
+ //        this(charset.newEncoder());
+ //    }
+-    
++
+     public NioEscapeHandler(String charsetName) {
+ //        this(Charset.forName(charsetName));
+-        this.encoder = Charset.forName(charsetName).newEncoder(); 
++        this.encoder = Charset.forName(charsetName).newEncoder();
+     }
+-    
++
+     public void escape(char[] ch, int start, int length, boolean isAttVal, Writer out) throws IOException {
+         int limit = start+length;
+         for (int i = start; i < limit; i++) {
+--- old/src/share/classes/com/sun/xml/internal/bind/marshaller/SAX2DOMEx.java	Thu Jul 30 17:40:00 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/marshaller/SAX2DOMEx.java	Thu Jul 30 17:39:59 2009
+@@ -49,7 +49,7 @@
+ 
+ /**
+  * Builds a DOM tree from SAX2 events.
+- * 
++ *
+  * @author  Vivek Pandey
+  * @since 1.0
+  */
+@@ -87,7 +87,7 @@
+         DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+         factory.setNamespaceAware(true);
+         factory.setValidating(false);
+-        
++
+         document = factory.newDocumentBuilder().newDocument();
+         node = document;
+         nodeStack.push( document );
+@@ -109,11 +109,11 @@
+ 
+     public void startElement(String namespace, String localName, String qName, Attributes attrs){
+         Node parent = nodeStack.peek();
+-        
++
+         // some broken DOM implementatino (we confirmed it with SAXON)
+         // return null from this method.
+         Element element = document.createElementNS(namespace, qName);
+-        
++
+         if( element==null ) {
+             // if so, report an user-friendly error message,
+             // rather than dying mysteriously with NPE.
+@@ -122,18 +122,18 @@
+                     document.getClass().getName(),
+                     Which.which(document.getClass())));
+         }
+-        
++
+         // process namespace bindings
+         for( int i=0; i<unprocessedNamespaces.size(); i+=2 ) {
+             String prefix = unprocessedNamespaces.get(i+0);
+             String uri = unprocessedNamespaces.get(i+1);
+-            
++
+             String qname;
+             if( "".equals(prefix) || prefix==null )
+                 qname = "xmlns";
+             else
+                 qname = "xmlns:"+prefix;
+-            
++
+             // older version of Xerces (I confirmed that the bug is gone with Xerces 2.4.0)
+             // have a problem of re-setting the same namespace attribute twice.
+             // work around this bug removing it first.
+@@ -148,12 +148,12 @@
+                 element.removeAttributeNS("http://www.w3.org/2000/xmlns/",qname);
+             }
+             // workaround until here
+-            
++
+             element.setAttributeNS("http://www.w3.org/2000/xmlns/",qname, uri);
+         }
+         unprocessedNamespaces.clear();
+-        
+-        
++
++
+         int length = attrs.getLength();
+         for(int i=0;i<length;i++){
+             String namespaceuri = attrs.getURI(i);
+@@ -166,7 +166,7 @@
+         // push this node onto stack
+         nodeStack.push(element);
+     }
+-    
++
+     public void endElement(String namespace, String localName, String qName){
+         nodeStack.pop();
+     }
+@@ -186,7 +186,7 @@
+     public void processingInstruction(String target, String data) throws org.xml.sax.SAXException{
+         Node parent = nodeStack.peek();
+         Node node = document.createProcessingInstruction(target, data);
+-        parent.appendChild(node);	
++        parent.appendChild(node);
+     }
+ 
+     public void setDocumentLocator(Locator locator) {
+--- old/src/share/classes/com/sun/xml/internal/bind/marshaller/XMLWriter.java	Thu Jul 30 17:40:03 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/marshaller/XMLWriter.java	Thu Jul 30 17:40:03 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ // @@3RD PARTY CODE@@
+ 
+ // XMLWriter.java - serialize an XML document.
+@@ -28,7 +29,7 @@
+ // Written by David Megginson, david@megginson.com
+ // NO WARRANTY!  This class is in the public domain.
+ 
+-// Id: XMLWriter.java,v 1.5 2000/09/17 01:08:16 david Exp 
++// Id: XMLWriter.java,v 1.5 2000/09/17 01:08:16 david Exp
+ 
+ package com.sun.xml.internal.bind.marshaller;
+ 
+@@ -56,7 +57,7 @@
+  * state at any point in a filter chain), and it can be
+  * used directly as a ContentHandler for a SAX2 XMLReader.</p>
+  *
+- * <p>The client creates a document by invoking the methods for 
++ * <p>The client creates a document by invoking the methods for
+  * standard SAX2 events, always beginning with the
+  * {@link #startDocument startDocument} method and ending with
+  * the {@link #endDocument endDocument} method.  There are convenience
+@@ -75,7 +76,7 @@
+  * </pre>
+  *
+  * <p>Except that it is more efficient because it does not allocate
+- * a new empty attribute list each time.  The following code will send 
++ * a new empty attribute list each time.  The following code will send
+  * a simple XML document to standard output:</p>
+  *
+  * <pre>
+@@ -132,8 +133,8 @@
+  * explicitly to add newlines or indentation.  Alternatively, you
+  * can use {@link DataWriter}, which
+  * is derived from this class -- it is optimized for writing
+- * purely data-oriented (or field-oriented) XML, and does automatic 
+- * linebreaks and indentation (but does not support mixed content 
++ * purely data-oriented (or field-oriented) XML, and does automatic
++ * linebreaks and indentation (but does not support mixed content
+  * properly).</p>
+  *
+  *
+@@ -141,8 +142,8 @@
+  *
+  * <p>The writer contains extensive support for XML Namespaces, so that
+  * a client application does not have to keep track of prefixes and
+- * supply <var>xmlns</var> attributes.  By default, the XML writer will 
+- * generate Namespace declarations in the form _NS1, _NS2, etc., wherever 
++ * supply <var>xmlns</var> attributes.  By default, the XML writer will
++ * generate Namespace declarations in the form _NS1, _NS2, etc., wherever
+  * they are needed, as in the following example:</p>
+  *
+  * <pre>
+@@ -243,7 +244,7 @@
+  * </pre>
+  *
+  * <p>This approach is also useful for declaring Namespace prefixes
+- * that be used by qualified names appearing in attribute values or 
++ * that be used by qualified names appearing in attribute values or
+  * character data.</p>
+  *
+  * @author David Megginson, david@megginson.com
+@@ -260,8 +261,8 @@
+     ////////////////////////////////////////////////////////////////////
+ 
+ 
+-    
+ 
++
+     /**
+      * Create a new XML writer.
+      *
+@@ -269,11 +270,11 @@
+      *
+      * @param writer
+      *      The output destination, or null to use standard output.
+-     * @param encoding 
++     * @param encoding
+      *      If non-null string is specified, it is written as a part
+      *      of the XML declaration.
+      */
+-    public XMLWriter (Writer writer, String encoding, CharacterEscapeHandler _escapeHandler ) 
++    public XMLWriter (Writer writer, String encoding, CharacterEscapeHandler _escapeHandler )
+     {
+         init(writer,encoding);
+         this.escapeHandler = _escapeHandler;
+@@ -280,11 +281,11 @@
+     }
+ 
+     public XMLWriter (Writer writer, String encoding ) {
+-        this( writer, encoding, DumbEscapeHandler.theInstance ); 
++        this( writer, encoding, DumbEscapeHandler.theInstance );
+     }
+-    
+ 
+ 
++
+     /**
+      * Internal initialization method.
+      *
+@@ -299,7 +300,7 @@
+     }
+ 
+ 
+-
++
+     ////////////////////////////////////////////////////////////////////
+     // Public methods.
+     ////////////////////////////////////////////////////////////////////
+@@ -329,8 +330,8 @@
+         elementLevel = 0;
+         startTagIsClosed = true;
+     }
+-    
+ 
++
+     /**
+      * Flush the output.
+      *
+@@ -346,12 +347,12 @@
+      * @see #reset()
+      */
+     public void flush ()
+-        throws IOException 
++        throws IOException
+     {
+         output.flush();
+     }
+-    
+ 
++
+     /**
+      * Set a new output destination for the document.
+      *
+@@ -368,38 +369,38 @@
+         }
+         encoding = _encoding;
+     }
+-    
++
+     /**
+      * Set whether the writer should print out the XML declaration
+      * (&lt;?xml version='1.0' ... ?>).
+      * <p>
+-     * This option is set to true by default. 
++     * This option is set to true by default.
+      */
+     public void setXmlDecl( boolean _writeXmlDecl ) {
+         this.writeXmlDecl = _writeXmlDecl;
+     }
+-    
++
+     /**
+      * Sets the header string.
+-     * 
++     *
+      * This string will be written right after the xml declaration
+      * without any escaping. Useful for generating a boiler-plate
+      * DOCTYPE decl, PIs, and comments.
+-     * 
++     *
+      * @param _header
+-     *      passing null will work as if the empty string is passed.   
++     *      passing null will work as if the empty string is passed.
+      */
+     public void setHeader( String _header ) {
+         this.header = _header;
+     }
+-    
+ 
++
+     private final HashMap<String,String> locallyDeclaredPrefix = new HashMap<String,String>();
+     public void startPrefixMapping( String prefix, String uri ) throws SAXException {
+         locallyDeclaredPrefix.put(prefix,uri);
+     }
+-    
+ 
++
+     ////////////////////////////////////////////////////////////////////
+     // Methods from org.xml.sax.ContentHandler.
+     ////////////////////////////////////////////////////////////////////
+@@ -419,7 +420,7 @@
+     {
+         try {
+             reset();
+-            
++
+             if(writeXmlDecl) {
+                 String e="";
+                 if(encoding!=null)
+@@ -427,10 +428,10 @@
+ 
+                 writeXmlDecl("<?xml version=\"1.0\""+e +" standalone=\"yes\"?>");
+             }
+-            
++
+             if(header!=null)
+                 write(header);
+-            
++
+             super.startDocument();
+         } catch( IOException e ) {
+             throw new SAXException(e);
+@@ -462,8 +463,8 @@
+             throw new SAXException(e);
+         }
+     }
+-    
+ 
++
+     /**
+      * Write a start tag.
+      *
+@@ -497,7 +498,7 @@
+             write('<');
+             write(qName);
+             writeAttributes(atts);
+-            
++
+             // declare namespaces specified by the startPrefixMapping methods
+             if(!locallyDeclaredPrefix.isEmpty()) {
+                 for (Map.Entry<String,String> e : locallyDeclaredPrefix.entrySet()) {
+@@ -570,8 +571,8 @@
+             throw new SAXException(e);
+         }
+     }
+-    
+ 
++
+     /**
+      * Write character data.
+      *
+@@ -599,8 +600,8 @@
+             throw new SAXException(e);
+         }
+     }
+-    
+ 
++
+     /**
+      * Write ignorable whitespace.
+      *
+@@ -624,9 +625,9 @@
+             throw new SAXException(e);
+         }
+     }
+-    
+ 
+ 
++
+     /**
+      * Write a processing instruction.
+      *
+@@ -660,21 +661,21 @@
+             throw new SAXException(e);
+         }
+     }
+-    
+ 
+-
++
++
+     ////////////////////////////////////////////////////////////////////
+     // Convenience methods.
+     ////////////////////////////////////////////////////////////////////
+-    
+ 
+ 
++
+     /**
+      * Start a new element without a qname or attributes.
+      *
+      * <p>This method will provide a default empty attribute
+-     * list and an empty string for the qualified name.  
+-     * It invokes {@link 
++     * list and an empty string for the qualified name.
++     * It invokes {@link
+      * #startElement(String, String, String, Attributes)}
+      * directly.</p>
+      *
+@@ -881,14 +882,14 @@
+     }
+ 
+ 
+-
++
+     ////////////////////////////////////////////////////////////////////
+     // Internal methods.
+     ////////////////////////////////////////////////////////////////////
+-    
+ 
+-    
+ 
++
++
+     /**
+      * Write a raw character.
+      *
+@@ -897,8 +898,8 @@
+     protected final void write (char c) throws IOException {
+         output.write(c);
+     }
+-    
+ 
++
+     /**
+      * Write a raw string.
+      */
+@@ -951,7 +952,7 @@
+     private final Attributes EMPTY_ATTS = new AttributesImpl();
+ 
+ 
+-
++
+     ////////////////////////////////////////////////////////////////////
+     // Internal state.
+     ////////////////////////////////////////////////////////////////////
+@@ -966,7 +967,7 @@
+      * , PIs, and comments.
+      */
+     private String header=null;
+-    
++
+     private final CharacterEscapeHandler escapeHandler;
+ 
+     private boolean startTagIsClosed = true;
+--- old/src/share/classes/com/sun/xml/internal/bind/unmarshaller/DOMScanner.java	Thu Jul 30 17:40:07 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/unmarshaller/DOMScanner.java	Thu Jul 30 17:40:06 2009
+@@ -47,7 +47,7 @@
+ 
+ /**
+  * Visits a W3C DOM tree and generates SAX2 events from it.
+- * 
++ *
+  * <p>
+  * This class is just intended to be used by {@link AbstractUnmarshallerImpl}.
+  * The javax.xml.bind.helpers package is generally a wrong place to put
+@@ -54,19 +54,18 @@
+  * classes like this.
+  *
+  * @author <ul><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li></ul>
+- * @version $Revision: 1.6 $ $Date: 2006/04/24 15:27:52 $
+  * @since JAXB1.0
+  */
+ public class DOMScanner implements LocatorEx,InfosetScanner/*<Node> --- but can't do this to protect 1.0 clients, or can I? */
+ {
+-    
++
+     /** reference to the current node being scanned - used for determining
+      *  location info for validation events */
+     private Node currentNode = null;
+-    
++
+     /** To save memory, only one instance of AttributesImpl will be used. */
+     private final AttributesImpl atts = new AttributesImpl();
+-    
++
+     /** This handler will receive SAX2 events. */
+     private ContentHandler receiver=null;
+ 
+@@ -74,8 +73,8 @@
+ 
+     public DOMScanner() {
+     }
+-    
+ 
++
+     /**
+      * Configures the locator object that the SAX {@link ContentHandler} will see.
+      */
+@@ -90,11 +89,11 @@
+             scan( (Element)node );
+         }
+     }
+-    
++
+     public void scan( Document doc ) throws SAXException {
+         scan( doc.getDocumentElement() );
+     }
+-    
++
+     public void scan( Element e) throws SAXException {
+         setCurrentLocation( e );
+ 
+@@ -103,28 +102,28 @@
+ 
+         NamespaceSupport nss = new NamespaceSupport();
+         buildNamespaceSupport( nss, e.getParentNode() );
+-        
++
+         for( Enumeration en = nss.getPrefixes(); en.hasMoreElements(); ) {
+             String prefix = (String)en.nextElement();
+             receiver.startPrefixMapping( prefix, nss.getURI(prefix) );
+         }
+-        
++
+         visit(e);
+-        
++
+         for( Enumeration en = nss.getPrefixes(); en.hasMoreElements(); ) {
+             String prefix = (String)en.nextElement();
+             receiver.endPrefixMapping( prefix );
+         }
+-        
+-        
++
++
+         setCurrentLocation( e );
+         receiver.endDocument();
+     }
+-        
++
+     /**
+      * Parses a subtree starting from the element e and
+      * reports SAX2 events to the specified handler.
+-     * 
++     *
+      * @deprecated in JAXB 2.0
+      *      Use {@link #scan(Element)}
+      */
+@@ -131,21 +130,21 @@
+     public void parse( Element e, ContentHandler handler ) throws SAXException {
+         // it might be better to set receiver at the constructor.
+         receiver = handler;
+-        
++
+         setCurrentLocation( e );
+         receiver.startDocument();
+-        
++
+         receiver.setDocumentLocator(locator);
+         visit(e);
+-        
++
+         setCurrentLocation( e );
+         receiver.endDocument();
+     }
+-    
++
+     /**
+      * Similar to the parse method but it visits the ancestor nodes
+      * and properly emulate the all in-scope namespace declarations.
+-     * 
++     *
+      * @deprecated in JAXB 2.0
+      *      Use {@link #scan(Element)}
+      */
+@@ -153,7 +152,7 @@
+         setContentHandler(handler);
+         scan(e);
+     }
+-    
++
+     /**
+      * Recursively visit ancestors and build up {@link NamespaceSupport} oject.
+      */
+@@ -160,9 +159,9 @@
+     private void buildNamespaceSupport(NamespaceSupport nss, Node node) {
+         if(node==null || node.getNodeType()!=Node.ELEMENT_NODE)
+             return;
+-            
++
+         buildNamespaceSupport( nss, node.getParentNode() );
+-        
++
+         nss.pushContext();
+         NamedNodeMap atts = node.getAttributes();
+         for( int i=0; i<atts.getLength(); i++ ) {
+@@ -184,10 +183,10 @@
+     public void visit( Element e ) throws SAXException {
+         setCurrentLocation( e );
+         final NamedNodeMap attributes = e.getAttributes();
+-        
++
+         atts.clear();
+         int len = attributes==null ? 0: attributes.getLength();
+-        
++
+         for( int i=len-1; i>=0; i-- ) {
+             Attr a = (Attr)attributes.item(i);
+             String name = a.getName();
+@@ -205,10 +204,10 @@
+                 }
+                 continue;
+             }
+-            
++
+             String uri = a.getNamespaceURI();
+             if(uri==null)   uri="";
+-            
++
+             String local = a.getLocalName();
+             if(local==null) local = a.getName();
+             // add other attributes to the attribute list
+@@ -220,7 +219,7 @@
+                 "CDATA",
+                 a.getValue());
+         }
+-        
++
+         String uri = e.getNamespaceURI();
+         if(uri==null)   uri="";
+         String local = e.getLocalName();
+@@ -227,18 +226,18 @@
+         String qname = e.getTagName();
+         if(local==null) local = qname;
+         receiver.startElement( uri, local, qname, atts );
+-        
++
+         // visit its children
+         NodeList children = e.getChildNodes();
+         int clen = children.getLength();
+         for( int i=0; i<clen; i++ )
+             visit(children.item(i));
+-        
+-        
+-        
++
++
++
+         setCurrentLocation( e );
+         receiver.endElement( uri, local, qname );
+-        
++
+         // call the endPrefixMapping method
+         for( int i=len-1; i>=0; i-- ) {
+             Attr a = (Attr)attributes.item(i);
+@@ -251,10 +250,10 @@
+             }
+         }
+     }
+-    
++
+     private void visit( Node n ) throws SAXException {
+         setCurrentLocation( n );
+-        
++
+         // if a case statement gets too big, it should be made into a separate method.
+         switch(n.getNodeType()) {
+         case Node.CDATA_SECTION_NODE:
+@@ -274,11 +273,11 @@
+             break;
+         }
+     }
+-    
++
+     private void setCurrentLocation( Node currNode ) {
+         currentNode = currNode;
+     }
+-    
++
+     /**
+      * The same as {@link #getCurrentElement()} but
+      * better typed.
+--- old/src/share/classes/com/sun/xml/internal/bind/unmarshaller/InfosetScanner.java	Thu Jul 30 17:40:11 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/unmarshaller/InfosetScanner.java	Thu Jul 30 17:40:10 2009
+@@ -34,22 +34,22 @@
+ 
+ /**
+  * Visits a DOM-ish API and generates SAX events.
+- * 
++ *
+  * <p>
+  * This interface is not tied to any particular DOM API.
+  * Used by the {@link Binder}.
+- * 
++ *
+  * <p>
+  * Since we are parsing a DOM-ish tree, I don't think this
+  * scanner itself will ever find an error, so this class
+  * doesn't have its own error reporting scheme.
+- * 
++ *
+  * <p>
+  * This interface <b>MAY NOT</b> be implemented by the generated
+  * runtime nor the generated code. We may add new methods on
+  * this interface later. This is to be implemented by the static runtime
+  * only.
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  * @since 2.0
+@@ -58,10 +58,10 @@
+     /**
+      * Parses the given DOM-ish element/document and generates
+      * SAX events.
+-     * 
++     *
+      * @throws ClassCastException
+      *      If the type of the node is not known to this implementation.
+-     * 
++     *
+      * @throws SAXException
+      *      If the {@link ContentHandler} throws a {@link SAXException}.
+      *      Do not throw an exception just because the scanner failed
+@@ -68,26 +68,26 @@
+      *      (if that can happen we need to change the API.)
+      */
+     void scan( XmlNode node ) throws SAXException;
+-    
++
+     /**
+      * Sets the {@link ContentHandler}.
+-     * 
++     *
+      * This handler receives the SAX events.
+      */
+     void setContentHandler( ContentHandler handler );
+     ContentHandler getContentHandler();
+-    
++
+     /**
+      * Gets the current element we are parsing.
+-     * 
++     *
+      * <p>
+      * This method could
+      * be called from the {@link ContentHandler#startElement(String, String, String, Attributes)}
+      * or {@link ContentHandler#endElement(String, String, String)}.
+-     * 
++     *
+      * <p>
+      * Otherwise the behavior of this method is undefined.
+-     * 
++     *
+      * @return
+      *      never return null.
+      */
+--- old/src/share/classes/com/sun/xml/internal/bind/unmarshaller/Messages.java	Thu Jul 30 17:40:14 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/unmarshaller/Messages.java	Thu Jul 30 17:40:13 2009
+@@ -30,7 +30,7 @@
+ 
+ /**
+  * Formats error messages.
+- * 
++ *
+  * @since JAXB1.0
+  */
+ public class Messages
+@@ -38,27 +38,27 @@
+     public static String format( String property ) {
+         return format( property, null );
+     }
+-    
++
+     public static String format( String property, Object arg1 ) {
+         return format( property, new Object[]{arg1} );
+     }
+-    
++
+     public static String format( String property, Object arg1, Object arg2 ) {
+         return format( property, new Object[]{arg1,arg2} );
+     }
+-    
++
+     public static String format( String property, Object arg1, Object arg2, Object arg3 ) {
+         return format( property, new Object[]{arg1,arg2,arg3} );
+     }
+-    
++
+     // add more if necessary.
+-    
++
+     /** Loads a string resource and formats it with specified arguments. */
+     public static String format( String property, Object[] args ) {
+         String text = ResourceBundle.getBundle(Messages.class.getName()).getString(property);
+         return MessageFormat.format(text,args);
+     }
+-    
++
+ //
+ //
+ // Message resources
+@@ -78,23 +78,23 @@
+ 
+     public static final String UNEXPECTED_TEXT =// arg:1
+         "ContentHandlerEx.UnexpectedText";
+-        
++
+     public static final String UNEXPECTED_LEAVE_CHILD = // 0 args
+         "ContentHandlerEx.UnexpectedLeaveChild";
+-        
++
+     public static final String UNEXPECTED_ROOT_ELEMENT = // 1 arg
+         "SAXUnmarshallerHandlerImpl.UnexpectedRootElement";
+-        
++
+     public static final String UNEXPECTED_ROOT_ELEMENT2 = // 3 arg
+         "SAXUnmarshallerHandlerImpl.UnexpectedRootElement2";
+-        
++
+     public static final String UNDEFINED_PREFIX = // 1 arg
+         "Util.UndefinedPrefix";
+ 
+     public static final String NULL_READER = // 0 args
+         "Unmarshaller.NullReader";
+-    
++
+     public static final String ILLEGAL_READER_STATE = // 1 arg
+         "Unmarshaller.IllegalReaderState";
+-    
++
+ }
+--- old/src/share/classes/com/sun/xml/internal/bind/unmarshaller/Messages.properties	Thu Jul 30 17:40:18 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/unmarshaller/Messages.properties	Thu Jul 30 17:40:17 2009
+@@ -28,36 +28,34 @@
+ #
+ 
+ ContentHandlerEx.UnexpectedEnterElement = \
+-	Unexpected element '{'{0}'}':{1}
++        Unexpected element '{'{0}'}':{1}
+ 
+ ContentHandlerEx.UnexpectedLeaveElement = \
+-	Unexpected end of element '{'{0}'}':{1}
++        Unexpected end of element '{'{0}'}':{1}
+ 
+ ContentHandlerEx.UnexpectedEnterAttribute = \
+-	Unexpected attribute '{'{0}'}':{1}
++        Unexpected attribute '{'{0}'}':{1}
+ 
+ ContentHandlerEx.UnexpectedLeaveAttribute = \
+-	Unexpected end of attribute '{'{0}'}':{1}
++        Unexpected end of attribute '{'{0}'}':{1}
+ 
+ ContentHandlerEx.UnexpectedText = \
+-	Unexpected text "{0}"
++        Unexpected text "{0}"
+ 
+ ContentHandlerEx.UnexpectedLeaveChild = \
+-	compiler error(unexpectedLeaveChild)
+-	
++        compiler error(unexpectedLeaveChild)
++
+ SAXUnmarshallerHandlerImpl.UnexpectedRootElement = \
+-	unexpected root element {0}
+-	
++        unexpected root element {0}
++
+ SAXUnmarshallerHandlerImpl.UnexpectedRootElement2 = \
+-	unexpected root element (uri:"{0}", local:"{1}"). Expected elements are {2}
+-	
++        unexpected root element (uri:"{0}", local:"{1}"). Expected elements are {2}
++
+ Util.UndefinedPrefix = \
+-	undefined prefix: {0}
+-	
++        undefined prefix: {0}
++
+ Unmarshaller.NullReader = \
+-	reader can not be null	
+-	
++        reader can not be null
++
+ Unmarshaller.IllegalReaderState = \
+-	reader must be on a START_ELEMENT event, not a {0} event
+-	
+- 
++        reader must be on a START_ELEMENT event, not a {0} event
+--- old/src/share/classes/com/sun/xml/internal/bind/unmarshaller/Patcher.java	Thu Jul 30 17:40:21 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/unmarshaller/Patcher.java	Thu Jul 30 17:40:20 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.unmarshaller;
+ 
+ import org.xml.sax.SAXException;
+--- old/src/share/classes/com/sun/xml/internal/bind/util/AttributesImpl.java	Thu Jul 30 17:40:25 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/util/AttributesImpl.java	Thu Jul 30 17:40:24 2009
+@@ -27,7 +27,6 @@
+ // http://www.saxproject.org
+ // Written by David Megginson
+ // NO WARRANTY!  This class is in the public domain.
+-// $Id: AttributesImpl.java,v 1.2 2005/05/11 19:44:28 kohsuke Exp $
+ package com.sun.xml.internal.bind.util;
+ 
+ import org.xml.sax.Attributes;
+@@ -44,8 +43,8 @@
+  * </blockquote>
+  *
+  * <p>This class provides a default implementation of the SAX2
+- * {@link org.xml.sax.Attributes Attributes} interface, with the 
+- * addition of manipulators so that the list can be modified or 
++ * {@link org.xml.sax.Attributes Attributes} interface, with the
++ * addition of manipulators so that the list can be modified or
+  * reused.</p>
+  *
+  * <p>There are two typical uses of this class:</p>
+@@ -56,11 +55,11 @@
+  * <li>to construct or modify an Attributes object in a SAX2 driver or filter.</li>
+  * </ol>
+  *
+- * <p>This class replaces the now-deprecated SAX1 {@link 
++ * <p>This class replaces the now-deprecated SAX1 {@link
+  * org.xml.sax.helpers.AttributeListImpl AttributeListImpl}
+  * class; in addition to supporting the updated Attributes
+  * interface rather than the deprecated {@link org.xml.sax.AttributeList
+- * AttributeList} interface, it also includes a much more efficient 
++ * AttributeList} interface, it also includes a much more efficient
+  * implementation using a single array rather than a set of Vectors.</p>
+  *
+  * @since JAXB1.0
+@@ -71,7 +70,7 @@
+ public class AttributesImpl implements Attributes
+ {
+ 
+-
++
+     ////////////////////////////////////////////////////////////////////
+     // Constructors.
+     ////////////////////////////////////////////////////////////////////
+@@ -82,8 +81,8 @@
+      */
+     public AttributesImpl ()
+     {
+-	length = 0;
+-	data = null;
++        length = 0;
++        data = null;
+     }
+ 
+ 
+@@ -97,11 +96,11 @@
+      */
+     public AttributesImpl (Attributes atts)
+     {
+-	setAttributes(atts);
++        setAttributes(atts);
+     }
+ 
+ 
+-
++
+     ////////////////////////////////////////////////////////////////////
+     // Implementation of org.xml.sax.Attributes.
+     ////////////////////////////////////////////////////////////////////
+@@ -115,7 +114,7 @@
+      */
+     public int getLength ()
+     {
+-	return length;
++        return length;
+     }
+ 
+ 
+@@ -129,11 +128,11 @@
+      */
+     public String getURI (int index)
+     {
+-	if (index >= 0 && index < length) {
+-	    return data[index*5];
+-	} else {
+-	    return null;
+-	}
++        if (index >= 0 && index < length) {
++            return data[index*5];
++        } else {
++            return null;
++        }
+     }
+ 
+ 
+@@ -141,17 +140,17 @@
+      * Return an attribute's local name.
+      *
+      * @param index The attribute's index (zero-based).
+-     * @return The attribute's local name, the empty string if 
++     * @return The attribute's local name, the empty string if
+      *         none is available, or null if the index if out of range.
+      * @see org.xml.sax.Attributes#getLocalName(int)
+      */
+     public String getLocalName (int index)
+     {
+-	if (index >= 0 && index < length) {
+-	    return data[index*5+1];
+-	} else {
+-	    return null;
+-	}
++        if (index >= 0 && index < length) {
++            return data[index*5+1];
++        } else {
++            return null;
++        }
+     }
+ 
+ 
+@@ -159,17 +158,17 @@
+      * Return an attribute's qualified (prefixed) name.
+      *
+      * @param index The attribute's index (zero-based).
+-     * @return The attribute's qualified name, the empty string if 
++     * @return The attribute's qualified name, the empty string if
+      *         none is available, or null if the index is out of bounds.
+      * @see org.xml.sax.Attributes#getQName(int)
+      */
+     public String getQName (int index)
+     {
+-	if (index >= 0 && index < length) {
+-	    return data[index*5+2];
+-	} else {
+-	    return null;
+-	}
++        if (index >= 0 && index < length) {
++            return data[index*5+2];
++        } else {
++            return null;
++        }
+     }
+ 
+ 
+@@ -183,11 +182,11 @@
+      */
+     public String getType (int index)
+     {
+-	if (index >= 0 && index < length) {
+-	    return data[index*5+3];
+-	} else {
+-	    return null;
+-	}
++        if (index >= 0 && index < length) {
++            return data[index*5+3];
++        } else {
++            return null;
++        }
+     }
+ 
+ 
+@@ -200,11 +199,11 @@
+      */
+     public String getValue (int index)
+     {
+-	if (index >= 0 && index < length) {
+-	    return data[index*5+4];
+-	} else {
+-	    return null;
+-	}
++        if (index >= 0 && index < length) {
++            return data[index*5+4];
++        } else {
++            return null;
++        }
+     }
+ 
+ 
+@@ -223,13 +222,13 @@
+      */
+     public int getIndex (String uri, String localName)
+     {
+-	int max = length * 5;
+-	for (int i = 0; i < max; i += 5) {
+-	    if (data[i].equals(uri) && data[i+1].equals(localName)) {
+-		return i / 5;
+-	    }
+-	} 
+-	return -1;
++        int max = length * 5;
++        for (int i = 0; i < max; i += 5) {
++            if (data[i].equals(uri) && data[i+1].equals(localName)) {
++                return i / 5;
++            }
++        }
++        return -1;
+     }
+ 
+     /**
+@@ -255,13 +254,13 @@
+      */
+     public int getIndex (String qName)
+     {
+-	int max = length * 5;
+-	for (int i = 0; i < max; i += 5) {
+-	    if (data[i+2].equals(qName)) {
+-		return i / 5;
+-	    }
+-	} 
+-	return -1;
++        int max = length * 5;
++        for (int i = 0; i < max; i += 5) {
++            if (data[i+2].equals(qName)) {
++                return i / 5;
++            }
++        }
++        return -1;
+     }
+ 
+ 
+@@ -277,13 +276,13 @@
+      */
+     public String getType (String uri, String localName)
+     {
+-	int max = length * 5;
+-	for (int i = 0; i < max; i += 5) {
+-	    if (data[i].equals(uri) && data[i+1].equals(localName)) {
+-		return data[i+3];
+-	    }
+-	} 
+-	return null;
++        int max = length * 5;
++        for (int i = 0; i < max; i += 5) {
++            if (data[i].equals(uri) && data[i+1].equals(localName)) {
++                return data[i+3];
++            }
++        }
++        return null;
+     }
+ 
+ 
+@@ -297,13 +296,13 @@
+      */
+     public String getType (String qName)
+     {
+-	int max = length * 5;
+-	for (int i = 0; i < max; i += 5) {
+-	    if (data[i+2].equals(qName)) {
+-		return data[i+3];
+-	    }
+-	}
+-	return null;
++        int max = length * 5;
++        for (int i = 0; i < max; i += 5) {
++            if (data[i+2].equals(qName)) {
++                return data[i+3];
++            }
++        }
++        return null;
+     }
+ 
+ 
+@@ -319,13 +318,13 @@
+      */
+     public String getValue (String uri, String localName)
+     {
+-	int max = length * 5;
+-	for (int i = 0; i < max; i += 5) {
+-	    if (data[i].equals(uri) && data[i+1].equals(localName)) {
+-		return data[i+4];
+-	    }
+-	}
+-	return null;
++        int max = length * 5;
++        for (int i = 0; i < max; i += 5) {
++            if (data[i].equals(uri) && data[i+1].equals(localName)) {
++                return data[i+4];
++            }
++        }
++        return null;
+     }
+ 
+ 
+@@ -339,17 +338,17 @@
+      */
+     public String getValue (String qName)
+     {
+-	int max = length * 5;
+-	for (int i = 0; i < max; i += 5) {
+-	    if (data[i+2].equals(qName)) {
+-		return data[i+4];
+-	    }
+-	}
+-	return null;
++        int max = length * 5;
++        for (int i = 0; i < max; i += 5) {
++            if (data[i+2].equals(qName)) {
++                return data[i+4];
++            }
++        }
++        return null;
+     }
+ 
+ 
+-
++
+     ////////////////////////////////////////////////////////////////////
+     // Manipulators.
+     ////////////////////////////////////////////////////////////////////
+@@ -359,16 +358,16 @@
+      * Clear the attribute list for reuse.
+      *
+      * <p>Note that little memory is freed by this call:
+-     * the current array is kept so it can be 
++     * the current array is kept so it can be
+      * reused.</p>
+      */
+     public void clear ()
+     {
+-	if (data != null) {
+-	    for (int i = 0; i < (length * 5); i++)
+-		data [i] = null;
+-	}
+-	length = 0;
++        if (data != null) {
++            for (int i = 0; i < (length * 5); i++)
++                data [i] = null;
++        }
++        length = 0;
+     }
+ 
+ 
+@@ -377,7 +376,7 @@
+      *
+      * <p>It may be more efficient to reuse an existing object
+      * rather than constantly allocating new ones.</p>
+-     * 
++     *
+      * @param atts The attributes to copy.
+      */
+     public void setAttributes (Attributes atts)
+@@ -393,7 +392,7 @@
+                 data[i*5+3] = atts.getType(i);
+                 data[i*5+4] = atts.getValue(i);
+             }
+-	}
++        }
+     }
+ 
+ 
+@@ -415,15 +414,15 @@
+      * @param value The attribute value.
+      */
+     public void addAttribute (String uri, String localName, String qName,
+-			      String type, String value)
++                              String type, String value)
+     {
+-	ensureCapacity(length+1);
+-	data[length*5] = uri;
+-	data[length*5+1] = localName;
+-	data[length*5+2] = qName;
+-	data[length*5+3] = type;
+-	data[length*5+4] = value;
+-	length++;
++        ensureCapacity(length+1);
++        data[length*5] = uri;
++        data[length*5+1] = localName;
++        data[length*5+2] = qName;
++        data[length*5+3] = type;
++        data[length*5+4] = value;
++        length++;
+     }
+ 
+ 
+@@ -449,17 +448,17 @@
+      *            in the list.
+      */
+     public void setAttribute (int index, String uri, String localName,
+-			      String qName, String type, String value)
++                              String qName, String type, String value)
+     {
+-	if (index >= 0 && index < length) {
+-	    data[index*5] = uri;
+-	    data[index*5+1] = localName;
+-	    data[index*5+2] = qName;
+-	    data[index*5+3] = type;
+-	    data[index*5+4] = value;
+-	} else {
+-	    badIndex(index);
+-	}
++        if (index >= 0 && index < length) {
++            data[index*5] = uri;
++            data[index*5+1] = localName;
++            data[index*5+2] = qName;
++            data[index*5+3] = type;
++            data[index*5+4] = value;
++        } else {
++            badIndex(index);
++        }
+     }
+ 
+ 
+@@ -473,21 +472,21 @@
+      */
+     public void removeAttribute (int index)
+     {
+-	if (index >= 0 && index < length) {
+-	    if (index < length - 1) {
+-		System.arraycopy(data, (index+1)*5, data, index*5,
+-				 (length-index-1)*5);
+-	    }
+-	    index = (length - 1) * 5;
+-	    data [index++] = null;
+-	    data [index++] = null;
+-	    data [index++] = null;
+-	    data [index++] = null;
+-	    data [index] = null;
+-	    length--;
+-	} else {
+-	    badIndex(index);
+-	}
++        if (index >= 0 && index < length) {
++            if (index < length - 1) {
++                System.arraycopy(data, (index+1)*5, data, index*5,
++                                 (length-index-1)*5);
++            }
++            index = (length - 1) * 5;
++            data [index++] = null;
++            data [index++] = null;
++            data [index++] = null;
++            data [index++] = null;
++            data [index] = null;
++            length--;
++        } else {
++            badIndex(index);
++        }
+     }
+ 
+ 
+@@ -503,11 +502,11 @@
+      */
+     public void setURI (int index, String uri)
+     {
+-	if (index >= 0 && index < length) {
+-	    data[index*5] = uri;
+-	} else {
+-	    badIndex(index);
+-	}
++        if (index >= 0 && index < length) {
++            data[index*5] = uri;
++        } else {
++            badIndex(index);
++        }
+     }
+ 
+ 
+@@ -523,11 +522,11 @@
+      */
+     public void setLocalName (int index, String localName)
+     {
+-	if (index >= 0 && index < length) {
+-	    data[index*5+1] = localName;
+-	} else {
+-	    badIndex(index);
+-	}
++        if (index >= 0 && index < length) {
++            data[index*5+1] = localName;
++        } else {
++            badIndex(index);
++        }
+     }
+ 
+ 
+@@ -543,11 +542,11 @@
+      */
+     public void setQName (int index, String qName)
+     {
+-	if (index >= 0 && index < length) {
+-	    data[index*5+2] = qName;
+-	} else {
+-	    badIndex(index);
+-	}
++        if (index >= 0 && index < length) {
++            data[index*5+2] = qName;
++        } else {
++            badIndex(index);
++        }
+     }
+ 
+ 
+@@ -562,11 +561,11 @@
+      */
+     public void setType (int index, String type)
+     {
+-	if (index >= 0 && index < length) {
+-	    data[index*5+3] = type;
+-	} else {
+-	    badIndex(index);
+-	}
++        if (index >= 0 && index < length) {
++            data[index*5+3] = type;
++        } else {
++            badIndex(index);
++        }
+     }
+ 
+ 
+@@ -581,15 +580,15 @@
+      */
+     public void setValue (int index, String value)
+     {
+-	if (index >= 0 && index < length) {
+-	    data[index*5+4] = value;
+-	} else {
+-	    badIndex(index);
+-	}
++        if (index >= 0 && index < length) {
++            data[index*5+4] = value;
++        } else {
++            badIndex(index);
++        }
+     }
+ 
+ 
+-
++
+     ////////////////////////////////////////////////////////////////////
+     // Internal methods.
+     ////////////////////////////////////////////////////////////////////
+@@ -634,15 +633,15 @@
+      * @exception java.lang.ArrayIndexOutOfBoundsException Always.
+      */
+     private void badIndex (int index)
+-	throws ArrayIndexOutOfBoundsException
++        throws ArrayIndexOutOfBoundsException
+     {
+-	String msg =
+-	    "Attempt to modify attribute at illegal index: " + index;
+-	throw new ArrayIndexOutOfBoundsException(msg);
++        String msg =
++            "Attempt to modify attribute at illegal index: " + index;
++        throw new ArrayIndexOutOfBoundsException(msg);
+     }
+ 
+ 
+-
++
+     ////////////////////////////////////////////////////////////////////
+     // Internal state.
+     ////////////////////////////////////////////////////////////////////
+@@ -653,5 +652,3 @@
+ }
+ 
+ // end of AttributesImpl.java
+-
+-
+--- old/src/share/classes/com/sun/xml/internal/bind/util/ValidationEventLocatorExImpl.java	Thu Jul 30 17:40:28 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/util/ValidationEventLocatorExImpl.java	Thu Jul 30 17:40:28 2009
+@@ -22,11 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * @(#)$Id: ValidationEventLocatorExImpl.java,v 1.1 2005/04/15 20:03:50 kohsuke Exp $
+- */
+-
+-
+ package com.sun.xml.internal.bind.util;
+ 
+ import javax.xml.bind.helpers.ValidationEventLocatorImpl;
+@@ -34,25 +29,25 @@
+ import com.sun.xml.internal.bind.ValidationEventLocatorEx;
+ 
+ /**
+- * 
+- * 
++ *
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+ public class ValidationEventLocatorExImpl
+     extends ValidationEventLocatorImpl implements ValidationEventLocatorEx {
+-    
++
+     private final String fieldName;
+-        
++
+     public ValidationEventLocatorExImpl( Object target, String fieldName ) {
+         super(target);
+         this.fieldName = fieldName;
+     }
+-    
++
+     public String getFieldName() {
+         return fieldName;
+     }
+-    
++
+     /**
+      * Returns a nice string representation for better debug experience.
+      */
+@@ -71,7 +66,7 @@
+         buf.append(",field=");
+         buf.append(getFieldName());
+         buf.append("]");
+-        
++
+         return buf.toString();
+     }
+ }
+--- old/src/share/classes/com/sun/xml/internal/bind/util/Which.java	Thu Jul 30 17:40:32 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/util/Which.java	Thu Jul 30 17:40:31 2009
+@@ -22,11 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * @(#)$Id: Which.java,v 1.1 2005/04/15 20:03:51 kohsuke Exp $
+- */
+-
+-
+ package com.sun.xml.internal.bind.util;
+ 
+ import java.net.URL;
+@@ -33,7 +28,7 @@
+ 
+ /**
+  * Finds out where a class file is loaded from.
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+@@ -57,7 +52,7 @@
+         if(loader == null) {
+             loader = ClassLoader.getSystemClassLoader();
+         }
+-        
++
+         URL it = loader.getResource(classnameAsResource);
+         if (it != null) {
+             return it.toString();
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/ClassFactory.java	Thu Jul 30 17:40:35 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/ClassFactory.java	Thu Jul 30 17:40:34 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2;
+ 
+ import java.lang.reflect.Constructor;
+@@ -28,6 +29,7 @@
+ import java.lang.reflect.InvocationTargetException;
+ import java.lang.reflect.Method;
+ import java.lang.reflect.Modifier;
++import java.lang.ref.WeakReference;
+ import java.util.ArrayList;
+ import java.util.HashSet;
+ import java.util.LinkedList;
+@@ -61,9 +63,9 @@
+      *
+      * To avoid synchronization among threads, we use {@link ThreadLocal}.
+      */
+-    private static final ThreadLocal<Map<Class,Constructor>> tls = new ThreadLocal<Map<Class,Constructor>>() {
+-        public Map<Class, Constructor> initialValue() {
+-            return new WeakHashMap<Class,Constructor>();
++    private static final ThreadLocal<Map<Class, WeakReference<Constructor>>> tls = new ThreadLocal<Map<Class,WeakReference<Constructor>>>() {
++        public Map<Class,WeakReference<Constructor>> initialValue() {
++            return new WeakHashMap<Class,WeakReference<Constructor>>();
+         }
+     };
+ 
+@@ -71,8 +73,11 @@
+      * Creates a new instance of the class but throw exceptions without catching it.
+      */
+     public static <T> T create0( final Class<T> clazz ) throws IllegalAccessException, InvocationTargetException, InstantiationException {
+-        Map<Class,Constructor> m = tls.get();
+-        Constructor<T> cons = m.get(clazz);
++        Map<Class,WeakReference<Constructor>> m = tls.get();
++        Constructor<T> cons = null;
++        WeakReference<Constructor> consRef = m.get(clazz);
++        if(consRef!=null)
++            cons = consRef.get();
+         if(cons==null) {
+             try {
+                 cons = clazz.getDeclaredConstructor(emptyClass);
+@@ -101,7 +106,7 @@
+                 }
+             }
+ 
+-            m.put(clazz,cons);
++            m.put(clazz,new WeakReference<Constructor>(cons));
+         }
+ 
+         return cons.newInstance(emptyObject);
+@@ -142,11 +147,10 @@
+     /**
+      *  Call a method in the factory class to get the object.
+      */
+-    public static Object create(final Method method) {
+-        Object cons = null;
+-        Throwable errorMsg = null;
++    public static Object create(Method method) {
++        Throwable errorMsg;
+         try {
+-            cons = method.invoke(null, emptyObject);
++            return method.invoke(null, emptyObject);
+         } catch (InvocationTargetException ive) {
+             Throwable target = ive.getTargetException();
+ 
+@@ -170,15 +174,13 @@
+             logger.log(Level.INFO,"failed to create a new instance of "+method.getReturnType().getName(),eie);
+             errorMsg = eie;
+         }
+-        if (errorMsg != null){
+-            NoSuchMethodError exp;
+-            exp = new NoSuchMethodError(errorMsg.getMessage());
+-            exp.initCause(errorMsg);
+-            throw exp;
+-        }
+-        return cons;
++
++        NoSuchMethodError exp;
++        exp = new NoSuchMethodError(errorMsg.getMessage());
++        exp.initCause(errorMsg);
++        throw exp;
+     }
+-    
++
+     /**
+      * Infers the instanciable implementation class that can be assigned to the given field type.
+      *
+@@ -201,12 +203,4 @@
+         // and returns null
+         return null;
+     }
+-
+-    public static final Class[] COLLECTION_IMPL_CLASSES = new Class[] {
+-        ArrayList.class,
+-        LinkedList.class,
+-        HashSet.class,
+-        TreeSet.class,
+-        Stack.class,
+-    };
+ }
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/ContextFactory.java	Thu Jul 30 17:40:39 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/ContextFactory.java	Thu Jul 30 17:40:38 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2;
+ 
+ import java.io.BufferedReader;
+@@ -79,12 +80,16 @@
+         if(allNillable==null)
+             allNillable = false;
+ 
++        Boolean retainPropertyInfo = getPropertyValue(properties, JAXBRIContext.RETAIN_REFERENCE_TO_INFO, Boolean.class);
++        if(retainPropertyInfo==null)
++            retainPropertyInfo = false;
++
+         Boolean xmlAccessorFactorySupport = getPropertyValue(properties,
+            JAXBRIContext.XMLACCESSORFACTORY_SUPPORT,Boolean.class);
+         if(xmlAccessorFactorySupport==null){
+             xmlAccessorFactorySupport = false;
+-            Util.getClassLogger().log(Level.FINE, "Property " + 
+-                JAXBRIContext.XMLACCESSORFACTORY_SUPPORT + 
++            Util.getClassLogger().log(Level.FINE, "Property " +
++                JAXBRIContext.XMLACCESSORFACTORY_SUPPORT +
+                 "is not active.  Using JAXB's implementation");
+         }
+ 
+@@ -103,7 +108,7 @@
+         }
+ 
+         return createContext(classes,Collections.<TypeReference>emptyList(),
+-                subclassReplacements,defaultNsUri,c14nSupport,ar,xmlAccessorFactorySupport,allNillable);
++                subclassReplacements,defaultNsUri,c14nSupport,ar,xmlAccessorFactorySupport,allNillable, retainPropertyInfo);
+     }
+ 
+     /**
+@@ -120,12 +125,22 @@
+             return type.cast(o);
+     }
+ 
+-    public static JAXBRIContext createContext( Class[] classes, 
+-            Collection<TypeReference> typeRefs, Map<Class,Class> subclassReplacements, 
+-            String defaultNsUri, boolean c14nSupport, RuntimeAnnotationReader ar, 
+-            boolean xmlAccessorFactorySupport, boolean allNillable) throws JAXBException {
+-        return new JAXBContextImpl(classes,typeRefs,subclassReplacements,defaultNsUri,
+-                c14nSupport,ar, xmlAccessorFactorySupport,allNillable);
++    public static JAXBRIContext createContext( Class[] classes,
++            Collection<TypeReference> typeRefs, Map<Class,Class> subclassReplacements,
++            String defaultNsUri, boolean c14nSupport, RuntimeAnnotationReader ar,
++            boolean xmlAccessorFactorySupport, boolean allNillable, boolean retainPropertyInfo) throws JAXBException {
++
++        JAXBContextImpl.JAXBContextBuilder builder = new JAXBContextImpl.JAXBContextBuilder();
++        builder.setClasses(classes);
++        builder.setTypeRefs(typeRefs);
++        builder.setSubclassReplacements(subclassReplacements);
++        builder.setDefaultNsUri(defaultNsUri);
++        builder.setC14NSupport(c14nSupport);
++        builder.setAnnotationReader(ar);
++        builder.setXmlAccessorFactorySupport(xmlAccessorFactorySupport);
++        builder.setAllNillable(allNillable);
++        builder.setRetainPropertyInfo(retainPropertyInfo);
++        return builder.build();
+     }
+ 
+     /**
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/Messages.properties	Thu Jul 30 17:40:42 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/Messages.properties	Thu Jul 30 17:40:42 2009
+@@ -43,4 +43,3 @@
+ 
+ INVALID_TYPE_IN_MAP = \
+     Map contains a wrong type
+- 
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/TODO.java	Thu Jul 30 17:40:46 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/TODO.java	Thu Jul 30 17:40:45 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2;
+ 
+ /**
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/WellKnownNamespace.java	Thu Jul 30 17:40:49 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/WellKnownNamespace.java	Thu Jul 30 17:40:49 2009
+@@ -26,7 +26,7 @@
+ 
+ /**
+  * Well-known namespace URIs.
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  * @since 2.0
+@@ -48,10 +48,10 @@
+ 
+     public static final String XOP =
+         "http://www.w3.org/2004/08/xop/include";
+-    
++
+     public static final String SWA_URI =
+         "http://ws-i.org/profiles/basic/1.1/xsd";
+-    
++
+     public static final String XML_MIME_URI = "http://www.w3.org/2005/05/xmlmime";
+ 
+     public static final String JAXB = "http://java.sun.com/xml/ns/jaxb";
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/bytecode/ClassTailor.java	Thu Jul 30 17:40:53 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/bytecode/ClassTailor.java	Thu Jul 30 17:40:52 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.bytecode;
+ 
+ import java.io.ByteArrayOutputStream;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/AbstractInlineAnnotationReaderImpl.java	Thu Jul 30 17:40:56 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/AbstractInlineAnnotationReaderImpl.java	Thu Jul 30 17:40:56 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.annotation;
+ 
+ import java.lang.annotation.Annotation;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/AnnotationReader.java	Thu Jul 30 17:41:00 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/AnnotationReader.java	Thu Jul 30 17:40:59 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.annotation;
+ 
+ import java.lang.annotation.Annotation;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/AnnotationSource.java	Thu Jul 30 17:41:03 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/AnnotationSource.java	Thu Jul 30 17:41:03 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.annotation;
+ 
+ import java.lang.annotation.Annotation;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/ClassLocatable.java	Thu Jul 30 17:41:07 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/ClassLocatable.java	Thu Jul 30 17:41:06 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.annotation;
+ 
+ import com.sun.xml.internal.bind.v2.model.nav.Navigator;
+@@ -29,7 +30,7 @@
+ 
+ /**
+  * {@link Locatable} implementation for a class.
+- * 
++ *
+  * @author Kohsuke Kawaguchi
+  */
+ public class ClassLocatable<C> implements Locatable {
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/FieldLocatable.java	Thu Jul 30 17:41:10 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/FieldLocatable.java	Thu Jul 30 17:41:10 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.annotation;
+ 
+ import com.sun.xml.internal.bind.v2.model.nav.Navigator;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/Init.java	Thu Jul 30 17:41:14 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/Init.java	Thu Jul 30 17:41:13 2009
+@@ -29,7 +29,7 @@
+ 
+ 
+     static Quick[] getAll() {
+-        return new Quick[] {new XmlTypeQuick(null, null), new XmlSchemaQuick(null, null), new XmlElementRefsQuick(null, null), new XmlValueQuick(null, null), new XmlElementDeclQuick(null, null), new XmlElementRefQuick(null, null), new XmlTransientQuick(null, null), new XmlElementQuick(null, null), new XmlAttributeQuick(null, null), new XmlRootElementQuick(null, null), new XmlEnumQuick(null, null)};
++        return new Quick[] {new XmlSchemaTypeQuick(null, null), new XmlElementDeclQuick(null, null), new XmlEnumQuick(null, null), new XmlTransientQuick(null, null), new XmlSchemaQuick(null, null), new XmlRootElementQuick(null, null), new XmlElementQuick(null, null), new XmlTypeQuick(null, null), new XmlElementRefQuick(null, null), new XmlElementRefsQuick(null, null), new XmlAttributeQuick(null, null), new XmlValueQuick(null, null)};
+     }
+ 
+ }
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/Locatable.java	Thu Jul 30 17:41:17 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/Locatable.java	Thu Jul 30 17:41:17 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.annotation;
+ 
+ import com.sun.xml.internal.bind.v2.runtime.Location;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/LocatableAnnotation.java	Thu Jul 30 17:41:21 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/LocatableAnnotation.java	Thu Jul 30 17:41:20 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.annotation;
+ 
+ import java.lang.annotation.Annotation;
+@@ -29,6 +30,7 @@
+ import java.lang.reflect.InvocationTargetException;
+ import java.lang.reflect.Method;
+ import java.lang.reflect.Proxy;
++import java.lang.reflect.Modifier;
+ import java.util.HashMap;
+ import java.util.Map;
+ 
+@@ -96,8 +98,13 @@
+         try {
+             if(method.getDeclaringClass()==Locatable.class)
+                 return method.invoke(this,args);
+-            else
+-                return method.invoke(core,args);
++            if(Modifier.isStatic(method.getModifiers()))
++                // malicious code can pass in a static Method object.
++                // doing method.invoke() would end up executing it,
++                // so we need to protect against it.
++                throw new IllegalArgumentException();
++
++            return method.invoke(core,args);
+         } catch (InvocationTargetException e) {
+             if(e.getTargetException()!=null)
+                 throw e.getTargetException();
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/Messages.java	Thu Jul 30 17:41:24 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/Messages.java	Thu Jul 30 17:41:24 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.annotation;
+ 
+ import java.text.MessageFormat;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/Messages.properties	Thu Jul 30 17:41:28 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/Messages.properties	Thu Jul 30 17:41:27 2009
+@@ -25,4 +25,3 @@
+ 
+ DUPLICATE_ANNOTATIONS = \
+     Annotation "{0}" is present on both "{1}" and "{2}"
+- 
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/MethodLocatable.java	Thu Jul 30 17:41:31 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/MethodLocatable.java	Thu Jul 30 17:41:31 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.annotation;
+ 
+ import com.sun.xml.internal.bind.v2.model.nav.Navigator;
+@@ -29,7 +30,7 @@
+ 
+ /**
+  * {@link Locatable} implementation for a method.
+- * 
++ *
+  * @author Kohsuke Kawaguchi
+  */
+ public class MethodLocatable<M> implements Locatable {
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/Quick.java	Thu Jul 30 17:41:35 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/Quick.java	Thu Jul 30 17:41:34 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.annotation;
+ 
+ import java.lang.annotation.Annotation;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/RuntimeAnnotationReader.java	Thu Jul 30 17:41:39 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/RuntimeAnnotationReader.java	Thu Jul 30 17:41:38 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.annotation;
+ 
+ import java.lang.reflect.Field;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/RuntimeInlineAnnotationReader.java	Thu Jul 30 17:41:42 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/RuntimeInlineAnnotationReader.java	Thu Jul 30 17:41:42 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.annotation;
+ 
+ import java.lang.annotation.Annotation;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/core/Adapter.java	Thu Jul 30 17:41:46 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/Adapter.java	Thu Jul 30 17:41:45 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.core;
+ 
+ import javax.xml.bind.annotation.adapters.XmlAdapter;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/core/ArrayInfo.java	Thu Jul 30 17:41:49 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/ArrayInfo.java	Thu Jul 30 17:41:49 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.core;
+ 
+ /**
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/core/AttributePropertyInfo.java	Thu Jul 30 17:41:53 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/AttributePropertyInfo.java	Thu Jul 30 17:41:52 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.core;
+ 
+ import javax.xml.namespace.QName;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/core/BuiltinLeafInfo.java	Thu Jul 30 17:41:56 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/BuiltinLeafInfo.java	Thu Jul 30 17:41:56 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.core;
+ 
+ import javax.xml.namespace.QName;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/core/ClassInfo.java	Thu Jul 30 17:42:00 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/ClassInfo.java	Thu Jul 30 17:41:59 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.core;
+ 
+ import java.util.List;
+@@ -121,7 +122,7 @@
+      * @return null
+      *      if the property was not found.
+      *
+-     * @see PropertyInfo#getName() 
++     * @see PropertyInfo#getName()
+      */
+     PropertyInfo<T,C> getProperty(String name);
+ 
+@@ -129,7 +130,7 @@
+      * If the class has properties, return true.  This is only
+      * true if the Collection object returned by {@link #getProperties()}
+      * is not empty.
+-     */ 
++     */
+     boolean hasProperties();
+ 
+     /**
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/core/Element.java	Thu Jul 30 17:42:03 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/Element.java	Thu Jul 30 17:42:03 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.core;
+ 
+ import javax.xml.namespace.QName;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/core/ElementInfo.java	Thu Jul 30 17:42:07 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/ElementInfo.java	Thu Jul 30 17:42:06 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.core;
+ 
+ import java.util.Collection;
+@@ -81,7 +82,7 @@
+     /**
+      * @inheritDoc
+      *
+-     * {@link ElementInfo} can only substitute {@link ElementInfo}. 
++     * {@link ElementInfo} can only substitute {@link ElementInfo}.
+      */
+     ElementInfo<T,C> getSubstitutionHead();
+ 
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/core/ElementPropertyInfo.java	Thu Jul 30 17:42:10 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/ElementPropertyInfo.java	Thu Jul 30 17:42:10 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.core;
+ 
+ import java.util.List;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/core/EnumConstant.java	Thu Jul 30 17:42:14 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/EnumConstant.java	Thu Jul 30 17:42:13 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.core;
+ 
+ import javax.xml.bind.annotation.XmlEnumValue;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/core/EnumLeafInfo.java	Thu Jul 30 17:42:17 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/EnumLeafInfo.java	Thu Jul 30 17:42:17 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.core;
+ 
+ /**
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/core/ErrorHandler.java	Thu Jul 30 17:42:21 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/ErrorHandler.java	Thu Jul 30 17:42:20 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.core;
+ 
+ import com.sun.xml.internal.bind.v2.model.impl.ModelBuilder;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/core/ID.java	Thu Jul 30 17:42:24 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/ID.java	Thu Jul 30 17:42:24 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.core;
+ 
+ /**
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/core/LeafInfo.java	Thu Jul 30 17:42:28 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/LeafInfo.java	Thu Jul 30 17:42:27 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.core;
+ 
+ /**
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/core/MapPropertyInfo.java	Thu Jul 30 17:42:31 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/MapPropertyInfo.java	Thu Jul 30 17:42:31 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.core;
+ 
+ import java.util.Map;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/core/MaybeElement.java	Thu Jul 30 17:42:35 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/MaybeElement.java	Thu Jul 30 17:42:35 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.core;
+ 
+ import javax.xml.namespace.QName;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/core/NonElement.java	Thu Jul 30 17:42:39 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/NonElement.java	Thu Jul 30 17:42:38 2009
+@@ -22,8 +22,10 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.core;
+ 
++import com.sun.xml.internal.bind.v2.WellKnownNamespace;
+ import javax.xml.namespace.QName;
+ 
+ /**
+@@ -31,13 +33,15 @@
+  *
+  * Either {@link LeafInfo} or {@link ClassInfo}.
+  *
+- * TODO: better name.
++ * TODO: better ANYTYPE_NAME.
+  *
+  * @author Kohsuke Kawaguchi
+  */
+ public interface NonElement<T,C> extends TypeInfo<T,C> {
++    public static final QName ANYTYPE_NAME = new QName(WellKnownNamespace.XML_SCHEMA, "anyType");
++
+     /**
+-     * Gets the primary XML type name of the class.
++     * Gets the primary XML type ANYTYPE_NAME of the class.
+      *
+      * <p>
+      * A Java type can be mapped to multiple XML types, but one of them is
+@@ -44,7 +48,7 @@
+      * considered "primary" and used when we generate a schema.
+      *
+      * @return
+-     *      null if the object doesn't have an explicit type name (AKA anonymous.)
++     *      null if the object doesn't have an explicit type ANYTYPE_NAME (AKA anonymous.)
+      */
+     QName getTypeName();
+ 
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/core/NonElementRef.java	Thu Jul 30 17:42:43 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/NonElementRef.java	Thu Jul 30 17:42:42 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.core;
+ 
+ 
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/core/PropertyInfo.java	Thu Jul 30 17:42:46 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/PropertyInfo.java	Thu Jul 30 17:42:45 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.core;
+ 
+ import java.util.Collection;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/core/PropertyKind.java	Thu Jul 30 17:42:50 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/PropertyKind.java	Thu Jul 30 17:42:49 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.core;
+ 
+ import javax.xml.bind.annotation.XmlMimeType;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/core/Ref.java	Thu Jul 30 17:42:53 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/Ref.java	Thu Jul 30 17:42:52 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.core;
+ 
+ import javax.xml.bind.annotation.XmlList;
+@@ -70,7 +71,7 @@
+     public Ref(ModelBuilder<T,C,?,?> builder, T type, XmlJavaTypeAdapter xjta, XmlList xl ) {
+         this(builder.reader,builder.nav,type,xjta,xl);
+     }
+-    
++
+     public Ref(AnnotationReader<T,C,?,?> reader,
+                Navigator<T,C,?,?> nav,
+                T type, XmlJavaTypeAdapter xjta, XmlList xl ) {
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/core/ReferencePropertyInfo.java	Thu Jul 30 17:42:57 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/ReferencePropertyInfo.java	Thu Jul 30 17:42:56 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.core;
+ 
+ import java.util.Collection;
+@@ -61,7 +62,7 @@
+      * {@inheritDoc}.
+      *
+      * If this {@link ReferencePropertyInfo} has a wildcard in it,
+-     * then the returned list will contain {@link WildcardTypeInfo}. 
++     * then the returned list will contain {@link WildcardTypeInfo}.
+      */
+     Collection<? extends TypeInfo<T,C>> ref();
+ 
+@@ -114,5 +115,10 @@
+      */
+     C getDOMHandler();
+ 
++    /**
++     * Returns true if this element is mandatory.
++     */
++    boolean isRequired();
++
+     Adapter<T,C> getAdapter();
+ }
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/core/RegistryInfo.java	Thu Jul 30 17:43:00 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/RegistryInfo.java	Thu Jul 30 17:42:59 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.core;
+ 
+ import java.util.Set;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/core/TypeInfo.java	Thu Jul 30 17:43:04 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/TypeInfo.java	Thu Jul 30 17:43:03 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.core;
+ 
+ import javax.xml.bind.annotation.XmlIDREF;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/core/TypeInfoSet.java	Thu Jul 30 17:43:07 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/TypeInfoSet.java	Thu Jul 30 17:43:06 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.core;
+ 
+ import java.util.Map;
+@@ -135,7 +136,7 @@
+      *
+      * <p>
+      * This operation is expected to be only used in schema generator, so it can be slow.
+-     *  
++     *
+      * @return
+      *      A map from prefixes to namespace URIs, which should be declared when generating a schema.
+      *      Could be empty but never null.
+@@ -152,7 +153,7 @@
+      *      A map from namespace URI to the value of the location.
+      *      If the entry is missing, that means a schema should be generated for that namespace.
+      *      If the value is "", that means the schema location is implied
+-     *      (&lt;xs:schema namespace="..."/> w/o schemaLocation.) 
++     *      (&lt;xs:schema namespace="..."/> w/o schemaLocation.)
+      */
+     Map<String,String> getSchemaLocations();
+ 
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/core/TypeRef.java	Thu Jul 30 17:43:11 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/TypeRef.java	Thu Jul 30 17:43:10 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.core;
+ 
+ import javax.xml.namespace.QName;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/core/ValuePropertyInfo.java	Thu Jul 30 17:43:14 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/ValuePropertyInfo.java	Thu Jul 30 17:43:13 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.core;
+ 
+ /**
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/core/WildcardMode.java	Thu Jul 30 17:43:18 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/WildcardMode.java	Thu Jul 30 17:43:17 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.core;
+ 
+ /**
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/core/WildcardTypeInfo.java	Thu Jul 30 17:43:21 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/WildcardTypeInfo.java	Thu Jul 30 17:43:20 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.core;
+ 
+ /**
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/core/package-info.java	Thu Jul 30 17:43:24 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/core/package-info.java	Thu Jul 30 17:43:24 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ /**
+  * The in-memory model of the JAXB-bound beans.
+  *
+@@ -54,7 +55,7 @@
+  *      Corresponds to {@link Method}.
+  *
+  * <dt>
+- */ 
++ */
+ @XmlSchema(namespace="http://jaxb.dev.java.net/xjc/model",elementFormDefault=QUALIFIED)
+ package com.sun.xml.internal.bind.v2.model.core;
+ 
+@@ -65,6 +66,3 @@
+ import javax.xml.bind.annotation.XmlSchema;
+ 
+ import static javax.xml.bind.annotation.XmlNsForm.QUALIFIED;
+-
+-
+-
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/AnyTypeImpl.java	Thu Jul 30 17:43:28 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/AnyTypeImpl.java	Thu Jul 30 17:43:27 2009
+@@ -22,12 +22,12 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.impl;
+ 
+ import javax.xml.namespace.QName;
+ import javax.xml.bind.annotation.XmlIDREF;
+ 
+-import com.sun.xml.internal.bind.v2.WellKnownNamespace;
+ import com.sun.xml.internal.bind.v2.runtime.Location;
+ import com.sun.xml.internal.bind.v2.model.core.NonElement;
+ import com.sun.xml.internal.bind.v2.model.core.TypeInfo;
+@@ -50,7 +50,7 @@
+     }
+ 
+     public QName getTypeName() {
+-        return name;
++        return ANYTYPE_NAME;
+     }
+ 
+     public T getType() {
+@@ -79,5 +79,4 @@
+         return true;
+     }
+ 
+-    private static final QName name = new QName(WellKnownNamespace.XML_SCHEMA,"anyType");
+ }
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/ArrayInfoImpl.java	Thu Jul 30 17:43:32 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/ArrayInfoImpl.java	Thu Jul 30 17:43:31 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.impl;
+ 
+ import javax.xml.namespace.QName;
+@@ -32,6 +33,7 @@
+ 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.runtime.Location;
++import com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationException;
+ 
+ /**
+  *
+@@ -57,10 +59,15 @@
+                          Locatable upstream, TypeT arrayType) {
+         super(builder, upstream);
+         this.arrayType = arrayType;
+-        this.itemType = builder.getTypeInfo(nav().getComponentType(arrayType), this);
++        TypeT componentType = nav().getComponentType(arrayType);
++        this.itemType = builder.getTypeInfo(componentType, this);
+ 
+-        // TODO: check itemType.getTypeName()!=null and report an error
+         QName n = itemType.getTypeName();
++        if(n==null) {
++            builder.reportError(new IllegalAnnotationException(Messages.ANONYMOUS_ARRAY_ITEM.format(
++                nav().getTypeName(componentType)),this));
++            n = new QName("#dummy"); // for error recovery
++        }
+         this.typeName = calcArrayTypeName(n);
+     }
+ 
+@@ -67,7 +74,7 @@
+     /**
+      * Computes the type name of the array from that of the item type.
+      */
+-    public static final QName calcArrayTypeName(QName n) {
++    public static QName calcArrayTypeName(QName n) {
+         String uri;
+         if(n.getNamespaceURI().equals(WellKnownNamespace.XML_SCHEMA)) {
+             TODO.checkSpec("this URI");
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/AttributePropertyInfoImpl.java	Thu Jul 30 17:43:35 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/AttributePropertyInfoImpl.java	Thu Jul 30 17:43:34 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.impl;
+ 
+ import javax.xml.bind.annotation.XmlAttribute;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/BuiltinLeafInfoImpl.java	Thu Jul 30 17:43:39 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/BuiltinLeafInfoImpl.java	Thu Jul 30 17:43:38 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.impl;
+ 
+ import java.util.HashMap;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/ClassInfoImpl.java	Thu Jul 30 17:43:42 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/ClassInfoImpl.java	Thu Jul 30 17:43:41 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.impl;
+ 
+ import java.lang.annotation.Annotation;
+@@ -37,6 +38,7 @@
+ import java.util.Map;
+ import java.util.Set;
+ import java.util.TreeSet;
++import java.util.AbstractList;
+ 
+ import javax.xml.bind.annotation.XmlAccessOrder;
+ import javax.xml.bind.annotation.XmlAccessType;
+@@ -66,7 +68,7 @@
+ import javax.xml.namespace.QName;
+ 
+ import com.sun.istack.internal.FinalArrayList;
+-import com.sun.xml.internal.bind.annotation.XmlLocation;
++import com.sun.xml.internal.bind.annotation.OverrideAnnotationOf;
+ import com.sun.xml.internal.bind.v2.model.annotation.Locatable;
+ import com.sun.xml.internal.bind.v2.model.annotation.MethodLocatable;
+ import com.sun.xml.internal.bind.v2.model.core.ClassInfo;
+@@ -75,10 +77,10 @@
+ import com.sun.xml.internal.bind.v2.model.core.NonElement;
+ import com.sun.xml.internal.bind.v2.model.core.PropertyInfo;
+ import com.sun.xml.internal.bind.v2.model.core.PropertyKind;
+-import com.sun.xml.internal.bind.v2.model.core.TypeInfo;
+ import com.sun.xml.internal.bind.v2.model.core.ValuePropertyInfo;
+ import com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationException;
+ import com.sun.xml.internal.bind.v2.runtime.Location;
++import com.sun.xml.internal.bind.v2.util.EditDistance;
+ 
+ 
+ /**
+@@ -116,7 +118,7 @@
+      *
+      * @see #isOrdered()
+      */
+-    private final String[] propOrder;
++    private /*final*/ String[] propOrder;
+ 
+     /**
+      * Lazily computed.
+@@ -169,6 +171,12 @@
+             propOrder = DEFAULT_ORDER;
+         }
+ 
++        // obtain XmlAccessorOrder and  set proporder (<xs:all> vs <xs:sequence>)
++        XmlAccessorOrder xao = reader().getClassAnnotation(XmlAccessorOrder.class, clazz, this);
++        if((xao != null) && (xao.value() == XmlAccessOrder.UNDEFINED)) {
++            propOrder = null;
++        }
++
+         if(nav().isInterface(clazz)) {
+             builder.reportError(new IllegalAnnotationException(
+                 Messages.CANT_HANDLE_INTERFACE.format(nav().getClassName(clazz)), this ));
+@@ -187,16 +195,15 @@
+                     msg.format(nav().getClassName(clazz)), this ));
+             }
+         }
+-    }
++        }
+ 
+     public ClassInfoImpl<T,C,F,M> getBaseClass() {
+-        if(!baseClassComputed) {
+-            baseClassComputed = true;
++        if (!baseClassComputed) {
+             // compute the base class
+             C s = nav().getSuperClass(clazz);
+-            if(s==null || s==nav().asDecl(Object.class))
++            if(s==null || s==nav().asDecl(Object.class)) {
+                 baseClass = null;
+-            else {
++            } else {
+                 NonElement<T,C> b = builder.getClassInfo(s, true, this);
+                 if(b instanceof ClassInfoImpl) {
+                     baseClass = (ClassInfoImpl<T,C,F,M>) b;
+@@ -205,6 +212,7 @@
+                     baseClass = null;
+                 }
+             }
++            baseClassComputed = true;
+         }
+         return baseClass;
+     }
+@@ -290,8 +298,9 @@
+         } else {
+             //sort them as specified
+             PropertySorter sorter = new PropertySorter();
+-            for (PropertyInfoImpl p : properties)
++            for (PropertyInfoImpl p : properties) {
+                 sorter.checkedGet(p);   // have it check for errors
++            }
+             Collections.sort(properties,sorter);
+             sorter.checkUnusedProperties();
+         }
+@@ -340,13 +349,17 @@
+     }
+ 
+     private void findFieldProperties(C c, XmlAccessType at) {
++
+         // always find properties from the super class first
+         C sc = nav().getSuperClass(c);
+-        if(shouldRecurseSuperClass(sc))
++        if (shouldRecurseSuperClass(sc)) {
+             findFieldProperties(sc,at);
++        }
+ 
+         for( F f : nav().getDeclaredFields(c) ) {
+             Annotation[] annotations = reader().getAllFieldAnnotations(f,this);
++            boolean isDummy = reader().hasFieldAnnotation(OverrideAnnotationOf.class, f);
++
+             if( nav().isTransient(f) ) {
+                 // it's an error for transient field to have any binding annotation
+                 if(hasJAXBAnnotation(annotations))
+@@ -357,12 +370,23 @@
+             if( nav().isStaticField(f) ) {
+                 // static fields are bound only when there's explicit annotation.
+                 if(hasJAXBAnnotation(annotations))
+-                    addProperty(createFieldSeed(f),annotations);
++                    addProperty(createFieldSeed(f),annotations, false);
+             } else {
+                 if(at==XmlAccessType.FIELD
+                 ||(at==XmlAccessType.PUBLIC_MEMBER && nav().isPublicField(f))
+-                || hasJAXBAnnotation(annotations))
+-                    addProperty(createFieldSeed(f),annotations);
++                || hasJAXBAnnotation(annotations)) {
++                    if (isDummy) {
++                        ClassInfo<T, C> top = getBaseClass();
++                        while ((top != null) && (top.getProperty("content") == null)) {
++                            top = top.getBaseClass();
++                        }
++                        DummyPropertyInfo prop = (DummyPropertyInfo) top.getProperty("content");
++                        PropertySeed seed = createFieldSeed(f);
++                        ((DummyPropertyInfo)prop).addType(createReferenceProperty(seed));
++                    } else {
++                        addProperty(createFieldSeed(f), annotations, false);
++                    }
++                }
+                 checkFieldXmlLocation(f);
+             }
+         }
+@@ -378,7 +402,7 @@
+         }
+ 
+         return false;
+-    }
++        }
+ 
+     public PropertyInfo<T,C> getProperty(String name) {
+         for( PropertyInfo<T,C> p: getProperties() ) {
+@@ -467,7 +491,7 @@
+             Integer i = get(p.getName());
+             if(i==null) {
+                 // missing
+-                if((p.kind().isOrdered))
++                if (p.kind().isOrdered)
+                     builder.reportError(new IllegalAnnotationException(
+                         Messages.PROPERTY_MISSING_FROM_ORDER.format(p.getName()),p));
+ 
+@@ -500,8 +524,20 @@
+             for( int i=0; i<used.length; i++ )
+                 if(used[i]==null) {
+                     String unusedName = propOrder[i];
+-                    builder.reportError(new IllegalAnnotationException(
+-                        Messages.PROPERTY_ORDER_CONTAINS_UNUSED_ENTRY.format(unusedName),ClassInfoImpl.this));
++                    String nearest = EditDistance.findNearest(unusedName, new AbstractList<String>() {
++                        public String get(int index) {
++                            return properties.get(index).getName();
++                        }
++
++                        public int size() {
++                            return properties.size();
++                        }
++                    });
++                    boolean isOverriding = (i > (properties.size()-1)) ? false : properties.get(i).hasAnnotation(OverrideAnnotationOf.class);
++                    if (!isOverriding) {
++                        builder.reportError(new IllegalAnnotationException(
++                        Messages.PROPERTY_ORDER_CONTAINS_UNUSED_ENTRY.format(unusedName,nearest),ClassInfoImpl.this));
++                    }
+                 }
+         }
+     }
+@@ -536,9 +572,9 @@
+         }
+     }
+ 
+-    private static final class DupliateException extends Exception {
++    private static final class DuplicateException extends Exception {
+         final Annotation a1,a2;
+-        public DupliateException(Annotation a1, Annotation a2) {
++        public DuplicateException(Annotation a1, Annotation a2) {
+             this.a1 = a1;
+             this.a2 = a2;
+         }
+@@ -628,6 +664,7 @@
+             XmlElementRefs.class,   // 7
+             XmlAnyElement.class,    // 8
+             XmlMixed.class,         // 9
++            OverrideAnnotationOf.class,// 10
+         };
+ 
+         HashMap<Class,Integer> m = ANNOTATION_NUMBER_MAP;
+@@ -645,10 +682,10 @@
+         }
+     }
+ 
+-    private void checkConflict(Annotation a, Annotation b) throws DupliateException {
++    private void checkConflict(Annotation a, Annotation b) throws DuplicateException {
+         assert b!=null;
+         if(a!=null)
+-            throw new DupliateException(a,b);
++            throw new DuplicateException(a,b);
+     }
+ 
+     /**
+@@ -663,7 +700,7 @@
+      *      {@code seed.readAllAnnotation()}, but taken as a parameter
+      *      because the caller should know it already.
+      */
+-    private void addProperty( PropertySeed<T,C,F,M> seed, Annotation[] annotations ) {
++    private void addProperty( PropertySeed<T,C,F,M> seed, Annotation[] annotations, boolean dummy ) {
+         // since typically there's a very few annotations on a method,
+         // this runs faster than checking for each annotation via readAnnotation(A)
+ 
+@@ -681,6 +718,7 @@
+         XmlElementRefs r2 = null;
+         XmlAnyElement xae = null;
+         XmlMixed mx = null;
++        OverrideAnnotationOf ov = null;
+ 
+         // encountered secondary annotations are accumulated into a bit mask
+         int secondaryAnnotations = 0;
+@@ -700,6 +738,7 @@
+                 case 7:     checkConflict(r2 ,ann); r2  = (XmlElementRefs) ann; break;
+                 case 8:     checkConflict(xae,ann); xae = (XmlAnyElement) ann; break;
+                 case 9:     checkConflict(mx, ann); mx  = (XmlMixed) ann; break;
++                case 10:    checkConflict(ov, ann); ov  = (OverrideAnnotationOf) ann; break;
+                 default:
+                     // secondary annotations
+                     secondaryAnnotations |= (1<<(index-20));
+@@ -732,7 +771,7 @@
+                 group = PropertyGroup.ELEMENT;
+                 groupCount++;
+             }
+-            if(r1!=null || r2!=null || xae!=null || mx!=null) {
++            if(r1!=null || r2!=null || xae!=null || mx!=null || ov != null) {
+                 group = PropertyGroup.ELEMENT_REF;
+                 groupCount++;
+             }
+@@ -837,7 +876,7 @@
+                     err.get(0), err.get(1) ));
+ 
+             // recover by ignoring this property
+-        } catch( DupliateException e ) {
++        } catch( DuplicateException e ) {
+             // both are present
+             builder.reportError(new IllegalAnnotationException(
+                 Messages.DUPLICATE_ANNOTATIONS.format(e.a1.annotationType().getName()),
+@@ -940,7 +979,7 @@
+                     System.arraycopy(sa,0,r,ga.length,sa.length);
+                 }
+ 
+-                addProperty(createAccessorSeed(getter, setter),r);
++                addProperty(createAccessorSeed(getter, setter), r, false);
+             }
+         }
+         // done with complete pairs
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/ERPropertyInfoImpl.java	Thu Jul 30 17:43:46 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/ERPropertyInfoImpl.java	Thu Jul 30 17:43:45 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.impl;
+ 
+ import javax.xml.bind.annotation.XmlElementWrapper;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/ElementInfoImpl.java	Thu Jul 30 17:43:50 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/ElementInfoImpl.java	Thu Jul 30 17:43:49 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.impl;
+ 
+ import java.lang.annotation.Annotation;
+@@ -273,7 +274,7 @@
+         tOfJAXBElementT =
+             methodParams.length>0 ? methodParams[0] // this is more reliable, as it works even for ObjectFactory that sometimes have to return public types
+             : nav().getTypeArgument(baseClass,0); // fall back to infer from the return type if no parameter.
+-        
++
+         if(adapter==null) {
+             T list = nav().getBaseClass(tOfJAXBElementT,nav().asDecl(List.class));
+             if(list==null) {
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/ElementPropertyInfoImpl.java	Thu Jul 30 17:43:53 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/ElementPropertyInfoImpl.java	Thu Jul 30 17:43:53 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.impl;
+ 
+ import java.util.AbstractList;
+@@ -44,7 +45,7 @@
+ /**
+  * Common {@link ElementPropertyInfo} implementation used for both
+  * APT and runtime.
+- * 
++ *
+  * @author Kohsuke Kawaguchi
+  */
+ class ElementPropertyInfoImpl<TypeT,ClassDeclT,FieldT,MethodT>
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/EnumConstantImpl.java	Thu Jul 30 17:43:57 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/EnumConstantImpl.java	Thu Jul 30 17:43:56 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.impl;
+ 
+ import com.sun.xml.internal.bind.v2.model.core.EnumConstant;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/EnumLeafInfoImpl.java	Thu Jul 30 17:44:00 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/EnumLeafInfoImpl.java	Thu Jul 30 17:44:00 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.impl;
+ 
+ import java.util.Iterator;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/FieldPropertySeed.java	Thu Jul 30 17:44:04 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/FieldPropertySeed.java	Thu Jul 30 17:44:03 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.impl;
+ 
+ import java.lang.annotation.Annotation;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/GetterSetterPropertySeed.java	Thu Jul 30 17:44:07 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/GetterSetterPropertySeed.java	Thu Jul 30 17:44:07 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.impl;
+ 
+ import java.lang.annotation.Annotation;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/LeafInfoImpl.java	Thu Jul 30 17:44:11 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/LeafInfoImpl.java	Thu Jul 30 17:44:10 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.impl;
+ 
+ import javax.xml.namespace.QName;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/MapPropertyInfoImpl.java	Thu Jul 30 17:44:14 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/MapPropertyInfoImpl.java	Thu Jul 30 17:44:14 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.impl;
+ 
+ import java.util.Arrays;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/Messages.java	Thu Jul 30 17:44:18 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/Messages.java	Thu Jul 30 17:44:17 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.impl;
+ 
+ import java.text.MessageFormat;
+@@ -56,7 +57,7 @@
+     SUPER_CLASS_HAS_WILDCARD, // 0 args
+     INVALID_ATTRIBUTE_WILDCARD_TYPE, // 1 arg
+     PROPERTY_MISSING_FROM_ORDER, // 1 arg
+-    PROPERTY_ORDER_CONTAINS_UNUSED_ENTRY, // 1 arg
++    PROPERTY_ORDER_CONTAINS_UNUSED_ENTRY, // 2 args
+ 
+     INVALID_XML_ENUM_VALUE, // 2 arg
+     FAILED_TO_INITIALE_DATATYPE_FACTORY, // 0 args
+@@ -72,7 +73,7 @@
+     SIMPLE_TYPE_IS_REQUIRED, // 1 arg
+     PROPERTY_COLLISION, // 1 arg
+     INVALID_IDREF, // 1 arg
+-    INVALID_XML_ELEMENT_REF, // 0 arg
++    INVALID_XML_ELEMENT_REF, // 1 arg
+     NO_XML_ELEMENT_DECL, // 2 args
+     XML_ELEMENT_WRAPPER_ON_NON_COLLECTION, // 1 arg
+ 
+@@ -84,20 +85,31 @@
+ 
+     INCOMPATIBLE_API_VERSION, // 2 args
+     INCOMPATIBLE_API_VERSION_MUSTANG, // 2 args
+-    
++    RUNNING_WITH_1_0_RUNTIME, // 2 args
++
+     MISSING_JAXB_PROPERTIES, // 1arg
+     TRANSIENT_FIELD_NOT_BINDABLE, // 1 arg
+     THERE_MUST_BE_VALUE_IN_XMLVALUE, // 1 arg
+     UNMATCHABLE_ADAPTER, // 2 args
++    ANONYMOUS_ARRAY_ITEM, // 1 arg
+ 
+     ACCESSORFACTORY_INSTANTIATION_EXCEPTION, // 2 arg
+     ACCESSORFACTORY_ACCESS_EXCEPTION, // 2 arg
+     CUSTOM_ACCESSORFACTORY_PROPERTY_ERROR, // 2 arg
+     CUSTOM_ACCESSORFACTORY_FIELD_ERROR, // 2 arg
++        XMLGREGORIANCALENDAR_INVALID, // 1 arg
++        XMLGREGORIANCALENDAR_SEC, // 0 arg
++        XMLGREGORIANCALENDAR_MIN, // 0 arg
++        XMLGREGORIANCALENDAR_HR, // 0 arg
++        XMLGREGORIANCALENDAR_DAY, // 0 arg
++        XMLGREGORIANCALENDAR_MONTH, // 0 arg
++        XMLGREGORIANCALENDAR_YEAR, // 0 arg
++        XMLGREGORIANCALENDAR_TIMEZONE, // 0 arg
+     ;
+ 
+     private static final ResourceBundle rb = ResourceBundle.getBundle(Messages.class.getName());
+ 
++    @Override
+     public String toString() {
+         return format();
+     }
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/Messages.properties	Thu Jul 30 17:44:21 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/Messages.properties	Thu Jul 30 17:44:21 2009
+@@ -51,7 +51,7 @@
+     Property "{0}" appears more than once in the @XmlType.propOrder
+ 
+ DUPLICATE_PROPERTIES = \
+-    There are two properties named "{0}" 
++    There are two properties named "{0}"
+ 
+ XML_ELEMENT_MAPPING_ON_NON_IXMLELEMENT_METHOD = \
+     The {0} method has @XmlElementMapping on it, but it doesn''t return a sub-type of JAXBElement.
+@@ -61,7 +61,7 @@
+ 
+ CONFLICTING_XML_ELEMENT_MAPPING = \
+     The element name '{'{0}'}'{1} has more than one mapping.
+-    
++
+ REFERENCE_TO_NON_ELEMENT = \
+     Property {0} is annotated with @XmlReference but doesn''t refer to an element.
+ 
+@@ -81,8 +81,8 @@
+     Property {0} is present but not specified in @XmlType.propOrder
+ 
+ PROPERTY_ORDER_CONTAINS_UNUSED_ENTRY = \
+-    Property {0} appears in @XmlType.propOrder, but no such property exists
+-    
++    Property {0} appears in @XmlType.propOrder, but no such property exists. Maybe you meant {1}?
++
+ INVALID_XML_ENUM_VALUE = \
+     "{0}" is not a valid value for {1}.
+ 
+@@ -121,7 +121,7 @@
+     XmlIDREF property is referencing a type "{0}" that doesn''t have an XmlID property.
+ 
+ INVALID_XML_ELEMENT_REF = \
+-    XmlElementRef points to a non-existent class.
++    Invalid @XmlElementRef : Type "{0}" or any of it's subclasses are not known to this context.
+ 
+ NO_XML_ELEMENT_DECL = \
+     There''s no ObjectFactory with an @XmlElementDecl for the element '{'{0}'}'{1}.
+@@ -161,8 +161,12 @@
+     Use the endorsed directory mechanism to place jaxb-api.jar in the bootstrap classloader. \
+     (See http://java.sun.com/j2se/1.5.0/docs/guide/standards/)
+ 
++RUNNING_WITH_1_0_RUNTIME = \
++    You are trying to run JAXB 2.0 runtime (from {1}) but you have old JAXB 1.0 runtime earlier \
++    in the classpath (at {0}) Please remove the JAXB 1.0 runtime for 2.0 runtime to work correctly.
++
+ UNMATCHABLE_ADAPTER = \
+-    Adapter {0} is not applicable to the field type {1}. 
++    Adapter {0} is not applicable to the field type {1}.
+ 
+ ACCESSORFACTORY_INSTANTIATION_EXCEPTION = \
+     Unable to create instance of AccessorFactory, {0} for class {1}.
+@@ -175,4 +179,30 @@
+ 
+ CUSTOM_ACCESSORFACTORY_FIELD_ERROR = \
+     Custom AccessorFactory, {0}, is reporting an error accessing a field. {1}
+- 
++
++ANONYMOUS_ARRAY_ITEM = \
++    {0} is used as an array component type, so it cannot be anonymous.
++
++XMLGREGORIANCALENDAR_INVALID = \
++    Invalid set of fields set for XMLGregorianCalendar type {0}.
++
++XMLGREGORIANCALENDAR_SEC = \
++    Seconds not set.
++
++XMLGREGORIANCALENDAR_MIN = \
++    Minutes not set.
++
++XMLGREGORIANCALENDAR_HR = \
++    Hour not set.
++
++XMLGREGORIANCALENDAR_DAY = \
++    Day not set.
++
++XMLGREGORIANCALENDAR_MONTH = \
++    Month not set.
++
++XMLGREGORIANCALENDAR_YEAR = \
++    Year not set.
++
++XMLGREGORIANCALENDAR_TIMEZONE = \
++    Timezone not set.
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/ModelBuilder.java	Thu Jul 30 17:44:25 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/ModelBuilder.java	Thu Jul 30 17:44:24 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.impl;
+ 
+ import java.util.HashMap;
+@@ -50,6 +51,7 @@
+ 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.runtime.IllegalAnnotationException;
++import com.sun.xml.internal.bind.WhiteSpaceProcessor;
+ 
+ 
+ /**
+@@ -161,6 +163,22 @@
+                 Which.which(XmlSchema.class),
+                 Which.which(ModelBuilder.class)
+             ));
++        }
++    }
++
++    /**
++     * Makes sure that we don't have conflicting 1.0 runtime,
++     * and report an error if we do.
++     */
++    static {
++        try {
++            WhiteSpaceProcessor.isWhiteSpace("xyz");
++        } catch (NoSuchMethodError e) {
++            // we seem to be getting 1.0 runtime
++            throw new LinkageError( Messages.RUNNING_WITH_1_0_RUNTIME.format(
++                Which.which(WhiteSpaceProcessor.class),
++                Which.which(ModelBuilder.class)
++            ));
+         }
+     }
+ 
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/PropertyInfoImpl.java	Thu Jul 30 17:44:29 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/PropertyInfoImpl.java	Thu Jul 30 17:44:28 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.impl;
+ 
+ import java.util.Collection;
+@@ -103,8 +104,6 @@
+         }
+         this.expectedMimeType = mt;
+         this.inlineBinary = seed.hasAnnotation(XmlInlineBinaryData.class);
+-        this.schemaType = Util.calcSchemaType(reader(),seed,parent.clazz,
+-                getIndividualType(),this);
+ 
+         T t = seed.getRawType();
+ 
+@@ -147,6 +146,8 @@
+         }
+ 
+         this.id = calcId();
++        this.schemaType = Util.calcSchemaType(reader(),seed,parent.clazz,
++                getIndividualType(),this);
+     }
+ 
+ 
+@@ -196,7 +197,7 @@
+         T type = reader().getClassValue(jta,"type");
+         if(declaredType.equals(type))
+             return true;    // for types explicitly marked in XmlJavaTypeAdapter.type()
+-        
++
+         T adapter = reader().getClassValue(jta,"value");
+         T ba = nav().getBaseClass(adapter, nav().asDecl(XmlAdapter.class));
+         if(!nav().isParameterizedType(ba))
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/PropertySeed.java	Thu Jul 30 17:44:32 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/PropertySeed.java	Thu Jul 30 17:44:32 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.impl;
+ 
+ import com.sun.xml.internal.bind.v2.model.annotation.Locatable;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/ReferencePropertyInfoImpl.java	Thu Jul 30 17:44:36 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/ReferencePropertyInfoImpl.java	Thu Jul 30 17:44:35 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.impl;
+ 
+ import java.util.Collections;
+@@ -47,6 +48,7 @@
+ import com.sun.xml.internal.bind.v2.model.core.WildcardMode;
+ import com.sun.xml.internal.bind.v2.model.nav.Navigator;
+ import com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationException;
++import java.util.Iterator;
+ 
+ /**
+  * Implementation of {@link ReferencePropertyInfo}.
+@@ -55,7 +57,7 @@
+  */
+ class ReferencePropertyInfoImpl<T,C,F,M>
+     extends ERPropertyInfoImpl<T,C,F,M>
+-    implements ReferencePropertyInfo<T,C>
++    implements ReferencePropertyInfo<T,C>, DummyPropertyInfo<T, C, F, M>
+ {
+     /**
+      * Lazily computed.
+@@ -62,13 +64,18 @@
+      * @see #getElements()
+      */
+     private Set<Element<T,C>> types;
++    private Set<PropertyInfoImpl<T,C,F,M>> subTypes = new LinkedHashSet<PropertyInfoImpl<T,C,F,M>>();
+ 
+     private final boolean isMixed;
+ 
+     private final WildcardMode wildcard;
+     private final C domHandler;
++    /**
++     * Lazily computed.
++     * @see #isRequired()
++     */
++    private Boolean isRequired;
+ 
+-
+     public ReferencePropertyInfoImpl(
+         ClassInfoImpl<T,C,F,M> classInfo,
+         PropertySeed<T,C,F,M> seed) {
+@@ -75,7 +82,7 @@
+ 
+         super(classInfo, seed);
+ 
+-        isMixed = seed.readAnnotation(XmlMixed.class)!=null;
++        isMixed = seed.readAnnotation(XmlMixed.class) != null;
+ 
+         XmlAnyElement xae = seed.readAnnotation(XmlAnyElement.class);
+         if(xae==null) {
+@@ -131,6 +138,8 @@
+                 ann = null;
+         }
+ 
++        isRequired = !isCollection();  // this is by default, to remain compatible with 2.1
++
+         if(ann!=null) {
+             Navigator<T,C,F,M> nav = nav();
+             AnnotationReader<T,C,F,M> reader = reader();
+@@ -147,6 +156,11 @@
+                 else
+                     yield = addAllSubtypes(type);
+ 
++                // essentially "isRequired &= isRequired(r)" except that we'd like to skip evaluating isRequird(r)
++                // if the value is already false.
++                if(isRequired && !isRequired(r))
++                    isRequired = false;
++
+                 if(last && !yield) {
+                     // a reference didn't produce any type.
+                     // diagnose the problem
+@@ -159,22 +173,114 @@
+                         ));
+                     } else {
+                         parent.builder.reportError(new IllegalAnnotationException(
+-                            Messages.INVALID_XML_ELEMENT_REF.format(),this));
++                            Messages.INVALID_XML_ELEMENT_REF.format(type),this));
+                     }
+ 
+                     // reporting one error would do.
+                     // often the element ref field is using @XmlElementRefs
+                     // to point to multiple JAXBElements.
+-                    // reporting one error for each @XmlElemetnRef is thus often redundant. 
++                    // reporting one error for each @XmlElemetnRef is thus often redundant.
+                     return;
+                 }
+             }
+         }
+ 
++        Iterator<PropertyInfoImpl<T,C,F,M>> i = subTypes.iterator();
++        while (i.hasNext()) {
++
++            ReferencePropertyInfoImpl<T,C,F,M> info = (ReferencePropertyInfoImpl<T, C, F, M>) i.next();
++            PropertySeed sd = info.seed;
++            refs = sd.readAnnotation(XmlElementRefs.class);
++            ref = sd.readAnnotation(XmlElementRef.class);
++
++            if (refs != null && ref != null) {
++                parent.builder.reportError(new IllegalAnnotationException(
++                        Messages.MUTUALLY_EXCLUSIVE_ANNOTATIONS.format(
++                        nav().getClassName(parent.getClazz())+'#'+seed.getName(),
++                        ref.annotationType().getName(), refs.annotationType().getName()),
++                        ref, refs ));
++            }
++
++            if (refs != null) {
++                ann = refs.value();
++            } else {
++                if (ref != null) {
++                    ann = new XmlElementRef[]{ref};
++                } else {
++                    ann = null;
++                }
++            }
++
++            if (ann != null) {
++                Navigator<T,C,F,M> nav = nav();
++                AnnotationReader<T,C,F,M> reader = reader();
++
++                final T defaultType = nav.ref(XmlElementRef.DEFAULT.class);
++                final C je = nav.asDecl(JAXBElement.class);
++
++                for( XmlElementRef r : ann ) {
++                    boolean yield;
++                    T type = reader.getClassValue(r,"type");
++                    if (type.equals(defaultType)) {
++                        type = nav.erasure(getIndividualType());
++                    }
++                    if (nav.getBaseClass(type,je) != null) {
++                        yield = addGenericElement(r, info);
++
++                    } else {
++                        yield = addAllSubtypes(type);
++                    }
++
++                    if(last && !yield) {
++                        // a reference didn't produce any type.
++                        // diagnose the problem
++                        if(type.equals(nav.ref(JAXBElement.class))) {
++                            // no XmlElementDecl
++                            parent.builder.reportError(new IllegalAnnotationException(
++                                Messages.NO_XML_ELEMENT_DECL.format(
++                                    getEffectiveNamespaceFor(r), r.name()),
++                                this
++                            ));
++                        } else {
++                            parent.builder.reportError(new IllegalAnnotationException(
++                                Messages.INVALID_XML_ELEMENT_REF.format(),this));
++                        }
++
++                        // reporting one error would do.
++                        // often the element ref field is using @XmlElementRefs
++                        // to point to multiple JAXBElements.
++                        // reporting one error for each @XmlElemetnRef is thus often redundant.
++                        return;
++                    }
++                }
++            }
++        }
++
+         types = Collections.unmodifiableSet(types);
+     }
+ 
++    public boolean isRequired() {
++        if(isRequired==null)
++            calcTypes(false);
++        return isRequired;
++    }
++
+     /**
++     * If we find out that we are working with 2.1 API, remember the fact so that
++     * we don't waste time generating exceptions every time we call {@link #isRequired(XmlElementRef)}.
++     */
++    private static boolean is2_2 = true;
++
++    /**
++     * Reads the value of {@code XmlElementRef.required()}.
++     *
++     * If we are working as 2.1 RI, this defaults to true.
++     */
++    private boolean isRequired(XmlElementRef ref) {
++        return true;
++    }
++
++    /**
+      * @return
+      *      true if the reference yields at least one type
+      */
+@@ -184,6 +290,13 @@
+         return addGenericElement(parent.owner.getElementInfo(parent.getClazz(),new QName(nsUri,r.name())));
+     }
+ 
++    private boolean addGenericElement(XmlElementRef r, ReferencePropertyInfoImpl<T,C,F,M> info) {
++        String nsUri = info.getEffectiveNamespaceFor(r);
++        ElementInfo ei = parent.owner.getElementInfo(info.parent.getClazz(), new QName(nsUri, r.name()));
++        types.add(ei);
++        return true;
++    }
++
+     private String getEffectiveNamespaceFor(XmlElementRef r) {
+         String nsUri = r.namespace();
+ 
+@@ -244,6 +357,7 @@
+     }
+ 
+ 
++    @Override
+     protected void link() {
+         super.link();
+ 
+@@ -254,6 +368,9 @@
+ 
+     }
+ 
++    public final void addType(PropertyInfoImpl<T,C,F,M> info) {
++        subTypes.add(info);
++    }
+ 
+     public final boolean isMixed() {
+         return isMixed;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RegistryInfoImpl.java	Thu Jul 30 17:44:39 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RegistryInfoImpl.java	Thu Jul 30 17:44:39 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.impl;
+ 
+ import java.util.LinkedHashSet;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeAnyTypeImpl.java	Thu Jul 30 17:44:43 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeAnyTypeImpl.java	Thu Jul 30 17:44:42 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.impl;
+ 
+ import java.lang.reflect.Type;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeArrayInfoImpl.java	Thu Jul 30 17:44:47 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeArrayInfoImpl.java	Thu Jul 30 17:44:46 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.impl;
+ 
+ import java.lang.reflect.Field;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeAttributePropertyInfoImpl.java	Thu Jul 30 17:44:50 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeAttributePropertyInfoImpl.java	Thu Jul 30 17:44:49 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.impl;
+ 
+ import java.lang.reflect.Field;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeBuiltinLeafInfoImpl.java	Thu Jul 30 17:44:54 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeBuiltinLeafInfoImpl.java	Thu Jul 30 17:44:53 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.impl;
+ 
+ import java.awt.*;
+@@ -56,6 +57,7 @@
+ import javax.activation.MimeTypeParseException;
+ import javax.imageio.ImageIO;
+ import javax.imageio.ImageWriter;
++import javax.imageio.stream.ImageOutputStream;
+ import javax.xml.bind.ValidationEvent;
+ import javax.xml.bind.helpers.ValidationEventImpl;
+ import javax.xml.datatype.DatatypeConfigurationException;
+@@ -174,6 +176,7 @@
+     public static final RuntimeBuiltinLeafInfoImpl<String> STRING = new StringImpl<String>(String.class,
+         createXS("string"),
+         createXS("normalizedString"),
++        createXS("anyURI"),
+         createXS("token"),
+         createXS("language"),
+         createXS("Name"),
+@@ -282,12 +285,29 @@
+                     return v.toExternalForm();
+                 }
+             },
++            new StringImpl<URI>(URI.class, createXS("string")) {
++                public URI parse(CharSequence text) throws SAXException {
++                    try {
++                        return new URI(text.toString());
++                    } catch (URISyntaxException e) {
++                        UnmarshallingContext.getInstance().handleError(e);
++                        return null;
++                    }
++                }
++
++                public String print(URI v) {
++                    return v.toString();
++                }
++            },
+             new StringImpl<Class>(Class.class, createXS("string")) {
+                 public Class parse(CharSequence text) throws SAXException {
+                     TODO.checkSpec("JSR222 Issue #42");
+                     try {
+                         String name = WhiteSpaceProcessor.trim(text).toString();
+-                        ClassLoader cl = Thread.currentThread().getContextClassLoader();
++                        ClassLoader cl = UnmarshallingContext.getInstance().classLoader;
++                        if(cl==null)
++                            cl = Thread.currentThread().getContextClassLoader();
++
+                         if(cl!=null)
+                             return cl.loadClass(name);
+                         else
+@@ -319,7 +339,11 @@
+                         // normally images can be content-sniffed.
+                         // so the MIME type check will only make us slower and draconian, both of which
+                         // JAXB 2.0 isn't interested.
+-                        return ImageIO.read(is);
++                        try {
++                            return ImageIO.read(is);
++                        } finally {
++                            is.close();
++                        }
+                     } catch (IOException e) {
+                         UnmarshallingContext.getInstance().handleError(e);
+                         return null;
+@@ -366,8 +390,10 @@
+                         Iterator<ImageWriter> itr = ImageIO.getImageWritersByMIMEType(mimeType);
+                         if(itr.hasNext()) {
+                             ImageWriter w = itr.next();
+-                            w.setOutput(ImageIO.createImageOutputStream(imageData));
++                            ImageOutputStream os = ImageIO.createImageOutputStream(imageData);
++                            w.setOutput(os);
+                             w.write(convertToBufferedImage(v));
++                            os.close();
+                             w.dispose();
+                         } else {
+                             // no encoder
+@@ -383,7 +409,7 @@
+                         // TODO: proper error reporting
+                         throw new RuntimeException(e);
+                     }
+-                    Base64Data bd = xs.getCachedBase64DataInstance();
++                    Base64Data bd = new Base64Data();
+                     imageData.set(bd,mimeType);
+                     return bd;
+                 }
+@@ -398,7 +424,7 @@
+                 }
+ 
+                 public Base64Data print(DataHandler v) {
+-                    Base64Data bd = XMLSerializer.getInstance().getCachedBase64DataInstance();
++                    Base64Data bd = new Base64Data();
+                     bd.set(v);
+                     return bd;
+                 }
+@@ -419,7 +445,7 @@
+ 
+                 public Base64Data print(Source v) {
+                     XMLSerializer xs = XMLSerializer.getInstance();
+-                    Base64Data bd = xs.getCachedBase64DataInstance();
++                    Base64Data bd = new Base64Data();
+ 
+                     String contentType = xs.getXMIMEContentType();
+                     MimeType mt = null;
+@@ -486,21 +512,27 @@
+ 
+                     QName type = xs.getSchemaType();
+                     if(type!=null) {
+-                        String format = xmlGregorianCalendarFormatString.get(type);
+-                        if(format!=null)
+-                            return format(format,cal);
+-                        // TODO:
+-                        // we need to think about how to report an error where @XmlSchemaType
+-                        // didn't take effect. a general case is when a transducer isn't even
+-                        // written to look at that value.
+-                    }
+-
++                                                try {
++                                                        checkXmlGregorianCalendarFieldRef(type, cal);
++                                                        String format = xmlGregorianCalendarFormatString.get(type);
++                                                        if(format!=null)
++                                                                return format(format,cal);
++                                                        // TODO:
++                                                        // we need to think about how to report an error where @XmlSchemaType
++                                                        // didn't take effect. a general case is when a transducer isn't even
++                                                        // written to look at that value.
++                                                } catch (javax.xml.bind.MarshalException e){
++                                                        //-xs.handleError(e);
++                                                        System.out.println(e.toString());
++                                                        return "";
++                                                }
++                                        }
+                     return cal.toXMLFormat();
+                 }
+ 
+                 public XMLGregorianCalendar parse(CharSequence lexical) throws SAXException {
+                     try {
+-                        return datatypeFactory.newXMLGregorianCalendar(lexical.toString());
++                        return datatypeFactory.newXMLGregorianCalendar(lexical.toString().trim()); // (.trim() - issue 396)
+                     } catch (Exception e) {
+                         UnmarshallingContext.getInstance().handleError(e);
+                         return null;
+@@ -611,7 +643,7 @@
+ 
+                 public Base64Data print(byte[] v) {
+                     XMLSerializer w = XMLSerializer.getInstance();
+-                    Base64Data bd = w.getCachedBase64DataInstance();
++                    Base64Data bd = new Base64Data();
+                     String mimeType = w.getXMIMEContentType();
+                     bd.set(v,mimeType);
+                     return bd;
+@@ -737,21 +769,6 @@
+                     w.getNamespaceContext().declareNamespace(v.getNamespaceURI(),v.getPrefix(),false);
+                 }
+             },
+-            new StringImpl<URI>(URI.class, createXS("anyURI")) {
+-                public URI parse(CharSequence text) throws SAXException {
+-                    TODO.checkSpec("JSR222 Issue #42");
+-                    try {
+-                        return new URI(text.toString());
+-                    } catch (URISyntaxException e) {
+-                        UnmarshallingContext.getInstance().handleError(e);
+-                        return null;
+-                    }
+-                }
+-
+-                public String print(URI v) {
+-                    return v.toString();
+-                }
+-            },
+             new StringImpl<Duration>(Duration.class,  createXS("duration")) {
+                 public String print(Duration duration) {
+                     return duration.toString();
+@@ -821,6 +838,61 @@
+         }
+     }
+ 
++        private static void checkXmlGregorianCalendarFieldRef(QName type,
++                XMLGregorianCalendar cal)throws javax.xml.bind.MarshalException{
++                StringBuffer buf = new StringBuffer();
++                int bitField = xmlGregorianCalendarFieldRef.get(type);
++                final int l = 0x1;
++                int pos = 0;
++                while (bitField != 0x0){
++                        int bit = bitField & l;
++                        bitField >>>= 4;
++                        pos++;
++
++                        if (bit == 1) {
++                                switch(pos){
++                                        case 1:
++                                                if (cal.getSecond() == DatatypeConstants.FIELD_UNDEFINED){
++                                                        buf.append("  " + Messages.XMLGREGORIANCALENDAR_SEC);
++                                                }
++                                                break;
++                                        case 2:
++                                                if (cal.getMinute() == DatatypeConstants.FIELD_UNDEFINED){
++                                                        buf.append("  " + Messages.XMLGREGORIANCALENDAR_MIN);
++                                                }
++                                                break;
++                                        case 3:
++                                                if (cal.getHour() == DatatypeConstants.FIELD_UNDEFINED){
++                                                        buf.append("  " + Messages.XMLGREGORIANCALENDAR_HR);
++                                                }
++                                                break;
++                                        case 4:
++                                                if (cal.getDay() == DatatypeConstants.FIELD_UNDEFINED){
++                                                        buf.append("  " + Messages.XMLGREGORIANCALENDAR_DAY);
++                                                }
++                                                break;
++                                        case 5:
++                                                if (cal.getMonth() == DatatypeConstants.FIELD_UNDEFINED){
++                                                        buf.append("  " + Messages.XMLGREGORIANCALENDAR_MONTH);
++                                                }
++                                                break;
++                                        case 6:
++                                                if (cal.getYear() == DatatypeConstants.FIELD_UNDEFINED){
++                                                        buf.append("  " + Messages.XMLGREGORIANCALENDAR_YEAR);
++                                                }
++                                                break;
++                                        case 7:  // ignore timezone setting
++                                                break;
++                                }
++                        }
++                }
++                if (buf.length() > 0){
++                        throw new javax.xml.bind.MarshalException(
++                         Messages.XMLGREGORIANCALENDAR_INVALID.format(type.getLocalPart())
++                         + buf.toString());
++                }
++        }
++
+     /**
+      * Format string for the {@link XMLGregorianCalendar}.
+      */
+@@ -839,6 +911,30 @@
+         m.put(DatatypeConstants.GMONTHDAY,  "--%M-%D" +"%z");
+     }
+ 
++        /**
++         * Field designations for XMLGregorianCalendar format string.
++         * sec          0x0000001
++         * min          0x0000010
++         * hrs          0x0000100
++         * day          0x0001000
++         * month        0x0010000
++         * year         0x0100000
++         * timezone 0x1000000
++         */
++        private static final Map<QName, Integer> xmlGregorianCalendarFieldRef =
++                new HashMap<QName, Integer>();
++        static {
++                Map<QName, Integer> f = xmlGregorianCalendarFieldRef;
++                f.put(DatatypeConstants.DATETIME,   0x1111111);
++                f.put(DatatypeConstants.DATE,       0x1111000);
++                f.put(DatatypeConstants.TIME,       0x1000111);
++                f.put(DatatypeConstants.GDAY,       0x1001000);
++                f.put(DatatypeConstants.GMONTH,     0x1010000);
++                f.put(DatatypeConstants.GYEAR,      0x1100000);
++                f.put(DatatypeConstants.GYEARMONTH, 0x1110000);
++                f.put(DatatypeConstants.GMONTHDAY,  0x1011000);
++        }
++
+     /**
+      * {@link RuntimeBuiltinLeafInfoImpl} for {@link UUID}.
+      *
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeClassInfoImpl.java	Thu Jul 30 17:44:57 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeClassInfoImpl.java	Thu Jul 30 17:44:57 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.impl;
+ 
+ import java.io.IOException;
+@@ -33,12 +34,14 @@
+ import java.util.List;
+ import java.util.Map;
+ 
+-import javax.xml.bind.annotation.XmlType;
++import javax.xml.bind.JAXBException;
+ import javax.xml.namespace.QName;
+ import javax.xml.stream.XMLStreamException;
+-import javax.xml.bind.JAXBException;
+ 
+ import com.sun.istack.internal.NotNull;
++import com.sun.xml.internal.bind.AccessorFactory;
++import com.sun.xml.internal.bind.AccessorFactoryImpl;
++import com.sun.xml.internal.bind.XmlAccessorFactory;
+ import com.sun.xml.internal.bind.annotation.XmlLocation;
+ import com.sun.xml.internal.bind.api.AccessorException;
+ import com.sun.xml.internal.bind.v2.ClassFactory;
+@@ -48,6 +51,7 @@
+ import com.sun.xml.internal.bind.v2.model.runtime.RuntimeElement;
+ import com.sun.xml.internal.bind.v2.model.runtime.RuntimePropertyInfo;
+ import com.sun.xml.internal.bind.v2.model.runtime.RuntimeValuePropertyInfo;
++import com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationException;
+ import com.sun.xml.internal.bind.v2.runtime.Location;
+ import com.sun.xml.internal.bind.v2.runtime.Name;
+ import com.sun.xml.internal.bind.v2.runtime.Transducer;
+@@ -54,12 +58,8 @@
+ import com.sun.xml.internal.bind.v2.runtime.XMLSerializer;
+ import com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl;
+ import com.sun.xml.internal.bind.v2.runtime.reflect.Accessor;
+-import com.sun.xml.internal.bind.AccessorFactory;
+-import com.sun.xml.internal.bind.AccessorFactoryImpl;
+ import com.sun.xml.internal.bind.v2.runtime.reflect.TransducedAccessor;
+ import com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext;
+-import com.sun.xml.internal.bind.XmlAccessorFactory;
+-import com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationException;
+ 
+ import org.xml.sax.Locator;
+ import org.xml.sax.SAXException;
+@@ -90,7 +90,8 @@
+         AccessorFactory accFactory = null;
+ 
+         // user providing class to be used.
+-        if (((RuntimeModelBuilder)builder).context.xmlAccessorFactorySupport){
++        JAXBContextImpl context = ((RuntimeModelBuilder) builder).context;
++        if (context!=null && context.xmlAccessorFactorySupport){
+             factoryAnn = findXmlAccessorFactoryAnnotation(clazz);
+ 
+             if (factoryAnn != null) {
+@@ -128,7 +129,7 @@
+     public Method getFactoryMethod(){
+         return super.getFactoryMethod();
+     }
+-    
++
+     public final RuntimeClassInfoImpl getBaseClass() {
+         return (RuntimeClassInfoImpl)super.getBaseClass();
+     }
+@@ -219,7 +220,7 @@
+             return null;
+         if( !valuep.getTarget().isSimpleType() )
+             return null;    // if there's an error, recover from it by returning null.
+-        
++
+         return new TransducerImpl(getClazz(),TransducedAccessor.get(
+                 ((RuntimeModelBuilder)builder).context,valuep));
+     }
+@@ -317,7 +318,7 @@
+     }
+ 
+ 
+-    
++
+     /**
+      * {@link Transducer} implementation used when this class maps to PCDATA in XML.
+      *
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeElementInfoImpl.java	Thu Jul 30 17:45:01 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeElementInfoImpl.java	Thu Jul 30 17:45:00 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.impl;
+ 
+ import java.lang.reflect.Field;
+@@ -51,7 +52,7 @@
+  */
+ final class RuntimeElementInfoImpl extends ElementInfoImpl<Type,Class,Field,Method>
+     implements RuntimeElementInfo {
+-    
++
+     public RuntimeElementInfoImpl(RuntimeModelBuilder modelBuilder, RegistryInfoImpl registry, Method method) throws IllegalAnnotationException {
+         super(modelBuilder, registry, method);
+ 
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeElementPropertyInfoImpl.java	Thu Jul 30 17:45:05 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeElementPropertyInfoImpl.java	Thu Jul 30 17:45:04 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.impl;
+ 
+ import java.lang.reflect.Field;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeEnumConstantImpl.java	Thu Jul 30 17:45:08 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeEnumConstantImpl.java	Thu Jul 30 17:45:07 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.impl;
+ 
+ import java.lang.reflect.Field;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeEnumLeafInfoImpl.java	Thu Jul 30 17:45:12 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeEnumLeafInfoImpl.java	Thu Jul 30 17:45:11 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.impl;
+ 
+ import java.io.IOException;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeMapPropertyInfoImpl.java	Thu Jul 30 17:45:15 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeMapPropertyInfoImpl.java	Thu Jul 30 17:45:14 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.impl;
+ 
+ import java.lang.reflect.Field;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeModelBuilder.java	Thu Jul 30 17:45:19 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeModelBuilder.java	Thu Jul 30 17:45:18 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.impl;
+ 
+ import java.lang.reflect.Field;
+@@ -50,7 +51,10 @@
+ import com.sun.xml.internal.bind.v2.runtime.Transducer;
+ import com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl;
+ import com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext;
++import com.sun.istack.internal.Nullable;
+ 
++import com.sun.xml.internal.bind.v2.WellKnownNamespace;
++import javax.xml.namespace.QName;
+ import org.xml.sax.SAXException;
+ 
+ /**
+@@ -66,8 +70,9 @@
+ public class RuntimeModelBuilder extends ModelBuilder<Type,Class,Field,Method> {
+     /**
+      * The {@link JAXBContextImpl} for which the model is built.
++     * Null when created for reflection.
+      */
+-    public final JAXBContextImpl context;
++    public final @Nullable JAXBContextImpl context;
+ 
+     public RuntimeModelBuilder(JAXBContextImpl context, RuntimeAnnotationReader annotationReader, Map<Class, Class> subclassReplacements, String defaultNamespaceRemap) {
+         super(annotationReader, Navigator.REFLECTION, subclassReplacements, defaultNamespaceRemap);
+@@ -144,14 +149,20 @@
+         if(src.inlineBinaryData())
+             t = new InlineBinaryTransducer(t);
+ 
+-        if(src.getSchemaType()!=null)
++        if(src.getSchemaType()!=null) {
++            if (src.getSchemaType().equals(createXSSimpleType())) {
++                return RuntimeBuiltinLeafInfoImpl.STRING;
++            }
+             t = new SchemaTypeTransducer(t,src.getSchemaType());
++        }
+ 
+         return t;
+     }
+ 
++    private static QName createXSSimpleType() {
++        return new QName(WellKnownNamespace.XML_SCHEMA,"anySimpleType");
++    }
+ 
+-
+     /**
+      * Transducer implementation for ID.
+      *
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeReferencePropertyInfoImpl.java	Thu Jul 30 17:45:22 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeReferencePropertyInfoImpl.java	Thu Jul 30 17:45:22 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.impl;
+ 
+ import java.lang.reflect.Field;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeTypeInfoSetImpl.java	Thu Jul 30 17:45:26 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeTypeInfoSetImpl.java	Thu Jul 30 17:45:25 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.impl;
+ 
+ import java.lang.reflect.Field;
+@@ -83,7 +84,7 @@
+     }
+ 
+     public Map<Class,RuntimeArrayInfoImpl> arrays() {
+-        return (Map<Class,RuntimeArrayInfoImpl>)super.arrays(); 
++        return (Map<Class,RuntimeArrayInfoImpl>)super.arrays();
+     }
+ 
+     public RuntimeElementInfoImpl getElementInfo(Class scope,QName name) {
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeTypeRefImpl.java	Thu Jul 30 17:45:29 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeTypeRefImpl.java	Thu Jul 30 17:45:29 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.impl;
+ 
+ import java.lang.reflect.Type;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeValuePropertyInfoImpl.java	Thu Jul 30 17:45:33 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeValuePropertyInfoImpl.java	Thu Jul 30 17:45:32 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.impl;
+ 
+ import java.lang.reflect.Field;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/SingleTypePropertyInfoImpl.java	Thu Jul 30 17:45:36 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/SingleTypePropertyInfoImpl.java	Thu Jul 30 17:45:36 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.impl;
+ 
+ import java.util.Collections;
+@@ -87,8 +88,8 @@
+     public void link() {
+         super.link();
+ 
+-        if(!type.isSimpleType() && id()!=ID.IDREF) {
+-            parent.builder.reportError(new IllegalAnnotationException(
++        if (!(NonElement.ANYTYPE_NAME.equals(type.getTypeName()) || type.isSimpleType() || id()==ID.IDREF)) {
++                parent.builder.reportError(new IllegalAnnotationException(
+                 Messages.SIMPLE_TYPE_IS_REQUIRED.format(),
+                 seed
+             ));
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/TypeInfoImpl.java	Thu Jul 30 17:45:40 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/TypeInfoImpl.java	Thu Jul 30 17:45:39 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.impl;
+ 
+ import javax.xml.bind.annotation.XmlRootElement;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/TypeInfoSetImpl.java	Thu Jul 30 17:45:43 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/TypeInfoSetImpl.java	Thu Jul 30 17:45:43 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.impl;
+ 
+ import java.util.Collections;
+@@ -109,7 +110,7 @@
+      */
+     private final Map<C,Map<QName,ElementInfoImpl<T,C,F,M>>> elementMappings =
+         new LinkedHashMap<C,Map<QName,ElementInfoImpl<T,C,F,M>>>();
+-    
++
+     private final Iterable<? extends ElementInfoImpl<T,C,F,M>> allElements =
+         new Iterable<ElementInfoImpl<T,C,F,M>>() {
+             public Iterator<ElementInfoImpl<T,C,F,M>> iterator() {
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/TypeRefImpl.java	Thu Jul 30 17:45:47 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/TypeRefImpl.java	Thu Jul 30 17:45:46 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.impl;
+ 
+ import javax.xml.namespace.QName;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/Util.java	Thu Jul 30 17:45:51 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/Util.java	Thu Jul 30 17:45:50 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.impl;
+ 
+ import javax.activation.MimeType;
+@@ -73,13 +74,13 @@
+ 
+         return null;
+     }
+-    
++
+     static MimeType calcExpectedMediaType(AnnotationSource primarySource,
+                         ModelBuilder builder ) {
+         XmlMimeType xmt = primarySource.readAnnotation(XmlMimeType.class);
+         if(xmt==null)
+             return null;
+-        
++
+         try {
+             return new MimeType(xmt.value());
+         } catch (MimeTypeParseException e) {
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/ValuePropertyInfoImpl.java	Thu Jul 30 17:45:54 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/ValuePropertyInfoImpl.java	Thu Jul 30 17:45:53 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.impl;
+ 
+ import com.sun.xml.internal.bind.v2.model.core.PropertyKind;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/nav/GenericArrayTypeImpl.java	Thu Jul 30 17:45:58 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/nav/GenericArrayTypeImpl.java	Thu Jul 30 17:45:57 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.nav;
+ 
+ import java.lang.reflect.GenericArrayType;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/nav/Navigator.java	Thu Jul 30 17:46:01 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/nav/Navigator.java	Thu Jul 30 17:46:01 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.nav;
+ 
+ import java.util.Collection;
+@@ -138,7 +139,7 @@
+      * Note that this method does not list methods declared on base classes.
+      *
+      * @return
+-     *      can be empty but always non-null. 
++     *      can be empty but always non-null.
+      */
+     Collection<? extends M> getDeclaredMethods(C clazz);
+ 
+@@ -334,7 +335,7 @@
+      *
+      * @return
+      *      can be empty but never null.
+-     */ 
++     */
+     F[] getEnumConstants(C clazz);
+ 
+     /**
+@@ -386,6 +387,9 @@
+      *
+      * This is only used to improve the error diagnostics, so
+      * it's OK to fail to detect some inner classes as such.
++     *
++     * Note that this method should return false for nested classes
++     * (static classes.)
+      */
+     boolean isInnerClass(C clazz);
+ }
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/nav/ParameterizedTypeImpl.java	Thu Jul 30 17:46:05 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/nav/ParameterizedTypeImpl.java	Thu Jul 30 17:46:04 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.nav;
+ 
+ import java.lang.reflect.MalformedParameterizedTypeException;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/nav/ReflectionNavigator.java	Thu Jul 30 17:46:08 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/nav/ReflectionNavigator.java	Thu Jul 30 17:46:08 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.nav;
+ 
+ import java.lang.reflect.Array;
+@@ -143,7 +144,7 @@
+ 
+         Type replace( TypeVariable v ) {
+             for(int i=0; i<params.length; i++)
+-                if(params[i]==v)
++                if(params[i].equals(v))
+                     return args[i];
+             return v;   // this is a free variable
+         }
+@@ -548,7 +549,7 @@
+     }
+ 
+     public boolean isInnerClass(Class clazz) {
+-        return clazz.getEnclosingClass()!=null;
++        return clazz.getEnclosingClass()!=null && !Modifier.isStatic(clazz.getModifiers());
+     }
+ 
+ 
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/nav/TypeVisitor.java	Thu Jul 30 17:46:12 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/nav/TypeVisitor.java	Thu Jul 30 17:46:11 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.nav;
+ 
+ import java.lang.reflect.GenericArrayType;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/nav/WildcardTypeImpl.java	Thu Jul 30 17:46:16 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/nav/WildcardTypeImpl.java	Thu Jul 30 17:46:15 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.nav;
+ 
+ import java.lang.reflect.Type;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeArrayInfo.java	Thu Jul 30 17:46:19 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeArrayInfo.java	Thu Jul 30 17:46:19 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.runtime;
+ 
+ import java.lang.reflect.Type;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeAttributePropertyInfo.java	Thu Jul 30 17:46:23 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeAttributePropertyInfo.java	Thu Jul 30 17:46:22 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.runtime;
+ 
+ import java.lang.reflect.Type;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeBuiltinLeafInfo.java	Thu Jul 30 17:46:26 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeBuiltinLeafInfo.java	Thu Jul 30 17:46:26 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.runtime;
+ 
+ import java.lang.reflect.Type;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeClassInfo.java	Thu Jul 30 17:46:30 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeClassInfo.java	Thu Jul 30 17:46:29 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.runtime;
+ 
+ import java.lang.reflect.Type;
+@@ -48,7 +49,7 @@
+     RuntimePropertyInfo getProperty(String name);
+ 
+     Method getFactoryMethod();
+-    
++
+     /**
+      * If {@link #hasAttributeWildcard()} is true,
+      * returns the accessor to access the property.
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeElement.java	Thu Jul 30 17:46:33 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeElement.java	Thu Jul 30 17:46:33 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.runtime;
+ 
+ import java.lang.reflect.Type;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeElementInfo.java	Thu Jul 30 17:46:40 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeElementInfo.java	Thu Jul 30 17:46:40 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.runtime;
+ 
+ import java.lang.reflect.Type;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeElementPropertyInfo.java	Thu Jul 30 17:46:44 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeElementPropertyInfo.java	Thu Jul 30 17:46:43 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.runtime;
+ 
+ import java.lang.reflect.Type;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeEnumLeafInfo.java	Thu Jul 30 17:46:47 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeEnumLeafInfo.java	Thu Jul 30 17:46:47 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.runtime;
+ 
+ import java.lang.reflect.Type;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeLeafInfo.java	Thu Jul 30 17:46:51 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeLeafInfo.java	Thu Jul 30 17:46:50 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.runtime;
+ 
+ import java.lang.reflect.Type;
+@@ -58,7 +59,7 @@
+      * While conceptually this method belongs to {@link RuntimeNonElement},
+      * if we do that we have to put a lot of dummy implementations everywhere,
+      * so it's placed here, where it's actually needed.
+-     * 
++     *
+      * @return
+      *      Always non-null. Do not modify the returned array.
+      */
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeMapPropertyInfo.java	Thu Jul 30 17:46:54 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeMapPropertyInfo.java	Thu Jul 30 17:46:54 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.runtime;
+ 
+ import java.lang.reflect.Type;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeNonElement.java	Thu Jul 30 17:46:58 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeNonElement.java	Thu Jul 30 17:46:57 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.runtime;
+ 
+ import java.lang.reflect.Type;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeNonElementRef.java	Thu Jul 30 17:47:01 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeNonElementRef.java	Thu Jul 30 17:47:00 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.runtime;
+ 
+ import java.lang.reflect.Type;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimePropertyInfo.java	Thu Jul 30 17:47:05 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimePropertyInfo.java	Thu Jul 30 17:47:04 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.runtime;
+ 
+ import java.lang.reflect.Type;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeReferencePropertyInfo.java	Thu Jul 30 17:47:08 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeReferencePropertyInfo.java	Thu Jul 30 17:47:07 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.runtime;
+ 
+ import java.lang.reflect.Type;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeTypeInfo.java	Thu Jul 30 17:47:12 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeTypeInfo.java	Thu Jul 30 17:47:11 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.runtime;
+ 
+ import java.lang.reflect.Type;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeTypeInfoSet.java	Thu Jul 30 17:47:15 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeTypeInfoSet.java	Thu Jul 30 17:47:14 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.runtime;
+ 
+ import java.lang.reflect.Field;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeTypeRef.java	Thu Jul 30 17:47:19 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeTypeRef.java	Thu Jul 30 17:47:18 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.runtime;
+ 
+ import java.lang.reflect.Type;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeValuePropertyInfo.java	Thu Jul 30 17:47:22 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeValuePropertyInfo.java	Thu Jul 30 17:47:21 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.model.runtime;
+ 
+ import java.lang.reflect.Type;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/package-info.java	Thu Jul 30 17:47:26 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/runtime/package-info.java	Thu Jul 30 17:47:25 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ /**
+  * The specialization of {@link com.sun.xml.internal.bind.v2.model.core} for the runtime.
+  *
+@@ -28,7 +29,7 @@
+  * <p>
+  * This package offers stronger types and additional methods available at the runtime
+  * to access objects according to the model. Most of the interfaces correspond one to one
+- * with the core package, and they are simply named with {@code Runtime} prefix.    
++ * with the core package, and they are simply named with {@code Runtime} prefix.
+  */
+ @XmlSchema(namespace="http://jaxb.dev.java.net/xjc/model",elementFormDefault=XmlNsForm.QUALIFIED)
+ package com.sun.xml.internal.bind.v2.model.runtime;
+@@ -35,6 +36,3 @@
+ 
+ import javax.xml.bind.annotation.XmlNsForm;
+ import javax.xml.bind.annotation.XmlSchema;
+-
+-
+-
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/package-info.java	Thu Jul 30 17:47:29 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/package-info.java	Thu Jul 30 17:47:28 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ /**
+  * <h1>The JAXB 2.0 runtime</h1>.
+  *
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/AnyTypeBeanInfo.java	Thu Jul 30 17:47:32 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/AnyTypeBeanInfo.java	Thu Jul 30 17:47:32 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime;
+ 
+ import java.io.IOException;
+@@ -51,8 +52,10 @@
+  *
+  * @author Kohsuke Kawaguchi
+  */
+-final class AnyTypeBeanInfo extends JaxBeanInfo<Object> {
++final class AnyTypeBeanInfo extends JaxBeanInfo<Object> implements AttributeAccessor {
+ 
++    private boolean nilIncluded = false;
++
+     public AnyTypeBeanInfo(JAXBContextImpl grammar,RuntimeTypeInfo anyTypeInfo) {
+         super(grammar, anyTypeInfo, Object.class, new QName(WellKnownNamespace.XML_SCHEMA,"anyType"), false, true, false);
+     }
+@@ -113,7 +116,9 @@
+             String local = a.getLocalName();
+             String name = a.getName();
+             if(local==null) local = name;
+-
++            if (uri.equals(WellKnownNamespace.XML_SCHEMA_INSTANCE) && ("nil".equals(local))) {
++                nilIncluded = true;
++            }
+             if(name.startsWith("xmlns")) continue;// DOM reports ns decls as attributes
+ 
+             target.attribute(uri,local,a.getValue());
+@@ -163,4 +168,8 @@
+     private static final W3CDomHandler domHandler = new W3CDomHandler();
+     private static final DomLoader domLoader = new DomLoader(domHandler);
+     private final XsiTypeLoader substLoader = new XsiTypeLoader(this);
++
++    public boolean isNilIncluded() {
++        return nilIncluded;
++    }
+ }
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/ArrayBeanInfoImpl.java	Thu Jul 30 17:47:36 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/ArrayBeanInfoImpl.java	Thu Jul 30 17:47:35 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime;
+ 
+ import java.io.IOException;
+@@ -54,14 +55,18 @@
+ 
+     private final Class itemType;
+     private final JaxBeanInfo itemBeanInfo;
+-    private final Loader loader;
++    private Loader loader;
+ 
+     public ArrayBeanInfoImpl(JAXBContextImpl owner, RuntimeArrayInfo rai) {
+         super(owner,rai,rai.getType(), rai.getTypeName(), false, true, false);
+         this.itemType = jaxbType.getComponentType();
+         this.itemBeanInfo = owner.getOrCreate(rai.getItemType());
++    }
+ 
+-        loader = new ArrayLoader(owner);
++    @Override
++    protected void link(JAXBContextImpl grammar) {
++        getLoader(grammar,false);
++        super.link(grammar);
+     }
+ 
+     private final class ArrayLoader extends Loader implements Receiver {
+@@ -119,7 +124,7 @@
+             if(item==null) {
+                 target.writeXsiNilTrue();
+             } else {
+-                target.childAsXsiType(item,"arrayItem",itemBeanInfo);
++                target.childAsXsiType(item,"arrayItem",itemBeanInfo, false);
+             }
+             target.endElement();
+         }
+@@ -168,6 +173,9 @@
+     }
+ 
+     public final Loader getLoader(JAXBContextImpl context, boolean typeSubstitutionCapable) {
++        if(loader==null)
++            loader = new ArrayLoader(context);
++
+         // type substitution not possible
+         return loader;
+     }
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/AssociationMap.java	Thu Jul 30 17:47:40 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/AssociationMap.java	Thu Jul 30 17:47:39 2009
+@@ -32,12 +32,12 @@
+ /**
+  * Bi-directional map between elements, inner peers,
+  * and outer peers.
+- * 
++ *
+  * <p>
+  * TODO: this should be rewritten for efficiency.
+- * 
++ *
+  * @since 2.0
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+@@ -44,23 +44,23 @@
+ public final class AssociationMap<XmlNode> {
+     final static class Entry<XmlNode> {
+         /** XML element. */
+-    	private XmlNode element;
++        private XmlNode element;
+         /** inner peer, or null. */
+         private Object inner;
+         /** outer peer, or null. */
+         private Object outer;
+-        
++
+         public XmlNode element() {
+-        	return element;
++                return element;
+         }
+         public Object inner() {
+-        	return inner;
++                return inner;
+         }
+         public Object outer() {
+-        	return outer;
++                return outer;
+         }
+     }
+-    
++
+     private final Map<XmlNode,Entry<XmlNode>> byElement = new IdentityHashMap<XmlNode,Entry<XmlNode>>();
+     private final Map<Object,Entry<XmlNode>> byPeer = new IdentityHashMap<Object,Entry<XmlNode>>();
+     private final Set<XmlNode> usedNodes = new HashSet<XmlNode>();
+@@ -69,17 +69,17 @@
+     public void addInner( XmlNode element, Object inner ) {
+         Entry<XmlNode> e = byElement.get(element);
+         if(e!=null) {
+-        	if(e.inner!=null)
++                if(e.inner!=null)
+                 byPeer.remove(e.inner);
+             e.inner = inner;
+         } else {
+-        	e = new Entry<XmlNode>();
++                e = new Entry<XmlNode>();
+             e.element = element;
+             e.inner = inner;
+         }
+-        
++
+         byElement.put(element,e);
+-        
++
+         Entry<XmlNode> old = byPeer.put(inner,e);
+         if(old!=null) {
+             if(old.outer!=null)
+@@ -88,7 +88,7 @@
+                 byElement.remove(old.element);
+         }
+     }
+-    
++
+     /** Records the new element&lt;->outer peer association. */
+     public void addOuter( XmlNode element, Object outer ) {
+         Entry<XmlNode> e = byElement.get(element);
+@@ -101,13 +101,13 @@
+             e.element = element;
+             e.outer = outer;
+         }
+-        
++
+         byElement.put(element,e);
+-        
++
+         Entry<XmlNode> old = byPeer.put(outer,e);
+         if(old!=null) {
+             old.outer=null;
+-            
++
+             if(old.inner==null)
+                 // remove this entry
+                 byElement.remove(old.element);
+@@ -121,17 +121,17 @@
+     public Entry<XmlNode> byElement( Object e ) {
+         return byElement.get(e);
+     }
+-    
++
+     public Entry<XmlNode> byPeer( Object o ) {
+         return byPeer.get(o);
+     }
+-    
++
+     public Object getInnerPeer( XmlNode element ) {
+         Entry e = byElement(element);
+         if(e==null)     return null;
+         else            return e.inner;
+     }
+-    
++
+     public Object getOuterPeer( XmlNode element ) {
+         Entry e = byElement(element);
+         if(e==null)     return null;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/BinderImpl.java	Thu Jul 30 17:47:43 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/BinderImpl.java	Thu Jul 30 17:47:42 2009
+@@ -44,11 +44,11 @@
+ 
+ /**
+  * Implementation of {@link Binder}.
+- * 
++ *
+  * TODO: investigate how much in-place unmarshalling is implemented
+  *      - some preliminary work is there. Probably buggy.
+  * TODO: work on the marshaller side.
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+@@ -58,7 +58,7 @@
+      * The parent context object.
+      */
+     private final JAXBContextImpl context;
+-    
++
+     /**
+      * Lazily created unmarshaller to do XML->Java binding.
+      * @see #getUnmarshaller()
+@@ -72,18 +72,18 @@
+     private MarshallerImpl marshaller;
+ 
+     private final InfosetScanner<XmlNode> scanner;
+-    
++
+     /**
+      * A {@link Binder} always works with the same
+      * association map.
+      */
+     private final AssociationMap<XmlNode> assoc = new AssociationMap<XmlNode>();
+-    
++
+     BinderImpl(JAXBContextImpl _context,InfosetScanner<XmlNode> scanner) {
+         this.context = _context;
+         this.scanner = scanner;
+     }
+-    
++
+     private UnmarshallerImpl getUnmarshaller() {
+         if(unmarshaller==null)
+             unmarshaller = new UnmarshallerImpl(context,assoc);
+@@ -146,11 +146,13 @@
+         } catch( SAXException e ) {
+             throw unmarshaller.createUnmarshalException(e);
+         }
+-        
++
+         return handler.getContext().getResult();
+     }
+ 
+     public XmlNode getXMLNode(Object jaxbObject) {
++        if(jaxbObject==null)
++            throw new IllegalArgumentException();
+         AssociationMap.Entry<XmlNode> e = assoc.byPeer(jaxbObject);
+         if(e==null)     return null;
+         return e.element();
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/BridgeAdapter.java	Thu Jul 30 17:47:47 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/BridgeAdapter.java	Thu Jul 30 17:47:46 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime;
+ 
+ import java.io.IOException;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/BridgeContextImpl.java	Thu Jul 30 17:47:50 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/BridgeContextImpl.java	Thu Jul 30 17:47:49 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime;
+ 
+ import javax.xml.bind.JAXBException;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/BridgeImpl.java	Thu Jul 30 17:47:54 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/BridgeImpl.java	Thu Jul 30 17:47:53 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime;
+ 
+ import java.io.IOException;
+@@ -75,7 +76,7 @@
+ 
+     public void marshal(Marshaller _m, T t, XMLStreamWriter output) throws JAXBException {
+         MarshallerImpl m = (MarshallerImpl)_m;
+-        m.write(tagName,bi,t,XMLStreamWriterOutput.create(output,context),new StAXPostInitAction(output,m.serializer));        
++        m.write(tagName,bi,t,XMLStreamWriterOutput.create(output,context),new StAXPostInitAction(output,m.serializer));
+     }
+ 
+     public void marshal(Marshaller _m, T t, OutputStream output, NamespaceContext nsContext) throws JAXBException {
+@@ -132,7 +133,7 @@
+         if(value==null) {
+             out.writeXsiNilTrue();
+         } else {
+-            out.childAsXsiType(value,null,bi);
++            out.childAsXsiType(value,null,bi,false);
+         }
+         out.endElement();
+     }
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/ClassBeanInfoImpl.java	Thu Jul 30 17:47:57 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/ClassBeanInfoImpl.java	Thu Jul 30 17:47:56 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime;
+ 
+ import java.io.IOException;
+@@ -36,6 +37,7 @@
+ import java.util.logging.Logger;
+ 
+ import javax.xml.bind.ValidationEvent;
++import javax.xml.bind.annotation.XmlRootElement;
+ import javax.xml.bind.helpers.ValidationEventImpl;
+ import javax.xml.namespace.QName;
+ import javax.xml.stream.XMLStreamException;
+@@ -44,6 +46,7 @@
+ import com.sun.xml.internal.bind.Util;
+ import com.sun.xml.internal.bind.api.AccessorException;
+ 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.runtime.RuntimeClassInfo;
+ import com.sun.xml.internal.bind.v2.model.runtime.RuntimePropertyInfo;
+@@ -65,8 +68,10 @@
+  *
+  * @author Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+-public final class ClassBeanInfoImpl<BeanT> extends JaxBeanInfo<BeanT> {
++public final class ClassBeanInfoImpl<BeanT> extends JaxBeanInfo<BeanT> implements AttributeAccessor<BeanT> {
+ 
++    private boolean isNilIncluded = false;
++
+     /**
+      * Properties of this bean class but not its ancestor classes.
+      */
+@@ -115,7 +120,7 @@
+     private /*final*/ Property<BeanT>[] uriProperties;
+ 
+     private final Method factoryMethod;
+-    
++
+     /*package*/ ClassBeanInfoImpl(JAXBContextImpl owner, RuntimeClassInfo ci) {
+         super(owner,ci,ci.getClazz(),ci.getTypeName(),ci.isElement(),false,true);
+ 
+@@ -139,7 +144,7 @@
+             }
+         }
+ 
+-        
++
+         if(ci.getBaseClass()==null)
+             this.superClazz = null;
+         else
+@@ -239,8 +244,8 @@
+     }
+ 
+     public BeanT createInstance(UnmarshallingContext context) throws IllegalAccessException, InvocationTargetException, InstantiationException, SAXException {
+-        
+-        BeanT bean = null;        
++
++        BeanT bean = null;
+         if (factoryMethod == null){
+            bean = ClassFactory.create0(jaxbType);
+         }else {
+@@ -251,7 +256,7 @@
+                 throw new InstantiationException("The factory method didn't return a correct object");
+             }
+         }
+-        
++
+         if(xmlLocatorField!=null)
+             // need to copy because Locator is mutable
+             try {
+@@ -288,17 +293,22 @@
+ 
+     public void serializeRoot(BeanT bean, XMLSerializer target) throws SAXException, IOException, XMLStreamException {
+         if(tagName==null) {
+-            target.reportError(
+-                    new ValidationEventImpl(
+-                            ValidationEvent.ERROR,
+-                            Messages.UNABLE_TO_MARSHAL_NON_ELEMENT.format(bean.getClass().getName()),
+-                            null,
+-                            null));
++            Class beanClass = bean.getClass();
++            String message;
++
++            if (beanClass.isAnnotationPresent(XmlRootElement.class)) {
++                message = Messages.UNABLE_TO_MARSHAL_UNBOUND_CLASS.format(beanClass.getName());
++            } else {
++                message = Messages.UNABLE_TO_MARSHAL_NON_ELEMENT.format(beanClass.getName());
++            }
++
++            target.reportError(new ValidationEventImpl(ValidationEvent.ERROR,message,null, null));
+         }
+         else {
+             target.startElement(tagName,bean);
+             target.childAsSoleContent(bean,null);
+             target.endElement();
++            target.currentProperty.remove();
+         }
+     }
+ 
+@@ -306,8 +316,10 @@
+         if(superClazz!=null)
+             superClazz.serializeBody(bean,target);
+         try {
+-            for( Property<BeanT> p : properties )
++            for( Property<BeanT> p : properties ) {
++                target.currentProperty.set(p);
+                 p.serializeBody(bean,target, null);
++            }
+         } catch (AccessorException e) {
+             target.reportError(null,e);
+         }
+@@ -314,10 +326,20 @@
+     }
+ 
+     public void serializeAttributes(BeanT bean, XMLSerializer target) throws SAXException, IOException, XMLStreamException {
+-        try {
+-            for( AttributeProperty<BeanT> p : attributeProperties )
++        for( AttributeProperty<BeanT> p : attributeProperties )
++            try {
++                final Property parentProperty = target.getCurrentProperty();
++                target.currentProperty.set(p);
+                 p.serializeAttributes(bean,target);
++                target.currentProperty.set(parentProperty);
++                if (p.attName.equals(WellKnownNamespace.XML_SCHEMA_INSTANCE, "nil")) {
++                    isNilIncluded = true;
++                }
++            } catch (AccessorException e) {
++                target.reportError(null,e);
++            }
+ 
++        try {
+             if(inheritedAttWildcard!=null) {
+                 Map<QName,String> map = inheritedAttWildcard.get(bean);
+                 target.attWildcardAsAttributes(map,null);
+@@ -329,8 +351,12 @@
+ 
+     public void serializeURIs(BeanT bean, XMLSerializer target) throws SAXException {
+         try {
+-            for( Property<BeanT> p : uriProperties )
++            final Property parentProperty = target.getCurrentProperty();
++            for( Property<BeanT> p : uriProperties ) {
++                target.currentProperty.set(p);
+                 p.serializeURIs(bean,target);
++            }
++            target.currentProperty.set(parentProperty);
+ 
+             if(inheritedAttWildcard!=null) {
+                 Map<QName,String> map = inheritedAttWildcard.get(bean);
+@@ -369,5 +395,8 @@
+     private static final AttributeProperty[] EMPTY_PROPERTIES = new AttributeProperty[0];
+ 
+     private static final Logger logger = Util.getClassLogger();
+-}
+ 
++    public boolean isNilIncluded() {
++        return isNilIncluded;
++    }
++}
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/CompositeStructureBeanInfo.java	Thu Jul 30 17:48:01 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/CompositeStructureBeanInfo.java	Thu Jul 30 17:48:00 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime;
+ 
+ import java.io.IOException;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/ContentHandlerAdaptor.java	Thu Jul 30 17:48:04 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/ContentHandlerAdaptor.java	Thu Jul 30 17:48:03 2009
+@@ -38,7 +38,7 @@
+ /**
+  * Receives SAX2 events and send the equivalent events to
+  * {@link XMLSerializer}
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+@@ -49,14 +49,14 @@
+ 
+     /** Events will be sent to this object. */
+     private final XMLSerializer serializer;
+-    
++
+     private final StringBuffer text = new StringBuffer();
+-    
+-    
++
++
+     ContentHandlerAdaptor( XMLSerializer _serializer ) {
+         this.serializer = _serializer;
+     }
+-    
++
+     public void startDocument() {
+         prefixMap.clear();
+     }
+@@ -89,7 +89,7 @@
+                 serializer.startElementForce(namespaceURI,localName,p,null);
+             else
+                 serializer.startElement(namespaceURI,localName, p,null);
+-            
++
+             // declare namespace events
+             for( int i=0; i<prefixMap.size(); i+=2 ) {
+                 // forcibly set this binding, instead of using declareNsUri.
+@@ -99,7 +99,7 @@
+                 serializer.getNamespaceContext().force(
+                     prefixMap.get(i+1), prefixMap.get(i) );
+             }
+-            // make sure namespaces needed by attributes are bound 
++            // make sure namespaces needed by attributes are bound
+             for( int i=0; i<len; i++ ) {
+                 String qname = atts.getQName(i);
+                 if(qname.startsWith("xmlns"))
+@@ -143,7 +143,7 @@
+             throw new SAXException2(e);
+         }
+     }
+-    
++
+     private void flushText() throws SAXException, IOException, XMLStreamException {
+         if( text.length()!=0 ) {
+             serializer.text(text.toString(),null);
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/Coordinator.java	Thu Jul 30 17:48:07 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/Coordinator.java	Thu Jul 30 17:48:07 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime;
+ 
+ import java.util.HashMap;
+@@ -62,7 +63,7 @@
+  * @author Kohsuke Kawaguchi
+  */
+ public abstract class Coordinator implements ErrorHandler, ValidationEventHandler {
+-    
++
+     private final HashMap<Class<? extends XmlAdapter>,XmlAdapter> adapters =
+             new HashMap<Class<? extends XmlAdapter>,XmlAdapter>();
+ 
+@@ -96,13 +97,13 @@
+     /**
+      * The {@link Coordinator} in charge before this {@link Coordinator}.
+      */
+-    private Coordinator old;
++    private Object old;
+ 
+     /**
+      * A 'pointer' to a {@link Coordinator} that keeps track of the currently active {@link Coordinator}.
+      * Having this improves the runtime performance.
+      */
+-    private Coordinator[] table;
++    private Object[] table;
+ 
+     /**
+      * When we set {@link #table} to null, record who did it.
+@@ -126,7 +127,7 @@
+      */
+     protected final void resetThreadAffinity() {
+         if(debugTableNPE)
+-            guyWhoSetTheTableToNull = new Exception(); // remember that we set it to null 
++            guyWhoSetTheTableToNull = new Exception(); // remember that we set it to null
+         table = null;
+     }
+ 
+@@ -148,13 +149,13 @@
+     }
+ 
+     public static Coordinator _getInstance() {
+-        return activeTable.get()[0];
++        return (Coordinator) activeTable.get()[0];
+     }
+ 
+     // this much is necessary to avoid calling get and set twice when we push.
+-    private static final ThreadLocal<Coordinator[]> activeTable = new ThreadLocal<Coordinator[]>() {
+-        public Coordinator[] initialValue() {
+-            return new Coordinator[1];
++    private static final ThreadLocal<Object[]> activeTable = new ThreadLocal<Object[]>() {
++        public Object[] initialValue() {
++            return new Object[1];
+         }
+     };
+ 
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/DomPostInitAction.java	Thu Jul 30 17:48:11 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/DomPostInitAction.java	Thu Jul 30 17:48:10 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime;
+ 
+ import java.util.HashSet;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/ElementBeanInfoImpl.java	Thu Jul 30 17:48:14 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/ElementBeanInfoImpl.java	Thu Jul 30 17:48:14 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime;
+ 
+ import java.io.IOException;
+@@ -37,6 +38,7 @@
+ import com.sun.xml.internal.bind.v2.model.core.PropertyKind;
+ import com.sun.xml.internal.bind.v2.model.nav.Navigator;
+ import com.sun.xml.internal.bind.v2.model.runtime.RuntimeElementInfo;
++import com.sun.xml.internal.bind.v2.model.runtime.RuntimePropertyInfo;
+ import com.sun.xml.internal.bind.v2.runtime.property.Property;
+ import com.sun.xml.internal.bind.v2.runtime.property.PropertyFactory;
+ import com.sun.xml.internal.bind.v2.runtime.property.UnmarshallerChain;
+@@ -136,7 +138,7 @@
+                     if(value==null) {
+                         target.writeXsiNilTrue();
+                     } else {
+-                        target.childAsXsiType(value,"value",tbi);
++                        target.childAsXsiType(value,"value",tbi, false);
+                     }
+                     target.endElement();
+                 } else {
+@@ -172,6 +174,11 @@
+ 
+             public void wrapUp() {
+             }
++
++            public RuntimePropertyInfo getInfo() {
++                return property.getInfo();
++            }
++
+         };
+     }
+ 
+@@ -224,6 +231,10 @@
+             state.target = state.backup;
+             state.backup = null;
+ 
++            if (state.nil) {
++                e.setNil(true);
++            }
++
+             if(o!=null)
+                 // if the value is a leaf type, it's often already set to the element
+                 // through Accessor.
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/FilterTransducer.java	Thu Jul 30 17:48:18 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/FilterTransducer.java	Thu Jul 30 17:48:17 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime;
+ 
+ import java.io.IOException;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/IllegalAnnotationException.java	Thu Jul 30 17:48:21 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/IllegalAnnotationException.java	Thu Jul 30 17:48:21 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime;
+ 
+ import java.lang.annotation.Annotation;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/IllegalAnnotationsException.java	Thu Jul 30 17:48:25 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/IllegalAnnotationsException.java	Thu Jul 30 17:48:24 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime;
+ 
+ import java.util.ArrayList;
+@@ -57,7 +58,7 @@
+     public String toString() {
+         StringBuilder sb = new StringBuilder(super.toString());
+         sb.append('\n');
+-        
++
+         for( IllegalAnnotationException error : errors )
+             sb.append(error.toString()).append('\n');
+ 
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/InlineBinaryTransducer.java	Thu Jul 30 17:48:28 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/InlineBinaryTransducer.java	Thu Jul 30 17:48:28 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime;
+ 
+ import java.io.IOException;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/InternalBridge.java	Thu Jul 30 17:48:32 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/InternalBridge.java	Thu Jul 30 17:48:31 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime;
+ 
+ import java.io.IOException;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/JAXBContextImpl.java	Thu Jul 30 17:48:35 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/JAXBContextImpl.java	Thu Jul 30 17:48:35 2009
+@@ -40,6 +40,8 @@
+ import java.util.Map;
+ import java.util.Set;
+ import java.util.TreeSet;
++import java.security.AccessController;
++import java.security.PrivilegedAction;
+ 
+ import javax.xml.bind.Binder;
+ import javax.xml.bind.DatatypeConverter;
+@@ -68,7 +70,6 @@
+ import javax.xml.transform.sax.TransformerHandler;
+ 
+ import com.sun.istack.internal.NotNull;
+-import com.sun.istack.internal.Nullable;
+ import com.sun.istack.internal.Pool;
+ import com.sun.xml.internal.bind.DatatypeConverterImpl;
+ import com.sun.xml.internal.bind.api.AccessorException;
+@@ -122,7 +123,6 @@
+ /**
+  * This class provides the implementation of JAXBContext.
+  *
+- * @version $Revision$
+  */
+ public final class JAXBContextImpl extends JAXBRIContext {
+ 
+@@ -215,6 +215,10 @@
+      */
+     public final boolean allNillable;
+ 
++    /**
++     * Store properties, so that they can be recovered in the run (is here because of JSON encoding of Jersey).
++     */
++    public final boolean retainPropertyInfo;
+ 
+     private WeakReference<RuntimeTypeInfoSet> typeInfoSetCache;
+ 
+@@ -240,41 +244,38 @@
+      * @param xmlAccessorFactorySupport
+      *      Use custom com.sun.xml.internal.bind.v2.runtime.reflect.Accessor implementation.
+      */
+-    public JAXBContextImpl(Class[] classes, Collection<TypeReference> typeRefs, 
+-        Map<Class,Class> subclassReplacements, String defaultNsUri, boolean c14nSupport, 
+-        @Nullable RuntimeAnnotationReader ar, boolean xmlAccessorFactorySupport, boolean allNillable) throws JAXBException {
+-        // initialize datatype converter with ours
+-        DatatypeConverter.setDatatypeConverter(DatatypeConverterImpl.theInstance);
++    public JAXBContextImpl(JAXBContextBuilder builder) throws JAXBException {
+ 
+-        if(defaultNsUri==null)      defaultNsUri="";    // fool-proof
++        this.defaultNsUri = builder.defaultNsUri;
++        this.retainPropertyInfo = builder.retainPropertyInfo;
++        this.annotaitonReader = builder.annotationReader;
++        this.subclassReplacements = builder.subclassReplacements;
++        this.c14nSupport = builder.c14nSupport;
++        this.classes = builder.classes;
++        this.xmlAccessorFactorySupport = builder.xmlAccessorFactorySupport;
++        this.allNillable = builder.allNillable;
+ 
+-        if(ar==null)
+-            ar = new RuntimeInlineAnnotationReader();
++        Collection<TypeReference> typeRefs = builder.typeRefs;
+ 
+-        if(subclassReplacements==null)  subclassReplacements=Collections.emptyMap();
+-        if(typeRefs==null)              typeRefs=Collections.emptyList();
++        AccessController.doPrivileged(new PrivilegedAction<Void>() {
++            public Void run() {
++                DatatypeConverter.setDatatypeConverter(DatatypeConverterImpl.theInstance);
++                return null;
++            }
++        });
+ 
+-        this.annotaitonReader = ar;
+-        this.subclassReplacements = subclassReplacements;
+-
+-        boolean fastBoot;
++        boolean fastB;
+         try {
+-            fastBoot = Boolean.getBoolean(JAXBContextImpl.class.getName()+".fastBoot");
++            fastB = Boolean.getBoolean(JAXBContextImpl.class.getName()+".fastBoot");
+         } catch (SecurityException e) {
+-            fastBoot = false;
++            fastB = false;
+         }
+-        this.fastBoot = fastBoot;
++        this.fastBoot = fastB;
+ 
+-        this.defaultNsUri = defaultNsUri;
+-        this.c14nSupport = c14nSupport;
+-        this.xmlAccessorFactorySupport = xmlAccessorFactorySupport;
+-        this.allNillable = allNillable;
+-        this.classes = new Class[classes.length];
+         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
+         elements.put(null,new LinkedHashMap<QName, ElementBeanInfoImpl>());
+ 
+@@ -378,7 +379,6 @@
+             bridges.put(tr,bridge);
+         }
+ 
+-
+         this.nameList = nameBuilder.conclude();
+ 
+         for (JaxBeanInfo bi : beanInfos.values())
+@@ -396,10 +396,19 @@
+         return hasSwaRef;
+     }
+ 
++    public RuntimeTypeInfoSet getRuntimeTypeInfoSet() {
++        try {
++            return getTypeInfoSet();
++        } catch (IllegalAnnotationsException e) {
++            // impossible, once the model is constructred
++            throw new AssertionError(e);
++        }
++    }
++
+     /**
+      * Creates a {@link RuntimeTypeInfoSet}.
+      */
+-    private RuntimeTypeInfoSet getTypeInfoSet() throws IllegalAnnotationsException {
++    public RuntimeTypeInfoSet getTypeInfoSet() throws IllegalAnnotationsException {
+ 
+         // check cache
+         if(typeInfoSetCache!=null) {
+@@ -473,7 +482,7 @@
+     }
+ 
+     protected JaxBeanInfo getOrCreate( RuntimeArrayInfo ai ) {
+-        JaxBeanInfo abi = beanInfos.get(ai.getType());
++        JaxBeanInfo abi = beanInfos.get(ai);
+         if(abi!=null)   return abi;
+ 
+         abi = new ArrayBeanInfoImpl(this,ai);
+@@ -661,15 +670,15 @@
+     public int getNumberOfLocalNames() {
+         return nameList.localNames.length;
+     }
+-    
++
+     public int getNumberOfElementNames() {
+         return nameList.numberOfElementNames;
+     }
+-    
++
+     public int getNumberOfAttributeNames() {
+         return nameList.numberOfAttributeNames;
+     }
+-    
++
+     /**
+      * Creates a new identity transformer.
+      */
+@@ -725,8 +734,8 @@
+ 
+     public UnmarshallerImpl createUnmarshaller() {
+         return new UnmarshallerImpl(this,null);
+-    }    
+-        
++    }
++
+     public Validator createValidator() {
+         throw new UnsupportedOperationException(Messages.NOT_IMPLEMENTED_IN_2_0.format());
+     }
+@@ -879,6 +888,13 @@
+         return new QName(bi.getElementNamespaceURI(o),bi.getElementLocalName(o));
+     }
+ 
++    public QName getElementName(Class o) throws JAXBException {
++        JaxBeanInfo bi = getBeanInfo(o,true);
++        if(!bi.isElement())
++            return null;
++        return new QName(bi.getElementNamespaceURI(o),bi.getElementLocalName(o));
++    }
++
+     public Bridge createBridge(TypeReference ref) {
+         return bridges.get(ref);
+     }
+@@ -925,6 +941,7 @@
+         return pkg.getImplementationVersion();
+     }
+ 
++    @Override
+     public String toString() {
+         StringBuilder buf = new StringBuilder(Which.which(getClass()) + " Build-Id: " + getBuildId());
+         buf.append("\nClasses known to this context:\n");
+@@ -976,8 +993,9 @@
+         System.arraycopy(classes,0,newList,0,classes.length);
+         newList[classes.length] = clazz;
+ 
+-        return new JAXBContextImpl(newList,bridges.keySet(),subclassReplacements,
+-        defaultNsUri,c14nSupport,annotaitonReader, xmlAccessorFactorySupport, allNillable);
++        JAXBContextBuilder builder = new JAXBContextBuilder(this);
++        builder.setClasses(newList);
++        return builder.build();
+     }
+ 
+     private static final Comparator<QName> QNAME_COMPARATOR = new Comparator<QName>() {
+@@ -988,4 +1006,100 @@
+             return lhs.getNamespaceURI().compareTo(rhs.getNamespaceURI());
+         }
+     };
++
++    public static class JAXBContextBuilder {
++
++        private boolean retainPropertyInfo = false;
++        private String defaultNsUri = "";
++        private @NotNull RuntimeAnnotationReader annotationReader = new RuntimeInlineAnnotationReader();
++        private @NotNull Map<Class,Class> subclassReplacements = Collections.emptyMap();
++        private boolean c14nSupport = false;
++        private Class[] classes;
++        private Collection<TypeReference> typeRefs;
++        private boolean xmlAccessorFactorySupport = false;
++        private boolean allNillable;
++
++        public JAXBContextBuilder() {};
++
++        public JAXBContextBuilder(JAXBContextImpl baseImpl) {
++            this.retainPropertyInfo = baseImpl.retainPropertyInfo;
++            this.defaultNsUri = baseImpl.defaultNsUri;
++            this.annotationReader = baseImpl.annotaitonReader;
++            this.subclassReplacements = baseImpl.subclassReplacements;
++            this.c14nSupport = baseImpl.c14nSupport;
++            this.classes = baseImpl.classes;
++            this.typeRefs = baseImpl.bridges.keySet();
++            this.xmlAccessorFactorySupport = baseImpl.xmlAccessorFactorySupport;
++            this.allNillable = baseImpl.allNillable;
++        }
++
++        public JAXBContextBuilder setRetainPropertyInfo(boolean val) {
++            this.retainPropertyInfo = val;
++            return this;
++        }
++
++        public JAXBContextBuilder setC14NSupport(boolean val) {
++            this.c14nSupport = val;
++            return this;
++        }
++
++        public JAXBContextBuilder setXmlAccessorFactorySupport(boolean val) {
++            this.xmlAccessorFactorySupport = val;
++            return this;
++        }
++
++        public JAXBContextBuilder setDefaultNsUri(String val) {
++            this.defaultNsUri = val;
++            return this;
++        }
++
++        public JAXBContextBuilder setAllNillable(boolean val) {
++            this.allNillable = val;
++            return this;
++        }
++
++        public JAXBContextBuilder setClasses(Class[] val) {
++            this.classes = val;
++            return this;
++        }
++
++        public JAXBContextBuilder setAnnotationReader(RuntimeAnnotationReader val) {
++            this.annotationReader = val;
++            return this;
++        }
++
++        public JAXBContextBuilder setSubclassReplacements(Map<Class,Class> val) {
++            this.subclassReplacements = val;
++            return this;
++        }
++
++        public JAXBContextBuilder setTypeRefs(Collection<TypeReference> val) {
++            this.typeRefs = val;
++            return this;
++        }
++
++        public JAXBContextImpl build() throws JAXBException {
++
++            // fool-proof
++            if (this.defaultNsUri == null) {
++                this.defaultNsUri = "";
++            }
++
++            if (this.subclassReplacements == null) {
++                this.subclassReplacements = Collections.emptyMap();
++            }
++
++            if (this.annotationReader == null) {
++                this.annotationReader = new RuntimeInlineAnnotationReader();
++            }
++
++            if (this.typeRefs == null) {
++                this.typeRefs = Collections.<TypeReference>emptyList();
++            }
++
++            return new JAXBContextImpl(this);
++        }
++
++    }
++
+ }
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/JaxBeanInfo.java	Thu Jul 30 17:48:39 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/JaxBeanInfo.java	Thu Jul 30 17:48:38 2009
+@@ -52,16 +52,16 @@
+ /**
+  * Encapsulates various JAXB operations on objects bound by JAXB.
+  * Immutable and thread-safe.
+- * 
++ *
+  * <p>
+  * Each JAXB-bound class has a corresponding {@link JaxBeanInfo} object,
+  * which performs all the JAXB related operations on behalf of
+  * the JAXB-bound object.
+- * 
++ *
+  * <p>
+  * Given a class, the corresponding {@link JaxBeanInfo} can be located
+  * via {@link JAXBContextImpl#getBeanInfo(Class,boolean)}.
+- * 
++ *
+  * <p>
+  * Typically, {@link JaxBeanInfo} implementations should be generated
+  * by XJC/JXC. Those impl classes will register themselves to their
+@@ -154,7 +154,7 @@
+     /**
+      * Gets the JAXB bound class type that this {@link JaxBeanInfo}
+      * handles.
+-     * 
++     *
+      * <p>
+      * IOW, when a bean info object is requested for T,
+      * sometimes the bean info for one of its base classes might be
+@@ -164,7 +164,7 @@
+ 
+     /**
+      * Returns true if the bean is mapped to/from an XML element.
+-     * 
++     *
+      * <p>
+      * When this method returns true, {@link #getElementNamespaceURI(Object)}
+      * and {@link #getElementLocalName(Object)} returns the element name of
+@@ -200,7 +200,7 @@
+      * <p>
+      * Should be considered immutable, though I can't mark it final
+      * because it cannot be computed in this constructor.
+-     */ 
++     */
+     protected final void hasElementOnlyContentModel(boolean value) {
+         if(value)
+             flag |= FLAG_HAS_ELEMENT_ONLY_CONTENTMODEL;
+@@ -223,17 +223,17 @@
+      * Returns the namespace URI portion of the element name,
+      * if the bean that this class represents is mapped from/to
+      * an XML element.
+-     * 
++     *
+      * @throws UnsupportedOperationException
+      *      if {@link #isElement} is false.
+      */
+     public abstract String getElementNamespaceURI(BeanT o);
+-    
++
+     /**
+      * Returns the local name portion of the element name,
+      * if the bean that this class represents is mapped from/to
+      * an XML element.
+-     * 
++     *
+      * @throws UnsupportedOperationException
+      *      if {@link #isElement} is false.
+      */
+@@ -249,7 +249,7 @@
+     /**
+      * Returns XML Schema type names if the bean is mapped from
+      * a complex/simple type of XML Schema.
+-     * 
++     *
+      * <p>
+      * This is an ugly necessity to correctly handle
+      * the type substitution semantics of XML Schema.
+@@ -298,7 +298,7 @@
+     /**
+      * Resets the object to the initial state, as if the object
+      * is created fresh.
+-     * 
++     *
+      * <p>
+      * This is used to reuse an existing object for unmarshalling.
+      *
+@@ -317,18 +317,18 @@
+      *      as a result of reporting an error, the context may throw a {@link SAXException}.
+      */
+     public abstract boolean reset( BeanT o, UnmarshallingContext context ) throws SAXException;
+-    
++
+     /**
+      * Gets the ID value of the given bean, if it has an ID value.
+      * Otherwise return null.
+      */
+     public abstract String getId(BeanT o, XMLSerializer target) throws SAXException;
+-    
++
+     /**
+      * Serializes child elements and texts into the specified target.
+      */
+     public abstract void serializeBody( BeanT o, XMLSerializer target ) throws SAXException, IOException, XMLStreamException;
+-    
++
+     /**
+      * Serializes attributes into the specified target.
+      */
+@@ -361,7 +361,7 @@
+      * its top-level scope into the specified target.
+      */
+     public abstract void serializeURIs( BeanT o, XMLSerializer target ) throws SAXException;
+-    
++
+     /**
+      * Gets the {@link Loader} that will unmarshall the given object.
+      *
+@@ -414,33 +414,54 @@
+      */
+     protected final void setLifecycleFlags() {
+         try {
+-            for( Method m : jaxbType.getDeclaredMethods() ) {
+-                String name = m.getName();
+-                if(name.equals("beforeUnmarshal")) {
+-                    if(match(m,unmarshalEventParams)) {
+-                        cacheLifecycleMethod(m, FLAG_HAS_BEFORE_UNMARSHAL_METHOD);
++            Class<BeanT> jt = jaxbType;
++
++            if (lcm == null) {
++                lcm = new LifecycleMethods();
++            }
++
++            while (jt != null) {
++                for (Method m : jt.getDeclaredMethods()) {
++                    String name = m.getName();
++
++                    if (lcm.beforeUnmarshal == null) {
++                        if (name.equals("beforeUnmarshal")) {
++                            if (match(m, unmarshalEventParams)) {
++                                cacheLifecycleMethod(m, FLAG_HAS_BEFORE_UNMARSHAL_METHOD);
++                            }
++                        }
+                     }
+-                } else
+-                if(name.equals("afterUnmarshal")) {
+-                    if(match(m,unmarshalEventParams)) {
+-                        cacheLifecycleMethod(m, FLAG_HAS_AFTER_UNMARSHAL_METHOD);
++
++                    if (lcm.afterUnmarshal == null) {
++                        if (name.equals("afterUnmarshal")) {
++                            if (match(m, unmarshalEventParams)) {
++                                cacheLifecycleMethod(m, FLAG_HAS_AFTER_UNMARSHAL_METHOD);
++                            }
++                        }
+                     }
+-                } else
+-                if(name.equals("beforeMarshal")) {
+-                    if(match(m,marshalEventParams)) {
+-                        cacheLifecycleMethod(m, FLAG_HAS_BEFORE_MARSHAL_METHOD);
++
++                    if (lcm.beforeMarshal == null) {
++                        if (name.equals("beforeMarshal")) {
++                            if (match(m, marshalEventParams)) {
++                                cacheLifecycleMethod(m, FLAG_HAS_BEFORE_MARSHAL_METHOD);
++                            }
++                        }
+                     }
+-                } else
+-                if(name.equals("afterMarshal")) {
+-                    if(match(m,marshalEventParams)) {
+-                        cacheLifecycleMethod(m, FLAG_HAS_AFTER_MARSHAL_METHOD);
++
++                    if (lcm.afterMarshal == null) {
++                        if (name.equals("afterMarshal")) {
++                            if (match(m, marshalEventParams)) {
++                                cacheLifecycleMethod(m, FLAG_HAS_AFTER_MARSHAL_METHOD);
++                            }
++                        }
+                     }
+                 }
++                jt = (Class<BeanT>) jt.getSuperclass();
+             }
+-        } catch(SecurityException e) {
++        } catch (SecurityException e) {
+             // this happens when we don't have enough permission.
+-            logger.log( Level.WARNING, Messages.UNABLE_TO_DISCOVER_EVENTHANDLER.format(
+-                jaxbType.getName(), e ));
++            logger.log(Level.WARNING, Messages.UNABLE_TO_DISCOVER_EVENTHANDLER.format(
++                    jaxbType.getName(), e));
+         }
+     }
+ 
+@@ -512,9 +533,9 @@
+         try {
+             m.invoke(child,unm,parent);
+         } catch (IllegalAccessException e) {
+-            UnmarshallingContext.getInstance().handleError(e);
++            UnmarshallingContext.getInstance().handleError(e, false);
+         } catch (InvocationTargetException e) {
+-            UnmarshallingContext.getInstance().handleError(e);
++            UnmarshallingContext.getInstance().handleError(e, false);
+         }
+     }
+ 
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/LeafBeanInfoImpl.java	Thu Jul 30 17:48:43 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/LeafBeanInfoImpl.java	Thu Jul 30 17:48:42 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime;
+ 
+ import java.io.IOException;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/LifecycleMethods.java	Thu Jul 30 17:48:46 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/LifecycleMethods.java	Thu Jul 30 17:48:46 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime;
+ 
+ import java.lang.reflect.Method;
+@@ -32,10 +33,10 @@
+ /**
+  * This class is a simple container for caching lifecycle methods that are
+  * discovered during construction of (@link JAXBContext}.
+- * 
++ *
+  * @see JaxBeanInfo#lcm
+  * @see Loader#fireBeforeUnmarshal(JaxBeanInfo, Object, UnmarshallingContext.State)
+- * @see Loader#fireAfterUnmarshal(JaxBeanInfo, Object, UnmarshallingContext.State) 
++ * @see Loader#fireAfterUnmarshal(JaxBeanInfo, Object, UnmarshallingContext.State)
+  * @see XMLSerializer#fireMarshalEvent(Object, Method)
+  */
+ final class LifecycleMethods {
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/Location.java	Thu Jul 30 17:48:50 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/Location.java	Thu Jul 30 17:48:49 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime;
+ 
+ 
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/MarshallerImpl.java	Thu Jul 30 17:48:53 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/MarshallerImpl.java	Thu Jul 30 17:48:53 2009
+@@ -53,6 +53,7 @@
+ import javax.xml.transform.stream.StreamResult;
+ import javax.xml.validation.Schema;
+ import javax.xml.validation.ValidatorHandler;
++import javax.xml.namespace.NamespaceContext;
+ 
+ import com.sun.xml.internal.bind.DatatypeConverterImpl;
+ import com.sun.xml.internal.bind.api.JAXBRIContext;
+@@ -131,9 +132,6 @@
+      *      non-null if the marshaller is working inside {@link BinderImpl}.
+      */
+     public MarshallerImpl( JAXBContextImpl c, AssociationMap assoc ) {
+-        // initialize datatype converter with ours
+-        DatatypeConverter.setDatatypeConverter(DatatypeConverterImpl.theInstance);
+-
+         context = c;
+         serializer = new XMLSerializer(this);
+         c14nSupport = context.c14nSupport;
+@@ -149,6 +147,16 @@
+         return context;
+     }
+ 
++    /**
++     * Marshals to {@link OutputStream} with the given in-scope namespaces
++     * taken into account.
++     *
++     * @since 2.1.5
++     */
++    public void marshal(Object obj, OutputStream out, NamespaceContext inscopeNamespace) throws JAXBException {
++        write(obj, createWriter(out), new StAXPostInitAction(inscopeNamespace,serializer));
++    }
++
+     public void marshal(Object obj, XMLStreamWriter writer) throws JAXBException {
+         write(obj, XMLStreamWriterOutput.create(writer,context), new StAXPostInitAction(writer,serializer));
+     }
+@@ -252,7 +260,7 @@
+                     if(obj==null)
+                         serializer.writeXsiNilTrue();
+                     else
+-                        serializer.childAsXsiType(obj,"root",bi);
++                        serializer.childAsXsiType(obj,"root",bi, false);
+                 }
+                 serializer.endElement();
+                 postwrite();
+@@ -426,14 +434,18 @@
+ 
+         if(encoding.equals("UTF-8")) {
+             Encoded[] table = context.getUTF8NameTable();
++            final UTF8XmlOutput out;
+             if(isFormattedOutput())
+-                return new IndentingUTF8XmlOutput(os,indent,table);
++                out = new IndentingUTF8XmlOutput(os,indent,table);
+             else {
+                 if(c14nSupport)
+-                    return new C14nXmlOutput(os,table,context.c14nSupport);
++                    out = new C14nXmlOutput(os,table,context.c14nSupport);
+                 else
+-                    return new UTF8XmlOutput(os,table);
++                    out = new UTF8XmlOutput(os,table);
+             }
++            if(header!=null)
++                out.setHeader(header);
++            return out;
+         }
+ 
+         try {
+@@ -461,8 +473,8 @@
+             return header;
+         if( C14N.equals(name) )
+             return c14nSupport;
+-        if ( OBJECT_IDENTITY_CYCLE_DETECTION.equals(name)) 
+-        	return serializer.getObjectIdentityCycleDetection();
++        if ( OBJECT_IDENTITY_CYCLE_DETECTION.equals(name))
++                return serializer.getObjectIdentityCycleDetection();
+ ;
+ 
+         return super.getProperty(name);
+@@ -512,7 +524,7 @@
+             return;
+         }
+         if (OBJECT_IDENTITY_CYCLE_DETECTION.equals(name)) {
+-        	checkBoolean(name,value);
++                checkBoolean(name,value);
+             serializer.setObjectIdentityCycleDetection((Boolean)value);
+             return;
+         }
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/Messages.java	Thu Jul 30 17:48:57 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/Messages.java	Thu Jul 30 17:48:56 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime;
+ 
+ import java.text.MessageFormat;
+@@ -42,6 +43,7 @@
+     DANGLING_IDREF, // 1 arg
+     NULL_OUTPUT_RESOLVER, // 0 args
+     UNABLE_TO_MARSHAL_NON_ELEMENT, // 1 arg
++    UNABLE_TO_MARSHAL_UNBOUND_CLASS, // 1 arg
+     UNSUPPORTED_PROPERTY, // 1 arg
+     NULL_PROPERTY_NAME, // 0 args
+     MUST_BE_X, // 3 args
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/Messages.properties	Thu Jul 30 17:49:00 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/Messages.properties	Thu Jul 30 17:49:00 2009
+@@ -24,13 +24,13 @@
+ #
+ 
+ NOT_MARSHALLABLE = \
+-	the object parameter to marshal() is not marshallable
++        the object parameter to marshal() is not marshallable
+ 
+ UNSUPPORTED_RESULT = \
+-	unsupported javax.xml.parser.transform.Result parameter
++        unsupported javax.xml.parser.transform.Result parameter
+ 
+ UNSUPPORTED_ENCODING = \
+-	unsupported encoding: {0}
++        unsupported encoding: {0}
+ 
+ ILLEGAL_PARAMETER = \
+     Illegal "{0}" parameter: {1}
+@@ -48,17 +48,17 @@
+     The tag name "{0}" is not known to this JAXBContext.
+ 
+ TYPE_MISMATCH = \
+-	"{1}" property of a "{0}" object contains an object of type "{2}" but this is not allowed. \
+-	See javadoc of this property for what this property can accept.
++        "{1}" property of a "{0}" object contains an object of type "{2}" but this is not allowed. \
++        See javadoc of this property for what this property can accept.
+ 
+ MISSING_OBJECT = \
+-	a required field "{0}" is missing an object
++        a required field "{0}" is missing an object
+ 
+ NOT_IDENTIFIABLE = \
+-	An object is referenced as IDREF but its ID field is null
++        An object is referenced as IDREF but its ID field is null
+ 
+ DANGLING_IDREF = \
+-	A tree contains a reference to ID "{0}" but it's not a part of the object graph
++        A tree contains a reference to ID "{0}" but it's not a part of the object graph
+ 
+ NULL_OUTPUT_RESOLVER = \
+     schema output resolver must not be null
+@@ -66,6 +66,9 @@
+ UNABLE_TO_MARSHAL_NON_ELEMENT = \
+     unable to marshal type "{0}" as an element because it is missing an @XmlRootElement annotation
+ 
++UNABLE_TO_MARSHAL_UNBOUND_CLASS = \
++    unable to marshal type "{0}" as an element because it is not known to this context.
++
+ UNSUPPORTED_PROPERTY = \
+     "{0}" is not a supported property
+ 
+@@ -74,7 +77,7 @@
+ 
+ MUST_BE_X = \
+     property "{0}" must be an instance of type {1}, not {2}
+-    
++
+ SUBSTITUTED_BY_ANONYMOUS_TYPE = \
+     Instance of "{1}" is substituting "{0}", but "{2}" is bound to an anonymous type.
+ 
+@@ -92,4 +95,3 @@
+ 
+ FAILED_TO_GENERATE_SCHEMA = \
+     Failed to generate schema.
+- 
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/MimeTypedTransducer.java	Thu Jul 30 17:49:04 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/MimeTypedTransducer.java	Thu Jul 30 17:49:03 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime;
+ 
+ import java.awt.*;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/Name.java	Thu Jul 30 17:49:07 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/Name.java	Thu Jul 30 17:49:07 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime;
+ 
+ import javax.xml.namespace.QName;
+@@ -59,12 +60,12 @@
+      * Index of the Name for an EII or AII
+      */
+     public final short qNameIndex;
+-            
++
+     /**
+      * Specifies if the Name is associated with an EII or AII
+      */
+     public final boolean isAttribute;
+-    
++
+     Name(int qNameIndex, int nsUriIndex, String nsUri, int localIndex, String localName, boolean isAttribute) {
+         this.qNameIndex = (short)qNameIndex;
+         this.nsUri = nsUri;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/NameBuilder.java	Thu Jul 30 17:49:11 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/NameBuilder.java	Thu Jul 30 17:49:10 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime;
+ 
+ import java.util.HashMap;
+@@ -81,19 +82,19 @@
+         }
+     }
+ 
+-    private Name createName(String nsUri, String localName, boolean isAttribute, QNameMap<Integer> map) {        
++    private Name createName(String nsUri, String localName, boolean isAttribute, QNameMap<Integer> map) {
+         assert nsUri.intern()==nsUri;
+         assert localName.intern()==localName;
+-                
++
+         return new Name(
+                 allocIndex(map,nsUri,localName),
+                 allocIndex(uriIndexMap,nsUri),
+                 nsUri,
+                 allocIndex(localNameIndexMap,localName),
+-                localName, 
++                localName,
+                 isAttribute );
+     }
+-    
++
+     private int allocIndex(Map<String,Integer> map, String str) {
+         Integer i = map.get(str);
+         if(i==null) {
+@@ -111,7 +112,7 @@
+         }
+         return i;
+     }
+-    
++
+     /**
+      * Wraps up everything and creates {@link NameList}.
+      */
+@@ -124,7 +125,7 @@
+         NameList r = new NameList(
+                 list(uriIndexMap),
+                 nsUriCannotBeDefaulted,
+-                list(localNameIndexMap), 
++                list(localNameIndexMap),
+                 elementQNameIndexMap.size(),
+                 attributeQNameIndexMap.size() );
+         // delete them so that the create method can never be called again
+@@ -138,5 +139,5 @@
+         for (Map.Entry<String, Integer> e : map.entrySet())
+             r[e.getValue()] = e.getKey();
+         return r;
+-    }    
++    }
+ }
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/NameList.java	Thu Jul 30 17:49:14 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/NameList.java	Thu Jul 30 17:49:14 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime;
+ 
+ /**
+@@ -49,7 +50,7 @@
+     /**
+      * Local names by their indices. No nulls in this array.
+      * Read-only.
+-     */ 
++     */
+     public final String[] localNames;
+ 
+     /**
+@@ -56,12 +57,12 @@
+      * Number of Names for elements
+      */
+     public final int numberOfElementNames;
+-    
++
+     /**
+      * Number of Names for attributes
+      */
+     public final int numberOfAttributeNames;
+-    
++
+     public NameList(String[] namespaceURIs, boolean[] nsUriCannotBeDefaulted, String[] localNames, int numberElementNames, int numberAttributeNames) {
+         this.namespaceURIs = namespaceURIs;
+         this.nsUriCannotBeDefaulted = nsUriCannotBeDefaulted;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/NamespaceContext2.java	Thu Jul 30 17:49:18 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/NamespaceContext2.java	Thu Jul 30 17:49:17 2009
+@@ -31,13 +31,13 @@
+ 
+ /**
+  * Maintains namespace&lt;->prefix bindings.
+- * 
++ *
+  * <p>
+  * This interface extends {@link NamespaceContext} and provides
+  * an additional functionality, which is necessary to declare
+  * namespaced attributes on elements. The added method is for
+  * self-consumption by the marshaller.
+- * 
++ *
+  * This object is composed into a Serializer.
+  */
+ public interface NamespaceContext2 extends NamespaceContext
+@@ -44,15 +44,15 @@
+ {
+     /**
+      * Declares a new namespace binding within the current context.
+-     * 
++     *
+      * <p>
+      * The prefix is automatically assigned by MarshallingContext. If
+      * a given namespace URI is already declared, nothing happens.
+-     * 
++     *
+      * <p>
+      * It is <b>NOT</b> an error to declare the same namespace URI
+      * more than once.
+-     * 
++     *
+      * <p>
+      * For marshalling to work correctly, all namespace bindings
+      * for an element must be declared between its startElement method and
+@@ -59,7 +59,7 @@
+      * its endAttributes event. Calling the same method with the same
+      * parameter between the endAttributes and the endElement returns
+      * the same prefix.
+-     * 
++     *
+      * @param   requirePrefix
+      *      If this parameter is true, this method must assign a prefix
+      *      to this namespace, even if it's already bound to the default
+@@ -70,7 +70,7 @@
+      *      If the caller has any particular preference to the
+      *      prefix, pass that as a parameter. The callee will try
+      *      to honor it. Set null if there's no particular preference.
+-     * 
++     *
+      * @return
+      *      returns the assigned prefix. If the namespace is bound to
+      *      the default namespace, null is returned.
+@@ -82,7 +82,7 @@
+      *
+      * If the (prefix,uri) binding is already in-scope, this method
+      * simply returns the assigned prefix index. Otherwise a new
+-     * declaration will be put. 
++     * declaration will be put.
+      */
+     int force(@NotNull String uri, @NotNull String prefix);
+ }
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/RuntimeUtil.java	Thu Jul 30 17:49:21 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/RuntimeUtil.java	Thu Jul 30 17:49:21 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime;
+ 
+ import java.util.Collections;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/SchemaTypeTransducer.java	Thu Jul 30 17:49:25 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/SchemaTypeTransducer.java	Thu Jul 30 17:49:24 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime;
+ 
+ import java.io.IOException;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/StAXPostInitAction.java	Thu Jul 30 17:49:28 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/StAXPostInitAction.java	Thu Jul 30 17:49:28 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime;
+ 
+ import javax.xml.namespace.NamespaceContext;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/SwaRefAdapter.java	Thu Jul 30 17:49:32 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/SwaRefAdapter.java	Thu Jul 30 17:49:31 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime;
+ 
+ 
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/Transducer.java	Thu Jul 30 17:49:36 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/Transducer.java	Thu Jul 30 17:49:35 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime;
+ 
+ import java.io.IOException;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/ValueListBeanInfoImpl.java	Thu Jul 30 17:49:39 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/ValueListBeanInfoImpl.java	Thu Jul 30 17:49:39 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime;
+ 
+ import java.io.IOException;
+@@ -43,7 +44,7 @@
+ 
+ /**
+  * {@link JaxBeanInfo} implementation that binds T[] to a list of simple types.
+- * 
++ *
+  * @author Kohsuke Kawaguchi
+  */
+ final class ValueListBeanInfoImpl extends JaxBeanInfo {
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/XMLSerializer.java	Thu Jul 30 17:49:43 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/XMLSerializer.java	Thu Jul 30 17:49:42 2009
+@@ -52,6 +52,7 @@
+ import javax.xml.transform.sax.SAXResult;
+ 
+ import com.sun.istack.internal.SAXException2;
++import com.sun.xml.internal.bind.CycleRecoverable;
+ import com.sun.xml.internal.bind.api.AccessorException;
+ import com.sun.xml.internal.bind.marshaller.NamespacePrefixMapper;
+ import com.sun.xml.internal.bind.util.ValidationEventLocatorExImpl;
+@@ -61,49 +62,49 @@
+ import com.sun.xml.internal.bind.v2.runtime.output.NamespaceContextImpl;
+ import com.sun.xml.internal.bind.v2.runtime.output.Pcdata;
+ import com.sun.xml.internal.bind.v2.runtime.output.XmlOutput;
++import com.sun.xml.internal.bind.v2.runtime.property.Property;
+ import com.sun.xml.internal.bind.v2.runtime.unmarshaller.Base64Data;
+ import com.sun.xml.internal.bind.v2.runtime.unmarshaller.IntData;
+ import com.sun.xml.internal.bind.v2.util.CollisionCheckStack;
+-import com.sun.xml.internal.bind.CycleRecoverable;
+ 
+ import org.xml.sax.SAXException;
+ 
+ /**
+  * Receives XML serialization event and writes to {@link XmlOutput}.
+- * 
++ *
+  * <p>
+  * This object coordinates the overall marshalling efforts across different
+  * content-tree objects and different target formats.
+- * 
++ *
+  * <p>
+  * The following CFG gives the proper sequence of method invocation.
+- * 
++ *
+  * <pre>
+  * MARSHALLING  :=  ELEMENT
+  * ELEMENT      :=  "startElement" NSDECL* "endNamespaceDecls"
+  *                        ATTRIBUTE* "endAttributes" BODY "endElement"
+- * 
++ *
+  * NSDECL       :=  "declareNamespace"
+- * 
++ *
+  * ATTRIBUTE    :=  "attribute"
+  * ATTVALUES    :=  "text"*
+- * 
+- * 
++ *
++ *
+  * BODY         :=  ( "text" | ELEMENT )*
+  * </pre>
+- * 
++ *
+  * <p>
+  * A marshalling of one element consists of two stages. The first stage is
+  * for marshalling attributes and collecting namespace declarations.
+  * The second stage is for marshalling characters/child elements of that element.
+- * 
++ *
+  * <p>
+  * Observe that multiple invocation of "text" is allowed.
+- * 
++ *
+  * <p>
+  * Also observe that the namespace declarations are allowed only between
+  * "startElement" and "endAttributes".
+- * 
++ *
+  * <h2>Exceptions in marshaller</h2>
+  * <p>
+  * {@link IOException}, {@link SAXException}, and {@link XMLStreamException}
+@@ -131,6 +132,9 @@
+ 
+     private NamespaceContextImpl.Element nse;
+ 
++    // Introduced based on Jersey requirements - to be able to retrieve marshalled name
++    ThreadLocal<Property> currentProperty = new ThreadLocal<Property>();
++
+     /**
+      * Set to true if a text is already written,
+      * and we need to print ' ' for additional text methods.
+@@ -181,7 +185,6 @@
+ 
+     public AttachmentMarshaller attachmentMarshaller;
+ 
+-
+     /*package*/ XMLSerializer( MarshallerImpl _owner ) {
+         this.marshaller = _owner;
+         this.grammar = marshaller.context;
+@@ -192,11 +195,13 @@
+ 
+     /**
+      * Gets the cached instance of {@link Base64Data}.
++     *
++     * @deprecated
++     *      {@link Base64Data} is no longer cached, so that
++     *      XMLStreamWriterEx impl can retain the data, like JAX-WS does.
+      */
+     public Base64Data getCachedBase64DataInstance() {
+-        if(base64Data==null)
+-            base64Data = new Base64Data();
+-        return base64Data;
++        return new Base64Data();
+     }
+ 
+     /**
+@@ -288,7 +293,7 @@
+ 
+         out.endStartTag();
+     }
+-    
++
+     /**
+      * Ends marshalling of an element.
+      * Pops the internal stack.
+@@ -432,13 +437,13 @@
+     public NamespaceContext2 getNamespaceContext() {
+         return nsContext;
+     }
+-    
+-    
++
++
+     public String onID( Object owner, String value ) {
+         objectsWithId.add(owner);
+         return value;
+     }
+-    
++
+     public String onIDREF( Object obj ) throws SAXException {
+         String id;
+         try {
+@@ -456,8 +461,8 @@
+         }
+         return id;
+     }
+-    
+-    
++
++
+     // TODO: think about the exception handling.
+     // I suppose we don't want to use SAXException. -kk
+ 
+@@ -607,7 +612,7 @@
+      *      Used as a part of the error message in case anything goes wrong
+      *      with 'o'.
+      */
+-    public final void childAsXsiType( Object child, String fieldName, JaxBeanInfo expected ) throws SAXException, IOException, XMLStreamException {
++    public final void childAsXsiType( Object child, String fieldName, JaxBeanInfo expected, boolean nillable) throws SAXException, IOException, XMLStreamException {
+         if(child==null) {
+             handleMissingObjectError(fieldName);
+         } else {
+@@ -658,12 +663,26 @@
+                 }
+             }
+             actual.serializeURIs(child,this);
++
++            if (nillable) {
++                getNamespaceContext().declareNamespace(WellKnownNamespace.XML_SCHEMA_INSTANCE,"xsi",true);
++            }
++
+             endNamespaceDecls(child);
+             if(!asExpected) {
+                 attribute(WellKnownNamespace.XML_SCHEMA_INSTANCE,"type",
+                     DatatypeConverter.printQName(actualTypeName,getNamespaceContext()));
+             }
++
+             actual.serializeAttributes(child,this);
++            boolean nilDefined = false;
++            if (actual instanceof AttributeAccessor) {
++                nilDefined = ((AttributeAccessor)actual).isNilIncluded();
++            }
++            if ((nillable) && (!nilDefined)) {
++                attribute(WellKnownNamespace.XML_SCHEMA_INSTANCE,"nil","true");
++            }
++
+             endAttributes();
+             actual.serializeBody(child,this);
+ 
+@@ -1028,6 +1047,14 @@
+         return getCurrentLocation(null);
+     }
+ 
++    /**
++     * May return null when the property hasn't been set.
++     * Introduced based on Jersey requirements.
++     */
++    public Property getCurrentProperty() {
++        return currentProperty.get();
++    }
++
+     /**
+      * When called from within the realm of the marshaller, this method
+      * returns the current {@link XMLSerializer} in charge.
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/C14nXmlOutput.java	Thu Jul 30 17:49:47 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/C14nXmlOutput.java	Thu Jul 30 17:49:46 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.output;
+ 
+ import java.io.IOException;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/DOMOutput.java	Thu Jul 30 17:49:50 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/DOMOutput.java	Thu Jul 30 17:49:50 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.output;
+ 
+ import com.sun.xml.internal.bind.v2.runtime.AssociationMap;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/Encoded.java	Thu Jul 30 17:49:54 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/Encoded.java	Thu Jul 30 17:49:53 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.output;
+ 
+ import java.io.IOException;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/FastInfosetStreamWriterOutput.java	Thu Jul 30 17:49:57 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/FastInfosetStreamWriterOutput.java	Thu Jul 30 17:49:57 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.output;
+ 
+ import com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl;
+@@ -68,7 +69,7 @@
+     private final StAXDocumentSerializer fiout;
+     private final Encoded[] localNames;
+     private final TablesPerJAXBContext tables;
+-    
++
+     /**
+      * Holder for the optimzed element, attribute and
+      * local name tables.
+@@ -75,6 +76,8 @@
+      */
+     final static class TablesPerJAXBContext {
+         final int[] elementIndexes;
++        final int[] elementIndexPrefixes;
++
+         final int[] attributeIndexes;
+         final int[] localNameIndexes;
+ 
+@@ -82,17 +85,17 @@
+          * The offset of the index
+          */
+         int indexOffset;
+-        
++
+         /**
+          * The the maximum known value of an index
+          */
+         int maxIndex;
+-        
++
+         /**
+          * True if the tables require clearing
+          */
+         boolean requiresClear;
+-        
++
+         /**
+          * Create a new set of tables for a JAXB context.
+          * <p>
+@@ -103,9 +106,10 @@
+          */
+         TablesPerJAXBContext(JAXBContextImpl context, int initialIndexOffset) {
+             elementIndexes = new int[context.getNumberOfElementNames()];
++            elementIndexPrefixes = new int[context.getNumberOfElementNames()];
+             attributeIndexes = new int[context.getNumberOfAttributeNames()];
+             localNameIndexes = new int[context.getNumberOfLocalNames()];
+-            
++
+             indexOffset = 1;
+             maxIndex = initialIndexOffset + elementIndexes.length + attributeIndexes.length;
+         }
+@@ -116,7 +120,7 @@
+         public void requireClearTables() {
+             requiresClear = true;
+         }
+-        
++
+         /**
+          * Clear or reset the tables.
+          * <p>
+@@ -146,7 +150,7 @@
+                 }
+             }
+         }
+-        
++
+         private void clearAll() {
+             clear(elementIndexes);
+             clear(attributeIndexes);
+@@ -153,13 +157,13 @@
+             clear(localNameIndexes);
+             indexOffset = 1;
+         }
+-        
++
+         private void clear(int[] array) {
+             for (int i = 0; i < array.length; i++) {
+                 array[i] = 0;
+             }
+         }
+-        
++
+         /**
+          * Increment the maximum know index value
+          * <p>
+@@ -174,7 +178,7 @@
+                 resetAll();
+             }
+         }
+-                
++
+         private void resetAll() {
+             clear(elementIndexes);
+             clear(attributeIndexes);
+@@ -181,7 +185,7 @@
+             clear(localNameIndexes);
+             indexOffset = 1;
+         }
+-        
++
+         private void reset(int[] array) {
+             for (int i = 0; i < array.length; i++) {
+                 if (array[i] > indexOffset) {
+@@ -191,13 +195,13 @@
+                 }
+             }
+         }
+-        
++
+     }
+ 
+     /**
+      * Holder of JAXB contexts -> tables.
+      * <p>
+-     * An instance will be registered with the 
++     * An instance will be registered with the
+      * {@link LowLevelStAXDocumentSerializer}.
+      */
+     final static class AppData implements VocabularyApplicationData {
+@@ -213,14 +217,14 @@
+                 c.requireClearTables();
+         }
+     }
+-    
++
+     public FastInfosetStreamWriterOutput(StAXDocumentSerializer out,
+             JAXBContextImpl context) {
+         super(out);
+-        
++
+         this.fiout = out;
+         this.localNames = context.getUTF8NameTable();
+-        
++
+         final VocabularyApplicationData vocabAppData = fiout.getVocabularyApplicationData();
+         AppData appData = null;
+         if (vocabAppData == null || !(vocabAppData instanceof AppData)) {
+@@ -229,7 +233,7 @@
+         } else {
+             appData = (AppData)vocabAppData;
+         }
+-        
++
+         final TablesPerJAXBContext tablesPerContext = appData.contexts.get(context);
+         if (tablesPerContext != null) {
+             tables = tablesPerContext;
+@@ -243,44 +247,49 @@
+             appData.contexts.put(context, tables);
+         }
+     }
+-    
+-    public void startDocument(XMLSerializer serializer, boolean fragment, 
+-            int[] nsUriIndex2prefixIndex, NamespaceContextImpl nsContext) 
++
++    @Override
++    public void startDocument(XMLSerializer serializer, boolean fragment,
++            int[] nsUriIndex2prefixIndex, NamespaceContextImpl nsContext)
+             throws IOException, SAXException, XMLStreamException {
+         super.startDocument(serializer, fragment, nsUriIndex2prefixIndex, nsContext);
+-        
++
+         if (fragment)
+             fiout.initiateLowLevelWriting();
+     }
+-    
++
++    @Override
+     public void endDocument(boolean fragment) throws IOException, SAXException, XMLStreamException {
+         super.endDocument(fragment);
+     }
+-    
++
++    @Override
+     public void beginStartTag(Name name) throws IOException {
+         fiout.writeLowLevelTerminationAndMark();
+-        
++
+         if (nsContext.getCurrent().count() == 0) {
+             final int qNameIndex = tables.elementIndexes[name.qNameIndex] - tables.indexOffset;
+-            if (qNameIndex >= 0) {
++            final int prefixIndex = nsUriIndex2prefixIndex[name.nsUriIndex];
++
++            if (qNameIndex >= 0 &&
++                    tables.elementIndexPrefixes[name.qNameIndex] == prefixIndex) {
+                 fiout.writeLowLevelStartElementIndexed(EncodingConstants.ELEMENT, qNameIndex);
+             } else {
+                 tables.elementIndexes[name.qNameIndex] = fiout.getNextElementIndex() + tables.indexOffset;
+-                
+-                final int prefix = nsUriIndex2prefixIndex[name.nsUriIndex];
++                tables.elementIndexPrefixes[name.qNameIndex] = prefixIndex;
+                 writeLiteral(EncodingConstants.ELEMENT | EncodingConstants.ELEMENT_LITERAL_QNAME_FLAG,
+                         name,
+-                        nsContext.getPrefix(prefix),
+-                        nsContext.getNamespaceURI(prefix));
++                        nsContext.getPrefix(prefixIndex),
++                        nsContext.getNamespaceURI(prefixIndex));
+             }
+         } else {
+             beginStartTagWithNamespaces(name);
+         }
+     }
+-    
++
+     public void beginStartTagWithNamespaces(Name name) throws IOException {
+         final NamespaceContextImpl.Element nse = nsContext.getCurrent();
+-        
++
+         fiout.writeLowLevelStartNamespaces();
+         for (int i = nse.count() - 1; i >= 0; i--) {
+             final String uri = nse.getNsUri(i);
+@@ -289,30 +298,33 @@
+             fiout.writeLowLevelNamespace(nse.getPrefix(i), uri);
+         }
+         fiout.writeLowLevelEndNamespaces();
+-        
++
+         final int qNameIndex = tables.elementIndexes[name.qNameIndex] - tables.indexOffset;
+-        if (qNameIndex >= 0) {
++        final int prefixIndex = nsUriIndex2prefixIndex[name.nsUriIndex];
++
++        if (qNameIndex >= 0 &&
++                tables.elementIndexPrefixes[name.qNameIndex] == prefixIndex) {
+             fiout.writeLowLevelStartElementIndexed(0, qNameIndex);
+         } else {
+             tables.elementIndexes[name.qNameIndex] = fiout.getNextElementIndex() + tables.indexOffset;
+-            
+-            final int prefix = nsUriIndex2prefixIndex[name.nsUriIndex];
++            tables.elementIndexPrefixes[name.qNameIndex] = prefixIndex;
+             writeLiteral(EncodingConstants.ELEMENT_LITERAL_QNAME_FLAG,
+                     name,
+-                    nsContext.getPrefix(prefix),
+-                    nsContext.getNamespaceURI(prefix));
++                    nsContext.getPrefix(prefixIndex),
++                    nsContext.getNamespaceURI(prefixIndex));
+         }
+     }
+-    
++
++    @Override
+     public void attribute(Name name, String value) throws IOException {
+         fiout.writeLowLevelStartAttributes();
+-        
++
+         final int qNameIndex = tables.attributeIndexes[name.qNameIndex] - tables.indexOffset;
+         if (qNameIndex >= 0) {
+             fiout.writeLowLevelAttributeIndexed(qNameIndex);
+         } else {
+             tables.attributeIndexes[name.qNameIndex] = fiout.getNextAttributeIndex() + tables.indexOffset;
+-            
++
+             final int namespaceURIId = name.nsUriIndex;
+             if (namespaceURIId == -1) {
+                 writeLiteral(EncodingConstants.ATTRIBUTE_LITERAL_QNAME_FLAG,
+@@ -327,16 +339,16 @@
+                         nsContext.getNamespaceURI(prefix));
+             }
+         }
+-        
++
+         fiout.writeLowLevelAttributeValue(value);
+     }
+-    
++
+     private void writeLiteral(int type, Name name, String prefix, String namespaceURI) throws IOException {
+         final int localNameIndex = tables.localNameIndexes[name.localNameIndex] - tables.indexOffset;
+-        
++
+         if (localNameIndex < 0) {
+             tables.localNameIndexes[name.localNameIndex] = fiout.getNextLocalNameIndex() + tables.indexOffset;
+-            
++
+             fiout.writeLowLevelStartNameLiteral(
+                     type,
+                     prefix,
+@@ -350,24 +362,28 @@
+                     namespaceURI);
+         }
+     }
+-    
++
++    @Override
+     public void endStartTag() throws IOException {
+         fiout.writeLowLevelEndStartElement();
+     }
+-    
++
++    @Override
+     public void endTag(Name name) throws IOException {
+         fiout.writeLowLevelEndElement();
+     }
+-    
++
++    @Override
+     public void endTag(int prefix, String localName) throws IOException {
+         fiout.writeLowLevelEndElement();
+     }
+-    
+-    
++
++
++    @Override
+     public void text(Pcdata value, boolean needsSeparatingWhitespace) throws IOException {
+         if (needsSeparatingWhitespace)
+             fiout.writeLowLevelText(" ");
+-        
++
+         /*
+          * Check if the CharSequence is from a base64Binary data type
+          */
+@@ -385,23 +401,25 @@
+             fiout.writeLowLevelOctets(dataValue.get(), dataValue.getDataLen());
+         }
+     }
+-    
+-    
++
++
++    @Override
+     public void text(String value, boolean needsSeparatingWhitespace) throws IOException {
+         if (needsSeparatingWhitespace)
+             fiout.writeLowLevelText(" ");
+-        
++
+         fiout.writeLowLevelText(value);
+     }
+-    
+-    
++
++
++    @Override
+     public void beginStartTag(int prefix, String localName) throws IOException {
+         fiout.writeLowLevelTerminationAndMark();
+-        
++
+         int type = EncodingConstants.ELEMENT;
+         if (nsContext.getCurrent().count() > 0) {
+             final NamespaceContextImpl.Element nse = nsContext.getCurrent();
+-            
++
+             fiout.writeLowLevelStartNamespaces();
+             for (int i = nse.count() - 1; i >= 0; i--) {
+                 final String uri = nse.getNsUri(i);
+@@ -410,10 +428,10 @@
+                 fiout.writeLowLevelNamespace(nse.getPrefix(i), uri);
+             }
+             fiout.writeLowLevelEndNamespaces();
+-            
++
+             type= 0;
+         }
+-        
++
+         final boolean isIndexed = fiout.writeLowLevelStartElement(
+                 type,
+                 nsContext.getPrefix(prefix),
+@@ -423,11 +441,12 @@
+         if (!isIndexed)
+             tables.incrementMaxIndexValue();
+     }
+-    
++
++    @Override
+     public void attribute(int prefix, String localName, String value) throws IOException {
+         fiout.writeLowLevelStartAttributes();
+ 
+-        boolean isIndexed; 
++        boolean isIndexed;
+         if (prefix == -1)
+             isIndexed = fiout.writeLowLevelAttribute("", "", localName);
+         else
+@@ -435,10 +454,10 @@
+                     nsContext.getPrefix(prefix),
+                     nsContext.getNamespaceURI(prefix),
+                     localName);
+-        
++
+         if (!isIndexed)
+             tables.incrementMaxIndexValue();
+-        
++
+         fiout.writeLowLevelAttributeValue(value);
+     }
+ }
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/ForkXmlOutput.java	Thu Jul 30 17:50:01 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/ForkXmlOutput.java	Thu Jul 30 17:50:00 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.output;
+ 
+ import java.io.IOException;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/InPlaceDOMOutput.java	Thu Jul 30 17:50:05 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/InPlaceDOMOutput.java	Thu Jul 30 17:50:04 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.output;
+ 
+ import com.sun.xml.internal.bind.v2.runtime.AssociationMap;
+@@ -31,7 +32,7 @@
+ import org.xml.sax.SAXException;
+ 
+ /**
+- * 
++ *
+  * @author Kohsuke Kawaguchi
+  */
+ public final class InPlaceDOMOutput extends SAXOutput {
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/IndentingUTF8XmlOutput.java	Thu Jul 30 17:50:08 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/IndentingUTF8XmlOutput.java	Thu Jul 30 17:50:07 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.output;
+ 
+ import java.io.IOException;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/MTOMXmlOutput.java	Thu Jul 30 17:50:12 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/MTOMXmlOutput.java	Thu Jul 30 17:50:11 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.output;
+ 
+ import java.io.IOException;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/NamespaceContextImpl.java	Thu Jul 30 17:50:15 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/NamespaceContextImpl.java	Thu Jul 30 17:50:15 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.output;
+ 
+ import java.io.IOException;
+@@ -164,7 +165,7 @@
+                                 break;
+                             }
+                         }
+-
++                        current.setTagName(subst, current.elementLocalName, current.getOuterPeer());
+                         return i;
+                     } else {
+                         // first, if the previous URI assigned to "" is
+@@ -217,6 +218,7 @@
+ 
+     public int force(@NotNull String uri, @NotNull String prefix) {
+         // check for the existing binding
++
+         for( int i=size-1; i>=0; i-- ) {
+             if(prefixes[i].equals(prefix)) {
+                 if(nsUris[i].equals(uri))
+@@ -256,7 +258,7 @@
+             if(size==1)
+                 prefix = "";    // if this is the first user namespace URI we see, use "".
+             else {
+-                // otherwise make up an unique name 
++                // otherwise make up an unique name
+                 prefix = makeUniquePrefix();
+             }
+         }
+@@ -442,6 +444,8 @@
+             }
+             context.size = baseIndex;
+             context.current = prev;
++            // release references to user objects
++            outerPeer = innerPeer = null;
+             return prev;
+         }
+ 
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/Pcdata.java	Thu Jul 30 17:50:19 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/Pcdata.java	Thu Jul 30 17:50:18 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.output;
+ 
+ import java.io.IOException;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/SAXOutput.java	Thu Jul 30 17:50:22 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/SAXOutput.java	Thu Jul 30 17:50:22 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.output;
+ 
+ import java.io.IOException;
+@@ -84,7 +85,15 @@
+             qname = localName;
+         } else {
+             nsUri = nsContext.getNamespaceURI(prefix);
+-            qname = nsContext.getPrefix(prefix)+':'+localName;
++            String p = nsContext.getPrefix(prefix);
++            if(p.length()==0)
++                // this is more likely a bug in the application code (NamespacePrefixMapper implementation)
++                // this only happens when it tries to assign "" prefix to a non-"" URI,
++                // which is by itself violation of namespace rec. But let's just be safe.
++                // See http://forums.java.net/jive/thread.jspa?messageID=212598#212598
++                qname = localName;
++            else
++                qname = p +':'+localName;
+         }
+         atts.addAttribute( nsUri, localName, qname, "CDATA", value );
+     }
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/UTF8XmlOutput.java	Thu Jul 30 17:50:26 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/UTF8XmlOutput.java	Thu Jul 30 17:50:25 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.output;
+ 
+ import java.io.IOException;
+@@ -59,7 +60,7 @@
+     private final Encoded[] localNames;
+ 
+     /** Temporary buffer used to encode text. */
+-    /* 
++    /*
+      * TODO
+      * The textBuffer could write directly to the _octetBuffer
+      * when encoding a string if Encoder is modified.
+@@ -70,7 +71,7 @@
+     /** Buffer of octets for writing. */
+     // TODO: Obtain buffer size from property on the JAXB context
+     protected final byte[] octetBuffer = new byte[1024];
+-    
++
+     /** Index in buffer to write to. */
+     protected int octetBufferIndex;
+ 
+@@ -340,7 +341,7 @@
+ 
+             if(batchSize<dataLen)
+                 flushBuffer();
+-            
++
+             start += batchSize;
+             dataLen -= batchSize;
+ 
+@@ -373,7 +374,7 @@
+     protected final void write(byte[] b) throws IOException {
+         write(b, 0,  b.length);
+     }
+-    
++
+     protected final void write(byte[] b, int start, int length) throws IOException {
+         if ((octetBufferIndex + length) < octetBuffer.length) {
+             System.arraycopy(b, start, octetBuffer, octetBufferIndex, length);
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/XMLEventWriterOutput.java	Thu Jul 30 17:50:29 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/XMLEventWriterOutput.java	Thu Jul 30 17:50:29 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.output;
+ 
+ import java.io.IOException;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/XMLStreamWriterOutput.java	Thu Jul 30 17:50:33 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/XMLStreamWriterOutput.java	Thu Jul 30 17:50:32 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.output;
+ 
+ import java.io.IOException;
+@@ -42,9 +43,9 @@
+  * <p>
+  * TODO:
+  * Finding the optimized FI implementations is a bit hacky and not very
+- * extensible. Can we use the service provider mechnism in general for 
++ * extensible. Can we use the service provider mechnism in general for
+  * concrete implementations of XmlOutputAbstractImpl.
+- * 
++ *
+  * @author Kohsuke Kawaguchi
+  */
+ public class XMLStreamWriterOutput extends XmlOutputAbstractImpl {
+@@ -60,8 +61,8 @@
+             try {
+                 return FI_OUTPUT_CTOR.newInstance(out, context);
+             } catch (Exception e) {
+-            }  
+-        } 
++            }
++        }
+         if (STAXEX_WRITER_CLASS!=null && STAXEX_WRITER_CLASS.isAssignableFrom(writerClass)) {
+             try {
+                 return STAXEX_OUTPUT_CTOR.newInstance(out);
+@@ -160,8 +161,8 @@
+ 
+     private static Class initFIStAXWriterClass() {
+         try {
+-            Class llfisw = MarshallerImpl.class.getClassLoader().
+-                    loadClass("com.sun.xml.internal.org.jvnet.fastinfoset.stax.LowLevelFastInfosetStreamWriter");
++            Class llfisw = Class.forName(
++                    "com.sun.xml.internal.org.jvnet.fastinfoset.stax.LowLevelFastInfosetStreamWriter", true, MarshallerImpl.class.getClassLoader());
+             Class sds = MarshallerImpl.class.getClassLoader().
+                     loadClass("com.sun.xml.internal.fastinfoset.stax.StAXDocumentSerializer");
+             // Check if StAXDocumentSerializer implements LowLevelFastInfosetStreamWriter
+@@ -178,14 +179,16 @@
+         try {
+             if (FI_STAX_WRITER_CLASS == null)
+                 return null;
+-            
+-            Class c = UnmarshallerImpl.class.getClassLoader().loadClass("com.sun.xml.internal.bind.v2.runtime.output.FastInfosetStreamWriterOutput");
++
++            Class c = Class.forName(
++                    "com.sun.xml.internal.bind.v2.runtime.output.FastInfosetStreamWriterOutput", true,
++                    UnmarshallerImpl.class.getClassLoader());
+             return c.getConstructor(FI_STAX_WRITER_CLASS, JAXBContextImpl.class);
+         } catch (Throwable e) {
+             return null;
+         }
+     }
+-    
++
+     //
+     // StAX-ex
+     //
+@@ -194,7 +197,7 @@
+ 
+     private static Class initStAXExWriterClass() {
+         try {
+-            return MarshallerImpl.class.getClassLoader().loadClass("com.sun.xml.internal.org.jvnet.staxex.XMLStreamWriterEx");
++            return Class.forName("com.sun.xml.internal.org.jvnet.staxex.XMLStreamWriterEx",true,MarshallerImpl.class.getClassLoader());
+         } catch (Throwable e) {
+             return null;
+         }
+@@ -202,7 +205,7 @@
+ 
+     private static Constructor<? extends XmlOutput> initStAXExOutputClass() {
+         try {
+-            Class c = UnmarshallerImpl.class.getClassLoader().loadClass("com.sun.xml.internal.bind.v2.runtime.output.StAXExStreamWriterOutput");
++            Class c = Class.forName("com.sun.xml.internal.bind.v2.runtime.output.StAXExStreamWriterOutput",true, UnmarshallerImpl.class.getClassLoader());
+             return c.getConstructor(STAXEX_WRITER_CLASS);
+         } catch (Throwable e) {
+             return null;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/XmlOutput.java	Thu Jul 30 17:50:37 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/XmlOutput.java	Thu Jul 30 17:50:36 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.output;
+ 
+ import java.io.IOException;
+@@ -122,7 +123,7 @@
+      *      false if we are writing the whole document.
+      */
+     public void endDocument(boolean fragment) throws IOException, SAXException, XMLStreamException;
+-    
++
+     /**
+      * Writes a start tag.
+      *
+@@ -134,11 +135,11 @@
+      * This method is used for writing tags that are indexed.
+      */
+     public void beginStartTag(Name name) throws IOException, XMLStreamException;
+-    
++
+     public void beginStartTag(int prefix, String localName) throws IOException, XMLStreamException;
+ 
+     public void attribute( Name name, String value ) throws IOException, XMLStreamException;
+-    
++
+     /**
+      * @param prefix
+      *      -1 if this attribute does not have a prefix
+@@ -149,7 +150,7 @@
+     public void endStartTag() throws IOException, SAXException;
+ 
+     public void endTag(Name name) throws IOException, SAXException, XMLStreamException;
+-    
++
+     public void endTag(int prefix, String localName) throws IOException, SAXException, XMLStreamException;
+ 
+     /**
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/XmlOutputAbstractImpl.java	Thu Jul 30 17:50:40 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/XmlOutputAbstractImpl.java	Thu Jul 30 17:50:40 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.output;
+ 
+ import java.io.IOException;
+@@ -37,7 +38,7 @@
+ /**
+  * Abstract implementation of {@link XmlOutput}
+  *
+- * Implements the optimal methods, where defer to 
++ * Implements the optimal methods, where defer to
+  * the non-optimal methods.
+  *
+  * @author Kohsuke Kawaguchi
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/package-info.java	Thu Jul 30 17:50:44 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/package-info.java	Thu Jul 30 17:50:43 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ /**
+  * Code that writes well-formed XML ({@link XmlOutput} and its implementations}.
+  */
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/ArrayERProperty.java	Thu Jul 30 17:50:47 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/ArrayERProperty.java	Thu Jul 30 17:50:47 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.property;
+ 
+ import java.io.IOException;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/ArrayElementLeafProperty.java	Thu Jul 30 17:50:51 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/ArrayElementLeafProperty.java	Thu Jul 30 17:50:50 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.property;
+ 
+ import java.io.IOException;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/ArrayElementNodeProperty.java	Thu Jul 30 17:50:55 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/ArrayElementNodeProperty.java	Thu Jul 30 17:50:54 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.property;
+ 
+ import java.io.IOException;
+@@ -50,7 +51,7 @@
+         if(item==null) {
+             w.writeXsiNilTrue();
+         } else {
+-            w.childAsXsiType(item,fieldName,expected);
++            w.childAsXsiType(item,fieldName,expected, false);
+         }
+     }
+ }
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/ArrayElementProperty.java	Thu Jul 30 17:50:58 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/ArrayElementProperty.java	Thu Jul 30 17:50:58 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.property;
+ 
+ import java.io.IOException;
+@@ -150,7 +151,7 @@
+                         // for the purpose of simple type substitution, make it a non-error
+ 
+                         w.startElement(typeMap.values().iterator().next().tagName,null);
+-                        w.childAsXsiType(item,fieldName,w.grammar.getBeanInfo(Object.class));
++                        w.childAsXsiType(item,fieldName,w.grammar.getBeanInfo(Object.class), false);
+                     } else {
+                         w.startElement(tt.tagName,null);
+                         serializeItem(tt.beanInfo,item,w);
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/ArrayProperty.java	Thu Jul 30 17:51:02 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/ArrayProperty.java	Thu Jul 30 17:51:01 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.property;
+ 
+ 
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/ArrayReferenceNodeProperty.java	Thu Jul 30 17:51:05 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/ArrayReferenceNodeProperty.java	Thu Jul 30 17:51:05 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.property;
+ 
+ import java.io.IOException;
+@@ -122,7 +123,7 @@
+         if(isMixed) {
+             // handler for processing mixed contents.
+             loaders.put(TEXT_HANDLER,
+-                new ChildLoader(new MixedTextoader(recv),null));
++                new ChildLoader(new MixedTextLoader(recv),null));
+         }
+ 
+         if(domHandler!=null) {
+@@ -131,17 +132,18 @@
+         }
+     }
+ 
+-    private static final class MixedTextoader extends Loader {
++    private static final class MixedTextLoader extends Loader {
+ 
+         private final Receiver recv;
+ 
+-        public MixedTextoader(Receiver recv) {
++        public MixedTextLoader(Receiver recv) {
+             super(true);
+             this.recv = recv;
+         }
+ 
+         public void text(UnmarshallingContext.State state, CharSequence text) throws SAXException {
+-            recv.receive(state,text.toString());
++            if(text.length()!=0) // length 0 text is pointless
++                recv.receive(state,text.toString());
+         }
+     }
+ 
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/AttributeProperty.java	Thu Jul 30 17:51:09 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/AttributeProperty.java	Thu Jul 30 17:51:08 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.property;
+ 
+ import java.io.IOException;
+@@ -63,6 +64,11 @@
+     public final Name attName;
+ 
+     /**
++     * Required
++     */
++    public final boolean required;
++
++    /**
+      * Heart of the conversion logic.
+      */
+     public final TransducedAccessor<BeanT> xacc;
+@@ -72,6 +78,7 @@
+     public AttributeProperty(JAXBContextImpl context, RuntimeAttributePropertyInfo prop) {
+         super(context,prop);
+         this.attName = context.nameBuilder.createAttributeName(prop.getXmlName());
++        this.required = prop.isRequired();
+         this.xacc = TransducedAccessor.get(context,prop);
+         this.acc = prop.getAccessor();   // we only use this for binder, so don't waste memory by optimizing
+     }
+@@ -83,8 +90,10 @@
+      */
+     public void serializeAttributes(BeanT o, XMLSerializer w) throws SAXException, AccessorException, IOException, XMLStreamException {
+         CharSequence value = xacc.print(o);
+-        if(value!=null)
+-            w.attribute(attName,value.toString());
++        if(value != null)
++            w.attribute(attName, value.toString());
++        else if(required)
++           w.attribute(attName, "");
+     }
+ 
+     public void serializeURIs(BeanT o, XMLSerializer w) throws AccessorException, SAXException {
+@@ -99,7 +108,7 @@
+         throw new IllegalStateException();
+     }
+ 
+-   
++
+     public PropertyKind getKind() {
+         return PropertyKind.ATTRIBUTE;
+     }
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/ListElementProperty.java	Thu Jul 30 17:51:12 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/ListElementProperty.java	Thu Jul 30 17:51:12 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.property;
+ 
+ import java.io.IOException;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/Messages.java	Thu Jul 30 17:51:16 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/Messages.java	Thu Jul 30 17:51:15 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.property;
+ 
+ import java.text.MessageFormat;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/Messages.properties	Thu Jul 30 17:51:20 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/Messages.properties	Thu Jul 30 17:51:19 2009
+@@ -28,4 +28,3 @@
+ 
+ UNEXPECTED_JAVA_TYPE = \
+     Java class {0} is not allowed in this property. Expected types are: {1}
+- 
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/Property.java	Thu Jul 30 17:51:23 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/Property.java	Thu Jul 30 17:51:23 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.property;
+ 
+ import java.io.IOException;
+@@ -34,6 +35,7 @@
+ import com.sun.xml.internal.bind.v2.model.core.ID;
+ import com.sun.xml.internal.bind.v2.model.core.PropertyInfo;
+ import com.sun.xml.internal.bind.v2.model.core.PropertyKind;
++import com.sun.xml.internal.bind.v2.model.runtime.RuntimePropertyInfo;
+ import com.sun.xml.internal.bind.v2.runtime.JaxBeanInfo;
+ import com.sun.xml.internal.bind.v2.runtime.XMLSerializer;
+ import com.sun.xml.internal.bind.v2.runtime.reflect.Accessor;
+@@ -125,4 +127,14 @@
+      * to clean up any unnecessary references.
+      */
+     void wrapUp();
++
++
++
++    /**
++     * Provides more {@link RuntimePropertyInfo} information on the property.
++     *
++     * @return
++     *      null if RETAIN_REFERENCE_TO_INFO property is not set on the {@link JAXBContext}
++     */
++    public RuntimePropertyInfo getInfo();
+ }
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/PropertyFactory.java	Thu Jul 30 17:51:27 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/PropertyFactory.java	Thu Jul 30 17:51:26 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.property;
+ 
+ import java.lang.reflect.Constructor;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/PropertyImpl.java	Thu Jul 30 17:51:30 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/PropertyImpl.java	Thu Jul 30 17:51:30 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.property;
+ 
+ import java.io.IOException;
+@@ -44,11 +45,19 @@
+      * Name of this field.
+      */
+     protected final String fieldName;
++    private RuntimePropertyInfo propertyInfo = null;
+ 
+     public PropertyImpl(JAXBContextImpl context, RuntimePropertyInfo prop) {
+         fieldName = prop.getName();
++        if (context.retainPropertyInfo) {
++            propertyInfo = prop;
++        }
+     }
+ 
++    public RuntimePropertyInfo getInfo() {
++        return propertyInfo;
++    }
++
+     public void serializeBody(BeanT o, XMLSerializer w, Object outerPeer) throws SAXException, AccessorException, IOException, XMLStreamException {
+     }
+ 
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/SingleElementLeafProperty.java	Thu Jul 30 17:51:34 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/SingleElementLeafProperty.java	Thu Jul 30 17:51:33 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.property;
+ 
+ import java.io.IOException;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/SingleElementNodeProperty.java	Thu Jul 30 17:51:37 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/SingleElementNodeProperty.java	Thu Jul 30 17:51:37 2009
+@@ -22,9 +22,11 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.property;
+ 
+ import java.io.IOException;
++import java.lang.reflect.Modifier;
+ import java.lang.reflect.Type;
+ import java.util.HashMap;
+ import java.util.Map;
+@@ -33,7 +35,6 @@
+ import javax.xml.stream.XMLStreamException;
+ 
+ import com.sun.xml.internal.bind.api.AccessorException;
+-import com.sun.xml.internal.bind.v2.util.QNameMap;
+ import com.sun.xml.internal.bind.v2.model.core.PropertyKind;
+ import com.sun.xml.internal.bind.v2.model.core.TypeRef;
+ import com.sun.xml.internal.bind.v2.model.runtime.RuntimeElementPropertyInfo;
+@@ -43,12 +44,14 @@
+ import com.sun.xml.internal.bind.v2.runtime.JaxBeanInfo;
+ import com.sun.xml.internal.bind.v2.runtime.Name;
+ import com.sun.xml.internal.bind.v2.runtime.XMLSerializer;
+-import com.sun.xml.internal.bind.v2.runtime.unmarshaller.Loader;
++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.XsiNilLoader;
+ import com.sun.xml.internal.bind.v2.runtime.unmarshaller.DefaultValueLoaderDecorator;
+-import com.sun.xml.internal.bind.v2.runtime.reflect.Accessor;
++import com.sun.xml.internal.bind.v2.runtime.unmarshaller.Loader;
++import com.sun.xml.internal.bind.v2.runtime.unmarshaller.XsiNilLoader;
++import com.sun.xml.internal.bind.v2.util.QNameMap;
+ 
++import javax.xml.bind.JAXBElement;
+ import org.xml.sax.SAXException;
+ 
+ /**
+@@ -111,7 +114,7 @@
+ 
+     public void serializeBody(BeanT o, XMLSerializer w, Object outerPeer) throws SAXException, AccessorException, IOException, XMLStreamException {
+         ValueT v = acc.get(o);
+-        if(v!=null) {
++        if (v!=null) {
+             Class vtype = v.getClass();
+             TagAndType tt=typeNames.get(vtype); // quick way that usually works
+ 
+@@ -124,6 +127,7 @@
+                 }
+             }
+ 
++            boolean addNilDecl = (o instanceof JAXBElement) && ((JAXBElement)o).isNil();
+             if(tt==null) {
+                 // actually this is an error, because the actual type was not a sub-type
+                 // of any of the types specified in the annotations,
+@@ -131,14 +135,13 @@
+                 // it's convenient to marshal this anyway (for example so that classes
+                 // generated from simple types like String can be marshalled as expected.)
+                 w.startElement(typeNames.values().iterator().next().tagName,null);
+-                w.childAsXsiType(v,fieldName,w.grammar.getBeanInfo(Object.class));
++                w.childAsXsiType(v,fieldName,w.grammar.getBeanInfo(Object.class), addNilDecl && nillable);
+             } else {
+                 w.startElement(tt.tagName,null);
+-                w.childAsXsiType(v,fieldName,tt.beanInfo);
++                w.childAsXsiType(v,fieldName,tt.beanInfo, addNilDecl && nillable);
+             }
+             w.endElement();
+-        } else
+-        if(nillable) {
++        } else if (nillable) {
+             w.startElement(nullTagName,null);
+             w.writeXsiNilTrue();
+             w.endElement();
+@@ -150,7 +153,9 @@
+ 
+         for (TypeRef<Type,Class> e : prop.getTypes()) {
+             JaxBeanInfo bi = context.getOrCreate((RuntimeTypeInfo) e.getTarget());
+-            Loader l = bi.getLoader(context,true);
++            // if the expected Java type is already final, type substitution won't really work anyway.
++            // this also traps cases like trying to substitute xsd:long element with xsi:type='xsd:int'
++            Loader l = bi.getLoader(context,!Modifier.isFinal(bi.jaxbType.getModifiers()));
+             if(e.getDefaultValue()!=null)
+                 l = new DefaultValueLoaderDecorator(l,e.getDefaultValue());
+             if(nillable || chain.context.allNillable)
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/SingleMapNodeProperty.java	Thu Jul 30 17:51:41 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/SingleMapNodeProperty.java	Thu Jul 30 17:51:40 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.property;
+ 
+ import java.io.IOException;
+@@ -236,7 +237,7 @@
+                 Object key = e.getKey();
+                 if(key!=null) {
+                     w.startElement(keyTag,key);
+-                    w.childAsXsiType(key,fieldName,keyBeanInfo);
++                    w.childAsXsiType(key,fieldName,keyBeanInfo, false);
+                     w.endElement();
+                 }
+ 
+@@ -243,7 +244,7 @@
+                 Object value = e.getValue();
+                 if(value!=null) {
+                     w.startElement(valueTag,value);
+-                    w.childAsXsiType(value,fieldName,valueBeanInfo);
++                    w.childAsXsiType(value,fieldName,valueBeanInfo, false);
+                     w.endElement();
+                 }
+ 
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/SingleReferenceNodeProperty.java	Thu Jul 30 17:51:45 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/SingleReferenceNodeProperty.java	Thu Jul 30 17:51:44 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.property;
+ 
+ import java.io.IOException;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/StructureLoaderBuilder.java	Thu Jul 30 17:51:48 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/StructureLoaderBuilder.java	Thu Jul 30 17:51:47 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.property;
+ 
+ import javax.xml.namespace.QName;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/TagAndType.java	Thu Jul 30 17:51:52 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/TagAndType.java	Thu Jul 30 17:51:51 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.property;
+ 
+ import javax.xml.namespace.QName;
+@@ -31,7 +32,7 @@
+ 
+ /**
+  * Pair of {@link QName} and {@link JaxBeanInfo}.
+- * 
++ *
+  * @author Kohsuke Kawaguchi
+  */
+ class TagAndType {
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/UnmarshallerChain.java	Thu Jul 30 17:51:55 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/UnmarshallerChain.java	Thu Jul 30 17:51:54 2009
+@@ -23,9 +23,6 @@
+  * have any questions.
+  */
+ 
+-/*
+- * @(#)$Id:
+- */
+ package com.sun.xml.internal.bind.v2.runtime.property;
+ 
+ import com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl;
+@@ -41,8 +38,8 @@
+  * <p>
+  * A ticket dispenser also maintains the offset for handlers
+  * to access state slots. A handler records this value when it's created.
+- * 
+  *
++ *
+  */
+ public final class UnmarshallerChain {
+     /**
+@@ -70,4 +67,3 @@
+         return offset;
+     }
+ }
+-
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/ValueProperty.java	Thu Jul 30 17:51:59 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/property/ValueProperty.java	Thu Jul 30 17:51:58 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.property;
+ 
+ 
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/Accessor.java	Thu Jul 30 17:52:02 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/Accessor.java	Thu Jul 30 17:52:02 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.reflect;
+ 
+ import java.lang.reflect.Field;
+@@ -42,11 +43,13 @@
+ import com.sun.xml.internal.bind.api.JAXBRIContext;
+ import com.sun.xml.internal.bind.v2.model.core.Adapter;
+ import com.sun.xml.internal.bind.v2.model.nav.Navigator;
++import com.sun.xml.internal.bind.v2.model.impl.RuntimeModelBuilder;
+ import com.sun.xml.internal.bind.v2.runtime.reflect.opt.OptimizedAccessorFactory;
+ 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;
+ 
+@@ -84,10 +87,11 @@
+      *
+      * @param context
+      *      The {@link JAXBContextImpl} that owns the whole thing.
++     *      (See {@link RuntimeModelBuilder#context}.)
+      * @return
+      *      At least the implementation can return <tt>this</tt>.
+      */
+-    public Accessor<BeanT,ValueT> optimize(JAXBContextImpl context) {
++    public Accessor<BeanT,ValueT> optimize(@Nullable JAXBContextImpl context) {
+         return this;
+     }
+ 
+@@ -156,6 +160,9 @@
+             set((BeanT)state.target,(ValueT)o);
+         } catch (AccessorException e) {
+             Loader.handleGenericException(e,true);
++        } catch (IllegalAccessError iae) {
++            // throw UnmarshalException instead IllegalAccesssError | Issue 475
++            Loader.handleGenericError(iae);
+         }
+     }
+ 
+@@ -189,8 +196,6 @@
+ 
+         private static final Logger logger = Util.getClassLogger();
+ 
+-        // TODO: revisit. this is a security hole because this method can be used by anyone
+-        // to enable access to a field.
+         public FieldReflection(Field f) {
+             super((Class<ValueT>)f.getType());
+             this.f = f;
+@@ -198,6 +203,9 @@
+             int mod = f.getModifiers();
+             if(!Modifier.isPublic(mod) || Modifier.isFinal(mod) || !Modifier.isPublic(f.getDeclaringClass().getModifiers())) {
+                 try {
++                    // attempt to make it accessible, but do so in the security context of the calling application.
++                    // don't do this in the doPrivilege block, as that would create a security hole for anyone
++                    // to make any field accessible.
+                     f.setAccessible(true);
+                 } catch( SecurityException e ) {
+                     if(!accessWarned)
+@@ -231,7 +239,7 @@
+ 
+         @Override
+         public Accessor<BeanT,ValueT> optimize(JAXBContextImpl context) {
+-            if(context.fastBoot)
++            if(context!=null && context.fastBoot)
+                 // let's not waste time on doing this for the sake of faster boot.
+                 return this;
+             Accessor<BeanT,ValueT> acc = OptimizedAccessorFactory.get(f);
+@@ -343,7 +351,7 @@
+             if(getter==null || setter==null)
+                 // if we aren't complete, OptimizedAccessor won't always work
+                 return this;
+-            if(context.fastBoot)
++            if(context!=null && context.fastBoot)
+                 // let's not waste time on doing this for the sake of faster boot.
+                 return this;
+ 
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/AdaptedAccessor.java	Thu Jul 30 17:52:06 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/AdaptedAccessor.java	Thu Jul 30 17:52:05 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.reflect;
+ 
+ import javax.xml.bind.annotation.adapters.XmlAdapter;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/AdaptedLister.java	Thu Jul 30 17:52:09 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/AdaptedLister.java	Thu Jul 30 17:52:09 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.reflect;
+ 
+ import javax.xml.bind.annotation.adapters.XmlAdapter;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/DefaultTransducedAccessor.java	Thu Jul 30 17:52:13 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/DefaultTransducedAccessor.java	Thu Jul 30 17:52:12 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.reflect;
+ 
+ import java.io.IOException;
+@@ -41,7 +42,7 @@
+  * The print method that works for {@link String} determines the dispatching
+  * of the {@link #writeText(XMLSerializer,Object,String)} and
+  * {@link #writeLeafElement(XMLSerializer, Name, Object, String)} methods,
+- * so those are implemented here. 
++ * so those are implemented here.
+  *
+  * @author Kohsuke Kawaguchi
+  */
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/ListIterator.java	Thu Jul 30 17:52:17 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/ListIterator.java	Thu Jul 30 17:52:16 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.reflect;
+ 
+ import java.util.Iterator;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/ListTransducedAccessorImpl.java	Thu Jul 30 17:52:20 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/ListTransducedAccessorImpl.java	Thu Jul 30 17:52:19 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.reflect;
+ 
+ import javax.xml.bind.JAXBException;
+@@ -48,7 +49,7 @@
+      */
+     private final Lister<BeanT,ListT,ItemT,PackT> lister;
+     /**
+-     * {@link Accessor} to get/set the list. 
++     * {@link Accessor} to get/set the list.
+      */
+     private final Accessor<BeanT,ListT> acc;
+ 
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/Lister.java	Thu Jul 30 17:52:24 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/Lister.java	Thu Jul 30 17:52:23 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.reflect;
+ 
+ import java.lang.ref.WeakReference;
+@@ -36,6 +37,10 @@
+ import java.util.List;
+ import java.util.Map;
+ import java.util.WeakHashMap;
++import java.util.LinkedList;
++import java.util.HashSet;
++import java.util.TreeSet;
++import java.util.Stack;
+ import java.util.concurrent.Callable;
+ 
+ import javax.xml.bind.JAXBException;
+@@ -139,7 +144,7 @@
+     }
+ 
+     private static Class getImplClass(Class<?> fieldType) {
+-        return ClassFactory.inferImplClass(fieldType,ClassFactory.COLLECTION_IMPL_CLASSES);
++        return ClassFactory.inferImplClass(fieldType,COLLECTION_IMPL_CLASSES);
+     }
+ 
+     /**
+@@ -474,4 +479,11 @@
+         }
+     };
+ 
++    private static final Class[] COLLECTION_IMPL_CLASSES = new Class[] {
++        ArrayList.class,
++        LinkedList.class,
++        HashSet.class,
++        TreeSet.class,
++        Stack.class
++    };
+ }
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/Messages.java	Thu Jul 30 17:52:27 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/Messages.java	Thu Jul 30 17:52:27 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.reflect;
+ 
+ import java.text.MessageFormat;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/Messages.properties	Thu Jul 30 17:52:31 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/Messages.properties	Thu Jul 30 17:52:30 2009
+@@ -38,4 +38,3 @@
+ NO_GETTER = \
+     The property has a setter "{0}" but no getter. \
+     For marshaller, please define getters.
+- 
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/NullSafeAccessor.java	Thu Jul 30 17:52:35 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/NullSafeAccessor.java	Thu Jul 30 17:52:34 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.reflect;
+ 
+ import com.sun.xml.internal.bind.api.AccessorException;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/PrimitiveArrayListerBoolean.java	Thu Jul 30 17:52:38 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/PrimitiveArrayListerBoolean.java	Thu Jul 30 17:52:38 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.reflect;
+ 
+ import com.sun.xml.internal.bind.api.AccessorException;
+@@ -35,7 +36,7 @@
+  * lister classes. Do not modify the generated copies.
+  */
+ final class PrimitiveArrayListerBoolean<BeanT> extends Lister<BeanT,boolean[],Boolean,PrimitiveArrayListerBoolean.BooleanArrayPack> {
+-    
++
+     private PrimitiveArrayListerBoolean() {
+     }
+ 
+@@ -83,7 +84,8 @@
+                 System.arraycopy(buf,0,nb,0,buf.length);
+                 buf = nb;
+             }
+-            buf[size++] = b;
++            if(b!=null)
++                buf[size++] = b;
+         }
+ 
+         boolean[] build() {
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/PrimitiveArrayListerByte.java	Thu Jul 30 17:52:42 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/PrimitiveArrayListerByte.java	Thu Jul 30 17:52:41 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.reflect;
+ 
+ import com.sun.xml.internal.bind.api.AccessorException;
+@@ -35,7 +36,7 @@
+  * lister classes. Do not modify the generated copies.
+  */
+ final class PrimitiveArrayListerByte<BeanT> extends Lister<BeanT,byte[],Byte,PrimitiveArrayListerByte.ByteArrayPack> {
+-    
++
+     private PrimitiveArrayListerByte() {
+     }
+ 
+@@ -83,7 +84,8 @@
+                 System.arraycopy(buf,0,nb,0,buf.length);
+                 buf = nb;
+             }
+-            buf[size++] = b;
++            if(b!=null)
++                buf[size++] = b;
+         }
+ 
+         byte[] build() {
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/PrimitiveArrayListerCharacter.java	Thu Jul 30 17:52:46 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/PrimitiveArrayListerCharacter.java	Thu Jul 30 17:52:45 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.reflect;
+ 
+ import com.sun.xml.internal.bind.api.AccessorException;
+@@ -35,7 +36,7 @@
+  * lister classes. Do not modify the generated copies.
+  */
+ final class PrimitiveArrayListerCharacter<BeanT> extends Lister<BeanT,char[],Character,PrimitiveArrayListerCharacter.CharacterArrayPack> {
+-    
++
+     private PrimitiveArrayListerCharacter() {
+     }
+ 
+@@ -83,7 +84,8 @@
+                 System.arraycopy(buf,0,nb,0,buf.length);
+                 buf = nb;
+             }
+-            buf[size++] = b;
++            if(b!=null)
++                buf[size++] = b;
+         }
+ 
+         char[] build() {
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/PrimitiveArrayListerDouble.java	Thu Jul 30 17:52:49 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/PrimitiveArrayListerDouble.java	Thu Jul 30 17:52:49 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.reflect;
+ 
+ import com.sun.xml.internal.bind.api.AccessorException;
+@@ -35,7 +36,7 @@
+  * lister classes. Do not modify the generated copies.
+  */
+ final class PrimitiveArrayListerDouble<BeanT> extends Lister<BeanT,double[],Double,PrimitiveArrayListerDouble.DoubleArrayPack> {
+-    
++
+     private PrimitiveArrayListerDouble() {
+     }
+ 
+@@ -83,7 +84,8 @@
+                 System.arraycopy(buf,0,nb,0,buf.length);
+                 buf = nb;
+             }
+-            buf[size++] = b;
++            if(b!=null)
++                buf[size++] = b;
+         }
+ 
+         double[] build() {
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/PrimitiveArrayListerFloat.java	Thu Jul 30 17:52:53 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/PrimitiveArrayListerFloat.java	Thu Jul 30 17:52:52 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.reflect;
+ 
+ import com.sun.xml.internal.bind.api.AccessorException;
+@@ -35,7 +36,7 @@
+  * lister classes. Do not modify the generated copies.
+  */
+ final class PrimitiveArrayListerFloat<BeanT> extends Lister<BeanT,float[],Float,PrimitiveArrayListerFloat.FloatArrayPack> {
+-    
++
+     private PrimitiveArrayListerFloat() {
+     }
+ 
+@@ -83,7 +84,8 @@
+                 System.arraycopy(buf,0,nb,0,buf.length);
+                 buf = nb;
+             }
+-            buf[size++] = b;
++            if(b!=null)
++                buf[size++] = b;
+         }
+ 
+         float[] build() {
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/PrimitiveArrayListerInteger.java	Thu Jul 30 17:52:57 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/PrimitiveArrayListerInteger.java	Thu Jul 30 17:52:56 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.reflect;
+ 
+ import com.sun.xml.internal.bind.api.AccessorException;
+@@ -35,7 +36,7 @@
+  * lister classes. Do not modify the generated copies.
+  */
+ final class PrimitiveArrayListerInteger<BeanT> extends Lister<BeanT,int[],Integer,PrimitiveArrayListerInteger.IntegerArrayPack> {
+-    
++
+     private PrimitiveArrayListerInteger() {
+     }
+ 
+@@ -83,7 +84,8 @@
+                 System.arraycopy(buf,0,nb,0,buf.length);
+                 buf = nb;
+             }
+-            buf[size++] = b;
++            if(b!=null)
++                buf[size++] = b;
+         }
+ 
+         int[] build() {
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/PrimitiveArrayListerLong.java	Thu Jul 30 17:53:00 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/PrimitiveArrayListerLong.java	Thu Jul 30 17:52:59 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.reflect;
+ 
+ import com.sun.xml.internal.bind.api.AccessorException;
+@@ -35,7 +36,7 @@
+  * lister classes. Do not modify the generated copies.
+  */
+ final class PrimitiveArrayListerLong<BeanT> extends Lister<BeanT,long[],Long,PrimitiveArrayListerLong.LongArrayPack> {
+-    
++
+     private PrimitiveArrayListerLong() {
+     }
+ 
+@@ -83,7 +84,8 @@
+                 System.arraycopy(buf,0,nb,0,buf.length);
+                 buf = nb;
+             }
+-            buf[size++] = b;
++            if(b!=null)
++                buf[size++] = b;
+         }
+ 
+         long[] build() {
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/PrimitiveArrayListerShort.java	Thu Jul 30 17:53:04 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/PrimitiveArrayListerShort.java	Thu Jul 30 17:53:03 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.reflect;
+ 
+ import com.sun.xml.internal.bind.api.AccessorException;
+@@ -35,7 +36,7 @@
+  * lister classes. Do not modify the generated copies.
+  */
+ final class PrimitiveArrayListerShort<BeanT> extends Lister<BeanT,short[],Short,PrimitiveArrayListerShort.ShortArrayPack> {
+-    
++
+     private PrimitiveArrayListerShort() {
+     }
+ 
+@@ -83,7 +84,8 @@
+                 System.arraycopy(buf,0,nb,0,buf.length);
+                 buf = nb;
+             }
+-            buf[size++] = b;
++            if(b!=null)
++                buf[size++] = b;
+         }
+ 
+         short[] build() {
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/TransducedAccessor.java	Thu Jul 30 17:53:07 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/TransducedAccessor.java	Thu Jul 30 17:53:07 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.reflect;
+ 
+ import java.io.IOException;
+@@ -266,7 +267,7 @@
+         public String print(BeanT bean) throws AccessorException, SAXException {
+             TargetT target = acc.get(bean);
+             if(target==null)    return null;
+-            
++
+             XMLSerializer w = XMLSerializer.getInstance();
+             try {
+                 String id = w.grammar.getBeanInfo(target,true).getId(target,w);
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/AccessorInjector.java	Thu Jul 30 17:53:11 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/AccessorInjector.java	Thu Jul 30 17:53:10 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
+ 
+ import java.io.InputStream;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/Bean.java	Thu Jul 30 17:53:14 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/Bean.java	Thu Jul 30 17:53:14 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
+ 
+ import com.sun.xml.internal.bind.v2.runtime.reflect.TransducedAccessor;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/Const.java	Thu Jul 30 17:53:18 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/Const.java	Thu Jul 30 17:53:17 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
+ 
+ /**
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/FieldAccessor_Boolean.java	Thu Jul 30 17:53:22 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/FieldAccessor_Boolean.java	Thu Jul 30 17:53:21 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
+ 
+ import com.sun.xml.internal.bind.v2.runtime.reflect.Accessor;
+@@ -31,7 +32,7 @@
+  *
+  * <p>
+  * All the FieldAccessors are generated from <code>FieldAccessor_B y t e</code>
+- * 
++ *
+  * @author Kohsuke Kawaguchi
+  */
+ public class FieldAccessor_Boolean extends Accessor {
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/FieldAccessor_Byte.java	Thu Jul 30 17:53:25 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/FieldAccessor_Byte.java	Thu Jul 30 17:53:24 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
+ 
+ import com.sun.xml.internal.bind.v2.runtime.reflect.Accessor;
+@@ -31,7 +32,7 @@
+  *
+  * <p>
+  * All the FieldAccessors are generated from <code>FieldAccessor_B y t e</code>
+- * 
++ *
+  * @author Kohsuke Kawaguchi
+  */
+ public class FieldAccessor_Byte extends Accessor {
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/FieldAccessor_Character.java	Thu Jul 30 17:53:29 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/FieldAccessor_Character.java	Thu Jul 30 17:53:28 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
+ 
+ import com.sun.xml.internal.bind.v2.runtime.reflect.Accessor;
+@@ -31,7 +32,7 @@
+  *
+  * <p>
+  * All the FieldAccessors are generated from <code>FieldAccessor_B y t e</code>
+- * 
++ *
+  * @author Kohsuke Kawaguchi
+  */
+ public class FieldAccessor_Character extends Accessor {
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/FieldAccessor_Double.java	Thu Jul 30 17:53:32 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/FieldAccessor_Double.java	Thu Jul 30 17:53:32 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
+ 
+ import com.sun.xml.internal.bind.v2.runtime.reflect.Accessor;
+@@ -31,7 +32,7 @@
+  *
+  * <p>
+  * All the FieldAccessors are generated from <code>FieldAccessor_B y t e</code>
+- * 
++ *
+  * @author Kohsuke Kawaguchi
+  */
+ public class FieldAccessor_Double extends Accessor {
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/FieldAccessor_Float.java	Thu Jul 30 17:53:36 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/FieldAccessor_Float.java	Thu Jul 30 17:53:35 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
+ 
+ import com.sun.xml.internal.bind.v2.runtime.reflect.Accessor;
+@@ -31,7 +32,7 @@
+  *
+  * <p>
+  * All the FieldAccessors are generated from <code>FieldAccessor_B y t e</code>
+- * 
++ *
+  * @author Kohsuke Kawaguchi
+  */
+ public class FieldAccessor_Float extends Accessor {
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/FieldAccessor_Integer.java	Thu Jul 30 17:53:39 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/FieldAccessor_Integer.java	Thu Jul 30 17:53:39 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
+ 
+ import com.sun.xml.internal.bind.v2.runtime.reflect.Accessor;
+@@ -31,7 +32,7 @@
+  *
+  * <p>
+  * All the FieldAccessors are generated from <code>FieldAccessor_B y t e</code>
+- * 
++ *
+  * @author Kohsuke Kawaguchi
+  */
+ public class FieldAccessor_Integer extends Accessor {
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/FieldAccessor_Long.java	Thu Jul 30 17:53:43 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/FieldAccessor_Long.java	Thu Jul 30 17:53:42 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
+ 
+ import com.sun.xml.internal.bind.v2.runtime.reflect.Accessor;
+@@ -31,7 +32,7 @@
+  *
+  * <p>
+  * All the FieldAccessors are generated from <code>FieldAccessor_B y t e</code>
+- * 
++ *
+  * @author Kohsuke Kawaguchi
+  */
+ public class FieldAccessor_Long extends Accessor {
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/FieldAccessor_Ref.java	Thu Jul 30 17:53:46 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/FieldAccessor_Ref.java	Thu Jul 30 17:53:46 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
+ 
+ import com.sun.xml.internal.bind.v2.runtime.reflect.Accessor;
+@@ -28,7 +29,7 @@
+ 
+ /**
+  * Template {@link Accessor} for reference type fields.
+- * 
++ *
+  * @author Kohsuke Kawaguchi
+  */
+ public class FieldAccessor_Ref extends Accessor {
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/FieldAccessor_Short.java	Thu Jul 30 17:53:50 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/FieldAccessor_Short.java	Thu Jul 30 17:53:49 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
+ 
+ import com.sun.xml.internal.bind.v2.runtime.reflect.Accessor;
+@@ -31,7 +32,7 @@
+  *
+  * <p>
+  * All the FieldAccessors are generated from <code>FieldAccessor_B y t e</code>
+- * 
++ *
+  * @author Kohsuke Kawaguchi
+  */
+ public class FieldAccessor_Short extends Accessor {
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/Injector.java	Thu Jul 30 17:53:53 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/Injector.java	Thu Jul 30 17:53:53 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
+ 
+ import java.lang.reflect.InvocationTargetException;
+@@ -37,6 +38,7 @@
+ import java.util.logging.Logger;
+ 
+ import com.sun.xml.internal.bind.Util;
++import com.sun.xml.internal.bind.v2.runtime.reflect.Accessor;
+ 
+ /**
+  * A {@link ClassLoader} used to "inject" optimized accessor classes
+@@ -113,6 +115,12 @@
+ 
+     private final ClassLoader parent;
+ 
++    /**
++     * True if this injector is capable of injecting accessors.
++     * False otherwise, which happens if this classloader can't see {@link Accessor}.
++     */
++    private final boolean loadable;
++
+     private static final Method defineClass;
+     private static final Method resolveClass;
+ 
+@@ -138,10 +146,23 @@
+     private Injector(ClassLoader parent) {
+         this.parent = parent;
+         assert parent!=null;
++
++        boolean loadable = false;
++
++        try {
++            loadable = parent.loadClass(Accessor.class.getName())==Accessor.class;
++        } catch (ClassNotFoundException e) {
++            ; // not loadable
++        }
++
++        this.loadable = loadable;
+     }
+ 
+ 
+     private synchronized Class inject(String className, byte[] image) {
++        if(!loadable)   // this injector cannot inject anything
++            return null;
++
+         Class c = classes.get(className);
+         if(c==null) {
+             // we need to inject a class into the
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/MethodAccessor_Boolean.java	Thu Jul 30 17:53:57 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/MethodAccessor_Boolean.java	Thu Jul 30 17:53:56 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
+ 
+ import com.sun.xml.internal.bind.v2.runtime.reflect.Accessor;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/MethodAccessor_Byte.java	Thu Jul 30 17:54:01 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/MethodAccessor_Byte.java	Thu Jul 30 17:54:00 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
+ 
+ import com.sun.xml.internal.bind.v2.runtime.reflect.Accessor;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/MethodAccessor_Character.java	Thu Jul 30 17:54:04 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/MethodAccessor_Character.java	Thu Jul 30 17:54:04 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
+ 
+ import com.sun.xml.internal.bind.v2.runtime.reflect.Accessor;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/MethodAccessor_Double.java	Thu Jul 30 17:54:08 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/MethodAccessor_Double.java	Thu Jul 30 17:54:07 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
+ 
+ import com.sun.xml.internal.bind.v2.runtime.reflect.Accessor;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/MethodAccessor_Float.java	Thu Jul 30 17:54:11 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/MethodAccessor_Float.java	Thu Jul 30 17:54:11 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
+ 
+ import com.sun.xml.internal.bind.v2.runtime.reflect.Accessor;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/MethodAccessor_Integer.java	Thu Jul 30 17:54:15 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/MethodAccessor_Integer.java	Thu Jul 30 17:54:14 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
+ 
+ import com.sun.xml.internal.bind.v2.runtime.reflect.Accessor;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/MethodAccessor_Long.java	Thu Jul 30 17:54:18 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/MethodAccessor_Long.java	Thu Jul 30 17:54:18 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
+ 
+ import com.sun.xml.internal.bind.v2.runtime.reflect.Accessor;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/MethodAccessor_Ref.java	Thu Jul 30 17:54:22 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/MethodAccessor_Ref.java	Thu Jul 30 17:54:21 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
+ 
+ import com.sun.xml.internal.bind.v2.runtime.reflect.Accessor;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/MethodAccessor_Short.java	Thu Jul 30 17:54:25 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/MethodAccessor_Short.java	Thu Jul 30 17:54:25 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
+ 
+ import com.sun.xml.internal.bind.v2.runtime.reflect.Accessor;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/OptimizedAccessorFactory.java	Thu Jul 30 17:54:29 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/OptimizedAccessorFactory.java	Thu Jul 30 17:54:28 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
+ 
+ import java.lang.reflect.Field;
+@@ -32,6 +33,7 @@
+ 
+ import com.sun.xml.internal.bind.Util;
+ import com.sun.xml.internal.bind.v2.runtime.reflect.Accessor;
++import com.sun.xml.internal.bind.v2.runtime.RuntimeUtil;
+ 
+ import static com.sun.xml.internal.bind.v2.bytecode.ClassTailor.toVMClassName;
+ import static com.sun.xml.internal.bind.v2.bytecode.ClassTailor.toVMTypeName;
+@@ -89,7 +91,7 @@
+ 
+         if(t.isPrimitive())
+             opt = AccessorInjector.prepare( getter.getDeclaringClass(),
+-                methodTemplateName+t.getName(),
++                methodTemplateName+RuntimeUtil.primitiveToBox.get(t).getSimpleName(),
+                 newClassName,
+                 toVMClassName(Bean.class),
+                 toVMClassName(getter.getDeclaringClass()),
+@@ -142,7 +144,7 @@
+ 
+         if(field.getType().isPrimitive())
+             opt = AccessorInjector.prepare( field.getDeclaringClass(),
+-                fieldTemplateName+field.getType().getName(),
++                fieldTemplateName+RuntimeUtil.primitiveToBox.get(field.getType()).getSimpleName(),
+                 newClassName,
+                 toVMClassName(Bean.class),
+                 toVMClassName(field.getDeclaringClass()),
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/OptimizedTransducedAccessorFactory.java	Thu Jul 30 17:54:33 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/OptimizedTransducedAccessorFactory.java	Thu Jul 30 17:54:32 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
+ 
+ import java.lang.reflect.Field;
+@@ -80,7 +81,7 @@
+         TypeInfo<Type,Class> parent = prop.parent();
+         if(!(parent instanceof RuntimeClassInfo))
+             return null;
+-        
++
+         Class dc = ((RuntimeClassInfo)parent).getClazz();
+         String newClassName = toVMClassName(dc)+"_JaxbXducedAccessor_"+prop.getName();
+ 
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/Ref.java	Thu Jul 30 17:54:36 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/Ref.java	Thu Jul 30 17:54:36 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
+ 
+ import com.sun.xml.internal.bind.v2.runtime.reflect.TransducedAccessor;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_field_Boolean.java	Thu Jul 30 17:54:40 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_field_Boolean.java	Thu Jul 30 17:54:39 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
+ 
+ import com.sun.xml.internal.bind.DatatypeConverterImpl;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_field_Byte.java	Thu Jul 30 17:54:44 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_field_Byte.java	Thu Jul 30 17:54:43 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
+ 
+ import com.sun.xml.internal.bind.DatatypeConverterImpl;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_field_Double.java	Thu Jul 30 17:54:47 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_field_Double.java	Thu Jul 30 17:54:47 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
+ 
+ import com.sun.xml.internal.bind.DatatypeConverterImpl;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_field_Float.java	Thu Jul 30 17:54:51 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_field_Float.java	Thu Jul 30 17:54:50 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
+ 
+ import com.sun.xml.internal.bind.DatatypeConverterImpl;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_field_Integer.java	Thu Jul 30 17:54:55 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_field_Integer.java	Thu Jul 30 17:54:54 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
+ 
+ import java.io.IOException;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_field_Long.java	Thu Jul 30 17:54:58 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_field_Long.java	Thu Jul 30 17:54:58 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
+ 
+ import com.sun.xml.internal.bind.DatatypeConverterImpl;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_field_Short.java	Thu Jul 30 17:55:02 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_field_Short.java	Thu Jul 30 17:55:01 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
+ 
+ import com.sun.xml.internal.bind.DatatypeConverterImpl;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_method_Boolean.java	Thu Jul 30 17:55:05 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_method_Boolean.java	Thu Jul 30 17:55:05 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
+ 
+ import com.sun.xml.internal.bind.DatatypeConverterImpl;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_method_Byte.java	Thu Jul 30 17:55:09 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_method_Byte.java	Thu Jul 30 17:55:08 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
+ 
+ import com.sun.xml.internal.bind.DatatypeConverterImpl;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_method_Double.java	Thu Jul 30 17:55:12 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_method_Double.java	Thu Jul 30 17:55:12 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
+ 
+ import com.sun.xml.internal.bind.DatatypeConverterImpl;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_method_Float.java	Thu Jul 30 17:55:16 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_method_Float.java	Thu Jul 30 17:55:15 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
+ 
+ import com.sun.xml.internal.bind.DatatypeConverterImpl;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_method_Integer.java	Thu Jul 30 17:55:19 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_method_Integer.java	Thu Jul 30 17:55:19 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
+ 
+ import java.io.IOException;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_method_Long.java	Thu Jul 30 17:55:23 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_method_Long.java	Thu Jul 30 17:55:22 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
+ 
+ import com.sun.xml.internal.bind.DatatypeConverterImpl;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_method_Short.java	Thu Jul 30 17:55:27 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/TransducedAccessor_method_Short.java	Thu Jul 30 17:55:26 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.reflect.opt;
+ 
+ import com.sun.xml.internal.bind.DatatypeConverterImpl;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/AttributesEx.java	Thu Jul 30 17:55:30 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/AttributesEx.java	Thu Jul 30 17:55:29 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.unmarshaller;
+ 
+ import org.xml.sax.Attributes;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/AttributesExImpl.java	Thu Jul 30 17:55:34 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/AttributesExImpl.java	Thu Jul 30 17:55:33 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.unmarshaller;
+ 
+ import com.sun.xml.internal.bind.util.AttributesImpl;
+@@ -28,7 +29,7 @@
+ 
+ /**
+  * {@link AttributesEx} implementation.
+- * 
++ *
+  * TODO: proper implementation that holds CharSequence
+  *
+  * @author Kohsuke Kawaguchi
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/Base64Data.java	Thu Jul 30 17:55:37 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/Base64Data.java	Thu Jul 30 17:55:36 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.unmarshaller;
+ 
+ import java.io.ByteArrayInputStream;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/ChildLoader.java	Thu Jul 30 17:55:41 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/ChildLoader.java	Thu Jul 30 17:55:40 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.unmarshaller;
+ 
+ /**
+@@ -28,7 +29,7 @@
+  * Pair of {@link Loader} and {@link Receiver}.
+  *
+  * Used by {@link StructureLoader}.
+- * 
++ *
+  * @author Kohsuke Kawaguchi
+  */
+ public final class ChildLoader {
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/DefaultIDResolver.java	Thu Jul 30 17:55:44 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/DefaultIDResolver.java	Thu Jul 30 17:55:44 2009
+@@ -22,13 +22,18 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.unmarshaller;
+ 
+ import java.util.HashMap;
+ import java.util.concurrent.Callable;
+ 
++import javax.xml.bind.ValidationEventHandler;
++
+ import com.sun.xml.internal.bind.IDResolver;
+ 
++import org.xml.sax.SAXException;
++
+ /**
+  * Default implementation of {@link IDResolver}.
+  *
+@@ -38,16 +43,19 @@
+     /** Records ID->Object map. */
+     private HashMap<String,Object> idmap = null;
+ 
+-    public void startDocument() {
++    @Override
++    public void startDocument(ValidationEventHandler eventHandler) throws SAXException {
+         if(idmap!=null)
+             idmap.clear();
+     }
+ 
++    @Override
+     public void bind(String id, Object obj) {
+         if(idmap==null)     idmap = new HashMap<String,Object>();
+         idmap.put(id,obj);
+     }
+ 
++    @Override
+     public Callable resolve(final String id, Class targetType) {
+         return new Callable() {
+             public Object call() throws Exception {
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/DefaultValueLoaderDecorator.java	Thu Jul 30 17:55:48 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/DefaultValueLoaderDecorator.java	Thu Jul 30 17:55:47 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.unmarshaller;
+ 
+ import org.xml.sax.SAXException;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/Discarder.java	Thu Jul 30 17:55:51 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/Discarder.java	Thu Jul 30 17:55:51 2009
+@@ -23,9 +23,6 @@
+  * have any questions.
+  */
+ 
+-/*
+- * @(#)$Id: Discarder.java,v 1.4 2005/09/10 19:07:43 kohsuke Exp $
+- */
+ package com.sun.xml.internal.bind.v2.runtime.unmarshaller;
+ 
+ 
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/DomLoader.java	Thu Jul 30 17:55:55 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/DomLoader.java	Thu Jul 30 17:55:54 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.unmarshaller;
+ 
+ import javax.xml.bind.annotation.DomHandler;
+@@ -120,7 +121,7 @@
+ 
+     public void text(UnmarshallingContext.State state, CharSequence text) throws SAXException {
+         if(text.length()==0)
+-            return;     // there's no point in creating an empty Text node in DOM. 
++            return;     // there's no point in creating an empty Text node in DOM.
+         try {
+             State s = (State) state.target;
+             s.handler.characters(text.toString().toCharArray(),0,text.length());
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/FastInfosetConnector.java	Thu Jul 30 17:55:58 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/FastInfosetConnector.java	Thu Jul 30 17:55:58 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.unmarshaller;
+ 
+ import javax.xml.stream.Location;
+@@ -30,6 +31,7 @@
+ 
+ import com.sun.xml.internal.bind.WhiteSpaceProcessor;
+ import com.sun.xml.internal.fastinfoset.stax.StAXDocumentParser;
++import com.sun.xml.internal.org.jvnet.fastinfoset.EncodingAlgorithmIndexes;
+ import org.xml.sax.SAXException;
+ 
+ /**
+@@ -73,8 +75,8 @@
+                 while( !fastInfosetStreamReader.isStartElement() )
+                     event = fastInfosetStreamReader.next();
+             }
+-            
+-                  
++
++
+             if( event!=XMLStreamConstants.START_ELEMENT)
+                 throw new IllegalStateException("The current event is not START_ELEMENT\n but " + event);
+ 
+@@ -104,7 +106,7 @@
+                             // Peek at the next event to see if there are
+                             // fragmented characters
+                             event = fastInfosetStreamReader.peekNext();
+-                            if (event == XMLStreamConstants.END_ELEMENT) 
++                            if (event == XMLStreamConstants.END_ELEMENT)
+                                 processNonIgnorableText();
+                             else if (event == XMLStreamConstants.START_ELEMENT)
+                                 processIgnorableText();
+@@ -114,7 +116,7 @@
+                         break;
+                     // otherwise simply ignore
+                 }
+-                
++
+                 event=fastInfosetStreamReader.next();
+             }
+ 
+@@ -136,7 +138,7 @@
+ 
+     private void handleStartElement() throws SAXException {
+         processUnreportedText();
+-                
++
+         for (int i = 0; i < fastInfosetStreamReader.accessNamespaceCount(); i++) {
+             visitor.startPrefixMapping(fastInfosetStreamReader.getNamespacePrefix(i),
+                     fastInfosetStreamReader.getNamespaceURI(i));
+@@ -151,7 +153,7 @@
+ 
+     private void handleFragmentedCharacters() throws XMLStreamException, SAXException {
+         buffer.setLength(0);
+-        
++
+         // Append characters of first character event
+         buffer.append(fastInfosetStreamReader.accessTextCharacters(),
+                 fastInfosetStreamReader.accessTextStart(),
+@@ -180,7 +182,7 @@
+             }
+         }
+     }
+-    
++
+     private void handleEndElement() throws SAXException {
+         processUnreportedText();
+ 
+@@ -193,8 +195,8 @@
+             visitor.endPrefixMapping(fastInfosetStreamReader.getNamespacePrefix(i));
+         }
+     }
+-    
+-    final private class CharSequenceImpl implements CharSequence {        
++
++    final private class CharSequenceImpl implements CharSequence {
+         char[] ch;
+         int start;
+         int length;
+@@ -207,13 +209,13 @@
+             this.start = start;
+             this.length = length;
+         }
+-        
++
+         public void set() {
+             ch = fastInfosetStreamReader.accessTextCharacters();
+             start = fastInfosetStreamReader.accessTextStart();
+             length = fastInfosetStreamReader.accessTextLength();
+         }
+-        
++
+         // CharSequence interface
+ 
+         public final int length() {
+@@ -230,36 +232,52 @@
+ 
+         public String toString() {
+             return new String(ch, start, length);
+-        }        
++        }
+     }
+-    
++
+     final private CharSequenceImpl charArray = new CharSequenceImpl();
+-    
++
+     private void processNonIgnorableText() throws SAXException {
+         textReported = true;
+-        if (fastInfosetStreamReader.getTextAlgorithmBytes() == null) {            
+-            charArray.set();
+-            visitor.text(charArray);
+-        } else {
++        boolean isTextAlgorithmAplied =
++                (fastInfosetStreamReader.getTextAlgorithmBytes() != null);
++
++        if (isTextAlgorithmAplied &&
++                fastInfosetStreamReader.getTextAlgorithmIndex() == EncodingAlgorithmIndexes.BASE64) {
+             base64Data.set(fastInfosetStreamReader.getTextAlgorithmBytesClone(),null);
+             visitor.text(base64Data);
++        } else {
++            if (isTextAlgorithmAplied) {
++                fastInfosetStreamReader.getText();
++            }
++
++            charArray.set();
++            visitor.text(charArray);
+         }
+     }
+-        
++
+     private void processIgnorableText() throws SAXException {
+-        if (fastInfosetStreamReader.getTextAlgorithmBytes() == null) {
++        boolean isTextAlgorithmAplied =
++                (fastInfosetStreamReader.getTextAlgorithmBytes() != null);
++
++        if (isTextAlgorithmAplied &&
++                fastInfosetStreamReader.getTextAlgorithmIndex() == EncodingAlgorithmIndexes.BASE64) {
++            base64Data.set(fastInfosetStreamReader.getTextAlgorithmBytesClone(),null);
++            visitor.text(base64Data);
++            textReported = true;
++        } else {
++            if (isTextAlgorithmAplied) {
++                fastInfosetStreamReader.getText();
++            }
++
+             charArray.set();
+             if (!WhiteSpaceProcessor.isWhiteSpace(charArray)) {
+                 visitor.text(charArray);
+                 textReported = true;
+             }
+-        } else {
+-            base64Data.set(fastInfosetStreamReader.getTextAlgorithmBytesClone(),null);
+-            visitor.text(base64Data);
+-            textReported = true;
+         }
+     }
+-    
++
+     private void processBufferedText(boolean ignorable) throws SAXException {
+         if (!ignorable || !WhiteSpaceProcessor.isWhiteSpace(buffer)) {
+             visitor.text(buffer);
+@@ -266,7 +284,7 @@
+             textReported = true;
+         }
+     }
+-    
++
+     private void processUnreportedText() throws SAXException {
+         if(!textReported && predictor.expectText()) {
+             visitor.text("");
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/IntArrayData.java	Thu Jul 30 17:56:02 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/IntArrayData.java	Thu Jul 30 17:56:01 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.unmarshaller;
+ 
+ import java.io.IOException;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/IntData.java	Thu Jul 30 17:56:05 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/IntData.java	Thu Jul 30 17:56:05 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.unmarshaller;
+ 
+ import java.io.IOException;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/Intercepter.java	Thu Jul 30 17:56:09 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/Intercepter.java	Thu Jul 30 17:56:08 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.unmarshaller;
+ 
+ import org.xml.sax.SAXException;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/InterningXmlVisitor.java	Thu Jul 30 17:56:13 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/InterningXmlVisitor.java	Thu Jul 30 17:56:12 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.unmarshaller;
+ 
+ import javax.xml.namespace.NamespaceContext;
+@@ -80,7 +81,7 @@
+     public UnmarshallingContext getContext() {
+         return next.getContext();
+     }
+-    
++
+     public TextPredictor getPredictor() {
+         return next.getPredictor();
+     }
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/LeafPropertyLoader.java	Thu Jul 30 17:56:16 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/LeafPropertyLoader.java	Thu Jul 30 17:56:15 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.unmarshaller;
+ 
+ import com.sun.xml.internal.bind.api.AccessorException;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/Loader.java	Thu Jul 30 17:56:20 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/Loader.java	Thu Jul 30 17:56:19 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.unmarshaller;
+ 
+ import java.util.Collection;
+@@ -91,8 +92,17 @@
+         state.receiver = null;
+     }
+ 
++    @SuppressWarnings({"StringEquality"})
+     protected final void reportUnexpectedChildElement(TagName ea, boolean canRecover) throws SAXException {
+-        reportError(Messages.UNEXPECTED_ELEMENT.format(ea.uri,ea.local,computeExpectedElements()), canRecover );
++        if(canRecover && !UnmarshallingContext.getInstance().parent.hasEventHandler())
++            // this error happens particurly often (when input documents contain a lot of unexpected elements to be ignored),
++            // so don't bother computing all the messages and etc if we know that
++            // there's no event handler to receive the error in the end. See #286
++            return;
++        if(ea.uri!=ea.uri.intern() || ea.local!=ea.local.intern())
++            reportError(Messages.UNINTERNED_STRINGS.format(), canRecover );
++        else
++            reportError(Messages.UNEXPECTED_ELEMENT.format(ea.uri,ea.local,computeExpectedElements()), canRecover );
+     }
+ 
+     /**
+@@ -213,6 +223,9 @@
+         reportError(e.getMessage(), e, canRecover );
+     }
+ 
++    public static void handleGenericError(Error e) throws SAXException {
++        reportError(e.getMessage(), false);
++    }
+ 
+     protected static void reportError(String msg, boolean canRecover) throws SAXException {
+         reportError(msg, null, canRecover );
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/LocatorEx.java	Thu Jul 30 17:56:23 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/LocatorEx.java	Thu Jul 30 17:56:23 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.unmarshaller;
+ 
+ import java.net.URL;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/LocatorExWrapper.java	Thu Jul 30 17:56:27 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/LocatorExWrapper.java	Thu Jul 30 17:56:26 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.unmarshaller;
+ 
+ import javax.xml.bind.ValidationEventLocator;
+@@ -31,7 +32,7 @@
+ 
+ /**
+  * {@link LocatorEx} implemented by {@link Locator}.
+- * 
++ *
+  * @author Kohsuke Kawaguchi
+  */
+ class LocatorExWrapper implements LocatorEx {
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/MTOMDecorator.java	Thu Jul 30 17:56:30 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/MTOMDecorator.java	Thu Jul 30 17:56:30 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.unmarshaller;
+ 
+ import javax.activation.DataHandler;
+@@ -59,7 +60,7 @@
+      *
+      * This happens twice; once before &lt;/xop:Include>, another
+      * after &lt;/xop:Include>. The spec guarantees that
+-     * no valid pcdata can follow &lt;/xop:Include>. 
++     * no valid pcdata can follow &lt;/xop:Include>.
+      */
+     private boolean followXop;
+ 
+@@ -78,7 +79,7 @@
+     }
+ 
+     public void startElement(TagName tagName) throws SAXException {
+-        if(tagName.local=="Include" && tagName.uri==WellKnownNamespace.XOP) {
++        if(tagName.local.equals("Include") && tagName.uri.equals(WellKnownNamespace.XOP)) {
+             // found xop:Include
+             String href = tagName.atts.getValue("href");
+             DataHandler attachment = au.getAttachmentAsDataHandler(href);
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/Messages.java	Thu Jul 30 17:56:34 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/Messages.java	Thu Jul 30 17:56:33 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.unmarshaller;
+ 
+ import java.text.MessageFormat;
+@@ -38,6 +39,7 @@
+     UNRECOGNIZED_TYPE_NAME, // 1 arg
+     UNRECOGNIZED_TYPE_NAME_MAYBE, // 2 args
+     UNABLE_TO_CREATE_MAP, // 1 arg
++    UNINTERNED_STRINGS, // no args
+     ;
+ 
+     private static final ResourceBundle rb = ResourceBundle.getBundle(Messages.class.getName());
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/Messages.properties	Thu Jul 30 17:56:37 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/Messages.properties	Thu Jul 30 17:56:37 2009
+@@ -36,7 +36,7 @@
+     Undefined ID "{0}".
+ 
+ UNEXPECTED_ELEMENT = \
+-	unexpected element (uri:"{0}", local:"{1}"). Expected elements are {2}
++        unexpected element (uri:"{0}", local:"{1}"). Expected elements are {2}
+ 
+ UNEXPECTED_TEXT = \
+     unexpected text "{0}"
+@@ -45,4 +45,6 @@
+     The type of the field is {0}, but JAXB doesn't know how to create an instance \
+     assignable to it. Create an instance in the constructor, or use a type that can \
+     be assignable from HashMap.
+- 
++
++UNINTERNED_STRINGS = \
++    Namespace URIs and local names to the unmarshaller needs to be interned.
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/Patcher.java	Thu Jul 30 17:56:41 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/Patcher.java	Thu Jul 30 17:56:40 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.unmarshaller;
+ 
+ import org.xml.sax.SAXException;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/ProxyLoader.java	Thu Jul 30 17:56:44 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/ProxyLoader.java	Thu Jul 30 17:56:44 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.unmarshaller;
+ 
+ import org.xml.sax.SAXException;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/Receiver.java	Thu Jul 30 17:56:48 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/Receiver.java	Thu Jul 30 17:56:47 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.unmarshaller;
+ 
+ import org.xml.sax.SAXException;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/SAXConnector.java	Thu Jul 30 17:56:51 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/SAXConnector.java	Thu Jul 30 17:56:51 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.unmarshaller;
+ 
+ import javax.xml.bind.JAXBException;
+@@ -28,6 +29,7 @@
+ import javax.xml.bind.UnmarshallerHandler;
+ 
+ import com.sun.xml.internal.bind.WhiteSpaceProcessor;
++import com.sun.xml.internal.bind.v2.runtime.ClassBeanInfoImpl;
+ 
+ import org.xml.sax.Attributes;
+ import org.xml.sax.Locator;
+@@ -116,8 +118,18 @@
+         if( qname==null || qname.length()==0 )
+             qname=local;
+ 
+-        processText(true);
+ 
++        boolean ignorable = true;
++        StructureLoader sl;
++
++        // not null only if element content is processed (StructureLoader is used)
++        // ugly
++        if((sl = this.context.getStructureLoader()) != null) {
++            ignorable = ((ClassBeanInfoImpl)sl.getBeanInfo()).hasElementOnlyContentModel();
++        }
++
++        processText(ignorable);
++
+         tagName.uri = uri;
+         tagName.local = local;
+         tagName.qname = qname;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/Scope.java	Thu Jul 30 17:56:55 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/Scope.java	Thu Jul 30 17:56:54 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.unmarshaller;
+ 
+ import com.sun.xml.internal.bind.api.AccessorException;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/StAXConnector.java	Thu Jul 30 17:56:58 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/StAXConnector.java	Thu Jul 30 17:56:58 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.unmarshaller;
+ 
+ import javax.xml.bind.ValidationEventLocator;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/StAXEventConnector.java	Thu Jul 30 17:57:02 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/StAXEventConnector.java	Thu Jul 30 17:57:01 2009
+@@ -22,6 +22,8 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.bind.v2.runtime.unmarshaller;
+ 
+ import java.util.Iterator;
+@@ -75,7 +77,7 @@
+     /**
+      * Construct a new StAX to SAX adapter that will convert a StAX event
+      * stream into a SAX event stream.
+-     * 
++     *
+      * @param staxCore
+      *                StAX event source
+      * @param visitor
+@@ -276,7 +278,7 @@
+                 qName = prefix + ':' + localName;
+             String type = staxAttr.getDTDType();
+             String value = staxAttr.getValue();
+-            
++
+             attrs.addAttribute(uri, localName, qName, type, value);
+         }
+ 
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/StAXStreamConnector.java	Thu Jul 30 17:57:06 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/StAXStreamConnector.java	Thu Jul 30 17:57:05 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.unmarshaller;
+ 
+ import java.lang.reflect.Constructor;
+@@ -42,7 +43,7 @@
+  * <p>
+  * TODO:
+  * Finding the optimized FI implementations is a bit hacky and not very
+- * extensible. Can we use the service provider mechnism in general for 
++ * extensible. Can we use the service provider mechnism in general for
+  * concrete implementations of StAXConnector.
+  *
+  * @author Ryan.Shoemaker@Sun.COM
+@@ -68,13 +69,14 @@
+ 
+         // Quick hack until SJSXP fixes 6270116
+         boolean isZephyr = readerClass.getName().equals("com.sun.xml.internal.stream.XMLReaderImpl");
+-        if(isZephyr)
++        if (getBoolProp(reader,"org.codehaus.stax2.internNames") &&
++            getBoolProp(reader,"org.codehaus.stax2.internNsUris"))
+             ; // no need for interning
+         else
+-        if(checkImplementaionNameOfSjsxp(reader))
++        if (isZephyr)
+             ; // no need for interning
+-        if(getBoolProp(reader,"org.codehaus.stax2.internNames")
+-        && getBoolProp(reader,"org.codehaus.stax2.internNsUris"))
++        else
++        if (checkImplementaionNameOfSjsxp(reader))
+             ; // no need for interning.
+         else
+             visitor = new InterningXmlVisitor(visitor);
+@@ -352,9 +354,9 @@
+         try {
+             if (FI_STAX_READER_CLASS == null)
+                 return null;
+-            
++
+             Class c = UnmarshallerImpl.class.getClassLoader().loadClass(
+-                    "com.sun.xml.internal.bind.v2.runtime.unmarshaller.FastInfosetConnector");                
++                    "com.sun.xml.internal.bind.v2.runtime.unmarshaller.FastInfosetConnector");
+             return c.getConstructor(FI_STAX_READER_CLASS,XmlVisitor.class);
+         } catch (Throwable e) {
+             return null;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/StructureLoader.java	Thu Jul 30 17:57:09 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/StructureLoader.java	Thu Jul 30 17:57:08 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.unmarshaller;
+ 
+ import java.util.Collection;
+@@ -256,4 +257,8 @@
+     }
+ 
+     private static final QNameMap<TransducedAccessor> EMPTY = new QNameMap<TransducedAccessor>();
++
++    public JaxBeanInfo getBeanInfo() {
++        return beanInfo;
++    }
+ }
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/TagName.java	Thu Jul 30 17:57:13 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/TagName.java	Thu Jul 30 17:57:12 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.unmarshaller;
+ 
+ import javax.xml.namespace.QName;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/TextLoader.java	Thu Jul 30 17:57:16 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/TextLoader.java	Thu Jul 30 17:57:16 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.unmarshaller;
+ 
+ import com.sun.xml.internal.bind.api.AccessorException;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/UnmarshallerImpl.java	Thu Jul 30 17:57:20 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/UnmarshallerImpl.java	Thu Jul 30 17:57:19 2009
+@@ -266,6 +266,15 @@
+         }
+     }
+ 
++    /**
++     * Returns true if an event handler is installed.
++     * <p>
++     * The default handler ignores any errors, and for that this method returns false.
++     */
++    public final boolean hasEventHandler() {
++        return getEventHandler()!=this;
++    }
++
+     @Override
+     public <T> JAXBElement<T> unmarshal(Node node, Class<T> expectedType) throws JAXBException {
+         if(expectedType==null)
+@@ -297,9 +306,11 @@
+                 scanner.scan((Document)node);
+             else
+                 // no other type of input is supported
+-                throw new IllegalArgumentException();
++                throw new IllegalArgumentException("Unexpected node type: "+node);
+ 
+-            return handler.getContext().getResult();
++            Object retVal = handler.getContext().getResult();
++            handler.getContext().clearResult();
++            return retVal;
+         } catch( SAXException e ) {
+             throw createUnmarshalException(e);
+         }
+@@ -340,7 +351,9 @@
+             throw handleStreamException(e);
+         }
+ 
+-        return h.getContext().getResult();
++        Object retVal = h.getContext().getResult();
++        h.getContext().clearResult();
++        return retVal;
+     }
+ 
+     @Override
+@@ -422,6 +435,10 @@
+             coordinator.classResolver = (ClassResolver)value;
+             return;
+         }
++        if(name.equals(ClassLoader.class.getName())) {
++            coordinator.classLoader = (ClassLoader)value;
++            return;
++        }
+         super.setProperty(name, value);
+     }
+ 
+@@ -516,4 +533,8 @@
+     public void setListener(Listener listener) {
+         externalListener = listener;
+     }
++
++    public UnmarshallingContext getContext() {
++        return coordinator;
++    }
+ }
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/UnmarshallingContext.java	Thu Jul 30 17:57:23 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/UnmarshallingContext.java	Thu Jul 30 17:57:23 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.unmarshaller;
+ 
+ import java.lang.reflect.InvocationTargetException;
+@@ -58,9 +59,9 @@
+ import com.sun.xml.internal.bind.v2.runtime.Coordinator;
+ 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.runtime.ElementBeanInfoImpl;
+ 
+ import org.xml.sax.ErrorHandler;
+-import org.xml.sax.Locator;
+ import org.xml.sax.SAXException;
+ import org.xml.sax.helpers.LocatorImpl;
+ 
+@@ -86,6 +87,17 @@
+      */
+     private State current;
+ 
++    private static final LocatorEx DUMMY_INSTANCE;
++
++    static {
++        LocatorImpl loc = new LocatorImpl();
++        loc.setPublicId(null);
++        loc.setSystemId(null);
++        loc.setLineNumber(-1);
++        loc.setColumnNumber(-1);
++        DUMMY_INSTANCE = new LocatorExWrapper(loc);
++    }
++
+     private @NotNull LocatorEx locator = DUMMY_INSTANCE;
+ 
+     /** Root object that is being unmarshalled. */
+@@ -160,6 +172,12 @@
+     public @Nullable ClassResolver classResolver;
+ 
+     /**
++     * User-supplied {@link ClassLoader} for converting name to {@link Class}.
++     * For backward compatibility, when null, use thread context classloader.
++     */
++    public @Nullable ClassLoader classLoader;
++
++    /**
+      * State information for each element.
+      */
+     public final class State {
+@@ -183,6 +201,30 @@
+ 
+         /**
+          * Hack for making JAXBElement unmarshalling work.
++         *
++         * <p>
++         * While the unmarshalling is in progress, the {@link #target} field stores the object being unmarshalled.
++         * This makes it convenient to keep track of the unmarshalling activity in context of XML infoset, but
++         * since there's only one {@link State} per element, this mechanism only works when there's one object
++         * per element, which breaks down when we have {@link JAXBElement}, since the presence of JAXBElement
++         * requires that we have two objects unmarshalled (a JAXBElement X and a value object Y bound to an XML type.)
++         *
++         * <p>
++         * So to make room for storing both, this {@link #backup} field is used. When we create X instance
++         * in the above example, we set that to {@code state.prev.target} and displace its old value to
++         * {@code state.prev.backup} (where Y goes to {@code state.target}.) Upon the completion of the unmarshalling
++         * of Y, we revert this.
++         *
++         * <p>
++         * While this attributes X incorrectly to its parent element, this preserves the parent/child
++         * relationship between unmarshalled objects and {@link State} parent/child relationship, and
++         * it thereby makes {@link Receiver} mechanism simpler.
++         *
++         * <p>
++         * Yes, I know this is a hack, and no, I'm not proud of it.
++         *
++         * @see ElementBeanInfoImpl.IntercepterLoader#startElement(State, TagName)
++         * @see ElementBeanInfoImpl.IntercepterLoader#intercept(State, Object)
+          */
+         public Object backup;
+ 
+@@ -210,6 +252,8 @@
+         public final State prev;
+         private State next;
+ 
++        public boolean nil = false;
++
+         /**
+          * Gets the context.
+          */
+@@ -514,6 +558,13 @@
+         throw new UnmarshalException((String)null);
+     }
+ 
++    void clearResult() {
++        if (isUnmarshalInProgress) {
++            throw new IllegalStateException();
++        }
++        result = null;
++    }
++
+     /**
+      * Creates a new instance of the specified class.
+      * In the unmarshaller, we need to check the user-specified factory class.
+@@ -970,6 +1021,7 @@
+          * Receives the root element and determines how to start
+          * unmarshalling.
+          */
++        @Override
+         public void childElement(UnmarshallingContext.State state, TagName ea) throws SAXException {
+             Loader loader = state.getContext().selectRootLoader(state,ea);
+             if(loader!=null) {
+@@ -1002,6 +1054,9 @@
+                 ((JAXBElement<Object>)state.backup).setValue(o);
+                 o = state.backup;
+             }
++            if (state.nil) {
++                ((JAXBElement<Object>)o).setNil(true);
++            }
+             state.getContext().result = o;
+         }
+     }
+@@ -1126,14 +1181,32 @@
+         return (UnmarshallingContext) Coordinator._getInstance();
+     }
+ 
+-    private static final LocatorEx DUMMY_INSTANCE;
++    /**
++     * Allows to access elements which are expected in current state.
++     * Useful for getting elements/attributes for current parent.
++     *
++     * @return
++     */
++    public Collection<QName> getCurrentExpectedElements() {
++        pushCoordinator();
++        try {
++            State s = getCurrentState();
++            Loader l = s.loader;
++            return l.getExpectedChildElements();
++        } finally {
++            popCoordinator();
++        }
++    }
+ 
+-    static {
+-        LocatorImpl loc = new LocatorImpl();
+-        loc.setPublicId(null);
+-        loc.setSystemId(null);
+-        loc.setLineNumber(-1);
+-        loc.setColumnNumber(-1);
+-        DUMMY_INSTANCE = new LocatorExWrapper(loc);
++    /**
++     * Gets StructureLoader if used as loader.
++     * Useful when determining if element is mixed or not.
++     *
++     */
++    public StructureLoader getStructureLoader() {
++        if(current.loader instanceof StructureLoader)
++            return (StructureLoader)current.loader;
++
++        return null;
+     }
+ }
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/ValidatingUnmarshaller.java	Thu Jul 30 17:57:27 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/ValidatingUnmarshaller.java	Thu Jul 30 17:57:27 2009
+@@ -38,7 +38,7 @@
+  * @author Kohsuke Kawaguchi
+  */
+ final class ValidatingUnmarshaller implements XmlVisitor, XmlVisitor.TextPredictor {
+-    
++
+     private final XmlVisitor next;
+     private final ValidatorHandler validator;
+ 
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/ValuePropertyLoader.java	Thu Jul 30 17:57:31 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/ValuePropertyLoader.java	Thu Jul 30 17:57:30 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.unmarshaller;
+ 
+ import com.sun.xml.internal.bind.v2.runtime.reflect.TransducedAccessor;
+@@ -54,4 +55,3 @@
+         }
+     }
+ }
+-
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/WildcardLoader.java	Thu Jul 30 17:57:34 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/WildcardLoader.java	Thu Jul 30 17:57:34 2009
+@@ -23,9 +23,6 @@
+  * have any questions.
+  */
+ 
+-/*
+- * @(#)$Id: WildcardLoader.java,v 1.3.6.1 2006/08/23 17:24:39 kohsuke Exp $
+- */
+ package com.sun.xml.internal.bind.v2.runtime.unmarshaller;
+ 
+ import javax.xml.bind.annotation.DomHandler;
+@@ -36,7 +33,7 @@
+ 
+ /**
+  * Feed incoming events to {@link DomHandler} and builds a DOM tree.
+- * 
++ *
+  * <p>
+  * Note that the SAXException returned by the ContentHandler is
+  * unreported. So we have to catch them and report it, then rethrow
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/XmlVisitor.java	Thu Jul 30 17:57:38 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/XmlVisitor.java	Thu Jul 30 17:57:37 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.unmarshaller;
+ 
+ import javax.xml.namespace.NamespaceContext;
+@@ -143,9 +144,9 @@
+          *
+          * <p>
+          * If this method returns true, all the whitespaces are considered significant
+-         * and thus need to be reported as a {@link #text} event. Furthermore,
++         * and thus need to be reported as a {@link XmlVisitor#text} event. Furthermore,
+          * if the element has no children (like &lt;foo/>), then it has to be reported
+-         * an empty {@link #text} event.
++         * an empty {@link XmlVisitor#text} event.
+          */
+         boolean expectText();
+     }
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/XsiNilLoader.java	Thu Jul 30 17:57:41 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/XsiNilLoader.java	Thu Jul 30 17:57:41 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.unmarshaller;
+ 
+ import com.sun.xml.internal.bind.DatatypeConverterImpl;
+@@ -29,6 +30,9 @@
+ import com.sun.xml.internal.bind.v2.WellKnownNamespace;
+ import com.sun.xml.internal.bind.v2.runtime.reflect.Accessor;
+ 
++import java.util.Collection;
++import javax.xml.bind.JAXBElement;
++import javax.xml.namespace.QName;
+ import org.xml.sax.SAXException;
+ 
+ /**
+@@ -49,17 +53,24 @@
+     protected Loader selectLoader(UnmarshallingContext.State state, TagName ea) throws SAXException {
+         int idx = ea.atts.getIndex(WellKnownNamespace.XML_SCHEMA_INSTANCE,"nil");
+ 
+-        if(idx!=-1) {
+-            String value = ea.atts.getValue(idx);
+-            if(DatatypeConverterImpl._parseBoolean(value)) {
++        if (idx!=-1) {
++            if (DatatypeConverterImpl._parseBoolean(ea.atts.getValue(idx))) {
+                 onNil(state);
+-                return Discarder.INSTANCE;
++                boolean hasOtherAttributes = (ea.atts.getLength() - 1) > 0;
++                // see issues 6759703 and 565 - need to preserve attributes even if the element is nil; only when the type is stored in JAXBElement
++                if (!(hasOtherAttributes && (state.prev.target instanceof JAXBElement))) {
++                    return Discarder.INSTANCE;
++                }
+             }
+         }
+-
+         return defaultLoader;
+     }
+ 
++        @Override
++        public Collection<QName> getExpectedChildElements() {
++            return defaultLoader.getExpectedChildElements();
++        }
++
+     /**
+      * Called when xsi:nil='true' was found.
+      */
+@@ -75,13 +86,16 @@
+             this.acc = acc;
+         }
+ 
++        @Override
+         protected void onNil(UnmarshallingContext.State state) throws SAXException {
+             try {
+                 acc.set(state.prev.target,null);
++                state.prev.nil = true;
+             } catch (AccessorException e) {
+                 handleGenericException(e,true);
+             }
+         }
++
+     }
+ 
+     public static final class Array extends XsiNilLoader {
+@@ -89,6 +103,7 @@
+             super(core);
+         }
+ 
++        @Override
+         protected void onNil(UnmarshallingContext.State state) {
+             // let the receiver add this to the lister
+             state.target = null;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/XsiTypeLoader.java	Thu Jul 30 17:57:45 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/XsiTypeLoader.java	Thu Jul 30 17:57:44 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.runtime.unmarshaller;
+ 
+ import javax.xml.namespace.QName;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/FoolProofResolver.java	Thu Jul 30 17:57:48 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/FoolProofResolver.java	Thu Jul 30 17:57:48 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.schemagen;
+ 
+ import java.io.IOException;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/Form.java	Thu Jul 30 17:57:52 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/Form.java	Thu Jul 30 17:57:51 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.schemagen;
+ 
+ import javax.xml.bind.annotation.XmlNsForm;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/GroupKind.java	Thu Jul 30 17:57:55 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/GroupKind.java	Thu Jul 30 17:57:55 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.schemagen;
+ 
+ import com.sun.xml.internal.bind.v2.schemagen.xmlschema.Particle;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/Messages.java	Thu Jul 30 17:57:59 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/Messages.java	Thu Jul 30 17:57:58 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.schemagen;
+ 
+ import java.util.ResourceBundle;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/Messages.properties	Thu Jul 30 17:58:02 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/Messages.properties	Thu Jul 30 17:58:02 2009
+@@ -24,4 +24,3 @@
+ #
+ 
+ ANONYMOUS_TYPE_CYCLE=Anonymous types form an infinite cycle: {0}
+- 
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/MultiMap.java	Thu Jul 30 17:58:06 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/MultiMap.java	Thu Jul 30 17:58:05 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.schemagen;
+ 
+ import java.util.TreeMap;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/Tree.java	Thu Jul 30 17:58:09 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/Tree.java	Thu Jul 30 17:58:09 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.schemagen;
+ 
+ import java.util.ArrayList;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/Util.java	Thu Jul 30 17:58:13 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/Util.java	Thu Jul 30 17:58:12 2009
+@@ -28,14 +28,14 @@
+ /**
+  * TODO: JAX-WS dependes on this class - consider moving it somewhere more stable, Notify JAX-WS before modifying anything...
+  *
+- * Other miscellaneous utility methods. 
+- * 
++ * Other miscellaneous utility methods.
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+ public final class Util {
+     private Util() {}   // no instanciation please
+-    
++
+     /**
+      * Escape any characters that would cause the single arg constructor
+      * of java.net.URI to complain about illegal chars.
+@@ -124,5 +124,5 @@
+             return s.equals(t);
+         }
+         return false;
+-    }    
++    }
+ }
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/XmlSchemaGenerator.java	Thu Jul 30 17:58:16 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/XmlSchemaGenerator.java	Thu Jul 30 17:58:16 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.schemagen;
+ 
+ import java.io.IOException;
+@@ -42,6 +43,7 @@
+ 
+ import javax.activation.MimeType;
+ import javax.xml.bind.SchemaOutputResolver;
++import javax.xml.bind.annotation.XmlElement;
+ import javax.xml.namespace.QName;
+ import javax.xml.transform.Result;
+ import javax.xml.transform.stream.StreamResult;
+@@ -54,6 +56,7 @@
+ import com.sun.xml.internal.bind.v2.TODO;
+ import com.sun.xml.internal.bind.v2.WellKnownNamespace;
+ import com.sun.xml.internal.bind.v2.util.CollisionCheckStack;
++import com.sun.xml.internal.bind.v2.util.StackRecorder;
+ import static com.sun.xml.internal.bind.v2.WellKnownNamespace.XML_SCHEMA;
+ import com.sun.xml.internal.bind.v2.model.core.Adapter;
+ import com.sun.xml.internal.bind.v2.model.core.ArrayInfo;
+@@ -267,10 +270,28 @@
+     public void add( ElementInfo<T,C> elem ) {
+         assert elem!=null;
+ 
++        boolean nillable = false; // default value
++
+         QName name = elem.getElementName();
+         Namespace n = getNamespace(name.getNamespaceURI());
+-        n.elementDecls.put(name.getLocalPart(),n.new ElementWithType(true,elem.getContentType()));
++        ElementInfo ei;
+ 
++        if (elem.getScope() != null) { // (probably) never happens
++            ei = this.types.getElementInfo(elem.getScope().getClazz(), name);
++        } else {
++            ei = this.types.getElementInfo(null, name);
++        }
++
++        XmlElement xmlElem = ei.getProperty().readAnnotation(XmlElement.class);
++
++        if (xmlElem == null) {
++            nillable = false;
++        } else {
++            nillable = xmlElem.nillable();
++        }
++
++        n.elementDecls.put(name.getLocalPart(),n.new ElementWithType(nillable, elem.getContentType()));
++
+         // search for foreign namespace references
+         n.processForeignNamespaces(elem.getProperty());
+     }
+@@ -404,6 +425,11 @@
+         if(resolver==null)
+             throw new IllegalArgumentException();
+ 
++        if(logger.isLoggable(Level.FINE)) {
++            // debug logging to see what's going on.
++            logger.log(Level.FINE,"Wrigin XML Schema for "+toString(),new StackRecorder());
++        }
++
+         // make it fool-proof
+         resolver = new FoolProofResolver(resolver);
+         this.errorListener = errorListener;
+@@ -1026,7 +1052,7 @@
+                         if(ep.isCollectionNillable()) {
+                             e.nillable(true);
+                         }
+-                        writeOccurs(e,true,repeated);
++                        writeOccurs(e,!ep.isCollectionRequired(),repeated);
+ 
+                         ComplexType p = e.complexType();
+                         choice.write(p);
+@@ -1180,11 +1206,8 @@
+             }
+ 
+ 
+-            final Tree choice = Tree.makeGroup(GroupKind.CHOICE, children).makeRepeated(rp.isCollection()).makeOptional(rp.isCollection());
+-            // it's a curious omission that XmlElementRef doesn't have required().
+-            // instead right now a collection will make it [0,unbounded]
++            final Tree choice = Tree.makeGroup(GroupKind.CHOICE, children).makeRepeated(rp.isCollection()).makeOptional(!rp.isRequired());
+ 
+-
+             final QName ename = rp.getXmlName();
+ 
+             if (ename != null) { // wrapped
+@@ -1253,6 +1276,16 @@
+             addDependencyTo(tref.getTarget().getTypeName());
+         }
+ 
++        @Override
++        public String toString() {
++            StringBuilder buf = new StringBuilder();
++            buf.append("[classes=").append(classes);
++            buf.append(",elementDecls=").append(elementDecls);
++            buf.append(",enums=").append(enums);
++            buf.append("]");
++            return super.toString();
++        }
++
+         /**
+          * Represents a global element declaration to be written.
+          *
+@@ -1339,6 +1372,18 @@
+     }
+ 
+     /**
++     * Debug information of what's in this {@link XmlSchemaGenerator}.
++     */
++    public String toString() {
++        StringBuilder buf = new StringBuilder();
++        for (Namespace ns : namespaces.values()) {
++            if(buf.length()>0)  buf.append(',');
++            buf.append(ns.uri).append('=').append(ns);
++        }
++        return super.toString()+'['+buf+']';
++    }
++
++    /**
+      * return the string representation of the processContents mode of the
+      * give wildcard, or null if it is the schema default "strict"
+      *
+@@ -1358,7 +1403,7 @@
+ 
+     /**
+      * TODO: JAX-WS dependency on this method - consider moving this method into com.sun.tools.internal.jxc.util.Util
+-     * 
++     *
+      * Relativizes a URI by using another URI (base URI.)
+      *
+      * <p>
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/episode/Bindings.java	Thu Jul 30 17:58:20 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/episode/Bindings.java	Thu Jul 30 17:58:20 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.schemagen.episode;
+ 
+ import com.sun.xml.internal.txw2.TypedXmlWriter;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/episode/Klass.java	Thu Jul 30 17:58:24 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/episode/Klass.java	Thu Jul 30 17:58:23 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.schemagen.episode;
+ 
+ import com.sun.xml.internal.txw2.TypedXmlWriter;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/episode/SchemaBindings.java	Thu Jul 30 17:58:27 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/episode/SchemaBindings.java	Thu Jul 30 17:58:27 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.schemagen.episode;
+ 
+ import com.sun.xml.internal.txw2.TypedXmlWriter;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/episode/package-info.java	Thu Jul 30 17:58:31 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/episode/package-info.java	Thu Jul 30 17:58:30 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ /**
+  * TXW interfaces for writing episode file, which is what XJC needs to
+  * handle separate compilation.
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/package-info.java	Thu Jul 30 17:58:36 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/package-info.java	Thu Jul 30 17:58:35 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ /**
+  * Schema generator.
+  *
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/ContentModelContainer.java	Thu Jul 30 17:58:40 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/ContentModelContainer.java	Thu Jul 30 17:58:40 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.schemagen.xmlschema;
+ 
+ import com.sun.xml.internal.txw2.TypedXmlWriter;
+@@ -31,7 +32,7 @@
+  * Used to write a content model.
+  *
+  * This mixes the particle and model group as the child of complex type.
+- * 
++ *
+  * @author Kohsuke Kawaguchi
+  */
+ public interface ContentModelContainer extends TypedXmlWriter {
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Element.java	Thu Jul 30 17:58:44 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Element.java	Thu Jul 30 17:58:43 2009
+@@ -37,10 +37,10 @@
+     public Element type(QName value);
+ 
+     @XmlAttribute
+-    public Element block(String value);
++    public Element block(String[] value);
+ 
+     @XmlAttribute
+-    public Element block(String[] value);
++    public Element block(String value);
+ 
+     @XmlAttribute
+     public Element nillable(boolean value);
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Occurs.java	Thu Jul 30 17:58:47 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Occurs.java	Thu Jul 30 17:58:47 2009
+@@ -36,9 +36,9 @@
+     public Occurs minOccurs(int value);
+ 
+     @XmlAttribute
+-    public Occurs maxOccurs(int value);
++    public Occurs maxOccurs(String value);
+ 
+     @XmlAttribute
+-    public Occurs maxOccurs(String value);
++    public Occurs maxOccurs(int value);
+ 
+ }
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Particle.java	Thu Jul 30 17:58:51 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Particle.java	Thu Jul 30 17:58:50 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.schemagen.xmlschema;
+ 
+ /**
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Schema.java	Thu Jul 30 17:58:54 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Schema.java	Thu Jul 30 17:58:54 2009
+@@ -56,10 +56,10 @@
+     public Schema attributeFormDefault(String value);
+ 
+     @XmlAttribute
+-    public Schema blockDefault(String value);
++    public Schema blockDefault(String[] value);
+ 
+     @XmlAttribute
+-    public Schema blockDefault(String[] value);
++    public Schema blockDefault(String value);
+ 
+     @XmlAttribute
+     public Schema finalDefault(String value);
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/SimpleType.java	Thu Jul 30 17:58:58 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/SimpleType.java	Thu Jul 30 17:58:57 2009
+@@ -35,10 +35,10 @@
+ 
+ 
+     @XmlAttribute("final")
+-    public SimpleType _final(String[] value);
++    public SimpleType _final(String value);
+ 
+     @XmlAttribute("final")
+-    public SimpleType _final(String value);
++    public SimpleType _final(String[] value);
+ 
+     @XmlAttribute
+     public SimpleType name(String value);
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Wildcard.java	Thu Jul 30 17:59:01 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/Wildcard.java	Thu Jul 30 17:59:01 2009
+@@ -36,9 +36,9 @@
+     public Wildcard processContents(String value);
+ 
+     @XmlAttribute
+-    public Wildcard namespace(String[] value);
++    public Wildcard namespace(String value);
+ 
+     @XmlAttribute
+-    public Wildcard namespace(String value);
++    public Wildcard namespace(String[] value);
+ 
+ }
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/util/ByteArrayOutputStreamEx.java	Thu Jul 30 17:59:05 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/util/ByteArrayOutputStreamEx.java	Thu Jul 30 17:59:04 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.util;
+ 
+ import java.io.ByteArrayOutputStream;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/util/CollisionCheckStack.java	Thu Jul 30 17:59:08 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/util/CollisionCheckStack.java	Thu Jul 30 17:59:07 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.util;
+ 
+ import java.util.AbstractList;
+@@ -61,9 +62,9 @@
+     // for our purpose, there isn't much point in resizing this as we don't expect
+     // the stack to grow that much.
+     private final int[] initialHash;
+-    
++
+     public CollisionCheckStack() {
+-    	initialHash = new int[17];
++        initialHash = new int[17];
+         data = new Object[16];
+         next = new int[16];
+     }
+@@ -98,7 +99,7 @@
+         size++;
+         return r;
+     }
+-    
++
+     /**
+      * Pushes a new object to the stack without making it participate
+      * with the collision check.
+@@ -142,7 +143,7 @@
+         }
+         return (E)o;
+     }
+-    
++
+     /**
+      * Returns the top of the stack.
+      */
+@@ -202,7 +203,7 @@
+             x = get(--i);
+             sb.append(x);
+         } while(obj!=x);
+-        
++
+         return sb.toString();
+     }
+ }
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/util/DataSourceSource.java	Thu Jul 30 17:59:11 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/util/DataSourceSource.java	Thu Jul 30 17:59:11 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.util;
+ 
+ import java.io.IOException;
+@@ -58,6 +59,12 @@
+      */
+     private final String charset;
+ 
++    // remember the value we returned so that the 2nd invocation
++    // will return the same object, which is what's expeted out of
++    // StreamSource
++    private Reader r;
++    private InputStream is;
++
+     public DataSourceSource(DataHandler dh) throws MimeTypeParseException {
+         this(dh.getDataSource());
+     }
+@@ -88,7 +95,9 @@
+     public Reader getReader() {
+         try {
+             if(charset==null)   return null;
+-            else                return new InputStreamReader(source.getInputStream(),charset);
++            if(r==null)
++                r = new InputStreamReader(source.getInputStream(),charset);
++            return r;
+         } catch (IOException e) {
+             // argh
+             throw new RuntimeException(e);
+@@ -98,8 +107,10 @@
+     @Override
+     public InputStream getInputStream() {
+         try {
+-            if(charset==null)   return source.getInputStream();
+-            else                return null;
++            if(charset!=null)   return null;
++            if(is==null)
++                is = source.getInputStream();
++            return is;
+         } catch (IOException e) {
+             // argh
+             throw new RuntimeException(e);
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/util/EditDistance.java	Thu Jul 30 17:59:15 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/util/EditDistance.java	Thu Jul 30 17:59:14 2009
+@@ -22,11 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * @(#)$Id$
+- */
+-
+-
+ package com.sun.xml.internal.bind.v2.util;
+ 
+ import java.util.Collection;
+@@ -34,11 +29,11 @@
+ 
+ /**
+  * Computes the string edit distance.
+- * 
++ *
+  * <p>
+  * Refer to a computer science text book for the definition
+  * of the "string edit distance".
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+@@ -46,7 +41,7 @@
+ 
+     /**
+      * Computes the edit distance between two strings.
+-     * 
++     *
+      * <p>
+      * The complexity is O(nm) where n=a.length() and m=b.length().
+      */
+@@ -53,12 +48,12 @@
+     public static int editDistance( String a, String b ) {
+         return new EditDistance(a,b).calc();
+     }
+-    
++
+     /**
+      * Finds the string in the <code>group</code> closest to
+      * <code>key</code> and returns it.
+-     * 
+-     * @return null if group.length==0. 
++     *
++     * @return null if group.length==0.
+      */
+     public static String findNearest( String key, String[] group ) {
+         return findNearest(key, Arrays.asList(group));
+@@ -87,21 +82,21 @@
+     /** cost vector. */
+     private int[] cost;
+     /** back buffer. */
+-    private int[] back; 
+-    
++    private int[] back;
++
+     /** Two strings to be compared. */
+     private final String a,b;
+-    
++
+     private EditDistance( String a, String b ) {
+         this.a=a;
+         this.b=b;
+         cost = new int[a.length()+1];
+         back = new int[a.length()+1]; // back buffer
+-        
++
+         for( int i=0; i<=a.length(); i++ )
+             cost[i] = i;
+     }
+-    
++
+     /**
+      * Swaps two buffers.
+      */
+@@ -110,11 +105,11 @@
+         cost = back;
+         back = t;
+     }
+-    
++
+     private int min(int a,int b,int c) {
+         return Math.min(a,Math.min(b,c));
+     }
+-    
++
+     private int calc() {
+         for( int j=0; j<b.length(); j++ ) {
+             flip();
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/util/FatalAdapter.java	Thu Jul 30 17:59:18 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/util/FatalAdapter.java	Thu Jul 30 17:59:18 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.util;
+ 
+ import org.xml.sax.ErrorHandler;
+@@ -30,7 +31,7 @@
+ 
+ /**
+  * Maps an error to a fatal error.
+- * 
++ *
+  * @author Kohsuke Kawaguchi
+  */
+ public class FatalAdapter implements ErrorHandler {
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/util/FlattenIterator.java	Thu Jul 30 17:59:22 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/util/FlattenIterator.java	Thu Jul 30 17:59:21 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.util;
+ 
+ import java.util.Iterator;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/util/QNameMap.java	Thu Jul 30 17:59:25 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/util/QNameMap.java	Thu Jul 30 17:59:24 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.util;
+ import java.util.AbstractSet;
+ import java.util.Iterator;
+@@ -291,8 +292,8 @@
+     }
+ 
+     private abstract class HashIterator<E> implements Iterator<E> {
+-        Entry<V> next;	// next entry to return
+-        int index;		// current slot
++        Entry<V> next;  // next entry to return
++        int index;              // current slot
+ 
+         HashIterator() {
+             Entry<V>[] t = table;
+--- old/src/share/classes/com/sun/xml/internal/bind/v2/util/TypeCast.java	Thu Jul 30 17:59:29 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/util/TypeCast.java	Thu Jul 30 17:59:28 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.bind.v2.util;
+ 
+ import java.util.Map;
+--- old/src/share/classes/com/sun/xml/internal/dtdparser/DTDHandlerBase.java	Thu Jul 30 17:59:32 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/dtdparser/DTDHandlerBase.java	Thu Jul 30 17:59:31 2009
+@@ -118,4 +118,3 @@
+     public void connector(short connectorType) throws SAXException {
+     }
+ }
+-
+--- old/src/share/classes/com/sun/xml/internal/dtdparser/DTDParser.java	Thu Jul 30 17:59:35 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/dtdparser/DTDParser.java	Thu Jul 30 17:59:35 2009
+@@ -58,7 +58,7 @@
+  * @author David Brownell
+  * @author Janet Koenig
+  * @author Kohsuke KAWAGUCHI
+- * @version $Id: DTDParser.java,v 1.1 2005/05/15 04:24:19 kohsuke Exp $
++ * @version $Id: DTDParser.java,v 1.1 2005/05/31 22:28:54 kohsuke Exp $
+  */
+ public class DTDParser {
+     public final static String TYPE_CDATA = "CDATA";
+@@ -626,7 +626,7 @@
+ 
+     // [11] SystemLiteral ::= ('"' [^"]* '"') | ("'" [^']* "'")
+     // for PUBLIC and SYSTEM literals, also "<?xml ...type='literal'?>'
+-    
++
+     // NOTE:  XML spec should explicitly say that PE ref syntax is
+     // ignored in PIs, comments, SystemLiterals, and Pubid Literal
+     // values ... can't process the XML spec's own DTD without doing
+@@ -787,7 +787,7 @@
+     //
+     //    ... handled by InputEntity.unparsedContent()
+ 
+-    // collapsing several rules together ... 
++    // collapsing several rules together ...
+     // simpler than attribute literals -- no reference parsing!
+     private String maybeReadAttribute(String name, boolean must)
+             throws IOException, SAXException {
+@@ -1163,7 +1163,7 @@
+ //        ContentModel       retval, temp, current;
+ 
+ //        retval = temp = current = null;
+-        
++
+         dtdHandler.startModelGroup();
+ 
+         do {
+@@ -1278,7 +1278,7 @@
+         }
+     }
+ 
+-    // '(' S? '#PCDATA' already consumed 
++    // '(' S? '#PCDATA' already consumed
+     // matching ')' must be in "start" entity if validating
+     private void getMixed(String elementName, /*Element element,*/ InputEntity start)
+             throws IOException, SAXException {
+@@ -1490,13 +1490,13 @@
+                     defaultValue = normalize(false);
+                 else
+                     defaultValue = strTmp.toString();
+-            
+-// TODO: implement this check        
++
++// TODO: implement this check
+ ///            if (a.type() != Attribute.CDATA)
+ ///                validateAttributeSyntax (a, a.defaultValue());
+             } else if (!peek("#IMPLIED")) {
+                 attributeUse = DTDEventListener.USE_IMPLIED;
+-            
++
+ ///            if (a.type() == Attribute.ID)
+                 if (typeName == TYPE_ID)
+                     error("V-018", new Object[]{attName});
+@@ -1509,8 +1509,8 @@
+                     defaultValue = normalize(false);
+                 else
+                     defaultValue = strTmp.toString();
+-            
+-// TODO: implement this check        
++
++// TODO: implement this check
+ ///            if (a.type() != Attribute.CDATA)
+ ///                validateAttributeSyntax (a, a.defaultValue());
+             } else {
+@@ -2133,7 +2133,7 @@
+ 
+         return in.peek(s, null);
+     }
+-    
++
+     // Return the entity starting the specified declaration
+     // (for validating declaration nesting) else null.
+ 
+--- old/src/share/classes/com/sun/xml/internal/dtdparser/EndOfInputException.java	Thu Jul 30 17:59:39 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/dtdparser/EndOfInputException.java	Thu Jul 30 17:59:39 2009
+@@ -29,4 +29,3 @@
+ 
+ class EndOfInputException extends IOException {
+ }
+-
+--- old/src/share/classes/com/sun/xml/internal/dtdparser/resources/Messages.properties	Thu Jul 30 17:59:43 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/dtdparser/resources/Messages.properties	Thu Jul 30 17:59:42 2009
+@@ -28,7 +28,7 @@
+ #
+ # P-NNN ... parser messages
+ # F-NNN ... message fragments (sometimes associated with more
+-#		than one message, but usually just with one)
++#               than one message, but usually just with one)
+ # V-NNN ... validation related messages
+ #
+ # Most messages can be produced in only one way.
+@@ -45,51 +45,51 @@
+ P-004 = Missing whitespace {0}
+ P-005 = Only whitespace allowed {0}
+ 
+-	#
+-	# unadorned "missing whitespace", with P-004 only
+-	#
+-	F-000 = after element name declaration
+-	F-001 = between attribute name and type
+-	F-002 = after NOTATION type name
+-	F-003 = between attribute type and default value
+-	F-004 = after #FIXED
+-	F-005 = after <!ENTITY declaration
+-	F-006 = after % in parameter entity declaration
+-	F-007 = after entity name
+-	F-008 = before SYSTEM literal URI
+-	F-009 = after PUBLIC keyword
+-	# F-010 ... identifier can be reused
+-	F-011 = after notation name
+-	# F-012 ... identifier can be reused
+-	# F-013 ... identifier can be reused
++        #
++        # unadorned "missing whitespace", with P-004 only
++        #
++        F-000 = after element name declaration
++        F-001 = between attribute name and type
++        F-002 = after NOTATION type name
++        F-003 = between attribute type and default value
++        F-004 = after #FIXED
++        F-005 = after <!ENTITY declaration
++        F-006 = after % in parameter entity declaration
++        F-007 = after entity name
++        F-008 = before SYSTEM literal URI
++        F-009 = after PUBLIC keyword
++        # F-010 ... identifier can be reused
++        F-011 = after notation name
++        # F-012 ... identifier can be reused
++        # F-013 ... identifier can be reused
+ 
+-	#
+-	# in declaration, in "S Name", with P-004 and P-005
+-	#
+-	F-014 = before name in <!DOCTYPE declaration
+-	F-015 = before name in <!ELEMENT declaration
+-	F-016 = before name in <!ATTLIST declaration
+-	F-017 = before name in <!ENTITY declaration
+-	F-018 = before NDATA notation name in <!ENTITY declaration
+-	F-019 = before name in <!NOTATION declaration
++        #
++        # in declaration, in "S Name", with P-004 and P-005
++        #
++        F-014 = before name in <!DOCTYPE declaration
++        F-015 = before name in <!ELEMENT declaration
++        F-016 = before name in <!ATTLIST declaration
++        F-017 = before name in <!ENTITY declaration
++        F-018 = before NDATA notation name in <!ENTITY declaration
++        F-019 = before name in <!NOTATION declaration
+ 
+ P-006 = Name tokens must not start with "{0}" characters
+ P-007 = Value must be quoted
+ P-008 = Next character must be "{0}" {1} {2}
+ 
+-	F-020 = terminating reference to entity
+-	F-021 = terminating reference to parameter entity
+-	F-022 = terminating comment
+-	F-023 = in XML Declaration
+-	F-024 = terminating internal DTD subset
+-	F-025 = terminating <!DOCTYPE ...> declaration
+-	F-026 = after attribute name
+-	F-027 = terminating element
+-	F-028 = starting content model for element
+-	F-029 = starting list of attribute NOTATIONS
+-	F-030 = beginning condition DTD subset
+-	F-031 = terminating <!ENTITY ...> declaration
+-	F-032 = terminating <!NOTATION ...> declaration
++        F-020 = terminating reference to entity
++        F-021 = terminating reference to parameter entity
++        F-022 = terminating comment
++        F-023 = in XML Declaration
++        F-024 = terminating internal DTD subset
++        F-025 = terminating <!DOCTYPE ...> declaration
++        F-026 = after attribute name
++        F-027 = terminating element
++        F-028 = starting content model for element
++        F-029 = starting list of attribute NOTATIONS
++        F-030 = beginning condition DTD subset
++        F-031 = terminating <!ENTITY ...> declaration
++        F-032 = terminating <!NOTATION ...> declaration
+ 
+ P-009 = Illegal character or entity reference syntax
+ 
+@@ -99,11 +99,11 @@
+ P-013 = Illegal reference to external entity "&{0};" in attribute
+ P-014 = Reference to undefined entity "&{0};"
+ P-015 = Expecting quoted value for {0}
+-	
+-	F-033 = PUBLIC identifier
+-	F-034 = SYSTEM identifier
+-	F-035 = attribute value {0}
+ 
++        F-033 = PUBLIC identifier
++        F-034 = SYSTEM identifier
++        F-035 = attribute value {0}
++
+ P-016 = Illegal character in PUBLIC identifier:  "{0}"
+ P-017 = End of entity while processing comment
+ P-018 = Processing instruction target is missing
+@@ -155,7 +155,7 @@
+ 
+ P-060 = Illegal character "{0}" in encoding name
+ P-061 = Declared encoding "{0}" does not match actual one "{1}"; \
+-	this might not be an error
++        this might not be an error
+ P-062 = Notation must be PUBLIC or SYSTEM
+ P-063 = Using first definition of notation "{0}"
+ P-064 = Premature end of parameter entity "%{0};"
+@@ -175,10 +175,10 @@
+ P-077 = Maximum symbol length ({0} characters) exceeded
+ P-078 = No messages for locale "{0}" are available
+ P-079 = The content beginning "<{1}" is not legal markup \
+-	Perhaps the "{1}" (&#{0};) character should be a letter
++        Perhaps the "{1}" (&#{0};) character should be a letter
+ 
+ P-080 = Parameter entity references must not appear within \
+-	markup declarations in the internal DTD subset
++        markup declarations in the internal DTD subset
+ P-081 = Incomplete Unicode surrogate pair:  &#x{0}
+ 
+ #
+@@ -188,7 +188,7 @@
+ # there's no need for the VC, ever; and "standalone" would then affect
+ # WF-ness.  For the moment this assumes it's to be a VC not a WFC
+ #
+-V-000 =	Validation is disabled
++V-000 = Validation is disabled
+ V-001 = Valid documents must have a <!DOCTYPE declaration
+ V-002 = This document is standalone, so it must not refer to "&{0};"
+ V-003 = Undeclared notation "{0}" is used by an <!ENTITY...> declaration
+@@ -200,9 +200,9 @@
+ V-009 = Attribute value for "{0}" is #REQUIRED
+ 
+ V-010 = This document is standalone, \
+-	so attribute "{0}" must not be defaulted
++        so attribute "{0}" must not be defaulted
+ V-011 = This document is standalone, \
+-	so element "{0}" must not have ignorable whitespace
++        so element "{0}" must not have ignorable whitespace
+ V-012 = Element "{0}" was already declared
+ V-013 = Parameter entities must not contain partial declarations
+ V-014 = Parameter entity nesting error in content model for "{0}"
+@@ -235,4 +235,3 @@
+ V-039 = IDREFS attributes must have at least one value
+ 
+ V-040 = ENTITIES attributes must have at least one value
+- 
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/AbstractResourceBundle.java	Thu Jul 30 17:59:46 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/AbstractResourceBundle.java	Thu Jul 30 17:59:46 2009
+@@ -24,6 +24,14 @@
+  *
+  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
+  */
++/*
++ *
++ * This code is subject to the freebxml License, Version 1.1
++ *
++ * Copyright (c) 2001 - 2005 freebxml.org.  All rights reserved.
++ *
++ * $Header: /cvs/fi/FastInfoset/src/com/sun/xml/internal/fastinfoset/AbstractResourceBundle.java,v 1.3.2.4 2009/05/13 08:53:01 oleksiys Exp $
++ */
+ package com.sun.xml.internal.fastinfoset;
+ 
+ import java.text.MessageFormat;
+@@ -35,19 +43,12 @@
+ /**
+  * This class contains methods common to all *ResourceBundle classes
+  *
+- * @author  Paul Sterk / Sun Microsystems
++ * @author FastInfoset team
+  */
+ public abstract class AbstractResourceBundle extends ResourceBundle {
+-        
++
+     public static final String LOCALE = "com.sun.xml.internal.fastinfoset.locale";
+-    static String _bundleName = null;
+-    
+-    public static String getBundleName() {
+-        return _bundleName;
+-    }
+-    public static void setBundleName(String name) {
+-        _bundleName = name;
+-    }
++
+     /**
+      * Gets 'key' from ResourceBundle and format mesage using 'args'.
+      *
+@@ -59,24 +60,6 @@
+         String pattern = getBundle().getString(key);
+         return MessageFormat.format(pattern, args);
+     }
+-    
+-    /**
+-     * Gets 'key' from ResourceBundle and format mesage using 'args'.
+-     *
+-     * @param key String key for message.
+-     * @param args Array of arguments for message.
+-     * @param locale Locale in which to perform key lookup.
+-     * @return String formatted message.
+-     */
+-    public String getString(String key, Object args[], Locale locale) {
+-        String pattern = null;
+-        if (locale == null) {
+-            pattern = getBundle().getString(key);
+-        } else {
+-            pattern = getBundle(_bundleName, locale).getString(key);
+-        }
+-        return MessageFormat.format(pattern, args);
+-    }
+ 
+     /**
+      * Parse a locale string, return corresponding Locale instance.
+@@ -85,7 +68,7 @@
+      * Name for the locale of interest.  If null, use VM default locale.
+      * @return New Locale instance.
+      */
+-    public static Locale parseLocale(String localeString) {        
++    public static Locale parseLocale(String localeString) {
+         Locale locale = null;
+         if (localeString == null) {
+             locale = Locale.getDefault();
+@@ -105,9 +88,9 @@
+         }
+         return locale;
+     }
+-    
++
+     /**
+-     * Subclasses of this class must implement this method so that the 
++     * Subclasses of this class must implement this method so that the
+      * correct resource bundle is passed to methods in this class
+      *
+      * @return
+@@ -115,8 +98,8 @@
+      *  will use this reference.
+      */
+     public abstract ResourceBundle getBundle();
+-    
+ 
++
+     /**
+      * Since we are changing the ResourceBundle extension point, must
+      * implement handleGetObject() using delegate getBundle().  Uses
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/CommonResourceBundle.java	Thu Jul 30 17:59:50 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/CommonResourceBundle.java	Thu Jul 30 17:59:49 2009
+@@ -37,7 +37,7 @@
+     private static CommonResourceBundle instance = null;
+     private static Locale locale = null;
+     private ResourceBundle bundle = null;
+-    
++
+     protected CommonResourceBundle() {
+         // Load the resource bundle of default locale
+         bundle = ResourceBundle.getBundle(BASE_NAME);
+@@ -62,7 +62,7 @@
+ 
+         return instance;
+     }
+-    
++
+     public static CommonResourceBundle getInstance(Locale locale) {
+         if (instance == null) {
+             synchronized (CommonResourceBundle.class) {
+@@ -74,7 +74,7 @@
+                     instance = new CommonResourceBundle(locale);
+                 }
+             }
+-	}
++        }
+         return instance;
+     }
+ 
+@@ -85,5 +85,5 @@
+     public ResourceBundle getBundle(Locale locale) {
+         return ResourceBundle.getBundle(BASE_NAME, locale);
+     }
+-    
++
+ }
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/Decoder.java	Thu Jul 30 17:59:53 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/Decoder.java	Thu Jul 30 17:59:53 2009
+@@ -71,34 +71,37 @@
+  * {@link java.io.InputStream}.
+  */
+ public abstract class Decoder implements FastInfosetParser {
+-    
+-    protected static final char[] XML_NAMESPACE_NAME_CHARS = EncodingConstants.XML_NAMESPACE_NAME.toCharArray();
+-    
+-    protected static final char[] XMLNS_NAMESPACE_PREFIX_CHARS = EncodingConstants.XMLNS_NAMESPACE_PREFIX.toCharArray();
+-    
+-    protected static final char[] XMLNS_NAMESPACE_NAME_CHARS = EncodingConstants.XMLNS_NAMESPACE_NAME.toCharArray();
+-    
++
++    private static final char[] XML_NAMESPACE_NAME_CHARS =
++            EncodingConstants.XML_NAMESPACE_NAME.toCharArray();
++
++    private static final char[] XMLNS_NAMESPACE_PREFIX_CHARS =
++            EncodingConstants.XMLNS_NAMESPACE_PREFIX.toCharArray();
++
++    private static final char[] XMLNS_NAMESPACE_NAME_CHARS =
++            EncodingConstants.XMLNS_NAMESPACE_NAME.toCharArray();
++
+     /**
+      * String interning system property.
+      */
+     public static final String STRING_INTERNING_SYSTEM_PROPERTY =
+             "com.sun.xml.internal.fastinfoset.parser.string-interning";
+-    
++
+     /**
+      * Internal buffer size interning system property.
+      */
+     public static final String BUFFER_SIZE_SYSTEM_PROPERTY =
+             "com.sun.xml.internal.fastinfoset.parser.buffer-size";
+-    
++
+     private static boolean _stringInterningSystemDefault = false;
+-    
++
+     private static int _bufferSizeSystemDefault = 1024;
+-    
++
+     static {
+         String p = System.getProperty(STRING_INTERNING_SYSTEM_PROPERTY,
+                 Boolean.toString(_stringInterningSystemDefault));
+         _stringInterningSystemDefault = Boolean.valueOf(p).booleanValue();
+-        
++
+         p = System.getProperty(BUFFER_SIZE_SYSTEM_PROPERTY,
+                 Integer.toString(_bufferSizeSystemDefault));
+         try {
+@@ -109,161 +112,161 @@
+         } catch (NumberFormatException e) {
+         }
+     }
+-    
++
+     /**
+      * True if string interning is performed by the decoder.
+      */
+     private boolean _stringInterning = _stringInterningSystemDefault;
+-    
++
+     /**
+      * The input stream from which the fast infoset document is being read.
+      */
+     private InputStream _s;
+-    
++
+     /**
+      * The map of URIs to referenced vocabularies.
+      */
+     private Map _externalVocabularies;
+-    
++
+     /**
+      * True if can parse fragments.
+      */
+     protected boolean _parseFragments;
+-    
++
+     /**
+      * True if needs to close underlying input stream.
+      */
+     protected boolean _needForceStreamClose;
+-    
++
+     /**
+      * True if the vocabulary is internally created by decoder.
+      */
+     private boolean _vIsInternal;
+-    
++
+     /**
+      * The list of Notation Information Items that are part of the
+      * Document Information Item.
+      */
+     protected List _notations;
+-    
++
+     /**
+      * The list of Unparsed Entity Information Items that are part of the
+      * Document Information Item.
+      */
+     protected List _unparsedEntities;
+-    
++
+     /**
+      * The map of URIs to registered encoding algorithms.
+      */
+     protected Map _registeredEncodingAlgorithms = new HashMap();
+-    
++
+     /**
+      * The vocabulary used for decoding.
+      */
+     protected ParserVocabulary _v;
+-    
++
+     /**
+      * The prefix table of the vocabulary.
+      */
+     protected PrefixArray _prefixTable;
+-    
++
+     /**
+      * The element name table of the vocabulary.
+      */
+     protected QualifiedNameArray _elementNameTable;
+-    
++
+     /**
+      * The attribute name table of the vocabulary.
+      */
+     protected QualifiedNameArray _attributeNameTable;
+-    
++
+     /**
+      * The character content chunk table of the vocabulary.
+      */
+     protected ContiguousCharArrayArray _characterContentChunkTable;
+-    
++
+     /**
+      * The attribute value table of the vocabulary.
+      */
+     protected StringArray _attributeValueTable;
+-    
++
+     /**
+      * The current octet that is being read
+      */
+     protected int _b;
+-    
++
+     /**
+      * True if an information item is terminated.
+      */
+     protected boolean _terminate;
+-    
++
+     /**
+      * True if two information item are terminated in direct sequence.
+      */
+     protected boolean _doubleTerminate;
+-    
++
+     /**
+      * True if an entry is required to be added to a table
+      */
+     protected boolean _addToTable;
+-    
++
+     /**
+      * The vocabulary table index to an indexed non identifying string.
+      */
+     protected int _integer;
+-    
++
+     /**
+      * The vocabulary table index of identifying string or the identifier of
+      * an encoding algorithm or restricted alphabet.
+      */
+     protected int _identifier;
+-    
++
+     /**
+      * The size of the internal buffer.
+      */
+     protected int _bufferSize = _bufferSizeSystemDefault;
+-    
++
+     /**
+      * The internal buffer used for decoding.
+      */
+     protected byte[] _octetBuffer = new byte[_bufferSizeSystemDefault];
+-    
++
+     /**
+      * A mark into the internal buffer used for decoding encoded algorithm
+      * or restricted alphabet data.
+      */
+     protected int _octetBufferStart;
+-    
++
+     /**
+      * The offset into the buffer to read the next byte.
+      */
+     protected int _octetBufferOffset;
+-    
++
+     /**
+      * The end of the buffer.
+      */
+     protected int _octetBufferEnd;
+-    
++
+     /**
+      * The length of some octets in the buffer that are to be read.
+      */
+     protected int _octetBufferLength;
+-    
++
+     /**
+      * The internal buffer of characters.
+      */
+     protected char[] _charBuffer = new char[512];
+-    
++
+     /**
+      * The length of characters in the buffer of characters.
+      */
+     protected int _charBufferLength;
+-    
++
+     /**
+      * Helper class that checks for duplicate attribute information items.
+      */
+     protected DuplicateAttributeVerifier _duplicateAttributeVerifier = new DuplicateAttributeVerifier();
+-    
++
+     /**
+      * Default constructor for the Decoder.
+      */
+@@ -276,10 +279,10 @@
+         _attributeValueTable = _v.attributeValue;
+         _vIsInternal = true;
+     }
+-    
+-    
++
++
+     // FastInfosetParser interface
+-    
++
+     /**
+      * {@inheritDoc}
+      */
+@@ -286,7 +289,7 @@
+     public void setStringInterning(boolean stringInterning) {
+         _stringInterning = stringInterning;
+     }
+-    
++
+     /**
+      * {@inheritDoc}
+      */
+@@ -293,7 +296,7 @@
+     public boolean getStringInterning() {
+         return _stringInterning;
+     }
+-    
++
+     /**
+      * {@inheritDoc}
+      */
+@@ -302,7 +305,7 @@
+             _bufferSize = bufferSize;
+         }
+     }
+-    
++
+     /**
+      * {@inheritDoc}
+      */
+@@ -309,7 +312,7 @@
+     public int getBufferSize() {
+         return _bufferSize;
+     }
+-    
++
+     /**
+      * {@inheritDoc}
+      */
+@@ -319,7 +322,7 @@
+             _registeredEncodingAlgorithms = new HashMap();
+         }
+     }
+-    
++
+     /**
+      * {@inheritDoc}
+      */
+@@ -326,7 +329,7 @@
+     public Map getRegisteredEncodingAlgorithms() {
+         return _registeredEncodingAlgorithms;
+     }
+-    
++
+     /**
+      * {@inheritDoc}
+      */
+@@ -339,7 +342,7 @@
+             _externalVocabularies = null;
+         }
+     }
+-    
++
+     /**
+      * {@inheritDoc}
+      */
+@@ -346,7 +349,7 @@
+     public Map getExternalVocabularies() {
+         return _externalVocabularies;
+     }
+-    
++
+     /**
+      * {@inheritDoc}
+      */
+@@ -353,7 +356,7 @@
+     public void setParseFragments(boolean parseFragments) {
+         _parseFragments = parseFragments;
+     }
+-    
++
+     /**
+      * {@inheritDoc}
+      */
+@@ -360,7 +363,7 @@
+     public boolean getParseFragments() {
+         return _parseFragments;
+     }
+-    
++
+     /**
+      * {@inheritDoc}
+      */
+@@ -367,7 +370,7 @@
+     public void setForceStreamClose(boolean needForceStreamClose) {
+         _needForceStreamClose = needForceStreamClose;
+     }
+-    
++
+     /**
+      * {@inheritDoc}
+      */
+@@ -374,9 +377,9 @@
+     public boolean getForceStreamClose() {
+         return _needForceStreamClose;
+     }
+-    
++
+ // End FastInfosetParser interface
+-    
++
+     /**
+      * Reset the decoder for reuse decoding another XML infoset.
+      */
+@@ -383,7 +386,7 @@
+     public void reset() {
+         _terminate = _doubleTerminate = false;
+     }
+-    
++
+     /**
+      * Set the ParserVocabulary to be used for decoding.
+      *
+@@ -398,7 +401,7 @@
+         _attributeValueTable = _v.attributeValue;
+         _vIsInternal = false;
+     }
+-    
++
+     /**
+      * Set the InputStream to decode the fast infoset document.
+      *
+@@ -412,7 +415,7 @@
+             _v.clear();
+         }
+     }
+-    
++
+     protected final void decodeDII() throws FastInfosetException, IOException {
+         final int b = read();
+         if (b == EncodingConstants.DOCUMENT_INITIAL_VOCABULARY_FLAG) {
+@@ -422,11 +425,11 @@
+                     getString("message.optinalValues"));
+         }
+     }
+-    
++
+     protected final void decodeAdditionalData() throws FastInfosetException, IOException {
+         for (int i = 0; i < decodeNumberOfItemsOfSequence(); i++) {
+             String URI = decodeNonEmptyOctetStringOnSecondBitAsUtf8String();
+-            
++
+             decodeNonEmptyOctetStringLengthOnSecondBit();
+             ensureOctetBufferSize();
+             _octetBufferStart = _octetBufferOffset;
+@@ -433,81 +436,81 @@
+             _octetBufferOffset += _octetBufferLength;
+         }
+     }
+-    
++
+     protected final void decodeInitialVocabulary() throws FastInfosetException, IOException {
+         // First 5 optionals of 13 bit optional field
+         int b = read();
+         // Next 8 optionals of 13 bit optional field
+         int b2 = read();
+-        
++
+         // Optimize for the most common case
+         if (b == EncodingConstants.INITIAL_VOCABULARY_EXTERNAL_VOCABULARY_FLAG && b2 == 0) {
+             decodeExternalVocabularyURI();
+             return;
+         }
+-        
++
+         if ((b & EncodingConstants.INITIAL_VOCABULARY_EXTERNAL_VOCABULARY_FLAG) > 0) {
+             decodeExternalVocabularyURI();
+         }
+-        
++
+         if ((b & EncodingConstants.INITIAL_VOCABULARY_RESTRICTED_ALPHABETS_FLAG) > 0) {
+             decodeTableItems(_v.restrictedAlphabet);
+         }
+-        
++
+         if ((b & EncodingConstants.INITIAL_VOCABULARY_ENCODING_ALGORITHMS_FLAG) > 0) {
+             decodeTableItems(_v.encodingAlgorithm);
+         }
+-        
++
+         if ((b & EncodingConstants.INITIAL_VOCABULARY_PREFIXES_FLAG) > 0) {
+             decodeTableItems(_v.prefix);
+         }
+-        
++
+         if ((b & EncodingConstants.INITIAL_VOCABULARY_NAMESPACE_NAMES_FLAG) > 0) {
+             decodeTableItems(_v.namespaceName);
+         }
+-        
++
+         if ((b2 & EncodingConstants.INITIAL_VOCABULARY_LOCAL_NAMES_FLAG) > 0) {
+             decodeTableItems(_v.localName);
+         }
+-        
++
+         if ((b2 & EncodingConstants.INITIAL_VOCABULARY_OTHER_NCNAMES_FLAG) > 0) {
+             decodeTableItems(_v.otherNCName);
+         }
+-        
++
+         if ((b2 & EncodingConstants.INITIAL_VOCABULARY_OTHER_URIS_FLAG) > 0) {
+             decodeTableItems(_v.otherURI);
+         }
+-        
++
+         if ((b2 & EncodingConstants.INITIAL_VOCABULARY_ATTRIBUTE_VALUES_FLAG) > 0) {
+             decodeTableItems(_v.attributeValue);
+         }
+-        
++
+         if ((b2 & EncodingConstants.INITIAL_VOCABULARY_CONTENT_CHARACTER_CHUNKS_FLAG) > 0) {
+             decodeTableItems(_v.characterContentChunk);
+         }
+-        
++
+         if ((b2 & EncodingConstants.INITIAL_VOCABULARY_OTHER_STRINGS_FLAG) > 0) {
+             decodeTableItems(_v.otherString);
+         }
+-        
++
+         if ((b2 & EncodingConstants.INITIAL_VOCABULARY_ELEMENT_NAME_SURROGATES_FLAG) > 0) {
+             decodeTableItems(_v.elementName, false);
+         }
+-        
++
+         if ((b2 & EncodingConstants.INITIAL_VOCABULARY_ATTRIBUTE_NAME_SURROGATES_FLAG) > 0) {
+             decodeTableItems(_v.attributeName, true);
+         }
+     }
+-    
++
+     private void decodeExternalVocabularyURI() throws FastInfosetException, IOException {
+         if (_externalVocabularies == null) {
+             throw new IOException(CommonResourceBundle.
+                     getInstance().getString("message.noExternalVocabularies"));
+         }
+-        
++
+         String externalVocabularyURI =
+                 decodeNonEmptyOctetStringOnSecondBitAsUtf8String();
+-        
++
+         Object o = _externalVocabularies.get(externalVocabularyURI);
+         if (o instanceof ParserVocabulary) {
+             _v.setReferencedVocabulary(externalVocabularyURI,
+@@ -516,7 +519,7 @@
+             com.sun.xml.internal.org.jvnet.fastinfoset.ExternalVocabulary v =
+                     (com.sun.xml.internal.org.jvnet.fastinfoset.ExternalVocabulary)o;
+             ParserVocabulary pv = new ParserVocabulary(v.vocabulary);
+-            
++
+             _externalVocabularies.put(externalVocabularyURI, pv);
+             _v.setReferencedVocabulary(externalVocabularyURI,
+                     pv, false);
+@@ -526,19 +529,19 @@
+                     new Object[]{externalVocabularyURI}));
+         }
+     }
+-    
++
+     private void decodeTableItems(StringArray array) throws FastInfosetException, IOException {
+         for (int i = 0; i < decodeNumberOfItemsOfSequence(); i++) {
+             array.add(decodeNonEmptyOctetStringOnSecondBitAsUtf8String());
+         }
+     }
+-    
++
+     private void decodeTableItems(PrefixArray array) throws FastInfosetException, IOException {
+         for (int i = 0; i < decodeNumberOfItemsOfSequence(); i++) {
+             array.add(decodeNonEmptyOctetStringOnSecondBitAsUtf8String());
+         }
+     }
+-    
++
+     private void decodeTableItems(ContiguousCharArrayArray array) throws FastInfosetException, IOException {
+         for (int i = 0; i < decodeNumberOfItemsOfSequence(); i++) {
+             switch(decodeNonIdentifyingStringOnFirstBit()) {
+@@ -550,7 +553,7 @@
+             }
+         }
+     }
+-    
++
+     private void decodeTableItems(CharArrayArray array) throws FastInfosetException, IOException {
+         for (int i = 0; i < decodeNumberOfItemsOfSequence(); i++) {
+             switch(decodeNonIdentifyingStringOnFirstBit()) {
+@@ -562,11 +565,11 @@
+             }
+         }
+     }
+-    
++
+     private void decodeTableItems(QualifiedNameArray array, boolean isAttribute) throws FastInfosetException, IOException {
+         for (int i = 0; i < decodeNumberOfItemsOfSequence(); i++) {
+             final int b = read();
+-            
++
+             String prefix = "";
+             int prefixIndex = -1;
+             if ((b & EncodingConstants.NAME_SURROGATE_PREFIX_FLAG) > 0) {
+@@ -573,7 +576,7 @@
+                 prefixIndex = decodeIntegerIndexOnSecondBit();
+                 prefix = _v.prefix.get(prefixIndex);
+             }
+-            
++
+             String namespaceName = "";
+             int namespaceNameIndex = -1;
+             if ((b & EncodingConstants.NAME_SURROGATE_NAME_FLAG) > 0) {
+@@ -580,24 +583,24 @@
+                 namespaceNameIndex = decodeIntegerIndexOnSecondBit();
+                 namespaceName = _v.prefix.get(prefixIndex);
+             }
+-            
++
+             if (namespaceName == "" && prefix != "") {
+                 throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.missingNamespace"));
+             }
+-            
++
+             final int localNameIndex = decodeIntegerIndexOnSecondBit();
+             final String localName = _v.localName.get(localNameIndex);
+-            
++
+             QualifiedName qualifiedName = new QualifiedName(prefix, namespaceName, localName,
+                     prefixIndex, namespaceNameIndex, localNameIndex,
+                     _charBuffer);
+             if (isAttribute) {
+-                qualifiedName.createAttributeValues(_duplicateAttributeVerifier.MAP_SIZE);
++                qualifiedName.createAttributeValues(DuplicateAttributeVerifier.MAP_SIZE);
+             }
+             array.add(qualifiedName);
+         }
+     }
+-    
++
+     private int decodeNumberOfItemsOfSequence() throws IOException {
+         final int b = read();
+         if (b < 128) {
+@@ -606,7 +609,7 @@
+             return ((b & 0x0F) << 16) | (read() << 8) | read();
+         }
+     }
+-    
++
+     protected final void decodeNotations() throws FastInfosetException, IOException {
+         if (_notations == null) {
+             _notations = new ArrayList();
+@@ -613,19 +616,19 @@
+         } else {
+             _notations.clear();
+         }
+-        
++
+         int b = read();
+         while ((b & EncodingConstants.NOTATIONS_MASK) == EncodingConstants.NOTATIONS) {
+             String name = decodeIdentifyingNonEmptyStringOnFirstBit(_v.otherNCName);
+-            
++
+             String system_identifier = ((_b & EncodingConstants.NOTATIONS_SYSTEM_IDENTIFIER_FLAG) > 0)
+             ? decodeIdentifyingNonEmptyStringOnFirstBit(_v.otherURI) : "";
+             String public_identifier = ((_b & EncodingConstants.NOTATIONS_PUBLIC_IDENTIFIER_FLAG) > 0)
+             ? decodeIdentifyingNonEmptyStringOnFirstBit(_v.otherURI) : "";
+-            
++
+             Notation notation = new Notation(name, system_identifier, public_identifier);
+             _notations.add(notation);
+-            
++
+             b = read();
+         }
+         if (b != EncodingConstants.TERMINATOR) {
+@@ -632,7 +635,7 @@
+             throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.IIsNotTerminatedCorrectly"));
+         }
+     }
+-    
++
+     protected final void decodeUnparsedEntities() throws FastInfosetException, IOException {
+         if (_unparsedEntities == null) {
+             _unparsedEntities = new ArrayList();
+@@ -639,20 +642,20 @@
+         } else {
+             _unparsedEntities.clear();
+         }
+-        
++
+         int b = read();
+         while ((b & EncodingConstants.UNPARSED_ENTITIES_MASK) == EncodingConstants.UNPARSED_ENTITIES) {
+             String name = decodeIdentifyingNonEmptyStringOnFirstBit(_v.otherNCName);
+             String system_identifier = decodeIdentifyingNonEmptyStringOnFirstBit(_v.otherURI);
+-            
++
+             String public_identifier = ((_b & EncodingConstants.UNPARSED_ENTITIES_PUBLIC_IDENTIFIER_FLAG) > 0)
+             ? decodeIdentifyingNonEmptyStringOnFirstBit(_v.otherURI) : "";
+-            
++
+             String notation_name = decodeIdentifyingNonEmptyStringOnFirstBit(_v.otherNCName);
+-            
++
+             UnparsedEntity unparsedEntity = new UnparsedEntity(name, system_identifier, public_identifier, notation_name);
+             _unparsedEntities.add(unparsedEntity);
+-            
++
+             b = read();
+         }
+         if (b != EncodingConstants.TERMINATOR) {
+@@ -659,11 +662,11 @@
+             throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.unparsedEntities"));
+         }
+     }
+-    
++
+     protected final String decodeCharacterEncodingScheme() throws FastInfosetException, IOException {
+         return decodeNonEmptyOctetStringOnSecondBitAsUtf8String();
+     }
+-    
++
+     protected final String decodeVersion() throws FastInfosetException, IOException {
+         switch(decodeNonIdentifyingStringOnFirstBit()) {
+             case NISTRING_STRING:
+@@ -681,13 +684,13 @@
+                 return "";
+         }
+     }
+-    
++
+     protected final QualifiedName decodeEIIIndexMedium() throws FastInfosetException, IOException {
+         final int i = (((_b & EncodingConstants.INTEGER_3RD_BIT_MEDIUM_MASK) << 8) | read())
+         + EncodingConstants.INTEGER_3RD_BIT_SMALL_LIMIT;
+         return _v.elementName._array[i];
+     }
+-    
++
+     protected final QualifiedName decodeEIIIndexLarge() throws FastInfosetException, IOException {
+         int i;
+         if ((_b & EncodingConstants.INTEGER_3RD_BIT_LARGE_LARGE_FLAG) == 0x20) {
+@@ -701,7 +704,7 @@
+         }
+         return _v.elementName._array[i];
+     }
+-    
++
+     protected final QualifiedName decodeLiteralQualifiedName(int state, QualifiedName q)
+     throws FastInfosetException, IOException {
+         if (q == null) q = new QualifiedName();
+@@ -743,12 +746,12 @@
+                 throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.decodingEII"));
+         }
+     }
+-    
++
+     protected static final int NISTRING_STRING              = 0;
+     protected static final int NISTRING_INDEX               = 1;
+     protected static final int NISTRING_ENCODING_ALGORITHM  = 2;
+     protected static final int NISTRING_EMPTY_STRING        = 3;
+-    
++
+     /*
+      * C.14
+      * decodeNonIdentifyingStringOnFirstBit
+@@ -755,7 +758,7 @@
+      */
+     protected final int decodeNonIdentifyingStringOnFirstBit() throws FastInfosetException, IOException {
+         final int b = read();
+-        switch(DecoderStateTables.NISTRING[b]) {
++        switch(DecoderStateTables.NISTRING(b)) {
+             case DecoderStateTables.NISTRING_UTF8_SMALL_LENGTH:
+                 _addToTable = (b & EncodingConstants.NISTRING_ADD_TO_TABLE_FLAG) > 0;
+                 _octetBufferLength = (b & EncodingConstants.OCTET_STRING_LENGTH_5TH_BIT_SMALL_MASK) + 1;
+@@ -805,9 +808,9 @@
+                 _identifier = (b & 0x0F) << 4;
+                 final int b2 = read();
+                 _identifier |= (b2 & 0xF0) >> 4;
+-                
++
+                 decodeOctetsOnFifthBitOfNonIdentifyingStringOnFirstBit(b2);
+-                
++
+                 decodeRestrictedAlphabetAsCharBuffer();
+                 return NISTRING_STRING;
+             }
+@@ -818,7 +821,7 @@
+                 _identifier = (b & 0x0F) << 4;
+                 final int b2 = read();
+                 _identifier |= (b2 & 0xF0) >> 4;
+-                
++
+                 decodeOctetsOnFifthBitOfNonIdentifyingStringOnFirstBit(b2);
+                 return NISTRING_ENCODING_ALGORITHM;
+             }
+@@ -839,12 +842,12 @@
+                 throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.decodingNonIdentifyingString"));
+         }
+     }
+-    
++
+     protected final void decodeOctetsOnFifthBitOfNonIdentifyingStringOnFirstBit(int b) throws FastInfosetException, IOException {
+         // Remove top 4 bits of restricted alphabet or encoding algorithm integer
+         b &= 0x0F;
+         // Reuse UTF8 length states
+-        switch(DecoderStateTables.NISTRING[b]) {
++        switch(DecoderStateTables.NISTRING(b)) {
+             case DecoderStateTables.NISTRING_UTF8_SMALL_LENGTH:
+                 _octetBufferLength = b + 1;
+                 break;
+@@ -865,7 +868,7 @@
+         _octetBufferStart = _octetBufferOffset;
+         _octetBufferOffset += _octetBufferLength;
+     }
+-    
++
+     protected final void decodeOctetsOnSeventhBitOfNonIdentifyingStringOnThirdBit(int b) throws FastInfosetException, IOException {
+         // Remove top 6 bits of restricted alphabet or encoding algorithm integer
+         switch (b & 0x03) {
+@@ -890,18 +893,18 @@
+                 _octetBufferLength += EncodingConstants.OCTET_STRING_LENGTH_7TH_BIT_MEDIUM_LIMIT;
+                 break;
+         }
+-        
++
+         ensureOctetBufferSize();
+         _octetBufferStart = _octetBufferOffset;
+         _octetBufferOffset += _octetBufferLength;
+     }
+-    
++
+     /*
+      * C.13
+      */
+     protected final String decodeIdentifyingNonEmptyStringOnFirstBit(StringArray table) throws FastInfosetException, IOException {
+         final int b = read();
+-        switch(DecoderStateTables.ISTRING[b]) {
++        switch(DecoderStateTables.ISTRING(b)) {
+             case DecoderStateTables.ISTRING_SMALL_LENGTH:
+             {
+                 _octetBufferLength = b + 1;
+@@ -942,26 +945,26 @@
+                 throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.decodingIdentifyingString"));
+         }
+     }
+-    
++
+     protected int _prefixIndex;
+-    
++
+     /*
+      * C.13
+      */
+     protected final String decodeIdentifyingNonEmptyStringOnFirstBitAsPrefix(boolean namespaceNamePresent) throws FastInfosetException, IOException {
+         final int b = read();
+-        switch(DecoderStateTables.ISTRING_PREFIX_NAMESPACE[b]) {
++        switch(DecoderStateTables.ISTRING_PREFIX_NAMESPACE(b)) {
+             case DecoderStateTables.ISTRING_PREFIX_NAMESPACE_LENGTH_3:
+             {
+                 _octetBufferLength = EncodingConstants.XML_NAMESPACE_PREFIX_LENGTH;
+                 decodeUtf8StringAsCharBuffer();
+-                
++
+                 if (_charBuffer[0] == 'x' &&
+                         _charBuffer[1] == 'm' &&
+                         _charBuffer[2] == 'l') {
+                     throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.prefixIllegal"));
+                 }
+-                
++
+                 final String s = (_stringInterning) ? new String(_charBuffer, 0, _charBufferLength).intern() :
+                     new String(_charBuffer, 0, _charBufferLength);
+                 _prefixIndex = _v.prefix.add(s);
+@@ -971,7 +974,7 @@
+             {
+                 _octetBufferLength = EncodingConstants.XMLNS_NAMESPACE_PREFIX_LENGTH;
+                 decodeUtf8StringAsCharBuffer();
+-                
++
+                 if (_charBuffer[0] == 'x' &&
+                         _charBuffer[1] == 'm' &&
+                         _charBuffer[2] == 'l' &&
+@@ -979,7 +982,7 @@
+                         _charBuffer[4] == 's') {
+                     throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.xmlns"));
+                 }
+-                
++
+                 final String s = (_stringInterning) ? new String(_charBuffer, 0, _charBufferLength).intern() :
+                     new String(_charBuffer, 0, _charBufferLength);
+                 _prefixIndex = _v.prefix.add(s);
+@@ -1016,7 +1019,7 @@
+                 if (namespaceNamePresent) {
+                     _prefixIndex = 0;
+                     // Peak at next byte and check the index of the XML namespace name
+-                    if (DecoderStateTables.ISTRING_PREFIX_NAMESPACE[peek()]
++                    if (DecoderStateTables.ISTRING_PREFIX_NAMESPACE(peek())
+                             != DecoderStateTables.ISTRING_PREFIX_NAMESPACE_INDEX_ZERO) {
+                         throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.wrongNamespaceName"));
+                     }
+@@ -1039,18 +1042,18 @@
+                 throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.decodingIdentifyingStringForPrefix"));
+         }
+     }
+-    
++
+     /*
+      * C.13
+      */
+     protected final String decodeIdentifyingNonEmptyStringIndexOnFirstBitAsPrefix(boolean namespaceNamePresent) throws FastInfosetException, IOException {
+         final int b = read();
+-        switch(DecoderStateTables.ISTRING_PREFIX_NAMESPACE[b]) {
++        switch(DecoderStateTables.ISTRING_PREFIX_NAMESPACE(b)) {
+             case DecoderStateTables.ISTRING_PREFIX_NAMESPACE_INDEX_ZERO:
+                 if (namespaceNamePresent) {
+                     _prefixIndex = 0;
+                     // Peak at next byte and check the index of the XML namespace name
+-                    if (DecoderStateTables.ISTRING_PREFIX_NAMESPACE[peek()]
++                    if (DecoderStateTables.ISTRING_PREFIX_NAMESPACE(peek())
+                             != DecoderStateTables.ISTRING_PREFIX_NAMESPACE_INDEX_ZERO) {
+                         throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.wrongNamespaceName"));
+                     }
+@@ -1073,15 +1076,15 @@
+                 throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.decodingIdentifyingStringForPrefix"));
+         }
+     }
+-    
++
+     protected int _namespaceNameIndex;
+-    
++
+     /*
+      * C.13
+      */
+     protected final String decodeIdentifyingNonEmptyStringOnFirstBitAsNamespaceName(boolean prefixPresent) throws FastInfosetException, IOException {
+         final int b = read();
+-        switch(DecoderStateTables.ISTRING_PREFIX_NAMESPACE[b]) {
++        switch(DecoderStateTables.ISTRING_PREFIX_NAMESPACE(b)) {
+             case DecoderStateTables.ISTRING_PREFIX_NAMESPACE_LENGTH_3:
+             case DecoderStateTables.ISTRING_PREFIX_NAMESPACE_LENGTH_5:
+             case DecoderStateTables.ISTRING_SMALL_LENGTH:
+@@ -1095,11 +1098,11 @@
+             {
+                 _octetBufferLength = EncodingConstants.XMLNS_NAMESPACE_NAME_LENGTH;
+                 decodeUtf8StringAsCharBuffer();
+-                
++
+                 if (compareCharsWithCharBufferFromEndToStart(XMLNS_NAMESPACE_NAME_CHARS)) {
+                     throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.xmlnsConnotBeBoundToPrefix"));
+                 }
+-                
++
+                 final String s = (_stringInterning) ? new String(_charBuffer, 0, _charBufferLength).intern() :
+                     new String(_charBuffer, 0, _charBufferLength);
+                 _namespaceNameIndex = _v.namespaceName.add(s);
+@@ -1109,11 +1112,11 @@
+             {
+                 _octetBufferLength = EncodingConstants.XML_NAMESPACE_NAME_LENGTH;
+                 decodeUtf8StringAsCharBuffer();
+-                
++
+                 if (compareCharsWithCharBufferFromEndToStart(XML_NAMESPACE_NAME_CHARS)) {
+                     throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.illegalNamespaceName"));
+                 }
+-                
++
+                 final String s = (_stringInterning) ? new String(_charBuffer, 0, _charBufferLength).intern() :
+                     new String(_charBuffer, 0, _charBufferLength);
+                 _namespaceNameIndex = _v.namespaceName.add(s);
+@@ -1159,13 +1162,13 @@
+                 throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.decodingForNamespaceName"));
+         }
+     }
+-    
++
+     /*
+      * C.13
+      */
+     protected final String decodeIdentifyingNonEmptyStringIndexOnFirstBitAsNamespaceName(boolean prefixPresent) throws FastInfosetException, IOException {
+         final int b = read();
+-        switch(DecoderStateTables.ISTRING_PREFIX_NAMESPACE[b]) {
++        switch(DecoderStateTables.ISTRING_PREFIX_NAMESPACE(b)) {
+             case DecoderStateTables.ISTRING_PREFIX_NAMESPACE_INDEX_ZERO:
+                 if (prefixPresent) {
+                     _namespaceNameIndex = 0;
+@@ -1188,7 +1191,7 @@
+                 throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.decodingForNamespaceName"));
+         }
+     }
+-    
++
+     private boolean compareCharsWithCharBufferFromEndToStart(char[] c) {
+         int i = _charBufferLength ;
+         while (--i >= 0) {
+@@ -1198,7 +1201,7 @@
+         }
+         return true;
+     }
+-    
++
+     /*
+      * C.22
+      */
+@@ -1206,7 +1209,7 @@
+         decodeNonEmptyOctetStringOnSecondBitAsUtf8CharArray();
+         return new String(_charBuffer, 0, _charBufferLength);
+     }
+-    
++
+     /*
+      * C.22
+      */
+@@ -1214,13 +1217,13 @@
+         decodeNonEmptyOctetStringLengthOnSecondBit();
+         decodeUtf8StringAsCharBuffer();
+     }
+-    
++
+     /*
+      * C.22
+      */
+     protected final void decodeNonEmptyOctetStringLengthOnSecondBit() throws FastInfosetException, IOException {
+         final int b = read();
+-        switch(DecoderStateTables.ISTRING[b]) {
++        switch(DecoderStateTables.ISTRING(b)) {
+             case DecoderStateTables.ISTRING_SMALL_LENGTH:
+                 _octetBufferLength = b + 1;
+                 break;
+@@ -1243,13 +1246,13 @@
+                 throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.decodingNonEmptyOctet"));
+         }
+     }
+-    
++
+     /*
+      * C.25
+      */
+     protected final int decodeIntegerIndexOnSecondBit() throws FastInfosetException, IOException {
+         final int b = read();
+-        switch(DecoderStateTables.ISTRING[b]) {
++        switch(DecoderStateTables.ISTRING(b)) {
+             case DecoderStateTables.ISTRING_INDEX_SMALL:
+                 return b & EncodingConstants.INTEGER_2ND_BIT_SMALL_MASK;
+             case DecoderStateTables.ISTRING_INDEX_MEDIUM:
+@@ -1265,13 +1268,13 @@
+                 throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.decodingIndexOnSecondBit"));
+         }
+     }
+-    
++
+     protected final void decodeHeader() throws FastInfosetException, IOException {
+         if (!_isFastInfosetDocument()) {
+             throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.notFIDocument"));
+         }
+     }
+-    
++
+     protected final void decodeRestrictedAlphabetAsCharBuffer() throws FastInfosetException, IOException {
+         if (_identifier <= EncodingConstants.RESTRICTED_ALPHABET_BUILTIN_END) {
+             decodeFourBitAlphabetOctetsAsCharBuffer(BuiltInRestrictedAlphabets.table[_identifier]);
+@@ -1289,17 +1292,17 @@
+             throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.alphabetIdentifiersReserved"));
+         }
+     }
+-    
++
+     protected final String decodeRestrictedAlphabetAsString() throws FastInfosetException, IOException {
+         decodeRestrictedAlphabetAsCharBuffer();
+         return new String(_charBuffer, 0, _charBufferLength);
+     }
+-    
++
+     protected final String decodeRAOctetsAsString(char[] restrictedAlphabet) throws FastInfosetException, IOException {
+         decodeAlphabetOctetsAsCharBuffer(restrictedAlphabet);
+         return new String(_charBuffer, 0, _charBufferLength);
+     }
+-    
++
+     protected final void decodeFourBitAlphabetOctetsAsCharBuffer(char[] restrictedAlphabet) throws FastInfosetException, IOException {
+         _charBufferLength = 0;
+         final int characters = _octetBufferLength * 2;
+@@ -1306,7 +1309,7 @@
+         if (_charBuffer.length < characters) {
+             _charBuffer = new char[characters];
+         }
+-        
++
+         int v = 0;
+         for (int i = 0; i < _octetBufferLength - 1; i++) {
+             v = _octetBuffer[_octetBufferStart++] & 0xFF;
+@@ -1320,28 +1323,28 @@
+             _charBuffer[_charBufferLength++] = restrictedAlphabet[v & 0x0F];
+         }
+     }
+-    
++
+     protected final void decodeAlphabetOctetsAsCharBuffer(char[] restrictedAlphabet) throws FastInfosetException, IOException {
+         if (restrictedAlphabet.length < 2) {
+             throw new IllegalArgumentException(CommonResourceBundle.getInstance().getString("message.alphabetMustContain2orMoreChars"));
+         }
+-        
++
+         int bitsPerCharacter = 1;
+         while ((1 << bitsPerCharacter) <= restrictedAlphabet.length) {
+             bitsPerCharacter++;
+         }
+         final int terminatingValue = (1 << bitsPerCharacter) - 1;
+-        
++
+         int characters = (_octetBufferLength << 3) / bitsPerCharacter;
+         if (characters == 0) {
+             throw new IOException("");
+         }
+-        
++
+         _charBufferLength = 0;
+         if (_charBuffer.length < characters) {
+             _charBuffer = new char[characters];
+         }
+-        
++
+         resetBits();
+         for (int i = 0; i < characters; i++) {
+             int value = readBits(bitsPerCharacter);
+@@ -1355,13 +1358,13 @@
+             _charBuffer[_charBufferLength++] = restrictedAlphabet[value];
+         }
+     }
+-    
++
+     private int _bitsLeftInOctet;
+-    
++
+     private void resetBits() {
+         _bitsLeftInOctet = 0;
+     }
+-    
++
+     private int readBits(int bits) throws IOException {
+         int value = 0;
+         while (bits > 0) {
+@@ -1372,39 +1375,39 @@
+             int bit = ((_b & (1 << --_bitsLeftInOctet)) > 0) ? 1 : 0;
+             value |= (bit << --bits);
+         }
+-        
++
+         return value;
+     }
+-    
++
+     protected final void decodeUtf8StringAsCharBuffer() throws IOException {
+         ensureOctetBufferSize();
+         decodeUtf8StringIntoCharBuffer();
+     }
+-    
++
+     protected final void decodeUtf8StringAsCharBuffer(char[] ch, int offset) throws IOException {
+         ensureOctetBufferSize();
+         decodeUtf8StringIntoCharBuffer(ch, offset);
+     }
+-    
++
+     protected final String decodeUtf8StringAsString() throws IOException {
+         decodeUtf8StringAsCharBuffer();
+         return new String(_charBuffer, 0, _charBufferLength);
+     }
+-    
++
+     protected final void decodeUtf16StringAsCharBuffer() throws IOException {
+         ensureOctetBufferSize();
+         decodeUtf16StringIntoCharBuffer();
+     }
+-    
++
+     protected final String decodeUtf16StringAsString() throws IOException {
+         decodeUtf16StringAsCharBuffer();
+         return new String(_charBuffer, 0, _charBufferLength);
+     }
+-    
++
+     private void ensureOctetBufferSize() throws IOException {
+         if (_octetBufferEnd < (_octetBufferOffset + _octetBufferLength)) {
+             final int octetsInBuffer = _octetBufferEnd - _octetBufferOffset;
+-            
++
+             if (_octetBuffer.length < _octetBufferLength) {
+                 // Length to read is too large, resize the buffer
+                 byte[] newOctetBuffer = new byte[_octetBufferLength];
+@@ -1416,7 +1419,7 @@
+                 System.arraycopy(_octetBuffer, _octetBufferOffset, _octetBuffer, 0, octetsInBuffer);
+             }
+             _octetBufferOffset = 0;
+-            
++
+             // Read as many octets as possible to fill the buffer
+             final int octetsRead = _s.read(_octetBuffer, octetsInBuffer, _octetBuffer.length - octetsInBuffer);
+             if (octetsRead < 0) {
+@@ -1423,7 +1426,7 @@
+                 throw new EOFException("Unexpeceted EOF");
+             }
+             _octetBufferEnd = octetsInBuffer + octetsRead;
+-            
++
+             // Check if the number of octets that have been read is not enough
+             // This can happen when underlying non-blocking is used to read
+             if (_octetBufferEnd < _octetBufferLength) {
+@@ -1431,7 +1434,7 @@
+             }
+         }
+     }
+-    
++
+     private void repeatedRead() throws IOException {
+         // Check if the number of octets that have been read is not enough
+         while (_octetBufferEnd < _octetBufferLength) {
+@@ -1443,18 +1446,18 @@
+             _octetBufferEnd += octetsRead;
+         }
+     }
+-    
++
+     protected final void decodeUtf8StringIntoCharBuffer() throws IOException {
+         if (_charBuffer.length < _octetBufferLength) {
+             _charBuffer = new char[_octetBufferLength];
+         }
+-        
++
+         _charBufferLength = 0;
+         final int end = _octetBufferLength + _octetBufferOffset;
+         int b1;
+         while (end != _octetBufferOffset) {
+             b1 = _octetBuffer[_octetBufferOffset++] & 0xFF;
+-            if (DecoderStateTables.UTF8[b1] == DecoderStateTables.UTF8_ONE_BYTE) {
++            if (DecoderStateTables.UTF8(b1) == DecoderStateTables.UTF8_ONE_BYTE) {
+                 _charBuffer[_charBufferLength++] = (char) b1;
+             } else {
+                 decodeTwoToFourByteUtf8Character(b1, end);
+@@ -1461,7 +1464,7 @@
+             }
+         }
+     }
+-    
++
+     protected final void decodeUtf8StringIntoCharBuffer(char[] ch, int offset) throws IOException {
+         _charBufferLength = offset;
+         final int end = _octetBufferLength + _octetBufferOffset;
+@@ -1468,7 +1471,7 @@
+         int b1;
+         while (end != _octetBufferOffset) {
+             b1 = _octetBuffer[_octetBufferOffset++] & 0xFF;
+-            if (DecoderStateTables.UTF8[b1] == DecoderStateTables.UTF8_ONE_BYTE) {
++            if (DecoderStateTables.UTF8(b1) == DecoderStateTables.UTF8_ONE_BYTE) {
+                 ch[_charBufferLength++] = (char) b1;
+             } else {
+                 decodeTwoToFourByteUtf8Character(ch, b1, end);
+@@ -1476,9 +1479,9 @@
+         }
+         _charBufferLength -= offset;
+     }
+-    
++
+     private void decodeTwoToFourByteUtf8Character(int b1, int end) throws IOException {
+-        switch(DecoderStateTables.UTF8[b1]) {
++        switch(DecoderStateTables.UTF8(b1)) {
+             case DecoderStateTables.UTF8_TWO_BYTES:
+             {
+                 // Decode byte 2
+@@ -1489,7 +1492,7 @@
+                 if ((b2 & 0xC0) != 0x80) {
+                     decodeUtf8StringIllegalState();
+                 }
+-                
++
+                 // Character guaranteed to be in [0x20, 0xD7FF] range
+                 // since a character encoded in two bytes will be in the
+                 // range [0x80, 0x1FFF]
+@@ -1521,9 +1524,9 @@
+                 decodeUtf8StringIllegalState();
+         }
+     }
+-    
++
+     private void decodeTwoToFourByteUtf8Character(char ch[], int b1, int end) throws IOException {
+-        switch(DecoderStateTables.UTF8[b1]) {
++        switch(DecoderStateTables.UTF8(b1)) {
+             case DecoderStateTables.UTF8_TWO_BYTES:
+             {
+                 // Decode byte 2
+@@ -1534,7 +1537,7 @@
+                 if ((b2 & 0xC0) != 0x80) {
+                     decodeUtf8StringIllegalState();
+                 }
+-                
++
+                 // Character guaranteed to be in [0x20, 0xD7FF] range
+                 // since a character encoded in two bytes will be in the
+                 // range [0x80, 0x1FFF]
+@@ -1566,25 +1569,25 @@
+                 decodeUtf8StringIllegalState();
+         }
+     }
+-    
++
+     protected final void decodeUtf8NCNameIntoCharBuffer() throws IOException {
+         _charBufferLength = 0;
+         if (_charBuffer.length < _octetBufferLength) {
+             _charBuffer = new char[_octetBufferLength];
+         }
+-        
++
+         final int end = _octetBufferLength + _octetBufferOffset;
+-        
++
+         int b1 = _octetBuffer[_octetBufferOffset++] & 0xFF;
+-        if (DecoderStateTables.UTF8_NCNAME[b1] == DecoderStateTables.UTF8_NCNAME_NCNAME) {
++        if (DecoderStateTables.UTF8_NCNAME(b1) == DecoderStateTables.UTF8_NCNAME_NCNAME) {
+             _charBuffer[_charBufferLength++] = (char) b1;
+         } else {
+             decodeUtf8NCNameStartTwoToFourByteCharacters(b1, end);
+         }
+-        
++
+         while (end != _octetBufferOffset) {
+             b1 = _octetBuffer[_octetBufferOffset++] & 0xFF;
+-            if (DecoderStateTables.UTF8_NCNAME[b1] < DecoderStateTables.UTF8_TWO_BYTES) {
++            if (DecoderStateTables.UTF8_NCNAME(b1) < DecoderStateTables.UTF8_TWO_BYTES) {
+                 _charBuffer[_charBufferLength++] = (char) b1;
+             } else {
+                 decodeUtf8NCNameTwoToFourByteCharacters(b1, end);
+@@ -1591,9 +1594,9 @@
+             }
+         }
+     }
+-    
++
+     private void decodeUtf8NCNameStartTwoToFourByteCharacters(int b1, int end) throws IOException {
+-        switch(DecoderStateTables.UTF8_NCNAME[b1]) {
++        switch(DecoderStateTables.UTF8_NCNAME(b1)) {
+             case DecoderStateTables.UTF8_TWO_BYTES:
+             {
+                 // Decode byte 2
+@@ -1604,7 +1607,7 @@
+                 if ((b2 & 0xC0) != 0x80) {
+                     decodeUtf8StringIllegalState();
+                 }
+-                
++
+                 final char c = (char) (
+                         ((b1 & 0x1F) << 6)
+                         | (b2 & 0x3F));
+@@ -1638,11 +1641,11 @@
+             default:
+                 decodeUtf8NCNameIllegalState();
+         }
+-        
++
+     }
+-    
++
+     private void decodeUtf8NCNameTwoToFourByteCharacters(int b1, int end) throws IOException {
+-        switch(DecoderStateTables.UTF8_NCNAME[b1]) {
++        switch(DecoderStateTables.UTF8_NCNAME(b1)) {
+             case DecoderStateTables.UTF8_TWO_BYTES:
+             {
+                 // Decode byte 2
+@@ -1653,7 +1656,7 @@
+                 if ((b2 & 0xC0) != 0x80) {
+                     decodeUtf8StringIllegalState();
+                 }
+-                
++
+                 final char c = (char) (
+                         ((b1 & 0x1F) << 6)
+                         | (b2 & 0x3F));
+@@ -1687,7 +1690,7 @@
+                 decodeUtf8NCNameIllegalState();
+         }
+     }
+-    
++
+     private char decodeUtf8ThreeByteChar(int end, int b1) throws IOException {
+         // Decode byte 2
+         if (end == _octetBufferOffset) {
+@@ -1699,7 +1702,7 @@
+                 || ((b1 & 0x0F) == 0 && (b2 & 0x20) == 0)) {
+             decodeUtf8StringIllegalState();
+         }
+-        
++
+         // Decode byte 3
+         if (end == _octetBufferOffset) {
+             decodeUtf8StringLengthTooSmall();
+@@ -1708,16 +1711,16 @@
+         if ((b3 & 0xC0) != 0x80) {
+             decodeUtf8StringIllegalState();
+         }
+-        
++
+         return (char) (
+                 (b1 & 0x0F) << 12
+                 | (b2 & 0x3F) << 6
+                 | (b3 & 0x3F));
+     }
+-    
++
+     private char _utf8_highSurrogate;
+     private char _utf8_lowSurrogate;
+-    
++
+     private int decodeUtf8FourByteChar(int end, int b1) throws IOException {
+         // Decode byte 2
+         if (end == _octetBufferOffset) {
+@@ -1728,7 +1731,7 @@
+                 || ((b2 & 0x30) == 0 && (b1 & 0x07) == 0)) {
+             decodeUtf8StringIllegalState();
+         }
+-        
++
+         // Decode byte 3
+         if (end == _octetBufferOffset) {
+             decodeUtf8StringLengthTooSmall();
+@@ -1737,7 +1740,7 @@
+         if ((b3 & 0xC0) != 0x80) {
+             decodeUtf8StringIllegalState();
+         }
+-        
++
+         // Decode byte 4
+         if (end == _octetBufferOffset) {
+             decodeUtf8StringLengthTooSmall();
+@@ -1746,47 +1749,51 @@
+         if ((b4 & 0xC0) != 0x80) {
+             decodeUtf8StringIllegalState();
+         }
+-        
++
+         final int uuuuu = ((b1 << 2) & 0x001C) | ((b2 >> 4) & 0x0003);
+         if (uuuuu > 0x10) {
+             decodeUtf8StringIllegalState();
+         }
+         final int wwww = uuuuu - 1;
+-        
++
+         _utf8_highSurrogate = (char) (0xD800 |
+                 ((wwww << 6) & 0x03C0) | ((b2 << 2) & 0x003C) |
+                 ((b3 >> 4) & 0x0003));
+         _utf8_lowSurrogate = (char) (0xDC00 | ((b3 << 6) & 0x03C0) | (b4 & 0x003F));
+-        
++
+         return XMLChar.supplemental(_utf8_highSurrogate, _utf8_lowSurrogate);
+     }
+-    
++
+     private void decodeUtf8StringLengthTooSmall() throws IOException {
+         throw new IOException(CommonResourceBundle.getInstance().getString("message.deliminatorTooSmall"));
+     }
+-    
++
+     private void decodeUtf8StringIllegalState() throws IOException {
+         throw new IOException(CommonResourceBundle.getInstance().getString("message.UTF8Encoded"));
+     }
+-    
++
+     private void decodeUtf8NCNameIllegalState() throws IOException {
+         throw new IOException(CommonResourceBundle.getInstance().getString("message.UTF8EncodedNCName"));
+     }
+-    
++
+     private void decodeUtf16StringIntoCharBuffer() throws IOException {
+         _charBufferLength = _octetBufferLength / 2;
+         if (_charBuffer.length < _charBufferLength) {
+             _charBuffer = new char[_charBufferLength];
+         }
+-        
++
+         for (int i = 0; i < _charBufferLength; i++) {
+             final char c = (char)((read() << 8) | read());
+             // TODO check c is a valid Char character
+             _charBuffer[i] = c;
+         }
+-        
++
+     }
+-    
++
++    protected String createQualifiedNameString(String second) {
++        return createQualifiedNameString(XMLNS_NAMESPACE_PREFIX_CHARS, second);
++    }
++
+     protected String createQualifiedNameString(char[] first, String second) {
+         final int l1 = first.length;
+         final int l2 = second.length();
+@@ -1803,7 +1810,7 @@
+             return b.toString();
+         }
+     }
+-    
++
+     protected final int read() throws IOException {
+         if (_octetBufferOffset < _octetBufferEnd) {
+             return _octetBuffer[_octetBufferOffset++] & 0xFF;
+@@ -1812,22 +1819,22 @@
+             if (_octetBufferEnd < 0) {
+                 throw new EOFException(CommonResourceBundle.getInstance().getString("message.EOF"));
+             }
+-            
++
+             _octetBufferOffset = 1;
+             return _octetBuffer[0] & 0xFF;
+         }
+     }
+-    
++
+     protected final void closeIfRequired() throws IOException {
+         if (_s != null && _needForceStreamClose) {
+             _s.close();
+         }
+     }
+-    
++
+     protected final int peek() throws IOException {
+         return peek(null);
+     }
+-    
++
+     protected final int peek(OctetBufferListener octetBufferListener) throws IOException {
+         if (_octetBufferOffset < _octetBufferEnd) {
+             return _octetBuffer[_octetBufferOffset] & 0xFF;
+@@ -1835,17 +1842,17 @@
+             if (octetBufferListener != null) {
+                 octetBufferListener.onBeforeOctetBufferOverwrite();
+             }
+-            
++
+             _octetBufferEnd = _s.read(_octetBuffer);
+             if (_octetBufferEnd < 0) {
+                 throw new EOFException(CommonResourceBundle.getInstance().getString("message.EOF"));
+             }
+-            
++
+             _octetBufferOffset = 0;
+             return _octetBuffer[0] & 0xFF;
+         }
+     }
+-    
++
+     protected final int peek2(OctetBufferListener octetBufferListener) throws IOException {
+         if (_octetBufferOffset + 1 < _octetBufferEnd) {
+             return _octetBuffer[_octetBufferOffset + 1] & 0xFF;
+@@ -1853,7 +1860,7 @@
+             if (octetBufferListener != null) {
+                 octetBufferListener.onBeforeOctetBufferOverwrite();
+             }
+-            
++
+             int offset = 0;
+             if (_octetBufferOffset < _octetBufferEnd) {
+                 _octetBuffer[0] = _octetBuffer[_octetBufferOffset];
+@@ -1860,18 +1867,18 @@
+                 offset = 1;
+             }
+             _octetBufferEnd = _s.read(_octetBuffer, offset, _octetBuffer.length - offset);
+-            
++
+             if (_octetBufferEnd < 0) {
+                 throw new EOFException(CommonResourceBundle.getInstance().getString("message.EOF"));
+             }
+-            
++
+             _octetBufferOffset = 0;
+             return _octetBuffer[1] & 0xFF;
+         }
+     }
+-    
++
+     protected class EncodingAlgorithmInputStream extends InputStream {
+-        
++
+         public int read() throws IOException {
+             if (_octetBufferStart < _octetBufferOffset) {
+                 return (_octetBuffer[_octetBufferStart++] & 0xFF);
+@@ -1879,11 +1886,13 @@
+                 return -1;
+             }
+         }
+-        
++
++        @Override
+         public int read(byte b[]) throws IOException {
+             return read(b, 0, b.length);
+         }
+-        
++
++        @Override
+         public int read(byte b[], int off, int len) throws IOException {
+             if (b == null) {
+                 throw new NullPointerException();
+@@ -1893,7 +1902,7 @@
+             } else if (len == 0) {
+                 return 0;
+             }
+-            
++
+             final int newOctetBufferStart = _octetBufferStart + len;
+             if (newOctetBufferStart < _octetBufferOffset) {
+                 System.arraycopy(_octetBuffer, _octetBufferStart, b, off, len);
+@@ -1909,27 +1918,27 @@
+             }
+         }
+     }
+-    
++
+     protected final boolean _isFastInfosetDocument() throws IOException {
+         // Fill up the octet buffer
+         peek();
+-        
++
+         _octetBufferLength = EncodingConstants.BINARY_HEADER.length;
+         ensureOctetBufferSize();
+         _octetBufferOffset += _octetBufferLength;
+-        
++
+         // Check for binary header
+         if (_octetBuffer[0] != EncodingConstants.BINARY_HEADER[0] ||
+                 _octetBuffer[1] != EncodingConstants.BINARY_HEADER[1] ||
+                 _octetBuffer[2] != EncodingConstants.BINARY_HEADER[2] ||
+                 _octetBuffer[3] != EncodingConstants.BINARY_HEADER[3]) {
+-            
++
+             // Check for each form of XML declaration
+             for (int i = 0; i < EncodingConstants.XML_DECLARATION_VALUES.length; i++) {
+                 _octetBufferLength = EncodingConstants.XML_DECLARATION_VALUES[i].length - _octetBufferOffset;
+                 ensureOctetBufferSize();
+                 _octetBufferOffset += _octetBufferLength;
+-                
++
+                 // Check XML declaration
+                 if (arrayEquals(_octetBuffer, 0,
+                         EncodingConstants.XML_DECLARATION_VALUES[i],
+@@ -1936,7 +1945,7 @@
+                         EncodingConstants.XML_DECLARATION_VALUES[i].length)) {
+                     _octetBufferLength = EncodingConstants.BINARY_HEADER.length;
+                     ensureOctetBufferSize();
+-                    
++
+                     // Check for binary header
+                     if (_octetBuffer[_octetBufferOffset++] != EncodingConstants.BINARY_HEADER[0] ||
+                             _octetBuffer[_octetBufferOffset++] != EncodingConstants.BINARY_HEADER[1] ||
+@@ -1949,14 +1958,14 @@
+                     }
+                 }
+             }
+-            
++
+             return false;
+         }
+-        
++
+         // Fast Infoset document with binary header
+         return true;
+     }
+-    
++
+     private boolean arrayEquals(byte[] b1, int offset, byte[] b2, int length) {
+         for (int i = 0; i < length; i++) {
+             if (b1[offset + i] != b2[i]) {
+@@ -1963,14 +1972,14 @@
+                 return false;
+             }
+         }
+-        
++
+         return true;
+     }
+-    
++
+     static public boolean isFastInfosetDocument(InputStream s) throws IOException {
+         // TODO
+         // Check for <?xml declaration with 'finf' encoding
+-        
++
+         final byte[] header = new byte[4];
+         s.read(header);
+         if (header[0] != EncodingConstants.BINARY_HEADER[0] ||
+@@ -1979,7 +1988,7 @@
+                 header[3] != EncodingConstants.BINARY_HEADER[3]) {
+             return false;
+         }
+-        
++
+         // TODO
+         return true;
+     }
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/DecoderStateTables.java	Thu Jul 30 17:59:57 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/DecoderStateTables.java	Thu Jul 30 17:59:57 2009
+@@ -24,9 +24,9 @@
+  *
+  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
+  */
+- 
+ 
+ 
++
+ package com.sun.xml.internal.fastinfoset;
+ 
+ public class DecoderStateTables {
+@@ -54,7 +54,7 @@
+     public final static int CII_INDEX_SMALL                 = 14;
+     public final static int CII_INDEX_MEDIUM                = 15;
+     public final static int CII_INDEX_LARGE                 = 16;
+-    public final static int CII_INDEX_LARGE_LARGE           = 17;    
++    public final static int CII_INDEX_LARGE_LARGE           = 17;
+     public final static int COMMENT_II                      = 18;
+     public final static int PROCESSING_INSTRUCTION_II       = 19;
+     public final static int DOCUMENT_TYPE_DECLARATION_II    = 20;
+@@ -62,9 +62,9 @@
+     public final static int TERMINATOR_SINGLE               = 22;
+     public final static int TERMINATOR_DOUBLE               = 23;
+ 
+-    public static final int[] DII = new int[256];
+-    
+-    private static int[][] DII_RANGES = {
++    private static final int[] DII = new int[256];
++
++    private static final int[][] DII_RANGES = {
+         // EII
+ 
+         // %00000000 to %00011111  EII no attributes small index
+@@ -80,7 +80,7 @@
+ 
+         // %00110001 to %00110111  ILLEGAL
+         { 0x37, STATE_ILLEGAL },
+-        
++
+         // %00111000  EII namespaces
+         { 0x38, EII_NAMESPACES },
+ 
+@@ -104,15 +104,15 @@
+ 
+         // %01100000 to %01100111  EII medium index
+         { 0x67, EII_INDEX_MEDIUM },
+-        
++
+         // %01101000 to %01101111  EII large index
+         // %01110000  EII very large index
+         // %01101000 to %01110000
+         { 0x70, EII_INDEX_LARGE },
+-        
++
+         // %01110001 to %01110111  ILLEGAL
+         { 0x77, STATE_ILLEGAL },
+-        
++
+         // %01111000  EII attributes namespaces
+         { 0x78, EII_NAMESPACES },
+ 
+@@ -130,16 +130,16 @@
+ 
+         // %01111111  EII attributes literal (prefix, namespace)
+         { 0x7F, EII_LITERAL },
+-                                
++
+         // %10000000 to %11000011
+         { 0xC3, STATE_ILLEGAL },
+-                
++
+         // %11000100 to %11000111
+         { 0xC7, DOCUMENT_TYPE_DECLARATION_II },
+-                
++
+         // %11001000 to %1110000
+         { 0xE0, STATE_ILLEGAL },
+-        
++
+         // %11100001 processing instruction
+         { 0xE1, PROCESSING_INSTRUCTION_II },
+ 
+@@ -148,9 +148,9 @@
+ 
+         // %111000011 to %11101111
+         { 0xEF, STATE_ILLEGAL },
+-        
++
+         // Terminators
+-        
++
+         // %11110000  single terminator
+         { 0xF0, TERMINATOR_SINGLE },
+ 
+@@ -160,10 +160,10 @@
+         // %11111111  double terminator
+         { 0xFF, TERMINATOR_DOUBLE }
+     };
+-    
+-    public static final int[] EII = new int[256];
+-    
+-    private static int[][] EII_RANGES = {
++
++    private static final int[] EII = new int[256];
++
++    private static final int[][] EII_RANGES = {
+         // EII
+ 
+         // %00000000 to %00011111  EII no attributes small index
+@@ -179,7 +179,7 @@
+ 
+         // %00110001 to %00110111  ILLEGAL
+         { 0x37, STATE_ILLEGAL },
+-        
++
+         // %00111000  EII namespaces
+         { 0x38, EII_NAMESPACES },
+ 
+@@ -203,15 +203,15 @@
+ 
+         // %01100000 to %01100111  EII medium index
+         { 0x67, EII_INDEX_MEDIUM },
+-        
++
+         // %01101000 to %01101111  EII large index
+         // %01110000  EII very large index
+         // %01101000 to %01110000
+         { 0x70, EII_INDEX_LARGE },
+-        
++
+         // %01110001 to %01110111  ILLEGAL
+         { 0x77, STATE_ILLEGAL },
+-        
++
+         // %01111000  EII attributes namespaces
+         { 0x78, EII_NAMESPACES },
+ 
+@@ -229,11 +229,11 @@
+ 
+         // %01111111  EII attributes literal (prefix, namespace)
+         { 0x7F, EII_LITERAL },
+-        
++
+         // CII
+ 
+         // UTF-8 string
+-                
++
+         // %10000000 to %10000001  CII UTF-8 no add to table small length
+         { 0x81, CII_UTF8_SMALL_LENGTH },
+ 
+@@ -244,7 +244,7 @@
+         { 0x83, CII_UTF8_LARGE_LENGTH },
+ 
+         // UTF-16 string
+-                
++
+         // %10000100 to %10000101  CII UTF-16 no add to table small length
+         { 0x85, CII_UTF16_SMALL_LENGTH },
+ 
+@@ -255,17 +255,17 @@
+         { 0x87, CII_UTF16_LARGE_LENGTH },
+ 
+         // Resitricted alphabet
+-                
++
+         // %10001000 to %10001011  CII RA no add to table
+         { 0x8B, CII_RA },
+ 
+         // Encoding algorithm
+-                
++
+         // %10001100 to %10001111  CII EA no add to table
+         { 0x8F, CII_EA },
+ 
+         // UTF-8 string, add to table
+-                
++
+         // %10010000 to %10010001  CII add to table small length
+         { 0x91, CII_UTF8_SMALL_LENGTH },
+ 
+@@ -274,9 +274,9 @@
+ 
+         // %10010011  CII add to table large length
+         { 0x93, CII_UTF8_LARGE_LENGTH },
+-        
++
+         // UTF-16 string, add to table
+-                
++
+         // %10010100 to %10010101  CII UTF-16 add to table small length
+         { 0x95, CII_UTF16_SMALL_LENGTH },
+ 
+@@ -292,15 +292,15 @@
+         { 0x9B, CII_RA },
+ 
+         // Encoding algorithm, add to table
+-                
++
+         // %10011100 to %10011111  CII EA add to table
+         { 0x9F, CII_EA },
+-        
++
+         // Index
+-                
++
+         // %10100000 to %10101111  CII small index
+         { 0xAF, CII_INDEX_SMALL },
+-        
++
+         // %10110000 to %10110011  CII medium index
+         { 0xB3, CII_INDEX_MEDIUM },
+ 
+@@ -309,16 +309,16 @@
+ 
+         // %10111000  CII very large index
+         { 0xB8, CII_INDEX_LARGE_LARGE },
+-                
++
+         // %10111001 to %11000111  ILLEGAL
+         { 0xC7, STATE_ILLEGAL },
+ 
+         // %11001000 to %11001011
+         { 0xCB, UNEXPANDED_ENTITY_REFERENCE_II },
+-                
++
+         // %11001100 to %11100000  ILLEGAL
+         { 0xE0, STATE_ILLEGAL },
+-        
++
+         // %11100001 processing instruction
+         { 0xE1, PROCESSING_INSTRUCTION_II },
+ 
+@@ -327,9 +327,9 @@
+ 
+         // %111000011 to %11101111
+         { 0xEF, STATE_ILLEGAL },
+-        
++
+         // Terminators
+-        
++
+         // %11110000  single terminator
+         { 0xF0, TERMINATOR_SINGLE },
+ 
+@@ -340,7 +340,7 @@
+         { 0xFF, TERMINATOR_DOUBLE }
+     };
+ 
+-    
++
+     // AII states
+     public final static int AII_INDEX_SMALL                 = 0;
+     public final static int AII_INDEX_MEDIUM                = 1;
+@@ -349,15 +349,15 @@
+     public final static int AII_TERMINATOR_SINGLE           = 4;
+     public final static int AII_TERMINATOR_DOUBLE           = 5;
+ 
+-    public static final int[] AII = new int[256];
++    private static final int[] AII = new int[256];
+ 
+-    private static int[][] AII_RANGES = {
++    private static final int[][] AII_RANGES = {
+         // %00000000 to %00111111  AII small index
+         { 0x3F, AII_INDEX_SMALL },
+ 
+         // %01000000 to %01011111  AII medium index
+         { 0x5F, AII_INDEX_MEDIUM },
+-        
++
+         // %01100000 to %01101111  AII large index
+         { 0x6F, AII_INDEX_LARGE },
+ 
+@@ -367,18 +367,18 @@
+         // %01111000  AII literal (no prefix, no namespace)
+         // %01111001  AII literal (no prefix, namespace)
+         { 0x79, AII_LITERAL },
+-        
++
+         // %01111010  ILLEGAL
+         { 0x7A, STATE_ILLEGAL },
+-        
++
+         // %01111011  AII literal (prefix, namespace)
+         { 0x7B, AII_LITERAL },
+-        
++
+         // %10000000 to %11101111  ILLEGAL
+         { 0xEF, STATE_ILLEGAL },
+ 
+         // Terminators
+-        
++
+         // %11110000  single terminator
+         { 0xF0, AII_TERMINATOR_SINGLE },
+ 
+@@ -388,8 +388,8 @@
+         // %11111111  double terminator
+         { 0xFF, AII_TERMINATOR_DOUBLE }
+     };
+-    
+-    
++
++
+     // AII value states
+     public final static int NISTRING_UTF8_SMALL_LENGTH     = 0;
+     public final static int NISTRING_UTF8_MEDIUM_LENGTH    = 1;
+@@ -404,45 +404,45 @@
+     public final static int NISTRING_INDEX_LARGE           = 10;
+     public final static int NISTRING_EMPTY                 = 11;
+ 
+-    public static final int[] NISTRING = new int[256];
++    private static final int[] NISTRING = new int[256];
+ 
+-    private static int[][] NISTRING_RANGES = {
++    private static final int[][] NISTRING_RANGES = {
+         // UTF-8 string
+-        
++
+         // %00000000 to %00000111  UTF-8 no add to table small length
+         { 0x07, NISTRING_UTF8_SMALL_LENGTH },
+-        
++
+         // %00001000  UTF-8 no add to table medium length
+         { 0x08, NISTRING_UTF8_MEDIUM_LENGTH },
+ 
+         // %00001001 to %00001011 ILLEGAL
+         { 0x0B, STATE_ILLEGAL },
+-        
++
+         // %00001100  UTF-8 no add to table large length
+         { 0x0C, NISTRING_UTF8_LARGE_LENGTH },
+-        
++
+         // %00001101 to %00001111 ILLEGAL
+         { 0x0F, STATE_ILLEGAL },
+-        
++
+         // UTF-16 string
+ 
+         // %00010000 to %00010111  UTF-16 no add to table small length
+         { 0x17, NISTRING_UTF16_SMALL_LENGTH },
+-        
++
+         // %00001000  UTF-16 no add to table medium length
+         { 0x18, NISTRING_UTF16_MEDIUM_LENGTH },
+ 
+         // %00011001 to %00011011 ILLEGAL
+         { 0x1B, STATE_ILLEGAL },
+-        
++
+         // %00011100  UTF-16 no add to table large length
+         { 0x1C, NISTRING_UTF16_LARGE_LENGTH },
+-        
++
+         // %00011101 to %00011111 ILLEGAL
+         { 0x1F, STATE_ILLEGAL },
+-        
++
+         // Restricted alphabet
+-                
++
+         // %00100000 to %00101111  RA no add to table small length
+         { 0x2F, NISTRING_RA },
+ 
+@@ -449,44 +449,44 @@
+         // Encoding algorithm
+ 
+         // %00110000 to %00111111  EA no add to table
+-        { 0x3F, NISTRING_EA },        
++        { 0x3F, NISTRING_EA },
+ 
+         // UTF-8 string, add to table
+-        
++
+         // %01000000 to %01000111  UTF-8 add to table small length
+         { 0x47, NISTRING_UTF8_SMALL_LENGTH },
+-        
++
+         // %01001000  UTF-8 add to table medium length
+         { 0x48, NISTRING_UTF8_MEDIUM_LENGTH },
+ 
+         // %01001001 to %01001011 ILLEGAL
+         { 0x4B, STATE_ILLEGAL },
+-        
++
+         // %01001100  UTF-8 add to table large length
+         { 0x4C, NISTRING_UTF8_LARGE_LENGTH },
+-        
++
+         // %01001101 to %01001111 ILLEGAL
+         { 0x4F, STATE_ILLEGAL },
+-        
++
+         // UTF-16 string, add to table
+ 
+         // %01010000 to %01010111  UTF-16 add to table small length
+         { 0x57, NISTRING_UTF16_SMALL_LENGTH },
+-        
++
+         // %01001000  UTF-16 add to table medium length
+         { 0x58, NISTRING_UTF16_MEDIUM_LENGTH },
+ 
+         // %01011001 to %01011011 ILLEGAL
+         { 0x5B, STATE_ILLEGAL },
+-        
++
+         // %01011100  UTF-16 add to table large length
+         { 0x5C, NISTRING_UTF16_LARGE_LENGTH },
+-        
++
+         // %01011101 to %01011111 ILLEGAL
+         { 0x5F, STATE_ILLEGAL },
+-        
++
+         // Restricted alphabet, add to table
+-        
++
+         // %01100000 to %01101111  RA no add to table small length
+         { 0x6F, NISTRING_RA },
+ 
+@@ -494,7 +494,7 @@
+ 
+         // %01110000 to %01111111  EA add to table
+         { 0x7F, NISTRING_EA },
+-                        
++
+         // Index
+ 
+         // %10000000 to %10111111 index small
+@@ -513,7 +513,7 @@
+         { 0xFF, NISTRING_EMPTY },
+     };
+ 
+-    
++
+     /* package */ final static int ISTRING_SMALL_LENGTH        = 0;
+     /* package */ final static int ISTRING_MEDIUM_LENGTH       = 1;
+     /* package */ final static int ISTRING_LARGE_LENGTH        = 2;
+@@ -521,9 +521,9 @@
+     /* package */ final static int ISTRING_INDEX_MEDIUM        = 4;
+     /* package */ final static int ISTRING_INDEX_LARGE         = 5;
+ 
+-    /* package */ static final int[] ISTRING = new int[256];
+-    
+-    private static int[][] ISTRING_RANGES = {
++    private static final int[] ISTRING = new int[256];
++
++    private static final int[][] ISTRING_RANGES = {
+         // %00000000 to %00111111 small length
+         { 0x3F, ISTRING_SMALL_LENGTH },
+ 
+@@ -552,46 +552,46 @@
+         { 0xFF, STATE_ILLEGAL },
+     };
+ 
+-    
++
+     /* package */ final static int ISTRING_PREFIX_NAMESPACE_LENGTH_3   = 6;
+     /* package */ final static int ISTRING_PREFIX_NAMESPACE_LENGTH_5   = 7;
+     /* package */ final static int ISTRING_PREFIX_NAMESPACE_LENGTH_29  = 8;
+     /* package */ final static int ISTRING_PREFIX_NAMESPACE_LENGTH_36  = 9;
+     /* package */ final static int ISTRING_PREFIX_NAMESPACE_INDEX_ZERO = 10;
+-    
+-    /* package */ static final int[] ISTRING_PREFIX_NAMESPACE = new int[256];
+-    
+-    private static int[][] ISTRING_PREFIX_NAMESPACE_RANGES = {
++
++    private static final int[] ISTRING_PREFIX_NAMESPACE = new int[256];
++
++    private static final int[][] ISTRING_PREFIX_NAMESPACE_RANGES = {
+         // %00000000 to %00000001 small length
+         { 0x01, ISTRING_SMALL_LENGTH },
+ 
+         // %00000010 small length
+         { 0x02, ISTRING_PREFIX_NAMESPACE_LENGTH_3 },
+-        
++
+         // %00000011 small length
+         { 0x03, ISTRING_SMALL_LENGTH },
+-                
++
+         // %00000100 small length
+         { 0x04, ISTRING_PREFIX_NAMESPACE_LENGTH_5 },
+ 
+         // %00011011 small length
+         { 0x1B, ISTRING_SMALL_LENGTH },
+-                
++
+         // %00011100 small length
+         { 0x1C, ISTRING_PREFIX_NAMESPACE_LENGTH_29 },
+ 
+         // %00100010 small length
+         { 0x22, ISTRING_SMALL_LENGTH },
+-                                
++
+         // %00100011 small length
+         { 0x23, ISTRING_PREFIX_NAMESPACE_LENGTH_36 },
+-                
++
+         // %00000101 to %00111111 small length
+         { 0x3F, ISTRING_SMALL_LENGTH },
+ 
+-                
+-                
+-                
++
++
++
+         // %01000000 medium length
+         { 0x40, ISTRING_MEDIUM_LENGTH },
+ 
+@@ -606,7 +606,7 @@
+ 
+         // %10000000 index small, 0
+         { 0x80, ISTRING_PREFIX_NAMESPACE_INDEX_ZERO },
+-                
++
+         // %10000000 to %10111111 index small
+         { 0xBF, ISTRING_INDEX_SMALL },
+ 
+@@ -619,7 +619,7 @@
+         // %11110000 to %11111111 ILLEGAL
+         { 0xFF, STATE_ILLEGAL },
+     };
+-    
++
+     // UTF-8 states
+     /* package */ final static int UTF8_NCNAME_NCNAME         = 0;
+     /* package */ final static int UTF8_NCNAME_NCNAME_CHAR    = 1;
+@@ -627,23 +627,23 @@
+     /* package */ final static int UTF8_THREE_BYTES           = 3;
+     /* package */ final static int UTF8_FOUR_BYTES            = 4;
+ 
+-    /* package */ static final int[] UTF8_NCNAME = new int[256];
+-    
+-    private static int[][] UTF8_NCNAME_RANGES = {
+-        
++    private static final int[] UTF8_NCNAME = new int[256];
++
++    private static final int[][] UTF8_NCNAME_RANGES = {
++
+         // Basic Latin
+-        
++
+         // %00000000 to %00101100
+         { 0x2C, STATE_ILLEGAL },
+-                
+-        // '-' '.'        
++
++        // '-' '.'
+         // %%00101101 to %00101110 [#x002D-#x002E]
+         { 0x2E, UTF8_NCNAME_NCNAME_CHAR },
+ 
+         // %00101111
+         { 0x2F, STATE_ILLEGAL },
+-        
+-        // [0-9]        
++
++        // [0-9]
+         // %0011000 to %00111001  [#x0030-#x0039]
+         { 0x39, UTF8_NCNAME_NCNAME_CHAR },
+ 
+@@ -650,107 +650,107 @@
+         // %01000000
+         { 0x40, STATE_ILLEGAL },
+ 
+-        // [A-Z]        
++        // [A-Z]
+         // %01000001 to %01011010 [#x0041-#x005A]
+         { 0x5A, UTF8_NCNAME_NCNAME },
+-        
++
+         // %01011110
+         { 0x5E, STATE_ILLEGAL },
+-        
++
+         // '_'
+         // %01011111 [#x005F]
+         { 0x5F, UTF8_NCNAME_NCNAME },
+-                
++
+         // %01100000
+         { 0x60, STATE_ILLEGAL },
+-              
+-        // [a-z]        
++
++        // [a-z]
+         // %01100001 to %01111010 [#x0061-#x007A]
+         { 0x7A, UTF8_NCNAME_NCNAME },
+-                
++
+         // %01111011 to %01111111
+         { 0x7F, STATE_ILLEGAL },
+-                
+-                
++
++
+         // Two bytes
+ 
+-        // %10000000 to %11000001                
++        // %10000000 to %11000001
+         { 0xC1, STATE_ILLEGAL },
+-                
++
+         // %11000010 to %11011111
+         { 0xDF, UTF8_TWO_BYTES },
+ 
+-                
++
+         // Three bytes
+-                
++
+         // %11100000 to %11101111
+         { 0xEF, UTF8_THREE_BYTES },
+ 
+-                
+-        // Four bytes 
+-                
+-        // %11110000 to %11110111                
++
++        // Four bytes
++
++        // %11110000 to %11110111
+         { 0xF7, UTF8_FOUR_BYTES },
+ 
+-                
+-        // %11111000 to %11111111                
++
++        // %11111000 to %11111111
+         { 0xFF, STATE_ILLEGAL }
+     };
+ 
+     /* package */ final static int UTF8_ONE_BYTE = 1;
+-    
+-    /* package */ static final int[] UTF8 = new int[256];
+-    
+-    private static int[][] UTF8_RANGES = {
+-        
++
++    private static final int[] UTF8 = new int[256];
++
++    private static final int[][] UTF8_RANGES = {
++
+         // Basic Latin
+-        
++
+         // %00000000 to %00001000
+         { 0x08, STATE_ILLEGAL },
+-                
+-        // CHARACTER TABULATION, LINE FEED        
++
++        // CHARACTER TABULATION, LINE FEED
+         // %%00001001 to %00001010 [#x0009-#x000A]
+         { 0x0A, UTF8_ONE_BYTE },
+ 
+         // %00001011 to %00001100
+         { 0x0C, STATE_ILLEGAL },
+-        
+-        // CARRIAGE RETURN       
++
++        // CARRIAGE RETURN
+         // %00001101 [#x000D]
+         { 0x0D, UTF8_ONE_BYTE },
+ 
+         // %00001110 to %00011111
+         { 0x1F, STATE_ILLEGAL },
+-                
++
+         // %0010000 to %01111111
+         { 0x7F, UTF8_ONE_BYTE },
+-                
+-                
++
++
+         // Two bytes
+ 
+-        // %10000000 to %11000001                
++        // %10000000 to %11000001
+         { 0xC1, STATE_ILLEGAL },
+-                
++
+         // %11000010 to %11011111
+         { 0xDF, UTF8_TWO_BYTES },
+ 
+-                
++
+         // Three bytes
+-                
++
+         // %11100000 to %11101111
+         { 0xEF, UTF8_THREE_BYTES },
+ 
+-                
+-        // Four bytes 
+-                
+-        // %11110000 to %11110111                
++
++        // Four bytes
++
++        // %11110000 to %11110111
+         { 0xF7, UTF8_FOUR_BYTES },
+ 
+-                
+-        // %11111000 to %11111111                
++
++        // %11111000 to %11111111
+         { 0xFF, STATE_ILLEGAL }
+     };
+-    
++
+     private static void constructTable(int[] table, int[][] ranges) {
+         int start = 0x00;
+         for (int range = 0; range < ranges.length; range++) {
+@@ -763,32 +763,64 @@
+         }
+     }
+ 
++    public static final int DII(final int index) {
++        return DII[index];
++    }
++
++    public static final int EII(final int index) {
++        return EII[index];
++    }
++
++    public static final int AII(final int index) {
++        return AII[index];
++    }
++
++    public static final int NISTRING(final int index) {
++        return NISTRING[index];
++    }
++
++    public static final int ISTRING(final int index) {
++        return ISTRING[index];
++    }
++
++    public static final int ISTRING_PREFIX_NAMESPACE(final int index) {
++        return ISTRING_PREFIX_NAMESPACE[index];
++    }
++
++    public static final int UTF8(final int index) {
++        return UTF8[index];
++    }
++
++    public static final int UTF8_NCNAME(final int index) {
++        return UTF8_NCNAME[index];
++    }
++
+     static {
+-        // EII
++        // DII
+         constructTable(DII, DII_RANGES);
+ 
+         // EII
+         constructTable(EII, EII_RANGES);
+-        
++
+         // AII
+-        constructTable(AII, AII_RANGES);        
++        constructTable(AII, AII_RANGES);
+ 
+         // AII Value
+-        constructTable(NISTRING, NISTRING_RANGES);        
++        constructTable(NISTRING, NISTRING_RANGES);
+ 
+         // Identifying string
+-        constructTable(ISTRING, ISTRING_RANGES);        
++        constructTable(ISTRING, ISTRING_RANGES);
+ 
+         // Identifying string
+-        constructTable(ISTRING_PREFIX_NAMESPACE, ISTRING_PREFIX_NAMESPACE_RANGES);        
+-        
++        constructTable(ISTRING_PREFIX_NAMESPACE, ISTRING_PREFIX_NAMESPACE_RANGES);
++
+         // UTF-8 NCNAME states
+-        constructTable(UTF8_NCNAME, UTF8_NCNAME_RANGES);        
++        constructTable(UTF8_NCNAME, UTF8_NCNAME_RANGES);
+ 
+         // UTF-8 states
+-        constructTable(UTF8, UTF8_RANGES);        
++        constructTable(UTF8, UTF8_RANGES);
+     }
+-    
++
+     private DecoderStateTables() {
+     }
+ }
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/Encoder.java	Thu Jul 30 18:00:01 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/Encoder.java	Thu Jul 30 18:00:01 2009
+@@ -50,7 +50,7 @@
+ /**
+  * Abstract encoder for developing concrete encoders.
+  *
+- * Concrete implementations extending Encoder will utilize methods on Encoder 
++ * Concrete implementations extending Encoder will utilize methods on Encoder
+  * to encode XML infoset according to the Fast Infoset standard. It is the
+  * responsibility of the concrete implementation to ensure that methods are
+  * invoked in the correct order to produce a valid fast infoset document.
+@@ -61,30 +61,30 @@
+  * methods that take org.sax.xml.DefaultHandler as a parameter.
+  *
+  * <p>
+- * Buffering of octets that are written to an {@link java.io.OutputStream} is 
++ * Buffering of octets that are written to an {@link java.io.OutputStream} is
+  * supported in a similar manner to a {@link java.io.BufferedOutputStream}.
+  * Combining buffering with encoding enables better performance.
+  *
+  * <p>
+- * More than one fast infoset document may be encoded to the 
++ * More than one fast infoset document may be encoded to the
+  * {@link java.io.OutputStream}.
+  *
+  */
+ public abstract class Encoder extends DefaultHandler implements FastInfosetSerializer {
+-    
+-    /** 
+-     * Character encoding scheme system property for the encoding 
++
++    /**
++     * Character encoding scheme system property for the encoding
+      * of content and attribute values.
+      */
+     public static final String CHARACTER_ENCODING_SCHEME_SYSTEM_PROPERTY =
+         "com.sun.xml.internal.fastinfoset.serializer.character-encoding-scheme";
+ 
+-    /** 
+-     * Default character encoding scheme system property for the encoding 
++    /**
++     * Default character encoding scheme system property for the encoding
+      * of content and attribute values.
+      */
+     protected static final String _characterEncodingSchemeSystemDefault = getDefaultEncodingScheme();
+-        
++
+     private static String getDefaultEncodingScheme() {
+         String p = System.getProperty(CHARACTER_ENCODING_SCHEME_SYSTEM_PROPERTY,
+             UTF_8);
+@@ -95,14 +95,14 @@
+         }
+     }
+ 
+-    protected static int[] NUMERIC_CHARACTERS_TABLE;
+-    
+-    protected static int[] DATE_TIME_CHARACTERS_TABLE;
+-    
++    private static int[] NUMERIC_CHARACTERS_TABLE;
++
++    private static int[] DATE_TIME_CHARACTERS_TABLE;
++
+     static {
+         NUMERIC_CHARACTERS_TABLE = new int[maxCharacter(RestrictedAlphabet.NUMERIC_CHARACTERS) + 1];
+         DATE_TIME_CHARACTERS_TABLE = new int[maxCharacter(RestrictedAlphabet.DATE_TIME_CHARACTERS) + 1];
+-    
++
+         for (int i = 0; i < NUMERIC_CHARACTERS_TABLE.length ; i++) {
+             NUMERIC_CHARACTERS_TABLE[i] = -1;
+         }
+@@ -109,15 +109,15 @@
+         for (int i = 0; i < DATE_TIME_CHARACTERS_TABLE.length ; i++) {
+             DATE_TIME_CHARACTERS_TABLE[i] = -1;
+         }
+-        
++
+         for (int i = 0; i < RestrictedAlphabet.NUMERIC_CHARACTERS.length() ; i++) {
+             NUMERIC_CHARACTERS_TABLE[RestrictedAlphabet.NUMERIC_CHARACTERS.charAt(i)] = i;
+-        }        
++        }
+         for (int i = 0; i < RestrictedAlphabet.DATE_TIME_CHARACTERS.length() ; i++) {
+             DATE_TIME_CHARACTERS_TABLE[RestrictedAlphabet.DATE_TIME_CHARACTERS.charAt(i)] = i;
+         }
+     }
+-    
++
+     private static int maxCharacter(String alphabet) {
+         int c = 0;
+         for (int i = 0; i < alphabet.length() ; i++) {
+@@ -125,30 +125,30 @@
+                 c = alphabet.charAt(i);
+             }
+         }
+-        
++
+         return c;
+     }
+-    
++
+     /**
+      * True if DTD and internal subset shall be ignored.
+      */
+     private boolean _ignoreDTD;
+-    
++
+     /**
+      * True if comments shall be ignored.
+      */
+     private boolean _ignoreComments;
+-    
++
+     /**
+      * True if procesing instructions shall be ignored.
+      */
+     private boolean _ignoreProcessingInstructions;
+-    
++
+     /**
+      * True if white space characters for text content shall be ignored.
+      */
+     private boolean _ignoreWhiteSpaceTextContent;
+-    
++
+     /**
+      * True, if the local name string is used as the key to find the
+      * associated set of qualified names.
+@@ -157,7 +157,7 @@
+      * to find the associated set of qualified names.
+      */
+     private boolean _useLocalNameAsKeyForQualifiedNameLookup;
+-            
++
+     /**
+      * True if strings for text content and attribute values will be
+      * UTF-8 encoded otherwise they will be UTF-16 encoded.
+@@ -173,7 +173,7 @@
+      * Encoding constant generated from the string encoding.
+      */
+     private int _nonIdentifyingStringOnFirstBitCES;
+-    
++
+     /**
+      * The map of URIs to algorithms.
+      */
+@@ -188,7 +188,7 @@
+      * The vocabulary application data that is used by the encoder
+      */
+     protected VocabularyApplicationData _vData;
+-    
++
+     /**
+      * True if the vocubulary is internal to the encoder
+      */
+@@ -205,13 +205,13 @@
+     protected int _b;
+ 
+     /**
+-     * The {@link java.io.OutputStream} that the encoded XML infoset (the 
++     * The {@link java.io.OutputStream} that the encoded XML infoset (the
+      * fast infoset document) is written to.
+      */
+     protected OutputStream _s;
+ 
+     /**
+-     * The internal buffer of characters used for the UTF-8 or UTF-16 encoding 
++     * The internal buffer of characters used for the UTF-8 or UTF-16 encoding
+      * of characters.
+      */
+     protected char[] _charBuffer = new char[512];
+@@ -220,12 +220,12 @@
+      * The internal buffer of bytes.
+      */
+     protected byte[] _octetBuffer = new byte[1024];
+-    
++
+     /**
+      * The current position in the internal buffer.
+      */
+     protected int _octetBufferIndex;
+-   
++
+     /**
+      * The current mark in the internal buffer.
+      *
+@@ -235,12 +235,18 @@
+     protected int _markIndex = -1;
+ 
+     /**
+-     * The limit on the size of [normalized value] of Attribute Information 
++     * The minimum size of [normalized value] of Attribute Information
+      * Items that will be indexed.
+      */
+-    protected int attributeValueSizeConstraint = FastInfosetSerializer.ATTRIBUTE_VALUE_SIZE_CONSTRAINT;
+-    
++    protected int minAttributeValueSize = FastInfosetSerializer.MIN_ATTRIBUTE_VALUE_SIZE;
++
+     /**
++     * The maximum size of [normalized value] of Attribute Information
++     * Items that will be indexed.
++     */
++    protected int maxAttributeValueSize = FastInfosetSerializer.MAX_ATTRIBUTE_VALUE_SIZE;
++
++    /**
+      * The limit on the size of indexed Map for attribute values
+      * Limit is measured in characters number
+      */
+@@ -247,33 +253,40 @@
+     protected int attributeValueMapTotalCharactersConstraint = FastInfosetSerializer.ATTRIBUTE_VALUE_MAP_MEMORY_CONSTRAINT / 2;
+ 
+     /**
+-     * The limit on the size of character content chunks
+-     * of Character Information Items or Comment Information Items that 
++     * The minimum size of character content chunks
++     * of Character Information Items or Comment Information Items that
+      * will be indexed.
+      */
+-    protected int characterContentChunkSizeContraint = FastInfosetSerializer.CHARACTER_CONTENT_CHUNK_SIZE_CONSTRAINT;
++    protected int minCharacterContentChunkSize = FastInfosetSerializer.MIN_CHARACTER_CONTENT_CHUNK_SIZE;
+ 
+     /**
++     * The maximum size of character content chunks
++     * of Character Information Items or Comment Information Items that
++     * will be indexed.
++     */
++    protected int maxCharacterContentChunkSize = FastInfosetSerializer.MAX_CHARACTER_CONTENT_CHUNK_SIZE;
++
++    /**
+      * The limit on the size of indexed Map for character content chunks
+      * Limit is measured in characters number
+      */
+     protected int characterContentChunkMapTotalCharactersConstraint = FastInfosetSerializer.CHARACTER_CONTENT_CHUNK_MAP_MEMORY_CONSTRAINT / 2;
+-    
++
+     /**
+      * Default constructor for the Encoder.
+      */
+     protected Encoder() {
+-        setCharacterEncodingScheme(_characterEncodingSchemeSystemDefault);        
++        setCharacterEncodingScheme(_characterEncodingSchemeSystemDefault);
+     }
+-    
++
+     protected Encoder(boolean useLocalNameAsKeyForQualifiedNameLookup) {
+-        setCharacterEncodingScheme(_characterEncodingSchemeSystemDefault);        
++        setCharacterEncodingScheme(_characterEncodingSchemeSystemDefault);
+         _useLocalNameAsKeyForQualifiedNameLookup = useLocalNameAsKeyForQualifiedNameLookup;
+     }
+-    
+-    
++
++
+     // FastInfosetSerializer interface
+-    
++
+     /**
+      * {@inheritDoc}
+      */
+@@ -280,7 +293,7 @@
+     public final void setIgnoreDTD(boolean ignoreDTD) {
+         _ignoreDTD = ignoreDTD;
+     }
+-    
++
+     /**
+      * {@inheritDoc}
+      */
+@@ -287,7 +300,7 @@
+     public final boolean getIgnoreDTD() {
+         return _ignoreDTD;
+     }
+-    
++
+     /**
+      * {@inheritDoc}
+      */
+@@ -294,7 +307,7 @@
+     public final void setIgnoreComments(boolean ignoreComments) {
+         _ignoreComments = ignoreComments;
+     }
+-    
++
+     /**
+      * {@inheritDoc}
+      */
+@@ -301,15 +314,15 @@
+     public final boolean getIgnoreComments() {
+         return _ignoreComments;
+     }
+-    
++
+     /**
+      * {@inheritDoc}
+      */
+-    public final void setIgnoreProcesingInstructions(boolean 
++    public final void setIgnoreProcesingInstructions(boolean
+             ignoreProcesingInstructions) {
+         _ignoreProcessingInstructions = ignoreProcesingInstructions;
+     }
+-    
++
+     /**
+      * {@inheritDoc}
+      */
+@@ -316,14 +329,14 @@
+     public final boolean getIgnoreProcesingInstructions() {
+         return _ignoreProcessingInstructions;
+     }
+-    
++
+     /**
+      * {@inheritDoc}
+      */
+-    public final void setIgnoreWhiteSpaceTextContent(boolean ignoreWhiteSpaceTextContent) {        
++    public final void setIgnoreWhiteSpaceTextContent(boolean ignoreWhiteSpaceTextContent) {
+         _ignoreWhiteSpaceTextContent = ignoreWhiteSpaceTextContent;
+     }
+-    
++
+     /**
+      * {@inheritDoc}
+      */
+@@ -330,12 +343,12 @@
+     public final boolean getIgnoreWhiteSpaceTextContent() {
+         return _ignoreWhiteSpaceTextContent;
+     }
+-        
++
+     /**
+      * {@inheritDoc}
+      */
+     public void setCharacterEncodingScheme(String characterEncodingScheme) {
+-        if (characterEncodingScheme.equals(UTF_16BE)) { 
++        if (characterEncodingScheme.equals(UTF_16BE)) {
+             _encodingStringsAsUtf8 = false;
+             _nonIdentifyingStringOnThirdBitCES = EncodingConstants.CHARACTER_CHUNK | EncodingConstants.CHARACTER_CHUNK_UTF_16_FLAG;
+             _nonIdentifyingStringOnFirstBitCES = EncodingConstants.NISTRING_UTF_16_FLAG;
+@@ -345,7 +358,7 @@
+             _nonIdentifyingStringOnFirstBitCES = 0;
+         }
+     }
+-        
++
+     /**
+      * {@inheritDoc}
+      */
+@@ -352,7 +365,7 @@
+     public String getCharacterEncodingScheme() {
+         return (_encodingStringsAsUtf8) ? UTF_8 : UTF_16BE;
+     }
+-    
++
+     /**
+      * {@inheritDoc}
+      */
+@@ -373,32 +386,39 @@
+     /**
+      * {@inheritDoc}
+      */
+-    public void setCharacterContentChunkSizeLimit(int size) {
++    public int getMinCharacterContentChunkSize() {
++        return minCharacterContentChunkSize;
++    }
++
++    /**
++     * {@inheritDoc}
++     */
++    public void setMinCharacterContentChunkSize(int size) {
+         if (size < 0 ) {
+             size = 0;
+         }
+-                
+-        characterContentChunkSizeContraint = size;
++
++        minCharacterContentChunkSize = size;
+     }
+-    
++
+     /**
+      * {@inheritDoc}
+      */
+-    public int getCharacterContentChunkSizeLimit() {
+-        return characterContentChunkSizeContraint;
++    public int getMaxCharacterContentChunkSize() {
++        return maxCharacterContentChunkSize;
+     }
+ 
+     /**
+      * {@inheritDoc}
+      */
+-    public void setCharacterContentChunkMapMemoryLimit(int size) {
++    public void setMaxCharacterContentChunkSize(int size) {
+         if (size < 0 ) {
+             size = 0;
+         }
+-        
+-        characterContentChunkMapTotalCharactersConstraint = size / 2;
++
++        maxCharacterContentChunkSize = size;
+     }
+-    
++
+     /**
+      * {@inheritDoc}
+      */
+@@ -407,49 +427,88 @@
+     }
+ 
+     /**
+-     * Checks whether character content chunk (its length) matches limits:
+-     * length limit itself and limit for total capacity of specified CharArrayIntMap
++     * {@inheritDoc}
++     */
++    public void setCharacterContentChunkMapMemoryLimit(int size) {
++        if (size < 0 ) {
++            size = 0;
++        }
++
++        characterContentChunkMapTotalCharactersConstraint = size / 2;
++    }
++
++    /**
++     * Checks whether character content chunk (its length) matches length limit
+      *
+      * @param length the length of character content chunk is checking to be added to Map.
++     * @return whether character content chunk length matches limit
++     */
++    public boolean isCharacterContentChunkLengthMatchesLimit(int length) {
++        return length >= minCharacterContentChunkSize &&
++                length <= maxCharacterContentChunkSize;
++    }
++
++    /**
++     * Checks whether character content table has enough memory to
++     * store character content chunk with the given length
++     *
++     * @param length the length of character content chunk is checking to be added to Map.
+      * @param map the custom CharArrayIntMap, which memory limits will be checked.
+-     * @return whether character content chunk length matches limits
++     * @return whether character content map has enough memory
+      */
+-    public boolean isCharacterContentChunkLengthMatchesLimit(int length, CharArrayIntMap map) {
+-        return (length < characterContentChunkSizeContraint) &&
+-                (map.getTotalCharacterCount() + length <
+-                        characterContentChunkMapTotalCharactersConstraint);
++    public boolean canAddCharacterContentToTable(int length, CharArrayIntMap map) {
++        return map.getTotalCharacterCount() + length <
++                        characterContentChunkMapTotalCharactersConstraint;
+     }
+ 
+     /**
+      * {@inheritDoc}
+      */
+-    public void setAttributeValueSizeLimit(int size) {
++    public int getMinAttributeValueSize() {
++        return minAttributeValueSize;
++    }
++
++    /**
++     * {@inheritDoc}
++     */
++    public void setMinAttributeValueSize(int size) {
+         if (size < 0 ) {
+             size = 0;
+         }
+-        
+-        attributeValueSizeConstraint = size;
++
++        minAttributeValueSize = size;
+     }
+-    
++
+     /**
+      * {@inheritDoc}
+      */
+-    public int getAttributeValueSizeLimit() {
+-        return attributeValueSizeConstraint;
++    public int getMaxAttributeValueSize() {
++        return maxAttributeValueSize;
+     }
+-    
++
+     /**
+      * {@inheritDoc}
+      */
++    public void setMaxAttributeValueSize(int size) {
++        if (size < 0 ) {
++            size = 0;
++        }
++
++        maxAttributeValueSize = size;
++    }
++
++    /**
++     * {@inheritDoc}
++     */
+     public void setAttributeValueMapMemoryLimit(int size) {
+         if (size < 0 ) {
+             size = 0;
+         }
+-        
++
+         attributeValueMapTotalCharactersConstraint = size / 2;
+-        
++
+     }
+-    
++
+     /**
+      * {@inheritDoc}
+      */
+@@ -456,20 +515,31 @@
+     public int getAttributeValueMapMemoryLimit() {
+         return attributeValueMapTotalCharactersConstraint * 2;
+     }
+-    
++
+     /**
+-     * Checks whether attribute value (its length) matches limits:
+-     * length limit itself and limit for index Map total capacity
++     * Checks whether attribute value (its length) matches length limit
+      *
+-     * @return whether attribute value matches limits
++     * @param length the length of attribute
++     * @return whether attribute value matches limit
+      */
+     public boolean isAttributeValueLengthMatchesLimit(int length) {
+-        return (length < attributeValueSizeConstraint) &&
+-                (_v.attributeValue.getTotalCharacterCount() + length <
+-                        attributeValueMapTotalCharactersConstraint);
++        return length >= minAttributeValueSize &&
++                length <= maxAttributeValueSize;
+     }
+ 
+     /**
++     * Checks whether attribute table has enough memory to
++     * store attribute value with the given length
++     *
++     * @param length the length of attribute value is checking to be added to Map.
++     * @return whether attribute map has enough memory
++     */
++    public boolean canAddAttributeToTable(int length) {
++        return _v.attributeValue.getTotalCharacterCount() + length <
++                        attributeValueMapTotalCharactersConstraint;
++    }
++
++    /**
+      * {@inheritDoc}
+      */
+     public void setExternalVocabulary(ExternalVocabulary v) {
+@@ -480,10 +550,10 @@
+                 _useLocalNameAsKeyForQualifiedNameLookup);
+         _v.setExternalVocabulary(v.URI,
+                 ev, false);
+-        
++
+         _vIsInternal = true;
+     }
+-    
++
+     /**
+      * {@inheritDoc}
+      */
+@@ -490,7 +560,7 @@
+     public void setVocabularyApplicationData(VocabularyApplicationData data) {
+         _vData = data;
+     }
+-    
++
+     /**
+      * {@inheritDoc}
+      */
+@@ -497,9 +567,9 @@
+     public VocabularyApplicationData getVocabularyApplicationData() {
+         return _vData;
+     }
+-    
++
+     // End of FastInfosetSerializer interface
+-    
++
+     /**
+      * Reset the encoder for reuse encoding another XML infoset.
+      */
+@@ -506,9 +576,9 @@
+     public void reset() {
+         _terminate = false;
+     }
+-        
++
+     /**
+-     * Set the OutputStream to encode the XML infoset to a 
++     * Set the OutputStream to encode the XML infoset to a
+      * fast infoset document.
+      *
+      * @param s the OutputStream where the fast infoset document is written to.
+@@ -554,7 +624,7 @@
+             if (_vData != null)
+                 _vData.clear();
+         }
+-        
++
+         if (!_v.hasInitialVocabulary() && !_v.hasExternalVocabulary()) {
+             write(0);
+         } else if (_v.hasInitialVocabulary()) {
+@@ -630,7 +700,7 @@
+     /**
+      * Encode a Attribute Information Item that is a namespace declaration.
+      *
+-     * @param prefix the prefix of the namespace declaration, 
++     * @param prefix the prefix of the namespace declaration,
+      * if "" then there is no prefix for the namespace declaration.
+      * @param uri the URI of the namespace declaration,
+      * if "" then there is no URI for the namespace declaration.
+@@ -668,7 +738,7 @@
+      * @throws ArrayIndexOutOfBoundsException.
+      */
+     protected final void encodeCharacters(char[] ch, int offset, int length) throws IOException {
+-        final boolean addToTable = isCharacterContentChunkLengthMatchesLimit(length, _v.characterContentChunk);
++        final boolean addToTable = isCharacterContentChunkLengthMatchesLimit(length);
+         encodeNonIdentifyingStringOnThirdBit(ch, offset, length, _v.characterContentChunk, addToTable, true);
+     }
+ 
+@@ -675,10 +745,10 @@
+     /**
+      * Encode a chunk of Character Information Items.
+      *
+-     * If the array of characters is to be indexed (as determined by 
++     * If the array of characters is to be indexed (as determined by
+      * {@link Encoder#characterContentChunkSizeContraint}) then the array is not cloned
+      * when adding the array to the vocabulary.
+-     * 
++     *
+      * @param ch the array of characters.
+      * @param offset the offset into the array of characters.
+      * @param length the length of characters.
+@@ -685,13 +755,13 @@
+      * @throws ArrayIndexOutOfBoundsException.
+      */
+     protected final void encodeCharactersNoClone(char[] ch, int offset, int length) throws IOException {
+-        final boolean addToTable = isCharacterContentChunkLengthMatchesLimit(length, _v.characterContentChunk);
++        final boolean addToTable = isCharacterContentChunkLengthMatchesLimit(length);
+         encodeNonIdentifyingStringOnThirdBit(ch, offset, length, _v.characterContentChunk, addToTable, false);
+     }
+-    
++
+     /**
+-     * Encode a chunk of Character Information Items using a restricted 
+-     * alphabet that results in the encoding of a character in 4 bits 
++     * Encode a chunk of Character Information Items using a numeric
++     * alphabet that results in the encoding of a character in 4 bits
+      * (or two characters per octet).
+      *
+      * @param id the restricted alphabet identifier.
+@@ -702,29 +772,80 @@
+      * @param addToTable if characters should be added to table.
+      * @throws ArrayIndexOutOfBoundsException.
+      */
+-    protected final void encodeFourBitCharacters(int id, int[] table, char[] ch, int offset, int length, 
++    protected final void encodeNumericFourBitCharacters(char[] ch, int offset, int length,
+             boolean addToTable) throws FastInfosetException, IOException {
++        encodeFourBitCharacters(RestrictedAlphabet.NUMERIC_CHARACTERS_INDEX,
++                NUMERIC_CHARACTERS_TABLE, ch, offset, length, addToTable);
++    }
++
++    /**
++     * Encode a chunk of Character Information Items using a date-time
++     * alphabet that results in the encoding of a character in 4 bits
++     * (or two characters per octet).
++     *
++     * @param id the restricted alphabet identifier.
++     * @param table the table mapping characters to 4 bit values.
++     * @param ch the array of characters.
++     * @param offset the offset into the array of characters.
++     * @param length the length of characters.
++     * @param addToTable if characters should be added to table.
++     * @throws ArrayIndexOutOfBoundsException.
++     */
++    protected final void encodeDateTimeFourBitCharacters(char[] ch, int offset, int length,
++            boolean addToTable) throws FastInfosetException, IOException {
++        encodeFourBitCharacters(RestrictedAlphabet.DATE_TIME_CHARACTERS_INDEX,
++                DATE_TIME_CHARACTERS_TABLE, ch, offset, length, addToTable);
++    }
++
++    /**
++     * Encode a chunk of Character Information Items using a restricted
++     * alphabet that results in the encoding of a character in 4 bits
++     * (or two characters per octet).
++     *
++     * @param id the restricted alphabet identifier.
++     * @param table the table mapping characters to 4 bit values.
++     * @param ch the array of characters.
++     * @param offset the offset into the array of characters.
++     * @param length the length of characters.
++     * @param addToTable if characters should be added to table.
++     * @throws ArrayIndexOutOfBoundsException.
++     */
++    protected final void encodeFourBitCharacters(int id, int[] table, char[] ch, int offset, int length,
++            boolean addToTable) throws FastInfosetException, IOException {
+         if (addToTable) {
+-            final int index = _v.characterContentChunk.obtainIndex(ch, offset, length, true);
++            // if char array could be added to table
++            boolean canAddCharacterContentToTable =
++                    canAddCharacterContentToTable(length, _v.characterContentChunk);
++
++            // obtain/get index
++            int index = canAddCharacterContentToTable ?
++                _v.characterContentChunk.obtainIndex(ch, offset, length, true) :
++                _v.characterContentChunk.get(ch, offset, length);
++
+             if (index != KeyIntMap.NOT_PRESENT) {
++                // if char array is in table
+                 _b = EncodingConstants.CHARACTER_CHUNK | 0x20;
+                 encodeNonZeroIntegerOnFourthBit(index);
+                 return;
++            } else if (canAddCharacterContentToTable) {
++                // if char array is not in table, but could be added
++                _b = EncodingConstants.CHARACTER_CHUNK | EncodingConstants.CHARACTER_CHUNK_RESTRICTED_ALPHABET_FLAG | EncodingConstants.CHARACTER_CHUNK_ADD_TO_TABLE_FLAG;
++            } else {
++                // if char array is not in table and could not be added
++                _b = EncodingConstants.CHARACTER_CHUNK | EncodingConstants.CHARACTER_CHUNK_RESTRICTED_ALPHABET_FLAG;
+             }
++        } else {
++            _b = EncodingConstants.CHARACTER_CHUNK | EncodingConstants.CHARACTER_CHUNK_RESTRICTED_ALPHABET_FLAG;
+         }
+-        
+-        // This procedure assumes that id <= 64
+-        _b = (addToTable) ?
+-            EncodingConstants.CHARACTER_CHUNK | EncodingConstants.CHARACTER_CHUNK_RESTRICTED_ALPHABET_FLAG | EncodingConstants.CHARACTER_CHUNK_ADD_TO_TABLE_FLAG :
+-            EncodingConstants.CHARACTER_CHUNK | EncodingConstants.CHARACTER_CHUNK_RESTRICTED_ALPHABET_FLAG;
++
+         write (_b);
+ 
+         // Encode bottom 6 bits of enoding algorithm id
+         _b = id << 2;
+ 
+-        encodeNonEmptyFourBitCharacterStringOnSeventhBit(table, ch, offset, length);        
++        encodeNonEmptyFourBitCharacterStringOnSeventhBit(table, ch, offset, length);
+     }
+-    
++
+     /**
+      * Encode a chunk of Character Information Items using a restricted
+      * alphabet table.
+@@ -742,12 +863,29 @@
+     protected final void encodeAlphabetCharacters(String alphabet, char[] ch, int offset, int length,
+             boolean addToTable) throws FastInfosetException, IOException {
+         if (addToTable) {
+-            final int index = _v.characterContentChunk.obtainIndex(ch, offset, length, true);
++            // if char array could be added to table
++            boolean canAddCharacterContentToTable =
++                    canAddCharacterContentToTable(length, _v.characterContentChunk);
++
++            // obtain/get index
++            int index = canAddCharacterContentToTable ?
++                _v.characterContentChunk.obtainIndex(ch, offset, length, true) :
++                _v.characterContentChunk.get(ch, offset, length);
++
+             if (index != KeyIntMap.NOT_PRESENT) {
++                // if char array is in table
+                 _b = EncodingConstants.CHARACTER_CHUNK | 0x20;
+                 encodeNonZeroIntegerOnFourthBit(index);
+                 return;
++            } else if (canAddCharacterContentToTable) {
++                // if char array is not in table, but could be added
++                _b = EncodingConstants.CHARACTER_CHUNK | EncodingConstants.CHARACTER_CHUNK_RESTRICTED_ALPHABET_FLAG | EncodingConstants.CHARACTER_CHUNK_ADD_TO_TABLE_FLAG;
++            } else {
++                // if char array is not in table and could not be added
++                _b = EncodingConstants.CHARACTER_CHUNK | EncodingConstants.CHARACTER_CHUNK_RESTRICTED_ALPHABET_FLAG;
+             }
++        } else {
++            _b = EncodingConstants.CHARACTER_CHUNK | EncodingConstants.CHARACTER_CHUNK_RESTRICTED_ALPHABET_FLAG;
+         }
+ 
+         int id = _v.restrictedAlphabet.get(alphabet);
+@@ -755,19 +893,16 @@
+             throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.restrictedAlphabetNotPresent"));
+         }
+         id += EncodingConstants.RESTRICTED_ALPHABET_APPLICATION_START;
+-        
+-        _b = (addToTable) ?
+-            EncodingConstants.CHARACTER_CHUNK | EncodingConstants.CHARACTER_CHUNK_RESTRICTED_ALPHABET_FLAG | EncodingConstants.CHARACTER_CHUNK_ADD_TO_TABLE_FLAG :
+-            EncodingConstants.CHARACTER_CHUNK | EncodingConstants.CHARACTER_CHUNK_RESTRICTED_ALPHABET_FLAG;
++
+         _b |= (id & 0xC0) >> 6;
+         write(_b);
+-        
++
+         // Encode bottom 6 bits of enoding algorithm id
+         _b = (id & 0x3F) << 2;
+-        
++
+         encodeNonEmptyNBitCharacterStringOnSeventhBit(alphabet, ch, offset, length);
+     }
+-            
++
+     /**
+      * Encode a Processing Instruction Information Item.
+      *
+@@ -781,7 +916,7 @@
+         encodeIdentifyingNonEmptyStringOnFirstBit(target, _v.otherNCName);
+ 
+         // Data
+-        boolean addToTable = isCharacterContentChunkLengthMatchesLimit(data.length(), _v.characterContentChunk);
++        boolean addToTable = isCharacterContentChunkLengthMatchesLimit(data.length());
+         encodeNonIdentifyingStringOnFirstBit(data, _v.otherString, addToTable);
+     }
+ 
+@@ -800,15 +935,15 @@
+             _b |= EncodingConstants.DOCUMENT_TYPE_PUBLIC_IDENTIFIER_FLAG;
+         }
+         write(_b);
+-        
++
+         if (systemId != null && systemId.length() > 0) {
+             encodeIdentifyingNonEmptyStringOnFirstBit(systemId, _v.otherURI);
+         }
+         if (publicId != null && publicId.length() > 0) {
+             encodeIdentifyingNonEmptyStringOnFirstBit(publicId, _v.otherURI);
+-        }        
++        }
+     }
+-    
++
+     /**
+      * Encode a Comment Information Item.
+      *
+@@ -820,7 +955,7 @@
+     protected final void encodeComment(char[] ch, int offset, int length) throws IOException {
+         write(EncodingConstants.COMMENT);
+ 
+-        boolean addToTable = isCharacterContentChunkLengthMatchesLimit(length, _v.otherString);
++        boolean addToTable = isCharacterContentChunkLengthMatchesLimit(length);
+         encodeNonIdentifyingStringOnFirstBit(ch, offset, length, _v.otherString, addToTable, true);
+     }
+ 
+@@ -827,10 +962,10 @@
+     /**
+      * Encode a Comment Information Item.
+      *
+-     * If the array of characters that is a comment is to be indexed (as 
+-     * determined by {@link Encoder#characterContentChunkSizeContraint}) then 
++     * If the array of characters that is a comment is to be indexed (as
++     * determined by {@link Encoder#characterContentChunkSizeContraint}) then
+      * the array is not cloned when adding the array to the vocabulary.
+-     * 
++     *
+      * @param ch the array of characters.
+      * @param offset the offset into the array of characters.
+      * @param length the length of characters.
+@@ -839,12 +974,12 @@
+     protected final void encodeCommentNoClone(char[] ch, int offset, int length) throws IOException {
+         write(EncodingConstants.COMMENT);
+ 
+-        boolean addToTable = isCharacterContentChunkLengthMatchesLimit(length, _v.otherString);
++        boolean addToTable = isCharacterContentChunkLengthMatchesLimit(length);
+         encodeNonIdentifyingStringOnFirstBit(ch, offset, length, _v.otherString, addToTable, false);
+     }
+ 
+     /**
+-     * Encode a qualified name of an Element Informaiton Item on the third bit 
++     * Encode a qualified name of an Element Informaiton Item on the third bit
+      * of an octet.
+      * Implementation of clause C.18 of ITU-T Rec. X.891 | ISO/IEC 24824-1.
+      *
+@@ -930,7 +1065,7 @@
+     }
+ 
+     /**
+-     * Encode a qualified name of an Attribute Informaiton Item on the third bit 
++     * Encode a qualified name of an Attribute Informaiton Item on the third bit
+      * of an octet.
+      * Implementation of clause C.17 of ITU-T Rec. X.891 | ISO/IEC 24824-1.
+      *
+@@ -976,7 +1111,7 @@
+         if (namespaceURI.length() > 0) {
+             namespaceURIIndex = _v.namespaceName.get(namespaceURI);
+             if (namespaceURIIndex == KeyIntMap.NOT_PRESENT) {
+-                if (namespaceURI == EncodingConstants.XMLNS_NAMESPACE_NAME || 
++                if (namespaceURI == EncodingConstants.XMLNS_NAMESPACE_NAME ||
+                         namespaceURI.equals(EncodingConstants.XMLNS_NAMESPACE_NAME)) {
+                     return false;
+                 } else {
+@@ -983,7 +1118,7 @@
+                     throw new IOException(CommonResourceBundle.getInstance().getString("message.namespaceURINotIndexed", new Object[]{namespaceURI}));
+                 }
+             }
+-            
++
+             if (prefix.length() > 0) {
+                 prefixIndex = _v.prefix.get(prefix);
+                 if (prefixIndex == KeyIntMap.NOT_PRESENT) {
+@@ -1023,7 +1158,7 @@
+         } else {
+             encodeNonEmptyOctetStringOnSecondBit(localName);
+         }
+-        
++
+         return true;
+     }
+ 
+@@ -1033,21 +1168,39 @@
+      *
+      * @param s the string to encode
+      * @param map the vocabulary table of strings to indexes.
+-     * @param addToTable true if the string should be added to the vocabulary
++     * @param addToTable true if the string could be added to the vocabulary
++     *                   table (if table has enough memory)
++     * @param mustBeAddedToTable true if the string must be added to the vocabulary
+      *                   table (if not already present in the table).
+      */
+-    protected final void encodeNonIdentifyingStringOnFirstBit(String s, StringIntMap map, boolean addToTable) throws IOException {
++    protected final void encodeNonIdentifyingStringOnFirstBit(String s, StringIntMap map,
++            boolean addToTable, boolean mustBeAddedToTable) throws IOException {
+         if (s == null || s.length() == 0) {
+             // C.26 an index (first bit '1') with seven '1' bits for an empty string
+             write(0xFF);
+         } else {
+-            if (addToTable) {
+-                int index = map.obtainIndex(s);
+-                if (index == KeyIntMap.NOT_PRESENT) {
+-                    _b = EncodingConstants.NISTRING_ADD_TO_TABLE_FLAG | _nonIdentifyingStringOnFirstBitCES;
++            if (addToTable || mustBeAddedToTable) {
++                // if attribute value could be added to table
++                boolean canAddAttributeToTable = mustBeAddedToTable ||
++                        canAddAttributeToTable(s.length());
++
++                // obtain/get index
++                int index = canAddAttributeToTable ?
++                    map.obtainIndex(s) :
++                    map.get(s);
++
++                if (index != KeyIntMap.NOT_PRESENT) {
++                    // if attribute value is in table
++                    encodeNonZeroIntegerOnSecondBitFirstBitOne(index);
++                } else if (canAddAttributeToTable) {
++                    // if attribute value is not in table, but could be added
++                    _b = EncodingConstants.NISTRING_ADD_TO_TABLE_FLAG |
++                            _nonIdentifyingStringOnFirstBitCES;
+                     encodeNonEmptyCharacterStringOnFifthBit(s);
+                 } else {
+-                    encodeNonZeroIntegerOnSecondBitFirstBitOne(index);
++                    // if attribute value is not in table and could not be added
++                    _b = _nonIdentifyingStringOnFirstBitCES;
++                    encodeNonEmptyCharacterStringOnFifthBit(s);
+                 }
+             } else {
+                 _b = _nonIdentifyingStringOnFirstBitCES;
+@@ -1073,12 +1226,28 @@
+             if (addToTable) {
+                 final char[] ch = s.toCharArray();
+                 final int length = s.length();
+-                int index = map.obtainIndex(ch, 0, length, false);
+-                if (index == KeyIntMap.NOT_PRESENT) {
+-                    _b = EncodingConstants.NISTRING_ADD_TO_TABLE_FLAG | _nonIdentifyingStringOnFirstBitCES;
++
++                // if char array could be added to table
++                boolean canAddCharacterContentToTable =
++                        canAddCharacterContentToTable(length, map);
++
++                // obtain/get index
++                int index = canAddCharacterContentToTable ?
++                    map.obtainIndex(ch, 0, length, false) :
++                    map.get(ch, 0, length);
++
++                if (index != KeyIntMap.NOT_PRESENT) {
++                    // if char array is in table
++                    encodeNonZeroIntegerOnSecondBitFirstBitOne(index);
++                } else if (canAddCharacterContentToTable) {
++                    // if char array is not in table, but could be added
++                    _b = EncodingConstants.NISTRING_ADD_TO_TABLE_FLAG |
++                            _nonIdentifyingStringOnFirstBitCES;
+                     encodeNonEmptyCharacterStringOnFifthBit(ch, 0, length);
+                 } else {
+-                    encodeNonZeroIntegerOnSecondBitFirstBitOne(index);
++                    // if char array is not in table and could not be added
++                    _b = _nonIdentifyingStringOnFirstBitCES;
++                    encodeNonEmptyCharacterStringOnFifthBit(s);
+                 }
+             } else {
+                 _b = _nonIdentifyingStringOnFirstBitCES;
+@@ -1097,7 +1266,7 @@
+      * @param map the vocabulary table of character arrays to indexes.
+      * @param addToTable true if the string should be added to the vocabulary
+      *                   table (if not already present in the table).
+-     * @param clone true if the array of characters should be cloned if added 
++     * @param clone true if the array of characters should be cloned if added
+      *              to the vocabulary table.
+      */
+     protected final void encodeNonIdentifyingStringOnFirstBit(char[] ch, int offset, int length, CharArrayIntMap map,
+@@ -1107,12 +1276,27 @@
+             write(0xFF);
+         } else {
+             if (addToTable) {
+-                int index = map.obtainIndex(ch, offset, length, clone);
+-                if (index == KeyIntMap.NOT_PRESENT) {
+-                    _b = EncodingConstants.NISTRING_ADD_TO_TABLE_FLAG | _nonIdentifyingStringOnFirstBitCES;
++                // if char array could be added to table
++                boolean canAddCharacterContentToTable =
++                        canAddCharacterContentToTable(length, map);
++
++                // obtain/get index
++                int index = canAddCharacterContentToTable ?
++                    map.obtainIndex(ch, offset, length, clone) :
++                    map.get(ch, offset, length);
++
++                if (index != KeyIntMap.NOT_PRESENT) {
++                    // if char array is in table
++                    encodeNonZeroIntegerOnSecondBitFirstBitOne(index);
++                } else if (canAddCharacterContentToTable) {
++                    // if char array is not in table, but could be added
++                    _b = EncodingConstants.NISTRING_ADD_TO_TABLE_FLAG |
++                            _nonIdentifyingStringOnFirstBitCES;
+                     encodeNonEmptyCharacterStringOnFifthBit(ch, offset, length);
+                 } else {
+-                    encodeNonZeroIntegerOnSecondBitFirstBitOne(index);
++                    // if char array is not in table and could not be added
++                    _b = _nonIdentifyingStringOnFirstBitCES;
++                    encodeNonEmptyCharacterStringOnFifthBit(ch, offset, length);
+                 }
+             } else {
+                 _b = _nonIdentifyingStringOnFirstBitCES;
+@@ -1121,23 +1305,59 @@
+         }
+     }
+ 
+-    protected final void encodeNonIdentifyingStringOnFirstBit(int id, int[] table, String s, boolean addToTable) 
++    protected final void encodeNumericNonIdentifyingStringOnFirstBit(
++            String s, boolean addToTable, boolean mustBeAddedToTable)
+             throws IOException, FastInfosetException {
++        encodeNonIdentifyingStringOnFirstBit(
++                                    RestrictedAlphabet.NUMERIC_CHARACTERS_INDEX,
++                                    NUMERIC_CHARACTERS_TABLE, s, addToTable,
++                                    mustBeAddedToTable);
++    }
++
++    protected final void encodeDateTimeNonIdentifyingStringOnFirstBit(
++            String s, boolean addToTable, boolean mustBeAddedToTable)
++            throws IOException, FastInfosetException {
++        encodeNonIdentifyingStringOnFirstBit(
++                                    RestrictedAlphabet.DATE_TIME_CHARACTERS_INDEX,
++                                    DATE_TIME_CHARACTERS_TABLE, s, addToTable,
++                                    mustBeAddedToTable);
++    }
++
++    protected final void encodeNonIdentifyingStringOnFirstBit(int id, int[] table,
++            String s, boolean addToTable, boolean mustBeAddedToTable)
++            throws IOException, FastInfosetException {
+         if (s == null || s.length() == 0) {
+             // C.26 an index (first bit '1') with seven '1' bits for an empty string
+             write(0xFF);
+             return;
+-        } else if (addToTable) {
+-            final int index = _v.attributeValue.obtainIndex(s);
++        }
++
++        if (addToTable || mustBeAddedToTable) {
++            // if attribute value could be added to table
++            boolean canAddAttributeToTable = mustBeAddedToTable ||
++                    canAddAttributeToTable(s.length());
++
++            // obtain/get index
++            int index = canAddAttributeToTable ?
++                _v.attributeValue.obtainIndex(s) :
++                _v.attributeValue.get(s);
++
+             if (index != KeyIntMap.NOT_PRESENT) {
++                // if attribute value is in table
+                 encodeNonZeroIntegerOnSecondBitFirstBitOne(index);
+                 return;
++            } else if (canAddAttributeToTable) {
++                // if attribute value is not in table, but could be added
++                _b = EncodingConstants.NISTRING_RESTRICTED_ALPHABET_FLAG |
++                        EncodingConstants.NISTRING_ADD_TO_TABLE_FLAG;
++            } else {
++                // if attribute value is not in table and could not be added
++                _b = EncodingConstants.NISTRING_RESTRICTED_ALPHABET_FLAG;
+             }
++        } else {
++            _b = EncodingConstants.NISTRING_RESTRICTED_ALPHABET_FLAG;
+         }
+ 
+-        _b = (addToTable) 
+-                ? EncodingConstants.NISTRING_RESTRICTED_ALPHABET_FLAG | EncodingConstants.NISTRING_ADD_TO_TABLE_FLAG
+-                : EncodingConstants.NISTRING_RESTRICTED_ALPHABET_FLAG;
+         // Encode identification and top four bits of alphabet id
+         write (_b | ((id & 0xF0) >> 4));
+         // Encode bottom 4 bits of alphabet id
+@@ -1149,7 +1369,7 @@
+         encodeNonZeroOctetStringLengthOnFifthBit(octetPairLength + octetSingleLength);
+         encodeNonEmptyFourBitCharacterString(table, s.toCharArray(), 0, octetPairLength, octetSingleLength);
+     }
+-    
++
+     /**
+      * Encode a non identifying string on the first bit of an octet as binary
+      * data using an encoding algorithm.
+@@ -1159,7 +1379,7 @@
+      *            encoding algorithm identifier takes precendence.
+      * @param id the encoding algorithm identifier.
+      * @param data the data to be encoded using an encoding algorithm.
+-     * @throws EncodingAlgorithmException if the encoding algorithm URI is not 
++     * @throws EncodingAlgorithmException if the encoding algorithm URI is not
+      *         present in the vocabulary, or the encoding algorithm identifier
+      *         is not with the required range.
+      */
+@@ -1227,7 +1447,7 @@
+     }
+ 
+     /**
+-     * Encode the [normalized value] of an Attribute Information Item using 
++     * Encode the [normalized value] of an Attribute Information Item using
+      * using an encoding algorithm.
+      * Implementation of clause C.14 of ITU-T Rec. X.891 | ISO/IEC 24824-1.
+      *
+@@ -1251,7 +1471,7 @@
+     }
+ 
+     /**
+-     * Encode the [normalized value] of an Attribute Information Item using 
++     * Encode the [normalized value] of an Attribute Information Item using
+      * using an encoding algorithm.
+      * Implementation of clause C.14 of ITU-T Rec. X.891 | ISO/IEC 24824-1.
+      *
+@@ -1275,13 +1495,13 @@
+     }
+ 
+     /**
+-     * Encode the [normalized value] of an Attribute Information Item using 
++     * Encode the [normalized value] of an Attribute Information Item using
+      * using a built in encoding algorithm.
+      * Implementation of clause C.14 of ITU-T Rec. X.891 | ISO/IEC 24824-1.
+      *
+      * @param id the built in encoding algorithm identifier.
+      * @param data the data to be encoded using an encoding algorithm. The data
+-     *        represents an array of items specified by the encoding algorithm 
++     *        represents an array of items specified by the encoding algorithm
+      *        identifier
+      * @param offset the offset into the array of bytes.
+      * @param length the length of bytes.
+@@ -1294,17 +1514,17 @@
+         // Encode bottom 4 bits of enoding algorithm id
+         _b = (id & 0x0F) << 4;
+ 
+-        final int octetLength = BuiltInEncodingAlgorithmFactory.table[id].
++        final int octetLength = BuiltInEncodingAlgorithmFactory.getAlgorithm(id).
+                     getOctetLengthFromPrimitiveLength(length);
+ 
+         encodeNonZeroOctetStringLengthOnFifthBit(octetLength);
+ 
+         ensureSize(octetLength);
+-        BuiltInEncodingAlgorithmFactory.table[id].
++        BuiltInEncodingAlgorithmFactory.getAlgorithm(id).
+                 encodeToBytes(data, offset, length, _octetBuffer, _octetBufferIndex);
+         _octetBufferIndex += octetLength;
+     }
+-    
++
+     /**
+      * Encode a non identifying string on the third bit of an octet.
+      * Implementation of clause C.15 of ITU-T Rec. X.891 | ISO/IEC 24824-1.
+@@ -1315,7 +1535,7 @@
+      * @param map the vocabulary table of character arrays to indexes.
+      * @param addToTable true if the array of characters should be added to the vocabulary
+      *                   table (if not already present in the table).
+-     * @param clone true if the array of characters should be cloned if added 
++     * @param clone true if the array of characters should be cloned if added
+      *              to the vocabulary table.
+      */
+     protected final void encodeNonIdentifyingStringOnThirdBit(char[] ch, int offset, int length,
+@@ -1323,16 +1543,31 @@
+         // length cannot be zero since sequence of CIIs has to be > 0
+ 
+         if (addToTable) {
+-            int index = map.obtainIndex(ch, offset, length, clone);
+-            if (index == KeyIntMap.NOT_PRESENT) {
+-                _b = EncodingConstants.CHARACTER_CHUNK_ADD_TO_TABLE_FLAG | 
++            // if char array could be added to table
++            boolean canAddCharacterContentToTable =
++                    canAddCharacterContentToTable(length, map);
++
++            // obtain/get index
++            int index = canAddCharacterContentToTable ?
++                map.obtainIndex(ch, offset, length, clone) :
++                map.get(ch, offset, length);
++
++            if (index != KeyIntMap.NOT_PRESENT) {
++                // if char array is in table
++                _b = EncodingConstants.CHARACTER_CHUNK | 0x20;
++                encodeNonZeroIntegerOnFourthBit(index);
++            } else if (canAddCharacterContentToTable) {
++                // if char array is not in table, but could be added
++                _b = EncodingConstants.CHARACTER_CHUNK_ADD_TO_TABLE_FLAG |
+                         _nonIdentifyingStringOnThirdBitCES;
+                 encodeNonEmptyCharacterStringOnSeventhBit(ch, offset, length);
+             } else {
+-                _b = EncodingConstants.CHARACTER_CHUNK | 0x20;
+-                encodeNonZeroIntegerOnFourthBit(index);
++                // if char array is not in table and could not be added
++                    _b = _nonIdentifyingStringOnThirdBitCES;
++                    encodeNonEmptyCharacterStringOnSeventhBit(ch, offset, length);
+             }
+         } else {
++            // char array will not be added to map
+             _b = _nonIdentifyingStringOnThirdBitCES;
+             encodeNonEmptyCharacterStringOnSeventhBit(ch, offset, length);
+         }
+@@ -1347,7 +1582,7 @@
+      *            encoding algorithm identifier takes precendence.
+      * @param id the encoding algorithm identifier.
+      * @param data the data to be encoded using an encoding algorithm.
+-     * @throws EncodingAlgorithmException if the encoding algorithm URI is not 
++     * @throws EncodingAlgorithmException if the encoding algorithm URI is not
+      *         present in the vocabulary, or the encoding algorithm identifier
+      *         is not with the required range.
+      */
+@@ -1425,7 +1660,7 @@
+      * @param d the data, as an array of bytes, to be encoded.
+      * @param offset the offset into the array of bytes.
+      * @param length the length of bytes.
+-     * @throws EncodingAlgorithmException if the encoding algorithm URI is not 
++     * @throws EncodingAlgorithmException if the encoding algorithm URI is not
+      *         present in the vocabulary.
+      */
+     protected final void encodeNonIdentifyingStringOnThirdBit(String URI, int id, byte[] d, int offset, int length) throws FastInfosetException, IOException {
+@@ -1441,7 +1676,7 @@
+     }
+ 
+     /**
+-     * Encode a chunk of Character Information Items using 
++     * Encode a chunk of Character Information Items using
+      * using an encoding algorithm.
+      * Implementation of clause C.15 of ITU-T Rec. X.891 | ISO/IEC 24824-1.
+      *
+@@ -1465,7 +1700,7 @@
+     }
+ 
+     /**
+-     * Encode a chunk of Character Information Items using 
++     * Encode a chunk of Character Information Items using
+      * using an encoding algorithm.
+      * Implementation of clause C.15 of ITU-T Rec. X.891 | ISO/IEC 24824-1.
+      *
+@@ -1489,13 +1724,13 @@
+     }
+ 
+     /**
+-     * Encode a chunk of Character Information Items using 
++     * Encode a chunk of Character Information Items using
+      * using an encoding algorithm.
+      * Implementation of clause C.15 of ITU-T Rec. X.891 | ISO/IEC 24824-1.
+      *
+      * @param id the built in encoding algorithm identifier.
+      * @param data the data to be encoded using an encoding algorithm. The data
+-     *        represents an array of items specified by the encoding algorithm 
++     *        represents an array of items specified by the encoding algorithm
+      *        identifier
+      * @param offset the offset into the array of bytes.
+      * @param length the length of bytes.
+@@ -1508,19 +1743,19 @@
+         // Encode bottom 6 bits of enoding algorithm id
+         _b = (id & 0x3F) << 2;
+ 
+-        final int octetLength = BuiltInEncodingAlgorithmFactory.table[id].
++        final int octetLength = BuiltInEncodingAlgorithmFactory.getAlgorithm(id).
+                     getOctetLengthFromPrimitiveLength(length);
+ 
+         encodeNonZeroOctetStringLengthOnSenventhBit(octetLength);
+ 
+         ensureSize(octetLength);
+-        BuiltInEncodingAlgorithmFactory.table[id].
++        BuiltInEncodingAlgorithmFactory.getAlgorithm(id).
+                 encodeToBytes(data, offset, length, _octetBuffer, _octetBufferIndex);
+         _octetBufferIndex += octetLength;
+     }
+ 
+     /**
+-     * Encode a chunk of Character Information Items using 
++     * Encode a chunk of Character Information Items using
+      * using the CDATA built in encoding algorithm.
+      * Implementation of clause C.15 of ITU-T Rec. X.891 | ISO/IEC 24824-1.
+      *
+@@ -1535,18 +1770,18 @@
+         // Encode bottom 6 bits of enoding algorithm id
+         _b = EncodingAlgorithmIndexes.CDATA << 2;
+ 
+-        
++
+         length = encodeUTF8String(ch, offset, length);
+         encodeNonZeroOctetStringLengthOnSenventhBit(length);
+         write(_encodingBuffer, length);
+     }
+-    
++
+     /**
+      * Encode a non empty identifying string on the first bit of an octet.
+      * Implementation of clause C.13 of ITU-T Rec. X.891 | ISO/IEC 24824-1.
+      *
+      * @param s the identifying string.
+-     * @param map the vocabulary table to use to determin the index of the 
++     * @param map the vocabulary table to use to determin the index of the
+      *        identifying string
+      */
+     protected final void encodeIdentifyingNonEmptyStringOnFirstBit(String s, StringIntMap map) throws IOException {
+@@ -1561,7 +1796,7 @@
+     }
+ 
+     /**
+-     * Encode a non empty string on the second bit of an octet using the UTF-8 
++     * Encode a non empty string on the second bit of an octet using the UTF-8
+      * encoding.
+      * Implementation of clause C.22 of ITU-T Rec. X.891 | ISO/IEC 24824-1.
+      *
+@@ -1599,7 +1834,7 @@
+     }
+ 
+     /**
+-     * Encode a non empty string on the fifth bit of an octet using the UTF-8 
++     * Encode a non empty string on the fifth bit of an octet using the UTF-8
+      * or UTF-16 encoding.
+      * Implementation of clause C.23 of ITU-T Rec. X.891 | ISO/IEC 24824-1.
+      *
+@@ -1612,7 +1847,7 @@
+     }
+ 
+     /**
+-     * Encode a non empty string on the fifth bit of an octet using the UTF-8 
++     * Encode a non empty string on the fifth bit of an octet using the UTF-8
+      * or UTF-16 encoding.
+      * Implementation of clause C.23 of ITU-T Rec. X.891 | ISO/IEC 24824-1.
+      *
+@@ -1653,7 +1888,7 @@
+     }
+ 
+     /**
+-     * Encode a non empty string on the seventh bit of an octet using the UTF-8 
++     * Encode a non empty string on the seventh bit of an octet using the UTF-8
+      * or UTF-16 encoding.
+      * Implementation of clause C.24 of ITU-T Rec. X.891 | ISO/IEC 24824-1.
+      *
+@@ -1668,8 +1903,8 @@
+     }
+ 
+     /**
+-     * Encode a non empty string on the seventh bit of an octet using a restricted 
+-     * alphabet that results in the encoding of a character in 4 bits 
++     * Encode a non empty string on the seventh bit of an octet using a restricted
++     * alphabet that results in the encoding of a character in 4 bits
+      * (or two characters per octet).
+      * Implementation of clause C.24 of ITU-T Rec. X.891 | ISO/IEC 24824-1.
+      *
+@@ -1681,13 +1916,13 @@
+     protected final void encodeNonEmptyFourBitCharacterStringOnSeventhBit(int[] table, char[] ch, int offset, int length) throws FastInfosetException, IOException {
+         final int octetPairLength = length / 2;
+         final int octetSingleLength = length % 2;
+-        
++
+         // Encode the length
+         encodeNonZeroOctetStringLengthOnSenventhBit(octetPairLength + octetSingleLength);
+         encodeNonEmptyFourBitCharacterString(table, ch, offset, octetPairLength, octetSingleLength);
+     }
+-    
+-    protected final void encodeNonEmptyFourBitCharacterString(int[] table, char[] ch, int offset, 
++
++    protected final void encodeNonEmptyFourBitCharacterString(int[] table, char[] ch, int offset,
+             int octetPairLength, int octetSingleLength) throws FastInfosetException, IOException {
+         ensureSize(octetPairLength + octetSingleLength);
+         // Encode all pairs
+@@ -1706,11 +1941,11 @@
+                 throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.characterOutofAlphabetRange"));
+             }
+             _octetBuffer[_octetBufferIndex++] = (byte)v;
+-        }        
++        }
+     }
+-    
++
+     /**
+-     * Encode a non empty string on the seventh bit of an octet using a restricted 
++     * Encode a non empty string on the seventh bit of an octet using a restricted
+      * alphabet table.
+      * Implementation of clause C.24 of ITU-T Rec. X.891 | ISO/IEC 24824-1.
+      *
+@@ -1725,12 +1960,12 @@
+         while ((1 << bitsPerCharacter) <= alphabet.length()) {
+             bitsPerCharacter++;
+         }
+-        
++
+         final int bits = length * bitsPerCharacter;
+         final int octets = bits / 8;
+         final int bitsOfLastOctet = bits % 8;
+         final int totalOctets = octets + ((bitsOfLastOctet > 0) ? 1 : 0);
+-        
++
+         // Encode the length
+         encodeNonZeroOctetStringLengthOnSenventhBit(totalOctets);
+ 
+@@ -1748,9 +1983,9 @@
+             if (v == alphabet.length()) {
+                 throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.characterOutofAlphabetRange"));
+             }
+-            writeBits(bitsPerCharacter, v);            
+-        }        
+-        
++            writeBits(bitsPerCharacter, v);
++        }
++
+         if (bitsOfLastOctet > 0) {
+             _b |= (1 << (8 - bitsOfLastOctet)) - 1;
+             write(_b);
+@@ -1763,7 +1998,7 @@
+         _bitsLeftInOctet = 8;
+         _b = 0;
+     }
+-    
++
+     private final void writeBits(int bits, int v) throws IOException {
+         while (bits > 0) {
+             final int bit = (v & (1 << --bits)) > 0 ? 1 : 0;
+@@ -1775,7 +2010,7 @@
+             }
+         }
+     }
+-    
++
+     /**
+      * Encode the length of a encoded string on the seventh bit
+      * of an octet.
+@@ -1806,14 +2041,14 @@
+      * Encode a non zero integer on the second bit of an octet, setting
+      * the first bit to 1.
+      * Implementation of clause C.24 of ITU-T Rec. X.891 | ISO/IEC 24824-1.
+-     * 
++     *
+      * <p>
+-     * The first bit of the first octet is set, as specified in clause C.13 of 
++     * The first bit of the first octet is set, as specified in clause C.13 of
+      * ITU-T Rec. X.891 | ISO/IEC 24824-1
+      *
+-     * @param i The integer to encode, which is a member of the interval 
++     * @param i The integer to encode, which is a member of the interval
+      *          [0, 1048575]. In the specification the interval is [1, 1048576]
+-     * 
++     *
+      */
+     protected final void encodeNonZeroIntegerOnSecondBitFirstBitOne(int i) throws IOException {
+         if (i < EncodingConstants.INTEGER_2ND_BIT_SMALL_LIMIT) {
+@@ -1836,7 +2071,7 @@
+             write(i & 0xFF);
+         } else {
+             throw new IOException(
+-                    CommonResourceBundle.getInstance().getString("message.integerMaxSize", 
++                    CommonResourceBundle.getInstance().getString("message.integerMaxSize",
+                     new Object[]{Integer.valueOf(EncodingConstants.INTEGER_2ND_BIT_LARGE_LIMIT)}));
+         }
+     }
+@@ -1845,14 +2080,14 @@
+      * Encode a non zero integer on the second bit of an octet, setting
+      * the first bit to 0.
+      * Implementation of clause C.25 of ITU-T Rec. X.891 | ISO/IEC 24824-1.
+-     * 
++     *
+      * <p>
+-     * The first bit of the first octet is set, as specified in clause C.13 of 
++     * The first bit of the first octet is set, as specified in clause C.13 of
+      * ITU-T Rec. X.891 | ISO/IEC 24824-1
+      *
+-     * @param i The integer to encode, which is a member of the interval 
++     * @param i The integer to encode, which is a member of the interval
+      *          [0, 1048575]. In the specification the interval is [1, 1048576]
+-     * 
++     *
+      */
+     protected final void encodeNonZeroIntegerOnSecondBitFirstBitZero(int i) throws IOException {
+         if (i < EncodingConstants.INTEGER_2ND_BIT_SMALL_LIMIT) {
+@@ -1877,10 +2112,10 @@
+     /**
+      * Encode a non zero integer on the third bit of an octet.
+      * Implementation of clause C.27 of ITU-T Rec. X.891 | ISO/IEC 24824-1.
+-     * 
+-     * @param i The integer to encode, which is a member of the interval 
++     *
++     * @param i The integer to encode, which is a member of the interval
+      *          [0, 1048575]. In the specification the interval is [1, 1048576]
+-     * 
++     *
+      */
+     protected final void encodeNonZeroIntegerOnThirdBit(int i) throws IOException {
+         if (i < EncodingConstants.INTEGER_3RD_BIT_SMALL_LIMIT) {
+@@ -1913,10 +2148,10 @@
+     /**
+      * Encode a non zero integer on the fourth bit of an octet.
+      * Implementation of clause C.28 of ITU-T Rec. X.891 | ISO/IEC 24824-1.
+-     * 
+-     * @param i The integer to encode, which is a member of the interval 
++     *
++     * @param i The integer to encode, which is a member of the interval
+      *          [0, 1048575]. In the specification the interval is [1, 1048576]
+-     * 
++     *
+      */
+     protected final void encodeNonZeroIntegerOnFourthBit(int i) throws IOException {
+         if (i < EncodingConstants.INTEGER_4TH_BIT_SMALL_LIMIT) {
+@@ -1948,7 +2183,7 @@
+ 
+     /**
+      * Encode a non empty string using the UTF-8 encoding.
+-     * 
++     *
+      * @param b the current octet that is being written.
+      * @param s the string to be UTF-8 encoded.
+      * @param constants the array of constants to use when encoding to determin
+@@ -1961,7 +2196,7 @@
+ 
+     /**
+      * Encode a non empty string using the UTF-8 encoding.
+-     * 
++     *
+      * @param b the current octet that is being written.
+      * @param ch the array of characters.
+      * @param offset the offset into the array of characters.
+@@ -1978,7 +2213,7 @@
+ 
+     /**
+      * Encode the length of non empty UTF-8 encoded string.
+-     * 
++     *
+      * @param b the current octet that is being written.
+      * @param length the length of the UTF-8 encoded string.
+      *        how the length of the UTF-8 encoded string is encoded.
+@@ -2003,7 +2238,7 @@
+ 
+     /**
+      * Encode a non zero integer.
+-     * 
++     *
+      * @param b the current octet that is being written.
+      * @param i the non zero integer.
+      * @param constants the array of constants to use when encoding to determin
+@@ -2053,7 +2288,7 @@
+     protected final boolean hasMark() {
+         return _markIndex != -1;
+     }
+-    
++
+     /**
+      * Write a byte to the buffered stream.
+      */
+@@ -2125,13 +2360,13 @@
+         }
+     }
+ 
+-    
++
+     private EncodingBufferOutputStream _encodingBufferOutputStream = new EncodingBufferOutputStream();
+ 
+     private byte[] _encodingBuffer = new byte[512];
+ 
+     private int _encodingBufferIndex;
+-    
++
+     private class EncodingBufferOutputStream extends OutputStream {
+ 
+         public void write(int b) throws IOException {
+@@ -2187,7 +2422,7 @@
+             return encodeUTF8String(ch, 0, length);
+         }
+     }
+-        
++
+     private void ensureEncodingBufferSizeForUtf8String(int length) {
+         final int newLength = 4 * length;
+         if (_encodingBuffer.length < newLength) {
+@@ -2194,7 +2429,7 @@
+             _encodingBuffer = new byte[newLength];
+         }
+     }
+-    
++
+     /**
+      * Encode a string using the UTF-8 encoding.
+      *
+@@ -2221,7 +2456,7 @@
+                     (byte) (0xC0 | (c >> 6));    // first 5
+                 _encodingBuffer[bpos++] =
+                     (byte) (0x80 | (c & 0x3F));  // second 6
+-            } else if (c <= '\uFFFF') { 
++            } else if (c <= '\uFFFF') {
+                 if (!XMLChar.isHighSurrogate(c) && !XMLChar.isLowSurrogate(c)) {
+                     // 3 bytes, 16 bits
+                     _encodingBuffer[bpos++] =
+@@ -2241,17 +2476,17 @@
+ 
+         return bpos;
+     }
+-    
++
+     private void encodeCharacterAsUtf8FourByte(int c, char[] ch, int chpos, int chend, int bpos) throws IOException {
+         if (chpos == chend) {
+             throw new IOException("");
+         }
+-        
++
+         final char d = ch[chpos];
+         if (!XMLChar.isLowSurrogate(d)) {
+             throw new IOException("");
+         }
+-        
++
+         final int uc = (((c & 0x3ff) << 10) | (d & 0x3ff)) + 0x10000;
+         if (uc < 0 || uc >= 0x200000) {
+             throw new IOException("");
+@@ -2278,7 +2513,7 @@
+             return encodeUtf16String(ch, 0, length);
+         }
+     }
+-        
++
+     private void ensureEncodingBufferSizeForUtf16String(int length) {
+         final int newLength = 2 * length;
+         if (_encodingBuffer.length < newLength) {
+@@ -2308,7 +2543,7 @@
+ 
+         return byteLength;
+     }
+-    
++
+     /**
+      * Obtain the prefix from a qualified name.
+      *
+@@ -2323,7 +2558,7 @@
+         }
+         return prefix;
+     }
+-    
++
+     /**
+      * Check if character array contains characters that are all white space.
+      *
+@@ -2334,13 +2569,13 @@
+      */
+     public static boolean isWhiteSpace(final char[] ch, int start, final int length) {
+         if (!XMLChar.isSpace(ch[start])) return false;
+-        
++
+         final int end = start + length;
+         while(++start < end && XMLChar.isSpace(ch[start]));
+-        
++
+         return start == end;
+     }
+-    
++
+     /**
+      * Check if a String contains characters that are all white space.
+      *
+@@ -2349,7 +2584,7 @@
+      */
+     public static boolean isWhiteSpace(String s) {
+         if (!XMLChar.isSpace(s.charAt(0))) return false;
+-        
++
+         final int end = s.length();
+         int start = 1;
+         while(start < end && XMLChar.isSpace(s.charAt(start++)));
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/EncodingConstants.java	Thu Jul 30 18:00:06 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/EncodingConstants.java	Thu Jul 30 18:00:05 2009
+@@ -24,9 +24,9 @@
+  *
+  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
+  */
+- 
+ 
+ 
++
+ package com.sun.xml.internal.fastinfoset;
+ 
+ import java.io.UnsupportedEncodingException;
+@@ -36,23 +36,23 @@
+     static {
+         initiateXMLDeclarationValues();
+     }
+-    
++
+     public static final String XML_NAMESPACE_PREFIX = "xml";
+     public static final int XML_NAMESPACE_PREFIX_LENGTH = XML_NAMESPACE_PREFIX.length();
+     public static final String XML_NAMESPACE_NAME = "http://www.w3.org/XML/1998/namespace";
+     public static final int XML_NAMESPACE_NAME_LENGTH = XML_NAMESPACE_NAME.length();
+-            
+-    public static final String XMLNS_NAMESPACE_PREFIX = "xmlns";    
++
++    public static final String XMLNS_NAMESPACE_PREFIX = "xmlns";
+     public static final int XMLNS_NAMESPACE_PREFIX_LENGTH = XMLNS_NAMESPACE_PREFIX.length();
+     public static final String XMLNS_NAMESPACE_NAME = "http://www.w3.org/2000/xmlns/";
+     public static final int XMLNS_NAMESPACE_NAME_LENGTH = XMLNS_NAMESPACE_NAME.length();
+-    
++
+     public static final QualifiedName DEFAULT_NAMESPACE_DECLARATION = new QualifiedName(
+             "",
+             EncodingConstants.XMLNS_NAMESPACE_NAME,
+             EncodingConstants.XMLNS_NAMESPACE_PREFIX,
+             EncodingConstants.XMLNS_NAMESPACE_PREFIX);
+-    
++
+     public static final int DOCUMENT_ADDITIONAL_DATA_FLAG = 0x40; // 01000000
+     public static final int DOCUMENT_INITIAL_VOCABULARY_FLAG = 0x20; // 00100000
+     public static final int DOCUMENT_NOTATIONS_FLAG = 0x10; // 00010000
+@@ -60,7 +60,7 @@
+     public static final int DOCUMENT_CHARACTER_ENCODING_SCHEME = 0x04; // 00000100
+     public static final int DOCUMENT_STANDALONE_FLAG = 0x02; // 00000010
+     public static final int DOCUMENT_VERSION_FLAG = 0x01; // 00000001
+-    
++
+     public static final int INITIAL_VOCABULARY_EXTERNAL_VOCABULARY_FLAG = 0x10; // 00010000
+     public static final int INITIAL_VOCABULARY_RESTRICTED_ALPHABETS_FLAG = 0x08; // 00001000
+     public static final int INITIAL_VOCABULARY_ENCODING_ALGORITHMS_FLAG = 0x04; // 00000100
+@@ -77,40 +77,40 @@
+ 
+     public static final int NAME_SURROGATE_PREFIX_FLAG = 0x02;
+     public static final int NAME_SURROGATE_NAME_FLAG = 0x01;
+-    
++
+     public static final int NOTATIONS = 0xC0; // 110000
+     public static final int NOTATIONS_MASK = 0xFC; // 6 bits
+     public static final int NOTATIONS_SYSTEM_IDENTIFIER_FLAG = 0x02;
+     public static final int NOTATIONS_PUBLIC_IDENTIFIER_FLAG = 0x01;
+-    
++
+     public static final int UNPARSED_ENTITIES = 0xD0; // 1101000
+     public static final int UNPARSED_ENTITIES_MASK = 0xFE; // 7 bits
+     public static final int UNPARSED_ENTITIES_PUBLIC_IDENTIFIER_FLAG = 0x01;
+-    
++
+     public static final int PROCESSING_INSTRUCTION = 0xE1; // 11100001
+     public static final int PROCESSING_INSTRUCTION_MASK = 0xFF; // 8 bits
+-    
++
+     public static final int COMMENT = 0xE2; // 11100010
+     public static final int COMMENT_MASK = 0xFF; // 8 bits
+-    
++
+     public static final int DOCUMENT_TYPE_DECLARATION = 0xC4; // 110001
+     public static final int DOCUMENT_TYPE_DECLARATION_MASK = 0xFC; // 6 bits
+     public static final int DOCUMENT_TYPE_SYSTEM_IDENTIFIER_FLAG = 0x02;
+     public static final int DOCUMENT_TYPE_PUBLIC_IDENTIFIER_FLAG = 0x01;
+-    
++
+     public static final int ELEMENT = 0x00; // 0
+     public static final int ELEMENT_ATTRIBUTE_FLAG = 0x40; // 01000000
+     public static final int ELEMENT_NAMESPACES_FLAG = 0x38; // 00111000
+     public static final int ELEMENT_LITERAL_QNAME_FLAG = 0x3C; // 00111100
+-    
++
+     public static final int NAMESPACE_ATTRIBUTE = 0xCC; // 110011 00
+     public static final int NAMESPACE_ATTRIBUTE_MASK = 0xFC; // 6 bits
+     public static final int NAMESPACE_ATTRIBUTE_PREFIX_NAME_MASK = 0x03; // 2 bits
+     public static final int NAMESPACE_ATTRIBUTE_PREFIX_FLAG = 0x02;
+     public static final int NAMESPACE_ATTRIBUTE_NAME_FLAG = 0x01;
+-    
++
+     public static final int ATTRIBUTE_LITERAL_QNAME_FLAG = 0x78; // 01111000
+-    
++
+     public static final int LITERAL_QNAME_PREFIX_NAMESPACE_NAME_MASK = 0x03;
+     public static final int LITERAL_QNAME_PREFIX_FLAG = 0x02;
+     public static final int LITERAL_QNAME_NAMESPACE_NAME_FLAG = 0x01;
+@@ -121,42 +121,42 @@
+     public static final int CHARACTER_CHUNK_UTF_16_FLAG = 0x04; // 00000100
+     public static final int CHARACTER_CHUNK_RESTRICTED_ALPHABET_FLAG = 0x08; // 00001000
+     public static final int CHARACTER_CHUNK_ENCODING_ALGORITHM_FLAG = 0x0C; // 00001100
+-    
++
+     public static final int UNEXPANDED_ENTITY_REFERENCE = 0xC8; // 110010
+     public static final int UNEXPANDED_ENTITY_REFERENCE_MASK = 0xFC; // 6 bits
+     public static final int UNEXPANDED_ENTITY_SYSTEM_IDENTIFIER_FLAG = 0x02;
+     public static final int UNEXPANDED_ENTITY_PUBLIC_IDENTIFIER_FLAG = 0x01;
+-    
++
+     public static final int NISTRING_ADD_TO_TABLE_FLAG = 0x40; // 01000000
+     public static final int NISTRING_UTF_8_FLAG = 0x00; // 00000000
+     public static final int NISTRING_UTF_16_FLAG = 0x10; // 00010000
+     public static final int NISTRING_RESTRICTED_ALPHABET_FLAG = 0x20; // 00100000
+     public static final int NISTRING_ENCODING_ALGORITHM_FLAG = 0x30; // 00110000
+-    
++
+     public static final int TERMINATOR = 0xF0;
+     public static final int DOUBLE_TERMINATOR = 0xFF;
+ 
+-    
++
+     public static final int ENCODING_ALGORITHM_BUILTIN_END = 9;
+     public static final int ENCODING_ALGORITHM_APPLICATION_START = 32;
+     public static final int ENCODING_ALGORITHM_APPLICATION_MAX = 255;
+-    
++
+     public static final int RESTRICTED_ALPHABET_BUILTIN_END = 1;
+     public static final int RESTRICTED_ALPHABET_APPLICATION_START = 32;
+     public static final int RESTRICTED_ALPHABET_APPLICATION_MAX = 255;
+-    
++
+     // Octet string length contants
+-    
++
+     public static final int OCTET_STRING_LENGTH_SMALL_LIMIT = 0;
+     public static final int OCTET_STRING_LENGTH_MEDIUM_LIMIT = 1;
+     public static final int OCTET_STRING_LENGTH_MEDIUM_FLAG = 2;
+     public static final int OCTET_STRING_LENGTH_LARGE_FLAG = 3;
+-    
++
+     public static final long OCTET_STRING_MAXIMUM_LENGTH = 4294967296L;
+-    
++
+     /*
+      * C.22
+-     */    
++     */
+     public static final int OCTET_STRING_LENGTH_2ND_BIT_SMALL_LIMIT = 65;
+     public static final int OCTET_STRING_LENGTH_2ND_BIT_MEDIUM_LIMIT = 321;
+     public static final int OCTET_STRING_LENGTH_2ND_BIT_MEDIUM_FLAG = 0x40;
+@@ -169,16 +169,16 @@
+         OCTET_STRING_LENGTH_2ND_BIT_MEDIUM_FLAG,
+         OCTET_STRING_LENGTH_2ND_BIT_LARGE_FLAG
+     };
+-    
++
+     /*
+      * C.23
+-     */    
++     */
+     public static final int OCTET_STRING_LENGTH_5TH_BIT_SMALL_LIMIT = 9;
+     public static final int OCTET_STRING_LENGTH_5TH_BIT_MEDIUM_LIMIT = 265;
+     public static final int OCTET_STRING_LENGTH_5TH_BIT_MEDIUM_FLAG = 0x08;
+     public static final int OCTET_STRING_LENGTH_5TH_BIT_LARGE_FLAG = 0x0C;
+     public static final int OCTET_STRING_LENGTH_5TH_BIT_SMALL_MASK = 0x07;
+-    
++
+     /* package */ static final int[] OCTET_STRING_LENGTH_5TH_BIT_VALUES = {
+         OCTET_STRING_LENGTH_5TH_BIT_SMALL_LIMIT,
+         OCTET_STRING_LENGTH_5TH_BIT_MEDIUM_LIMIT,
+@@ -202,9 +202,9 @@
+         OCTET_STRING_LENGTH_7TH_BIT_LARGE_FLAG
+     };
+ 
+-    
++
+     // Integer
+-    
++
+     public static final int INTEGER_SMALL_LIMIT = 0;
+     public static final int INTEGER_MEDIUM_LIMIT = 1;
+     public static final int INTEGER_LARGE_LIMIT = 2;
+@@ -225,7 +225,7 @@
+     public static final int INTEGER_2ND_BIT_SMALL_MASK = 0x3F;
+     public static final int INTEGER_2ND_BIT_MEDIUM_MASK = 0x1F;
+     public static final int INTEGER_2ND_BIT_LARGE_MASK = 0x0F;
+-    
++
+     /* package */ static final int[] INTEGER_2ND_BIT_VALUES = {
+         INTEGER_2ND_BIT_SMALL_LIMIT,
+         INTEGER_2ND_BIT_MEDIUM_LIMIT,
+@@ -257,7 +257,7 @@
+         INTEGER_3RD_BIT_LARGE_FLAG,
+         INTEGER_3RD_BIT_LARGE_LARGE_FLAG
+     };
+-    
++
+     /*
+      * C.28
+      */
+@@ -266,7 +266,7 @@
+     public static final int INTEGER_4TH_BIT_LARGE_LIMIT = 263184;
+     public static final int INTEGER_4TH_BIT_MEDIUM_FLAG = 0x10;
+     public static final int INTEGER_4TH_BIT_LARGE_FLAG = 0x14;
+-    public static final int INTEGER_4TH_BIT_LARGE_LARGE_FLAG = 0x18;    
++    public static final int INTEGER_4TH_BIT_LARGE_LARGE_FLAG = 0x18;
+     public static final int INTEGER_4TH_BIT_SMALL_MASK = 0x0F;
+     public static final int INTEGER_4TH_BIT_MEDIUM_MASK = 0x03;
+     public static final int INTEGER_4TH_BIT_LARGE_MASK = 0x03;
+@@ -279,15 +279,15 @@
+         INTEGER_4TH_BIT_LARGE_FLAG,
+         INTEGER_4TH_BIT_LARGE_LARGE_FLAG
+     };
+-        
++
+     /* package */ static final byte[] BINARY_HEADER = {(byte)0xE0, 0, 0, 1};
+-    
++
+     /* package */ static byte[][] XML_DECLARATION_VALUES;
+-    
++
+     private static void initiateXMLDeclarationValues() {
+-        
++
+         XML_DECLARATION_VALUES = new byte[9][];
+-        
++
+         try {
+             XML_DECLARATION_VALUES[0] = "<?xml encoding='finf'?>".getBytes("UTF-8");
+             XML_DECLARATION_VALUES[1] = "<?xml version='1.0' encoding='finf'?>".getBytes("UTF-8");
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/Notation.java	Thu Jul 30 18:00:09 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/Notation.java	Thu Jul 30 18:00:09 2009
+@@ -24,8 +24,8 @@
+  *
+  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
+  */
+- 
+ 
++
+ package com.sun.xml.internal.fastinfoset;
+ 
+ public class Notation {
+@@ -32,7 +32,7 @@
+     public final String name;
+     public final String systemIdentifier;
+     public final String publicIdentifier;
+-    
++
+     /** Creates a new instance of Notation */
+     public Notation(String _name, String _systemIdentifier, String _publicIdentifier) {
+         name = _name;
+@@ -39,5 +39,5 @@
+         systemIdentifier = _systemIdentifier;
+         publicIdentifier = _publicIdentifier;
+     }
+-    
++
+ }
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/QualifiedName.java	Thu Jul 30 18:00:13 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/QualifiedName.java	Thu Jul 30 18:00:12 2009
+@@ -24,9 +24,9 @@
+  *
+  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
+  */
+- 
+ 
+ 
++
+ package com.sun.xml.internal.fastinfoset;
+ 
+ import javax.xml.namespace.QName;
+@@ -43,9 +43,9 @@
+     public int attributeId;
+     public int attributeHash;
+     private QName qNameObject;
+-    
++
+     public QualifiedName() { }
+-    
++
+     public QualifiedName(String prefix, String namespaceName, String localName, String qName) {
+         this.prefix = prefix;
+         this.namespaceName = namespaceName;
+@@ -53,9 +53,9 @@
+         this.qName = qName;
+         this.index = -1;
+         this.prefixIndex = 0;
+-        this.namespaceNameIndex = 0;        
++        this.namespaceNameIndex = 0;
+         this.localNameIndex = -1;
+-    }    
++    }
+ 
+     public void set(String prefix, String namespaceName, String localName, String qName) {
+         this.prefix = prefix;
+@@ -64,11 +64,11 @@
+         this.qName = qName;
+         this.index = -1;
+         this.prefixIndex = 0;
+-        this.namespaceNameIndex = 0;        
++        this.namespaceNameIndex = 0;
+         this.localNameIndex = -1;
+         this.qNameObject = null;
+-    }    
+-    
++    }
++
+     public QualifiedName(String prefix, String namespaceName, String localName, String qName, int index) {
+         this.prefix = prefix;
+         this.namespaceName = namespaceName;
+@@ -76,10 +76,10 @@
+         this.qName = qName;
+         this.index = index;
+         this.prefixIndex = 0;
+-        this.namespaceNameIndex = 0;        
++        this.namespaceNameIndex = 0;
+         this.localNameIndex = -1;
+-    }    
+-    
++    }
++
+     public final QualifiedName set(String prefix, String namespaceName, String localName, String qName, int index) {
+         this.prefix = prefix;
+         this.namespaceName = namespaceName;
+@@ -87,13 +87,13 @@
+         this.qName = qName;
+         this.index = index;
+         this.prefixIndex = 0;
+-        this.namespaceNameIndex = 0;        
++        this.namespaceNameIndex = 0;
+         this.localNameIndex = -1;
+         this.qNameObject = null;
+         return this;
+-    }    
+-    
+-    public QualifiedName(String prefix, String namespaceName, String localName, String qName, int index, 
++    }
++
++    public QualifiedName(String prefix, String namespaceName, String localName, String qName, int index,
+             int prefixIndex, int namespaceNameIndex, int localNameIndex) {
+         this.prefix = prefix;
+         this.namespaceName = namespaceName;
+@@ -103,9 +103,9 @@
+         this.prefixIndex = prefixIndex + 1;
+         this.namespaceNameIndex = namespaceNameIndex + 1;
+         this.localNameIndex = localNameIndex;
+-    }    
+-    
+-    public final QualifiedName set(String prefix, String namespaceName, String localName, String qName, int index, 
++    }
++
++    public final QualifiedName set(String prefix, String namespaceName, String localName, String qName, int index,
+             int prefixIndex, int namespaceNameIndex, int localNameIndex) {
+         this.prefix = prefix;
+         this.namespaceName = namespaceName;
+@@ -117,8 +117,8 @@
+         this.localNameIndex = localNameIndex;
+         this.qNameObject = null;
+         return this;
+-    }    
+-    
++    }
++
+     public QualifiedName(String prefix, String namespaceName, String localName) {
+         this.prefix = prefix;
+         this.namespaceName = namespaceName;
+@@ -126,9 +126,9 @@
+         this.qName = createQNameString(prefix, localName);
+         this.index = -1;
+         this.prefixIndex = 0;
+-        this.namespaceNameIndex = 0;        
++        this.namespaceNameIndex = 0;
+         this.localNameIndex = -1;
+-    }    
++    }
+ 
+     public final QualifiedName set(String prefix, String namespaceName, String localName) {
+         this.prefix = prefix;
+@@ -137,14 +137,14 @@
+         this.qName = createQNameString(prefix, localName);
+         this.index = -1;
+         this.prefixIndex = 0;
+-        this.namespaceNameIndex = 0;        
++        this.namespaceNameIndex = 0;
+         this.localNameIndex = -1;
+         this.qNameObject = null;
+         return this;
+-    }    
+-    
+-    public QualifiedName(String prefix, String namespaceName, String localName, 
+-            int prefixIndex, int namespaceNameIndex, int localNameIndex, 
++    }
++
++    public QualifiedName(String prefix, String namespaceName, String localName,
++            int prefixIndex, int namespaceNameIndex, int localNameIndex,
+             char[] charBuffer) {
+         this.prefix = prefix;
+         this.namespaceName = namespaceName;
+@@ -170,10 +170,10 @@
+         this.namespaceNameIndex = namespaceNameIndex + 1;
+         this.localNameIndex = localNameIndex;
+         this.index = -1;
+-    }    
+-    
+-    public final QualifiedName set(String prefix, String namespaceName, String localName, 
+-            int prefixIndex, int namespaceNameIndex, int localNameIndex, 
++    }
++
++    public final QualifiedName set(String prefix, String namespaceName, String localName,
++            int prefixIndex, int namespaceNameIndex, int localNameIndex,
+             char[] charBuffer) {
+         this.prefix = prefix;
+         this.namespaceName = namespaceName;
+@@ -201,8 +201,8 @@
+         this.index = -1;
+         this.qNameObject = null;
+         return this;
+-    }    
+-    
++    }
++
+     public QualifiedName(String prefix, String namespaceName, String localName, int index) {
+         this.prefix = prefix;
+         this.namespaceName = namespaceName;
+@@ -210,10 +210,10 @@
+         this.qName = createQNameString(prefix, localName);
+         this.index = index;
+         this.prefixIndex = 0;
+-        this.namespaceNameIndex = 0;        
++        this.namespaceNameIndex = 0;
+         this.localNameIndex = -1;
+-    }    
+-    
++    }
++
+     public final QualifiedName set(String prefix, String namespaceName, String localName, int index) {
+         this.prefix = prefix;
+         this.namespaceName = namespaceName;
+@@ -221,13 +221,13 @@
+         this.qName = createQNameString(prefix, localName);
+         this.index = index;
+         this.prefixIndex = 0;
+-        this.namespaceNameIndex = 0;        
++        this.namespaceNameIndex = 0;
+         this.localNameIndex = -1;
+         this.qNameObject = null;
+         return this;
+-    }    
+-    
+-    public QualifiedName(String prefix, String namespaceName, String localName, int index, 
++    }
++
++    public QualifiedName(String prefix, String namespaceName, String localName, int index,
+             int prefixIndex, int namespaceNameIndex, int localNameIndex) {
+         this.prefix = prefix;
+         this.namespaceName = namespaceName;
+@@ -237,9 +237,9 @@
+         this.prefixIndex = prefixIndex + 1;
+         this.namespaceNameIndex = namespaceNameIndex + 1;
+         this.localNameIndex = localNameIndex;
+-    }    
+-    
+-    public final QualifiedName set(String prefix, String namespaceName, String localName, int index, 
++    }
++
++    public final QualifiedName set(String prefix, String namespaceName, String localName, int index,
+             int prefixIndex, int namespaceNameIndex, int localNameIndex) {
+         this.prefix = prefix;
+         this.namespaceName = namespaceName;
+@@ -251,8 +251,8 @@
+         this.localNameIndex = localNameIndex;
+         this.qNameObject = null;
+         return this;
+-    }    
+-    
++    }
++
+     // Qualified Name as a Namespace Name
+     public QualifiedName(String prefix, String namespaceName) {
+         this.prefix = prefix;
+@@ -261,10 +261,10 @@
+         this.qName = "";
+         this.index = -1;
+         this.prefixIndex = 0;
+-        this.namespaceNameIndex = 0;       
++        this.namespaceNameIndex = 0;
+         this.localNameIndex = -1;
+     }
+-    
++
+     public final QualifiedName set(String prefix, String namespaceName) {
+         this.prefix = prefix;
+         this.namespaceName = namespaceName;
+@@ -272,33 +272,33 @@
+         this.qName = "";
+         this.index = -1;
+         this.prefixIndex = 0;
+-        this.namespaceNameIndex = 0;       
++        this.namespaceNameIndex = 0;
+         this.localNameIndex = -1;
+         this.qNameObject = null;
+         return this;
+     }
+-    
++
+     public final QName getQName() {
+         if (qNameObject == null) {
+             qNameObject = new QName(namespaceName, localName, prefix);
+         }
+-        
++
+         return qNameObject;
+     }
+-    
++
+     public final String getQNameString() {
+         if (this.qName != "") {
+             return this.qName;
+         }
+-        
++
+         return this.qName = createQNameString(prefix, localName);
+     }
+-    
++
+     public final void createAttributeValues(int size) {
+         attributeId = localNameIndex | (namespaceNameIndex << 20);
+         attributeHash = localNameIndex % size;
+     }
+-    
++
+     private final String createQNameString(String p, String l) {
+         if (p != null && p.length() > 0) {
+             final StringBuffer b = new StringBuffer(p);
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/UnparsedEntity.java	Thu Jul 30 18:00:16 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/UnparsedEntity.java	Thu Jul 30 18:00:16 2009
+@@ -24,17 +24,17 @@
+  *
+  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
+  */
+- 
+ 
++
+ package com.sun.xml.internal.fastinfoset;
+ 
+ public class UnparsedEntity extends Notation {
+     public final String notationName;
+-    
++
+     /** Creates a new instance of UnparsedEntityDeclaration */
+     public UnparsedEntity(String _name, String _systemIdentifier, String _publicIdentifier, String _notationName) {
+         super(_name, _systemIdentifier, _publicIdentifier);
+         notationName = _notationName;
+     }
+-    
++
+ }
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/BASE64EncodingAlgorithm.java	Thu Jul 30 18:00:20 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/BASE64EncodingAlgorithm.java	Thu Jul 30 18:00:19 2009
+@@ -35,7 +35,7 @@
+ import com.sun.xml.internal.fastinfoset.CommonResourceBundle;
+ 
+ public class BASE64EncodingAlgorithm extends BuiltInEncodingAlgorithm {
+-    
++
+     /* package */ static final char encodeBase64[] = {
+         'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
+         'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
+@@ -119,31 +119,31 @@
+         System.arraycopy(b, start, data, 0, length);
+         return data;
+     }
+-    
++
+     public final Object decodeFromInputStream(InputStream s) throws IOException {
+         throw new UnsupportedOperationException(CommonResourceBundle.getInstance().getString("message.notImplemented"));
+     }
+-    
+-    
++
++
+     public void encodeToOutputStream(Object data, OutputStream s) throws IOException {
+         if (!(data instanceof byte[])) {
+             throw new IllegalArgumentException(CommonResourceBundle.getInstance().getString("message.dataNotByteArray"));
+         }
+-        
++
+         s.write((byte[])data);
+     }
+-    
++
+     public final Object convertFromCharacters(char[] ch, int start, int length) {
+         if (length == 0) {
+             return new byte[0];
+         }
+-        
++
+         StringBuffer encodedValue = removeWhitespace(ch, start, length);
+         int encodedLength = encodedValue.length();
+         if (encodedLength == 0) {
+             return new byte[0];
+         }
+-        
++
+         int blockCount = encodedLength / 4;
+         int partialBlockLength = 3;
+ 
+@@ -176,16 +176,16 @@
+ 
+         return value;
+     }
+-    
++
+     public final void convertToCharacters(Object data, StringBuffer s) {
+         if (data == null) {
+             return;
+         }
+         final byte[] value = (byte[]) data;
+-        
++
+         convertToCharacters(value, 0, value.length, s);
+     }
+-    
++
+     public final int getPrimtiveLengthFromOctetLength(int octetLength) throws EncodingAlgorithmException {
+         return octetLength;
+     }
+@@ -193,10 +193,10 @@
+     public int getOctetLengthFromPrimitiveLength(int primitiveLength) {
+         return primitiveLength;
+     }
+-    
++
+     public final void encodeToBytes(Object array, int astart, int alength, byte[] b, int start) {
+         System.arraycopy((byte[])array, astart, b, start, alength);
+-    }    
++    }
+ 
+     public final void convertToCharacters(byte[] data, int offset, int length, StringBuffer s) {
+         if (data == null) {
+@@ -206,10 +206,10 @@
+         if (length == 0) {
+             return;
+         }
+-        
++
+         final int partialBlockLength = length % 3;
+-        final int blockCount = (partialBlockLength != 0) ? 
+-            length / 3 + 1 : 
++        final int blockCount = (partialBlockLength != 0) ?
++            length / 3 + 1 :
+             length / 3;
+ 
+         final int encodedLength = blockCount * 4;
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/BooleanEncodingAlgorithm.java	Thu Jul 30 18:00:24 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/BooleanEncodingAlgorithm.java	Thu Jul 30 18:00:24 2009
+@@ -50,7 +50,7 @@
+  *
+  */
+ public class BooleanEncodingAlgorithm extends BuiltInEncodingAlgorithm {
+-    
++
+     /** Table for setting a particular bit of a byte */
+     private static final int[] BIT_TABLE = {
+         1 << 7,
+@@ -61,7 +61,7 @@
+         1 << 2,
+         1 << 1,
+         1 << 0};
+-                
++
+     public int getPrimtiveLengthFromOctetLength(int octetLength) throws EncodingAlgorithmException {
+         // Cannot determine the number of boolean values from just the octet length
+         throw new UnsupportedOperationException();
+@@ -72,10 +72,10 @@
+             return 1;
+         } else {
+             final int div = primitiveLength / 8;
+-            return (div == 0) ? 2 : 1 + div;             
+-        }         
++            return (div == 0) ? 2 : 1 + div;
++        }
+     }
+-                
++
+     public final Object decodeFromBytes(byte[] b, int start, int length) throws EncodingAlgorithmException {
+         final int blength = getPrimtiveLengthFromOctetLength(length, b[start]);
+         boolean[] data = new boolean[blength];
+@@ -82,17 +82,17 @@
+ 
+         decodeFromBytesToBooleanArray(data, 0, blength, b, start, length);
+         return data;
+-    }                
+-                
++    }
++
+     public final Object decodeFromInputStream(InputStream s) throws IOException {
+         final List booleanList = new ArrayList();
+ 
+         int value = s.read();
+         if (value == -1) {
+-            throw new EOFException();            
++            throw new EOFException();
+         }
+         final int unusedBits = (value >> 4) & 0xFF;
+-                   
++
+         int bitPosition = 4;
+         int bitPositionEnd = 8;
+         int valueNext = 0;
+@@ -101,18 +101,18 @@
+             if (valueNext == -1) {
+                 bitPositionEnd -= unusedBits;
+             }
+-            
++
+             while(bitPosition < bitPositionEnd) {
+                 booleanList.add(
+                         Boolean.valueOf((value & BIT_TABLE[bitPosition++]) > 0));
+             }
+-            
++
+             value = valueNext;
+         } while (value != -1);
+-        
++
+         return generateArrayFromList(booleanList);
+     }
+-                
++
+     public void encodeToOutputStream(Object data, OutputStream s) throws IOException {
+         if (!(data instanceof boolean[])) {
+             throw new IllegalArgumentException(CommonResourceBundle.getInstance().getString("message.dataNotBoolean"));
+@@ -120,10 +120,10 @@
+ 
+         boolean array[] = (boolean[])data;
+         final int alength = array.length;
+-        
++
+         final int mod = (alength + 4) % 8;
+         final int unusedBits = (mod == 0) ? 0 : 8 - mod;
+-        
++
+         int bitPosition = 4;
+         int value = unusedBits << 4;
+         int astart = 0;
+@@ -131,18 +131,18 @@
+             if (array[astart++]) {
+                 value |= BIT_TABLE[bitPosition];
+             }
+-            
++
+             if (++bitPosition == 8) {
+                 s.write(value);
+                 bitPosition = value = 0;
+             }
+         }
+-        
++
+         if (bitPosition != 8) {
+             s.write(value);
+         }
+     }
+-                                
++
+     public final Object convertFromCharacters(char[] ch, int start, int length) {
+         if (length == 0) {
+             return new boolean[0];
+@@ -204,9 +204,9 @@
+                throw new EncodingAlgorithmException(CommonResourceBundle.getInstance().getString("message.unusedBits8"));
+            }
+            return octetLength * 8 - 4 - unusedBits;
+-        } 
++        }
+     }
+-    
++
+     public final void decodeFromBytesToBooleanArray(boolean[] bdata, int bstart, int blength, byte[] b, int start, int length) {
+         int value = b[start++] & 0xFF;
+         int bitPosition = 4;
+@@ -216,11 +216,11 @@
+                 value = b[start++] & 0xFF;
+                 bitPosition = 0;
+             }
+-            
++
+             bdata[bstart++] = (value & BIT_TABLE[bitPosition++]) > 0;
+         }
+     }
+-                
++
+     public void encodeToBytes(Object array, int astart, int alength, byte[] b, int start) {
+         if (!(array instanceof boolean[])) {
+             throw new IllegalArgumentException(CommonResourceBundle.getInstance().getString("message.dataNotBoolean"));
+@@ -228,11 +228,11 @@
+ 
+         encodeToBytesFromBooleanArray((boolean[])array, astart, alength, b, start);
+     }
+-    
++
+     public void encodeToBytesFromBooleanArray(boolean[] array, int astart, int alength, byte[] b, int start) {
+         final int mod = (alength + 4) % 8;
+         final int unusedBits = (mod == 0) ? 0 : 8 - mod;
+-        
++
+         int bitPosition = 4;
+         int value = unusedBits << 4;
+         final int aend = astart + alength;
+@@ -240,13 +240,13 @@
+             if (array[astart++]) {
+                 value |= BIT_TABLE[bitPosition];
+             }
+-            
++
+             if (++bitPosition == 8) {
+                 b[start++] = (byte)value;
+                 bitPosition = value = 0;
+             }
+         }
+-        
++
+         if (bitPosition > 0) {
+             b[start] = (byte)value;
+         }
+@@ -268,6 +268,5 @@
+ 
+         return bdata;
+     }
+-           
+-}
+ 
++}
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/BuiltInEncodingAlgorithm.java	Thu Jul 30 18:00:28 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/BuiltInEncodingAlgorithm.java	Thu Jul 30 18:00:27 2009
+@@ -42,11 +42,11 @@
+     public abstract int getOctetLengthFromPrimitiveLength(int primitiveLength);
+ 
+     public abstract void encodeToBytes(Object array, int astart, int alength, byte[] b, int start);
+-        
++
+     public interface WordListener {
+         public void word(int start, int end);
+     }
+-    
++
+     public void matchWhiteSpaceDelimnatedWords(CharBuffer cb, WordListener wl) {
+         Matcher m = SPACE_PATTERN.matcher(cb);
+         int i = 0;
+@@ -61,7 +61,7 @@
+         if (i != cb.length())
+             wl.word(i, cb.length());
+     }
+-    
++
+     public StringBuffer removeWhitespace(char[] ch, int start, int length) {
+         StringBuffer buf = new StringBuffer();
+         int firstNonWS = 0;
+@@ -79,5 +79,5 @@
+         }
+         return buf;
+     }
+-    
++
+ }
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/BuiltInEncodingAlgorithmFactory.java	Thu Jul 30 18:00:31 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/BuiltInEncodingAlgorithmFactory.java	Thu Jul 30 18:00:31 2009
+@@ -33,27 +33,27 @@
+ 
+ public final class BuiltInEncodingAlgorithmFactory {
+ 
+-    public final static BuiltInEncodingAlgorithm[] table =
++    private final static BuiltInEncodingAlgorithm[] table =
+             new BuiltInEncodingAlgorithm[EncodingConstants.ENCODING_ALGORITHM_BUILTIN_END + 1];
+ 
+     public final static HexadecimalEncodingAlgorithm hexadecimalEncodingAlgorithm = new HexadecimalEncodingAlgorithm();
+-    
++
+     public final static BASE64EncodingAlgorithm base64EncodingAlgorithm = new BASE64EncodingAlgorithm();
+ 
+     public final static BooleanEncodingAlgorithm booleanEncodingAlgorithm = new BooleanEncodingAlgorithm();
+-    
++
+     public final static ShortEncodingAlgorithm shortEncodingAlgorithm = new ShortEncodingAlgorithm();
+ 
+     public final static IntEncodingAlgorithm intEncodingAlgorithm = new IntEncodingAlgorithm();
+ 
+     public final static LongEncodingAlgorithm longEncodingAlgorithm = new LongEncodingAlgorithm();
+-    
++
+     public final static FloatEncodingAlgorithm floatEncodingAlgorithm = new FloatEncodingAlgorithm();
+ 
+     public final static DoubleEncodingAlgorithm doubleEncodingAlgorithm = new DoubleEncodingAlgorithm();
+-    
++
+     public final static UUIDEncodingAlgorithm uuidEncodingAlgorithm = new UUIDEncodingAlgorithm();
+-    
++
+     static {
+         table[EncodingAlgorithmIndexes.HEXADECIMAL] = hexadecimalEncodingAlgorithm;
+         table[EncodingAlgorithmIndexes.BASE64] = base64EncodingAlgorithm;
+@@ -65,4 +65,8 @@
+         table[EncodingAlgorithmIndexes.DOUBLE] = doubleEncodingAlgorithm;
+         table[EncodingAlgorithmIndexes.UUID] = uuidEncodingAlgorithm;
+     }
++
++    public static BuiltInEncodingAlgorithm getAlgorithm(int index) {
++        return table[index];
++    }
+ }
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/BuiltInEncodingAlgorithmState.java	Thu Jul 30 18:00:35 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/BuiltInEncodingAlgorithmState.java	Thu Jul 30 18:00:35 2009
+@@ -31,16 +31,16 @@
+ public class BuiltInEncodingAlgorithmState {
+ 
+     public static final int INITIAL_LENGTH = 8;
+-    
++
+     public boolean[] booleanArray = new boolean[INITIAL_LENGTH];
+-    
++
+     public short[] shortArray = new short[INITIAL_LENGTH];
+-    
++
+     public int[] intArray = new int[INITIAL_LENGTH];
+ 
+     public long[] longArray = new long[INITIAL_LENGTH];
+-        
++
+     public float[] floatArray = new float[INITIAL_LENGTH];
+ 
+-    public double[] doubleArray = new double[INITIAL_LENGTH];    
++    public double[] doubleArray = new double[INITIAL_LENGTH];
+ }
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/DoubleEncodingAlgorithm.java	Thu Jul 30 18:00:39 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/DoubleEncodingAlgorithm.java	Thu Jul 30 18:00:38 2009
+@@ -47,40 +47,40 @@
+             throw new EncodingAlgorithmException(CommonResourceBundle.getInstance().
+                     getString("message.lengthIsNotMultipleOfDouble", new Object[]{Integer.valueOf(DOUBLE_SIZE)}));
+         }
+-        
++
+         return octetLength / DOUBLE_SIZE;
+     }
+-    
++
+     public int getOctetLengthFromPrimitiveLength(int primitiveLength) {
+         return primitiveLength * DOUBLE_SIZE;
+     }
+-   
++
+     public final Object decodeFromBytes(byte[] b, int start, int length) throws EncodingAlgorithmException {
+         double[] data = new double[getPrimtiveLengthFromOctetLength(length)];
+         decodeFromBytesToDoubleArray(data, 0, b, start, length);
+-        
++
+         return data;
+     }
+-    
++
+     public final Object decodeFromInputStream(InputStream s) throws IOException {
+         return decodeFromInputStreamToDoubleArray(s);
+     }
+-    
+-    
++
++
+     public void encodeToOutputStream(Object data, OutputStream s) throws IOException {
+         if (!(data instanceof double[])) {
+             throw new IllegalArgumentException(CommonResourceBundle.getInstance().getString("message.dataNotDouble"));
+         }
+-        
++
+         final double[] fdata = (double[])data;
+-        
++
+         encodeToOutputStreamFromDoubleArray(fdata, s);
+     }
+-    
++
+     public final Object convertFromCharacters(char[] ch, int start, int length) {
+         final CharBuffer cb = CharBuffer.wrap(ch, start, length);
+         final List doubleList = new ArrayList();
+-        
++
+         matchWhiteSpaceDelimnatedWords(cb,
+                 new WordListener() {
+             public void word(int start, int end) {
+@@ -89,41 +89,41 @@
+             }
+         }
+         );
+-        
++
+         return generateArrayFromList(doubleList);
+     }
+-    
++
+     public final void convertToCharacters(Object data, StringBuffer s) {
+         if (!(data instanceof double[])) {
+             throw new IllegalArgumentException(CommonResourceBundle.getInstance().getString("message.dataNotDouble"));
+         }
+-        
++
+         final double[] fdata = (double[])data;
+-        
++
+         convertToCharactersFromDoubleArray(fdata, s);
+     }
+-    
+-    
++
++
+     public final void decodeFromBytesToDoubleArray(double[] data, int fstart, byte[] b, int start, int length) {
+         final int size = length / DOUBLE_SIZE;
+         for (int i = 0; i < size; i++) {
+             final long bits =
+-                    ((long)(b[start++] & 0xFF) << 56) | 
+-                    ((long)(b[start++] & 0xFF) << 48) | 
+-                    ((long)(b[start++] & 0xFF) << 40) | 
+-                    ((long)(b[start++] & 0xFF) << 32) | 
+-                    ((long)(b[start++] & 0xFF) << 24) | 
+-                    ((long)(b[start++] & 0xFF) << 16) | 
+-                    ((long)(b[start++] & 0xFF) << 8) | 
++                    ((long)(b[start++] & 0xFF) << 56) |
++                    ((long)(b[start++] & 0xFF) << 48) |
++                    ((long)(b[start++] & 0xFF) << 40) |
++                    ((long)(b[start++] & 0xFF) << 32) |
++                    ((long)(b[start++] & 0xFF) << 24) |
++                    ((long)(b[start++] & 0xFF) << 16) |
++                    ((long)(b[start++] & 0xFF) << 8) |
+                     (long)(b[start++] & 0xFF);
+             data[fstart++] = Double.longBitsToDouble(bits);
+         }
+     }
+-    
++
+     public final double[] decodeFromInputStreamToDoubleArray(InputStream s) throws IOException {
+         final List doubleList = new ArrayList();
+         final byte[] b = new byte[DOUBLE_SIZE];
+-        
++
+         while (true) {
+             int n = s.read(b);
+             if (n != DOUBLE_SIZE) {
+@@ -130,7 +130,7 @@
+                 if (n == -1) {
+                     break;
+                 }
+-                
++
+                 while(n != DOUBLE_SIZE) {
+                     final int m = s.read(b, n, DOUBLE_SIZE - n);
+                     if (m == -1) {
+@@ -139,24 +139,24 @@
+                     n += m;
+                 }
+             }
+-            
+-            final long bits = 
+-                    ((long)(b[0] & 0xFF) << 56) | 
+-                    ((long)(b[1] & 0xFF) << 48) | 
+-                    ((long)(b[2] & 0xFF) << 40) | 
+-                    ((long)(b[3] & 0xFF) << 32) | 
+-                    ((b[4] & 0xFF) << 24) | 
+-                    ((b[5] & 0xFF) << 16) | 
+-                    ((b[6] & 0xFF) << 8) | 
++
++            final long bits =
++                    ((long)(b[0] & 0xFF) << 56) |
++                    ((long)(b[1] & 0xFF) << 48) |
++                    ((long)(b[2] & 0xFF) << 40) |
++                    ((long)(b[3] & 0xFF) << 32) |
++                    ((b[4] & 0xFF) << 24) |
++                    ((b[5] & 0xFF) << 16) |
++                    ((b[6] & 0xFF) << 8) |
+                     (b[7] & 0xFF);
+-            
++
+             doubleList.add(Double.valueOf(Double.longBitsToDouble(bits)));
+         }
+-        
++
+         return generateArrayFromList(doubleList);
+     }
+-    
+-    
++
++
+     public final void encodeToOutputStreamFromDoubleArray(double[] fdata, OutputStream s) throws IOException {
+         for (int i = 0; i < fdata.length; i++) {
+             final long bits = Double.doubleToLongBits(fdata[i]);
+@@ -170,11 +170,11 @@
+             s.write((int)(bits & 0xFF));
+         }
+     }
+-    
++
+     public final void encodeToBytes(Object array, int astart, int alength, byte[] b, int start) {
+         encodeToBytesFromDoubleArray((double[])array, astart, alength, b, start);
+     }
+-    
++
+     public final void encodeToBytesFromDoubleArray(double[] fdata, int fstart, int flength, byte[] b, int start) {
+         final int fend = fstart + flength;
+         for (int i = fstart; i < fend; i++) {
+@@ -189,8 +189,8 @@
+             b[start++] = (byte)(bits & 0xFF);
+         }
+     }
+-    
+-    
++
++
+     public final void convertToCharactersFromDoubleArray(double[] fdata, StringBuffer s) {
+         final int end = fdata.length - 1;
+         for (int i = 0; i <= end; i++) {
+@@ -200,15 +200,15 @@
+             }
+         }
+     }
+-    
+-    
++
++
+     public final double[] generateArrayFromList(List array) {
+         double[] fdata = new double[array.size()];
+         for (int i = 0; i < fdata.length; i++) {
+             fdata[i] = ((Double)array.get(i)).doubleValue();
+         }
+-        
++
+         return fdata;
+     }
+-    
++
+ }
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/FloatEncodingAlgorithm.java	Thu Jul 30 18:00:43 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/FloatEncodingAlgorithm.java	Thu Jul 30 18:00:42 2009
+@@ -47,40 +47,40 @@
+             throw new EncodingAlgorithmException(CommonResourceBundle.getInstance().
+                     getString("message.lengthNotMultipleOfFloat", new Object[]{Integer.valueOf(FLOAT_SIZE)}));
+         }
+-        
++
+         return octetLength / FLOAT_SIZE;
+     }
+-    
++
+     public int getOctetLengthFromPrimitiveLength(int primitiveLength) {
+         return primitiveLength * FLOAT_SIZE;
+     }
+-   
++
+     public final Object decodeFromBytes(byte[] b, int start, int length) throws EncodingAlgorithmException {
+         float[] data = new float[getPrimtiveLengthFromOctetLength(length)];
+         decodeFromBytesToFloatArray(data, 0, b, start, length);
+-        
++
+         return data;
+     }
+-    
++
+     public final Object decodeFromInputStream(InputStream s) throws IOException {
+         return decodeFromInputStreamToFloatArray(s);
+     }
+-    
+-    
++
++
+     public void encodeToOutputStream(Object data, OutputStream s) throws IOException {
+         if (!(data instanceof float[])) {
+             throw new IllegalArgumentException(CommonResourceBundle.getInstance().getString("message.dataNotFloat"));
+         }
+-        
++
+         final float[] fdata = (float[])data;
+-        
++
+         encodeToOutputStreamFromFloatArray(fdata, s);
+     }
+-    
++
+     public final Object convertFromCharacters(char[] ch, int start, int length) {
+         final CharBuffer cb = CharBuffer.wrap(ch, start, length);
+         final List floatList = new ArrayList();
+-        
++
+         matchWhiteSpaceDelimnatedWords(cb,
+                 new WordListener() {
+             public void word(int start, int end) {
+@@ -89,36 +89,36 @@
+             }
+         }
+         );
+-        
++
+         return generateArrayFromList(floatList);
+     }
+-    
++
+     public final void convertToCharacters(Object data, StringBuffer s) {
+         if (!(data instanceof float[])) {
+             throw new IllegalArgumentException(CommonResourceBundle.getInstance().getString("message.dataNotFloat"));
+         }
+-        
++
+         final float[] fdata = (float[])data;
+-        
++
+         convertToCharactersFromFloatArray(fdata, s);
+     }
+-    
+-    
++
++
+     public final void decodeFromBytesToFloatArray(float[] data, int fstart, byte[] b, int start, int length) {
+         final int size = length / FLOAT_SIZE;
+         for (int i = 0; i < size; i++) {
+-            final int bits = ((b[start++] & 0xFF) << 24) | 
+-                    ((b[start++] & 0xFF) << 16) | 
+-                    ((b[start++] & 0xFF) << 8) | 
++            final int bits = ((b[start++] & 0xFF) << 24) |
++                    ((b[start++] & 0xFF) << 16) |
++                    ((b[start++] & 0xFF) << 8) |
+                     (b[start++] & 0xFF);
+             data[fstart++] = Float.intBitsToFloat(bits);
+         }
+     }
+-    
++
+     public final float[] decodeFromInputStreamToFloatArray(InputStream s) throws IOException {
+         final List floatList = new ArrayList();
+         final byte[] b = new byte[FLOAT_SIZE];
+-        
++
+         while (true) {
+             int n = s.read(b);
+             if (n != 4) {
+@@ -125,7 +125,7 @@
+                 if (n == -1) {
+                     break;
+                 }
+-                
++
+                 while(n != 4) {
+                     final int m = s.read(b, n, FLOAT_SIZE - n);
+                     if (m == -1) {
+@@ -134,18 +134,18 @@
+                     n += m;
+                 }
+             }
+-            
+-            final int bits = ((b[0] & 0xFF) << 24) | 
+-                    ((b[1] & 0xFF) << 16) | 
+-                    ((b[2] & 0xFF) << 8) | 
++
++            final int bits = ((b[0] & 0xFF) << 24) |
++                    ((b[1] & 0xFF) << 16) |
++                    ((b[2] & 0xFF) << 8) |
+                     (b[3] & 0xFF);
+             floatList.add(Float.valueOf(Float.intBitsToFloat(bits)));
+         }
+-        
++
+         return generateArrayFromList(floatList);
+     }
+-    
+-    
++
++
+     public final void encodeToOutputStreamFromFloatArray(float[] fdata, OutputStream s) throws IOException {
+         for (int i = 0; i < fdata.length; i++) {
+             final int bits = Float.floatToIntBits(fdata[i]);
+@@ -155,11 +155,11 @@
+             s.write(bits & 0xFF);
+         }
+     }
+-    
++
+     public final void encodeToBytes(Object array, int astart, int alength, byte[] b, int start) {
+         encodeToBytesFromFloatArray((float[])array, astart, alength, b, start);
+     }
+-    
++
+     public final void encodeToBytesFromFloatArray(float[] fdata, int fstart, int flength, byte[] b, int start) {
+         final int fend = fstart + flength;
+         for (int i = fstart; i < fend; i++) {
+@@ -170,8 +170,8 @@
+             b[start++] = (byte)(bits & 0xFF);
+         }
+     }
+-    
+-    
++
++
+     public final void convertToCharactersFromFloatArray(float[] fdata, StringBuffer s) {
+         final int end = fdata.length - 1;
+         for (int i = 0; i <= end; i++) {
+@@ -181,15 +181,15 @@
+             }
+         }
+     }
+-    
+-    
++
++
+     public final float[] generateArrayFromList(List array) {
+         float[] fdata = new float[array.size()];
+         for (int i = 0; i < fdata.length; i++) {
+             fdata[i] = ((Float)array.get(i)).floatValue();
+         }
+-        
++
+         return fdata;
+     }
+-    
++
+ }
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/HexadecimalEncodingAlgorithm.java	Thu Jul 30 18:00:46 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/HexadecimalEncodingAlgorithm.java	Thu Jul 30 18:00:45 2009
+@@ -37,8 +37,8 @@
+ public class HexadecimalEncodingAlgorithm extends BuiltInEncodingAlgorithm {
+     private static final char NIBBLE_TO_HEXADECIMAL_TABLE[] =
+         {   '0','1','2','3','4','5','6','7',
+-            '8','9','A','B','B','D','E','F' };
+-    
++            '8','9','A','B','C','D','E','F' };
++
+     private static final int HEXADECIMAL_TO_NIBBLE_TABLE[] = {
+         /*'0'*/ 0,
+         /*'1'*/ 1,
+@@ -70,31 +70,31 @@
+         System.arraycopy(b, start, data, 0, length);
+         return data;
+     }
+-    
++
+     public final Object decodeFromInputStream(InputStream s) throws IOException {
+         throw new UnsupportedOperationException(CommonResourceBundle.getInstance().getString("message.notImplemented"));
+     }
+-    
+-    
++
++
+     public void encodeToOutputStream(Object data, OutputStream s) throws IOException {
+         if (!(data instanceof byte[])) {
+             throw new IllegalArgumentException(CommonResourceBundle.getInstance().getString("message.dataNotByteArray"));
+         }
+-        
++
+         s.write((byte[])data);
+     }
+-    
++
+     public final Object convertFromCharacters(char[] ch, int start, int length) {
+         if (length == 0) {
+             return new byte[0];
+         }
+-        
++
+         StringBuffer encodedValue = removeWhitespace(ch, start, length);
+         int encodedLength = encodedValue.length();
+         if (encodedLength == 0) {
+             return new byte[0];
+         }
+-        
++
+         int valueLength = encodedValue.length() / 2;
+         byte[] value = new byte[valueLength];
+ 
+@@ -107,7 +107,7 @@
+ 
+         return value;
+     }
+-    
++
+     public final void convertToCharacters(Object data, StringBuffer s) {
+         if (data == null) {
+             return;
+@@ -123,9 +123,9 @@
+             s.append(NIBBLE_TO_HEXADECIMAL_TABLE[value[i] & 0xf]);
+         }
+     }
+-    
+-    
+-        
++
++
++
+     public final int getPrimtiveLengthFromOctetLength(int octetLength) throws EncodingAlgorithmException {
+         return octetLength * 2;
+     }
+@@ -133,8 +133,8 @@
+     public int getOctetLengthFromPrimitiveLength(int primitiveLength) {
+         return primitiveLength / 2;
+     }
+-    
++
+     public final void encodeToBytes(Object array, int astart, int alength, byte[] b, int start) {
+         System.arraycopy((byte[])array, astart, b, start, alength);
+-    }    
++    }
+ }
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/IEEE754FloatingPointEncodingAlgorithm.java	Thu Jul 30 18:00:50 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/IEEE754FloatingPointEncodingAlgorithm.java	Thu Jul 30 18:00:49 2009
+@@ -34,5 +34,5 @@
+ 
+     public final static int FLOAT_MAX_CHARACTER_SIZE    = 14;
+     public final static int DOUBLE_MAX_CHARACTER_SIZE   = 24;
+-        
++
+ }
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/IntEncodingAlgorithm.java	Thu Jul 30 18:00:53 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/IntEncodingAlgorithm.java	Thu Jul 30 18:00:52 2009
+@@ -47,7 +47,7 @@
+             throw new EncodingAlgorithmException(CommonResourceBundle.getInstance().
+                     getString("message.lengthNotMultipleOfInt", new Object[]{Integer.valueOf(INT_SIZE)}));
+         }
+-        
++
+         return octetLength / INT_SIZE;
+     }
+ 
+@@ -54,34 +54,34 @@
+     public int getOctetLengthFromPrimitiveLength(int primitiveLength) {
+         return primitiveLength * INT_SIZE;
+     }
+-    
++
+     public final Object decodeFromBytes(byte[] b, int start, int length) throws EncodingAlgorithmException {
+         int[] data = new int[getPrimtiveLengthFromOctetLength(length)];
+         decodeFromBytesToIntArray(data, 0, b, start, length);
+-        
++
+         return data;
+     }
+-    
++
+     public final Object decodeFromInputStream(InputStream s) throws IOException {
+         return decodeFromInputStreamToIntArray(s);
+     }
+-    
+-    
++
++
+     public void encodeToOutputStream(Object data, OutputStream s) throws IOException {
+         if (!(data instanceof int[])) {
+             throw new IllegalArgumentException(CommonResourceBundle.getInstance().getString("message.dataNotIntArray"));
+         }
+-        
++
+         final int[] idata = (int[])data;
+-        
++
+         encodeToOutputStreamFromIntArray(idata, s);
+     }
+-    
+-    
++
++
+     public final Object convertFromCharacters(char[] ch, int start, int length) {
+         final CharBuffer cb = CharBuffer.wrap(ch, start, length);
+         final List integerList = new ArrayList();
+-        
++
+         matchWhiteSpaceDelimnatedWords(cb,
+                 new WordListener() {
+             public void word(int start, int end) {
+@@ -90,35 +90,35 @@
+             }
+         }
+         );
+-        
++
+         return generateArrayFromList(integerList);
+     }
+-    
++
+     public final void convertToCharacters(Object data, StringBuffer s) {
+         if (!(data instanceof int[])) {
+             throw new IllegalArgumentException(CommonResourceBundle.getInstance().getString("message.dataNotIntArray"));
+         }
+-        
++
+         final int[] idata = (int[])data;
+-        
++
+         convertToCharactersFromIntArray(idata, s);
+     }
+-    
+-    
++
++
+     public final void decodeFromBytesToIntArray(int[] idata, int istart, byte[] b, int start, int length) {
+         final int size = length / INT_SIZE;
+         for (int i = 0; i < size; i++) {
+-            idata[istart++] = ((b[start++] & 0xFF) << 24) | 
+-                    ((b[start++] & 0xFF) << 16) | 
+-                    ((b[start++] & 0xFF) << 8) | 
++            idata[istart++] = ((b[start++] & 0xFF) << 24) |
++                    ((b[start++] & 0xFF) << 16) |
++                    ((b[start++] & 0xFF) << 8) |
+                     (b[start++] & 0xFF);
+-        }        
++        }
+     }
+-    
++
+     public final int[] decodeFromInputStreamToIntArray(InputStream s) throws IOException {
+         final List integerList = new ArrayList();
+         final byte[] b = new byte[INT_SIZE];
+-        
++
+         while (true) {
+             int n = s.read(b);
+             if (n != 4) {
+@@ -125,7 +125,7 @@
+                 if (n == -1) {
+                     break;
+                 }
+-                
++
+                 while(n != 4) {
+                     final int m = s.read(b, n, INT_SIZE - n);
+                     if (m == -1) {
+@@ -134,18 +134,18 @@
+                     n += m;
+                 }
+             }
+-            
+-            final int i = ((b[0] & 0xFF) << 24) | 
+-                    ((b[1] & 0xFF) << 16) | 
+-                    ((b[2] & 0xFF) << 8) | 
++
++            final int i = ((b[0] & 0xFF) << 24) |
++                    ((b[1] & 0xFF) << 16) |
++                    ((b[2] & 0xFF) << 8) |
+                     (b[3] & 0xFF);
+             integerList.add(Integer.valueOf(i));
+         }
+-        
++
+         return generateArrayFromList(integerList);
+     }
+-    
+-    
++
++
+     public final void encodeToOutputStreamFromIntArray(int[] idata, OutputStream s) throws IOException {
+         for (int i = 0; i < idata.length; i++) {
+             final int bits = idata[i];
+@@ -155,11 +155,11 @@
+             s.write(bits & 0xFF);
+         }
+     }
+-    
++
+     public final void encodeToBytes(Object array, int astart, int alength, byte[] b, int start) {
+         encodeToBytesFromIntArray((int[])array, astart, alength, b, start);
+     }
+-    
++
+     public final void encodeToBytesFromIntArray(int[] idata, int istart, int ilength, byte[] b, int start) {
+         final int iend = istart + ilength;
+         for (int i = istart; i < iend; i++) {
+@@ -170,8 +170,8 @@
+             b[start++] = (byte)(bits & 0xFF);
+         }
+     }
+-    
+-    
++
++
+     public final void convertToCharactersFromIntArray(int[] idata, StringBuffer s) {
+         final int end = idata.length - 1;
+         for (int i = 0; i <= end; i++) {
+@@ -181,14 +181,14 @@
+             }
+         }
+     }
+-    
+-    
++
++
+     public final int[] generateArrayFromList(List array) {
+         int[] idata = new int[array.size()];
+         for (int i = 0; i < idata.length; i++) {
+             idata[i] = ((Integer)array.get(i)).intValue();
+         }
+-        
++
+         return idata;
+     }
+ }
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/IntegerEncodingAlgorithm.java	Thu Jul 30 18:00:57 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/IntegerEncodingAlgorithm.java	Thu Jul 30 18:00:56 2009
+@@ -36,5 +36,5 @@
+     public final static int SHORT_MAX_CHARACTER_SIZE    = 6;
+     public final static int INT_MAX_CHARACTER_SIZE      = 11;
+     public final static int LONG_MAX_CHARACTER_SIZE     = 20;
+-        
++
+ }
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/LongEncodingAlgorithm.java	Thu Jul 30 18:01:00 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/LongEncodingAlgorithm.java	Thu Jul 30 18:01:00 2009
+@@ -46,7 +46,7 @@
+             throw new EncodingAlgorithmException(CommonResourceBundle.getInstance().
+                     getString("message.lengthNotMultipleOfLong", new Object[]{Integer.valueOf(LONG_SIZE)}));
+         }
+-        
++
+         return octetLength / LONG_SIZE;
+     }
+ 
+@@ -53,34 +53,34 @@
+     public int getOctetLengthFromPrimitiveLength(int primitiveLength) {
+         return primitiveLength * LONG_SIZE;
+     }
+-    
++
+     public final Object decodeFromBytes(byte[] b, int start, int length) throws EncodingAlgorithmException {
+         long[] data = new long[getPrimtiveLengthFromOctetLength(length)];
+         decodeFromBytesToLongArray(data, 0, b, start, length);
+-        
++
+         return data;
+     }
+-    
++
+     public final Object decodeFromInputStream(InputStream s) throws IOException {
+         return decodeFromInputStreamToIntArray(s);
+     }
+-    
+-    
++
++
+     public void encodeToOutputStream(Object data, OutputStream s) throws IOException {
+         if (!(data instanceof long[])) {
+             throw new IllegalArgumentException(CommonResourceBundle.getInstance().getString("message.dataNotLongArray"));
+         }
+-        
++
+         final long[] ldata = (long[])data;
+-        
++
+         encodeToOutputStreamFromLongArray(ldata, s);
+     }
+-    
+-    
++
++
+     public Object convertFromCharacters(char[] ch, int start, int length) {
+         final CharBuffer cb = CharBuffer.wrap(ch, start, length);
+         final List longList = new ArrayList();
+-        
++
+         matchWhiteSpaceDelimnatedWords(cb,
+                 new WordListener() {
+             public void word(int start, int end) {
+@@ -89,40 +89,40 @@
+             }
+         }
+         );
+-        
++
+         return generateArrayFromList(longList);
+     }
+-    
++
+     public void convertToCharacters(Object data, StringBuffer s) {
+         if (!(data instanceof long[])) {
+             throw new IllegalArgumentException(CommonResourceBundle.getInstance().getString("message.dataNotLongArray"));
+         }
+-        
++
+         final long[] ldata = (long[])data;
+-        
++
+         convertToCharactersFromLongArray(ldata, s);
+     }
+-    
+-    
++
++
+     public final void decodeFromBytesToLongArray(long[] ldata, int istart, byte[] b, int start, int length) {
+         final int size = length / LONG_SIZE;
+         for (int i = 0; i < size; i++) {
+-            ldata[istart++] = 
+-                    ((long)(b[start++] & 0xFF) << 56) | 
+-                    ((long)(b[start++] & 0xFF) << 48) | 
+-                    ((long)(b[start++] & 0xFF) << 40) | 
+-                    ((long)(b[start++] & 0xFF) << 32) | 
+-                    ((long)(b[start++] & 0xFF) << 24) | 
+-                    ((long)(b[start++] & 0xFF) << 16) | 
+-                    ((long)(b[start++] & 0xFF) << 8) | 
++            ldata[istart++] =
++                    ((long)(b[start++] & 0xFF) << 56) |
++                    ((long)(b[start++] & 0xFF) << 48) |
++                    ((long)(b[start++] & 0xFF) << 40) |
++                    ((long)(b[start++] & 0xFF) << 32) |
++                    ((long)(b[start++] & 0xFF) << 24) |
++                    ((long)(b[start++] & 0xFF) << 16) |
++                    ((long)(b[start++] & 0xFF) << 8) |
+                     (long)(b[start++] & 0xFF);
+-        }        
++        }
+     }
+-    
++
+     public final long[] decodeFromInputStreamToIntArray(InputStream s) throws IOException {
+         final List longList = new ArrayList();
+         final byte[] b = new byte[LONG_SIZE];
+-        
++
+         while (true) {
+             int n = s.read(b);
+             if (n != LONG_SIZE) {
+@@ -129,7 +129,7 @@
+                 if (n == -1) {
+                     break;
+                 }
+-                
++
+                 while(n != LONG_SIZE) {
+                     final int m = s.read(b, n, LONG_SIZE - n);
+                     if (m == -1) {
+@@ -138,23 +138,24 @@
+                     n += m;
+                 }
+             }
+-            
+-            final long l = 
+-                    ((long)(b[0] & 0xFF) << 56) | 
+-                    ((long)(b[1] & 0xFF) << 48) | 
+-                    ((long)(b[2] & 0xFF) << 40) | 
+-                    ((long)(b[3] & 0xFF) << 32) | 
+-                    ((b[4] & 0xFF) << 24) | 
+-                    ((b[5] & 0xFF) << 16) | 
+-                    ((b[6] & 0xFF) << 8) | 
+-                    (b[7] & 0xFF);
++
++            final long l =
++                    (((long) b[0] << 56) +
++                    ((long) (b[1] & 0xFF) << 48) +
++                    ((long) (b[2] & 0xFF) << 40) +
++                    ((long) (b[3] & 0xFF) << 32) +
++                    ((long) (b[4] & 0xFF) << 24) +
++                    ((b[5] & 0xFF) << 16) +
++                    ((b[6] & 0xFF) << 8) +
++                    ((b[7] & 0xFF) << 0));
++
+             longList.add(Long.valueOf(l));
+         }
+-        
++
+         return generateArrayFromList(longList);
+     }
+-    
+-    
++
++
+     public final void encodeToOutputStreamFromLongArray(long[] ldata, OutputStream s) throws IOException {
+         for (int i = 0; i < ldata.length; i++) {
+             final long bits = ldata[i];
+@@ -168,11 +169,11 @@
+             s.write((int)(bits & 0xFF));
+         }
+     }
+-    
++
+     public final void encodeToBytes(Object array, int astart, int alength, byte[] b, int start) {
+         encodeToBytesFromLongArray((long[])array, astart, alength, b, start);
+     }
+-    
++
+     public final void encodeToBytesFromLongArray(long[] ldata, int lstart, int llength, byte[] b, int start) {
+         final int lend = lstart + llength;
+         for (int i = lstart; i < lend; i++) {
+@@ -187,10 +188,10 @@
+             b[start++] = (byte)(bits & 0xFF);
+         }
+     }
+-    
+-    
++
++
+     public final void convertToCharactersFromLongArray(long[] ldata, StringBuffer s) {
+-        final int end = ldata.length - 1;        
++        final int end = ldata.length - 1;
+         for (int i = 0; i <= end; i++) {
+             s.append(Long.toString(ldata[i]));
+             if (i != end) {
+@@ -198,14 +199,14 @@
+             }
+         }
+     }
+-    
+-    
++
++
+     public final long[] generateArrayFromList(List array) {
+         long[] ldata = new long[array.size()];
+         for (int i = 0; i < ldata.length; i++) {
+             ldata[i] = ((Long)array.get(i)).longValue();
+         }
+-        
++
+         return ldata;
+     }
+ }
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/UUIDEncodingAlgorithm.java	Thu Jul 30 18:01:04 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/algorithm/UUIDEncodingAlgorithm.java	Thu Jul 30 18:01:03 2009
+@@ -34,20 +34,20 @@
+ import com.sun.xml.internal.fastinfoset.CommonResourceBundle;
+ 
+ public class UUIDEncodingAlgorithm extends LongEncodingAlgorithm {
+-    
++
+     public final int getPrimtiveLengthFromOctetLength(int octetLength) throws EncodingAlgorithmException {
+         if (octetLength % (LONG_SIZE * 2) != 0) {
+             throw new EncodingAlgorithmException(CommonResourceBundle.getInstance().
+                     getString("message.lengthNotMultipleOfUUID",new Object[]{Integer.valueOf(LONG_SIZE * 2)}));
+         }
+-        
++
+         return octetLength / LONG_SIZE;
+     }
+-    
++
+     public final Object convertFromCharacters(char[] ch, int start, int length) {
+         final CharBuffer cb = CharBuffer.wrap(ch, start, length);
+         final List longList = new ArrayList();
+-        
++
+         matchWhiteSpaceDelimnatedWords(cb,
+                 new WordListener() {
+             public void word(int start, int end) {
+@@ -58,18 +58,18 @@
+             }
+         }
+         );
+-        
++
+         return generateArrayFromList(longList);
+     }
+-    
++
+     public final void convertToCharacters(Object data, StringBuffer s) {
+         if (!(data instanceof long[])) {
+             throw new IllegalArgumentException(CommonResourceBundle.getInstance().getString("message.dataNotLongArray"));
+         }
+-        
++
+         final long[] ldata = (long[])data;
+ 
+-        final int end = ldata.length - 1;
++        final int end = ldata.length - 2;
+         for (int i = 0; i <= end; i += 2) {
+             s.append(toUUIDString(ldata[i], ldata[i + 1]));
+             if (i != end) {
+@@ -76,18 +76,18 @@
+                 s.append(' ');
+             }
+         }
+-    }    
++    }
+ 
+-    
++
+     private long _msb;
+     private long _lsb;
+-    
++
+     final void fromUUIDString(String name) {
+         String[] components = name.split("-");
+         if (components.length != 5)
+             throw new IllegalArgumentException(CommonResourceBundle.getInstance().
+                     getString("message.invalidUUID", new Object[]{name}));
+-                    
++
+         for (int i=0; i<5; i++)
+             components[i] = "0x"+components[i];
+ 
+@@ -103,16 +103,16 @@
+     }
+ 
+     final String toUUIDString(long msb, long lsb) {
+-	return (digits(msb >> 32, 8) + "-" +
+-		digits(msb >> 16, 4) + "-" +
+-		digits(msb, 4) + "-" +
+-		digits(lsb >> 48, 4) + "-" +
+-		digits(lsb, 12));
++        return (digits(msb >> 32, 8) + "-" +
++                digits(msb >> 16, 4) + "-" +
++                digits(msb, 4) + "-" +
++                digits(lsb >> 48, 4) + "-" +
++                digits(lsb, 12));
+     }
+-    
++
+     final String digits(long val, int digits) {
+-	long hi = 1L << (digits * 4);
+-	return Long.toHexString(hi | (val & (hi - 1))).substring(1);
++        long hi = 1L << (digits * 4);
++        return Long.toHexString(hi | (val & (hi - 1))).substring(1);
+     }
+-    
++
+ }
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/alphabet/BuiltInRestrictedAlphabets.java	Thu Jul 30 18:01:07 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/alphabet/BuiltInRestrictedAlphabets.java	Thu Jul 30 18:01:07 2009
+@@ -34,7 +34,7 @@
+ public final class BuiltInRestrictedAlphabets {
+     public final static char[][] table =
+             new char[EncodingConstants.RESTRICTED_ALPHABET_BUILTIN_END + 1][];
+-    
++
+     static {
+         table[RestrictedAlphabet.NUMERIC_CHARACTERS_INDEX] = RestrictedAlphabet.NUMERIC_CHARACTERS.toCharArray();
+         table[RestrictedAlphabet.DATE_TIME_CHARACTERS_INDEX] = RestrictedAlphabet.DATE_TIME_CHARACTERS.toCharArray();
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/dom/DOMDocumentParser.java	Thu Jul 30 18:01:11 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/dom/DOMDocumentParser.java	Thu Jul 30 18:01:10 2009
+@@ -45,63 +45,65 @@
+ import org.w3c.dom.Element;
+ import org.w3c.dom.Node;
+ import com.sun.xml.internal.fastinfoset.CommonResourceBundle;
++import com.sun.xml.internal.fastinfoset.util.DuplicateAttributeVerifier;
++import org.w3c.dom.Text;
+ 
+ /**
+  * The Fast Infoset DOM parser.
+  * <p>
+- * Instantiate this parser to parse a fast infoset document in accordance 
++ * Instantiate this parser to parse a fast infoset document in accordance
+  * with the DOM API.
+- * 
++ *
+  */
+ public class DOMDocumentParser extends Decoder {
+     protected Document _document;
+-    
++
+     protected Node _currentNode;
+-    
++
+     protected Element _currentElement;
+ 
+     protected Attr[] _namespaceAttributes = new Attr[16];
+ 
+     protected int _namespaceAttributesIndex;
+-    
++
+     protected int[] _namespacePrefixes = new int[16];
+-    
++
+     protected int _namespacePrefixesIndex;
+ 
+     /**
+      * Parse a fast infoset document into a {@link Document} instance.
+      * <p>
+-     * {@link Node}s will be created and appended to the {@link Document} 
++     * {@link Node}s will be created and appended to the {@link Document}
+      * instance.
+      *
+      * @param d the {@link Document} instance.
+      * @param s the input stream containing the fast infoset document.
+      */
+-    public void parse(Document d, InputStream s) throws FastInfosetException, IOException {        
++    public void parse(Document d, InputStream s) throws FastInfosetException, IOException {
+         _currentNode = _document = d;
+         _namespaceAttributesIndex = 0;
+-                    
+-        parse(s);        
++
++        parse(s);
+     }
+-    
++
+     protected final void parse(InputStream s) throws FastInfosetException, IOException {
+         setInputStream(s);
+         parse();
+     }
+-    
++
+     protected void resetOnError() {
+         _namespacePrefixesIndex = 0;
+-        
++
+         if (_v == null) {
+             _prefixTable.clearCompletely();
+         }
+         _duplicateAttributeVerifier.clear();
+     }
+-    
++
+     protected final void parse() throws FastInfosetException, IOException {
+         try {
+             reset();
+-            decodeHeader();                                                                                
++            decodeHeader();
+             processDII();
+         } catch (RuntimeException e) {
+             resetOnError();
+@@ -115,19 +117,19 @@
+             throw e;
+         }
+     }
+-    
+-    protected final void processDII() throws FastInfosetException, IOException {        
++
++    protected final void processDII() throws FastInfosetException, IOException {
+         _b = read();
+         if (_b > 0) {
+             processDIIOptionalProperties();
+         }
+-        
++
+         // Decode one Document Type II, Comment IIs, PI IIs and one EII
+         boolean firstElementHasOccured = false;
+         boolean documentTypeDeclarationOccured = false;
+         while(!_terminate || !firstElementHasOccured) {
+             _b = read();
+-            switch(DecoderStateTables.DII[_b]) {
++            switch(DecoderStateTables.DII(_b)) {
+                 case DecoderStateTables.EII_NO_AIIS_INDEX_SMALL:
+                     processEII(_elementNameTable._array[_b], false);
+                     firstElementHasOccured = true;
+@@ -147,8 +149,8 @@
+                 case DecoderStateTables.EII_LITERAL:
+                 {
+                     final QualifiedName qn = processLiteralQualifiedName(
+-                                _b & EncodingConstants.LITERAL_QNAME_PREFIX_NAMESPACE_NAME_MASK,
+-                                _elementNameTable.getNext());
++                            _b & EncodingConstants.LITERAL_QNAME_PREFIX_NAMESPACE_NAME_MASK,
++                            _elementNameTable.getNext());
+                     _elementNameTable.add(qn);
+                     processEII(qn, (_b & EncodingConstants.ELEMENT_ATTRIBUTE_FLAG) > 0);
+                     firstElementHasOccured = true;
+@@ -165,11 +167,11 @@
+                     }
+                     documentTypeDeclarationOccured = true;
+ 
+-                    String system_identifier = ((_b & EncodingConstants.DOCUMENT_TYPE_SYSTEM_IDENTIFIER_FLAG) > 0) 
+-                        ? decodeIdentifyingNonEmptyStringOnFirstBit(_v.otherURI) : null;
+-                    String public_identifier = ((_b & EncodingConstants.DOCUMENT_TYPE_PUBLIC_IDENTIFIER_FLAG) > 0) 
+-                        ? decodeIdentifyingNonEmptyStringOnFirstBit(_v.otherURI) : null;
+-                    
++                    String system_identifier = ((_b & EncodingConstants.DOCUMENT_TYPE_SYSTEM_IDENTIFIER_FLAG) > 0)
++                    ? decodeIdentifyingNonEmptyStringOnFirstBit(_v.otherURI) : null;
++                    String public_identifier = ((_b & EncodingConstants.DOCUMENT_TYPE_PUBLIC_IDENTIFIER_FLAG) > 0)
++                    ? decodeIdentifyingNonEmptyStringOnFirstBit(_v.otherURI) : null;
++
+                     _b = read();
+                     while (_b == EncodingConstants.PROCESSING_INSTRUCTION) {
+                         switch(decodeNonIdentifyingStringOnFirstBit()) {
+@@ -179,7 +181,7 @@
+                                 }
+                                 break;
+                             case NISTRING_ENCODING_ALGORITHM:
+-                                throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.processingIIWithEncodingAlgorithm"));                        
++                                throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.processingIIWithEncodingAlgorithm"));
+                             case NISTRING_INDEX:
+                                 break;
+                             case NISTRING_EMPTY_STRING:
+@@ -193,7 +195,7 @@
+                     if (_b == EncodingConstants.DOUBLE_TERMINATOR) {
+                         _terminate = true;
+                     }
+-                    
++
+                     _notations.clear();
+                     _unparsedEntities.clear();
+                     /*
+@@ -208,8 +210,8 @@
+                 case DecoderStateTables.PROCESSING_INSTRUCTION_II:
+                     processProcessingII();
+                     break;
+-                case DecoderStateTables.TERMINATOR_DOUBLE:                    
+-                    _doubleTerminate = true; 
++                case DecoderStateTables.TERMINATOR_DOUBLE:
++                    _doubleTerminate = true;
+                 case DecoderStateTables.TERMINATOR_SINGLE:
+                     _terminate = true;
+                     break;
+@@ -221,7 +223,7 @@
+         // Decode any remaining Comment IIs, PI IIs
+         while(!_terminate) {
+             _b = read();
+-            switch(DecoderStateTables.DII[_b]) {
++            switch(DecoderStateTables.DII(_b)) {
+                 case DecoderStateTables.COMMENT_II:
+                     processCommentII();
+                     break;
+@@ -228,8 +230,8 @@
+                 case DecoderStateTables.PROCESSING_INSTRUCTION_II:
+                     processProcessingII();
+                     break;
+-                case DecoderStateTables.TERMINATOR_DOUBLE:                    
+-                    _doubleTerminate = true; 
++                case DecoderStateTables.TERMINATOR_DOUBLE:
++                    _doubleTerminate = true;
+                 case DecoderStateTables.TERMINATOR_SINGLE:
+                     _terminate = true;
+                     break;
+@@ -240,21 +242,21 @@
+ 
+     }
+ 
+-    protected final void processDIIOptionalProperties() throws FastInfosetException, IOException {     
++    protected final void processDIIOptionalProperties() throws FastInfosetException, IOException {
+         // Optimize for the most common case
+         if (_b == EncodingConstants.DOCUMENT_INITIAL_VOCABULARY_FLAG) {
+             decodeInitialVocabulary();
+             return;
+         }
+-        
++
+         if ((_b & EncodingConstants.DOCUMENT_ADDITIONAL_DATA_FLAG) > 0) {
+             decodeAdditionalData();
+             /*
+-             * TODO 
++             * TODO
+              * how to report the additional data?
+              */
+         }
+-        
++
+         if ((_b & EncodingConstants.DOCUMENT_INITIAL_VOCABULARY_FLAG) > 0) {
+             decodeInitialVocabulary();
+         }
+@@ -272,15 +274,15 @@
+         if ((_b & EncodingConstants.DOCUMENT_CHARACTER_ENCODING_SCHEME) > 0) {
+             String version = decodeCharacterEncodingScheme();
+             /*
+-             * TODO 
++             * TODO
+              * how to report the character encoding scheme?
+              */
+         }
+-        
++
+         if ((_b & EncodingConstants.DOCUMENT_STANDALONE_FLAG) > 0) {
+             boolean standalone = (read() > 0) ? true : false ;
+             /*
+-             * TODO 
++             * TODO
+              * how to report the standalone flag?
+              */
+         }
+@@ -288,7 +290,7 @@
+         if ((_b & EncodingConstants.DOCUMENT_VERSION_FLAG) > 0) {
+             decodeVersion();
+             /*
+-             * TODO 
++             * TODO
+              * how to report the document version?
+              */
+         }
+@@ -298,11 +300,11 @@
+         if (_prefixTable._currentInScope[name.prefixIndex] != name.namespaceNameIndex) {
+             throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.qnameOfEIINotInScope"));
+         }
+-        
++
+         final Node parentCurrentNode = _currentNode;
+-        
++
+         _currentNode = _currentElement = createElement(name.namespaceName, name.qName, name.localName);
+-        
++
+         if (_namespaceAttributesIndex > 0) {
+             for (int i = 0; i < _namespaceAttributesIndex; i++) {
+                 _currentElement.setAttributeNode(_namespaceAttributes[i]);
+@@ -310,16 +312,16 @@
+             }
+             _namespaceAttributesIndex = 0;
+         }
+-        
++
+         if (hasAttributes) {
+             processAIIs();
+         }
+-        
++
+         parentCurrentNode.appendChild(_currentElement);
+ 
+         while(!_terminate) {
+             _b = read();
+-            switch(DecoderStateTables.EII[_b]) {
++            switch(DecoderStateTables.EII(_b)) {
+                 case DecoderStateTables.EII_NO_AIIS_INDEX_SMALL:
+                     processEII(_elementNameTable._array[_b], false);
+                     break;
+@@ -335,8 +337,8 @@
+                 case DecoderStateTables.EII_LITERAL:
+                 {
+                     final QualifiedName qn = processLiteralQualifiedName(
+-                                _b & EncodingConstants.LITERAL_QNAME_PREFIX_NAMESPACE_NAME_MASK,
+-                                _elementNameTable.getNext());
++                            _b & EncodingConstants.LITERAL_QNAME_PREFIX_NAMESPACE_NAME_MASK,
++                            _elementNameTable.getNext());
+                     _elementNameTable.add(qn);
+                     processEII(qn, (_b & EncodingConstants.ELEMENT_ATTRIBUTE_FLAG) > 0);
+                     break;
+@@ -346,37 +348,37 @@
+                     break;
+                 case DecoderStateTables.CII_UTF8_SMALL_LENGTH:
+                 {
+-                    _octetBufferLength = (_b & EncodingConstants.OCTET_STRING_LENGTH_7TH_BIT_SMALL_MASK) 
+-                        + 1;
+-                    processUtf8CharacterString();
++                    _octetBufferLength = (_b & EncodingConstants.OCTET_STRING_LENGTH_7TH_BIT_SMALL_MASK)
++                    + 1;
++                    appendOrCreateTextData(processUtf8CharacterString());
+                     break;
+                 }
+                 case DecoderStateTables.CII_UTF8_MEDIUM_LENGTH:
+                 {
+                     _octetBufferLength = read() + EncodingConstants.OCTET_STRING_LENGTH_7TH_BIT_SMALL_LIMIT;
+-                    processUtf8CharacterString();
++                    appendOrCreateTextData(processUtf8CharacterString());
+                     break;
+                 }
+-                case DecoderStateTables.CII_UTF8_LARGE_LENGTH:
++                    case DecoderStateTables.CII_UTF8_LARGE_LENGTH:
+                 {
+                     _octetBufferLength = (read() << 24) |
+-                        (read() << 16) |
+-                        (read() << 8) |
+-                        read();
++                            (read() << 16) |
++                            (read() << 8) |
++                            read();
+                     _octetBufferLength += EncodingConstants.OCTET_STRING_LENGTH_7TH_BIT_MEDIUM_LIMIT;
+-                    processUtf8CharacterString();
++                    appendOrCreateTextData(processUtf8CharacterString());
+                     break;
+                 }
+                 case DecoderStateTables.CII_UTF16_SMALL_LENGTH:
+                 {
+-                    _octetBufferLength = (_b & EncodingConstants.OCTET_STRING_LENGTH_7TH_BIT_SMALL_MASK) 
+-                        + 1;
++                    _octetBufferLength = (_b & EncodingConstants.OCTET_STRING_LENGTH_7TH_BIT_SMALL_MASK)
++                    + 1;
+                     String v = decodeUtf16StringAsString();
+                     if ((_b & EncodingConstants.CHARACTER_CHUNK_ADD_TO_TABLE_FLAG) > 0) {
+                         _characterContentChunkTable.add(_charBuffer, _charBufferLength);
+                     }
+-                    
+-                    _currentNode.appendChild(_document.createTextNode(v));
++
++                    appendOrCreateTextData(v);
+                     break;
+                 }
+                 case DecoderStateTables.CII_UTF16_MEDIUM_LENGTH:
+@@ -386,29 +388,29 @@
+                     if ((_b & EncodingConstants.CHARACTER_CHUNK_ADD_TO_TABLE_FLAG) > 0) {
+                         _characterContentChunkTable.add(_charBuffer, _charBufferLength);
+                     }
+-                    
+-                    _currentNode.appendChild(_document.createTextNode(v));
++
++                    appendOrCreateTextData(v);
+                     break;
+                 }
+                 case DecoderStateTables.CII_UTF16_LARGE_LENGTH:
+                 {
+                     _octetBufferLength = (read() << 24) |
+-                        (read() << 16) |
+-                        (read() << 8) |
+-                        read();
++                            (read() << 16) |
++                            (read() << 8) |
++                            read();
+                     _octetBufferLength += EncodingConstants.OCTET_STRING_LENGTH_7TH_BIT_MEDIUM_LIMIT;
+                     String v = decodeUtf16StringAsString();
+                     if ((_b & EncodingConstants.CHARACTER_CHUNK_ADD_TO_TABLE_FLAG) > 0) {
+                         _characterContentChunkTable.add(_charBuffer, _charBufferLength);
+                     }
+-                    
+-                    _currentNode.appendChild(_document.createTextNode(v));
++
++                    appendOrCreateTextData(v);
+                     break;
+                 }
+                 case DecoderStateTables.CII_RA:
+                 {
+                     final boolean addToTable = (_b & EncodingConstants.CHARACTER_CHUNK_ADD_TO_TABLE_FLAG) > 0;
+-                    
++
+                     // Decode resitricted alphabet integer
+                     _identifier = (_b & 0x02) << 6;
+                     _b = read();
+@@ -415,69 +417,69 @@
+                     _identifier |= (_b & 0xFC) >> 2;
+ 
+                     decodeOctetsOnSeventhBitOfNonIdentifyingStringOnThirdBit(_b);
+-                    
+-                    String v = decodeRestrictedAlphabetAsString();                    
++
++                    String v = decodeRestrictedAlphabetAsString();
+                     if (addToTable) {
+                         _characterContentChunkTable.add(_charBuffer, _charBufferLength);
+                     }
+-                    
+-                    _currentNode.appendChild(_document.createTextNode(v));
++
++                    appendOrCreateTextData(v);
+                     break;
+                 }
+                 case DecoderStateTables.CII_EA:
+                 {
+-                    if ((_b & EncodingConstants.NISTRING_ADD_TO_TABLE_FLAG) > 0) {
+-                        throw new EncodingAlgorithmException(CommonResourceBundle.getInstance().getString("message.addToTableNotSupported"));
+-                    }
+-
++                    final boolean addToTable = (_b & EncodingConstants.CHARACTER_CHUNK_ADD_TO_TABLE_FLAG) > 0;
+                     // Decode encoding algorithm integer
+                     _identifier = (_b & 0x02) << 6;
+                     _b = read();
+                     _identifier |= (_b & 0xFC) >> 2;
+-                    
++
+                     decodeOctetsOnSeventhBitOfNonIdentifyingStringOnThirdBit(_b);
+                     final String s = convertEncodingAlgorithmDataToCharacters(false);
+-                    _currentNode.appendChild(_document.createTextNode(s));
++                    if (addToTable) {
++                        _characterContentChunkTable.add(s.toCharArray(), s.length());
++                    }
++                    appendOrCreateTextData(s);
+                     break;
+                 }
+                 case DecoderStateTables.CII_INDEX_SMALL:
+                 {
+                     final String s = _characterContentChunkTable.getString(_b & EncodingConstants.INTEGER_4TH_BIT_SMALL_MASK);
+-                    
+-                    _currentNode.appendChild(_document.createTextNode(s));
++
++                    appendOrCreateTextData(s);
+                     break;
+                 }
+                 case DecoderStateTables.CII_INDEX_MEDIUM:
+                 {
+                     final int index = (((_b & EncodingConstants.INTEGER_4TH_BIT_MEDIUM_MASK) << 8) | read())
+-                        + EncodingConstants.INTEGER_4TH_BIT_SMALL_LIMIT;
++                    + EncodingConstants.INTEGER_4TH_BIT_SMALL_LIMIT;
+                     final String s = _characterContentChunkTable.getString(index);
+-                    
+-                    _currentNode.appendChild(_document.createTextNode(s));
++
++                    appendOrCreateTextData(s);
+                     break;
+                 }
+                 case DecoderStateTables.CII_INDEX_LARGE:
+                 {
+                     int index = ((_b & EncodingConstants.INTEGER_4TH_BIT_LARGE_MASK) << 16) |
+-                        (read() << 8) |
+-                        read();
++                            (read() << 8) |
++                            read();
+                     index += EncodingConstants.INTEGER_4TH_BIT_MEDIUM_LIMIT;
+                     final String s = _characterContentChunkTable.getString(index);
+-                    
+-                    _currentNode.appendChild(_document.createTextNode(s));
++
++                    appendOrCreateTextData(s);
+                     break;
+                 }
+                 case DecoderStateTables.CII_INDEX_LARGE_LARGE:
+                 {
+-                    int index = (read() << 16) | 
+-                        (read() << 8) |
+-                        read();
++                    int index = (read() << 16) |
++                            (read() << 8) |
++                            read();
+                     index += EncodingConstants.INTEGER_4TH_BIT_LARGE_LIMIT;
+                     final String s = _characterContentChunkTable.getString(index);
+-                    
+-                    _currentNode.appendChild(_document.createTextNode(s));
++
++                    appendOrCreateTextData(s);
+                     break;
+-                }                       
++                }
+                 case DecoderStateTables.COMMENT_II:
+                     processCommentII();
+                     break;
+@@ -487,17 +489,17 @@
+                 case DecoderStateTables.UNEXPANDED_ENTITY_REFERENCE_II:
+                 {
+                     String entity_reference_name = decodeIdentifyingNonEmptyStringOnFirstBit(_v.otherNCName);
+-                    
+-                    String system_identifier = ((_b & EncodingConstants.UNEXPANDED_ENTITY_SYSTEM_IDENTIFIER_FLAG) > 0) 
+-                        ? decodeIdentifyingNonEmptyStringOnFirstBit(_v.otherURI) : null;
+-                    String public_identifier = ((_b & EncodingConstants.UNEXPANDED_ENTITY_PUBLIC_IDENTIFIER_FLAG) > 0) 
+-                        ? decodeIdentifyingNonEmptyStringOnFirstBit(_v.otherURI) : null;
+ 
++                    String system_identifier = ((_b & EncodingConstants.UNEXPANDED_ENTITY_SYSTEM_IDENTIFIER_FLAG) > 0)
++                    ? decodeIdentifyingNonEmptyStringOnFirstBit(_v.otherURI) : null;
++                    String public_identifier = ((_b & EncodingConstants.UNEXPANDED_ENTITY_PUBLIC_IDENTIFIER_FLAG) > 0)
++                    ? decodeIdentifyingNonEmptyStringOnFirstBit(_v.otherURI) : null;
++
+                     // TODO create Node
+                     break;
+                 }
+-                case DecoderStateTables.TERMINATOR_DOUBLE:                    
+-                    _doubleTerminate = true; 
++                case DecoderStateTables.TERMINATOR_DOUBLE:
++                    _doubleTerminate = true;
+                 case DecoderStateTables.TERMINATOR_SINGLE:
+                     _terminate = true;
+                     break;
+@@ -508,25 +510,33 @@
+ 
+         _terminate = _doubleTerminate;
+         _doubleTerminate = false;
+-        
++
+         _currentNode = parentCurrentNode;
+     }
+ 
+-    private final void processUtf8CharacterString() throws FastInfosetException, IOException {
++    private void appendOrCreateTextData(String textData) {
++        Node lastChild = _currentNode.getLastChild();
++        if (lastChild instanceof Text) {
++            ((Text) lastChild).appendData(textData);
++        } else {
++            _currentNode.appendChild(
++                    _document.createTextNode(textData));
++        }
++    }
++
++    private final String processUtf8CharacterString() throws FastInfosetException, IOException {
+         if ((_b & EncodingConstants.CHARACTER_CHUNK_ADD_TO_TABLE_FLAG) > 0) {
+             _characterContentChunkTable.ensureSize(_octetBufferLength);
+             final int charactersOffset = _characterContentChunkTable._arrayIndex;
+             decodeUtf8StringAsCharBuffer(_characterContentChunkTable._array, charactersOffset);
+             _characterContentChunkTable.add(_charBufferLength);
+-            _currentNode.appendChild(_document.createTextNode(
+-                    _characterContentChunkTable.getString(_characterContentChunkTable._cachedIndex)));
++            return _characterContentChunkTable.getString(_characterContentChunkTable._cachedIndex);
+         } else {
+             decodeUtf8StringAsCharBuffer();
+-            _currentNode.appendChild(_document.createTextNode(
+-                    new String(_charBuffer, 0, _charBufferLength)));
++            return new String(_charBuffer, 0, _charBufferLength);
+         }
+     }
+-    
++
+     protected final void processEIIWithNamespaces() throws FastInfosetException, IOException {
+         final boolean hasAttributes = (_b & EncodingConstants.ELEMENT_ATTRIBUTE_FLAG) > 0;
+ 
+@@ -551,7 +561,7 @@
+                 _namespacePrefixes = namespaceAIIs;
+             }
+ 
+-            
++
+             switch (b & EncodingConstants.NAMESPACE_ATTRIBUTE_PREFIX_NAME_MASK) {
+                 // no prefix, no namespace
+                 // Undeclaration of default namespace
+@@ -558,54 +568,54 @@
+                 case 0:
+                     a = createAttribute(
+                             EncodingConstants.XMLNS_NAMESPACE_NAME,
+-                            EncodingConstants.XMLNS_NAMESPACE_PREFIX, 
++                            EncodingConstants.XMLNS_NAMESPACE_PREFIX,
+                             EncodingConstants.XMLNS_NAMESPACE_PREFIX);
+-                    a.setValue ("");
+-                    
++                    a.setValue("");
++
+                     _prefixIndex = _namespaceNameIndex = _namespacePrefixes[_namespacePrefixesIndex++] = -1;
+                     break;
+-                // no prefix, namespace
+-                // Declaration of default namespace
++                    // no prefix, namespace
++                    // Declaration of default namespace
+                 case 1:
+                     a = createAttribute(
+                             EncodingConstants.XMLNS_NAMESPACE_NAME,
+-                            EncodingConstants.XMLNS_NAMESPACE_PREFIX, 
++                            EncodingConstants.XMLNS_NAMESPACE_PREFIX,
+                             EncodingConstants.XMLNS_NAMESPACE_PREFIX);
+-                    a.setValue (decodeIdentifyingNonEmptyStringOnFirstBitAsNamespaceName(false));
+-                           
++                    a.setValue(decodeIdentifyingNonEmptyStringOnFirstBitAsNamespaceName(false));
++
+                     _prefixIndex = _namespacePrefixes[_namespacePrefixesIndex++] = -1;
+                     break;
+-                // prefix, no namespace
+-                // Undeclaration of namespace
++                    // prefix, no namespace
++                    // Undeclaration of namespace
+                 case 2:
+                     prefix = decodeIdentifyingNonEmptyStringOnFirstBitAsPrefix(false);
+                     a = createAttribute(
+                             EncodingConstants.XMLNS_NAMESPACE_NAME,
+-                            createQualifiedNameString(XMLNS_NAMESPACE_PREFIX_CHARS, prefix),
++                            createQualifiedNameString(prefix),
+                             prefix);
+-                    a.setValue ("");
+-                    
++                    a.setValue("");
++
+                     _namespaceNameIndex = -1;
+                     _namespacePrefixes[_namespacePrefixesIndex++] = _prefixIndex;
+                     break;
+-                // prefix, namespace
+-                // Declaration of prefixed namespace 
++                    // prefix, namespace
++                    // Declaration of prefixed namespace
+                 case 3:
+                     prefix = decodeIdentifyingNonEmptyStringOnFirstBitAsPrefix(true);
+                     a = createAttribute(
+                             EncodingConstants.XMLNS_NAMESPACE_NAME,
+-                            createQualifiedNameString(XMLNS_NAMESPACE_PREFIX_CHARS, prefix),
++                            createQualifiedNameString(prefix),
+                             prefix);
+-                    a.setValue (decodeIdentifyingNonEmptyStringOnFirstBitAsNamespaceName(true));
+-                    
++                    a.setValue(decodeIdentifyingNonEmptyStringOnFirstBitAsNamespaceName(true));
++
+                     _namespacePrefixes[_namespacePrefixesIndex++] = _prefixIndex;
+                     break;
+             }
+-                        
++
+             _prefixTable.pushScope(_prefixIndex, _namespaceNameIndex);
+-            
++
+             _namespaceAttributes[_namespaceAttributesIndex++] = a;
+-            
++
+             b = read();
+         }
+         if (b != EncodingConstants.TERMINATOR) {
+@@ -614,7 +624,7 @@
+         final int end = _namespacePrefixesIndex;
+ 
+         _b = read();
+-        switch(DecoderStateTables.EII[_b]) {
++        switch(DecoderStateTables.EII(_b)) {
+             case DecoderStateTables.EII_NO_AIIS_INDEX_SMALL:
+                 processEII(_elementNameTable._array[_b], hasAttributes);
+                 break;
+@@ -627,8 +637,8 @@
+             case DecoderStateTables.EII_LITERAL:
+             {
+                 final QualifiedName qn = processLiteralQualifiedName(
+-                            _b & EncodingConstants.LITERAL_QNAME_PREFIX_NAMESPACE_NAME_MASK,
+-                            _elementNameTable.getNext());
++                        _b & EncodingConstants.LITERAL_QNAME_PREFIX_NAMESPACE_NAME_MASK,
++                        _elementNameTable.getNext());
+                 _elementNameTable.add(qn);
+                 processEII(qn, hasAttributes);
+                 break;
+@@ -636,55 +646,55 @@
+             default:
+                 throw new IOException(CommonResourceBundle.getInstance().getString("message.IllegalStateDecodingEIIAfterAIIs"));
+         }
+-        
++
+         for (int i = start; i < end; i++) {
+             _prefixTable.popScope(_namespacePrefixes[i]);
+         }
+         _namespacePrefixesIndex = start;
+-        
++
+     }
+ 
+     protected final QualifiedName processLiteralQualifiedName(int state, QualifiedName q)
+     throws FastInfosetException, IOException {
+         if (q == null) q = new QualifiedName();
+-        
++
+         switch (state) {
+             // no prefix, no namespace
+             case 0:
+                 return q.set(
+-                        null, 
+-                        null, 
++                        null,
++                        null,
+                         decodeIdentifyingNonEmptyStringOnFirstBit(_v.localName),
+                         -1,
+                         -1,
+                         _identifier,
+                         null);
+-            // no prefix, namespace
++                // no prefix, namespace
+             case 1:
+                 return q.set(
+                         null,
+-                        decodeIdentifyingNonEmptyStringIndexOnFirstBitAsNamespaceName(false), 
++                        decodeIdentifyingNonEmptyStringIndexOnFirstBitAsNamespaceName(false),
+                         decodeIdentifyingNonEmptyStringOnFirstBit(_v.localName),
+                         -1,
+                         _namespaceNameIndex,
+                         _identifier,
+                         null);
+-            // prefix, no namespace
++                // prefix, no namespace
+             case 2:
+                 throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.qNameMissingNamespaceName"));
+-            // prefix, namespace
++                // prefix, namespace
+             case 3:
+                 return q.set(
+-                        decodeIdentifyingNonEmptyStringIndexOnFirstBitAsPrefix(true), 
+-                        decodeIdentifyingNonEmptyStringIndexOnFirstBitAsNamespaceName(true), 
++                        decodeIdentifyingNonEmptyStringIndexOnFirstBitAsPrefix(true),
++                        decodeIdentifyingNonEmptyStringIndexOnFirstBitAsNamespaceName(true),
+                         decodeIdentifyingNonEmptyStringOnFirstBit(_v.localName),
+                         _prefixIndex,
+-                        _namespaceNameIndex, 
++                        _namespaceNameIndex,
+                         _identifier,
+                         _charBuffer);
+             default:
+-                throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.decodingEII"));                
+-        }        
++                throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.decodingEII"));
++        }
+     }
+ 
+     protected final QualifiedName processLiteralQualifiedName(int state)
+@@ -693,41 +703,41 @@
+             // no prefix, no namespace
+             case 0:
+                 return new QualifiedName(
+-                        null, 
+-                        null, 
++                        null,
++                        null,
+                         decodeIdentifyingNonEmptyStringOnFirstBit(_v.localName),
+                         -1,
+                         -1,
+                         _identifier,
+                         null);
+-            // no prefix, namespace
++                // no prefix, namespace
+             case 1:
+                 return new QualifiedName(
+                         null,
+-                        decodeIdentifyingNonEmptyStringIndexOnFirstBitAsNamespaceName(false), 
++                        decodeIdentifyingNonEmptyStringIndexOnFirstBitAsNamespaceName(false),
+                         decodeIdentifyingNonEmptyStringOnFirstBit(_v.localName),
+                         -1,
+                         _namespaceNameIndex,
+                         _identifier,
+                         null);
+-            // prefix, no namespace
++                // prefix, no namespace
+             case 2:
+                 throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.qNameMissingNamespaceName"));
+-            // prefix, namespace
++                // prefix, namespace
+             case 3:
+                 return new QualifiedName(
+-                        decodeIdentifyingNonEmptyStringIndexOnFirstBitAsPrefix(true), 
+-                        decodeIdentifyingNonEmptyStringIndexOnFirstBitAsNamespaceName(true), 
++                        decodeIdentifyingNonEmptyStringIndexOnFirstBitAsPrefix(true),
++                        decodeIdentifyingNonEmptyStringIndexOnFirstBitAsNamespaceName(true),
+                         decodeIdentifyingNonEmptyStringOnFirstBit(_v.localName),
+                         _prefixIndex,
+-                        _namespaceNameIndex, 
++                        _namespaceNameIndex,
+                         _identifier,
+                         _charBuffer);
+             default:
+-                throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.decodingEII"));                
+-        }        
++                throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.decodingEII"));
++        }
+     }
+-    
++
+     protected final void processAIIs() throws FastInfosetException, IOException {
+         QualifiedName name;
+         int b;
+@@ -736,25 +746,25 @@
+         if (++_duplicateAttributeVerifier._currentIteration == Integer.MAX_VALUE) {
+             _duplicateAttributeVerifier.clear();
+         }
+-        
++
+         do {
+             // AII qualified name
+             b = read();
+-            switch (DecoderStateTables.AII[b]) {
++            switch (DecoderStateTables.AII(b)) {
+                 case DecoderStateTables.AII_INDEX_SMALL:
+                     name = _attributeNameTable._array[b];
+                     break;
+                 case DecoderStateTables.AII_INDEX_MEDIUM:
+                 {
+-                    final int i = (((b & EncodingConstants.INTEGER_2ND_BIT_MEDIUM_MASK) << 8) | read()) 
+-                        + EncodingConstants.INTEGER_2ND_BIT_SMALL_LIMIT;            
++                    final int i = (((b & EncodingConstants.INTEGER_2ND_BIT_MEDIUM_MASK) << 8) | read())
++                    + EncodingConstants.INTEGER_2ND_BIT_SMALL_LIMIT;
+                     name = _attributeNameTable._array[i];
+                     break;
+                 }
+                 case DecoderStateTables.AII_INDEX_LARGE:
+                 {
+-                    final int i = (((b & EncodingConstants.INTEGER_2ND_BIT_LARGE_MASK) << 16) | (read() << 8) | read()) 
+-                        + EncodingConstants.INTEGER_2ND_BIT_MEDIUM_LIMIT;
++                    final int i = (((b & EncodingConstants.INTEGER_2ND_BIT_LARGE_MASK) << 16) | (read() << 8) | read())
++                    + EncodingConstants.INTEGER_2ND_BIT_MEDIUM_LIMIT;
+                     name = _attributeNameTable._array[i];
+                     break;
+                 }
+@@ -762,10 +772,10 @@
+                     name = processLiteralQualifiedName(
+                             b & EncodingConstants.LITERAL_QNAME_PREFIX_NAMESPACE_NAME_MASK,
+                             _attributeNameTable.getNext());
+-                    name.createAttributeValues(_duplicateAttributeVerifier.MAP_SIZE);
++                    name.createAttributeValues(DuplicateAttributeVerifier.MAP_SIZE);
+                     _attributeNameTable.add(name);
+                     break;
+-                case DecoderStateTables.AII_TERMINATOR_DOUBLE:                    
++                case DecoderStateTables.AII_TERMINATOR_DOUBLE:
+                     _doubleTerminate = true;
+                 case DecoderStateTables.AII_TERMINATOR_SINGLE:
+                     _terminate = true;
+@@ -782,14 +792,14 @@
+             _duplicateAttributeVerifier.checkForDuplicateAttribute(name.attributeHash, name.attributeId);
+ 
+             Attr a = createAttribute(
+-                        name.namespaceName,
+-                        name.qName, 
+-                        name.localName);
+-                        
++                    name.namespaceName,
++                    name.qName,
++                    name.localName);
++
+             // [normalized value] of AII
+-            
++
+             b = read();
+-            switch(DecoderStateTables.NISTRING[b]) {
++            switch(DecoderStateTables.NISTRING(b)) {
+                 case DecoderStateTables.NISTRING_UTF8_SMALL_LENGTH:
+                 {
+                     final boolean addToTable = (b & EncodingConstants.NISTRING_ADD_TO_TABLE_FLAG) > 0;
+@@ -798,8 +808,8 @@
+                     if (addToTable) {
+                         _attributeValueTable.add(value);
+                     }
+-                    
+-                    a.setValue(value);                
++
++                    a.setValue(value);
+                     _currentElement.setAttributeNode(a);
+                     break;
+                 }
+@@ -811,8 +821,8 @@
+                     if (addToTable) {
+                         _attributeValueTable.add(value);
+                     }
+-                    
+-                    a.setValue(value);                
++
++                    a.setValue(value);
+                     _currentElement.setAttributeNode(a);
+                     break;
+                 }
+@@ -820,9 +830,9 @@
+                 {
+                     final boolean addToTable = (b & EncodingConstants.NISTRING_ADD_TO_TABLE_FLAG) > 0;
+                     final int length = (read() << 24) |
+-                        (read() << 16) |
+-                        (read() << 8) |
+-                        read();
++                            (read() << 16) |
++                            (read() << 8) |
++                            read();
+                     _octetBufferLength = length + EncodingConstants.OCTET_STRING_LENGTH_5TH_BIT_MEDIUM_LIMIT;
+                     value = decodeUtf8StringAsString();
+                     if (addToTable) {
+@@ -829,7 +839,7 @@
+                         _attributeValueTable.add(value);
+                     }
+ 
+-                    a.setValue(value);                
++                    a.setValue(value);
+                     _currentElement.setAttributeNode(a);
+                     break;
+                 }
+@@ -841,8 +851,8 @@
+                     if (addToTable) {
+                         _attributeValueTable.add(value);
+                     }
+-                    
+-                    a.setValue(value);                
++
++                    a.setValue(value);
+                     _currentElement.setAttributeNode(a);
+                     break;
+                 }
+@@ -854,8 +864,8 @@
+                     if (addToTable) {
+                         _attributeValueTable.add(value);
+                     }
+-                    
+-                    a.setValue(value);                
++
++                    a.setValue(value);
+                     _currentElement.setAttributeNode(a);
+                     break;
+                 }
+@@ -863,9 +873,9 @@
+                 {
+                     final boolean addToTable = (b & EncodingConstants.NISTRING_ADD_TO_TABLE_FLAG) > 0;
+                     final int length = (read() << 24) |
+-                        (read() << 16) |
+-                        (read() << 8) |
+-                        read();
++                            (read() << 16) |
++                            (read() << 8) |
++                            read();
+                     _octetBufferLength = length + EncodingConstants.OCTET_STRING_LENGTH_5TH_BIT_MEDIUM_LIMIT;
+                     value = decodeUtf16StringAsString();
+                     if (addToTable) {
+@@ -872,7 +882,7 @@
+                         _attributeValueTable.add(value);
+                     }
+ 
+-                    a.setValue(value);                
++                    a.setValue(value);
+                     _currentElement.setAttributeNode(a);
+                     break;
+                 }
+@@ -883,24 +893,21 @@
+                     _identifier = (b & 0x0F) << 4;
+                     b = read();
+                     _identifier |= (b & 0xF0) >> 4;
+-                    
++
+                     decodeOctetsOnFifthBitOfNonIdentifyingStringOnFirstBit(b);
+-                    
++
+                     value = decodeRestrictedAlphabetAsString();
+                     if (addToTable) {
+                         _attributeValueTable.add(value);
+                     }
+ 
+-                    a.setValue(value);                
++                    a.setValue(value);
+                     _currentElement.setAttributeNode(a);
+                     break;
+                 }
+                 case DecoderStateTables.NISTRING_EA:
+                 {
+-                    if ((b & EncodingConstants.NISTRING_ADD_TO_TABLE_FLAG) > 0) {
+-                        throw new EncodingAlgorithmException(CommonResourceBundle.getInstance().getString("message.addToTableNotSupported"));
+-                    }
+-
++                    final boolean addToTable = (b & EncodingConstants.NISTRING_ADD_TO_TABLE_FLAG) > 0;
+                     _identifier = (b & 0x0F) << 4;
+                     b = read();
+                     _identifier |= (b & 0xF0) >> 4;
+@@ -907,7 +914,10 @@
+ 
+                     decodeOctetsOnFifthBitOfNonIdentifyingStringOnFirstBit(b);
+                     value = convertEncodingAlgorithmDataToCharacters(true);
+-                    a.setValue(value);                
++                    if (addToTable) {
++                        _attributeValueTable.add(value);
++                    }
++                    a.setValue(value);
+                     _currentElement.setAttributeNode(a);
+                     break;
+                 }
+@@ -914,46 +924,46 @@
+                 case DecoderStateTables.NISTRING_INDEX_SMALL:
+                     value = _attributeValueTable._array[b & EncodingConstants.INTEGER_2ND_BIT_SMALL_MASK];
+ 
+-                    a.setValue(value);                
++                    a.setValue(value);
+                     _currentElement.setAttributeNode(a);
+                     break;
+                 case DecoderStateTables.NISTRING_INDEX_MEDIUM:
+                 {
+-                    final int index = (((b & EncodingConstants.INTEGER_2ND_BIT_MEDIUM_MASK) << 8) | read()) 
+-                        + EncodingConstants.INTEGER_2ND_BIT_SMALL_LIMIT;
++                    final int index = (((b & EncodingConstants.INTEGER_2ND_BIT_MEDIUM_MASK) << 8) | read())
++                    + EncodingConstants.INTEGER_2ND_BIT_SMALL_LIMIT;
+                     value = _attributeValueTable._array[index];
+ 
+-                    a.setValue(value);                
++                    a.setValue(value);
+                     _currentElement.setAttributeNode(a);
+                     break;
+                 }
+                 case DecoderStateTables.NISTRING_INDEX_LARGE:
+                 {
+-                    final int index = (((b & EncodingConstants.INTEGER_2ND_BIT_LARGE_MASK) << 16) | (read() << 8) | read()) 
+-                        + EncodingConstants.INTEGER_2ND_BIT_MEDIUM_LIMIT;
++                    final int index = (((b & EncodingConstants.INTEGER_2ND_BIT_LARGE_MASK) << 16) | (read() << 8) | read())
++                    + EncodingConstants.INTEGER_2ND_BIT_MEDIUM_LIMIT;
+                     value = _attributeValueTable._array[index];
+ 
+-                    a.setValue(value);                
++                    a.setValue(value);
+                     _currentElement.setAttributeNode(a);
+                     break;
+                 }
+                 case DecoderStateTables.NISTRING_EMPTY:
+-                    a.setValue("");                
++                    a.setValue("");
+                     _currentElement.setAttributeNode(a);
+                     break;
+                 default:
+                     throw new IOException(CommonResourceBundle.getInstance().getString("message.decodingAIIValue"));
+             }
+-            
++
+         } while (!_terminate);
+- 
++
+         // Reset duplication attribute verfifier
+         _duplicateAttributeVerifier._poolCurrent = _duplicateAttributeVerifier._poolHead;
+-        
++
+         _terminate = _doubleTerminate;
+         _doubleTerminate = false;
+     }
+-        
++
+     protected final void processCommentII() throws FastInfosetException, IOException {
+         switch(decodeNonIdentifyingStringOnFirstBit()) {
+             case NISTRING_STRING:
+@@ -962,12 +972,12 @@
+                 if (_addToTable) {
+                     _v.otherString.add(new CharArrayString(s, false));
+                 }
+-                
++
+                 _currentNode.appendChild(_document.createComment(s));
+                 break;
+             }
+             case NISTRING_ENCODING_ALGORITHM:
+-                throw new IOException(CommonResourceBundle.getInstance().getString("message.commentIIAlgorithmNotSupported"));                        
++                throw new IOException(CommonResourceBundle.getInstance().getString("message.commentIIAlgorithmNotSupported"));
+             case NISTRING_INDEX:
+             {
+                 final String s = _v.otherString.get(_integer).toString();
+@@ -978,7 +988,7 @@
+             case NISTRING_EMPTY_STRING:
+                 _currentNode.appendChild(_document.createComment(""));
+                 break;
+-        }        
++        }
+     }
+ 
+     protected final void processProcessingII() throws FastInfosetException, IOException {
+@@ -992,28 +1002,28 @@
+                     _v.otherString.add(new CharArrayString(data, false));
+                 }
+ 
+-                _currentNode.appendChild (_document.createProcessingInstruction (target, data));
++                _currentNode.appendChild(_document.createProcessingInstruction(target, data));
+                 break;
+             }
+             case NISTRING_ENCODING_ALGORITHM:
+-                throw new IOException(CommonResourceBundle.getInstance().getString("message.processingIIWithEncodingAlgorithm"));                        
++                throw new IOException(CommonResourceBundle.getInstance().getString("message.processingIIWithEncodingAlgorithm"));
+             case NISTRING_INDEX:
+             {
+                 final String data = _v.otherString.get(_integer).toString();
+-                
+-                _currentNode.appendChild (_document.createProcessingInstruction (target, data));
++
++                _currentNode.appendChild(_document.createProcessingInstruction(target, data));
+                 break;
+             }
+             case NISTRING_EMPTY_STRING:
+-                _currentNode.appendChild (_document.createProcessingInstruction (target, ""));
++                _currentNode.appendChild(_document.createProcessingInstruction(target, ""));
+                 break;
+         }
+     }
+-    
++
+     protected Element createElement(String namespaceName, String qName, String localName) {
+         return _document.createElementNS(namespaceName, qName);
+     }
+-    
++
+     protected Attr createAttribute(String namespaceName, String qName, String localName) {
+         return _document.createAttributeNS(namespaceName, qName);
+     }
+@@ -1021,16 +1031,16 @@
+     protected String convertEncodingAlgorithmDataToCharacters(boolean isAttributeValue) throws FastInfosetException, IOException {
+         StringBuffer buffer = new StringBuffer();
+         if (_identifier < EncodingConstants.ENCODING_ALGORITHM_BUILTIN_END) {
+-            Object array = BuiltInEncodingAlgorithmFactory.table[_identifier].
+-                decodeFromBytes(_octetBuffer, _octetBufferStart, _octetBufferLength);
+-            BuiltInEncodingAlgorithmFactory.table[_identifier].convertToCharacters(array,  buffer);
++            Object array = BuiltInEncodingAlgorithmFactory.getAlgorithm(_identifier).
++                    decodeFromBytes(_octetBuffer, _octetBufferStart, _octetBufferLength);
++            BuiltInEncodingAlgorithmFactory.getAlgorithm(_identifier).convertToCharacters(array,  buffer);
+         } else if (_identifier == EncodingAlgorithmIndexes.CDATA) {
+             if (!isAttributeValue) {
+                 // Set back buffer position to start of encoded string
+                 _octetBufferOffset -= _octetBufferLength;
+-                return decodeUtf8StringAsString();                
++                return decodeUtf8StringAsString();
+             }
+-            throw new EncodingAlgorithmException(CommonResourceBundle.getInstance().getString("message.CDATAAlgorithmNotSupported"));            
++            throw new EncodingAlgorithmException(CommonResourceBundle.getInstance().getString("message.CDATAAlgorithmNotSupported"));
+         } else if (_identifier >= EncodingConstants.ENCODING_ALGORITHM_APPLICATION_START) {
+             final String URI = _v.encodingAlgorithm.get(_identifier - EncodingConstants.ENCODING_ALGORITHM_APPLICATION_START);
+             final EncodingAlgorithm ea = (EncodingAlgorithm)_registeredEncodingAlgorithms.get(URI);
+@@ -1044,5 +1054,4 @@
+         }
+         return buffer.toString();
+     }
+-    
+ }
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/dom/DOMDocumentSerializer.java	Thu Jul 30 18:01:15 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/dom/DOMDocumentSerializer.java	Thu Jul 30 18:01:14 2009
+@@ -48,7 +48,7 @@
+  *
+  */
+ public class DOMDocumentSerializer extends Encoder {
+-    
++
+     /**
+      * Serialize a {@link Node}.
+      *
+@@ -70,7 +70,7 @@
+                 break;
+         }
+     }
+-    
++
+     /**
+      * Serialize a {@link Document}.
+      *
+@@ -80,7 +80,7 @@
+         reset();
+         encodeHeader(false);
+         encodeInitialVocabulary();
+-        
++
+         final NodeList nl = d.getChildNodes();
+         for (int i = 0; i < nl.getLength(); i++) {
+             final Node n = nl.item(i);
+@@ -98,31 +98,31 @@
+         }
+         encodeDocumentTermination();
+     }
+-    
++
+     protected final void serializeElementAsDocument(Node e) throws IOException {
+         reset();
+         encodeHeader(false);
+         encodeInitialVocabulary();
+-        
++
+         serializeElement(e);
+-        
++
+         encodeDocumentTermination();
+     }
+-    
++
+ //    protected Node[] _namespaceAttributes = new Node[4];
+-    
++
+     // map which will hold all current scope prefixes and associated attributes
+     // Collection of populated namespace available for current scope
+     protected NamespaceContextImplementation _namespaceScopeContext = new NamespaceContextImplementation();
+     protected Node[] _attributes = new Node[32];
+-    
++
+     protected final void serializeElement(Node e) throws IOException {
+         encodeTermination();
+-        
++
+         int attributesSize = 0;
+-        
++
+         _namespaceScopeContext.pushContext();
+-        
++
+         if (e.hasAttributes()) {
+             /*
+              * Split the attribute nodes into namespace attributes
+@@ -146,7 +146,7 @@
+                         _attributes = attributes;
+                     }
+                     _attributes[attributesSize++] = a;
+-                    
++
+                     String attrNamespaceURI = a.getNamespaceURI();
+                     String attrPrefix = a.getPrefix();
+                     if (attrPrefix != null && !_namespaceScopeContext.getNamespaceURI(attrPrefix).equals(attrNamespaceURI)) {
+@@ -155,7 +155,7 @@
+                 }
+             }
+         }
+-        
++
+         String elementNamespaceURI = e.getNamespaceURI();
+         String elementPrefix = e.getPrefix();
+         if (elementPrefix == null)  elementPrefix = "";
+@@ -163,7 +163,7 @@
+                 !_namespaceScopeContext.getNamespaceURI(elementPrefix).equals(elementNamespaceURI)) {
+             _namespaceScopeContext.declarePrefix(elementPrefix, elementNamespaceURI);
+         }
+-        
++
+         if (!_namespaceScopeContext.isCurrentContextEmpty()) {
+             if (attributesSize > 0) {
+                 write(EncodingConstants.ELEMENT | EncodingConstants.ELEMENT_NAMESPACES_FLAG |
+@@ -171,7 +171,7 @@
+             } else {
+                 write(EncodingConstants.ELEMENT | EncodingConstants.ELEMENT_NAMESPACES_FLAG);
+             }
+-            
++
+             for (int i = _namespaceScopeContext.getCurrentContextStartIndex();
+                      i < _namespaceScopeContext.getCurrentContextEndIndex(); i++) {
+ 
+@@ -185,12 +185,12 @@
+             _b = (attributesSize > 0) ? EncodingConstants.ELEMENT | EncodingConstants.ELEMENT_ATTRIBUTE_FLAG :
+                 EncodingConstants.ELEMENT;
+         }
+-        
++
+         String namespaceURI = elementNamespaceURI;
+ //        namespaceURI = (namespaceURI == null) ? _namespaceScopeContext.getNamespaceURI("") : namespaceURI;
+         namespaceURI = (namespaceURI == null) ? "" : namespaceURI;
+         encodeElement(namespaceURI, e.getNodeName(), e.getLocalName());
+-        
++
+         if (attributesSize > 0) {
+             // Serialize the attributes
+             for (int i = 0; i < attributesSize; i++) {
+@@ -199,16 +199,16 @@
+                 namespaceURI = a.getNamespaceURI();
+                 namespaceURI = (namespaceURI == null) ? "" : namespaceURI;
+                 encodeAttribute(namespaceURI, a.getNodeName(), a.getLocalName());
+-                
++
+                 final String value = a.getNodeValue();
+                 final boolean addToTable = isAttributeValueLengthMatchesLimit(value.length());
+-                encodeNonIdentifyingStringOnFirstBit(value, _v.attributeValue, addToTable);
++                encodeNonIdentifyingStringOnFirstBit(value, _v.attributeValue, addToTable, false);
+             }
+-            
++
+             _b = EncodingConstants.TERMINATOR;
+             _terminate = true;
+         }
+-        
++
+         if (e.hasChildNodes()) {
+             // Serialize the children
+             final NodeList nl = e.getChildNodes();
+@@ -236,11 +236,11 @@
+         encodeElementTermination();
+         _namespaceScopeContext.popContext();
+     }
+-    
+-    
++
++
+     protected final void serializeText(Node t) throws IOException {
+         final String text = t.getNodeValue();
+-        
++
+         final int length = (text != null) ? text.length() : 0;
+         if (length == 0) {
+             return;
+@@ -248,7 +248,7 @@
+             text.getChars(0, length, _charBuffer, 0);
+             if (getIgnoreWhiteSpaceTextContent() &&
+                     isWhiteSpace(_charBuffer, 0, length)) return;
+-            
++
+             encodeTermination();
+             encodeCharacters(_charBuffer, 0, length);
+         } else {
+@@ -255,15 +255,15 @@
+             final char ch[] = text.toCharArray();
+             if (getIgnoreWhiteSpaceTextContent() &&
+                     isWhiteSpace(ch, 0, length)) return;
+-            
++
+             encodeTermination();
+             encodeCharactersNoClone(ch, 0, length);
+         }
+     }
+-    
++
+     protected final void serializeCDATA(Node t) throws IOException {
+         final String text = t.getNodeValue();
+-        
++
+         final int length = (text != null) ? text.length() : 0;
+         if (length == 0) {
+             return;
+@@ -271,7 +271,7 @@
+             final char ch[] = text.toCharArray();
+             if (getIgnoreWhiteSpaceTextContent() &&
+                     isWhiteSpace(ch, 0, length)) return;
+-            
++
+             encodeTermination();
+             try {
+                 encodeCIIBuiltInAlgorithmDataAsCDATA(ch, 0, length);
+@@ -280,14 +280,14 @@
+             }
+         }
+     }
+-    
++
+     protected final void serializeComment(Node c) throws IOException {
+         if (getIgnoreComments()) return;
+-        
++
+         encodeTermination();
+-        
++
+         final String comment = c.getNodeValue();
+-        
++
+         final int length = (comment != null) ? comment.length() : 0;
+         if (length == 0) {
+             encodeComment(_charBuffer, 0, 0);
+@@ -299,17 +299,17 @@
+             encodeCommentNoClone(ch, 0, length);
+         }
+     }
+-    
++
+     protected final void serializeProcessingInstruction(Node pi) throws IOException {
+         if (getIgnoreProcesingInstructions()) return;
+-        
++
+         encodeTermination();
+-        
++
+         final String target = pi.getNodeName();
+         final String data = pi.getNodeValue();
+         encodeProcessingInstruction(target, data);
+     }
+-    
++
+     protected final void encodeElement(String namespaceURI, String qName, String localName) throws IOException {
+         LocalNameQualifiedNamesMap.Entry entry = _v.elementName.obtainEntry(qName);
+         if (entry._valueIndex > 0) {
+@@ -321,7 +321,7 @@
+                 }
+             }
+         }
+-        
++
+         // Was DOM node created using an NS-aware call?
+         if (localName != null) {
+             encodeLiteralElementQualifiedNameOnThirdBit(namespaceURI, getPrefixFromQualifiedName(qName),
+@@ -330,7 +330,7 @@
+             encodeLiteralElementQualifiedNameOnThirdBit(namespaceURI, "", qName, entry);
+         }
+     }
+-    
++
+     protected final void encodeAttribute(String namespaceURI, String qName, String localName) throws IOException {
+         LocalNameQualifiedNamesMap.Entry entry = _v.attributeName.obtainEntry(qName);
+         if (entry._valueIndex > 0) {
+@@ -342,7 +342,7 @@
+                 }
+             }
+         }
+-        
++
+         // Was DOM node created using an NS-aware call?
+         if (localName != null) {
+             encodeLiteralAttributeQualifiedNameOnSecondBit(namespaceURI, getPrefixFromQualifiedName(qName),
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/org/apache/xerces/util/XMLChar.java	Thu Jul 30 18:01:19 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/org/apache/xerces/util/XMLChar.java	Thu Jul 30 18:01:18 2009
+@@ -2,7 +2,7 @@
+  * reserved comment block
+  * DO NOT REMOVE OR ALTER!
+  */
+-/*
++ /*
+  * Portions Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+  *
+@@ -33,7 +33,7 @@
+  * The Apache Software License, Version 1.1
+  *
+  *
+- * Copyright (c) 1999-2004 The Apache Software Foundation.  All rights 
++ * Copyright (c) 1999-2004 The Apache Software Foundation.  All rights
+  * reserved.
+  *
+  * Redistribution and use in source and binary forms, with or without
+@@ -41,7 +41,7 @@
+  * are met:
+  *
+  * 1. Redistributions of source code must retain the above copyright
+- *    notice, this list of conditions and the following disclaimer. 
++ *    notice, this list of conditions and the following disclaimer.
+  *
+  * 2. Redistributions in binary form must reproduce the above copyright
+  *    notice, this list of conditions and the following disclaimer in
+@@ -49,7 +49,7 @@
+  *    distribution.
+  *
+  * 3. The end-user documentation included with the redistribution,
+- *    if any, must include the following acknowledgment:  
++ *    if any, must include the following acknowledgment:
+  *       "This product includes software developed by the
+  *        Apache Software Foundation (http://www.apache.org/)."
+  *    Alternately, this acknowledgment may appear in the software itself,
+@@ -57,7 +57,7 @@
+  *
+  * 4. The names "Xerces" and "Apache Software Foundation" must
+  *    not be used to endorse or promote products derived from this
+- *    software without prior written permission. For written 
++ *    software without prior written permission. For written
+  *    permission, please contact apache@apache.org.
+  *
+  * 5. Products derived from this software may not be called "Apache",
+@@ -112,7 +112,7 @@
+  * @author Michael Glavassevich, IBM
+  * @author Rahul Srivastava, Sun Microsystems Inc.
+  *
+- * @version $Id: XMLChar.java,v 1.1 2005/04/18 12:54:47 sandoz Exp $
++ * @version $Id: XMLChar.java,v 1.2 2006/03/16 16:22:16 sandoz Exp $
+  */
+ public class XMLChar {
+ 
+@@ -137,10 +137,10 @@
+ 
+     /** Pubid character mask. */
+     public static final int MASK_PUBID = 0x10;
+-    
+-    /** 
++
++    /**
+      * Content character mask. Special characters are those that can
+-     * be considered the start of markup, such as '&lt;' and '&amp;'. 
++     * be considered the start of markup, such as '&lt;' and '&amp;'.
+      * The various newline characters are considered special as well.
+      * All other valid XML characters can be considered content.
+      * <p>
+@@ -159,10 +159,10 @@
+     //
+ 
+     static {
+-        
++
+         // Initializing the Character Flag Array
+         // Code generated by: XMLCharGenerator.
+-        
++
+         CHARS[9] = 35;
+         CHARS[10] = 19;
+         CHARS[13] = 19;
+@@ -979,8 +979,8 @@
+         }
+         return true;
+     } // isValidName(String):boolean
+-    
+ 
++
+     /*
+      * from the namespace rec
+      * [4] NCName ::= (Letter | '_') (NCNameChar)*
+@@ -1015,7 +1015,7 @@
+      * in the XML 1.0 Recommendation
+      *
+      * @param nmtoken string to check
+-     * @return true if nmtoken is a valid Nmtoken 
++     * @return true if nmtoken is a valid Nmtoken
+      */
+     public static boolean isValidNmtoken(String nmtoken) {
+         if (nmtoken.length() == 0)
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/resources/ResourceBundle.properties	Thu Jul 30 18:01:22 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/resources/ResourceBundle.properties	Thu Jul 30 18:01:22 2009
+@@ -22,6 +22,8 @@
+ # CA 95054 USA or visit www.sun.com if you need additional information or
+ # have any questions.
+ #
++# THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
++#
+ 
+ # Sample ResourceBundle properties file
+ message.optinalValues = Optional values (other than initial vocabulary) of DII not supported
+@@ -132,7 +134,7 @@
+ message.URINotPresent=URI not present for encoding algorithm identifier {0}
+ message.algorithmNotRegistered=Encoding algorithm not registered for URI {0}
+ message.featureNotSupported=Feature not supported\: {0}
+-message.propertyNotRecognized=Property not recognized\: 
++message.propertyNotRecognized=Property not recognized\:
+ message.inputSource=InputSource must include a byte stream or a system ID
+ message.qNameOfEIINotInScope=Qualified name of EII not in scope
+ message.unsupportedAlgorithm=Unsupported built-in encoding algorithm\: {0}
+@@ -172,7 +174,7 @@
+ message.nullPropertyName=Property name can not be null.
+ 
+ message.validationNotSupported=This implementation does not support validation
+-message.externalEntities=This implementation does not resolve external entities 
++message.externalEntities=This implementation does not resolve external entities
+ message.propertyNotSupported=Property {0} is not supported
+ message.noElement=No element.
+ message.nullXMLEventAllocator=XMLEvent Allocator may not be null
+@@ -203,4 +205,3 @@
+ message.illegalLoadFactor=Illegal load factor\: {0}
+ message.duplicateNamespaceAttribute=Duplicate namespace attribute entry
+ message.readonlyList=The list is read-only. Content can not be changed.
+- 
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/sax/AttributesHolder.java	Thu Jul 30 18:01:26 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/sax/AttributesHolder.java	Thu Jul 30 18:01:25 2009
+@@ -24,9 +24,9 @@
+  *
+  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
+  */
+- 
+ 
+ 
++
+ package com.sun.xml.internal.fastinfoset.sax;
+ 
+ import com.sun.xml.internal.fastinfoset.EncodingConstants;
+@@ -46,20 +46,20 @@
+     private static final int DEFAULT_CAPACITY = 8;
+ 
+     private Map _registeredEncodingAlgorithms;
+-    
++
+     private int _attributeCount;
+-    
++
+     private QualifiedName[] _names;
+     private String[] _values;
+-    
++
+     private String[] _algorithmURIs;
+     private int[] _algorithmIds;
+     private Object[] _algorithmData;
+-    
++
+     public AttributesHolder() {
+         _names = new QualifiedName[DEFAULT_CAPACITY];
+         _values = new String[DEFAULT_CAPACITY];
+-        
++
+         _algorithmURIs = new String[DEFAULT_CAPACITY];
+         _algorithmIds = new int[DEFAULT_CAPACITY];
+         _algorithmData = new Object[DEFAULT_CAPACITY];
+@@ -69,9 +69,9 @@
+         this();
+         _registeredEncodingAlgorithms = registeredEncodingAlgorithms;
+     }
+-    
++
+     // org.xml.sax.Attributes
+-    
++
+     public final int getLength() {
+         return _attributeCount;
+     }
+@@ -97,11 +97,11 @@
+         if (value != null) {
+             return value;
+         }
+-        
++
+         if (_algorithmData[index] == null || _registeredEncodingAlgorithms == null) {
+             return null;
+         }
+-                
++
+         try {
+             return _values[index] = convertEncodingAlgorithmDataToString(
+                     _algorithmIds[index],
+@@ -122,7 +122,7 @@
+             prefix = qName.substring(0, i);
+             localName = qName.substring(i + 1);
+         }
+-        
++
+         for (i = 0; i < _attributeCount; i++) {
+             QualifiedName name = _names[i];
+             if (localName.equals(name.localName) &&
+@@ -189,15 +189,15 @@
+     }
+ 
+     // EncodingAlgorithmAttributes
+-    
++
+     public final String getAlgorithmURI(int index) {
+         return _algorithmURIs[index];
+     }
+- 
++
+     public final int getAlgorithmIndex(int index) {
+         return _algorithmIds[index];
+     }
+-    
++
+     public final Object getAlgorithmData(int index) {
+         return _algorithmData[index];
+     }
+@@ -209,9 +209,9 @@
+     public boolean getToIndex(int index) {
+         return false;
+     }
+-    
++
+     // -----
+-    
++
+     public final void addAttribute(QualifiedName name, String value) {
+         if (_attributeCount == _names.length) {
+             resize();
+@@ -235,11 +235,11 @@
+     public final QualifiedName getQualifiedName(int index) {
+         return _names[index];
+     }
+-    
++
+     public final String getPrefix(int index) {
+         return _names[index].prefix;
+     }
+-        
++
+     private final void resize() {
+         final int newLength = _attributeCount * 3 / 2 + 1;
+ 
+@@ -264,18 +264,18 @@
+         _algorithmIds = algorithmIds;
+         _algorithmData = algorithmData;
+     }
+-    
++
+     private final StringBuffer convertEncodingAlgorithmDataToString(int identifier, String URI, Object data) throws FastInfosetException, IOException {
+         EncodingAlgorithm ea = null;
+         if (identifier < EncodingConstants.ENCODING_ALGORITHM_BUILTIN_END) {
+-            ea = BuiltInEncodingAlgorithmFactory.table[identifier];
++            ea = BuiltInEncodingAlgorithmFactory.getAlgorithm(identifier);
+         } else if (identifier == EncodingAlgorithmIndexes.CDATA) {
+-            throw new EncodingAlgorithmException(CommonResourceBundle.getInstance().getString("message.CDATAAlgorithmNotSupported"));            
++            throw new EncodingAlgorithmException(CommonResourceBundle.getInstance().getString("message.CDATAAlgorithmNotSupported"));
+         } else if (identifier >= EncodingConstants.ENCODING_ALGORITHM_APPLICATION_START) {
+             if (URI == null) {
+                 throw new EncodingAlgorithmException(CommonResourceBundle.getInstance().getString("message.URINotPresent") + identifier);
+             }
+-            
++
+             ea = (EncodingAlgorithm)_registeredEncodingAlgorithms.get(URI);
+             if (ea == null) {
+                 throw new EncodingAlgorithmException(CommonResourceBundle.getInstance().getString("message.algorithmNotRegistered") + URI);
+@@ -290,6 +290,6 @@
+         final StringBuffer sb = new StringBuffer();
+         ea.convertToCharacters(data, sb);
+         return sb;
+-    }    
++    }
+ 
+ }
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/sax/Features.java	Thu Jul 30 18:01:30 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/sax/Features.java	Thu Jul 30 18:01:29 2009
+@@ -24,16 +24,16 @@
+  *
+  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
+  */
+- 
+ 
+ 
++
+ package com.sun.xml.internal.fastinfoset.sax;
+ 
+ public class Features {
+     public static final String NAMESPACES_FEATURE =
+         "http://xml.org/sax/features/namespaces";
+-    public static final String NAMESPACE_PREFIXES_FEATURE = 
++    public static final String NAMESPACE_PREFIXES_FEATURE =
+         "http://xml.org/sax/features/namespace-prefixes";
+-    public static final String STRING_INTERNING_FEATURE = 
++    public static final String STRING_INTERNING_FEATURE =
+         "http://xml.org/sax/features/string-interning";
+ }
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/sax/Properties.java	Thu Jul 30 18:01:33 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/sax/Properties.java	Thu Jul 30 18:01:32 2009
+@@ -24,9 +24,9 @@
+  *
+  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
+  */
+- 
+ 
+ 
++
+ package com.sun.xml.internal.fastinfoset.sax;
+ 
+ public class Properties {
+@@ -35,4 +35,3 @@
+     public static final String DTD_DECLARATION_HANDLER_PROPERTY =
+             "http://xml.org/sax/properties/declaration-handler";
+ }
+-
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/sax/SAXDocumentParser.java	Thu Jul 30 18:01:36 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/sax/SAXDocumentParser.java	Thu Jul 30 18:01:36 2009
+@@ -63,11 +63,11 @@
+ /**
+  * The Fast Infoset SAX parser.
+  * <p>
+- * Instantiate this parser to parse a fast infoset document in accordance 
++ * Instantiate this parser to parse a fast infoset document in accordance
+  * with the SAX API.
+- * 
++ *
+  * <p>
+- * More than one fast infoset document may be decoded from the 
++ * More than one fast infoset document may be decoded from the
+  * {@link java.io.InputStream}.
+  */
+ public class SAXDocumentParser extends Decoder implements FastInfosetReader {
+@@ -78,17 +78,17 @@
+      */
+     private static final class LexicalHandlerImpl implements LexicalHandler {
+         public void comment(char[] ch, int start, int end) { }
+-        
++
+         public void startDTD(String name, String publicId, String systemId) { }
+         public void endDTD() { }
+ 
+         public void startEntity(String name) { }
+         public void endEntity(String name) { }
+-        
++
+         public void startCDATA() { }
+         public void endCDATA() { }
+     };
+-    
++
+     /*
+      * Empty DTD declaration handler used by default to report
+      * DTD declaration-based events
+@@ -97,74 +97,74 @@
+         public void elementDecl(String name, String model) throws SAXException {
+         }
+ 
+-        public void attributeDecl(String eName, String aName, 
++        public void attributeDecl(String eName, String aName,
+                 String type, String mode, String value) throws SAXException {
+         }
+ 
+-        public void internalEntityDecl(String name, 
++        public void internalEntityDecl(String name,
+                 String value) throws SAXException {
+         }
+ 
+-        public void externalEntityDecl(String name, 
++        public void externalEntityDecl(String name,
+                 String publicId, String systemId) throws SAXException {
+         }
+     }
+-    
++
+     /**
+      * SAX Namespace attributes features
+      */
+     protected boolean _namespacePrefixesFeature = false;
+-    
++
+     /**
+      * Reference to entity resolver.
+      */
+     protected EntityResolver _entityResolver;
+-    
++
+     /**
+      * Reference to dtd handler.
+      */
+     protected DTDHandler _dtdHandler;
+-    
++
+     /**
+      * Reference to content handler.
+      */
+     protected ContentHandler _contentHandler;
+-    
++
+     /**
+      * Reference to error handler.
+      */
+     protected ErrorHandler _errorHandler;
+-    
++
+     /**
+      * Reference to lexical handler.
+      */
+     protected LexicalHandler _lexicalHandler;
+-    
++
+     /**
+      * Reference to DTD declaration handler.
+      */
+     protected DeclHandler _declHandler;
+-    
++
+     protected EncodingAlgorithmContentHandler _algorithmHandler;
+-    
++
+     protected PrimitiveTypeContentHandler _primitiveHandler;
+-        
++
+     protected BuiltInEncodingAlgorithmState builtInAlgorithmState =
+             new BuiltInEncodingAlgorithmState();
+-    
++
+     protected AttributesHolder _attributes;
+-    
++
+     protected int[] _namespacePrefixes = new int[16];
+-    
++
+     protected int _namespacePrefixesIndex;
+-    
++
+     protected boolean _clearAttributes = false;
+-    
++
+     /** Creates a new instance of DocumetParser2 */
+     public SAXDocumentParser() {
+         DefaultHandler handler = new DefaultHandler();
+         _attributes = new AttributesHolder(_registeredEncodingAlgorithms);
+-        
++
+         _entityResolver = handler;
+         _dtdHandler = handler;
+         _contentHandler = handler;
+@@ -172,7 +172,7 @@
+         _lexicalHandler = new LexicalHandlerImpl();
+         _declHandler = new DeclHandlerImpl();
+     }
+-    
++
+     protected void resetOnError() {
+         _clearAttributes = false;
+         _attributes.clear();
+@@ -183,9 +183,9 @@
+         }
+         _duplicateAttributeVerifier.clear();
+     }
+-    
++
+     // XMLReader interface
+-    
++
+     public boolean getFeature(String name)
+     throws SAXNotRecognizedException, SAXNotSupportedException {
+         if (name.equals(Features.NAMESPACES_FEATURE)) {
+@@ -200,7 +200,7 @@
+                     CommonResourceBundle.getInstance().getString("message.featureNotSupported") + name);
+         }
+     }
+-    
++
+     public void setFeature(String name, boolean value)
+     throws SAXNotRecognizedException, SAXNotSupportedException {
+         if (name.equals(Features.NAMESPACES_FEATURE)) {
+@@ -217,7 +217,7 @@
+                     CommonResourceBundle.getInstance().getString("message.featureNotSupported") + name);
+         }
+     }
+-    
++
+     public Object getProperty(String name)
+     throws SAXNotRecognizedException, SAXNotSupportedException {
+         if (name.equals(Properties.LEXICAL_HANDLER_PROPERTY)) {
+@@ -237,7 +237,7 @@
+                     getString("message.propertyNotRecognized", new Object[]{name}));
+         }
+     }
+-    
++
+     public void setProperty(String name, Object value)
+     throws SAXNotRecognizedException, SAXNotSupportedException {
+         if (name.equals(Properties.LEXICAL_HANDLER_PROPERTY)) {
+@@ -251,7 +251,7 @@
+                 setDeclHandler((DeclHandler)value);
+             } else {
+                 throw new SAXNotSupportedException(Properties.LEXICAL_HANDLER_PROPERTY);
+-            }            
++            }
+         } else if (name.equals(FastInfosetReader.EXTERNAL_VOCABULARIES_PROPERTY)) {
+             if (value instanceof Map) {
+                 setExternalVocabularies((Map)value);
+@@ -287,19 +287,19 @@
+                     getString("message.propertyNotRecognized", new Object[]{name}));
+         }
+     }
+-    
++
+     public void setEntityResolver(EntityResolver resolver) {
+         _entityResolver = resolver;
+     }
+-    
++
+     public EntityResolver getEntityResolver() {
+         return _entityResolver;
+     }
+-    
++
+     public void setDTDHandler(DTDHandler handler) {
+         _dtdHandler = handler;
+     }
+-    
++
+     public DTDHandler getDTDHandler() {
+         return _dtdHandler;
+     }
+@@ -306,19 +306,19 @@
+     public void setContentHandler(ContentHandler handler) {
+         _contentHandler = handler;
+     }
+-    
++
+     public ContentHandler getContentHandler() {
+         return _contentHandler;
+     }
+-    
++
+     public void setErrorHandler(ErrorHandler handler) {
+         _errorHandler = handler;
+     }
+-    
++
+     public ErrorHandler getErrorHandler() {
+         return _errorHandler;
+     }
+-    
++
+     public void parse(InputSource input) throws IOException, SAXException {
+         try {
+             InputStream s = input.getByteStream();
+@@ -336,7 +336,7 @@
+             throw new SAXException(e);
+         }
+     }
+-    
++
+     public void parse(String systemId) throws IOException, SAXException {
+         try {
+             systemId = SystemIdResolver.getAbsoluteURI(systemId);
+@@ -346,63 +346,63 @@
+             throw new SAXException(e);
+         }
+     }
+-    
+-    
+-    
+-    
++
++
++
++
+     // FastInfosetReader
+-    
++
+     public final void parse(InputStream s) throws IOException, FastInfosetException, SAXException {
+         setInputStream(s);
+         parse();
+     }
+-        
++
+     public void setLexicalHandler(LexicalHandler handler) {
+         _lexicalHandler = handler;
+     }
+-    
++
+     public LexicalHandler getLexicalHandler() {
+         return _lexicalHandler;
+     }
+-    
++
+     public void setDeclHandler(DeclHandler handler) {
+         _declHandler = handler;
+     }
+-    
++
+     public DeclHandler getDeclHandler() {
+         return _declHandler;
+     }
+-    
++
+     public void setEncodingAlgorithmContentHandler(EncodingAlgorithmContentHandler handler) {
+         _algorithmHandler = handler;
+     }
+-    
++
+     public EncodingAlgorithmContentHandler getEncodingAlgorithmContentHandler() {
+         return _algorithmHandler;
+     }
+-    
++
+     public void setPrimitiveTypeContentHandler(PrimitiveTypeContentHandler handler) {
+         _primitiveHandler = handler;
+     }
+-    
++
+     public PrimitiveTypeContentHandler getPrimitiveTypeContentHandler() {
+         return _primitiveHandler;
+     }
+-    
+-    
+-    
+-    
++
++
++
++
+     public final void parse() throws FastInfosetException, IOException {
+         if (_octetBuffer.length < _bufferSize) {
+             _octetBuffer = new byte[_bufferSize];
+         }
+-        
++
+         try {
+             reset();
+             decodeHeader();
+             if (_parseFragments)
+                 processDIIFragment();
+-            else 
++            else
+                 processDII();
+         } catch (RuntimeException e) {
+             try {
+@@ -428,7 +428,7 @@
+             throw e;
+         }
+     }
+-    
++
+     protected final void processDII() throws FastInfosetException, IOException {
+         try {
+             _contentHandler.startDocument();
+@@ -435,18 +435,18 @@
+         } catch (SAXException e) {
+             throw new FastInfosetException("processDII", e);
+         }
+-                
++
+         _b = read();
+         if (_b > 0) {
+             processDIIOptionalProperties();
+         }
+-        
++
+         // Decode one Document Type II, Comment IIs, PI IIs and one EII
+         boolean firstElementHasOccured = false;
+         boolean documentTypeDeclarationOccured = false;
+         while(!_terminate || !firstElementHasOccured) {
+             _b = read();
+-            switch(DecoderStateTables.DII[_b]) {
++            switch(DecoderStateTables.DII(_b)) {
+                 case DecoderStateTables.EII_NO_AIIS_INDEX_SMALL:
+                     processEII(_elementNameTable._array[_b], false);
+                     firstElementHasOccured = true;
+@@ -466,8 +466,8 @@
+                 case DecoderStateTables.EII_LITERAL:
+                 {
+                     final QualifiedName qn = decodeLiteralQualifiedName(
+-                                _b & EncodingConstants.LITERAL_QNAME_PREFIX_NAMESPACE_NAME_MASK,
+-                                _elementNameTable.getNext());
++                            _b & EncodingConstants.LITERAL_QNAME_PREFIX_NAMESPACE_NAME_MASK,
++                            _elementNameTable.getNext());
+                     _elementNameTable.add(qn);
+                     processEII(qn, (_b & EncodingConstants.ELEMENT_ATTRIBUTE_FLAG) > 0);
+                     firstElementHasOccured = true;
+@@ -483,12 +483,12 @@
+                         throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.secondOccurenceOfDTDII"));
+                     }
+                     documentTypeDeclarationOccured = true;
+-                    
++
+                     String system_identifier = ((_b & EncodingConstants.DOCUMENT_TYPE_SYSTEM_IDENTIFIER_FLAG) > 0)
+                     ? decodeIdentifyingNonEmptyStringOnFirstBit(_v.otherURI) : "";
+                     String public_identifier = ((_b & EncodingConstants.DOCUMENT_TYPE_PUBLIC_IDENTIFIER_FLAG) > 0)
+                     ? decodeIdentifyingNonEmptyStringOnFirstBit(_v.otherURI) : "";
+-                    
++
+                     _b = read();
+                     while (_b == EncodingConstants.PROCESSING_INSTRUCTION) {
+                         switch(decodeNonIdentifyingStringOnFirstBit()) {
+@@ -512,7 +512,7 @@
+                     if (_b == EncodingConstants.DOUBLE_TERMINATOR) {
+                         _terminate = true;
+                     }
+-                    
++
+                     if (_notations != null) _notations.clear();
+                     if (_unparsedEntities != null) _unparsedEntities.clear();
+                     /*
+@@ -536,11 +536,11 @@
+                     throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.IllegalStateDecodingDII"));
+             }
+         }
+-        
++
+         // Decode any remaining Comment IIs, PI IIs
+         while(!_terminate) {
+             _b = read();
+-            switch(DecoderStateTables.DII[_b]) {
++            switch(DecoderStateTables.DII(_b)) {
+                 case DecoderStateTables.COMMENT_II:
+                     processCommentII();
+                     break;
+@@ -556,7 +556,7 @@
+                     throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.IllegalStateDecodingDII"));
+             }
+         }
+-        
++
+         try {
+             _contentHandler.endDocument();
+         } catch (SAXException e) {
+@@ -563,7 +563,7 @@
+             throw new FastInfosetException("processDII", e);
+         }
+     }
+-    
++
+     protected final void processDIIFragment() throws FastInfosetException, IOException {
+         try {
+             _contentHandler.startDocument();
+@@ -570,15 +570,15 @@
+         } catch (SAXException e) {
+             throw new FastInfosetException("processDII", e);
+         }
+-                
++
+         _b = read();
+         if (_b > 0) {
+             processDIIOptionalProperties();
+         }
+-        
++
+         while(!_terminate) {
+             _b = read();
+-            switch(DecoderStateTables.EII[_b]) {
++            switch(DecoderStateTables.EII(_b)) {
+                 case DecoderStateTables.EII_NO_AIIS_INDEX_SMALL:
+                     processEII(_elementNameTable._array[_b], false);
+                     break;
+@@ -594,8 +594,8 @@
+                 case DecoderStateTables.EII_LITERAL:
+                 {
+                     final QualifiedName qn = decodeLiteralQualifiedName(
+-                                _b & EncodingConstants.LITERAL_QNAME_PREFIX_NAMESPACE_NAME_MASK,
+-                                _elementNameTable.getNext());
++                            _b & EncodingConstants.LITERAL_QNAME_PREFIX_NAMESPACE_NAME_MASK,
++                            _elementNameTable.getNext());
+                     _elementNameTable.add(qn);
+                     processEII(qn, (_b & EncodingConstants.ELEMENT_ATTRIBUTE_FLAG) > 0);
+                     break;
+@@ -627,7 +627,7 @@
+                     if ((_b & EncodingConstants.CHARACTER_CHUNK_ADD_TO_TABLE_FLAG) > 0) {
+                         _characterContentChunkTable.add(_charBuffer, _charBufferLength);
+                     }
+-                    
++
+                     try {
+                         _contentHandler.characters(_charBuffer, 0, _charBufferLength);
+                     } catch (SAXException e) {
+@@ -640,7 +640,7 @@
+                     if ((_b & EncodingConstants.CHARACTER_CHUNK_ADD_TO_TABLE_FLAG) > 0) {
+                         _characterContentChunkTable.add(_charBuffer, _charBufferLength);
+                     }
+-                    
++
+                     try {
+                         _contentHandler.characters(_charBuffer, 0, _charBufferLength);
+                     } catch (SAXException e) {
+@@ -657,7 +657,7 @@
+                     if ((_b & EncodingConstants.CHARACTER_CHUNK_ADD_TO_TABLE_FLAG) > 0) {
+                         _characterContentChunkTable.add(_charBuffer, _charBufferLength);
+                     }
+-                    
++
+                     try {
+                         _contentHandler.characters(_charBuffer, 0, _charBufferLength);
+                     } catch (SAXException e) {
+@@ -667,16 +667,16 @@
+                 case DecoderStateTables.CII_RA:
+                 {
+                     final boolean addToTable = (_b & EncodingConstants.CHARACTER_CHUNK_ADD_TO_TABLE_FLAG) > 0;
+-                    
++
+                     // Decode resitricted alphabet integer
+                     _identifier = (_b & 0x02) << 6;
+                     _b = read();
+                     _identifier |= (_b & 0xFC) >> 2;
+-                    
++
+                     decodeOctetsOnSeventhBitOfNonIdentifyingStringOnThirdBit(_b);
+-                    
++
+                     decodeRestrictedAlphabetAsCharBuffer();
+-                    
++
+                     if (addToTable) {
+                         _characterContentChunkTable.add(_charBuffer, _charBufferLength);
+                     }
+@@ -685,23 +685,21 @@
+                         _contentHandler.characters(_charBuffer, 0, _charBufferLength);
+                     } catch (SAXException e) {
+                         throw new FastInfosetException("processCII", e);
+-                    }                    
++                    }
+                     break;
+                 }
+                 case DecoderStateTables.CII_EA:
+                 {
+-                    if ((_b & EncodingConstants.NISTRING_ADD_TO_TABLE_FLAG) > 0) {
+-                        throw new EncodingAlgorithmException(CommonResourceBundle.getInstance().getString("message.addToTableNotSupported"));
+-                    }
+-                    
++                    final boolean addToTable = (_b & EncodingConstants.CHARACTER_CHUNK_ADD_TO_TABLE_FLAG) > 0;
++
+                     // Decode encoding algorithm integer
+                     _identifier = (_b & 0x02) << 6;
+                     _b = read();
+                     _identifier |= (_b & 0xFC) >> 2;
+-                    
++
+                     decodeOctetsOnSeventhBitOfNonIdentifyingStringOnThirdBit(_b);
+-                    
+-                    processCIIEncodingAlgorithm();
++
++                    processCIIEncodingAlgorithm(addToTable);
+                     break;
+                 }
+                 case DecoderStateTables.CII_INDEX_SMALL:
+@@ -708,8 +706,8 @@
+                 {
+                     final int index = _b & EncodingConstants.INTEGER_4TH_BIT_SMALL_MASK;
+                     try {
+-                        _contentHandler.characters(_characterContentChunkTable._array, 
+-                                _characterContentChunkTable._offset[index], 
++                        _contentHandler.characters(_characterContentChunkTable._array,
++                                _characterContentChunkTable._offset[index],
+                                 _characterContentChunkTable._length[index]);
+                     } catch (SAXException e) {
+                         throw new FastInfosetException("processCII", e);
+@@ -719,10 +717,10 @@
+                 case DecoderStateTables.CII_INDEX_MEDIUM:
+                 {
+                     final int index = (((_b & EncodingConstants.INTEGER_4TH_BIT_MEDIUM_MASK) << 8) | read())
+-                            + EncodingConstants.INTEGER_4TH_BIT_SMALL_LIMIT;
++                    + EncodingConstants.INTEGER_4TH_BIT_SMALL_LIMIT;
+                     try {
+-                        _contentHandler.characters(_characterContentChunkTable._array, 
+-                                _characterContentChunkTable._offset[index], 
++                        _contentHandler.characters(_characterContentChunkTable._array,
++                                _characterContentChunkTable._offset[index],
+                                 _characterContentChunkTable._length[index]);
+                     } catch (SAXException e) {
+                         throw new FastInfosetException("processCII", e);
+@@ -733,12 +731,12 @@
+                 {
+                     final int index = (((_b & EncodingConstants.INTEGER_4TH_BIT_LARGE_MASK) << 16) |
+                             (read() << 8) |
+-                            read()) 
++                            read())
+                             + EncodingConstants.INTEGER_4TH_BIT_MEDIUM_LIMIT;
+-                    
++
+                     try {
+-                        _contentHandler.characters(_characterContentChunkTable._array, 
+-                                _characterContentChunkTable._offset[index], 
++                        _contentHandler.characters(_characterContentChunkTable._array,
++                                _characterContentChunkTable._offset[index],
+                                 _characterContentChunkTable._length[index]);
+                     } catch (SAXException e) {
+                         throw new FastInfosetException("processCII", e);
+@@ -749,12 +747,12 @@
+                 {
+                     final int index = ((read() << 16) |
+                             (read() << 8) |
+-                            read()) 
++                            read())
+                             + EncodingConstants.INTEGER_4TH_BIT_LARGE_LIMIT;
+-                    
++
+                     try {
+-                        _contentHandler.characters(_characterContentChunkTable._array, 
+-                                _characterContentChunkTable._offset[index], 
++                        _contentHandler.characters(_characterContentChunkTable._array,
++                                _characterContentChunkTable._offset[index],
+                                 _characterContentChunkTable._length[index]);
+                     } catch (SAXException e) {
+                         throw new FastInfosetException("processCII", e);
+@@ -770,12 +768,12 @@
+                 case DecoderStateTables.UNEXPANDED_ENTITY_REFERENCE_II:
+                 {
+                     String entity_reference_name = decodeIdentifyingNonEmptyStringOnFirstBit(_v.otherNCName);
+-                    
++
+                     String system_identifier = ((_b & EncodingConstants.UNEXPANDED_ENTITY_SYSTEM_IDENTIFIER_FLAG) > 0)
+                     ? decodeIdentifyingNonEmptyStringOnFirstBit(_v.otherURI) : "";
+                     String public_identifier = ((_b & EncodingConstants.UNEXPANDED_ENTITY_PUBLIC_IDENTIFIER_FLAG) > 0)
+                     ? decodeIdentifyingNonEmptyStringOnFirstBit(_v.otherURI) : "";
+-                    
++
+                     try {
+                         /*
+                          * TODO
+@@ -799,7 +797,7 @@
+                     throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.IllegalStateDecodingEII"));
+             }
+         }
+-                
++
+         try {
+             _contentHandler.endDocument();
+         } catch (SAXException e) {
+@@ -806,7 +804,7 @@
+             throw new FastInfosetException("processDII", e);
+         }
+     }
+-    
++
+     protected final void processDIIOptionalProperties() throws FastInfosetException, IOException {
+         // Optimize for the most common case
+         if (_b == EncodingConstants.DOCUMENT_INITIAL_VOCABULARY_FLAG) {
+@@ -813,7 +811,7 @@
+             decodeInitialVocabulary();
+             return;
+         }
+-        
++
+         if ((_b & EncodingConstants.DOCUMENT_ADDITIONAL_DATA_FLAG) > 0) {
+             decodeAdditionalData();
+             /*
+@@ -821,11 +819,11 @@
+              * how to report the additional data?
+              */
+         }
+-        
++
+         if ((_b & EncodingConstants.DOCUMENT_INITIAL_VOCABULARY_FLAG) > 0) {
+             decodeInitialVocabulary();
+         }
+-        
++
+         if ((_b & EncodingConstants.DOCUMENT_NOTATIONS_FLAG) > 0) {
+             decodeNotations();
+             /*
+@@ -836,7 +834,7 @@
+                 }
+              */
+         }
+-        
++
+         if ((_b & EncodingConstants.DOCUMENT_UNPARSED_ENTITIES_FLAG) > 0) {
+             decodeUnparsedEntities();
+             /*
+@@ -847,7 +845,7 @@
+                 }
+              */
+         }
+-        
++
+         if ((_b & EncodingConstants.DOCUMENT_CHARACTER_ENCODING_SCHEME) > 0) {
+             String characterEncodingScheme = decodeCharacterEncodingScheme();
+             /*
+@@ -855,7 +853,7 @@
+              * how to report the character encoding scheme?
+              */
+         }
+-        
++
+         if ((_b & EncodingConstants.DOCUMENT_STANDALONE_FLAG) > 0) {
+             boolean standalone = (read() > 0) ? true : false ;
+             /*
+@@ -863,7 +861,7 @@
+              * how to report the standalone flag?
+              */
+         }
+-        
++
+         if ((_b & EncodingConstants.DOCUMENT_VERSION_FLAG) > 0) {
+             decodeVersion();
+             /*
+@@ -872,16 +870,16 @@
+              */
+         }
+     }
+-    
++
+     protected final void processEII(QualifiedName name, boolean hasAttributes) throws FastInfosetException, IOException {
+         if (_prefixTable._currentInScope[name.prefixIndex] != name.namespaceNameIndex) {
+             throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.qNameOfEIINotInScope"));
+         }
+-        
++
+         if (hasAttributes) {
+             processAIIs();
+         }
+-    
++
+         try {
+             _contentHandler.startElement(name.namespaceName, name.localName, name.qName, _attributes);
+         } catch (SAXException e) {
+@@ -888,15 +886,15 @@
+             e.printStackTrace();
+             throw new FastInfosetException("processEII", e);
+         }
+-        
++
+         if (_clearAttributes) {
+             _attributes.clear();
+             _clearAttributes = false;
+         }
+-        
++
+         while(!_terminate) {
+             _b = read();
+-            switch(DecoderStateTables.EII[_b]) {
++            switch(DecoderStateTables.EII(_b)) {
+                 case DecoderStateTables.EII_NO_AIIS_INDEX_SMALL:
+                     processEII(_elementNameTable._array[_b], false);
+                     break;
+@@ -912,8 +910,8 @@
+                 case DecoderStateTables.EII_LITERAL:
+                 {
+                     final QualifiedName qn = decodeLiteralQualifiedName(
+-                                _b & EncodingConstants.LITERAL_QNAME_PREFIX_NAMESPACE_NAME_MASK,
+-                                _elementNameTable.getNext());
++                            _b & EncodingConstants.LITERAL_QNAME_PREFIX_NAMESPACE_NAME_MASK,
++                            _elementNameTable.getNext());
+                     _elementNameTable.add(qn);
+                     processEII(qn, (_b & EncodingConstants.ELEMENT_ATTRIBUTE_FLAG) > 0);
+                     break;
+@@ -945,7 +943,7 @@
+                     if ((_b & EncodingConstants.CHARACTER_CHUNK_ADD_TO_TABLE_FLAG) > 0) {
+                         _characterContentChunkTable.add(_charBuffer, _charBufferLength);
+                     }
+-                    
++
+                     try {
+                         _contentHandler.characters(_charBuffer, 0, _charBufferLength);
+                     } catch (SAXException e) {
+@@ -958,7 +956,7 @@
+                     if ((_b & EncodingConstants.CHARACTER_CHUNK_ADD_TO_TABLE_FLAG) > 0) {
+                         _characterContentChunkTable.add(_charBuffer, _charBufferLength);
+                     }
+-                    
++
+                     try {
+                         _contentHandler.characters(_charBuffer, 0, _charBufferLength);
+                     } catch (SAXException e) {
+@@ -975,7 +973,7 @@
+                     if ((_b & EncodingConstants.CHARACTER_CHUNK_ADD_TO_TABLE_FLAG) > 0) {
+                         _characterContentChunkTable.add(_charBuffer, _charBufferLength);
+                     }
+-                    
++
+                     try {
+                         _contentHandler.characters(_charBuffer, 0, _charBufferLength);
+                     } catch (SAXException e) {
+@@ -985,16 +983,16 @@
+                 case DecoderStateTables.CII_RA:
+                 {
+                     final boolean addToTable = (_b & EncodingConstants.CHARACTER_CHUNK_ADD_TO_TABLE_FLAG) > 0;
+-                    
++
+                     // Decode resitricted alphabet integer
+                     _identifier = (_b & 0x02) << 6;
+                     _b = read();
+                     _identifier |= (_b & 0xFC) >> 2;
+-                    
++
+                     decodeOctetsOnSeventhBitOfNonIdentifyingStringOnThirdBit(_b);
+-                    
++
+                     decodeRestrictedAlphabetAsCharBuffer();
+-                    
++
+                     if (addToTable) {
+                         _characterContentChunkTable.add(_charBuffer, _charBufferLength);
+                     }
+@@ -1003,23 +1001,20 @@
+                         _contentHandler.characters(_charBuffer, 0, _charBufferLength);
+                     } catch (SAXException e) {
+                         throw new FastInfosetException("processCII", e);
+-                    }                    
++                    }
+                     break;
+                 }
+                 case DecoderStateTables.CII_EA:
+                 {
+-                    if ((_b & EncodingConstants.NISTRING_ADD_TO_TABLE_FLAG) > 0) {
+-                        throw new EncodingAlgorithmException(CommonResourceBundle.getInstance().getString("message.addToTableNotSupported"));
+-                    }
+-                    
++                    final boolean addToTable = (_b & EncodingConstants.CHARACTER_CHUNK_ADD_TO_TABLE_FLAG) > 0;
+                     // Decode encoding algorithm integer
+                     _identifier = (_b & 0x02) << 6;
+                     _b = read();
+                     _identifier |= (_b & 0xFC) >> 2;
+-                    
++
+                     decodeOctetsOnSeventhBitOfNonIdentifyingStringOnThirdBit(_b);
+-                    
+-                    processCIIEncodingAlgorithm();
++
++                    processCIIEncodingAlgorithm(addToTable);
+                     break;
+                 }
+                 case DecoderStateTables.CII_INDEX_SMALL:
+@@ -1026,8 +1021,8 @@
+                 {
+                     final int index = _b & EncodingConstants.INTEGER_4TH_BIT_SMALL_MASK;
+                     try {
+-                        _contentHandler.characters(_characterContentChunkTable._array, 
+-                                _characterContentChunkTable._offset[index], 
++                        _contentHandler.characters(_characterContentChunkTable._array,
++                                _characterContentChunkTable._offset[index],
+                                 _characterContentChunkTable._length[index]);
+                     } catch (SAXException e) {
+                         throw new FastInfosetException("processCII", e);
+@@ -1037,10 +1032,10 @@
+                 case DecoderStateTables.CII_INDEX_MEDIUM:
+                 {
+                     final int index = (((_b & EncodingConstants.INTEGER_4TH_BIT_MEDIUM_MASK) << 8) | read())
+-                            + EncodingConstants.INTEGER_4TH_BIT_SMALL_LIMIT;
++                    + EncodingConstants.INTEGER_4TH_BIT_SMALL_LIMIT;
+                     try {
+-                        _contentHandler.characters(_characterContentChunkTable._array, 
+-                                _characterContentChunkTable._offset[index], 
++                        _contentHandler.characters(_characterContentChunkTable._array,
++                                _characterContentChunkTable._offset[index],
+                                 _characterContentChunkTable._length[index]);
+                     } catch (SAXException e) {
+                         throw new FastInfosetException("processCII", e);
+@@ -1051,12 +1046,12 @@
+                 {
+                     final int index = (((_b & EncodingConstants.INTEGER_4TH_BIT_LARGE_MASK) << 16) |
+                             (read() << 8) |
+-                            read()) 
++                            read())
+                             + EncodingConstants.INTEGER_4TH_BIT_MEDIUM_LIMIT;
+-                    
++
+                     try {
+-                        _contentHandler.characters(_characterContentChunkTable._array, 
+-                                _characterContentChunkTable._offset[index], 
++                        _contentHandler.characters(_characterContentChunkTable._array,
++                                _characterContentChunkTable._offset[index],
+                                 _characterContentChunkTable._length[index]);
+                     } catch (SAXException e) {
+                         throw new FastInfosetException("processCII", e);
+@@ -1067,12 +1062,12 @@
+                 {
+                     final int index = ((read() << 16) |
+                             (read() << 8) |
+-                            read()) 
++                            read())
+                             + EncodingConstants.INTEGER_4TH_BIT_LARGE_LIMIT;
+-                    
++
+                     try {
+-                        _contentHandler.characters(_characterContentChunkTable._array, 
+-                                _characterContentChunkTable._offset[index], 
++                        _contentHandler.characters(_characterContentChunkTable._array,
++                                _characterContentChunkTable._offset[index],
+                                 _characterContentChunkTable._length[index]);
+                     } catch (SAXException e) {
+                         throw new FastInfosetException("processCII", e);
+@@ -1088,12 +1083,12 @@
+                 case DecoderStateTables.UNEXPANDED_ENTITY_REFERENCE_II:
+                 {
+                     String entity_reference_name = decodeIdentifyingNonEmptyStringOnFirstBit(_v.otherNCName);
+-                    
++
+                     String system_identifier = ((_b & EncodingConstants.UNEXPANDED_ENTITY_SYSTEM_IDENTIFIER_FLAG) > 0)
+                     ? decodeIdentifyingNonEmptyStringOnFirstBit(_v.otherURI) : "";
+                     String public_identifier = ((_b & EncodingConstants.UNEXPANDED_ENTITY_PUBLIC_IDENTIFIER_FLAG) > 0)
+                     ? decodeIdentifyingNonEmptyStringOnFirstBit(_v.otherURI) : "";
+-                    
++
+                     try {
+                         /*
+                          * TODO
+@@ -1117,10 +1112,10 @@
+                     throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.IllegalStateDecodingEII"));
+             }
+         }
+-        
++
+         _terminate = _doubleTerminate;
+         _doubleTerminate = false;
+-        
++
+         try {
+             _contentHandler.endElement(name.namespaceName, name.localName, name.qName);
+         } catch (SAXException e) {
+@@ -1127,7 +1122,7 @@
+             throw new FastInfosetException("processEII", e);
+         }
+     }
+-    
++
+     private final void processUtf8CharacterString() throws FastInfosetException, IOException {
+         if ((_b & EncodingConstants.CHARACTER_CHUNK_ADD_TO_TABLE_FLAG) > 0) {
+             _characterContentChunkTable.ensureSize(_octetBufferLength);
+@@ -1148,16 +1143,16 @@
+             }
+         }
+     }
+-    
++
+     protected final void processEIIWithNamespaces() throws FastInfosetException, IOException {
+         final boolean hasAttributes = (_b & EncodingConstants.ELEMENT_ATTRIBUTE_FLAG) > 0;
+-        
++
+         _clearAttributes = (_namespacePrefixesFeature) ? true : false;
+-        
++
+         if (++_prefixTable._declarationId == Integer.MAX_VALUE) {
+             _prefixTable.clearDeclarationIds();
+         }
+-        
++
+         String prefix = "", namespaceName = "";
+         final int start = _namespacePrefixesIndex;
+         int b = read();
+@@ -1167,7 +1162,7 @@
+                 System.arraycopy(_namespacePrefixes, 0, namespaceAIIs, 0, _namespacePrefixesIndex);
+                 _namespacePrefixes = namespaceAIIs;
+             }
+-            
++
+             switch (b & EncodingConstants.NAMESPACE_ATTRIBUTE_PREFIX_NAME_MASK) {
+                 // no prefix, no namespace
+                 // Undeclaration of default namespace
+@@ -1175,35 +1170,35 @@
+                     prefix = namespaceName = "";
+                     _namespaceNameIndex = _prefixIndex = _namespacePrefixes[_namespacePrefixesIndex++] = -1;
+                     break;
+-                // no prefix, namespace
+-                // Declaration of default namespace
++                    // no prefix, namespace
++                    // Declaration of default namespace
+                 case 1:
+                     prefix = "";
+                     namespaceName = decodeIdentifyingNonEmptyStringOnFirstBitAsNamespaceName(false);
+-                           
++
+                     _prefixIndex = _namespacePrefixes[_namespacePrefixesIndex++] = -1;
+                     break;
+-                // prefix, no namespace
+-                // Undeclaration of namespace
++                    // prefix, no namespace
++                    // Undeclaration of namespace
+                 case 2:
+                     prefix = decodeIdentifyingNonEmptyStringOnFirstBitAsPrefix(false);
+                     namespaceName = "";
+-                    
++
+                     _namespaceNameIndex = -1;
+                     _namespacePrefixes[_namespacePrefixesIndex++] = _prefixIndex;
+                     break;
+-                // prefix, namespace
+-                // Declaration of prefixed namespace 
++                    // prefix, namespace
++                    // Declaration of prefixed namespace
+                 case 3:
+                     prefix = decodeIdentifyingNonEmptyStringOnFirstBitAsPrefix(true);
+                     namespaceName = decodeIdentifyingNonEmptyStringOnFirstBitAsNamespaceName(true);
+-                    
++
+                     _namespacePrefixes[_namespacePrefixesIndex++] = _prefixIndex;
+                     break;
+             }
+-    
++
+             _prefixTable.pushScope(_prefixIndex, _namespaceNameIndex);
+-            
++
+             if (_namespacePrefixesFeature) {
+                 // Add the namespace delcaration as an attribute
+                 if (prefix != "") {
+@@ -1230,9 +1225,9 @@
+             throw new IOException(CommonResourceBundle.getInstance().getString("message.EIInamespaceNameNotTerminatedCorrectly"));
+         }
+         final int end = _namespacePrefixesIndex;
+-                
++
+         _b = read();
+-        switch(DecoderStateTables.EII[_b]) {
++        switch(DecoderStateTables.EII(_b)) {
+             case DecoderStateTables.EII_NO_AIIS_INDEX_SMALL:
+                 processEII(_elementNameTable._array[_b], hasAttributes);
+                 break;
+@@ -1245,8 +1240,8 @@
+             case DecoderStateTables.EII_LITERAL:
+             {
+                 final QualifiedName qn = decodeLiteralQualifiedName(
+-                            _b & EncodingConstants.LITERAL_QNAME_PREFIX_NAMESPACE_NAME_MASK,
+-                            _elementNameTable.getNext());
++                        _b & EncodingConstants.LITERAL_QNAME_PREFIX_NAMESPACE_NAME_MASK,
++                        _elementNameTable.getNext());
+                 _elementNameTable.add(qn);
+                 processEII(qn, hasAttributes);
+                 break;
+@@ -1254,13 +1249,13 @@
+             default:
+                 throw new IOException(CommonResourceBundle.getInstance().getString("message.IllegalStateDecodingEIIAfterAIIs"));
+         }
+-        
++
+         try {
+             for (int i = end - 1; i >= start; i--) {
+                 final int prefixIndex = _namespacePrefixes[i];
+                 _prefixTable.popScope(prefixIndex);
+                 prefix = (prefixIndex > 0) ? _prefixTable.get(prefixIndex - 1) :
+-                        (prefixIndex == -1) ? "" : EncodingConstants.XML_NAMESPACE_PREFIX;
++                    (prefixIndex == -1) ? "" : EncodingConstants.XML_NAMESPACE_PREFIX;
+                 _contentHandler.endPrefixMapping(prefix);
+             }
+             _namespacePrefixesIndex = start;
+@@ -1268,22 +1263,22 @@
+             throw new IOException("processStartNamespaceAII");
+         }
+     }
+-    
++
+     protected final void processAIIs() throws FastInfosetException, IOException {
+         QualifiedName name;
+         int b;
+         String value;
+-        
++
+         _clearAttributes = true;
+-        
++
+         if (++_duplicateAttributeVerifier._currentIteration == Integer.MAX_VALUE) {
+             _duplicateAttributeVerifier.clear();
+         }
+-        
++
+         do {
+             // AII qualified name
+             b = read();
+-            switch (DecoderStateTables.AII[b]) {
++            switch (DecoderStateTables.AII(b)) {
+                 case DecoderStateTables.AII_INDEX_SMALL:
+                     name = _attributeNameTable._array[b];
+                     break;
+@@ -1290,7 +1285,7 @@
+                 case DecoderStateTables.AII_INDEX_MEDIUM:
+                 {
+                     final int i = (((b & EncodingConstants.INTEGER_2ND_BIT_MEDIUM_MASK) << 8) | read())
+-                            + EncodingConstants.INTEGER_2ND_BIT_SMALL_LIMIT;
++                    + EncodingConstants.INTEGER_2ND_BIT_SMALL_LIMIT;
+                     name = _attributeNameTable._array[i];
+                     break;
+                 }
+@@ -1297,7 +1292,7 @@
+                 case DecoderStateTables.AII_INDEX_LARGE:
+                 {
+                     final int i = (((b & EncodingConstants.INTEGER_2ND_BIT_LARGE_MASK) << 16) | (read() << 8) | read())
+-                            + EncodingConstants.INTEGER_2ND_BIT_MEDIUM_LIMIT;
++                    + EncodingConstants.INTEGER_2ND_BIT_MEDIUM_LIMIT;
+                     name = _attributeNameTable._array[i];
+                     break;
+                 }
+@@ -1323,11 +1318,11 @@
+             }
+ 
+             _duplicateAttributeVerifier.checkForDuplicateAttribute(name.attributeHash, name.attributeId);
+-            
++
+             // [normalized value] of AII
+-            
++
+             b = read();
+-            switch(DecoderStateTables.NISTRING[b]) {
++            switch(DecoderStateTables.NISTRING(b)) {
+                 case DecoderStateTables.NISTRING_UTF8_SMALL_LENGTH:
+                     _octetBufferLength = (b & EncodingConstants.OCTET_STRING_LENGTH_5TH_BIT_SMALL_MASK) + 1;
+                     value = decodeUtf8StringAsString();
+@@ -1334,7 +1329,7 @@
+                     if ((b & EncodingConstants.NISTRING_ADD_TO_TABLE_FLAG) > 0) {
+                         _attributeValueTable.add(value);
+                     }
+-                    
++
+                     _attributes.addAttribute(name, value);
+                     break;
+                 case DecoderStateTables.NISTRING_UTF8_MEDIUM_LENGTH:
+@@ -1343,7 +1338,7 @@
+                     if ((b & EncodingConstants.NISTRING_ADD_TO_TABLE_FLAG) > 0) {
+                         _attributeValueTable.add(value);
+                     }
+-                    
++
+                     _attributes.addAttribute(name, value);
+                     break;
+                 case DecoderStateTables.NISTRING_UTF8_LARGE_LENGTH:
+@@ -1350,13 +1345,13 @@
+                     _octetBufferLength = ((read() << 24) |
+                             (read() << 16) |
+                             (read() << 8) |
+-                            read()) 
++                            read())
+                             + EncodingConstants.OCTET_STRING_LENGTH_5TH_BIT_MEDIUM_LIMIT;
+                     value = decodeUtf8StringAsString();
+                     if ((b & EncodingConstants.NISTRING_ADD_TO_TABLE_FLAG) > 0) {
+                         _attributeValueTable.add(value);
+                     }
+-                    
++
+                     _attributes.addAttribute(name, value);
+                     break;
+                 case DecoderStateTables.NISTRING_UTF16_SMALL_LENGTH:
+@@ -1365,7 +1360,7 @@
+                     if ((b & EncodingConstants.NISTRING_ADD_TO_TABLE_FLAG) > 0) {
+                         _attributeValueTable.add(value);
+                     }
+-                    
++
+                     _attributes.addAttribute(name, value);
+                     break;
+                 case DecoderStateTables.NISTRING_UTF16_MEDIUM_LENGTH:
+@@ -1374,7 +1369,7 @@
+                     if ((b & EncodingConstants.NISTRING_ADD_TO_TABLE_FLAG) > 0) {
+                         _attributeValueTable.add(value);
+                     }
+-                    
++
+                     _attributes.addAttribute(name, value);
+                     break;
+                 case DecoderStateTables.NISTRING_UTF16_LARGE_LENGTH:
+@@ -1387,7 +1382,7 @@
+                     if ((b & EncodingConstants.NISTRING_ADD_TO_TABLE_FLAG) > 0) {
+                         _attributeValueTable.add(value);
+                     }
+-                    
++
+                     _attributes.addAttribute(name, value);
+                     break;
+                 case DecoderStateTables.NISTRING_RA:
+@@ -1397,34 +1392,32 @@
+                     _identifier = (b & 0x0F) << 4;
+                     b = read();
+                     _identifier |= (b & 0xF0) >> 4;
+-                    
++
+                     decodeOctetsOnFifthBitOfNonIdentifyingStringOnFirstBit(b);
+-                    
++
+                     value = decodeRestrictedAlphabetAsString();
+                     if (addToTable) {
+                         _attributeValueTable.add(value);
+                     }
+-                    
++
+                     _attributes.addAttribute(name, value);
+                     break;
+                 }
+                 case DecoderStateTables.NISTRING_EA:
+                 {
+-                    if ((b & EncodingConstants.NISTRING_ADD_TO_TABLE_FLAG) > 0) {
+-                        throw new EncodingAlgorithmException(CommonResourceBundle.getInstance().getString("message.addToTableNotSupported"));
+-                    }
+-                    
++                    final boolean addToTable = (b & EncodingConstants.NISTRING_ADD_TO_TABLE_FLAG) > 0;
++
+                     _identifier = (b & 0x0F) << 4;
+                     b = read();
+                     _identifier |= (b & 0xF0) >> 4;
+-                    
++
+                     decodeOctetsOnFifthBitOfNonIdentifyingStringOnFirstBit(b);
+-                    
+-                    processAIIEncodingAlgorithm(name);
++
++                    processAIIEncodingAlgorithm(name, addToTable);
+                     break;
+                 }
+                 case DecoderStateTables.NISTRING_INDEX_SMALL:
+-                    _attributes.addAttribute(name, 
++                    _attributes.addAttribute(name,
+                             _attributeValueTable._array[b & EncodingConstants.INTEGER_2ND_BIT_SMALL_MASK]);
+                     break;
+                 case DecoderStateTables.NISTRING_INDEX_MEDIUM:
+@@ -1431,8 +1424,8 @@
+                 {
+                     final int index = (((b & EncodingConstants.INTEGER_2ND_BIT_MEDIUM_MASK) << 8) | read())
+                     + EncodingConstants.INTEGER_2ND_BIT_SMALL_LIMIT;
+-                    
+-                    _attributes.addAttribute(name, 
++
++                    _attributes.addAttribute(name,
+                             _attributeValueTable._array[index]);
+                     break;
+                 }
+@@ -1440,8 +1433,8 @@
+                 {
+                     final int index = (((b & EncodingConstants.INTEGER_2ND_BIT_LARGE_MASK) << 16) | (read() << 8) | read())
+                     + EncodingConstants.INTEGER_2ND_BIT_MEDIUM_LIMIT;
+-                    
+-                    _attributes.addAttribute(name, 
++
++                    _attributes.addAttribute(name,
+                             _attributeValueTable._array[index]);
+                     break;
+                 }
+@@ -1451,16 +1444,16 @@
+                 default:
+                     throw new IOException(CommonResourceBundle.getInstance().getString("message.decodingAIIValue"));
+             }
+-            
++
+         } while (!_terminate);
+ 
+         // Reset duplication attribute verfifier
+         _duplicateAttributeVerifier._poolCurrent = _duplicateAttributeVerifier._poolHead;
+-        
++
+         _terminate = _doubleTerminate;
+         _doubleTerminate = false;
+     }
+-    
++
+     protected final void processCommentII() throws FastInfosetException, IOException {
+         switch(decodeNonIdentifyingStringOnFirstBit()) {
+             case NISTRING_STRING:
+@@ -1467,7 +1460,7 @@
+                 if (_addToTable) {
+                     _v.otherString.add(new CharArray(_charBuffer, 0, _charBufferLength, true));
+                 }
+-                
++
+                 try {
+                     _lexicalHandler.comment(_charBuffer, 0, _charBufferLength);
+                 } catch (SAXException e) {
+@@ -1478,7 +1471,7 @@
+                 throw new IOException(CommonResourceBundle.getInstance().getString("message.commentIIAlgorithmNotSupported"));
+             case NISTRING_INDEX:
+                 final CharArray ca = _v.otherString.get(_integer);
+-                
++
+                 try {
+                     _lexicalHandler.comment(ca.ch, ca.start, ca.length);
+                 } catch (SAXException e) {
+@@ -1494,10 +1487,10 @@
+                 break;
+         }
+     }
+-    
++
+     protected final void processProcessingII() throws FastInfosetException, IOException {
+         final String target = decodeIdentifyingNonEmptyStringOnFirstBit(_v.otherNCName);
+-        
++
+         switch(decodeNonIdentifyingStringOnFirstBit()) {
+             case NISTRING_STRING:
+                 final String data = new String(_charBuffer, 0, _charBufferLength);
+@@ -1528,14 +1521,14 @@
+                 break;
+         }
+     }
+-        
+-    protected final void processCIIEncodingAlgorithm() throws FastInfosetException, IOException {
++
++    protected final void processCIIEncodingAlgorithm(boolean addToTable) throws FastInfosetException, IOException {
+         if (_identifier < EncodingConstants.ENCODING_ALGORITHM_BUILTIN_END) {
+             if (_primitiveHandler != null) {
+                 processCIIBuiltInEncodingAlgorithmAsPrimitive();
+             } else if (_algorithmHandler != null) {
+                 Object array = processBuiltInEncodingAlgorithmAsObject();
+-                
++
+                 try {
+                     _algorithmHandler.object(null, _identifier, array);
+                 } catch (SAXException e) {
+@@ -1544,7 +1537,7 @@
+             } else {
+                 StringBuffer buffer = new StringBuffer();
+                 processBuiltInEncodingAlgorithmAsCharacters(buffer);
+-                
++
+                 try {
+                     _contentHandler.characters(buffer.toString().toCharArray(), 0, buffer.length());
+                 } catch (SAXException e) {
+@@ -1551,18 +1544,28 @@
+                     throw new FastInfosetException(e);
+                 }
+             }
++
++            if (addToTable) {
++                StringBuffer buffer = new StringBuffer();
++                processBuiltInEncodingAlgorithmAsCharacters(buffer);
++                _characterContentChunkTable.add(buffer.toString().toCharArray(), buffer.length());
++            }
+         } else if (_identifier == EncodingAlgorithmIndexes.CDATA) {
+-                // Set back buffer position to start of encoded string
+-                _octetBufferOffset -= _octetBufferLength;
+-                decodeUtf8StringIntoCharBuffer();
+-                
+-                try {
+-                    _lexicalHandler.startCDATA();
+-                    _contentHandler.characters(_charBuffer, 0, _charBufferLength);
+-                    _lexicalHandler.endCDATA();
+-                } catch (SAXException e) {
+-                    throw new FastInfosetException(e);
+-                }
++            // Set back buffer position to start of encoded string
++            _octetBufferOffset -= _octetBufferLength;
++            decodeUtf8StringIntoCharBuffer();
++
++            try {
++                _lexicalHandler.startCDATA();
++                _contentHandler.characters(_charBuffer, 0, _charBufferLength);
++                _lexicalHandler.endCDATA();
++            } catch (SAXException e) {
++                throw new FastInfosetException(e);
++            }
++
++            if (addToTable) {
++                _characterContentChunkTable.add(_charBuffer, _charBufferLength);
++            }
+         } else if (_identifier >= EncodingConstants.ENCODING_ALGORITHM_APPLICATION_START && _algorithmHandler != null) {
+             final String URI = _v.encodingAlgorithm.get(_identifier - EncodingConstants.ENCODING_ALGORITHM_APPLICATION_START);
+             if (URI == null) {
+@@ -1569,7 +1572,7 @@
+                 throw new EncodingAlgorithmException(CommonResourceBundle.getInstance().
+                         getString("message.URINotPresent", new Object[]{Integer.valueOf(_identifier)}));
+             }
+-            
++
+             final EncodingAlgorithm ea = (EncodingAlgorithm)_registeredEncodingAlgorithms.get(URI);
+             if (ea != null) {
+                 final Object data = ea.decodeFromBytes(_octetBuffer, _octetBufferStart, _octetBufferLength);
+@@ -1585,6 +1588,9 @@
+                     throw new FastInfosetException(e);
+                 }
+             }
++            if (addToTable) {
++                throw new EncodingAlgorithmException(CommonResourceBundle.getInstance().getString("message.addToTableNotSupported"));
++            }
+         } else if (_identifier >= EncodingConstants.ENCODING_ALGORITHM_APPLICATION_START) {
+             // TODO should have property to ignore
+             throw new EncodingAlgorithmException(
+@@ -1596,7 +1602,7 @@
+             throw new EncodingAlgorithmException(CommonResourceBundle.getInstance().getString("message.identifiers10to31Reserved"));
+         }
+     }
+-    
++
+     protected final void processCIIBuiltInEncodingAlgorithmAsPrimitive() throws FastInfosetException, IOException {
+         try {
+             int length;
+@@ -1614,7 +1620,7 @@
+                                 array, 0, builtInAlgorithmState.shortArray.length);
+                         builtInAlgorithmState.shortArray = array;
+                     }
+-                    
++
+                     BuiltInEncodingAlgorithmFactory.shortEncodingAlgorithm.
+                             decodeFromBytesToShortArray(builtInAlgorithmState.shortArray, 0,
+                             _octetBuffer, _octetBufferStart, _octetBufferLength);
+@@ -1629,7 +1635,7 @@
+                                 array, 0, builtInAlgorithmState.intArray.length);
+                         builtInAlgorithmState.intArray = array;
+                     }
+-                    
++
+                     BuiltInEncodingAlgorithmFactory.intEncodingAlgorithm.
+                             decodeFromBytesToIntArray(builtInAlgorithmState.intArray, 0,
+                             _octetBuffer, _octetBufferStart, _octetBufferLength);
+@@ -1644,7 +1650,7 @@
+                                 array, 0, builtInAlgorithmState.longArray.length);
+                         builtInAlgorithmState.longArray = array;
+                     }
+-                    
++
+                     BuiltInEncodingAlgorithmFactory.longEncodingAlgorithm.
+                             decodeFromBytesToLongArray(builtInAlgorithmState.longArray, 0,
+                             _octetBuffer, _octetBufferStart, _octetBufferLength);
+@@ -1659,7 +1665,7 @@
+                                 array, 0, builtInAlgorithmState.booleanArray.length);
+                         builtInAlgorithmState.booleanArray = array;
+                     }
+-                    
++
+                     BuiltInEncodingAlgorithmFactory.booleanEncodingAlgorithm.
+                             decodeFromBytesToBooleanArray(
+                             builtInAlgorithmState.booleanArray, 0, length,
+@@ -1675,7 +1681,7 @@
+                                 array, 0, builtInAlgorithmState.floatArray.length);
+                         builtInAlgorithmState.floatArray = array;
+                     }
+-                    
++
+                     BuiltInEncodingAlgorithmFactory.floatEncodingAlgorithm.
+                             decodeFromBytesToFloatArray(builtInAlgorithmState.floatArray, 0,
+                             _octetBuffer, _octetBufferStart, _octetBufferLength);
+@@ -1690,7 +1696,7 @@
+                                 array, 0, builtInAlgorithmState.doubleArray.length);
+                         builtInAlgorithmState.doubleArray = array;
+                     }
+-                    
++
+                     BuiltInEncodingAlgorithmFactory.doubleEncodingAlgorithm.
+                             decodeFromBytesToDoubleArray(builtInAlgorithmState.doubleArray, 0,
+                             _octetBuffer, _octetBufferStart, _octetBufferLength);
+@@ -1705,7 +1711,7 @@
+                                 array, 0, builtInAlgorithmState.longArray.length);
+                         builtInAlgorithmState.longArray = array;
+                     }
+-                    
++
+                     BuiltInEncodingAlgorithmFactory.uuidEncodingAlgorithm.
+                             decodeFromBytesToLongArray(builtInAlgorithmState.longArray, 0,
+                             _octetBuffer, _octetBufferStart, _octetBufferLength);
+@@ -1721,9 +1727,9 @@
+             throw new FastInfosetException(e);
+         }
+     }
+-    
+-    
+-    protected final void processAIIEncodingAlgorithm(QualifiedName name) throws FastInfosetException, IOException {
++
++
++    protected final void processAIIEncodingAlgorithm(QualifiedName name, boolean addToTable) throws FastInfosetException, IOException {
+         if (_identifier < EncodingConstants.ENCODING_ALGORITHM_BUILTIN_END) {
+             if (_primitiveHandler != null || _algorithmHandler != null) {
+                 Object data = processBuiltInEncodingAlgorithmAsObject();
+@@ -1739,7 +1745,7 @@
+                 throw new EncodingAlgorithmException(CommonResourceBundle.getInstance().
+                         getString("message.URINotPresent", new Object[]{Integer.valueOf(_identifier)}));
+             }
+-            
++
+             final EncodingAlgorithm ea = (EncodingAlgorithm)_registeredEncodingAlgorithms.get(URI);
+             if (ea != null) {
+                 final Object data = ea.decodeFromBytes(_octetBuffer, _octetBufferStart, _octetBufferLength);
+@@ -1761,18 +1767,22 @@
+             // reported, allows for support through handler if required.
+             throw new EncodingAlgorithmException(CommonResourceBundle.getInstance().getString("message.identifiers10to31Reserved"));
+         }
++
++        if (addToTable) {
++            _attributeValueTable.add(_attributes.getValue(_attributes.getIndex(name.qName)));
++        }
+     }
+-    
++
+     protected final void processBuiltInEncodingAlgorithmAsCharacters(StringBuffer buffer) throws FastInfosetException, IOException {
+         // TODO not very efficient, need to reuse buffers
+-        Object array = BuiltInEncodingAlgorithmFactory.table[_identifier].
++        Object array = BuiltInEncodingAlgorithmFactory.getAlgorithm(_identifier).
+                 decodeFromBytes(_octetBuffer, _octetBufferStart, _octetBufferLength);
+-        
+-        BuiltInEncodingAlgorithmFactory.table[_identifier].convertToCharacters(array,  buffer);
++
++        BuiltInEncodingAlgorithmFactory.getAlgorithm(_identifier).convertToCharacters(array,  buffer);
+     }
+-    
++
+     protected final Object processBuiltInEncodingAlgorithmAsObject() throws FastInfosetException, IOException {
+-        return BuiltInEncodingAlgorithmFactory.table[_identifier].
++        return BuiltInEncodingAlgorithmFactory.getAlgorithm(_identifier).
+                 decodeFromBytes(_octetBuffer, _octetBufferStart, _octetBufferLength);
+-    }    
++    }
+ }
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/sax/SAXDocumentSerializer.java	Thu Jul 30 18:01:41 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/sax/SAXDocumentSerializer.java	Thu Jul 30 18:01:40 2009
+@@ -44,17 +44,17 @@
+ /**
+  * The Fast Infoset SAX serializer.
+  * <p>
+- * Instantiate this serializer to serialize a fast infoset document in accordance 
++ * Instantiate this serializer to serialize a fast infoset document in accordance
+  * with the SAX API.
+  * <p>
+  * This utilizes the SAX API in a reverse manner to that of parsing. It is the
+- * responsibility of the client to call the appropriate event methods on the 
+- * SAX handlers, and to ensure that such a sequence of methods calls results 
+- * in the production well-formed fast infoset documents. The 
++ * responsibility of the client to call the appropriate event methods on the
++ * SAX handlers, and to ensure that such a sequence of methods calls results
++ * in the production well-formed fast infoset documents. The
+  * SAXDocumentSerializer performs no well-formed checks.
+- * 
++ *
+  * <p>
+- * More than one fast infoset document may be encoded to the 
++ * More than one fast infoset document may be encoded to the
+  * {@link java.io.OutputStream}.
+  */
+ public class SAXDocumentSerializer extends Encoder implements FastInfosetWriter {
+@@ -61,11 +61,11 @@
+     protected boolean _elementHasNamespaces = false;
+ 
+     protected boolean _charactersAsCDATA = false;
+-    
++
+     protected SAXDocumentSerializer(boolean v) {
+         super(v);
+     }
+-    
++
+     public SAXDocumentSerializer() {
+     }
+ 
+@@ -72,11 +72,11 @@
+ 
+     public void reset() {
+         super.reset();
+-        
++
+         _elementHasNamespaces = false;
+         _charactersAsCDATA = false;
+     }
+-    
++
+     // ContentHandler
+ 
+     public final void startDocument() throws SAXException {
+@@ -118,7 +118,7 @@
+ 
+     public final void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException {
+         // TODO consider using buffer for encoding of attributes, then pre-counting is not necessary
+-        final int attributeCount = (atts != null && atts.getLength() > 0) 
++        final int attributeCount = (atts != null && atts.getLength() > 0)
+                 ? countAttributes(atts) : 0;
+         try {
+             if (_elementHasNamespaces) {
+@@ -166,8 +166,8 @@
+         if (length <= 0) {
+             return;
+         }
+-        
+-        if (getIgnoreWhiteSpaceTextContent() && 
++
++        if (getIgnoreWhiteSpaceTextContent() &&
+                 isWhiteSpace(ch, start, length)) return;
+ 
+         try {
+@@ -187,7 +187,7 @@
+ 
+     public final void ignorableWhitespace(char[] ch, int start, int length) throws SAXException {
+         if (getIgnoreWhiteSpaceTextContent()) return;
+-        
++
+         characters(ch, start, length);
+     }
+ 
+@@ -194,7 +194,7 @@
+     public final void processingInstruction(String target, String data) throws SAXException {
+         try {
+             if (getIgnoreProcesingInstructions()) return;
+-            
++
+             if (target.length() == 0) {
+                 throw new SAXException(CommonResourceBundle.getInstance().
+                         getString("message.processingInstructionTargetIsEmpty"));
+@@ -220,7 +220,7 @@
+     public final void comment(char[] ch, int start, int length) throws SAXException {
+         try {
+             if (getIgnoreComments()) return;
+-            
++
+             encodeTermination();
+ 
+             encodeComment(ch, start, length);
+@@ -239,10 +239,10 @@
+ 
+     public final void startDTD(String name, String publicId, String systemId) throws SAXException {
+         if (getIgnoreDTD()) return;
+-        
++
+         try {
+             encodeTermination();
+-            
++
+             encodeDocumentTypeDeclaration(publicId, systemId);
+             encodeElementTermination();
+         } catch (IOException e) {
+@@ -259,9 +259,9 @@
+     public final void endEntity(String name) throws SAXException {
+     }
+ 
+-    
++
+     // EncodingAlgorithmContentHandler
+-    
++
+     public final void octets(String URI, int id, byte[] b, int start, int length)  throws SAXException {
+         if (length <= 0) {
+             return;
+@@ -370,7 +370,7 @@
+             throw new SAXException(e);
+         }
+     }
+-    
++
+     public final void floats(float[] f, int start, int length) throws SAXException {
+         if (length <= 0) {
+             return;
+@@ -421,7 +421,7 @@
+ 
+ 
+     // RestrictedAlphabetContentHandler
+-    
++
+     public void numericCharacters(char ch[], int start, int length) throws SAXException {
+         if (length <= 0) {
+             return;
+@@ -430,9 +430,8 @@
+         try {
+             encodeTermination();
+ 
+-            final boolean addToTable = isCharacterContentChunkLengthMatchesLimit(length, _v.characterContentChunk);
+-            encodeFourBitCharacters(RestrictedAlphabet.NUMERIC_CHARACTERS_INDEX, NUMERIC_CHARACTERS_TABLE,
+-                    ch, start, length, addToTable);
++            final boolean addToTable = isCharacterContentChunkLengthMatchesLimit(length);
++            encodeNumericFourBitCharacters(ch, start, length, addToTable);
+         } catch (IOException e) {
+             throw new SAXException(e);
+         } catch (FastInfosetException e) {
+@@ -439,7 +438,7 @@
+             throw new SAXException(e);
+         }
+     }
+-    
++
+     public void dateTimeCharacters(char ch[], int start, int length) throws SAXException {
+         if (length <= 0) {
+             return;
+@@ -448,9 +447,8 @@
+         try {
+             encodeTermination();
+ 
+-            final boolean addToTable = isCharacterContentChunkLengthMatchesLimit(length, _v.characterContentChunk);
+-            encodeFourBitCharacters(RestrictedAlphabet.DATE_TIME_CHARACTERS_INDEX, DATE_TIME_CHARACTERS_TABLE,
+-                    ch, start, length, addToTable);
++            final boolean addToTable = isCharacterContentChunkLengthMatchesLimit(length);
++            encodeDateTimeFourBitCharacters(ch, start, length, addToTable);
+         } catch (IOException e) {
+             throw new SAXException(e);
+         } catch (FastInfosetException e) {
+@@ -457,7 +455,7 @@
+             throw new SAXException(e);
+         }
+     }
+-    
++
+     public void alphabetCharacters(String alphabet, char ch[], int start, int length) throws SAXException {
+         if (length <= 0) {
+             return;
+@@ -466,7 +464,7 @@
+         try {
+             encodeTermination();
+ 
+-            final boolean addToTable = isCharacterContentChunkLengthMatchesLimit(length, _v.characterContentChunk);
++            final boolean addToTable = isCharacterContentChunkLengthMatchesLimit(length);
+             encodeAlphabetCharacters(alphabet, ch, start, length, addToTable);
+         } catch (IOException e) {
+             throw new SAXException(e);
+@@ -476,13 +474,13 @@
+     }
+ 
+     // ExtendedContentHandler
+-    
++
+     public void characters(char[] ch, int start, int length, boolean index) throws SAXException {
+         if (length <= 0) {
+             return;
+         }
+-        
+-        if (getIgnoreWhiteSpaceTextContent() && 
++
++        if (getIgnoreWhiteSpaceTextContent() &&
+                 isWhiteSpace(ch, start, length)) return;
+ 
+         try {
+@@ -497,11 +495,11 @@
+             throw new SAXException(e);
+         } catch (FastInfosetException e) {
+             throw new SAXException(e);
+-        }        
++        }
+     }
+ 
+-    
+ 
++
+     protected final int countAttributes(Attributes atts) {
+         // Count attributes ignoring any in the XMLNS namespace
+         // Note, such attributes may be produced when transforming from a DOM node
+@@ -518,6 +516,7 @@
+ 
+     protected void encodeAttributes(Attributes atts) throws IOException, FastInfosetException {
+         boolean addToTable;
++        boolean mustBeAddedToTable;
+         String value;
+         if (atts instanceof EncodingAlgorithmAttributes) {
+             final EncodingAlgorithmAttributes eAtts = (EncodingAlgorithmAttributes)atts;
+@@ -529,24 +528,21 @@
+                     // If data is null then there is no algorithm data
+                     if (data == null) {
+                         value = eAtts.getValue(i);
+-                        addToTable = eAtts.getToIndex(i) || isAttributeValueLengthMatchesLimit(value.length());
++                        addToTable = isAttributeValueLengthMatchesLimit(value.length());
++                        mustBeAddedToTable = eAtts.getToIndex(i);
+ 
+                         alphabet = eAtts.getAlpababet(i);
+-                        if (alphabet == null)
+-                            encodeNonIdentifyingStringOnFirstBit(value, _v.attributeValue, addToTable);
+-                        else if (alphabet == RestrictedAlphabet.DATE_TIME_CHARACTERS) 
+-                            encodeNonIdentifyingStringOnFirstBit(
+-                                    RestrictedAlphabet.DATE_TIME_CHARACTERS_INDEX, 
+-                                    DATE_TIME_CHARACTERS_TABLE,
+-                                    value, addToTable);
+-                        else if (alphabet == RestrictedAlphabet.DATE_TIME_CHARACTERS) 
+-                            encodeNonIdentifyingStringOnFirstBit(
+-                                    RestrictedAlphabet.NUMERIC_CHARACTERS_INDEX, 
+-                                    NUMERIC_CHARACTERS_TABLE,
+-                                    value, addToTable);
+-                        else
+-                            encodeNonIdentifyingStringOnFirstBit(value, _v.attributeValue, addToTable);
+-
++                        if (alphabet == null) {
++                            encodeNonIdentifyingStringOnFirstBit(value, _v.attributeValue, addToTable, mustBeAddedToTable);
++                        } else if (alphabet == RestrictedAlphabet.DATE_TIME_CHARACTERS) {
++                            encodeDateTimeNonIdentifyingStringOnFirstBit(
++                                    value, addToTable, mustBeAddedToTable);
++                        } else if (alphabet == RestrictedAlphabet.NUMERIC_CHARACTERS) {
++                            encodeNumericNonIdentifyingStringOnFirstBit(
++                                    value, addToTable, mustBeAddedToTable);
++                        } else {
++                            encodeNonIdentifyingStringOnFirstBit(value, _v.attributeValue, addToTable, mustBeAddedToTable);
++                        }
+                     } else {
+                         encodeNonIdentifyingStringOnFirstBit(eAtts.getAlgorithmURI(i),
+                                 eAtts.getAlgorithmIndex(i), data);
+@@ -558,7 +554,7 @@
+                 if (encodeAttribute(atts.getURI(i), atts.getQName(i), atts.getLocalName(i))) {
+                     value = atts.getValue(i);
+                     addToTable = isAttributeValueLengthMatchesLimit(value.length());
+-                    encodeNonIdentifyingStringOnFirstBit(value, _v.attributeValue, addToTable);
++                    encodeNonIdentifyingStringOnFirstBit(value, _v.attributeValue, addToTable, false);
+                 }
+             }
+         }
+@@ -565,7 +561,7 @@
+         _b = EncodingConstants.TERMINATOR;
+         _terminate = true;
+     }
+-    
++
+     protected void encodeElement(String namespaceURI, String qName, String localName) throws IOException {
+         LocalNameQualifiedNamesMap.Entry entry = _v.elementName.obtainEntry(qName);
+         if (entry._valueIndex > 0) {
+@@ -597,5 +593,5 @@
+ 
+         return encodeLiteralAttributeQualifiedNameOnSecondBit(namespaceURI, getPrefixFromQualifiedName(qName),
+                 localName, entry);
+-    }    
++    }
+ }
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/sax/SAXDocumentSerializerWithPrefixMapping.java	Thu Jul 30 18:01:44 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/sax/SAXDocumentSerializerWithPrefixMapping.java	Thu Jul 30 18:01:44 2009
+@@ -62,23 +62,23 @@
+     protected Map _prefixToPrefixMapping;
+     protected String _lastCheckedNamespace;
+     protected String _lastCheckedPrefix;
+-    
++
+     protected StringIntMap _declaredNamespaces;
+-    
++
+     public SAXDocumentSerializerWithPrefixMapping(Map namespaceToPrefixMapping) {
+         // Use the local name to look up elements/attributes
+         super(true);
+         _namespaceToPrefixMapping = new HashMap(namespaceToPrefixMapping);
+         _prefixToPrefixMapping = new HashMap();
+-        
++
+         // Empty prefix
+         _namespaceToPrefixMapping.put("", "");
+         // 'xml' prefix
+         _namespaceToPrefixMapping.put(EncodingConstants.XML_NAMESPACE_NAME, EncodingConstants.XML_NAMESPACE_PREFIX);
+-        
++
+         _declaredNamespaces = new StringIntMap(4);
+     }
+-    
++
+     public final void startPrefixMapping(String prefix, String uri) throws SAXException {
+         try {
+             if (_elementHasNamespaces == false) {
+@@ -90,7 +90,7 @@
+ 
+                 // Write out Element byte with namespaces
+                 write(EncodingConstants.ELEMENT | EncodingConstants.ELEMENT_NAMESPACES_FLAG);
+-            
++
+                 _declaredNamespaces.clear();
+                 _declaredNamespaces.obtainIndex(uri);
+             } else {
+@@ -99,10 +99,10 @@
+                     if (p != null) {
+                         _prefixToPrefixMapping.put(prefix, p);
+                     }
+-                    return;   
++                    return;
+                 }
+             }
+-            
++
+             final String p = getPrefix(uri);
+             if (p != null) {
+                 encodeNamespaceAttribute(p, uri);
+@@ -111,12 +111,12 @@
+                 putPrefix(uri, prefix);
+                 encodeNamespaceAttribute(prefix, uri);
+             }
+-            
++
+         } catch (IOException e) {
+             throw new SAXException("startElement", e);
+         }
+     }
+-    
++
+     protected final void encodeElement(String namespaceURI, String qName, String localName) throws IOException {
+         LocalNameQualifiedNamesMap.Entry entry = _v.elementName.obtainEntry(localName);
+         if (entry._valueIndex > 0) {
+@@ -131,9 +131,9 @@
+         }
+ 
+         encodeLiteralElementQualifiedNameOnThirdBit(namespaceURI, getPrefix(namespaceURI),
+-                localName, entry);            
++                localName, entry);
+     }
+-    
++
+     protected boolean encodeElementMapEntry(LocalNameQualifiedNamesMap.Entry entry, String namespaceURI) throws IOException {
+         QualifiedName[] names = entry._value;
+         for (int i = 0; i < entry._valueIndex; i++) {
+@@ -144,10 +144,11 @@
+         }
+         return false;
+     }
+-    
+-    
++
++
+     protected final void encodeAttributes(Attributes atts) throws IOException, FastInfosetException {
+         boolean addToTable;
++        boolean mustToBeAddedToTable;
+         String value;
+         if (atts instanceof EncodingAlgorithmAttributes) {
+             final EncodingAlgorithmAttributes eAtts = (EncodingAlgorithmAttributes)atts;
+@@ -160,28 +161,24 @@
+                     // If data is null then there is no algorithm data
+                     if (data == null) {
+                         value = eAtts.getValue(i);
+-                        addToTable = eAtts.getToIndex(i) || isAttributeValueLengthMatchesLimit(value.length());
+-
++                        addToTable = isAttributeValueLengthMatchesLimit(value.length());
++                        mustToBeAddedToTable = eAtts.getToIndex(i);
+                         alphabet = eAtts.getAlpababet(i);
+                         if (alphabet == null) {
+-                            if (uri == "http://www.w3.org/2001/XMLSchema-instance" || 
++                            if (uri == "http://www.w3.org/2001/XMLSchema-instance" ||
+                                     uri.equals("http://www.w3.org/2001/XMLSchema-instance")) {
+                                 value = convertQName(value);
+                             }
+-                            encodeNonIdentifyingStringOnFirstBit(value, _v.attributeValue, addToTable);
+-                        } else if (alphabet == RestrictedAlphabet.DATE_TIME_CHARACTERS) 
+-                            encodeNonIdentifyingStringOnFirstBit(
+-                                    RestrictedAlphabet.DATE_TIME_CHARACTERS_INDEX, 
+-                                    DATE_TIME_CHARACTERS_TABLE,
+-                                    value, addToTable);
+-                        else if (alphabet == RestrictedAlphabet.DATE_TIME_CHARACTERS) 
+-                            encodeNonIdentifyingStringOnFirstBit(
+-                                    RestrictedAlphabet.NUMERIC_CHARACTERS_INDEX, 
+-                                    NUMERIC_CHARACTERS_TABLE,
+-                                    value, addToTable);
+-                        else
+-                            encodeNonIdentifyingStringOnFirstBit(value, _v.attributeValue, addToTable);
+-
++                            encodeNonIdentifyingStringOnFirstBit(value, _v.attributeValue, addToTable, mustToBeAddedToTable);
++                        } else if (alphabet == RestrictedAlphabet.DATE_TIME_CHARACTERS) {
++                            encodeDateTimeNonIdentifyingStringOnFirstBit(
++                                    value, addToTable, mustToBeAddedToTable);
++                        } else if (alphabet == RestrictedAlphabet.NUMERIC_CHARACTERS) {
++                            encodeNumericNonIdentifyingStringOnFirstBit(
++                                    value, addToTable, mustToBeAddedToTable);
++                        } else {
++                            encodeNonIdentifyingStringOnFirstBit(value, _v.attributeValue, addToTable, mustToBeAddedToTable);
++                        }
+                     } else {
+                         encodeNonIdentifyingStringOnFirstBit(eAtts.getAlgorithmURI(i),
+                                 eAtts.getAlgorithmIndex(i), data);
+@@ -194,12 +191,12 @@
+                 if (encodeAttribute(atts.getURI(i), atts.getQName(i), atts.getLocalName(i))) {
+                     value = atts.getValue(i);
+                     addToTable = isAttributeValueLengthMatchesLimit(value.length());
+-                    
+-                    if (uri == "http://www.w3.org/2001/XMLSchema-instance" || 
++
++                    if (uri == "http://www.w3.org/2001/XMLSchema-instance" ||
+                             uri.equals("http://www.w3.org/2001/XMLSchema-instance")) {
+                         value = convertQName(value);
+                     }
+-                    encodeNonIdentifyingStringOnFirstBit(value, _v.attributeValue, addToTable);
++                    encodeNonIdentifyingStringOnFirstBit(value, _v.attributeValue, addToTable, false);
+                 }
+             }
+         }
+@@ -206,7 +203,7 @@
+         _b = EncodingConstants.TERMINATOR;
+         _terminate = true;
+     }
+-    
++
+     private String convertQName(String qName) {
+         int i = qName.indexOf(':');
+         String prefix = "";
+@@ -215,7 +212,7 @@
+             prefix = qName.substring(0, i);
+             localName = qName.substring(i + 1);
+         }
+-        
++
+         String p = (String)_prefixToPrefixMapping.get(prefix);
+         if (p != null) {
+             if (p.length() == 0)
+@@ -226,7 +223,7 @@
+             return qName;
+         }
+     }
+-    
++
+     protected final boolean encodeAttribute(String namespaceURI, String qName, String localName) throws IOException {
+         LocalNameQualifiedNamesMap.Entry entry = _v.attributeName.obtainEntry(localName);
+         if (entry._valueIndex > 0) {
+@@ -241,10 +238,10 @@
+         }
+ 
+         return encodeLiteralAttributeQualifiedNameOnSecondBit(namespaceURI, getPrefix(namespaceURI),
+-                localName, entry);            
++                localName, entry);
+     }
+ 
+-    protected boolean encodeAttributeMapEntry(LocalNameQualifiedNamesMap.Entry entry, String namespaceURI) throws IOException {        
++    protected boolean encodeAttributeMapEntry(LocalNameQualifiedNamesMap.Entry entry, String namespaceURI) throws IOException {
+         QualifiedName[] names = entry._value;
+         for (int i = 0; i < entry._valueIndex; i++) {
+             if ((namespaceURI == names[i].namespaceName || namespaceURI.equals(names[i].namespaceName))) {
+@@ -254,17 +251,17 @@
+         }
+         return false;
+     }
+-            
++
+     protected final String getPrefix(String namespaceURI) {
+         if (_lastCheckedNamespace == namespaceURI) return _lastCheckedPrefix;
+-        
++
+         _lastCheckedNamespace = namespaceURI;
+         return _lastCheckedPrefix = (String)_namespaceToPrefixMapping.get(namespaceURI);
+     }
+-    
++
+     protected final void putPrefix(String namespaceURI, String prefix) {
+         _namespaceToPrefixMapping.put(namespaceURI, prefix);
+-        
++
+         _lastCheckedNamespace = namespaceURI;
+         _lastCheckedPrefix = prefix;
+     }
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/sax/SystemIdResolver.java	Thu Jul 30 18:01:48 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/sax/SystemIdResolver.java	Thu Jul 30 18:01:47 2009
+@@ -24,23 +24,23 @@
+  *
+  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
+  */
+- 
+ 
+ 
++
+ package com.sun.xml.internal.fastinfoset.sax;
+ 
+ import java.io.*;
+ 
+ public class SystemIdResolver {
+-    
++
+     public SystemIdResolver() {
+     }
+-    
++
+     public static String getAbsoluteURIFromRelative(String localPath) {
+         if (localPath == null || localPath.length() == 0) {
+             return "";
+         }
+-        
++
+         String absolutePath = localPath;
+         if (!isAbsolutePath(localPath)) {
+             try {
+@@ -50,7 +50,7 @@
+                 return "file:" + localPath;
+             }
+         }
+-        
++
+         String urlString;
+         if (null != absolutePath) {
+             urlString = absolutePath.startsWith(File.separator) ?
+@@ -60,28 +60,28 @@
+         else {
+             urlString = "file:" + localPath;
+         }
+-        
++
+         return replaceChars(urlString);
+     }
+-    
++
+     private static String getAbsolutePathFromRelativePath(String relativePath) {
+         return new File(relativePath).getAbsolutePath();
+     }
+-    
++
+     public static boolean isAbsoluteURI(String systemId) {
+         if (systemId == null) {
+             return false;
+         }
+-        
++
+         if (isWindowsAbsolutePath(systemId)) {
+             return false;
+         }
+-        
++
+         final int fragmentIndex = systemId.indexOf('#');
+         final int queryIndex = systemId.indexOf('?');
+         final int slashIndex = systemId.indexOf('/');
+         final int colonIndex = systemId.indexOf(':');
+-        
++
+         int index = systemId.length() -1;
+         if (fragmentIndex > 0) {
+             index = fragmentIndex;
+@@ -92,17 +92,17 @@
+         if (slashIndex > 0 && slashIndex <index) {
+             index = slashIndex;
+         }
+-        return (colonIndex > 0) && (colonIndex < index);        
++        return (colonIndex > 0) && (colonIndex < index);
+     }
+-    
++
+     public static boolean isAbsolutePath(String systemId) {
+         if(systemId == null)
+             return false;
+         final File file = new File(systemId);
+         return file.isAbsolute();
+-        
++
+     }
+-    
++
+     private static boolean isWindowsAbsolutePath(String systemId) {
+         if(!isAbsolutePath(systemId))
+             return false;
+@@ -114,7 +114,7 @@
+         else
+             return false;
+     }
+-    
++
+     private static String replaceChars(String str) {
+         StringBuffer buf = new StringBuffer(str);
+         int length = buf.length();
+@@ -132,16 +132,16 @@
+                 buf.setCharAt(i, '/');
+             }
+         }
+-        
++
+         return buf.toString();
+     }
+-    
++
+     public static String getAbsoluteURI(String systemId) {
+         String absoluteURI = systemId;
+         if (isAbsoluteURI(systemId)) {
+             if (systemId.startsWith("file:")) {
+                 String str = systemId.substring(5);
+-                
++
+                 if (str != null && str.startsWith("/")) {
+                     if (str.startsWith("///") || !str.startsWith("//")) {
+                         int secondColonIndex = systemId.indexOf(':', 5);
+@@ -161,7 +161,7 @@
+                 else {
+                     return getAbsoluteURIFromRelative(systemId.substring(5));
+                 }
+-                
++
+                 return replaceChars(absoluteURI);
+             }
+             else  {
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/stax/EventLocation.java	Thu Jul 30 18:01:51 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/EventLocation.java	Thu Jul 30 18:01:51 2009
+@@ -24,8 +24,8 @@
+  *
+  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
+  */
+- 
+ 
++
+ package com.sun.xml.internal.fastinfoset.stax;
+ 
+ import javax.xml.stream.Location;
+@@ -37,10 +37,10 @@
+     int _column = -1;
+     int _line = -1;
+     int _charOffset = -1;
+-    
++
+     EventLocation() {
+     }
+-    
++
+     //explicitly create a nil location
+     public static Location getNilLocation() {
+         return new EventLocation();
+@@ -61,12 +61,12 @@
+     public int getColumnNumber() {
+         return _column;
+     }
+-    
++
+   /**
+    * Return the byte or character offset into the input source this location
+-   * is pointing to. If the input source is a file or a byte stream then 
+-   * this is the byte offset into that stream, but if the input source is 
+-   * a character media then the offset is the character offset. 
++   * is pointing to. If the input source is a file or a byte stream then
++   * this is the byte offset into that stream, but if the input source is
++   * a character media then the offset is the character offset.
+    * Returns -1 if there is no offset available.
+    * @return the current offset
+    */
+@@ -73,7 +73,7 @@
+     public int getCharacterOffset(){
+         return _charOffset;
+     }
+-    
++
+     /**
+     * Returns the public ID of the XML
+     * @return the public ID, or null if not available
+@@ -81,7 +81,7 @@
+     public String getPublicId(){
+         return _publicId;
+     }
+-    
++
+   /**
+    * Returns the system ID of the XML
+    * @return the system ID, or null if not available
+@@ -89,7 +89,7 @@
+     public String getSystemId(){
+         return _systemId;
+     }
+-    
++
+     public void setLineNumber(int line) {
+         _line = line;
+     }
+@@ -105,7 +105,7 @@
+     public void setSystemId(String id) {
+         _systemId = id;
+     }
+-    
++
+     public String toString(){
+         StringBuffer sbuffer = new StringBuffer() ;
+         sbuffer.append("Line number = " + _line);
+@@ -120,6 +120,5 @@
+         sbuffer.append("\n") ;
+         return sbuffer.toString();
+     }
+-    
+-}
+ 
++}
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/stax/StAXDocumentParser.java	Thu Jul 30 18:01:55 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/StAXDocumentParser.java	Thu Jul 30 18:01:54 2009
+@@ -51,6 +51,7 @@
+ import com.sun.xml.internal.org.jvnet.fastinfoset.FastInfosetException;
+ import com.sun.xml.internal.fastinfoset.CommonResourceBundle;
+ import com.sun.xml.internal.fastinfoset.org.apache.xerces.util.XMLChar;
++import com.sun.xml.internal.fastinfoset.util.DuplicateAttributeVerifier;
+ import com.sun.xml.internal.org.jvnet.fastinfoset.stax.FastInfosetStreamReader;
+ 
+ /**
+@@ -71,14 +72,14 @@
+     protected static final int INTERNAL_STATE_DOUBLE_TERMINATE_ELEMENT = 3;
+     protected static final int INTERNAL_STATE_END_DOCUMENT = 4;
+     protected static final int INTERNAL_STATE_VOID = -1;
+-    
++
+     protected int _internalState;
+-    
++
+     /**
+      * Current event
+      */
+     protected int _eventType;
+-    
++
+     /**
+      * Stack of qualified names and namespaces
+      */
+@@ -86,36 +87,36 @@
+     protected int[] _namespaceAIIsStartStack = new int[32];
+     protected int[] _namespaceAIIsEndStack = new int[32];
+     protected int _stackCount = -1;
+-    
++
+     protected String[] _namespaceAIIsPrefix = new String[32];
+     protected String[] _namespaceAIIsNamespaceName = new String[32];
+     protected int[] _namespaceAIIsPrefixIndex = new int[32];
+     protected int _namespaceAIIsIndex;
+-    
++
+     /**
+      * Namespaces associated with START_ELEMENT or END_ELEMENT
+      */
+     protected int _currentNamespaceAIIsStart;
+     protected int _currentNamespaceAIIsEnd;
+-    
++
+     /**
+      * Qualified name associated with START_ELEMENT or END_ELEMENT.
+      */
+     protected QualifiedName _qualifiedName;
+-    
++
+     /**
+      * List of attributes
+      */
+     protected AttributesHolder _attributes = new AttributesHolder();
+-    
++
+     protected boolean _clearAttributes = false;
+-    
++
+     /**
+      * Characters associated with event.
+      */
+     protected char[] _characters;
+     protected int _charactersOffset;
+-    
++
+     protected String _algorithmURI;
+     protected int _algorithmId;
+     protected boolean _isAlgorithmDataCloned;
+@@ -122,81 +123,83 @@
+     protected byte[] _algorithmData;
+     protected int _algorithmDataOffset;
+     protected int _algorithmDataLength;
+-    
++
+     /**
+      * State for processing instruction
+      */
+     protected String _piTarget;
+     protected String _piData;
+-    
++
+     protected NamespaceContextImpl _nsContext = new NamespaceContextImpl();
+-    
++
+     protected String _characterEncodingScheme;
+-    
++
+     protected StAXManager _manager;
+-    
++
+     public StAXDocumentParser() {
+         reset();
+         _manager = new StAXManager(StAXManager.CONTEXT_READER);
+     }
+-    
++
+     public StAXDocumentParser(InputStream s) {
+         this();
+         setInputStream(s);
+         _manager = new StAXManager(StAXManager.CONTEXT_READER);
+     }
+-    
++
+     public StAXDocumentParser(InputStream s, StAXManager manager) {
+         this(s);
+         _manager = manager;
+     }
+-    
++
++    @Override
+     public void setInputStream(InputStream s) {
+         super.setInputStream(s);
+         reset();
+     }
+-    
++
++    @Override
+     public void reset() {
+         super.reset();
+         if (_internalState != INTERNAL_STATE_START_DOCUMENT &&
+                 _internalState != INTERNAL_STATE_END_DOCUMENT) {
+-            
++
+             for (int i = _namespaceAIIsIndex - 1; i >= 0; i--) {
+                 _prefixTable.popScopeWithPrefixEntry(_namespaceAIIsPrefixIndex[i]);
+             }
+-            
++
+             _stackCount = -1;
+-            
++
+             _namespaceAIIsIndex = 0;
+             _characters = null;
+             _algorithmData = null;
+         }
+-        
++
+         _characterEncodingScheme = "UTF-8";
+         _eventType = START_DOCUMENT;
+         _internalState = INTERNAL_STATE_START_DOCUMENT;
+     }
+-    
++
+     protected void resetOnError() {
+         super.reset();
+-        
++
+         if (_v != null) {
+             _prefixTable.clearCompletely();
+         }
+         _duplicateAttributeVerifier.clear();
+-        
++
+         _stackCount = -1;
+-        
++
+         _namespaceAIIsIndex = 0;
+         _characters = null;
+         _algorithmData = null;
+-        
++
+         _eventType = START_DOCUMENT;
+         _internalState = INTERNAL_STATE_START_DOCUMENT;
+     }
+-    
++
+     // -- XMLStreamReader Interface -------------------------------------------
+-    
++
+     public Object getProperty(java.lang.String name)
+     throws java.lang.IllegalArgumentException {
+         if (_manager != null) {
+@@ -204,7 +207,7 @@
+         }
+         return null;
+     }
+-    
++
+     public int next() throws XMLStreamException {
+         try {
+             if (_internalState != INTERNAL_STATE_VOID) {
+@@ -212,7 +215,7 @@
+                     case INTERNAL_STATE_START_DOCUMENT:
+                         decodeHeader();
+                         processDII();
+-                        
++
+                         _internalState = INTERNAL_STATE_VOID;
+                         break;
+                     case INTERNAL_STATE_START_ELEMENT_TERMINATE:
+@@ -222,10 +225,10 @@
+                             }
+                             _namespaceAIIsIndex = _currentNamespaceAIIsStart;
+                         }
+-                        
++
+                         // Pop information off the stack
+                         popStack();
+-                        
++
+                         _internalState = INTERNAL_STATE_VOID;
+                         return _eventType = END_ELEMENT;
+                     case INTERNAL_STATE_SINGLE_TERMINATE_ELEMENT_WITH_NAMESPACES:
+@@ -244,15 +247,15 @@
+                             }
+                             _namespaceAIIsIndex = _currentNamespaceAIIsStart;
+                         }
+-                        
++
+                         if (_stackCount == -1) {
+                             _internalState = INTERNAL_STATE_END_DOCUMENT;
+                             return _eventType = END_DOCUMENT;
+                         }
+-                        
++
+                         // Pop information off the stack
+                         popStack();
+-                        
++
+                         _internalState = (_currentNamespaceAIIsEnd > 0) ?
+                             INTERNAL_STATE_SINGLE_TERMINATE_ELEMENT_WITH_NAMESPACES :
+                             INTERNAL_STATE_VOID;
+@@ -261,15 +264,15 @@
+                         throw new NoSuchElementException(CommonResourceBundle.getInstance().getString("message.noMoreEvents"));
+                 }
+             }
+-            
++
+             // Reset internal state
+             _characters = null;
+             _algorithmData = null;
+             _currentNamespaceAIIsEnd = 0;
+-            
++
+             // Process information item
+             final int b = read();
+-            switch(DecoderStateTables.EII[b]) {
++            switch(DecoderStateTables.EII(b)) {
+                 case DecoderStateTables.EII_NO_AIIS_INDEX_SMALL:
+                     processEII(_elementNameTable._array[b], false);
+                     return _eventType;
+@@ -331,15 +334,15 @@
+                 case DecoderStateTables.CII_RA:
+                 {
+                     final boolean addToTable = (b & EncodingConstants.CHARACTER_CHUNK_ADD_TO_TABLE_FLAG) > 0;
+-                    
++
+                     _identifier = (b & 0x02) << 6;
+                     final int b2 = read();
+                     _identifier |= (b2 & 0xFC) >> 2;
+-                    
++
+                     decodeOctetsOnSeventhBitOfNonIdentifyingStringOnThirdBit(b2);
+-                    
++
+                     decodeRestrictedAlphabetAsCharBuffer();
+-                    
++
+                     if (addToTable) {
+                         _charactersOffset = _characterContentChunkTable.add(_charBuffer, _charBufferLength);
+                         _characters = _characterContentChunkTable._array;
+@@ -351,18 +354,15 @@
+                 }
+                 case DecoderStateTables.CII_EA:
+                 {
+-                    if ((b & EncodingConstants.NISTRING_ADD_TO_TABLE_FLAG) > 0) {
+-                        throw new EncodingAlgorithmException(CommonResourceBundle.getInstance().getString("message.addToTableNotSupported"));
+-                    }
+-                    
++                    final boolean addToTable = (b & EncodingConstants.CHARACTER_CHUNK_ADD_TO_TABLE_FLAG) > 0;
+                     // Decode encoding algorithm integer
+                     _algorithmId = (b & 0x02) << 6;
+                     final int b2 = read();
+                     _algorithmId |= (b2 & 0xFC) >> 2;
+-                    
++
+                     decodeOctetsOnSeventhBitOfNonIdentifyingStringOnThirdBit(b2);
+-                    processCIIEncodingAlgorithm();
+-                    
++                    processCIIEncodingAlgorithm(addToTable);
++
+                     return _eventType = CHARACTERS;
+                 }
+                 case DecoderStateTables.CII_INDEX_SMALL:
+@@ -369,7 +369,7 @@
+                 {
+                     final int index = b & EncodingConstants.INTEGER_4TH_BIT_SMALL_MASK;
+                     _characterContentChunkTable._cachedIndex = index;
+-                    
++
+                     _characters = _characterContentChunkTable._array;
+                     _charactersOffset = _characterContentChunkTable._offset[index];
+                     _charBufferLength = _characterContentChunkTable._length[index];
+@@ -380,7 +380,7 @@
+                     final int index = (((b & EncodingConstants.INTEGER_4TH_BIT_MEDIUM_MASK) << 8) | read())
+                     + EncodingConstants.INTEGER_4TH_BIT_SMALL_LIMIT;
+                     _characterContentChunkTable._cachedIndex = index;
+-                    
++
+                     _characters = _characterContentChunkTable._array;
+                     _charactersOffset = _characterContentChunkTable._offset[index];
+                     _charBufferLength = _characterContentChunkTable._length[index];
+@@ -393,7 +393,7 @@
+                             read())
+                             + EncodingConstants.INTEGER_4TH_BIT_MEDIUM_LIMIT;
+                     _characterContentChunkTable._cachedIndex = index;
+-                    
++
+                     _characters = _characterContentChunkTable._array;
+                     _charactersOffset = _characterContentChunkTable._offset[index];
+                     _charBufferLength = _characterContentChunkTable._length[index];
+@@ -406,7 +406,7 @@
+                             read())
+                             + EncodingConstants.INTEGER_4TH_BIT_LARGE_LIMIT;
+                     _characterContentChunkTable._cachedIndex = index;
+-                    
++
+                     _characters = _characterContentChunkTable._array;
+                     _charactersOffset = _characterContentChunkTable._offset[index];
+                     _charBufferLength = _characterContentChunkTable._length[index];
+@@ -428,11 +428,11 @@
+                     if (_stackCount != -1) {
+                         // Pop information off the stack
+                         popStack();
+-                        
++
+                         _internalState = INTERNAL_STATE_DOUBLE_TERMINATE_ELEMENT;
+                         return _eventType = END_ELEMENT;
+                     }
+-                    
++
+                     _internalState = INTERNAL_STATE_END_DOCUMENT;
+                     return _eventType = END_DOCUMENT;
+                 case DecoderStateTables.TERMINATOR_SINGLE:
+@@ -439,13 +439,13 @@
+                     if (_stackCount != -1) {
+                         // Pop information off the stack
+                         popStack();
+-                        
++
+                         if (_currentNamespaceAIIsEnd > 0) {
+                             _internalState = INTERNAL_STATE_SINGLE_TERMINATE_ELEMENT_WITH_NAMESPACES;
+                         }
+                         return _eventType = END_ELEMENT;
+                     }
+-                    
++
+                     _internalState = INTERNAL_STATE_END_DOCUMENT;
+                     return _eventType = END_DOCUMENT;
+                 default:
+@@ -465,7 +465,7 @@
+             throw e;
+         }
+     }
+-    
++
+     private final void processUtf8CharacterString(final int b) throws IOException {
+         if ((b & EncodingConstants.CHARACTER_CHUNK_ADD_TO_TABLE_FLAG) > 0) {
+             _characterContentChunkTable.ensureSize(_octetBufferLength);
+@@ -479,7 +479,7 @@
+             _charactersOffset = 0;
+         }
+     }
+-    
++
+     private final void processUtf16CharacterString(final int b) throws IOException {
+         decodeUtf16StringAsCharBuffer();
+         if ((b & EncodingConstants.CHARACTER_CHUNK_ADD_TO_TABLE_FLAG) > 0) {
+@@ -490,7 +490,7 @@
+             _charactersOffset = 0;
+         }
+     }
+-    
++
+     private final void popStack() {
+         // Pop information off the stack
+         _qualifiedName = _qNameStack[_stackCount];
+@@ -498,7 +498,7 @@
+         _currentNamespaceAIIsEnd = _namespaceAIIsEndStack[_stackCount];
+         _qNameStack[_stackCount--] = null;
+     }
+-    
++
+     /** Test if the current event is of the given type and if the namespace and name match the current namespace and name of the current event.
+      * If the namespaceURI is null it is not checked for equality, if the localName is null it is not checked for equality.
+      * @param type the event type
+@@ -514,10 +514,10 @@
+             throw new XMLStreamException(CommonResourceBundle.getInstance().getString("message.namespaceURINotMatch", new Object[]{namespaceURI}));
+         if(localName != null && !localName.equals(getLocalName()))
+             throw new XMLStreamException(CommonResourceBundle.getInstance().getString("message.localNameNotMatch", new Object[]{localName}));
+-        
++
+         return;
+     }
+-    
++
+     /** Reads the content of a text-only element. Precondition:
+      * the current event is START_ELEMENT. Postcondition:
+      * The current event is the corresponding END_ELEMENT.
+@@ -525,7 +525,7 @@
+      * a non text element is encountered
+      */
+     public final String getElementText() throws XMLStreamException {
+-        
++
+         if(getEventType() != START_ELEMENT) {
+             throw new XMLStreamException(
+                     CommonResourceBundle.getInstance().getString("message.mustBeOnSTARTELEMENT"), getLocation());
+@@ -566,7 +566,7 @@
+         }
+         return content.toString();
+     }
+-    
++
+     /** Skips any white space (isWhiteSpace() returns true), COMMENT,
+      * or PROCESSING_INSTRUCTION,
+      * until a START_ELEMENT or END_ELEMENT is reached.
+@@ -604,11 +604,11 @@
+         }
+         return eventType;
+     }
+-    
++
+     public final boolean hasNext() throws XMLStreamException {
+         return (_eventType != END_DOCUMENT);
+     }
+-    
++
+     public void close() throws XMLStreamException {
+         try {
+             super.closeIfRequired();
+@@ -615,7 +615,7 @@
+         } catch (IOException ex) {
+         }
+     }
+-    
++
+     public final String getNamespaceURI(String prefix) {
+         String namespace = getNamespaceDecl(prefix);
+         if (namespace == null) {
+@@ -626,19 +626,19 @@
+         }
+         return namespace;
+     }
+-    
++
+     public final boolean isStartElement() {
+         return (_eventType == START_ELEMENT);
+     }
+-    
++
+     public final boolean isEndElement() {
+         return (_eventType == END_ELEMENT);
+     }
+-    
++
+     public final boolean isCharacters() {
+         return (_eventType == CHARACTERS);
+     }
+-    
++
+     /**
+      *  Returns true if the cursor points to a character data event that consists of all whitespace
+      *  Application calling this method needs to cache the value and avoid calling this method again
+@@ -659,15 +659,15 @@
+         }
+         return false;
+     }
+-    
++
+     public final String getAttributeValue(String namespaceURI, String localName) {
+         if (_eventType != START_ELEMENT) {
+             throw new IllegalStateException(CommonResourceBundle.getInstance().getString("message.invalidCallingGetAttributeValue"));
+         }
+-        
++
+         if (localName == null)
+             throw new IllegalArgumentException();
+-        
++
+         // Search for the attributes in _attributes
+         if (namespaceURI != null) {
+             for (int i = 0; i < _attributes.getLength(); i++) {
+@@ -683,18 +683,18 @@
+                 }
+             }
+         }
+-        
++
+         return null;
+     }
+-    
++
+     public final int getAttributeCount() {
+         if (_eventType != START_ELEMENT) {
+             throw new IllegalStateException(CommonResourceBundle.getInstance().getString("message.invalidCallingGetAttributeValue"));
+         }
+-        
++
+         return _attributes.getLength();
+     }
+-    
++
+     public final javax.xml.namespace.QName getAttributeName(int index) {
+         if (_eventType != START_ELEMENT) {
+             throw new IllegalStateException(CommonResourceBundle.getInstance().getString("message.invalidCallingGetAttributeValue"));
+@@ -701,15 +701,15 @@
+         }
+         return _attributes.getQualifiedName(index).getQName();
+     }
+-    
++
+     public final String getAttributeNamespace(int index) {
+         if (_eventType != START_ELEMENT) {
+             throw new IllegalStateException(CommonResourceBundle.getInstance().getString("message.invalidCallingGetAttributeValue"));
+         }
+-        
++
+         return _attributes.getURI(index);
+     }
+-    
++
+     public final String getAttributeLocalName(int index) {
+         if (_eventType != START_ELEMENT) {
+             throw new IllegalStateException(CommonResourceBundle.getInstance().getString("message.invalidCallingGetAttributeValue"));
+@@ -716,7 +716,7 @@
+         }
+         return _attributes.getLocalName(index);
+     }
+-    
++
+     public final String getAttributePrefix(int index) {
+         if (_eventType != START_ELEMENT) {
+             throw new IllegalStateException(CommonResourceBundle.getInstance().getString("message.invalidCallingGetAttributeValue"));
+@@ -723,7 +723,7 @@
+         }
+         return _attributes.getPrefix(index);
+     }
+-    
++
+     public final String getAttributeType(int index) {
+         if (_eventType != START_ELEMENT) {
+             throw new IllegalStateException(CommonResourceBundle.getInstance().getString("message.invalidCallingGetAttributeValue"));
+@@ -730,7 +730,7 @@
+         }
+         return _attributes.getType(index);
+     }
+-    
++
+     public final String getAttributeValue(int index) {
+         if (_eventType != START_ELEMENT) {
+             throw new IllegalStateException(CommonResourceBundle.getInstance().getString("message.invalidCallingGetAttributeValue"));
+@@ -737,11 +737,11 @@
+         }
+         return _attributes.getValue(index);
+     }
+-    
++
+     public final boolean isAttributeSpecified(int index) {
+         return false;   // non-validating parser
+     }
+-    
++
+     public final int getNamespaceCount() {
+         if (_eventType == START_ELEMENT || _eventType == END_ELEMENT) {
+             return (_currentNamespaceAIIsEnd > 0) ? (_currentNamespaceAIIsEnd - _currentNamespaceAIIsStart) : 0;
+@@ -749,7 +749,7 @@
+             throw new IllegalStateException(CommonResourceBundle.getInstance().getString("message.invalidCallingGetNamespaceCount"));
+         }
+     }
+-    
++
+     public final String getNamespacePrefix(int index) {
+         if (_eventType == START_ELEMENT || _eventType == END_ELEMENT) {
+             return _namespaceAIIsPrefix[_currentNamespaceAIIsStart + index];
+@@ -757,7 +757,7 @@
+             throw new IllegalStateException(CommonResourceBundle.getInstance().getString("message.invalidCallingGetNamespacePrefix"));
+         }
+     }
+-    
++
+     public final String getNamespaceURI(int index) {
+         if (_eventType == START_ELEMENT || _eventType == END_ELEMENT) {
+             return _namespaceAIIsNamespaceName[_currentNamespaceAIIsStart + index];
+@@ -765,20 +765,20 @@
+             throw new IllegalStateException(CommonResourceBundle.getInstance().getString("message.invalidCallingGetNamespacePrefix"));
+         }
+     }
+-    
++
+     public final NamespaceContext getNamespaceContext() {
+         return _nsContext;
+     }
+-    
++
+     public final int getEventType() {
+         return _eventType;
+     }
+-    
++
+     public final String getText() {
+         if (_characters == null) {
+             checkTextState();
+         }
+-        
++
+         if (_characters == _characterContentChunkTable._array) {
+             return _characterContentChunkTable.getString(_characterContentChunkTable._cachedIndex);
+         } else {
+@@ -785,51 +785,52 @@
+             return new String(_characters, _charactersOffset, _charBufferLength);
+         }
+     }
+-    
++
+     public final char[] getTextCharacters() {
+         if (_characters == null) {
+             checkTextState();
+         }
+-        
++
+         return _characters;
+     }
+-    
++
+     public final int getTextStart() {
+         if (_characters == null) {
+             checkTextState();
+         }
+-        
++
+         return _charactersOffset;
+     }
+-    
++
+     public final int getTextLength() {
+         if (_characters == null) {
+             checkTextState();
+         }
+-        
++
+         return _charBufferLength;
+     }
+-    
++
+     public final int getTextCharacters(int sourceStart, char[] target,
+             int targetStart, int length) throws XMLStreamException {
+         if (_characters == null) {
+             checkTextState();
+         }
+-        
++
+         try {
+-            System.arraycopy(_characters, sourceStart, target,
+-                    targetStart, length);
+-            return length;
++            int bytesToCopy = Math.min(_charBufferLength, length);
++            System.arraycopy(_characters, _charactersOffset + sourceStart,
++                    target, targetStart, bytesToCopy);
++            return bytesToCopy;
+         } catch (IndexOutOfBoundsException e) {
+             throw new XMLStreamException(e);
+         }
+     }
+-    
++
+     protected final void checkTextState() {
+         if (_algorithmData == null) {
+             throw new IllegalStateException(CommonResourceBundle.getInstance().getString("message.InvalidStateForText"));
+         }
+-        
++
+         try {
+             convertEncodingAlgorithmDataToCharacters();
+         } catch (Exception e) {
+@@ -836,21 +837,21 @@
+             throw new IllegalStateException(CommonResourceBundle.getInstance().getString("message.InvalidStateForText"));
+         }
+     }
+-    
++
+     public final String getEncoding() {
+         return _characterEncodingScheme;
+     }
+-    
++
+     public final boolean hasText() {
+         return (_characters != null);
+     }
+-    
++
+     public final Location getLocation() {
+         //location should be created in next()
+         //returns a nil location for now
+         return EventLocation.getNilLocation();
+     }
+-    
++
+     public final QName getName() {
+         if (_eventType == START_ELEMENT || _eventType == END_ELEMENT) {
+             return _qualifiedName.getQName();
+@@ -858,7 +859,7 @@
+             throw new IllegalStateException(CommonResourceBundle.getInstance().getString("message.invalidCallingGetName"));
+         }
+     }
+-    
++
+     public final String getLocalName() {
+         if (_eventType == START_ELEMENT || _eventType == END_ELEMENT) {
+             return _qualifiedName.localName;
+@@ -866,11 +867,11 @@
+             throw new IllegalStateException(CommonResourceBundle.getInstance().getString("message.invalidCallingGetLocalName"));
+         }
+     }
+-    
++
+     public final boolean hasName() {
+         return (_eventType == START_ELEMENT || _eventType == END_ELEMENT);
+     }
+-    
++
+     public final String getNamespaceURI() {
+         if (_eventType == START_ELEMENT || _eventType == END_ELEMENT) {
+             return _qualifiedName.namespaceName;
+@@ -878,7 +879,7 @@
+             throw new IllegalStateException(CommonResourceBundle.getInstance().getString("message.invalidCallingGetNamespaceURI"));
+         }
+     }
+-    
++
+     public final String getPrefix() {
+         if (_eventType == START_ELEMENT || _eventType == END_ELEMENT) {
+             return _qualifiedName.prefix;
+@@ -886,42 +887,42 @@
+             throw new IllegalStateException(CommonResourceBundle.getInstance().getString("message.invalidCallingGetPrefix"));
+         }
+     }
+-    
++
+     public final String getVersion() {
+         return null;
+     }
+-    
++
+     public final boolean isStandalone() {
+         return false;
+     }
+-    
++
+     public final boolean standaloneSet() {
+         return false;
+     }
+-    
++
+     public final String getCharacterEncodingScheme() {
+         return null;
+     }
+-    
++
+     public final String getPITarget() {
+         if (_eventType != PROCESSING_INSTRUCTION) {
+             throw new IllegalStateException(CommonResourceBundle.getInstance().getString("message.invalidCallingGetPITarget"));
+         }
+-        
++
+         return _piTarget;
+     }
+-    
++
+     public final String getPIData() {
+         if (_eventType != PROCESSING_INSTRUCTION) {
+             throw new IllegalStateException(CommonResourceBundle.getInstance().getString("message.invalidCallingGetPIData"));
+         }
+-        
++
+         return _piData;
+     }
+-    
+-    
+-    
+-    
++
++
++
++
+     public final String getNameString() {
+         if (_eventType == START_ELEMENT || _eventType == END_ELEMENT) {
+             return _qualifiedName.getQNameString();
+@@ -929,7 +930,7 @@
+             throw new IllegalStateException(CommonResourceBundle.getInstance().getString("message.invalidCallingGetName"));
+         }
+     }
+-    
++
+     public final String getAttributeNameString(int index) {
+         if (_eventType != START_ELEMENT) {
+             throw new IllegalStateException(CommonResourceBundle.getInstance().getString("message.invalidCallingGetAttributeValue"));
+@@ -936,38 +937,38 @@
+         }
+         return _attributes.getQualifiedName(index).getQNameString();
+     }
+-    
+-    
++
++
+     public final String getTextAlgorithmURI() {
+         return _algorithmURI;
+     }
+-    
++
+     public final int getTextAlgorithmIndex() {
+         return _algorithmId;
+     }
+-    
++
+     public final byte[] getTextAlgorithmBytes() {
+         return _algorithmData;
+     }
+-    
++
+     public final byte[] getTextAlgorithmBytesClone() {
+         if (_algorithmData == null) {
+             return null;
+         }
+-        
++
+         byte[] algorithmData = new byte[_algorithmDataLength];
+         System.arraycopy(_algorithmData, _algorithmDataOffset, algorithmData, 0, _algorithmDataLength);
+         return algorithmData;
+     }
+-    
++
+     public final int getTextAlgorithmStart() {
+         return _algorithmDataOffset;
+     }
+-    
++
+     public final int getTextAlgorithmLength() {
+         return _algorithmDataLength;
+     }
+-    
++
+     public final int getTextAlgorithmBytes(int sourceStart, byte[] target,
+             int targetStart, int length) throws XMLStreamException {
+         try {
+@@ -978,12 +979,12 @@
+             throw new XMLStreamException(e);
+         }
+     }
+-    
++
+     // FastInfosetStreamReader impl
+-    
++
+     public final int peekNext() throws XMLStreamException {
+         try {
+-            switch(DecoderStateTables.EII[peek(this)]) {
++            switch(DecoderStateTables.EII(peek(this))) {
+                 case DecoderStateTables.EII_NO_AIIS_INDEX_SMALL:
+                 case DecoderStateTables.EII_AIIS_INDEX_SMALL:
+                 case DecoderStateTables.EII_INDEX_MEDIUM:
+@@ -1023,7 +1024,7 @@
+             throw new XMLStreamException(e);
+         }
+     }
+-    
++
+     public void onBeforeOctetBufferOverwrite() {
+         if (_algorithmData != null) {
+             _algorithmData = getTextAlgorithmBytesClone();
+@@ -1031,39 +1032,39 @@
+             _isAlgorithmDataCloned = true;
+         }
+     }
+-    
++
+     // Faster access methods without checks
+-    
++
+     public final int accessNamespaceCount() {
+         return (_currentNamespaceAIIsEnd > 0) ? (_currentNamespaceAIIsEnd - _currentNamespaceAIIsStart) : 0;
+     }
+-    
++
+     public final String accessLocalName() {
+         return _qualifiedName.localName;
+     }
+-    
++
+     public final String accessNamespaceURI() {
+         return _qualifiedName.namespaceName;
+     }
+-    
++
+     public final String accessPrefix() {
+         return _qualifiedName.prefix;
+     }
+-    
++
+     public final char[] accessTextCharacters() {
+         return _characters;
+     }
+-    
++
+     public final int accessTextStart() {
+         return _charactersOffset;
+     }
+-    
++
+     public final int accessTextLength() {
+         return _charBufferLength;
+     }
+-    
++
+     //
+-    
++
+     protected final void processDII() throws FastInfosetException, IOException {
+         final int b = read();
+         if (b > 0) {
+@@ -1070,7 +1071,7 @@
+             processDIIOptionalProperties(b);
+         }
+     }
+-    
++
+     protected final void processDIIOptionalProperties(int b) throws FastInfosetException, IOException {
+         // Optimize for the most common case
+         if (b == EncodingConstants.DOCUMENT_INITIAL_VOCABULARY_FLAG) {
+@@ -1077,7 +1078,7 @@
+             decodeInitialVocabulary();
+             return;
+         }
+-        
++
+         if ((b & EncodingConstants.DOCUMENT_ADDITIONAL_DATA_FLAG) > 0) {
+             decodeAdditionalData();
+             /*
+@@ -1085,11 +1086,11 @@
+              * how to report the additional data?
+              */
+         }
+-        
++
+         if ((b & EncodingConstants.DOCUMENT_INITIAL_VOCABULARY_FLAG) > 0) {
+             decodeInitialVocabulary();
+         }
+-        
++
+         if ((b & EncodingConstants.DOCUMENT_NOTATIONS_FLAG) > 0) {
+             decodeNotations();
+             /*
+@@ -1100,7 +1101,7 @@
+                 }
+              */
+         }
+-        
++
+         if ((b & EncodingConstants.DOCUMENT_UNPARSED_ENTITIES_FLAG) > 0) {
+             decodeUnparsedEntities();
+             /*
+@@ -1111,11 +1112,11 @@
+                 }
+              */
+         }
+-        
++
+         if ((b & EncodingConstants.DOCUMENT_CHARACTER_ENCODING_SCHEME) > 0) {
+             _characterEncodingScheme = decodeCharacterEncodingScheme();
+         }
+-        
++
+         if ((b & EncodingConstants.DOCUMENT_STANDALONE_FLAG) > 0) {
+             boolean standalone = (read() > 0) ? true : false ;
+             /*
+@@ -1123,7 +1124,7 @@
+              * how to report the standalone flag?
+              */
+         }
+-        
++
+         if ((b & EncodingConstants.DOCUMENT_VERSION_FLAG) > 0) {
+             decodeVersion();
+             /*
+@@ -1132,27 +1133,27 @@
+              */
+         }
+     }
+-    
+-    
++
++
+     protected final void resizeNamespaceAIIs() {
+         final String[] namespaceAIIsPrefix = new String[_namespaceAIIsIndex * 2];
+         System.arraycopy(_namespaceAIIsPrefix, 0, namespaceAIIsPrefix, 0, _namespaceAIIsIndex);
+         _namespaceAIIsPrefix = namespaceAIIsPrefix;
+-        
++
+         final String[] namespaceAIIsNamespaceName = new String[_namespaceAIIsIndex * 2];
+         System.arraycopy(_namespaceAIIsNamespaceName, 0, namespaceAIIsNamespaceName, 0, _namespaceAIIsIndex);
+         _namespaceAIIsNamespaceName = namespaceAIIsNamespaceName;
+-        
++
+         final int[] namespaceAIIsPrefixIndex = new int[_namespaceAIIsIndex * 2];
+         System.arraycopy(_namespaceAIIsPrefixIndex, 0, namespaceAIIsPrefixIndex, 0, _namespaceAIIsIndex);
+         _namespaceAIIsPrefixIndex = namespaceAIIsPrefixIndex;
+     }
+-    
++
+     protected final void processEIIWithNamespaces(boolean hasAttributes) throws FastInfosetException, IOException {
+         if (++_prefixTable._declarationId == Integer.MAX_VALUE) {
+             _prefixTable.clearDeclarationIds();
+         }
+-        
++
+         _currentNamespaceAIIsStart = _namespaceAIIsIndex;
+         String prefix = "", namespaceName = "";
+         int b = read();
+@@ -1160,7 +1161,7 @@
+             if (_namespaceAIIsIndex == _namespaceAIIsPrefix.length) {
+                 resizeNamespaceAIIs();
+             }
+-            
++
+             switch (b & EncodingConstants.NAMESPACE_ATTRIBUTE_PREFIX_NAME_MASK) {
+                 // no prefix, no namespace
+                 // Undeclaration of default namespace
+@@ -1168,7 +1169,7 @@
+                     prefix = namespaceName =
+                             _namespaceAIIsPrefix[_namespaceAIIsIndex] =
+                             _namespaceAIIsNamespaceName[_namespaceAIIsIndex] = "";
+-                    
++
+                     _namespaceNameIndex = _prefixIndex = _namespaceAIIsPrefixIndex[_namespaceAIIsIndex++] = -1;
+                     break;
+                     // no prefix, namespace
+@@ -1177,7 +1178,7 @@
+                     prefix = _namespaceAIIsPrefix[_namespaceAIIsIndex] = "";
+                     namespaceName = _namespaceAIIsNamespaceName[_namespaceAIIsIndex] =
+                             decodeIdentifyingNonEmptyStringOnFirstBitAsNamespaceName(false);
+-                    
++
+                     _prefixIndex = _namespaceAIIsPrefixIndex[_namespaceAIIsIndex++] = -1;
+                     break;
+                     // prefix, no namespace
+@@ -1186,7 +1187,7 @@
+                     prefix = _namespaceAIIsPrefix[_namespaceAIIsIndex] =
+                             decodeIdentifyingNonEmptyStringOnFirstBitAsPrefix(false);
+                     namespaceName = _namespaceAIIsNamespaceName[_namespaceAIIsIndex] = "";
+-                    
++
+                     _namespaceNameIndex = -1;
+                     _namespaceAIIsPrefixIndex[_namespaceAIIsIndex++] = _prefixIndex;
+                     break;
+@@ -1197,14 +1198,14 @@
+                             decodeIdentifyingNonEmptyStringOnFirstBitAsPrefix(true);
+                     namespaceName = _namespaceAIIsNamespaceName[_namespaceAIIsIndex] =
+                             decodeIdentifyingNonEmptyStringOnFirstBitAsNamespaceName(true);
+-                    
++
+                     _namespaceAIIsPrefixIndex[_namespaceAIIsIndex++] = _prefixIndex;
+                     break;
+             }
+-            
++
+             // Push namespace declarations onto the stack
+             _prefixTable.pushScopeWithPrefixEntry(prefix, namespaceName, _prefixIndex, _namespaceNameIndex);
+-            
++
+             b = read();
+         }
+         if (b != EncodingConstants.TERMINATOR) {
+@@ -1211,9 +1212,9 @@
+             throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.EIInamespaceNameNotTerminatedCorrectly"));
+         }
+         _currentNamespaceAIIsEnd = _namespaceAIIsIndex;
+-        
++
+         b = read();
+-        switch(DecoderStateTables.EII[b]) {
++        switch(DecoderStateTables.EII(b)) {
+             case DecoderStateTables.EII_NO_AIIS_INDEX_SMALL:
+                 processEII(_elementNameTable._array[b], hasAttributes);
+                 break;
+@@ -1236,24 +1237,24 @@
+                 throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.IllegalStateDecodingEIIAfterAIIs"));
+         }
+     }
+-    
++
+     protected final void processEII(QualifiedName name, boolean hasAttributes) throws FastInfosetException, IOException {
+         if (_prefixTable._currentInScope[name.prefixIndex] != name.namespaceNameIndex) {
+             throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.qnameOfEIINotInScope"));
+         }
+-        
++
+         _eventType = START_ELEMENT;
+         _qualifiedName = name;
+-        
++
+         if (_clearAttributes) {
+             _attributes.clear();
+             _clearAttributes = false;
+         }
+-        
++
+         if (hasAttributes) {
+             processAIIs();
+         }
+-        
++
+         // Push element holder onto the stack
+         _stackCount++;
+         if (_stackCount == _qNameStack.length) {
+@@ -1260,11 +1261,11 @@
+             QualifiedName[] qNameStack = new QualifiedName[_qNameStack.length * 2];
+             System.arraycopy(_qNameStack, 0, qNameStack, 0, _qNameStack.length);
+             _qNameStack = qNameStack;
+-            
++
+             int[] namespaceAIIsStartStack = new int[_namespaceAIIsStartStack.length * 2];
+             System.arraycopy(_namespaceAIIsStartStack, 0, namespaceAIIsStartStack, 0, _namespaceAIIsStartStack.length);
+             _namespaceAIIsStartStack = namespaceAIIsStartStack;
+-            
++
+             int[] namespaceAIIsEndStack = new int[_namespaceAIIsEndStack.length * 2];
+             System.arraycopy(_namespaceAIIsEndStack, 0, namespaceAIIsEndStack, 0, _namespaceAIIsEndStack.length);
+             _namespaceAIIsEndStack = namespaceAIIsEndStack;
+@@ -1273,22 +1274,22 @@
+         _namespaceAIIsStartStack[_stackCount] = _currentNamespaceAIIsStart;
+         _namespaceAIIsEndStack[_stackCount] = _currentNamespaceAIIsEnd;
+     }
+-    
++
+     protected final void processAIIs() throws FastInfosetException, IOException {
+         QualifiedName name;
+         int b;
+         String value;
+-        
++
+         if (++_duplicateAttributeVerifier._currentIteration == Integer.MAX_VALUE) {
+             _duplicateAttributeVerifier.clear();
+         }
+-        
++
+         _clearAttributes = true;
+         boolean terminate = false;
+         do {
+             // AII qualified name
+             b = read();
+-            switch (DecoderStateTables.AII[b]) {
++            switch (DecoderStateTables.AII(b)) {
+                 case DecoderStateTables.AII_INDEX_SMALL:
+                     name = _attributeNameTable._array[b];
+                     break;
+@@ -1310,7 +1311,7 @@
+                     name = processLiteralQualifiedName(
+                             b & EncodingConstants.LITERAL_QNAME_PREFIX_NAMESPACE_NAME_MASK,
+                             _attributeNameTable.getNext());
+-                    name.createAttributeValues(_duplicateAttributeVerifier.MAP_SIZE);
++                    name.createAttributeValues(DuplicateAttributeVerifier.MAP_SIZE);
+                     _attributeNameTable.add(name);
+                     break;
+                 case DecoderStateTables.AII_TERMINATOR_DOUBLE:
+@@ -1322,17 +1323,17 @@
+                 default:
+                     throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.decodingAIIs"));
+             }
+-            
++
+             // [normalized value] of AII
+-            
++
+             if (name.prefixIndex > 0 && _prefixTable._currentInScope[name.prefixIndex] != name.namespaceNameIndex) {
+                 throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.AIIqNameNotInScope"));
+             }
+-            
++
+             _duplicateAttributeVerifier.checkForDuplicateAttribute(name.attributeHash, name.attributeId);
+-            
++
+             b = read();
+-            switch(DecoderStateTables.NISTRING[b]) {
++            switch(DecoderStateTables.NISTRING(b)) {
+                 case DecoderStateTables.NISTRING_UTF8_SMALL_LENGTH:
+                     _octetBufferLength = (b & EncodingConstants.OCTET_STRING_LENGTH_5TH_BIT_SMALL_MASK) + 1;
+                     value = decodeUtf8StringAsString();
+@@ -1339,7 +1340,7 @@
+                     if ((b & EncodingConstants.NISTRING_ADD_TO_TABLE_FLAG) > 0) {
+                         _attributeValueTable.add(value);
+                     }
+-                    
++
+                     _attributes.addAttribute(name, value);
+                     break;
+                 case DecoderStateTables.NISTRING_UTF8_MEDIUM_LENGTH:
+@@ -1348,7 +1349,7 @@
+                     if ((b & EncodingConstants.NISTRING_ADD_TO_TABLE_FLAG) > 0) {
+                         _attributeValueTable.add(value);
+                     }
+-                    
++
+                     _attributes.addAttribute(name, value);
+                     break;
+                 case DecoderStateTables.NISTRING_UTF8_LARGE_LENGTH:
+@@ -1361,7 +1362,7 @@
+                     if ((b & EncodingConstants.NISTRING_ADD_TO_TABLE_FLAG) > 0) {
+                         _attributeValueTable.add(value);
+                     }
+-                    
++
+                     _attributes.addAttribute(name, value);
+                     break;
+                 case DecoderStateTables.NISTRING_UTF16_SMALL_LENGTH:
+@@ -1370,7 +1371,7 @@
+                     if ((b & EncodingConstants.NISTRING_ADD_TO_TABLE_FLAG) > 0) {
+                         _attributeValueTable.add(value);
+                     }
+-                    
++
+                     _attributes.addAttribute(name, value);
+                     break;
+                 case DecoderStateTables.NISTRING_UTF16_MEDIUM_LENGTH:
+@@ -1379,7 +1380,7 @@
+                     if ((b & EncodingConstants.NISTRING_ADD_TO_TABLE_FLAG) > 0) {
+                         _attributeValueTable.add(value);
+                     }
+-                    
++
+                     _attributes.addAttribute(name, value);
+                     break;
+                 case DecoderStateTables.NISTRING_UTF16_LARGE_LENGTH:
+@@ -1392,7 +1393,7 @@
+                     if ((b & EncodingConstants.NISTRING_ADD_TO_TABLE_FLAG) > 0) {
+                         _attributeValueTable.add(value);
+                     }
+-                    
++
+                     _attributes.addAttribute(name, value);
+                     break;
+                 case DecoderStateTables.NISTRING_RA:
+@@ -1402,30 +1403,27 @@
+                     _identifier = (b & 0x0F) << 4;
+                     b = read();
+                     _identifier |= (b & 0xF0) >> 4;
+-                    
++
+                     decodeOctetsOnFifthBitOfNonIdentifyingStringOnFirstBit(b);
+-                    
++
+                     value = decodeRestrictedAlphabetAsString();
+                     if (addToTable) {
+                         _attributeValueTable.add(value);
+                     }
+-                    
++
+                     _attributes.addAttribute(name, value);
+                     break;
+                 }
+                 case DecoderStateTables.NISTRING_EA:
+                 {
+-                    if ((b & EncodingConstants.NISTRING_ADD_TO_TABLE_FLAG) > 0) {
+-                        throw new EncodingAlgorithmException(CommonResourceBundle.getInstance().getString("message.addToTableNotSupported"));
+-                    }
+-                    
++                    final boolean addToTable = (b & EncodingConstants.NISTRING_ADD_TO_TABLE_FLAG) > 0;
+                     // Decode encoding algorithm integer
+                     _identifier = (b & 0x0F) << 4;
+                     b = read();
+                     _identifier |= (b & 0xF0) >> 4;
+-                    
++
+                     decodeOctetsOnFifthBitOfNonIdentifyingStringOnFirstBit(b);
+-                    processAIIEncodingAlgorithm(name);
++                    processAIIEncodingAlgorithm(name, addToTable);
+                     break;
+                 }
+                 case DecoderStateTables.NISTRING_INDEX_SMALL:
+@@ -1436,7 +1434,7 @@
+                 {
+                     final int index = (((b & EncodingConstants.INTEGER_2ND_BIT_MEDIUM_MASK) << 8) | read())
+                     + EncodingConstants.INTEGER_2ND_BIT_SMALL_LIMIT;
+-                    
++
+                     _attributes.addAttribute(name,
+                             _attributeValueTable._array[index]);
+                     break;
+@@ -1445,7 +1443,7 @@
+                 {
+                     final int index = (((b & EncodingConstants.INTEGER_2ND_BIT_LARGE_MASK) << 16) | (read() << 8) | read())
+                     + EncodingConstants.INTEGER_2ND_BIT_MEDIUM_LIMIT;
+-                    
++
+                     _attributes.addAttribute(name,
+                             _attributeValueTable._array[index]);
+                     break;
+@@ -1456,19 +1454,19 @@
+                 default:
+                     throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.decodingAIIValue"));
+             }
+-            
++
+         } while (!terminate);
+-        
++
+         // Reset duplication attribute verfifier
+         _duplicateAttributeVerifier._poolCurrent = _duplicateAttributeVerifier._poolHead;
+     }
+-    
++
+     protected final QualifiedName processEIIIndexMedium(int b) throws FastInfosetException, IOException {
+         final int i = (((b & EncodingConstants.INTEGER_3RD_BIT_MEDIUM_MASK) << 8) | read())
+         + EncodingConstants.INTEGER_3RD_BIT_SMALL_LIMIT;
+         return _elementNameTable._array[i];
+     }
+-    
++
+     protected final QualifiedName processEIIIndexLarge(int b) throws FastInfosetException, IOException {
+         int i;
+         if ((b & EncodingConstants.INTEGER_3RD_BIT_LARGE_LARGE_FLAG) == 0x20) {
+@@ -1482,11 +1480,11 @@
+         }
+         return _elementNameTable._array[i];
+     }
+-    
++
+     protected final QualifiedName processLiteralQualifiedName(int state, QualifiedName q)
+     throws FastInfosetException, IOException {
+         if (q == null) q = new QualifiedName();
+-        
++
+         switch (state) {
+             // no prefix, no namespace
+             case 0:
+@@ -1528,16 +1526,16 @@
+                 throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.decodingEII"));
+         }
+     }
+-    
++
+     protected final void processCommentII() throws FastInfosetException, IOException {
+         _eventType = COMMENT;
+-        
++
+         switch(decodeNonIdentifyingStringOnFirstBit()) {
+             case NISTRING_STRING:
+                 if (_addToTable) {
+                     _v.otherString.add(new CharArray(_charBuffer, 0, _charBufferLength, true));
+                 }
+-                
++
+                 _characters = _charBuffer;
+                 _charactersOffset = 0;
+                 break;
+@@ -1545,7 +1543,7 @@
+                 throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.commentIIAlgorithmNotSupported"));
+             case NISTRING_INDEX:
+                 final CharArray ca = _v.otherString.get(_integer);
+-                
++
+                 _characters = ca.ch;
+                 _charactersOffset = ca.start;
+                 _charBufferLength = ca.length;
+@@ -1557,12 +1555,12 @@
+                 break;
+         }
+     }
+-    
++
+     protected final void processProcessingII() throws FastInfosetException, IOException {
+         _eventType = PROCESSING_INSTRUCTION;
+-        
++
+         _piTarget = decodeIdentifyingNonEmptyStringOnFirstBit(_v.otherNCName);
+-        
++
+         switch(decodeNonIdentifyingStringOnFirstBit()) {
+             case NISTRING_STRING:
+                 _piData = new String(_charBuffer, 0, _charBufferLength);
+@@ -1580,28 +1578,28 @@
+                 break;
+         }
+     }
+-    
++
+     protected final void processUnexpandedEntityReference(final int b) throws FastInfosetException, IOException {
+         _eventType = ENTITY_REFERENCE;
+-        
++
+         /*
+          * TODO
+          * How does StAX report such events?
+          */
+         String entity_reference_name = decodeIdentifyingNonEmptyStringOnFirstBit(_v.otherNCName);
+-        
++
+         String system_identifier = ((b & EncodingConstants.UNEXPANDED_ENTITY_SYSTEM_IDENTIFIER_FLAG) > 0)
+         ? decodeIdentifyingNonEmptyStringOnFirstBit(_v.otherURI) : "";
+         String public_identifier = ((b & EncodingConstants.UNEXPANDED_ENTITY_PUBLIC_IDENTIFIER_FLAG) > 0)
+         ? decodeIdentifyingNonEmptyStringOnFirstBit(_v.otherURI) : "";
+     }
+-    
+-    protected final void processCIIEncodingAlgorithm() throws FastInfosetException, IOException {
++
++    protected final void processCIIEncodingAlgorithm(boolean addToTable) throws FastInfosetException, IOException {
+         _algorithmData = _octetBuffer;
+         _algorithmDataOffset = _octetBufferStart;
+         _algorithmDataLength = _octetBufferLength;
+         _isAlgorithmDataCloned = false;
+-        
++
+         if (_algorithmId >= EncodingConstants.ENCODING_ALGORITHM_APPLICATION_START) {
+             _algorithmURI = _v.encodingAlgorithm.get(_algorithmId - EncodingConstants.ENCODING_ALGORITHM_APPLICATION_START);
+             if (_algorithmURI == null) {
+@@ -1613,9 +1611,14 @@
+             // reported, allows for support through handler if required.
+             throw new EncodingAlgorithmException(CommonResourceBundle.getInstance().getString("message.identifiers10to31Reserved"));
+         }
++
++        if (addToTable) {
++            convertEncodingAlgorithmDataToCharacters();
++            _characterContentChunkTable.add(_characters, _characters.length);
++        }
+     }
+-    
+-    protected final void processAIIEncodingAlgorithm(QualifiedName name) throws FastInfosetException, IOException {
++
++    protected final void processAIIEncodingAlgorithm(QualifiedName name, boolean addToTable) throws FastInfosetException, IOException {
+         String URI = null;
+         if (_identifier >= EncodingConstants.ENCODING_ALGORITHM_APPLICATION_START) {
+             URI = _v.encodingAlgorithm.get(_identifier - EncodingConstants.ENCODING_ALGORITHM_APPLICATION_START);
+@@ -1626,30 +1629,33 @@
+             if (_identifier == EncodingAlgorithmIndexes.CDATA) {
+                 throw new EncodingAlgorithmException(CommonResourceBundle.getInstance().getString("message.CDATAAlgorithmNotSupported"));
+             }
+-            
++
+             // Reserved built-in algorithms for future use
+             // TODO should use sax property to decide if event will be
+             // reported, allows for support through handler if required.
+             throw new EncodingAlgorithmException(CommonResourceBundle.getInstance().getString("message.identifiers10to31Reserved"));
+         }
+-        
++
+         final byte[] data = new byte[_octetBufferLength];
+         System.arraycopy(_octetBuffer, _octetBufferStart, data, 0, _octetBufferLength);
+         _attributes.addAttributeWithAlgorithmData(name, URI, _identifier, data);
++        if (addToTable) {
++            _attributeValueTable.add(_attributes.getValue(_attributes.getIndex(name.qName)));
++        }
+     }
+-    
++
+     protected final void convertEncodingAlgorithmDataToCharacters() throws FastInfosetException, IOException {
+         StringBuffer buffer = new StringBuffer();
+         if (_algorithmId == EncodingAlgorithmIndexes.BASE64) {
+             convertBase64AlorithmDataToCharacters(buffer);
+         } else if (_algorithmId < EncodingConstants.ENCODING_ALGORITHM_BUILTIN_END) {
+-            Object array = BuiltInEncodingAlgorithmFactory.table[_algorithmId].
++            Object array = BuiltInEncodingAlgorithmFactory.getAlgorithm(_algorithmId).
+                     decodeFromBytes(_algorithmData, _algorithmDataOffset, _algorithmDataLength);
+-            BuiltInEncodingAlgorithmFactory.table[_algorithmId].convertToCharacters(array,  buffer);
++            BuiltInEncodingAlgorithmFactory.getAlgorithm(_algorithmId).convertToCharacters(array,  buffer);
+         } else if (_algorithmId == EncodingAlgorithmIndexes.CDATA) {
+             _octetBufferOffset -= _octetBufferLength;
+             decodeUtf8StringIntoCharBuffer();
+-            
++
+             _characters = _charBuffer;
+             _charactersOffset = 0;
+             return;
+@@ -1663,13 +1669,13 @@
+                         CommonResourceBundle.getInstance().getString("message.algorithmDataCannotBeReported"));
+             }
+         }
+-        
++
+         _characters = new char[buffer.length()];
+         buffer.getChars(0, buffer.length(), _characters, 0);
+         _charactersOffset = 0;
+         _charBufferLength = _characters.length;
+     }
+-    
++
+     /* If base64 data comes is chunks, bytes, which were cut to align 3,
+      * from prev. base64 chunk are stored in this buffer */
+     private byte[] base64TaleBytes = new byte[3];
+@@ -1682,7 +1688,7 @@
+     protected void convertBase64AlorithmDataToCharacters(StringBuffer buffer) throws EncodingAlgorithmException, IOException {
+         // How much new came data was serialized with prev. tale
+         int afterTaleOffset = 0;
+-        
++
+         if (base64TaleLength > 0) {
+             // Serialize tale left from prev. chunk
+             int bytesToCopy = Math.min(3 - base64TaleLength, _algorithmDataLength);
+@@ -1698,13 +1704,13 @@
+                 base64TaleLength += bytesToCopy;
+                 return;
+             }
+-            
++
+             afterTaleOffset = bytesToCopy;
+             base64TaleLength = 0;
+         }
+-        
++
+         int taleBytesRemaining = isBase64Follows() ? (_algorithmDataLength - afterTaleOffset) % 3 : 0;
+-        
++
+         if (_isAlgorithmDataCloned) {
+             base64DecodeWithoutCloning(buffer, _algorithmData, _algorithmDataOffset + afterTaleOffset,
+                     _algorithmDataLength - afterTaleOffset - taleBytesRemaining);
+@@ -1712,7 +1718,7 @@
+             base64DecodeWithCloning(buffer, _algorithmData, _algorithmDataOffset + afterTaleOffset,
+                     _algorithmDataLength - afterTaleOffset - taleBytesRemaining);
+         }
+-        
++
+         if (taleBytesRemaining > 0) {
+             System.arraycopy(_algorithmData, _algorithmDataOffset + _algorithmDataLength - taleBytesRemaining,
+                     base64TaleBytes, 0, taleBytesRemaining);
+@@ -1719,7 +1725,7 @@
+             base64TaleLength = taleBytesRemaining;
+         }
+     }
+-    
++
+     /*
+      * Encodes incoming data to Base64 string.
+      * Method performs additional input data cloning
+@@ -1729,7 +1735,7 @@
+                 decodeFromBytes(data, offset, length);
+         BuiltInEncodingAlgorithmFactory.base64EncodingAlgorithm.convertToCharacters(array, dstBuffer);
+     }
+-    
++
+     /*
+      * Encodes incoming data to Base64 string.
+      * Avoids input data cloning
+@@ -1737,8 +1743,8 @@
+     private void base64DecodeWithoutCloning(StringBuffer dstBuffer, byte[] data, int offset, int length) throws EncodingAlgorithmException {
+         BuiltInEncodingAlgorithmFactory.base64EncodingAlgorithm.convertToCharacters(data, offset, length, dstBuffer);
+     }
+-    
+-    
++
++
+     /*
+      * Looks ahead in InputStream, whether next data is Base64 chunk
+      */
+@@ -1745,52 +1751,52 @@
+     public boolean isBase64Follows() throws IOException {
+         // Process information item
+         int b = peek(this);
+-        switch (DecoderStateTables.EII[b]) {
++        switch (DecoderStateTables.EII(b)) {
+             case DecoderStateTables.CII_EA:
+                 int algorithmId = (b & 0x02) << 6;
+                 int b2 = peek2(this);
+                 algorithmId |= (b2 & 0xFC) >> 2;
+-                
++
+                 return algorithmId == EncodingAlgorithmIndexes.BASE64;
+             default:
+                 return false;
+         }
+     }
+-    
++
+     protected class NamespaceContextImpl implements NamespaceContext {
+         public final String getNamespaceURI(String prefix) {
+             return _prefixTable.getNamespaceFromPrefix(prefix);
+         }
+-        
++
+         public final String getPrefix(String namespaceURI) {
+             return _prefixTable.getPrefixFromNamespace(namespaceURI);
+         }
+-        
++
+         public final Iterator getPrefixes(String namespaceURI) {
+             return _prefixTable.getPrefixesFromNamespace(namespaceURI);
+         }
+     }
+-    
++
+     public final String getNamespaceDecl(String prefix) {
+         return _prefixTable.getNamespaceFromPrefix(prefix);
+     }
+-    
++
+     public final String getURI(String prefix) {
+         return getNamespaceDecl(prefix);
+     }
+-    
++
+     public final Iterator getPrefixes() {
+         return _prefixTable.getPrefixes();
+     }
+-    
++
+     public final AttributesHolder getAttributesHolder() {
+         return _attributes;
+     }
+-    
++
+     public final void setManager(StAXManager manager) {
+         _manager = manager;
+     }
+-    
++
+     final static String getEventTypeString(int eventType) {
+         switch (eventType){
+             case START_ELEMENT:
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/stax/StAXDocumentSerializer.java	Thu Jul 30 18:01:59 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/StAXDocumentSerializer.java	Thu Jul 30 18:01:58 2009
+@@ -45,28 +45,28 @@
+ /**
+  * The Fast Infoset StAX serializer.
+  * <p>
+- * Instantiate this serializer to serialize a fast infoset document in accordance 
++ * Instantiate this serializer to serialize a fast infoset document in accordance
+  * with the StAX API.
+- * 
++ *
+  * <p>
+- * More than one fast infoset document may be encoded to the 
++ * More than one fast infoset document may be encoded to the
+  * {@link java.io.OutputStream}.
+  */
+-public class StAXDocumentSerializer extends Encoder 
++public class StAXDocumentSerializer extends Encoder
+         implements XMLStreamWriter, LowLevelFastInfosetStreamWriter {
+     protected StAXManager _manager;
+-    
++
+     protected String _encoding;
+     /**
+      * Local name of current element.
+      */
+     protected String _currentLocalName;
+-    
++
+     /**
+      * Namespace of current element.
+      */
+     protected String _currentUri;
+-    
++
+     /**
+      * Prefix of current element.
+      */
+@@ -76,7 +76,7 @@
+      * This flag indicates when there is a pending start element event.
+      */
+     protected boolean _inStartElement = false;
+-    
++
+     /**
+      * This flag indicates if the current element is empty.
+      */
+@@ -87,14 +87,14 @@
+      */
+     protected String[] _attributesArray = new String[4 * 16];
+     protected int _attributesArrayIndex = 0;
+-    
++
+     protected boolean[] _nsSupportContextStack = new boolean[32];
+-    protected int _stackCount = -1;    
+-    
++    protected int _stackCount = -1;
++
+     /**
+      * Mapping between uris and prefixes.
+      */
+-    protected NamespaceContextImplementation _nsContext = 
++    protected NamespaceContextImplementation _nsContext =
+             new NamespaceContextImplementation();
+ 
+     /**
+@@ -102,12 +102,12 @@
+      */
+     protected String[] _namespacesArray = new String[2 * 8];
+     protected int _namespacesArrayIndex = 0;
+-    
++
+     public StAXDocumentSerializer() {
+         super(true);
+         _manager = new StAXManager(StAXManager.CONTEXT_WRITER);
+     }
+-    
++
+     public StAXDocumentSerializer(OutputStream outputStream) {
+         super(true);
+         setOutputStream(outputStream);
+@@ -119,37 +119,37 @@
+         setOutputStream(outputStream);
+         _manager = manager;
+     }
+-    
++
+     public void reset() {
+         super.reset();
+-        
++
+         _attributesArrayIndex = 0;
+         _namespacesArrayIndex = 0;
+-        
++
+         _nsContext.reset();
+         _stackCount = -1;
+-                
++
+         _currentUri = _currentPrefix = null;
+         _currentLocalName = null;
+-        
++
+         _inStartElement = _isEmptyElement = false;
+     }
+-    
++
+     // -- XMLStreamWriter Interface -------------------------------------------
+-            
++
+     public void writeStartDocument() throws XMLStreamException {
+         writeStartDocument("finf", "1.0");
+     }
+-    
++
+     public void writeStartDocument(String version) throws XMLStreamException {
+         writeStartDocument("finf", version);
+     }
+-    
++
+     public void writeStartDocument(String encoding, String version)
+         throws XMLStreamException
+     {
+         reset();
+-        
++
+         try {
+             encodeHeader(false);
+             encodeInitialVocabulary();
+@@ -157,10 +157,10 @@
+             throw new XMLStreamException(e);
+         }
+     }
+-    
++
+     public void writeEndDocument() throws XMLStreamException {
+         try {
+-            
++
+             // terminate all elements not terminated
+             // by writeEndElement
+             for(;_stackCount >= 0; _stackCount--) {
+@@ -168,16 +168,16 @@
+             }
+ 
+             encodeDocumentTermination();
+-        } 
++        }
+         catch (IOException e) {
+             throw new XMLStreamException(e);
+         }
+     }
+-    
++
+     public void close() throws XMLStreamException {
+         reset();
+     }
+-    
++
+     public void flush() throws XMLStreamException {
+         try {
+             _s.flush();
+@@ -186,7 +186,7 @@
+             throw new XMLStreamException(e);
+         }
+     }
+-    
++
+     public void writeStartElement(String localName)
+         throws XMLStreamException
+     {
+@@ -193,18 +193,18 @@
+         // TODO is it necessary for FI to obtain the default namespace in scope?
+         writeStartElement("", localName, "");
+     }
+-    
++
+     public void writeStartElement(String namespaceURI, String localName)
+         throws XMLStreamException
+     {
+-        writeStartElement(getPrefix(namespaceURI), localName, namespaceURI);
++        writeStartElement("", localName, namespaceURI);
+     }
+-    
++
+     public void writeStartElement(String prefix, String localName,
+         String namespaceURI) throws XMLStreamException
+     {
+         encodeTerminationAndCurrentElement(false);
+-              
++
+         _inStartElement = true;
+         _isEmptyElement = false;
+ 
+@@ -218,33 +218,33 @@
+             System.arraycopy(_nsSupportContextStack, 0, nsSupportContextStack, 0, _nsSupportContextStack.length);
+             _nsSupportContextStack = nsSupportContextStack;
+         }
+-        
++
+         _nsSupportContextStack[_stackCount] = false;
+     }
+-    
++
+     public void writeEmptyElement(String localName)
+         throws XMLStreamException
+     {
+         writeEmptyElement("", localName, "");
+     }
+-    
++
+     public void writeEmptyElement(String namespaceURI, String localName)
+         throws XMLStreamException
+     {
+-        writeEmptyElement(getPrefix(namespaceURI), localName, namespaceURI);
++        writeEmptyElement("", localName, namespaceURI);
+     }
+-    
+-    public void writeEmptyElement(String prefix, String localName, 
++
++    public void writeEmptyElement(String prefix, String localName,
+         String namespaceURI) throws XMLStreamException
+     {
+         encodeTerminationAndCurrentElement(false);
+-        
++
+         _isEmptyElement = _inStartElement = true;
+-        
++
+         _currentLocalName = localName;
+         _currentPrefix = prefix;
+         _currentUri = namespaceURI;
+-        
++
+         _stackCount++;
+         if (_stackCount == _nsSupportContextStack.length) {
+             boolean[] nsSupportContextStack = new boolean[_stackCount * 2];
+@@ -251,16 +251,16 @@
+             System.arraycopy(_nsSupportContextStack, 0, nsSupportContextStack, 0, _nsSupportContextStack.length);
+             _nsSupportContextStack = nsSupportContextStack;
+         }
+-        
++
+         _nsSupportContextStack[_stackCount] = false;
+     }
+-        
++
+     public void writeEndElement() throws XMLStreamException {
+         if (_inStartElement) {
+             encodeTerminationAndCurrentElement(false);
+         }
+-            
+-        try {            
++
++        try {
+             encodeElementTermination();
+             if (_nsSupportContextStack[_stackCount--] == true) {
+                 _nsContext.popContext();
+@@ -274,20 +274,20 @@
+         }
+     }
+ 
+-    
++
+     public void writeAttribute(String localName, String value)
+         throws XMLStreamException
+     {
+         writeAttribute("", "", localName, value);
+     }
+-    
++
+     public void writeAttribute(String namespaceURI, String localName,
+         String value) throws XMLStreamException
+     {
+         String prefix = "";
+-        
++
+         // Find prefix for attribute, ignoring default namespace
+-        if (namespaceURI.length() > 0) {            
++        if (namespaceURI.length() > 0) {
+             prefix = _nsContext.getNonDefaultPrefix(namespaceURI);
+ 
+             // Undeclared prefix or ignorable default ns?
+@@ -294,11 +294,11 @@
+             if (prefix == null || prefix.length() == 0) {
+                 // Workaround for BUG in SAX NamespaceSupport helper
+                 // which incorrectly defines namespace declaration URI
+-                if (namespaceURI == EncodingConstants.XMLNS_NAMESPACE_NAME || 
++                if (namespaceURI == EncodingConstants.XMLNS_NAMESPACE_NAME ||
+                         namespaceURI.equals(EncodingConstants.XMLNS_NAMESPACE_NAME)) {
+                     // TODO
+                     // Need to check carefully the rule for the writing of
+-                    // namespaces in StAX. Is it safe to ignore such 
++                    // namespaces in StAX. Is it safe to ignore such
+                     // attributes, as declarations will be made using the
+                     // writeNamespace method
+                     return;
+@@ -308,7 +308,7 @@
+         }
+         writeAttribute(prefix, namespaceURI, localName, value);
+     }
+-        
++
+     public void writeAttribute(String prefix, String namespaceURI,
+         String localName, String value) throws XMLStreamException
+     {
+@@ -318,10 +318,10 @@
+ 
+         // TODO
+         // Need to check carefully the rule for the writing of
+-        // namespaces in StAX. Is it safe to ignore such 
++        // namespaces in StAX. Is it safe to ignore such
+         // attributes, as declarations will be made using the
+         // writeNamespace method
+-        if (namespaceURI == EncodingConstants.XMLNS_NAMESPACE_NAME || 
++        if (namespaceURI == EncodingConstants.XMLNS_NAMESPACE_NAME ||
+                 namespaceURI.equals(EncodingConstants.XMLNS_NAMESPACE_NAME)) {
+             return;
+         }
+@@ -331,13 +331,13 @@
+             System.arraycopy(_attributesArray, 0, attributesArray, 0, _attributesArrayIndex);
+             _attributesArray = attributesArray;
+         }
+-        
++
+         _attributesArray[_attributesArrayIndex++] = namespaceURI;
+         _attributesArray[_attributesArrayIndex++] = prefix;
+         _attributesArray[_attributesArrayIndex++] = localName;
+         _attributesArray[_attributesArrayIndex++] = value;
+     }
+-    
++
+     public void writeNamespace(String prefix, String namespaceURI)
+         throws XMLStreamException
+     {
+@@ -348,19 +348,19 @@
+             if (!_inStartElement) {
+                 throw new IllegalStateException(CommonResourceBundle.getInstance().getString("message.attributeWritingNotAllowed"));
+             }
+-            
++
+             if (_namespacesArrayIndex == _namespacesArray.length) {
+                 final String[] namespacesArray = new String[_namespacesArrayIndex * 2];
+                 System.arraycopy(_namespacesArray, 0, namespacesArray, 0, _namespacesArrayIndex);
+                 _namespacesArray = namespacesArray;
+             }
+-            
++
+             _namespacesArray[_namespacesArrayIndex++] = prefix;
+             _namespacesArray[_namespacesArrayIndex++] = namespaceURI;
+             setPrefix(prefix, namespaceURI);
+         }
+     }
+-    
++
+     public void writeDefaultNamespace(String namespaceURI)
+         throws XMLStreamException
+     {
+@@ -367,7 +367,7 @@
+         if (!_inStartElement) {
+             throw new IllegalStateException(CommonResourceBundle.getInstance().getString("message.attributeWritingNotAllowed"));
+         }
+-        
++
+         if (_namespacesArrayIndex == _namespacesArray.length) {
+             final String[] namespacesArray = new String[_namespacesArrayIndex * 2];
+             System.arraycopy(_namespacesArray, 0, namespacesArray, 0, _namespacesArrayIndex);
+@@ -378,11 +378,11 @@
+         _namespacesArray[_namespacesArrayIndex++] = namespaceURI;
+         setPrefix("", namespaceURI);
+     }
+-    
++
+     public void writeComment(String data) throws XMLStreamException {
+         try {
+             if (getIgnoreComments()) return;
+-            
++
+             encodeTerminationAndCurrentElement(true);
+ 
+             // TODO: avoid array copy here
+@@ -392,19 +392,19 @@
+             throw new XMLStreamException(e);
+         }
+     }
+-    
++
+     public void writeProcessingInstruction(String target)
+         throws XMLStreamException
+     {
+         writeProcessingInstruction(target, "");
+     }
+-    
++
+     public void writeProcessingInstruction(String target, String data)
+         throws XMLStreamException
+     {
+         try {
+             if (getIgnoreProcesingInstructions()) return;
+-            
++
+             encodeTerminationAndCurrentElement(true);
+ 
+             encodeProcessingInstruction(target, data);
+@@ -413,19 +413,19 @@
+             throw new XMLStreamException(e);
+         }
+     }
+-    
++
+     public void writeCData(String data) throws XMLStreamException {
+         throw new UnsupportedOperationException(CommonResourceBundle.getInstance().getString("message.notImplemented"));
+    }
+-    
++
+     public void writeDTD(String dtd) throws XMLStreamException {
+         throw new UnsupportedOperationException(CommonResourceBundle.getInstance().getString("message.notImplemented"));
+     }
+-    
++
+     public void writeEntityRef(String name) throws XMLStreamException {
+         throw new UnsupportedOperationException(CommonResourceBundle.getInstance().getString("message.notImplemented"));
+     }
+-        
++
+     public void writeCharacters(String text) throws XMLStreamException {
+          try {
+             final int length = text.length();
+@@ -432,24 +432,24 @@
+             if (length == 0) {
+                 return;
+             } else if (length < _charBuffer.length) {
+-                if (getIgnoreWhiteSpaceTextContent() && 
++                if (getIgnoreWhiteSpaceTextContent() &&
+                         isWhiteSpace(text)) return;
+-                
++
+                 // Warning: this method must be called before any state
+                 // is modified, such as the _charBuffer contents,
+                 // so the characters of text cannot be copied to _charBuffer
+                 // before this call
+                 encodeTerminationAndCurrentElement(true);
+-                
++
+                 text.getChars(0, length, _charBuffer, 0);
+                 encodeCharacters(_charBuffer, 0, length);
+             } else {
+                 final char ch[] = text.toCharArray();
+-                if (getIgnoreWhiteSpaceTextContent() && 
++                if (getIgnoreWhiteSpaceTextContent() &&
+                         isWhiteSpace(ch, 0, length)) return;
+-                
++
+                 encodeTerminationAndCurrentElement(true);
+-                
++
+                 encodeCharactersNoClone(ch, 0, length);
+             }
+         }
+@@ -457,7 +457,7 @@
+             throw new XMLStreamException(e);
+         }
+     }
+-    
++
+     public void writeCharacters(char[] text, int start, int len)
+         throws XMLStreamException
+     {
+@@ -466,9 +466,9 @@
+                 return;
+             }
+ 
+-            if (getIgnoreWhiteSpaceTextContent() && 
++            if (getIgnoreWhiteSpaceTextContent() &&
+                     isWhiteSpace(text, start, len)) return;
+-            
++
+             encodeTerminationAndCurrentElement(true);
+ 
+             encodeCharacters(text, start, len);
+@@ -481,22 +481,22 @@
+     public String getPrefix(String uri) throws XMLStreamException {
+         return _nsContext.getPrefix(uri);
+     }
+-    
+-    public void setPrefix(String prefix, String uri) 
+-        throws XMLStreamException 
++
++    public void setPrefix(String prefix, String uri)
++        throws XMLStreamException
+     {
+         if (_stackCount > -1 && _nsSupportContextStack[_stackCount] == false) {
+             _nsSupportContextStack[_stackCount] = true;
+             _nsContext.pushContext();
+         }
+-        
++
+         _nsContext.declarePrefix(prefix, uri);
+     }
+-    
++
+     public void setDefaultNamespace(String uri) throws XMLStreamException {
+         setPrefix("", uri);
+     }
+-    
++
+     /**
+      * Sets the current namespace context for prefix and uri bindings.
+      * This context becomes the root namespace context for writing and
+@@ -512,17 +512,17 @@
+      * @throws XMLStreamException
+      */
+     public void setNamespaceContext(NamespaceContext context)
+-        throws XMLStreamException 
+-    {           
++        throws XMLStreamException
++    {
+         throw new UnsupportedOperationException("setNamespaceContext");
+     }
+-    
++
+     public NamespaceContext getNamespaceContext() {
+         return _nsContext;
+     }
+-    
+-    public Object getProperty(java.lang.String name) 
+-        throws IllegalArgumentException 
++
++    public Object getProperty(java.lang.String name)
++        throws IllegalArgumentException
+     {
+         if (_manager != null) {
+             return _manager.getProperty(name);
+@@ -533,12 +533,12 @@
+     public void setManager(StAXManager manager) {
+         _manager = manager;
+     }
+-    
++
+     public void setEncoding(String encoding) {
+         _encoding = encoding;
+     }
+-    
+ 
++
+     public void writeOctets(byte[] b, int start, int len)
+         throws XMLStreamException
+     {
+@@ -555,11 +555,11 @@
+             throw new XMLStreamException(e);
+         }
+     }
+-    
++
+     protected void encodeTerminationAndCurrentElement(boolean terminateAfter) throws XMLStreamException {
+         try {
+             encodeTermination();
+-            
++
+             if (_inStartElement) {
+ 
+                 _b = EncodingConstants.ELEMENT;
+@@ -574,7 +574,7 @@
+                         encodeNamespaceAttribute(_namespacesArray[i++], _namespacesArray[i++]);
+                     }
+                     _namespacesArrayIndex = 0;
+-                    
++
+                     write(EncodingConstants.TERMINATOR);
+ 
+                     _b = 0;
+@@ -581,12 +581,19 @@
+                 }
+ 
+                 // If element's prefix is empty - apply default scope namespace
+-                if (_currentPrefix.length() == 0 && _currentUri.length() == 0) {
+-                    _currentUri = _nsContext.getNamespaceURI("");
++                if (_currentPrefix.length() == 0) {
++                    if (_currentUri.length() == 0) {
++                        _currentUri = _nsContext.getNamespaceURI("");
++                    } else {
++                        String tmpPrefix = getPrefix(_currentUri);
++                        if (tmpPrefix != null) {
++                            _currentPrefix = tmpPrefix;
++                        }
++                    }
+                 }
+-                
++
+                 encodeElementQualifiedNameOnThirdBit(_currentUri, _currentPrefix, _currentLocalName);
+-                
++
+                 for (int i = 0; i < _attributesArrayIndex;) {
+                     encodeAttributeQualifiedNameOnSecondBit(
+                             _attributesArray[i++], _attributesArray[i++], _attributesArray[i++]);
+@@ -594,8 +601,8 @@
+                     final String value = _attributesArray[i];
+                     _attributesArray[i++] = null;
+                     final boolean addToTable = isAttributeValueLengthMatchesLimit(value.length());
+-                    encodeNonIdentifyingStringOnFirstBit(value, _v.attributeValue, addToTable);
+-                    
++                    encodeNonIdentifyingStringOnFirstBit(value, _v.attributeValue, addToTable, false);
++
+                     _b = EncodingConstants.TERMINATOR;
+                     _terminate = true;
+                 }
+@@ -607,10 +614,10 @@
+                     if (_nsSupportContextStack[_stackCount--] == true) {
+                         _nsContext.popContext();
+                     }
+-                    
++
+                     _isEmptyElement = false;
+                 }
+-                
++
+                 if (terminateAfter) {
+                     encodeTermination();
+                 }
+@@ -620,13 +627,13 @@
+         }
+     }
+ 
+-    
++
+     // LowLevelFastInfosetSerializer
+-    
++
+     public final void initiateLowLevelWriting() throws XMLStreamException {
+         encodeTerminationAndCurrentElement(false);
+     }
+-        
++
+     public final int getNextElementIndex() {
+         return _v.elementName.getNextIndex();
+     }
+@@ -634,11 +641,11 @@
+     public final int getNextAttributeIndex() {
+         return _v.attributeName.getNextIndex();
+     }
+-    
++
+     public final int getLocalNameIndex() {
+         return _v.localName.getIndex();
+     }
+-    
++
+     public final int getNextLocalNameIndex() {
+         return _v.localName.getNextIndex();
+     }
+@@ -652,31 +659,31 @@
+         _b = type;
+         encodeNonZeroIntegerOnThirdBit(index);
+     }
+-    
++
+     public final boolean writeLowLevelStartElement(int type, String prefix, String localName,
+             String namespaceURI) throws IOException {
+         final boolean isIndexed = encodeElement(type, namespaceURI, prefix, localName);
+-        
++
+         if (!isIndexed)
+             encodeLiteral(type | EncodingConstants.ELEMENT_LITERAL_QNAME_FLAG,
+                     namespaceURI, prefix, localName);
+-        
++
+         return isIndexed;
+     }
+-                
++
+     public final void writeLowLevelStartNamespaces() throws IOException {
+         write(EncodingConstants.ELEMENT | EncodingConstants.ELEMENT_NAMESPACES_FLAG);
+     }
+-    
+-    public final void writeLowLevelNamespace(String prefix, String namespaceName) 
++
++    public final void writeLowLevelNamespace(String prefix, String namespaceName)
+         throws IOException {
+         encodeNamespaceAttribute(prefix, namespaceName);
+     }
+-    
++
+     public final void writeLowLevelEndNamespaces() throws IOException {
+         write(EncodingConstants.TERMINATOR);
+     }
+-    
++
+     public final void writeLowLevelStartAttributes() throws IOException {
+         if (hasMark()) {
+             _octetBuffer[_markIndex] |= EncodingConstants.ELEMENT_ATTRIBUTE_FLAG;
+@@ -683,40 +690,40 @@
+             resetMark();
+         }
+     }
+-        
++
+     public final void writeLowLevelAttributeIndexed(int index) throws IOException {
+         encodeNonZeroIntegerOnSecondBitFirstBitZero(index);
+     }
+-    
++
+     public final boolean writeLowLevelAttribute(String prefix, String namespaceURI, String localName) throws IOException {
+         final boolean isIndexed = encodeAttribute(namespaceURI, prefix, localName);
+ 
+         if (!isIndexed)
+-            encodeLiteral(EncodingConstants.ATTRIBUTE_LITERAL_QNAME_FLAG, 
++            encodeLiteral(EncodingConstants.ATTRIBUTE_LITERAL_QNAME_FLAG,
+                     namespaceURI, prefix, localName);
+-        
++
+         return isIndexed;
+     }
+-                
++
+     public final void writeLowLevelAttributeValue(String value) throws IOException
+     {
+         final boolean addToTable = isAttributeValueLengthMatchesLimit(value.length());
+-        encodeNonIdentifyingStringOnFirstBit(value, _v.attributeValue, addToTable);
++        encodeNonIdentifyingStringOnFirstBit(value, _v.attributeValue, addToTable, false);
+     }
+-    
+-    public final void writeLowLevelStartNameLiteral(int type, String prefix, byte[] utf8LocalName, 
++
++    public final void writeLowLevelStartNameLiteral(int type, String prefix, byte[] utf8LocalName,
+             String namespaceURI) throws IOException {
+         encodeLiteralHeader(type, namespaceURI, prefix);
+         encodeNonZeroOctetStringLengthOnSecondBit(utf8LocalName.length);
+         write(utf8LocalName, 0, utf8LocalName.length);
+     }
+-    
+-    public final void writeLowLevelStartNameLiteral(int type, String prefix, int localNameIndex, 
++
++    public final void writeLowLevelStartNameLiteral(int type, String prefix, int localNameIndex,
+             String namespaceURI) throws IOException {
+         encodeLiteralHeader(type, namespaceURI, prefix);
+         encodeNonZeroIntegerOnSecondBitFirstBitOne(localNameIndex);
+     }
+-     
++
+     public final void writeLowLevelEndStartElement() throws IOException {
+         if (hasMark()) {
+             resetMark();
+@@ -726,27 +733,27 @@
+             _terminate = true;
+         }
+     }
+-    
++
+     public final void writeLowLevelEndElement() throws IOException {
+         encodeElementTermination();
+     }
+-    
++
+     public final void writeLowLevelText(char[] text, int length) throws IOException {
+         if (length == 0)
+             return;
+-        
++
+         encodeTermination();
+-        
++
+         encodeCharacters(text, 0, length);
+     }
+-    
++
+     public final void writeLowLevelText(String text) throws IOException {
+         final int length = text.length();
+         if (length == 0)
+             return;
+-        
++
+         encodeTermination();
+-        
++
+         if (length < _charBuffer.length) {
+             text.getChars(0, length, _charBuffer, 0);
+             encodeCharacters(_charBuffer, 0, length);
+@@ -755,13 +762,13 @@
+             encodeCharactersNoClone(ch, 0, length);
+         }
+     }
+-    
++
+     public final void writeLowLevelOctets(byte[] octets, int length) throws IOException {
+         if (length == 0)
+             return;
+-        
++
+         encodeTermination();
+-        
++
+         encodeCIIOctetAlgorithmData(EncodingAlgorithmIndexes.BASE64, octets, 0, length);
+     }
+ 
+@@ -780,7 +787,7 @@
+         entry.addQualifiedName(new QualifiedName(prefix, namespaceURI, localName, "", _v.elementName.getNextIndex()));
+         return false;
+     }
+-        
++
+     private boolean encodeAttribute(String namespaceURI, String prefix, String localName) throws IOException {
+         final LocalNameQualifiedNamesMap.Entry entry = _v.attributeName.obtainEntry(localName);
+         for (int i = 0; i < entry._valueIndex; i++) {
+@@ -801,7 +808,7 @@
+             type |= EncodingConstants.LITERAL_QNAME_NAMESPACE_NAME_FLAG;
+             if (prefix != "")
+                 type |= EncodingConstants.LITERAL_QNAME_PREFIX_FLAG;
+-                        
++
+             write(type);
+             if (prefix != "")
+                 encodeNonZeroIntegerOnSecondBitFirstBitOne(_v.prefix.get(prefix));
+@@ -809,14 +816,14 @@
+         } else
+             write(type);
+     }
+-        
++
+     private void encodeLiteral(int type, String namespaceURI, String prefix, String localName) throws IOException {
+         encodeLiteralHeader(type, namespaceURI, prefix);
+-        
++
+         final int localNameIndex = _v.localName.obtainIndex(localName);
+         if (localNameIndex == -1) {
+             encodeNonEmptyOctetStringOnSecondBit(localName);
+         } else
+             encodeNonZeroIntegerOnSecondBitFirstBitOne(localNameIndex);
+-    }    
++    }
+ }
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/stax/StAXManager.java	Thu Jul 30 18:02:03 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/StAXManager.java	Thu Jul 30 18:02:02 2009
+@@ -24,8 +24,8 @@
+  *
+  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
+  */
+- 
+ 
++
+ package com.sun.xml.internal.fastinfoset.stax;
+ 
+ import java.util.HashMap;
+@@ -36,17 +36,17 @@
+ public class StAXManager {
+     protected static final String STAX_NOTATIONS = "javax.xml.stream.notations";
+     protected static final String STAX_ENTITIES = "javax.xml.stream.entities";
+-    
++
+     HashMap features = new HashMap();
+-    
++
+     public static final int CONTEXT_READER = 1;
+     public static final int CONTEXT_WRITER = 2;
+-    
+-    
++
++
+     /** Creates a new instance of StAXManager */
+     public StAXManager() {
+     }
+-    
++
+     public StAXManager(int context) {
+         switch(context){
+             case CONTEXT_READER:{
+@@ -59,17 +59,17 @@
+             }
+         }
+     }
+-    
++
+     public StAXManager(StAXManager manager){
+-        
++
+         HashMap properties = manager.getProperties();
+         features.putAll(properties);
+     }
+-    
++
+     private HashMap getProperties(){
+         return features ;
+     }
+-    
++
+     private void initConfigurableReaderProperties(){
+         //spec v1.0 default values
+         features.put(XMLInputFactory.IS_NAMESPACE_AWARE, Boolean.TRUE);
+@@ -83,11 +83,11 @@
+         features.put(XMLInputFactory.ALLOCATOR, null);
+         features.put(STAX_NOTATIONS,null );
+     }
+-    
++
+     private void initWriterProps(){
+         features.put(XMLOutputFactory.IS_REPAIRING_NAMESPACES , Boolean.FALSE);
+     }
+-    
++
+     /**
+      * public void reset(){
+      * features.clear() ;
+@@ -96,12 +96,12 @@
+     public boolean containsProperty(String property){
+         return features.containsKey(property) ;
+     }
+-    
++
+     public Object getProperty(String name){
+         checkProperty(name);
+         return features.get(name);
+     }
+-    
++
+     public void setProperty(String name, Object value){
+         checkProperty(name);
+         if (name.equals(XMLInputFactory.IS_VALIDATING) &&
+@@ -116,7 +116,7 @@
+         features.put(name,value);
+ 
+     }
+-    
++
+     public void checkProperty(String name) {
+         if (!features.containsKey(name))
+             throw new IllegalArgumentException(CommonResourceBundle.getInstance().getString("message.propertyNotSupported", new Object[]{name}));
+@@ -125,5 +125,5 @@
+     public String toString(){
+         return features.toString();
+     }
+-        
++
+ }
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/AttributeBase.java	Thu Jul 30 18:02:06 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/AttributeBase.java	Thu Jul 30 18:02:06 2009
+@@ -24,8 +24,8 @@
+  *
+  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
+  */
+- 
+ 
++
+ package com.sun.xml.internal.fastinfoset.stax.events;
+ 
+ import javax.xml.namespace.QName;
+@@ -40,12 +40,12 @@
+     //an Attribute consists of a qualified name and value
+     private QName _QName;
+     private String _value;
+-    
++
+     private String _attributeType = null;
+     //A flag indicating whether this attribute was actually specified in the start-tag
+     //of its element or was defaulted from the schema.
+     private boolean _specified = false;
+-    
++
+     public AttributeBase(){
+         super(ATTRIBUTE);
+     }
+@@ -72,12 +72,12 @@
+         _value = value;
+         _attributeType = (attributeType == null) ? "CDATA":attributeType;
+     }
+-    
+ 
++
+     public void setName(QName name){
+         _QName = name ;
+     }
+-    
++
+   /**
+    * Returns the QName for this attribute
+    */
+@@ -84,11 +84,11 @@
+     public QName getName() {
+         return _QName;
+     }
+-    
++
+     public void setValue(String value){
+         _value = value;
+     }
+-    
++
+     public String getLocalName() {
+         return _QName.getLocalPart();
+     }
+@@ -98,13 +98,13 @@
+     public String getValue() {
+         return _value;
+     }
+-    
++
+     public void setAttributeType(String attributeType){
+         _attributeType = attributeType ;
+     }
+ 
+     /**
+-   * Gets the type of this attribute, default is 
++   * Gets the type of this attribute, default is
+    * the String "CDATA"
+    * @return the type as a String, default is "CDATA"
+    */
+@@ -111,11 +111,11 @@
+     public String getDTDType() {
+         return _attributeType;
+     }
+-    
+-    
++
++
+   /**
+-   * A flag indicating whether this attribute was actually 
+-   * specified in the start-tag of its element, or was defaulted from the schema. 
++   * A flag indicating whether this attribute was actually
++   * specified in the start-tag of its element, or was defaulted from the schema.
+    * @return returns true if this was specified in the start element
+    */
+     public boolean isSpecified() {
+@@ -125,16 +125,15 @@
+     public void setSpecified(boolean isSpecified){
+         _specified = isSpecified ;
+     }
+-   
+-    
++
++
+     public String toString() {
+         String prefix = _QName.getPrefix();
+         if (!Util.isEmptyString(prefix))
+             return prefix + ":" + _QName.getLocalPart() + "='" + _value + "'";
+-        
++
+         return _QName.getLocalPart() + "='" + _value + "'";
+     }
+-    
+-    
+-}
+ 
++
++}
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/CharactersEvent.java	Thu Jul 30 18:02:10 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/CharactersEvent.java	Thu Jul 30 18:02:09 2009
+@@ -24,9 +24,9 @@
+  *
+  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
+  */
+- 
+ 
+ 
++
+ package com.sun.xml.internal.fastinfoset.stax.events ;
+ 
+ import com.sun.xml.internal.fastinfoset.org.apache.xerces.util.XMLChar;
+@@ -40,10 +40,10 @@
+     private boolean isSpace=false;
+     private boolean isIgnorable=false;
+     private boolean needtoCheck = true;
+-    
++
+     public CharactersEvent() {
+         super(CHARACTERS);
+-    }    
++    }
+     /**
+      *
+      * @param data Character Data.
+@@ -52,7 +52,7 @@
+         super(CHARACTERS);
+         _text = data;
+     }
+-    
++
+     /**
+      *
+      * @param data Character Data.
+@@ -63,7 +63,7 @@
+         _text = data;
+         this.isCData = isCData;
+     }
+-    
++
+   /**
+    * Get the character data of this event
+    */
+@@ -70,11 +70,11 @@
+    public String getData() {
+         return _text;
+     }
+-    
++
+     public void setData(String data){
+         _text = data;
+     }
+-    
++
+     /**
+      *
+      * @return boolean returns true if the data is CData
+@@ -82,7 +82,7 @@
+     public boolean isCData() {
+         return isCData;
+     }
+-    
++
+     /**
+      *
+      * @return String return the String representation of this event.
+@@ -93,7 +93,7 @@
+         else
+             return _text;
+     }
+-    
++
+     /**
+      * Return true if this is ignorableWhiteSpace.  If
+      * this event is ignorableWhiteSpace its event type will
+@@ -103,10 +103,10 @@
+     public boolean isIgnorableWhiteSpace() {
+         return isIgnorable;
+     }
+-    
++
+     /**
+      * Returns true if this set of Characters are all whitespace.  Whitspace inside a document
+-     * is reported as CHARACTERS.  This method allows checking of CHARACTERS events to see 
++     * is reported as CHARACTERS.  This method allows checking of CHARACTERS events to see
+      * if they are composed of only whitespace characters
+      * @return boolean true if this set of Characters are all whitespace
+      */
+@@ -118,7 +118,7 @@
+         }
+         return isSpace;
+     }
+-    
++
+     public void setSpace(boolean isSpace) {
+         this.isSpace = isSpace;
+         needtoCheck = false;
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/CommentEvent.java	Thu Jul 30 18:02:13 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/CommentEvent.java	Thu Jul 30 18:02:13 2009
+@@ -24,8 +24,8 @@
+  *
+  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
+  */
+- 
+ 
++
+ package com.sun.xml.internal.fastinfoset.stax.events ;
+ 
+ 
+@@ -32,20 +32,20 @@
+ import javax.xml.stream.events.Comment;
+ 
+ public class CommentEvent extends EventBase implements Comment {
+-    
++
+     /* String data for this event */
+     private String _text;
+-    
++
+     public CommentEvent() {
+         super(COMMENT);
+     }
+-    
++
+     public CommentEvent(String text) {
+         this();
+         _text = text;
+     }
+-    
+-    
++
++
+     /**
+      * @return String String representation of this event
+      */
+@@ -52,7 +52,7 @@
+     public String toString() {
+         return "<!--" + _text + "-->";
+     }
+-    
++
+   /**
+    * Return the string data of the comment, returns empty string if it
+    * does not exist
+@@ -60,7 +60,7 @@
+     public String getText() {
+         return _text ;
+     }
+-    
++
+     public void setText(String text) {
+         _text = text;
+     }
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/DTDEvent.java	Thu Jul 30 18:02:17 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/DTDEvent.java	Thu Jul 30 18:02:16 2009
+@@ -24,8 +24,8 @@
+  *
+  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
+  */
+- 
+ 
++
+ package com.sun.xml.internal.fastinfoset.stax.events;
+ 
+ import java.util.List;
+@@ -38,26 +38,26 @@
+  * DTDEvent. Notations and Entities are not used
+  */
+ public class DTDEvent extends EventBase implements DTD{
+-    
++
+     private String _dtd;
+     private List _notations;
+     private List _entities;
+-    
++
+     /** Creates a new instance of DTDEvent */
+     public DTDEvent() {
+         setEventType(DTD);
+     }
+-    
++
+     public DTDEvent(String dtd){
+         setEventType(DTD);
+         _dtd = dtd;
+     }
+-    
++
+    /**
+    * Returns the entire Document Type Declaration as a string, including
+    * the internal DTD subset.
+    * This may be null if there is not an internal subset.
+-   * If it is not null it must return the entire 
++   * If it is not null it must return the entire
+    * Document Type Declaration which matches the doctypedecl
+    * production in the XML 1.0 specification
+    */
+@@ -67,9 +67,9 @@
+    public void setDTD(String dtd){
+         _dtd = dtd;
+     }
+-   
++
+    /**
+-   * Return a List containing the general entities, 
++   * Return a List containing the general entities,
+    * both external and internal, declared in the DTD.
+    * This list must contain EntityDeclaration events.
+    * @see EntityDeclaration
+@@ -78,10 +78,10 @@
+     public List getEntities() {
+         return _entities;
+     }
+-        
++
+    /**
+    * Return a List containing the notations declared in the DTD.
+-   * This list must contain NotationDeclaration events. 
++   * This list must contain NotationDeclaration events.
+    * @see NotationDeclaration
+    * @return an unordered list of NotationDeclaration events
+    */
+@@ -88,7 +88,7 @@
+    public List getNotations() {
+         return _notations;
+     }
+-    
++
+     /**
+      *Returns an implementation defined representation of the DTD.
+      * This method may return null if no representation is available.
+@@ -101,11 +101,11 @@
+     public void setEntities(List entites){
+         _entities = entites;
+     }
+-        
++
+     public void setNotations(List notations){
+         _notations = notations;
+     }
+-    
++
+     public String toString(){
+         return _dtd ;
+     }
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/EmptyIterator.java	Thu Jul 30 18:02:20 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/EmptyIterator.java	Thu Jul 30 18:02:20 2009
+@@ -24,8 +24,8 @@
+  *
+  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
+  */
+- 
+ 
++
+ package com.sun.xml.internal.fastinfoset.stax.events;
+ import java.util.Iterator;
+ import com.sun.xml.internal.fastinfoset.CommonResourceBundle;
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/EndDocumentEvent.java	Thu Jul 30 18:02:24 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/EndDocumentEvent.java	Thu Jul 30 18:02:23 2009
+@@ -24,8 +24,8 @@
+  *
+  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
+  */
+- 
+ 
++
+ package com.sun.xml.internal.fastinfoset.stax.events ;
+ 
+ import javax.xml.stream.events.EndDocument;
+@@ -32,13 +32,13 @@
+ 
+ 
+ public class EndDocumentEvent extends EventBase implements EndDocument {
+-    
++
+     public EndDocumentEvent() {
+         super(END_DOCUMENT);
+     }
+-    
++
+     public String toString() {
+         return "<? EndDocument ?>";
+     }
+-    
++
+ }
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/EndElementEvent.java	Thu Jul 30 18:02:27 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/EndElementEvent.java	Thu Jul 30 18:02:27 2009
+@@ -24,8 +24,8 @@
+  *
+  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
+  */
+- 
+ 
++
+ package com.sun.xml.internal.fastinfoset.stax.events ;
+ 
+ import java.util.ArrayList;
+@@ -40,18 +40,18 @@
+ 
+ 
+ public class EndElementEvent extends EventBase implements EndElement {
+-    
++
+     List _namespaces = null;
+     QName _qname ;
+-    
++
+     public void reset() {
+         if (_namespaces != null) _namespaces.clear();
+     }
+-    
++
+     public EndElementEvent() {
+         setEventType(END_ELEMENT);
+     }
+-    
++
+     public EndElementEvent(String namespaceURI, String localpart, String prefix) {
+         _qname = getQName(namespaceURI,localpart,prefix);
+         setEventType(END_ELEMENT);
+@@ -61,7 +61,7 @@
+         _qname = qname;
+         setEventType(END_ELEMENT);
+     }
+-        
++
+   /**
+    * Get the name of this event
+    * @return the qualified name of this event
+@@ -69,12 +69,12 @@
+     public QName getName() {
+         return _qname;
+     }
+-    
++
+     public void setName(QName qname) {
+         _qname = qname;
+     }
+-    
+ 
++
+     /** Returns an Iterator of namespaces that have gone out
+      * of scope.  Returns an empty iterator if no namespaces have gone
+      * out of scope.
+@@ -86,7 +86,7 @@
+             return _namespaces.iterator();
+         return EmptyIterator.getInstance();
+     }
+-    
++
+     public void addNamespace(Namespace namespace){
+         if (_namespaces == null) {
+             _namespaces = new ArrayList();
+@@ -93,8 +93,8 @@
+         }
+         _namespaces.add(namespace);
+     }
+-    
+-    public String toString() { 
++
++    public String toString() {
+         StringBuffer sb = new StringBuffer();
+         sb.append("</").append(nameAsString());
+         Iterator namespaces = getNamespaces();
+@@ -105,7 +105,7 @@
+         return sb.toString();
+     }
+ 
+-    
++
+     private String nameAsString() {
+         if("".equals(_qname.getNamespaceURI()))
+             return _qname.getLocalPart();
+@@ -123,5 +123,5 @@
+         else if(prefix == null && uri == null)
+             qn = new QName(localPart);
+         return qn;
+-    }    
++    }
+ }
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/EntityDeclarationImpl.java	Thu Jul 30 18:02:31 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/EntityDeclarationImpl.java	Thu Jul 30 18:02:30 2009
+@@ -24,8 +24,8 @@
+  *
+  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
+  */
+- 
+ 
++
+ package com.sun.xml.internal.fastinfoset.stax.events;
+ 
+ import javax.xml.stream.events.EntityDeclaration;
+@@ -38,22 +38,22 @@
+     private String _entityName;
+     private String _replacement;
+     private String _notationName;
+-    
++
+     /** Creates a new instance of EntityDeclarationImpl */
+     public EntityDeclarationImpl() {
+         init();
+     }
+-    
++
+     public EntityDeclarationImpl(String entityName , String replacement){
+         init();
+         _entityName = entityName;
+         _replacement = replacement;
+     }
+-    
++
+     /**
+     * The entity's public identifier, or null if none was given
+     * @return the public ID for this declaration or null
+-    */    
++    */
+     public String getPublicId(){
+         return _publicId;
+     }
+@@ -64,7 +64,7 @@
+     */
+     public String getSystemId(){
+         return _systemId;
+-    }    
++    }
+ 
+     /**
+     * The entity's name
+@@ -73,7 +73,7 @@
+     public String getName(){
+         return _entityName;
+     }
+-    
++
+     /**
+     * The name of the associated notation.
+     * @return the notation name
+@@ -104,27 +104,27 @@
+     public void setPublicId(String publicId) {
+         _publicId = publicId;
+     }
+-    
++
+     public void setSystemId(String systemId) {
+         _systemId = systemId;
+     }
+-    
++
+     public void setBaseURI(String baseURI) {
+         _baseURI = baseURI;
+     }
+-    
++
+     public void setName(String entityName){
+         _entityName = entityName;
+-    }    
+-    
++    }
++
+     public void setReplacementText(String replacement){
+         _replacement = replacement;
+     }
+-        
++
+     public void setNotationName(String notationName){
+         _notationName = notationName;
+     }
+-        
++
+     protected void init(){
+         setEventType(ENTITY_DECLARATION);
+     }
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/EntityReferenceEvent.java	Thu Jul 30 18:02:35 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/EntityReferenceEvent.java	Thu Jul 30 18:02:34 2009
+@@ -24,8 +24,8 @@
+  *
+  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
+  */
+- 
+ 
++
+ package com.sun.xml.internal.fastinfoset.stax.events ;
+ 
+ import javax.xml.stream.events.EntityDeclaration;
+@@ -35,17 +35,17 @@
+ public class EntityReferenceEvent extends EventBase implements EntityReference {
+     private EntityDeclaration _entityDeclaration ;
+     private String _entityName;
+-    
++
+     public EntityReferenceEvent() {
+         init();
+     }
+-    
++
+     public EntityReferenceEvent(String entityName , EntityDeclaration entityDeclaration) {
+         init();
+         _entityName = entityName;
+         _entityDeclaration = entityDeclaration;
+     }
+-    
++
+   /**
+    * The name of the entity
+    * @return the entity's name, may not be null
+@@ -53,7 +53,7 @@
+     public String getName() {
+         return _entityName;
+     }
+-    
++
+   /**
+    * Return the declaration of this entity.
+    */
+@@ -64,11 +64,11 @@
+     public void setName(String name){
+         _entityName = name;
+     }
+-    
++
+     public void setDeclaration(EntityDeclaration declaration) {
+         _entityDeclaration = declaration ;
+     }
+-    
++
+     public String toString() {
+         String text = _entityDeclaration.getReplacementText();
+         if(text == null)
+@@ -75,10 +75,10 @@
+             text = "";
+         return "&" + getName() + ";='" + text + "'";
+     }
+-        
++
+     protected void init() {
+         setEventType(ENTITY_REFERENCE);
+     }
+-    
+-    
++
++
+ }
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/EventBase.java	Thu Jul 30 18:02:39 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/EventBase.java	Thu Jul 30 18:02:38 2009
+@@ -24,9 +24,9 @@
+  *
+  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
+  */
+- 
+ 
+ 
++
+ package com.sun.xml.internal.fastinfoset.stax.events ;
+ 
+ import javax.xml.stream.Location;
+@@ -40,19 +40,19 @@
+ 
+ 
+ public abstract class EventBase implements XMLEvent {
+-    
++
+     /* Event type this event corresponds to */
+     protected int _eventType;
+     protected Location _location = null;
+-    
++
+     public EventBase() {
+-        
++
+     }
+-    
++
+     public EventBase(int eventType) {
+         _eventType = eventType;
+     }
+-    
++
+     /**
+     * Returns an integer code for this event.
+     */
+@@ -59,38 +59,38 @@
+     public int getEventType() {
+         return _eventType;
+     }
+-    
++
+     protected void setEventType(int eventType){
+         _eventType = eventType;
+     }
+-    
+-    
++
++
+     public boolean isStartElement() {
+         return _eventType == START_ELEMENT;
+     }
+-    
++
+     public boolean isEndElement() {
+         return _eventType == END_ELEMENT;
+     }
+-    
++
+     public boolean isEntityReference() {
+         return _eventType == ENTITY_REFERENCE;
+     }
+-    
++
+     public boolean isProcessingInstruction() {
+         return _eventType == PROCESSING_INSTRUCTION;
+     }
+-    
++
+     public boolean isStartDocument() {
+         return _eventType == START_DOCUMENT;
+     }
+-    
++
+     public boolean isEndDocument() {
+         return _eventType == END_DOCUMENT;
+     }
+-    
++
+   /**
+-   * Return the location of this event.  The Location 
++   * Return the location of this event.  The Location
+    * returned from this method is non-volatile and
+    * will retain its information.
+    * @see javax.xml.stream.Location
+@@ -98,7 +98,7 @@
+     public Location getLocation(){
+         return _location;
+     }
+-    
++
+     public void setLocation(Location loc){
+         _location = loc;
+     }
+@@ -108,7 +108,7 @@
+         else
+             return _location.getSystemId();
+     }
+-    
++
+     /** Returns this event as Characters, may result in
+      * a class cast exception if this event is not Characters.
+      */
+@@ -118,7 +118,7 @@
+         } else
+             throw new ClassCastException(CommonResourceBundle.getInstance().getString("message.charactersCast", new Object[]{getEventTypeString()}));
+     }
+-    
++
+     /** Returns this event as an end  element event, may result in
+      * a class cast exception if this event is not a end element.
+      */
+@@ -128,7 +128,7 @@
+         } else
+             throw new ClassCastException(CommonResourceBundle.getInstance().getString("message.endElementCase", new Object[]{getEventTypeString()}));
+     }
+-    
++
+   /**
+    * Returns this event as a start element event, may result in
+    * a class cast exception if this event is not a start element.
+@@ -139,7 +139,7 @@
+         } else
+             throw new ClassCastException(CommonResourceBundle.getInstance().getString("message.startElementCase", new Object[]{getEventTypeString()}));
+     }
+-    
++
+     /**
+     * This method is provided for implementations to provide
+     * optional type information about the associated event.
+@@ -149,7 +149,7 @@
+     public QName getSchemaType() {
+         return null;
+     }
+-    
++
+     /** A utility function to check if this event is an Attribute.
+      * @see javax.xml.stream.events.Attribute
+      */
+@@ -156,7 +156,7 @@
+     public boolean isAttribute() {
+         return _eventType == ATTRIBUTE;
+     }
+-    
++
+     /** A utility function to check if this event is Characters.
+      * @see javax.xml.stream.events.Characters
+      */
+@@ -163,7 +163,7 @@
+     public boolean isCharacters() {
+         return _eventType == CHARACTERS;
+     }
+-    
++
+     /** A utility function to check if this event is a Namespace.
+      * @see javax.xml.stream.events.Namespace
+      */
+@@ -170,27 +170,27 @@
+     public boolean isNamespace() {
+         return _eventType == NAMESPACE;
+     }
+-    
+ 
++
+     /**
+     * This method will write the XMLEvent as per the XML 1.0 specification as Unicode characters.
+     * No indentation or whitespace should be outputted.
+     *
+-    * Any user defined event type SHALL have this method 
++    * Any user defined event type SHALL have this method
+     * called when being written to on an output stream.
+-    * Built in Event types MUST implement this method, 
+-    * but implementations MAY choose not call these methods 
+-    * for optimizations reasons when writing out built in 
+-    * Events to an output stream. 
+-    * The output generated MUST be equivalent in terms of the 
++    * Built in Event types MUST implement this method,
++    * but implementations MAY choose not call these methods
++    * for optimizations reasons when writing out built in
++    * Events to an output stream.
++    * The output generated MUST be equivalent in terms of the
+     * infoset expressed.
+-    * 
++    *
+     * @param writer The writer that will output the data
+     * @throws XMLStreamException if there is a fatal error writing the event
+     */
+     public void writeAsEncodedUnicode(Writer writer) throws javax.xml.stream.XMLStreamException {
+     }
+-    
++
+     private String getEventTypeString() {
+         switch (_eventType){
+             case START_ELEMENT:
+@@ -218,5 +218,5 @@
+         }
+         return "UNKNOWN_EVENT_TYPE";
+     }
+-    
++
+ }
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/NamespaceBase.java	Thu Jul 30 18:02:42 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/NamespaceBase.java	Thu Jul 30 18:02:42 2009
+@@ -24,8 +24,8 @@
+  *
+  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
+  */
+- 
+ 
++
+ package com.sun.xml.internal.fastinfoset.stax.events;
+ 
+ import javax.xml.namespace.QName;
+@@ -42,10 +42,10 @@
+     static final String XMLNS_ATTRIBUTE = "xmlns";
+     static final String W3C_XML_SCHEMA_NS_URI = "http://www.w3.org/2001/XMLSchema";
+     static final String W3C_XML_SCHEMA_INSTANCE_NS_URI = "http://www.w3.org/2001/XMLSchema-instance";
+-    
++
+     //is this namespace default declaration?
+     private boolean defaultDeclaration = false;
+-    
++
+     /** a namespace attribute has a form: xmlns:NCName="URI reference" */
+     public NamespaceBase(String namespaceURI) {
+         super(XMLNS_ATTRIBUTE, "", namespaceURI);
+@@ -64,7 +64,7 @@
+             defaultDeclaration=true;
+         }
+     }
+-    
++
+     void setPrefix(String prefix){
+         if(prefix == null)
+             setName(new QName(XMLNS_ATTRIBUTE_NS_URI,DEFAULT_NS_PREFIX,XMLNS_ATTRIBUTE));
+@@ -71,13 +71,13 @@
+         else// new QName(uri, localpart, prefix)
+             setName(new QName(XMLNS_ATTRIBUTE_NS_URI,prefix,XMLNS_ATTRIBUTE));
+     }
+-    
++
+     public String getPrefix() {
+         if (defaultDeclaration) return "";
+         return super.getLocalName();
+     }
+-    
+-    
++
++
+   /**
+    * set Namespace URI reference (xmlns:prefix = "uri")
+    * @param uri the uri reference of a namespace is the value for an attribute
+@@ -88,15 +88,15 @@
+     public String getNamespaceURI() {
+         return getValue();
+     }
+-    
+ 
++
+     public boolean isNamespace(){
+         return true;
+     }
+-    
++
+     public boolean isDefaultNamespaceDeclaration() {
+         return defaultDeclaration;
+     }
+-    
+ 
++
+ }
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/ProcessingInstructionEvent.java	Thu Jul 30 18:02:46 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/ProcessingInstructionEvent.java	Thu Jul 30 18:02:45 2009
+@@ -24,8 +24,8 @@
+  *
+  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
+  */
+- 
+ 
++
+ package com.sun.xml.internal.fastinfoset.stax.events ;
+ 
+ import javax.xml.stream.XMLStreamConstants;
+@@ -33,40 +33,40 @@
+ 
+ 
+ public class ProcessingInstructionEvent extends EventBase implements ProcessingInstruction {
+-    
++
+     private String targetName;
+     private String _data;
+-    
++
+     public ProcessingInstructionEvent() {
+         init();
+     }
+-    
++
+     public ProcessingInstructionEvent(String targetName, String data) {
+         this.targetName = targetName;
+         _data = data;
+         init();
+-    }    
+-    
++    }
++
+     protected void init() {
+         setEventType(XMLStreamConstants.PROCESSING_INSTRUCTION);
+     }
+-    
++
+     public String getTarget() {
+         return targetName;
+     }
+-    
++
+     public void setTarget(String targetName) {
+         this.targetName = targetName;
+     }
+-    
++
+     public void setData(String data) {
+         _data = data;
+     }
+-    
++
+     public String getData() {
+         return _data;
+     }
+-    
++
+     public String toString() {
+         if(_data != null && targetName != null)
+             return "<?" + targetName + " " + _data + "?>";
+@@ -77,5 +77,5 @@
+         else
+             return "<??>";
+     }
+-    
++
+ }
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/ReadIterator.java	Thu Jul 30 18:02:49 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/ReadIterator.java	Thu Jul 30 18:02:49 2009
+@@ -24,9 +24,9 @@
+  *
+  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
+  */
+- 
+ 
+ 
++
+ package com.sun.xml.internal.fastinfoset.stax.events;
+ 
+ import java.util.Iterator;
+@@ -33,29 +33,29 @@
+ import com.sun.xml.internal.fastinfoset.CommonResourceBundle;
+ 
+ public class ReadIterator implements Iterator {
+-    
++
+     Iterator iterator = EmptyIterator.getInstance();
+-    
++
+     public ReadIterator(){
+     }
+-    
++
+     public ReadIterator(Iterator iterator){
+         if (iterator != null) {
+             this.iterator = iterator;
+         }
+     }
+-    
++
+     public boolean hasNext() {
+         return iterator.hasNext();
+     }
+-    
++
+     public Object next() {
+         return iterator.next();
+     }
+-    
++
+     public void remove() {
+         throw new  UnsupportedOperationException(CommonResourceBundle.getInstance().getString("message.readonlyList"));
+     }
+-    
+ 
++
+ }
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/StAXEventAllocatorBase.java	Thu Jul 30 18:02:53 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/StAXEventAllocatorBase.java	Thu Jul 30 18:02:52 2009
+@@ -24,8 +24,8 @@
+  *
+  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
+  */
+- 
+ 
++
+ package com.sun.xml.internal.fastinfoset.stax.events;
+ 
+ import javax.xml.stream.XMLEventFactory;
+@@ -39,13 +39,13 @@
+ import com.sun.xml.internal.fastinfoset.CommonResourceBundle;
+ 
+ /**
+- * allows a user to register a way to allocate events given an XMLStreamReader.  
++ * allows a user to register a way to allocate events given an XMLStreamReader.
+  * The XMLEventAllocator can be set on an XMLInputFactory
+  * using the property "javax.xml.stream.allocator"
+  *
+  * This base class uses EventFactory to create events as recommended in the JavaDoc of XMLEventAllocator.
+  * However, creating new object per each event reduces performance. The implementation of
+- * EventReader therefore will set the Allocator to StAXEventAllocator which implements the 
++ * EventReader therefore will set the Allocator to StAXEventAllocator which implements the
+  * Allocate methods without creating new objects.
+  *
+  * The spec for the first Allocate method states that it must NOT modify the state of the Reader
+@@ -55,11 +55,11 @@
+  */
+ public class StAXEventAllocatorBase implements XMLEventAllocator {
+     XMLEventFactory factory;
+-    
++
+     /** Creates a new instance of XMLEventAllocator */
+     public StAXEventAllocatorBase() {
+         if (System.getProperty("javax.xml.stream.XMLEventFactory")==null) {
+-            System.setProperty("javax.xml.stream.XMLEventFactory", 
++            System.setProperty("javax.xml.stream.XMLEventFactory",
+                        "com.sun.xml.internal.fastinfoset.stax.factory.StAXEventFactory");
+         }
+         factory = XMLEventFactory.newInstance();
+@@ -66,7 +66,7 @@
+     }
+ 
+     // ---------------------methods defined by XMLEventAllocator-----------------//
+-    
++
+   /**
+    * This method creates an instance of the XMLEventAllocator. This
+    * allows the XMLInputFactory to allocate a new instance per reader.
+@@ -76,9 +76,9 @@
+     }
+ 
+   /**
+-   * This method allocates an event given the current state of the XMLStreamReader.  
++   * This method allocates an event given the current state of the XMLStreamReader.
+    * If this XMLEventAllocator does not have a one-to-one mapping between reader state
+-   * and events this method will return null.  
++   * and events this method will return null.
+    * @param streamReader The XMLStreamReader to allocate from
+    * @return the event corresponding to the current reader state
+    */
+@@ -87,11 +87,11 @@
+             throw new XMLStreamException(CommonResourceBundle.getInstance().getString("message.nullReader"));
+         return getXMLEvent(streamReader);
+     }
+-    
++
+   /**
+-   * This method allocates an event or set of events given the current state of 
+-   * the XMLStreamReader and adds the event or set of events to the consumer that 
+-   * was passed in.  
++   * This method allocates an event or set of events given the current state of
++   * the XMLStreamReader and adds the event or set of events to the consumer that
++   * was passed in.
+    * @param streamReader The XMLStreamReader to allocate from
+    * @param consumer The XMLEventConsumer to add to.
+    */
+@@ -100,8 +100,8 @@
+ 
+     }
+     // ---------------------end of methods defined by XMLEventAllocator-----------------//
+-    
+-    
++
++
+     XMLEvent getXMLEvent(XMLStreamReader reader){
+         XMLEvent event = null;
+         //returns the current event
+@@ -109,7 +109,7 @@
+         //this needs to be set before creating events
+         factory.setLocation(reader.getLocation());
+         switch(eventType){
+-            
++
+             case XMLEvent.START_ELEMENT:
+             {
+                 StartElementEvent startElement = (StartElementEvent)factory.createStartElement(reader.getPrefix(),
+@@ -141,7 +141,7 @@
+                   event = factory.createSpace(reader.getText());
+                 else
+                   event = factory.createCharacters(reader.getText());
+-                
++
+                 break;
+             }
+             case XMLEvent.COMMENT:
+@@ -167,10 +167,10 @@
+                 break;
+             }
+             case XMLEvent.ENTITY_REFERENCE:{
+-                event = factory.createEntityReference(reader.getLocalName(), 
++                event = factory.createEntityReference(reader.getLocalName(),
+                         new EntityDeclarationImpl(reader.getLocalName(),reader.getText()));
+                 break;
+-                
++
+             }
+             case XMLEvent.ATTRIBUTE:{
+                 event = null ;
+@@ -191,12 +191,12 @@
+         }
+         return event ;
+     }
+-    
++
+     //use event.addAttribute instead of addAttributes to avoid creating another list
+-    protected void addAttributes(StartElementEvent event,XMLStreamReader streamReader){        
++    protected void addAttributes(StartElementEvent event,XMLStreamReader streamReader){
+         AttributeBase attr = null;
+         for(int i=0; i<streamReader.getAttributeCount() ;i++){
+-            attr = (AttributeBase)factory.createAttribute(streamReader.getAttributeName(i), 
++            attr = (AttributeBase)factory.createAttribute(streamReader.getAttributeName(i),
+                                     streamReader.getAttributeValue(i));
+             attr.setAttributeType(streamReader.getAttributeType(i));
+             attr.setSpecified(streamReader.isAttributeSpecified(i));
+@@ -203,7 +203,7 @@
+             event.addAttribute(attr);
+         }
+     }
+-    
++
+     //add namespaces to StartElement/EndElement
+     protected void addNamespaces(StartElementEvent event,XMLStreamReader streamReader){
+         Namespace namespace = null;
+@@ -221,6 +221,6 @@
+             event.addNamespace(namespace);
+         }
+     }
+-    
+-    
++
++
+ }
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/StAXEventReader.java	Thu Jul 30 18:02:56 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/StAXEventReader.java	Thu Jul 30 18:02:56 2009
+@@ -24,8 +24,8 @@
+  *
+  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
+  */
+- 
+ 
++
+ package com.sun.xml.internal.fastinfoset.stax.events;
+ 
+ import com.sun.xml.internal.fastinfoset.stax.*;
+@@ -47,7 +47,7 @@
+     private int size = 3;
+     private int currentIndex = 0;
+     private boolean hasEvent = false;   //true when current event exists, false initially & at end
+-    
++
+     //only constructor will do because we delegate everything to underlying XMLStreamReader
+     public StAXEventReader(XMLStreamReader reader) throws  XMLStreamException {
+         _streamReader = reader ;
+@@ -66,15 +66,15 @@
+             throw new XMLStreamException(CommonResourceBundle.getInstance().getString("message.noElement"));
+         }
+     }
+-        
+-    public boolean hasNext() {        
++
++    public boolean hasNext() {
+         return hasEvent;
+-    }    
+-    
++    }
++
+     public XMLEvent nextEvent() throws XMLStreamException {
+         XMLEvent event = null;
+         XMLEvent nextEvent = null;
+-        if (hasEvent) 
++        if (hasEvent)
+         {
+             event = events[currentIndex];
+             events[currentIndex] = null;
+@@ -95,19 +95,19 @@
+         }
+         else{
+             throw new NoSuchElementException();
+-        }        
++        }
+     }
+-    
++
+     public void remove(){
+         //stream reader is read-only.
+         throw new java.lang.UnsupportedOperationException();
+     }
+-    
+-    
++
++
+     public void close() throws XMLStreamException {
+         _streamReader.close();
+     }
+-    
++
+     /** Reads the content of a text-only element. Precondition:
+      * the current event is START_ELEMENT. Postcondition:
+      * The current event is the corresponding END_ELEMENT.
+@@ -118,7 +118,7 @@
+         if(!hasEvent) {
+             throw new NoSuchElementException();
+         }
+-                
++
+         if(!_currentEvent.isStartElement()) {
+             StAXDocumentParser parser = (StAXDocumentParser)_streamReader;
+             return parser.getElementText(true);
+@@ -126,7 +126,7 @@
+             return _streamReader.getElementText();
+         }
+     }
+-    
++
+     /** Get the value of a feature/property from the underlying implementation
+      * @param name The name of the property
+      * @return The value of the property
+@@ -135,7 +135,7 @@
+     public Object getProperty(java.lang.String name) throws java.lang.IllegalArgumentException {
+         return _streamReader.getProperty(name) ;
+     }
+-    
++
+     /** Skips any insignificant space events until a START_ELEMENT or
+      * END_ELEMENT is reached. If anything other than space characters are
+      * encountered, an exception is thrown. This method should
+@@ -152,7 +152,7 @@
+         parser.nextTag(true);
+         return _eventAllocator.allocate(_streamReader);
+     }
+-    
++
+     //XMLEventReader extends Iterator;
+     public Object next() {
+         try{
+@@ -161,7 +161,7 @@
+             return null;
+         }
+     }
+-    
++
+     public XMLEvent peek() throws XMLStreamException{
+         if (!hasEvent)
+              throw new XMLStreamException(CommonResourceBundle.getInstance().getString("message.noElement"));
+@@ -175,6 +175,6 @@
+ 
+         _eventAllocator = allocator;
+     }
+-    
+-    
++
++
+ }
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/StAXEventWriter.java	Thu Jul 30 18:03:00 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/StAXEventWriter.java	Thu Jul 30 18:02:59 2009
+@@ -24,8 +24,8 @@
+  *
+  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
+  */
+- 
+ 
++
+ package com.sun.xml.internal.fastinfoset.stax.events;
+ 
+ import java.util.Iterator;
+@@ -40,7 +40,7 @@
+ import com.sun.xml.internal.fastinfoset.CommonResourceBundle;
+ 
+ public class StAXEventWriter implements XMLEventWriter {
+-    
++
+     private XMLStreamWriter _streamWriter ;
+     /**
+      *
+@@ -64,7 +64,7 @@
+     public void close() throws javax.xml.stream.XMLStreamException {
+         _streamWriter.close();
+     }
+-    
++
+     /**
+      *
+      * @param eventReader
+@@ -76,10 +76,10 @@
+             add(eventReader.nextEvent());
+         }
+     }
+-    
++
+     /**
+     * Add an event to the output stream
+-    * Adding a START_ELEMENT will open a new namespace scope that 
++    * Adding a START_ELEMENT will open a new namespace scope that
+     * will be closed when the corresponding END_ELEMENT is written.
+     *
+     * @param event
+@@ -102,7 +102,7 @@
+                 StartElement startElement = event.asStartElement() ;
+                 QName qname = startElement.getName();
+                 _streamWriter.writeStartElement(qname.getPrefix(), qname.getLocalPart(), qname.getNamespaceURI());
+-                
++
+                 Iterator iterator = startElement.getNamespaces();
+                 while(iterator.hasNext()){
+                     Namespace namespace = (Namespace)iterator.next();
+@@ -113,7 +113,7 @@
+                 while(attributes.hasNext()){
+                     Attribute attribute = (Attribute)attributes.next();
+                     QName name = attribute.getName();
+-                    _streamWriter.writeAttribute(name.getPrefix(), name.getNamespaceURI(), 
++                    _streamWriter.writeAttribute(name.getPrefix(), name.getNamespaceURI(),
+                                                 name.getLocalPart(),attribute.getValue());
+                 }
+                 break;
+@@ -164,7 +164,7 @@
+                 }
+                 break;
+             }
+-            
++
+             case XMLEvent.END_ELEMENT:{
+                 _streamWriter.writeEndElement();
+                 break;
+@@ -177,9 +177,9 @@
+                 throw new XMLStreamException(CommonResourceBundle.getInstance().getString("message.eventTypeNotSupported", new Object[]{Util.getEventTypeString(type)}));
+             //throw new XMLStreamException("Unknown Event type = " + type);
+         };
+-        
++
+     }
+-    
++
+     /**
+     * Gets the prefix the uri is bound to
+     * @param uri the uri to look up
+@@ -188,8 +188,8 @@
+     public String getPrefix(String uri) throws XMLStreamException {
+         return _streamWriter.getPrefix(uri);
+     }
+-    
+-    
++
++
+     /**
+     * Returns the current namespace context.
+     * @return the current namespace context
+@@ -197,8 +197,8 @@
+     public NamespaceContext getNamespaceContext() {
+         return _streamWriter.getNamespaceContext();
+     }
+-    
+-    
++
++
+     /**
+     * Binds a URI to the default namespace
+     * This URI is bound
+@@ -211,7 +211,7 @@
+     public void setDefaultNamespace(String uri) throws XMLStreamException {
+         _streamWriter.setDefaultNamespace(uri);
+     }
+-    
++
+     /**
+     * Sets the current namespace context for prefix and uri bindings.
+     * This context becomes the root namespace context for writing and
+@@ -237,5 +237,5 @@
+     public void setPrefix(String prefix, String uri) throws XMLStreamException {
+         _streamWriter.setPrefix(prefix, uri);
+     }
+-        
++
+ }
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/StAXFilteredEvent.java	Thu Jul 30 18:03:03 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/StAXFilteredEvent.java	Thu Jul 30 18:03:03 2009
+@@ -42,11 +42,11 @@
+ public class StAXFilteredEvent implements XMLEventReader {
+     private XMLEventReader eventReader;
+     private EventFilter _filter;
+-    
++
+     /** Creates a new instance of StAXFilteredEvent */
+     public StAXFilteredEvent() {
+     }
+-    
++
+     public StAXFilteredEvent(XMLEventReader reader, EventFilter filter) throws XMLStreamException
+     {
+         eventReader = reader;
+@@ -69,7 +69,7 @@
+         }
+     }
+ 
+-    public XMLEvent nextEvent() throws XMLStreamException 
++    public XMLEvent nextEvent() throws XMLStreamException
+     {
+         if (hasNext())
+             return eventReader.nextEvent();
+@@ -82,7 +82,7 @@
+         XMLEvent e = nextEvent();
+         if (!e.isStartElement())
+             throw new XMLStreamException(
+-            CommonResourceBundle.getInstance().getString("message.mustBeOnSTART_ELEMENT"));            
++            CommonResourceBundle.getInstance().getString("message.mustBeOnSTART_ELEMENT"));
+ 
+         while(hasNext()) {
+             e = nextEvent();
+@@ -93,7 +93,7 @@
+                 buffer.append(((Characters) e).getData());
+             if(e.isEndElement())
+                 return buffer.toString();
+-        } 
++        }
+         throw new XMLStreamException(CommonResourceBundle.getInstance().getString("message.END_ELEMENTnotFound"));
+     }
+ 
+@@ -107,9 +107,9 @@
+     }
+ 
+ 
+-    public boolean hasNext() 
++    public boolean hasNext()
+     {
+-        try { 
++        try {
+             while(eventReader.hasNext()) {
+                 if (_filter.accept(eventReader.peek())) return true;
+                 eventReader.nextEvent();
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/StartDocumentEvent.java	Thu Jul 30 18:03:07 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/StartDocumentEvent.java	Thu Jul 30 18:03:06 2009
+@@ -24,8 +24,8 @@
+  *
+  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
+  */
+- 
+ 
++
+ package com.sun.xml.internal.fastinfoset.stax.events ;
+ 
+ import javax.xml.stream.XMLStreamConstants;
+@@ -34,7 +34,7 @@
+ import com.sun.xml.internal.fastinfoset.stax.events.XMLConstants;
+ 
+ public class StartDocumentEvent extends EventBase implements StartDocument {
+-    
++
+     protected String _systemId;
+     protected String _encoding = XMLConstants.ENCODING; //default
+     protected boolean _standalone = true;
+@@ -41,7 +41,7 @@
+     protected String _version = XMLConstants.XMLVERSION;
+     private boolean _encodingSet = false;
+     private boolean _standaloneSet = false;
+-    
++
+     public void reset() {
+         _encoding = XMLConstants.ENCODING;
+         _standalone = true;
+@@ -52,11 +52,11 @@
+     public StartDocumentEvent() {
+         this(null ,null);
+     }
+-    
++
+     public StartDocumentEvent(String encoding){
+         this(encoding, null);
+     }
+-    
++
+     public StartDocumentEvent(String encoding, String version){
+         if (encoding != null) {
+             _encoding = encoding;
+@@ -66,8 +66,8 @@
+             _version = version;
+         setEventType(XMLStreamConstants.START_DOCUMENT);
+     }
+-    
+-    
++
++
+     // ------------------- methods defined in StartDocument -------------------------
+     /**
+     * Returns the system ID of the XML data
+@@ -76,7 +76,7 @@
+     public String getSystemId() {
+         return super.getSystemId();
+     }
+-    
++
+     /**
+     * Returns the encoding style of the XML data
+     * @return the character encoding, defaults to "UTF-8"
+@@ -85,14 +85,14 @@
+         return _encoding;
+     }
+     /**
+-    * Returns true if CharacterEncodingScheme was set in 
++    * Returns true if CharacterEncodingScheme was set in
+     * the encoding declaration of the document
+     */
+     public boolean encodingSet() {
+         return _encodingSet;
+     }
+-    
+ 
++
+   /**
+    * Returns if this XML is standalone
+    * @return the standalone state of XML, defaults to "no"
+@@ -101,13 +101,13 @@
+         return _standalone;
+     }
+     /**
+-    * Returns true if the standalone attribute was set in 
++    * Returns true if the standalone attribute was set in
+     * the encoding declaration of the document.
+     */
+     public boolean standaloneSet() {
+         return _standaloneSet;
+     }
+-    
++
+   /**
+    * Returns the version of XML of this XML stream
+    * @return the version of XML, defaults to "1.0"
+@@ -116,12 +116,12 @@
+         return _version;
+     }
+     // ------------------- end of methods defined in StartDocument -------------------------
+-    
++
+     public void setStandalone(boolean standalone) {
+         _standaloneSet = true;
+         _standalone = standalone;
+     }
+-    
++
+     public void setStandalone(String s) {
+         _standaloneSet = true;
+         if(s == null) {
+@@ -133,21 +133,21 @@
+         else
+             _standalone = false;
+     }
+-    
+-        
++
++
+     public void setEncoding(String encoding) {
+         _encoding = encoding;
+         _encodingSet = true;
+     }
+-    
++
+     void setDeclaredEncoding(boolean value){
+         _encodingSet = value;
+     }
+-    
++
+     public void setVersion(String s) {
+         _version = s;
+     }
+-    
++
+     void clear() {
+         _encoding = "UTF-8";
+         _standalone = true;
+@@ -155,7 +155,7 @@
+         _encodingSet = false;
+         _standaloneSet = false;
+     }
+-    
++
+     public String toString() {
+         String s = "<?xml version=\"" + _version + "\"";
+         s = s + " encoding='" + _encoding + "'";
+@@ -169,7 +169,7 @@
+         }
+         return s;
+     }
+-    
++
+     public boolean isStartDocument() {
+         return true;
+     }
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/StartElementEvent.java	Thu Jul 30 18:03:10 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/StartElementEvent.java	Thu Jul 30 18:03:10 2009
+@@ -24,8 +24,8 @@
+  *
+  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
+  */
+- 
+ 
++
+ package com.sun.xml.internal.fastinfoset.stax.events ;
+ 
+ import java.util.ArrayList;
+@@ -46,22 +46,22 @@
+ import com.sun.xml.internal.fastinfoset.stax.events.ReadIterator;
+ 
+ public class StartElementEvent extends EventBase implements StartElement {
+-    
++
+     private Map _attributes;
+     private List _namespaces;
+     private NamespaceContext _context = null;
+     private QName _qname;
+-    
++
+     public void reset() {
+         if (_attributes != null) _attributes.clear();
+         if (_namespaces != null) _namespaces.clear();
+         if (_context != null) _context = null;
+     }
+-    
++
+     public StartElementEvent() {
+         init();
+     }
+-    
++
+     public StartElementEvent(String prefix, String uri, String localpart) {
+         init();
+         if (uri == null) uri = "";
+@@ -69,24 +69,24 @@
+         _qname = new QName(uri, localpart, prefix);
+         setEventType(START_ELEMENT);
+     }
+-    
++
+     public StartElementEvent(QName qname) {
+         init();
+         _qname = qname;
+     }
+-    
++
+     public StartElementEvent(StartElement startelement) {
+         this(startelement.getName());
+         addAttributes(startelement.getAttributes());
+         addNamespaces(startelement.getNamespaces());
+     }
+-    
++
+     protected void init() {
+         setEventType(XMLStreamConstants.START_ELEMENT);
+         _attributes = new HashMap();
+         _namespaces = new ArrayList();
+     }
+-    
++
+     // ---------------------methods defined by StartElement-----------------//
+     /**
+     * Get the name of this event
+@@ -96,7 +96,7 @@
+         return _qname;
+     }
+     /**
+-    * Returns an Iterator of non-namespace declared attributes 
++    * Returns an Iterator of non-namespace declared attributes
+     * returns an empty iterator if there are no attributes.  The
+     * iterator must contain only implementations of the javax.xml.stream.Attribute
+     * interface.   Attributes are fundamentally unordered and may not be reported
+@@ -112,7 +112,7 @@
+         }
+         return EmptyIterator.getInstance();
+     }
+-     
++
+   /**
+    * Returns an Iterator of namespaces declared on this element.
+    * This Iterator does not contain previously declared namespaces
+@@ -120,13 +120,13 @@
+    * Therefore this list may contain redeclared namespaces and duplicate namespace
+    * declarations. Use the getNamespaceContext() method to get the
+    * current context of namespace declarations.
+-   *  
+-   * <p>The iterator must contain only implementations of the 
++   *
++   * <p>The iterator must contain only implementations of the
+    * javax.xml.stream.Namespace interface.
+-   * 
++   *
+    * <p>A Namespace is an Attribute.  One
+-   * can iterate over a list of namespaces as a list of attributes.  
+-   * However this method returns only the list of namespaces 
++   * can iterate over a list of namespaces as a list of attributes.
++   * However this method returns only the list of namespaces
+    * declared on this START_ELEMENT and does not
+    * include the attributes declared on this START_ELEMENT.
+    *
+@@ -140,7 +140,7 @@
+         }
+         return EmptyIterator.getInstance();
+     }
+- 
++
+   /**
+    * Returns the attribute referred to by this name
+    * @param qname the qname of the desired name
+@@ -151,7 +151,7 @@
+             return null;
+         return (Attribute)_attributes.get(qname);
+     }
+-    
++
+     /** Gets a read-only namespace context. If no context is
+      * available this method will return an empty namespace context.
+      * The NamespaceContext contains information about all namespaces
+@@ -167,15 +167,15 @@
+     public void setName(QName qname) {
+         this._qname = qname;
+     }
+-    
+-    
++
++
+     public String getNamespace(){
+         return _qname.getNamespaceURI();
+     }
+-    
++
+     /**
+     * Gets the value that the prefix is bound to in the
+-    * context of this element.  Returns null if 
++    * context of this element.  Returns null if
+     * the prefix is not bound in this context
+     * @param prefix the prefix to lookup
+     * @return the uri bound to the prefix or null
+@@ -188,10 +188,10 @@
+             return _context.getNamespaceURI(prefix);
+         return null;
+     }
+-    
++
+     public String toString() {
+         String s = "<" + nameAsString();
+-        
++
+         if(_attributes != null){
+             Iterator it = this.getAttributes();
+             Attribute attr = null;
+@@ -200,7 +200,7 @@
+                 s = s + " " + attr.toString();
+             }
+         }
+-        
++
+         if(_namespaces != null){
+             Iterator it = _namespaces.iterator();
+             Namespace attr = null;
+@@ -212,7 +212,7 @@
+         s = s + ">";
+         return s;
+     }
+-    
++
+     /** Return this event as String
+      * @return String Event returned as string.
+      */
+@@ -224,38 +224,38 @@
+         else
+             return "['" + _qname.getNamespaceURI() + "']:" + _qname.getLocalPart();
+     }
+-    
+-    
++
++
+     public void setNamespaceContext(NamespaceContext context) {
+         _context = context;
+     }
+-    
++
+     public void addAttribute(Attribute attr){
+         _attributes.put(attr.getName(),attr);
+     }
+-    
++
+     public void addAttributes(Iterator attrs){
+         if(attrs != null) {
+             while(attrs.hasNext()){
+                 Attribute attr = (Attribute)attrs.next();
+                 _attributes.put(attr.getName(),attr);
+-            }            
++            }
+         }
+     }
+-    
++
+     public void addNamespace(Namespace namespace){
+         if(namespace != null) {
+             _namespaces.add(namespace);
+-        }        
++        }
+     }
+-    
++
+     public void addNamespaces(Iterator namespaces){
+         if(namespaces != null) {
+             while(namespaces.hasNext()){
+                 Namespace namespace = (Namespace)namespaces.next();
+                 _namespaces.add(namespace);
+-            }            
++            }
+         }
+     }
+-    
++
+ }
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/Util.java	Thu Jul 30 18:03:14 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/Util.java	Thu Jul 30 18:03:13 2009
+@@ -24,7 +24,7 @@
+  *
+  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
+  */
+- 
++
+ package com.sun.xml.internal.fastinfoset.stax.events;
+ 
+ import javax.xml.stream.XMLStreamConstants;
+@@ -32,7 +32,7 @@
+ /** A Utility class for the StAX Events implementation.
+  */
+ public class Util {
+-    
++
+     /**
+      * A string is empty if it's null or contains nothing
+      *
+@@ -39,12 +39,12 @@
+      * @param s The string to check.
+      */
+     public static boolean isEmptyString(String s) {
+-        if (s != null && !s.equals("")) 
++        if (s != null && !s.equals(""))
+             return false;
+         else
+             return true;
+-    } 
+-    
++    }
++
+     public final static String getEventTypeString(int eventType) {
+         switch (eventType){
+             case XMLStreamConstants.START_ELEMENT:
+@@ -72,5 +72,5 @@
+         }
+         return "UNKNOWN_EVENT_TYPE";
+     }
+-    
++
+ }
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/XMLConstants.java	Thu Jul 30 18:03:18 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/XMLConstants.java	Thu Jul 30 18:03:17 2009
+@@ -24,14 +24,14 @@
+  *
+  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
+  */
+- 
+ 
+ 
++
+ package com.sun.xml.internal.fastinfoset.stax.events;
+ 
+ 
+ public class XMLConstants {
+-    
++
+    public static final String ENCODING = "UTF-8";
+    public static final String XMLVERSION = "1.0";
+ }
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/stax/factory/StAXEventFactory.java	Thu Jul 30 18:03:21 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/factory/StAXEventFactory.java	Thu Jul 30 18:03:20 2009
+@@ -24,9 +24,9 @@
+  *
+  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
+  */
+- 
+ 
+ 
++
+ package com.sun.xml.internal.fastinfoset.stax.factory;
+ 
+ import javax.xml.namespace.QName;
+@@ -40,7 +40,7 @@
+ 
+ public class StAXEventFactory extends XMLEventFactory {
+     Location location = null;
+-    
++
+     /** Creates a new instance of StAXEventFactory */
+     public StAXEventFactory() {
+     }
+@@ -47,7 +47,7 @@
+     /**
+     * This method allows setting of the Location on each event that
+     * is created by this factory.  The values are copied by value into
+-    * the events created by this factory.  To reset the location 
++    * the events created by this factory.  To reset the location
+     * information set the location to null.
+     * @param location the location to set on each event created
+     */
+@@ -54,7 +54,7 @@
+     public void setLocation(Location location) {
+         this.location = location;
+     }
+-    
++
+   /**
+    * Create a new Attribute
+    * @param prefix the prefix of this attribute, may not be null
+@@ -68,7 +68,7 @@
+         if(location != null)attr.setLocation(location);
+         return attr;
+     }
+-    
++
+   /**
+    * Create a new Attribute
+    * @param localName the local name of the XML name of the attribute, localName cannot be null
+@@ -80,13 +80,13 @@
+         if(location != null)attr.setLocation(location);
+         return attr;
+     }
+-    
++
+     public Attribute createAttribute(QName name, String value) {
+         AttributeBase attr =  new AttributeBase(name, value);
+         if(location != null)attr.setLocation(location);
+         return attr;
+     }
+-    
++
+   /**
+    * Create a new default Namespace
+    * @param namespaceURI the default namespace uri
+@@ -97,7 +97,7 @@
+         if(location != null)event.setLocation(location);
+         return event;
+     }
+-    
++
+   /**
+    * Create a new Namespace
+    * @param prefix the prefix of this namespace, may not be null
+@@ -109,13 +109,13 @@
+         if(location != null)event.setLocation(location);
+         return event;
+     }
+-        
++
+   /**
+-   * Create a new StartElement.  
++   * Create a new StartElement.
+    * @param name the qualified name of the attribute, may not be null
+-   * @param attributes an optional unordered set of objects that 
++   * @param attributes an optional unordered set of objects that
+    * implement Attribute to add to the new StartElement, may be null
+-   * @param namespaces an optional unordered set of objects that 
++   * @param namespaces an optional unordered set of objects that
+    * implement Namespace to add to the new StartElement, may be null
+    * @return an instance of the requested StartElement
+    */
+@@ -122,17 +122,17 @@
+     public StartElement createStartElement(QName name, Iterator attributes, Iterator namespaces) {
+         return createStartElement(name.getPrefix(), name.getNamespaceURI(), name.getLocalPart(), attributes, namespaces);
+     }
+-    
++
+     public StartElement createStartElement(String prefix, String namespaceUri, String localName) {
+         StartElementEvent event =  new StartElementEvent(prefix, namespaceUri, localName);
+         if(location != null)event.setLocation(location);
+         return event;
+     }
+-    
++
+     public StartElement createStartElement(String prefix, String namespaceUri, String localName, Iterator attributes, Iterator namespaces) {
+         return createStartElement(prefix, namespaceUri, localName, attributes, namespaces, null);
+     }
+-    
++
+     public StartElement createStartElement(String prefix, String namespaceUri, String localName, Iterator attributes, Iterator namespaces, NamespaceContext context) {
+         StartElementEvent elem =  new StartElementEvent(prefix, namespaceUri, localName);
+         elem.addAttributes(attributes);
+@@ -141,11 +141,11 @@
+         if(location != null)elem.setLocation(location);
+         return elem;
+     }
+-    
++
+   /**
+    * Create a new EndElement
+    * @param name the qualified name of the EndElement
+-   * @param namespaces an optional unordered set of objects that 
++   * @param namespaces an optional unordered set of objects that
+    * implement Namespace that have gone out of scope, may be null
+    * @return an instance of the requested EndElement
+    */
+@@ -152,7 +152,7 @@
+     public EndElement createEndElement(QName name, Iterator namespaces) {
+         return createEndElement(name.getPrefix(), name.getNamespaceURI(), name.getLocalPart(), namespaces);
+     }
+-    
++
+   /**
+    * Create a new EndElement
+    * @param namespaceUri the uri of the QName of the new StartElement
+@@ -165,18 +165,18 @@
+         if(location != null)event.setLocation(location);
+         return event;
+     }
+-    
++
+   /**
+    * Create a new EndElement
+    * @param namespaceUri the uri of the QName of the new StartElement
+    * @param localName the local name of the QName of the new StartElement
+    * @param prefix the prefix of the QName of the new StartElement
+-   * @param namespaces an unordered set of objects that implement 
++   * @param namespaces an unordered set of objects that implement
+    * Namespace that have gone out of scope, may be null
+    * @return an instance of the requested EndElement
+    */
+     public EndElement createEndElement(String prefix, String namespaceUri, String localName, Iterator namespaces) {
+-        
++
+         EndElementEvent event =  new EndElementEvent(prefix, namespaceUri, localName);
+         if(namespaces!=null){
+             while(namespaces.hasNext())
+@@ -185,7 +185,7 @@
+         if(location != null)event.setLocation(location);
+         return event;
+     }
+-        
++
+   /**
+    * Create a Characters event, this method does not check if the content
+    * is all whitespace.  To create a space event use #createSpace(String)
+@@ -232,17 +232,17 @@
+         if(location != null)event.setLocation(location);
+         return event;
+     }
+-  /** 
++  /**
+    * Creates a new instance of a StartDocument event
+    * @return a StartDocument event
+-   */    
++   */
+     public StartDocument createStartDocument() {
+         StartDocumentEvent event = new StartDocumentEvent();
+         if(location != null)event.setLocation(location);
+         return event;
+     }
+-    
+-  /** 
++
++  /**
+    * Creates a new instance of a StartDocument event
+    *
+    * @param encoding the encoding style
+@@ -253,8 +253,8 @@
+         if(location != null)event.setLocation(location);
+         return event;
+     }
+-    
+-  /** 
++
++  /**
+    * Creates a new instance of a StartDocument event
+    *
+    * @param encoding the encoding style
+@@ -266,8 +266,8 @@
+         if(location != null)event.setLocation(location);
+         return event;
+     }
+-    
+-  /** 
++
++  /**
+    * Creates a new instance of a StartDocument event
+    *
+    * @param encoding the encoding style
+@@ -287,7 +287,7 @@
+         if(location != null)event.setLocation(location);
+         return event;
+     }
+-    
++
+     /** Creates a new instance of a EntityReference event
+     *
+     * @param name The name of the reference
+@@ -299,7 +299,7 @@
+         if(location != null)event.setLocation(location);
+         return event;
+     }
+-        
++
+     /**
+     * Create a comment
+     * @param text The text of the comment
+@@ -310,7 +310,7 @@
+         if(location != null)charEvent.setLocation(location);
+         return charEvent;
+     }
+-    
++
+     /**
+     * Create a document type definition event
+     * This string contains the entire document type declaration that matches
+@@ -336,9 +336,9 @@
+         if(location != null)event.setLocation(location);
+         return event;
+     }
+-    
+ 
+ 
+ 
+-        
++
++
+ }
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/stax/factory/StAXInputFactory.java	Thu Jul 30 18:03:25 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/factory/StAXInputFactory.java	Thu Jul 30 18:03:24 2009
+@@ -24,9 +24,9 @@
+  *
+  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
+  */
+- 
+ 
+ 
++
+ package com.sun.xml.internal.fastinfoset.stax.factory;
+ 
+ import com.sun.xml.internal.fastinfoset.stax.*;
+@@ -48,13 +48,13 @@
+ import javax.xml.transform.Source;
+ import com.sun.xml.internal.fastinfoset.CommonResourceBundle;
+ 
+-public class StAXInputFactory extends XMLInputFactory {    
++public class StAXInputFactory extends XMLInputFactory {
+     //List of supported properties and default values.
+     private StAXManager _manager = new StAXManager(StAXManager.CONTEXT_READER) ;
+-    
++
+     public StAXInputFactory() {
+     }
+-    
++
+     public static XMLInputFactory newInstance() {
+         return XMLInputFactory.newInstance();
+     }
+@@ -62,36 +62,36 @@
+   /**
+    * Create a new XMLStreamReader from a reader
+    * @param xmlfile the XML data to read from
+-   * @throws XMLStreamException 
++   * @throws XMLStreamException
+    */
+     public XMLStreamReader createXMLStreamReader(Reader xmlfile) throws XMLStreamException {
+         return getXMLStreamReader(xmlfile);
+-    }    
+-    
++    }
++
+     public XMLStreamReader createXMLStreamReader(InputStream s) throws XMLStreamException {
+         return new StAXDocumentParser(s, _manager);
+     }
+-    
++
+     public XMLStreamReader createXMLStreamReader(String systemId, Reader xmlfile) throws XMLStreamException {
+         return getXMLStreamReader(xmlfile);
+     }
+-    
++
+     public XMLStreamReader createXMLStreamReader(Source source) throws XMLStreamException {
+         return null;
+     }
+-    
++
+     public XMLStreamReader createXMLStreamReader(String systemId, InputStream inputstream) throws XMLStreamException {
+         return createXMLStreamReader(inputstream);
+     }
+-    
+-    
++
++
+     public XMLStreamReader createXMLStreamReader(InputStream inputstream, String encoding) throws XMLStreamException {
+         return createXMLStreamReader(inputstream);
+     }
+ 
+-    
+-    XMLStreamReader getXMLStreamReader(String systemId, InputStream inputstream, String encoding) 
+-        throws XMLStreamException{        
++
++    XMLStreamReader getXMLStreamReader(String systemId, InputStream inputstream, String encoding)
++        throws XMLStreamException{
+         return createXMLStreamReader(inputstream);
+ 
+     }
+@@ -100,10 +100,10 @@
+      * @param inputstream
+      * @throws XMLStreamException
+      * @return
+-     */    
+-    XMLStreamReader getXMLStreamReader(Reader xmlfile) 
++     */
++    XMLStreamReader getXMLStreamReader(Reader xmlfile)
+         throws XMLStreamException{
+-        
++
+         ByteArrayOutputStream byteStream = new ByteArrayOutputStream();
+         BufferedOutputStream bufferedStream = new BufferedOutputStream(byteStream);
+         StAXDocumentParser sr = null;
+@@ -117,14 +117,14 @@
+             sr.setInputStream(document);
+             sr.setManager(_manager);
+             return sr;
+-            //return new StAXDocumentParser(document, _manager); 
++            //return new StAXDocumentParser(document, _manager);
+         } catch (Exception e) {
+             return null;
+         }
+ 
+     }
+-           
+-    
++
++
+     /**
+      * @param inputstream
+      * @throws XMLStreamException
+@@ -133,27 +133,27 @@
+     public XMLEventReader createXMLEventReader(InputStream inputstream) throws XMLStreamException {
+         return new StAXEventReader(createXMLStreamReader(inputstream));
+     }
+-    
++
+     public XMLEventReader createXMLEventReader(Reader reader) throws XMLStreamException {
+         return new StAXEventReader(createXMLStreamReader(reader));
+     }
+-    
++
+     public XMLEventReader createXMLEventReader(Source source) throws XMLStreamException {
+         return new StAXEventReader(createXMLStreamReader(source));
+     }
+-    
++
+     public XMLEventReader createXMLEventReader(String systemId, InputStream inputstream) throws XMLStreamException {
+         return new StAXEventReader(createXMLStreamReader(systemId, inputstream));
+     }
+-    
++
+     public XMLEventReader createXMLEventReader(java.io.InputStream stream, String encoding) throws XMLStreamException {
+         return new StAXEventReader(createXMLStreamReader(stream, encoding));
+     }
+-    
++
+     public XMLEventReader createXMLEventReader(String systemId, Reader reader) throws XMLStreamException {
+         return new StAXEventReader(createXMLStreamReader(systemId, reader));
+     }
+-    
++
+     /** Create a new XMLEventReader from an XMLStreamReader.  After being used
+      * to construct the XMLEventReader instance returned from this method
+      * the XMLStreamReader must not be used.
+@@ -168,25 +168,25 @@
+     public XMLEventAllocator getEventAllocator() {
+         return (XMLEventAllocator)getProperty(XMLInputFactory.ALLOCATOR);
+     }
+-    
++
+     public XMLReporter getXMLReporter() {
+         return (XMLReporter)_manager.getProperty(XMLInputFactory.REPORTER);
+     }
+-    
++
+     public XMLResolver getXMLResolver() {
+         Object object = _manager.getProperty(XMLInputFactory.RESOLVER);
+         return (XMLResolver)object;
+         //return (XMLResolver)_manager.getProperty(XMLInputFactory.RESOLVER);
+     }
+-    
++
+     public void setXMLReporter(XMLReporter xmlreporter) {
+         _manager.setProperty(XMLInputFactory.REPORTER, xmlreporter);
+     }
+-    
++
+     public void setXMLResolver(XMLResolver xmlresolver) {
+         _manager.setProperty(XMLInputFactory.RESOLVER, xmlresolver);
+     }
+-    
++
+     /** Create a filtered event reader that wraps the filter around the event reader
+      * @param reader the event reader to wrap
+      * @param filter the filter to apply to the event reader
+@@ -195,7 +195,7 @@
+     public XMLEventReader createFilteredReader(XMLEventReader reader, EventFilter filter) throws XMLStreamException {
+         return new StAXFilteredEvent(reader, filter);
+     }
+-    
++
+     /** Create a filtered reader that wraps the filter around the reader
+      * @param reader the reader to filter
+      * @param filter the filter to apply to the reader
+@@ -202,15 +202,15 @@
+      * @throws XMLStreamException
+      */
+     public XMLStreamReader createFilteredReader(XMLStreamReader reader, StreamFilter filter) throws XMLStreamException {
+-        
++
+         if( reader != null && filter != null )
+             return new StAXFilteredParser(reader,filter);
+-        
++
+         return null;
+     }
+-    
+-    
+-    
++
++
++
+     /** Get the value of a feature/property from the underlying implementation
+      * @param name The name of the property (may not be null)
+      * @return The value of the property
+@@ -224,7 +224,7 @@
+             return _manager.getProperty(name);
+         throw new IllegalArgumentException(CommonResourceBundle.getInstance().getString("message.propertyNotSupported", new Object[]{name}));
+     }
+-    
++
+     /** Query the set of Properties that this factory supports.
+      *
+      * @param name The name of the property (may not be null)
+@@ -236,7 +236,7 @@
+         else
+             return _manager.containsProperty(name);
+     }
+-    
++
+     /** Set a user defined event allocator for events
+      * @param allocator the user defined allocator
+      */
+@@ -243,7 +243,7 @@
+     public void setEventAllocator(XMLEventAllocator allocator) {
+         _manager.setProperty(XMLInputFactory.ALLOCATOR, allocator);
+     }
+-    
++
+     /** Allows the user to set specific feature/property on the underlying implementation. The underlying implementation
+      * is not required to support every setting of every property in the specification and may use IllegalArgumentException
+      * to signal that an unsupported property may not be set with the specified value.
+@@ -254,5 +254,5 @@
+     public void setProperty(String name, Object value) throws IllegalArgumentException {
+         _manager.setProperty(name,value);
+     }
+-    
++
+ }
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/stax/factory/StAXOutputFactory.java	Thu Jul 30 18:03:28 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/factory/StAXOutputFactory.java	Thu Jul 30 18:03:27 2009
+@@ -24,9 +24,9 @@
+  *
+  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
+  */
+- 
+ 
+ 
++
+ package com.sun.xml.internal.fastinfoset.stax.factory;
+ 
+ import com.sun.xml.internal.fastinfoset.stax.*;
+@@ -45,31 +45,31 @@
+ import com.sun.xml.internal.fastinfoset.CommonResourceBundle;
+ 
+ public class StAXOutputFactory extends XMLOutputFactory {
+-        
++
+     //List of supported properties and default values.
+     private StAXManager _manager = null ;
+-    
++
+     /** Creates a new instance of StAXOutputFactory */
+     public StAXOutputFactory() {
+         _manager = new StAXManager(StAXManager.CONTEXT_WRITER);
+     }
+-    
++
+     public XMLEventWriter createXMLEventWriter(Result result) throws XMLStreamException {
+         return new StAXEventWriter(createXMLStreamWriter(result));
+     }
+-    
++
+     public XMLEventWriter createXMLEventWriter(Writer writer) throws XMLStreamException {
+         return new StAXEventWriter(createXMLStreamWriter(writer));
+     }
+-    
++
+     public XMLEventWriter createXMLEventWriter(OutputStream outputStream) throws XMLStreamException {
+         return new StAXEventWriter(createXMLStreamWriter(outputStream));
+     }
+-    
++
+     public XMLEventWriter createXMLEventWriter(OutputStream outputStream, String encoding) throws XMLStreamException {
+         return new StAXEventWriter(createXMLStreamWriter(outputStream, encoding));
+     }
+-    
++
+     public XMLStreamWriter createXMLStreamWriter(Result result) throws XMLStreamException {
+         if(result instanceof StreamResult){
+             StreamResult streamResult = (StreamResult)result;
+@@ -97,7 +97,7 @@
+         }
+         throw new java.lang.UnsupportedOperationException();
+     }
+-    
++
+     /** this is assumed that user wants to write the file in xml format
+      *
+      */
+@@ -104,17 +104,17 @@
+     public XMLStreamWriter createXMLStreamWriter(Writer writer) throws XMLStreamException {
+         throw new java.lang.UnsupportedOperationException();
+     }
+-    
++
+     public XMLStreamWriter createXMLStreamWriter(OutputStream outputStream) throws XMLStreamException {
+         return new StAXDocumentSerializer(outputStream, new StAXManager(_manager));
+     }
+-    
++
+     public XMLStreamWriter createXMLStreamWriter(OutputStream outputStream, String encoding) throws XMLStreamException {
+         StAXDocumentSerializer serializer = new StAXDocumentSerializer(outputStream, new StAXManager(_manager));
+         serializer.setEncoding(encoding);
+         return serializer;
+     }
+-    
++
+     public Object getProperty(String name) throws java.lang.IllegalArgumentException {
+         if(name == null){
+             throw new IllegalArgumentException(CommonResourceBundle.getInstance().getString("message.propertyNotSupported", new Object[]{null}));
+@@ -123,7 +123,7 @@
+             return _manager.getProperty(name);
+         throw new IllegalArgumentException(CommonResourceBundle.getInstance().getString("message.propertyNotSupported", new Object[]{name}));
+     }
+-    
++
+     public boolean isPropertySupported(String name) {
+         if(name == null)
+             return false ;
+@@ -130,10 +130,10 @@
+         else
+             return _manager.containsProperty(name);
+     }
+-    
++
+     public void setProperty(String name, Object value) throws java.lang.IllegalArgumentException {
+         _manager.setProperty(name,value);
+-        
++
+     }
+-        
++
+ }
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/stax/util/StAXFilteredParser.java	Thu Jul 30 18:03:32 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/util/StAXFilteredParser.java	Thu Jul 30 18:03:31 2009
+@@ -24,8 +24,8 @@
+  *
+  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
+  */
+- 
+ 
++
+ package com.sun.xml.internal.fastinfoset.stax.util;
+ 
+ import javax.xml.stream.XMLStreamException;
+@@ -36,7 +36,7 @@
+ 
+ public class StAXFilteredParser extends StAXParserWrapper {
+     private StreamFilter _filter;
+-    
++
+     /** Creates a new instance of StAXFilteredParser */
+     public StAXFilteredParser() {
+     }
+@@ -44,7 +44,7 @@
+         super(reader);
+         _filter = filter;
+     }
+-    
++
+     public void setFilter(StreamFilter filter) {
+         _filter = filter;
+     }
+@@ -64,5 +64,5 @@
+         }
+         return false;
+     }
+-    
++
+ }
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/stax/util/StAXParserWrapper.java	Thu Jul 30 18:03:35 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/util/StAXParserWrapper.java	Thu Jul 30 18:03:34 2009
+@@ -24,8 +24,8 @@
+  *
+  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
+  */
+- 
+ 
++
+ package com.sun.xml.internal.fastinfoset.stax.util;
+ 
+ import javax.xml.namespace.QName;
+@@ -38,7 +38,7 @@
+ 
+ public class StAXParserWrapper implements XMLStreamReader{
+     private XMLStreamReader _reader;
+-    
++
+     /** Creates a new instance of StAXParserWrapper */
+     public StAXParserWrapper() {
+     }
+@@ -53,17 +53,17 @@
+         return _reader;
+     }
+ 
+-    public int next() throws XMLStreamException 
++    public int next() throws XMLStreamException
+     {
+         return _reader.next();
+     }
+ 
+-    public int nextTag() throws XMLStreamException 
++    public int nextTag() throws XMLStreamException
+     {
+         return _reader.nextTag();
+     }
+ 
+-    public String getElementText() throws XMLStreamException 
++    public String getElementText() throws XMLStreamException
+     {
+         return _reader.getElementText();
+     }
+@@ -83,7 +83,7 @@
+         _reader.close();
+     }
+ 
+-    public String getNamespaceURI(String prefix) 
++    public String getNamespaceURI(String prefix)
+     {
+         return _reader.getNamespaceURI(prefix);
+     }
+@@ -112,14 +112,14 @@
+         return _reader.getAttributeName(index);
+     }
+ 
+-    public int getTextCharacters(int sourceStart, char[] target, int targetStart, 
+-                               int length) throws XMLStreamException 
++    public int getTextCharacters(int sourceStart, char[] target, int targetStart,
++                               int length) throws XMLStreamException
+     {
+         return _reader.getTextCharacters(sourceStart, target, targetStart, length);
+     }
+ 
+     public String getAttributeValue(String namespaceUri,
+-                                  String localName) 
++                                  String localName)
+     {
+         return _reader.getAttributeValue(namespaceUri,localName);
+     }
+@@ -233,5 +233,5 @@
+ 
+     public Object getProperty(String name) {
+         return _reader.getProperty(name);
+-    }    
++    }
+ }
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/tools/FI_DOM_Or_XML_DOM_SAX_SAXEvent.java	Thu Jul 30 18:03:39 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/tools/FI_DOM_Or_XML_DOM_SAX_SAXEvent.java	Thu Jul 30 18:03:38 2009
+@@ -42,20 +42,20 @@
+ import org.w3c.dom.Document;
+ 
+ public class FI_DOM_Or_XML_DOM_SAX_SAXEvent extends TransformInputOutput {
+-    
++
+     public void parse(InputStream document, OutputStream events, String workingDirectory) throws Exception {
+         if (!document.markSupported()) {
+             document = new BufferedInputStream(document);
+         }
+-        
++
+         document.mark(4);
+         boolean isFastInfosetDocument = Decoder.isFastInfosetDocument(document);
+         document.reset();
+-        
++
+         DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+         dbf.setNamespaceAware(true);
+         DocumentBuilder db = dbf.newDocumentBuilder();
+-        
++
+         Document d;
+         if (isFastInfosetDocument) {
+             d = db.newDocument();
+@@ -67,21 +67,21 @@
+             }
+             d = db.parse(document);
+         }
+-        
++
+         SAXEventSerializer ses = new SAXEventSerializer(events);
+-        
++
+         TransformerFactory tf = TransformerFactory.newInstance();
+         Transformer t = tf.newTransformer();
+         t.transform(new DOMSource(d), new SAXResult(ses));
+     }
+-    
++
+     public void parse(InputStream document, OutputStream events) throws Exception {
+         parse(document, events, null);
+     }
+-    
++
+     public static void main(String[] args) throws Exception {
+         FI_DOM_Or_XML_DOM_SAX_SAXEvent p = new FI_DOM_Or_XML_DOM_SAX_SAXEvent();
+         p.parse(args);
+     }
+-    
++
+ }
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/tools/FI_SAX_Or_XML_SAX_DOM_SAX_SAXEvent.java	Thu Jul 30 18:03:42 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/tools/FI_SAX_Or_XML_SAX_DOM_SAX_SAXEvent.java	Thu Jul 30 18:03:42 2009
+@@ -46,23 +46,23 @@
+ import org.xml.sax.XMLReader;
+ 
+ public class FI_SAX_Or_XML_SAX_DOM_SAX_SAXEvent extends TransformInputOutput {
+-    
++
+     public FI_SAX_Or_XML_SAX_DOM_SAX_SAXEvent() {
+     }
+-    
++
+     public void parse(InputStream document, OutputStream events, String workingDirectory) throws Exception {
+         if (!document.markSupported()) {
+             document = new BufferedInputStream(document);
+         }
+-        
++
+         document.mark(4);
+         boolean isFastInfosetDocument = Decoder.isFastInfosetDocument(document);
+         document.reset();
+-        
++
+         TransformerFactory tf = TransformerFactory.newInstance();
+         Transformer t = tf.newTransformer();
+         DOMResult dr = new DOMResult();
+-        
++
+         if (isFastInfosetDocument) {
+             t.transform(new FastInfosetSource(document), dr);
+         } else if (workingDirectory != null) {
+@@ -70,20 +70,20 @@
+             XMLReader reader = parser.getXMLReader();
+             reader.setEntityResolver(createRelativePathResolver(workingDirectory));
+             SAXSource source = new SAXSource(reader, new InputSource(document));
+-            
++
+             t.transform(source, dr);
+         } else {
+             t.transform(new StreamSource(document), dr);
+         }
+-        
++
+         SAXEventSerializer ses = new SAXEventSerializer(events);
+         t.transform(new DOMSource(dr.getNode()), new SAXResult(ses));
+     }
+-    
++
+     public void parse(InputStream document, OutputStream events) throws Exception {
+         parse(document, events, null);
+     }
+-    
++
+     private SAXParser getParser() {
+         SAXParserFactory saxParserFactory = SAXParserFactory.newInstance();
+         saxParserFactory.setNamespaceAware(true);
+@@ -93,10 +93,10 @@
+             return null;
+         }
+     }
+-    
++
+     public static void main(String[] args) throws Exception {
+         FI_SAX_Or_XML_SAX_DOM_SAX_SAXEvent p = new FI_SAX_Or_XML_SAX_DOM_SAX_SAXEvent();
+         p.parse(args);
+     }
+-    
++
+ }
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/tools/FI_SAX_Or_XML_SAX_SAXEvent.java	Thu Jul 30 18:03:46 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/tools/FI_SAX_Or_XML_SAX_SAXEvent.java	Thu Jul 30 18:03:45 2009
+@@ -40,19 +40,19 @@
+ import org.xml.sax.XMLReader;
+ 
+ public class FI_SAX_Or_XML_SAX_SAXEvent extends TransformInputOutput {
+-    
++
+     public FI_SAX_Or_XML_SAX_SAXEvent() {
+     }
+-    
++
+     public void parse(InputStream document, OutputStream events, String workingDirectory) throws Exception {
+         if (!document.markSupported()) {
+             document = new BufferedInputStream(document);
+         }
+-        
++
+         document.mark(4);
+         boolean isFastInfosetDocument = Decoder.isFastInfosetDocument(document);
+         document.reset();
+-        
++
+         if (isFastInfosetDocument) {
+             SAXDocumentParser parser = new SAXDocumentParser();
+             SAXEventSerializer ses = new SAXEventSerializer(events);
+@@ -64,7 +64,7 @@
+             parserFactory.setNamespaceAware(true);
+             SAXParser parser = parserFactory.newSAXParser();
+             SAXEventSerializer ses = new SAXEventSerializer(events);
+-            
++
+             XMLReader reader = parser.getXMLReader();
+             reader.setProperty("http://xml.org/sax/properties/lexical-handler", ses);
+             reader.setContentHandler(ses);
+@@ -74,11 +74,11 @@
+             reader.parse(new InputSource(document));
+         }
+     }
+-    
++
+     public void parse(InputStream document, OutputStream events) throws Exception {
+         parse(document, events, null);
+     }
+-    
++
+     public static void main(String[] args) throws Exception {
+         FI_SAX_Or_XML_SAX_SAXEvent p = new FI_SAX_Or_XML_SAX_SAXEvent();
+         p.parse(args);
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/tools/FI_SAX_XML.java	Thu Jul 30 18:03:49 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/tools/FI_SAX_XML.java	Thu Jul 30 18:03:48 2009
+@@ -24,9 +24,9 @@
+  *
+  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
+  */
+- 
+ 
+ 
++
+ package com.sun.xml.internal.fastinfoset.tools;
+ 
+ import com.sun.xml.internal.org.jvnet.fastinfoset.FastInfosetSource;
+@@ -37,17 +37,17 @@
+ import javax.xml.transform.stream.StreamResult;
+ 
+ public class FI_SAX_XML extends TransformInputOutput {
+-    
++
+     public FI_SAX_XML() {
+     }
+-    
++
+     public void parse(InputStream finf, OutputStream xml) throws Exception {
+         Transformer tx = TransformerFactory.newInstance().newTransformer();
+         tx.transform(new FastInfosetSource(finf), new StreamResult(xml));
+     }
+-    
+-    public static void main(String[] args) throws Exception {        
++
++    public static void main(String[] args) throws Exception {
+         FI_SAX_XML p = new FI_SAX_XML();
+         p.parse(args);
+-    }    
++    }
+ }
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/tools/FI_StAX_SAX_Or_XML_SAX_SAXEvent.java	Thu Jul 30 18:03:53 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/tools/FI_StAX_SAX_Or_XML_SAX_SAXEvent.java	Thu Jul 30 18:03:52 2009
+@@ -24,9 +24,9 @@
+  *
+  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
+  */
+- 
+ 
+ 
++
+ package com.sun.xml.internal.fastinfoset.tools;
+ 
+ import com.sun.xml.internal.fastinfoset.Decoder;
+@@ -40,7 +40,7 @@
+ import com.sun.xml.internal.fastinfoset.tools.StAX2SAXReader;
+ 
+ public class FI_StAX_SAX_Or_XML_SAX_SAXEvent extends TransformInputOutput {
+-    
++
+     public FI_StAX_SAX_Or_XML_SAX_SAXEvent() {
+     }
+ 
+@@ -48,11 +48,11 @@
+         if (!document.markSupported()) {
+             document = new BufferedInputStream(document);
+         }
+-        
++
+         document.mark(4);
+         boolean isFastInfosetDocument = Decoder.isFastInfosetDocument(document);
+         document.reset();
+-        
++
+         if (isFastInfosetDocument) {
+             StAXDocumentParser parser = new StAXDocumentParser();
+             parser.setInputStream(document);
+@@ -69,10 +69,10 @@
+             parser.parse(document, ses);
+         }
+     }
+-    
++
+     public static void main(String[] args) throws Exception {
+         FI_StAX_SAX_Or_XML_SAX_SAXEvent p = new FI_StAX_SAX_Or_XML_SAX_SAXEvent();
+         p.parse(args);
+-    }    
+-    
++    }
++
+ }
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/tools/PrintTable.java	Thu Jul 30 18:03:56 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/tools/PrintTable.java	Thu Jul 30 18:03:55 2009
+@@ -24,9 +24,9 @@
+  *
+  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
+  */
+- 
+ 
+ 
++
+ package com.sun.xml.internal.fastinfoset.tools;
+ 
+ import com.sun.xml.internal.fastinfoset.QualifiedName;
+@@ -45,11 +45,11 @@
+ 
+ 
+ public class PrintTable {
+-    
++
+     /** Creates a new instance of PrintTable */
+     public PrintTable() {
+     }
+-    
++
+     public static void printVocabulary(ParserVocabulary vocabulary) {
+         printArray("Attribute Name Table", vocabulary.attributeName);
+         printArray("Attribute Value Table", vocabulary.attributeValue);
+@@ -62,13 +62,13 @@
+         printArray("Other URI Table", vocabulary.otherURI);
+         printArray("Prefix Table", vocabulary.prefix);
+     }
+-    
++
+     public static void printArray(String title, StringArray a) {
+         System.out.println(title);
+ 
+         for (int i = 0; i < a.getSize(); i++) {
+             System.out.println("" + (i + 1) + ": " + a.getArray()[i]);
+-        }        
++        }
+     }
+ 
+     public static void printArray(String title, PrefixArray a) {
+@@ -76,15 +76,15 @@
+ 
+         for (int i = 0; i < a.getSize(); i++) {
+             System.out.println("" + (i + 1) + ": " + a.getArray()[i]);
+-        }        
++        }
+     }
+-    
++
+     public static void printArray(String title, CharArrayArray a) {
+         System.out.println(title);
+ 
+         for (int i = 0; i < a.getSize(); i++) {
+             System.out.println("" + (i + 1) + ": " + a.getArray()[i]);
+-        }        
++        }
+     }
+ 
+     public static void printArray(String title, ContiguousCharArrayArray a) {
+@@ -92,7 +92,7 @@
+ 
+         for (int i = 0; i < a.getSize(); i++) {
+             System.out.println("" + (i + 1) + ": " + a.getString(i));
+-        }        
++        }
+     }
+ 
+     public static void printArray(String title, QualifiedNameArray a) {
+@@ -100,12 +100,12 @@
+ 
+         for (int i = 0; i < a.getSize(); i++) {
+             QualifiedName name = a.getArray()[i];
+-            System.out.println("" + (name.index + 1) + ": " + 
+-                    "{" + name.namespaceName + "}" + 
++            System.out.println("" + (name.index + 1) + ": " +
++                    "{" + name.namespaceName + "}" +
+                     name.prefix + ":" + name.localName);
+-        }        
++        }
+     }
+-    
++
+     /**
+      * @param args the command line arguments
+      */
+@@ -117,11 +117,11 @@
+             SAXParser saxParser = saxParserFactory.newSAXParser();
+ 
+             ParserVocabulary referencedVocabulary = new ParserVocabulary();
+-        
++
+             VocabularyGenerator vocabularyGenerator = new VocabularyGenerator(referencedVocabulary);
+             File f = new File(args[0]);
+             saxParser.parse(f, vocabularyGenerator);
+-                        
++
+             printVocabulary(referencedVocabulary);
+         } catch (Exception e) {
+             e.printStackTrace();
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/tools/SAX2StAXWriter.java	Thu Jul 30 18:04:00 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/tools/SAX2StAXWriter.java	Thu Jul 30 18:03:59 2009
+@@ -24,9 +24,9 @@
+  *
+  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
+  */
+- 
+ 
+ 
++
+ package com.sun.xml.internal.fastinfoset.tools;
+ 
+ import com.sun.xml.internal.fastinfoset.QualifiedName;
+@@ -40,25 +40,25 @@
+ import org.xml.sax.helpers.DefaultHandler;
+ 
+ public class SAX2StAXWriter extends DefaultHandler implements LexicalHandler {
+-        
++
+     /**
+      * XML stream writer where events are pushed.
+      */
+     XMLStreamWriter _writer;
+-    
++
+     /**
+      * List of namespace decl for upcoming element.
+      */
+     ArrayList _namespaces = new ArrayList();
+-    
++
+     public SAX2StAXWriter(XMLStreamWriter writer) {
+         _writer = writer;
+     }
+-    
++
+     public XMLStreamWriter getWriter() {
+         return _writer;
+     }
+-    
++
+     public void startDocument() throws SAXException {
+         try {
+             _writer.writeStartDocument();
+@@ -67,7 +67,7 @@
+             throw new SAXException(e);
+         }
+     }
+-    
++
+     public void endDocument() throws SAXException {
+         try {
+             _writer.writeEndDocument();
+@@ -77,9 +77,9 @@
+             throw new SAXException(e);
+         }
+     }
+-    
+-    public void characters(char[] ch, int start, int length) 
+-        throws SAXException 
++
++    public void characters(char[] ch, int start, int length)
++        throws SAXException
+     {
+         try {
+             _writer.writeCharacters(ch, start, length);
+@@ -87,16 +87,16 @@
+         catch (XMLStreamException e) {
+             throw new SAXException(e);
+         }
+-    }    
+-    
+-    public void startElement(String namespaceURI, String localName, 
+-        String qName, Attributes atts) throws SAXException 
++    }
++
++    public void startElement(String namespaceURI, String localName,
++        String qName, Attributes atts) throws SAXException
+     {
+         try {
+             int k = qName.indexOf(':');
+             String prefix = (k > 0) ? qName.substring(0, k) : "";
+             _writer.writeStartElement(prefix, localName, namespaceURI);
+-            
++
+             int length = _namespaces.size();
+             for (int i = 0; i < length; i++) {
+                 QualifiedName nsh = (QualifiedName) _namespaces.get(i);
+@@ -103,21 +103,21 @@
+                 _writer.writeNamespace(nsh.prefix, nsh.namespaceName);
+             }
+             _namespaces.clear();
+-            
++
+             length = atts.getLength();
+             for (int i = 0; i < length; i++) {
+-                _writer.writeAttribute(atts.getURI(i), 
++                _writer.writeAttribute(atts.getURI(i),
+                                        atts.getLocalName(i),
+-                                       atts.getValue(i));                                       
++                                       atts.getValue(i));
+             }
+         }
+         catch (XMLStreamException e) {
+             throw new SAXException(e);
+-        }                
++        }
+     }
+-    
+-    public void endElement(String namespaceURI, String localName, 
+-        String qName) throws SAXException 
++
++    public void endElement(String namespaceURI, String localName,
++        String qName) throws SAXException
+     {
+         try {
+             _writer.writeEndElement();
+@@ -125,11 +125,11 @@
+         catch (XMLStreamException e) {
+             e.printStackTrace();
+             throw new SAXException(e);
+-        }        
++        }
+     }
+-    
+-    public void startPrefixMapping(String prefix, String uri) 
+-        throws SAXException 
++
++    public void startPrefixMapping(String prefix, String uri)
++        throws SAXException
+     {
+     // Commented as in StAX NS are declared for current element?
+     // now _writer.setPrefix() is invoked in _writer.writeNamespace()
+@@ -141,18 +141,18 @@
+ //            throw new SAXException(e);
+ //        }
+     }
+-    
++
+     public void endPrefixMapping(String prefix) throws SAXException {
+     }
+-    
+-    public void ignorableWhitespace(char[] ch, int start, int length) 
+-        throws SAXException 
++
++    public void ignorableWhitespace(char[] ch, int start, int length)
++        throws SAXException
+     {
+         characters(ch, start, length);
+     }
+-    
+-    public void processingInstruction(String target, String data) 
+-        throws SAXException 
++
++    public void processingInstruction(String target, String data)
++        throws SAXException
+     {
+         try {
+             _writer.writeProcessingInstruction(target, data);
+@@ -161,15 +161,15 @@
+             throw new SAXException(e);
+         }
+     }
+-    
++
+     public void setDocumentLocator(Locator locator) {
+     }
+-    
++
+     public void skippedEntity(String name) throws SAXException {
+     }
+-    
+-    public void comment(char[] ch, int start, int length) 
+-        throws SAXException 
++
++    public void comment(char[] ch, int start, int length)
++        throws SAXException
+     {
+         try {
+             _writer.writeComment(new String(ch, start, length));
+@@ -176,26 +176,25 @@
+         }
+         catch (XMLStreamException e) {
+             throw new SAXException(e);
+-        }        
+-    }    
+-    
++        }
++    }
++
+     public void endCDATA() throws SAXException {
+     }
+-    
++
+     public void endDTD() throws SAXException {
+     }
+-    
++
+     public void endEntity(String name) throws SAXException {
+     }
+-    
++
+     public void startCDATA() throws SAXException {
+     }
+-    
++
+     public void startDTD(String name, String publicId, String systemId) throws SAXException {
+     }
+-    
++
+     public void startEntity(String name) throws SAXException {
+     }
+-    
+-}
+ 
++}
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/tools/SAXEventSerializer.java	Thu Jul 30 18:04:03 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/tools/SAXEventSerializer.java	Thu Jul 30 18:04:02 2009
+@@ -24,9 +24,9 @@
+  *
+  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
+  */
+- 
+ 
+ 
++
+ package com.sun.xml.internal.fastinfoset.tools;
+ 
+ import java.io.IOException;
+@@ -46,24 +46,24 @@
+ public class SAXEventSerializer extends DefaultHandler
+         implements LexicalHandler {
+ 
+-    private Writer _writer; 
++    private Writer _writer;
+     private boolean _charactersAreCDATA;
+     private StringBuffer _characters;
+-    
+-    private Stack _namespaceStack = new Stack();    
++
++    private Stack _namespaceStack = new Stack();
+     protected List _namespaceAttributes;
+-    
++
+     public SAXEventSerializer(OutputStream s) throws IOException {
+         _writer = new OutputStreamWriter(s);
+         _charactersAreCDATA = false;
+     }
+-    
++
+     // -- ContentHandler interface ---------------------------------------
+ 
+     public void startDocument() throws SAXException {
+         try {
+             _writer.write("<sax xmlns=\"http://www.sun.com/xml/sax-events\">\n");
+-            _writer.write("<startDocument/>\n");   
++            _writer.write("<startDocument/>\n");
+             _writer.flush();
+         }
+         catch (IOException e) {
+@@ -73,7 +73,7 @@
+ 
+     public void endDocument() throws SAXException {
+         try {
+-            _writer.write("<endDocument/>\n");  
++            _writer.write("<endDocument/>\n");
+             _writer.write("</sax>");
+             _writer.flush();
+             _writer.close();
+@@ -83,26 +83,26 @@
+         }
+     }
+ 
+-    
+-    public void startPrefixMapping(String prefix, String uri) 
++
++    public void startPrefixMapping(String prefix, String uri)
+         throws SAXException
+     {
+         if (_namespaceAttributes == null) {
+             _namespaceAttributes = new ArrayList();
+         }
+-        
++
+         String qName = (prefix.length() == 0) ? "xmlns" : "xmlns" + prefix;
+         AttributeValueHolder attribute = new AttributeValueHolder(
+                 qName,
+-                prefix, 
+-                uri, 
++                prefix,
++                uri,
+                 null,
+                 null);
+-        _namespaceAttributes.add(attribute);            
++        _namespaceAttributes.add(attribute);
+     }
+-    
+-    public void endPrefixMapping(String prefix) 
+-        throws SAXException 
++
++    public void endPrefixMapping(String prefix)
++        throws SAXException
+     {
+         /*
+         try {
+@@ -120,16 +120,16 @@
+ 
+     public void startElement(String uri, String localName,
+             String qName, Attributes attributes)
+-        throws SAXException 
++        throws SAXException
+     {
+         try {
+             outputCharacters();
+ 
+             if (_namespaceAttributes != null) {
+-                
++
+                 AttributeValueHolder[] attrsHolder = new AttributeValueHolder[0];
+                 attrsHolder = (AttributeValueHolder[])_namespaceAttributes.toArray(attrsHolder);
+-                        
++
+                 // Sort attributes
+                 quicksort(attrsHolder, 0, attrsHolder.length - 1);
+ 
+@@ -138,24 +138,24 @@
+                         attrsHolder[i].localName + "\" uri=\"" + attrsHolder[i].uri + "\"/>\n");
+                     _writer.flush();
+                 }
+-                        
++
+                 _namespaceStack.push(attrsHolder);
+                 _namespaceAttributes = null;
+             } else {
+                 _namespaceStack.push(null);
+             }
+-            
+-            AttributeValueHolder[] attrsHolder = 
++
++            AttributeValueHolder[] attrsHolder =
+                 new AttributeValueHolder[attributes.getLength()];
+             for (int i = 0; i < attributes.getLength(); i++) {
+                 attrsHolder[i] = new AttributeValueHolder(
+-                    attributes.getQName(i), 
+-                    attributes.getLocalName(i), 
+-                    attributes.getURI(i), 
++                    attributes.getQName(i),
++                    attributes.getLocalName(i),
++                    attributes.getURI(i),
+                     attributes.getType(i),
+                     attributes.getValue(i));
+             }
+-            
++
+             // Sort attributes
+             quicksort(attrsHolder, 0, attrsHolder.length - 1);
+ 
+@@ -167,15 +167,15 @@
+                 }
+                 attributeCount++;
+             }
+-            
++
+             if (attributeCount == 0) {
+-                _writer.write("<startElement uri=\"" + uri 
++                _writer.write("<startElement uri=\"" + uri
+                     + "\" localName=\"" + localName + "\" qName=\""
+                     + qName + "\"/>\n");
+                 return;
+             }
+-            
+-            _writer.write("<startElement uri=\"" + uri 
++
++            _writer.write("<startElement uri=\"" + uri
+                 + "\" localName=\"" + localName + "\" qName=\""
+                 + qName + "\">\n");
+ 
+@@ -193,24 +193,24 @@
+                     "\" value=\"" + attrsHolder[i].value +
+                     "\"/>\n");
+             }
+-            
++
+             _writer.write("</startElement>\n");
+             _writer.flush();
+         }
+         catch (IOException e) {
+             throw new SAXException(e);
+-        }       
++        }
+     }
+ 
+     public void endElement(String uri, String localName, String qName)
+-            throws SAXException 
++            throws SAXException
+     {
+         try {
+             outputCharacters();
+ 
+-            _writer.write("<endElement uri=\"" + uri 
++            _writer.write("<endElement uri=\"" + uri
+                 + "\" localName=\"" + localName + "\" qName=\""
+-                + qName + "\"/>\n");   
++                + qName + "\"/>\n");
+             _writer.flush();
+ 
+             // Write out the end prefix here rather than waiting
+@@ -223,7 +223,7 @@
+                     _writer.flush();
+                 }
+             }
+-            
++
+         }
+         catch (IOException e) {
+             throw new SAXException(e);
+@@ -231,19 +231,19 @@
+     }
+ 
+     public void characters(char[] ch, int start, int length)
+-            throws SAXException 
++            throws SAXException
+     {
+         if (length == 0) {
+             return;
+         }
+-        
++
+         if (_characters == null) {
+             _characters = new StringBuffer();
+         }
+-        
++
+         // Coalesce multiple character events
+         _characters.append(ch, start, length);
+-        
++
+         /*
+         try {
+             _writer.write("<characters>" +
+@@ -263,7 +263,7 @@
+         if (_characters == null) {
+             return;
+         }
+-        
++
+         try {
+             _writer.write("<characters>" +
+                 (_charactersAreCDATA ? "<![CDATA[" : "") +
+@@ -277,9 +277,9 @@
+             throw new SAXException(e);
+         }
+     }
+-    
++
+     public void ignorableWhitespace(char[] ch, int start, int length)
+-            throws SAXException 
++            throws SAXException
+     {
+         // Report ignorable ws as characters (assumes validation off)
+         characters(ch, start, length);
+@@ -286,20 +286,20 @@
+     }
+ 
+     public void processingInstruction(String target, String data)
+-            throws SAXException 
++            throws SAXException
+     {
+         try {
+             outputCharacters();
+ 
+-            _writer.write("<processingInstruction target=\"" + target 
+-                + "\" data=\"" + data + "\"/>\n");   
++            _writer.write("<processingInstruction target=\"" + target
++                + "\" data=\"" + data + "\"/>\n");
+             _writer.flush();
+-        } 
++        }
+         catch (IOException e) {
+             throw new SAXException(e);
+         }
+     }
+-    
++
+     // -- LexicalHandler interface ---------------------------------------
+ 
+     public void startDTD(String name, String publicId, String systemId)
+@@ -333,7 +333,7 @@
+     }
+ 
+     public void comment(char[] ch, int start, int length)
+-            throws SAXException 
++            throws SAXException
+     {
+         try {
+             outputCharacters();
+@@ -347,9 +347,9 @@
+             throw new SAXException(e);
+         }
+     }
+-    
++
+     // -- Utility methods ------------------------------------------------
+-    
++
+     private void quicksort(AttributeValueHolder[] attrs, int p, int r) {
+         while (p < r) {
+             final int q = partition(attrs, p, r);
+@@ -357,7 +357,7 @@
+             p = q + 1;
+         }
+     }
+-                                                                                                                         
++
+     private int partition(AttributeValueHolder[] attrs, int p, int r) {
+         AttributeValueHolder x = attrs[(p + r) >>> 1];
+         int i = p - 1;
+@@ -375,7 +375,7 @@
+             }
+         }
+     }
+-    
++
+     public static class AttributeValueHolder implements Comparable {
+         public final String qName;
+         public final String localName;
+@@ -403,8 +403,7 @@
+             catch (Exception e) {
+                 throw new RuntimeException(CommonResourceBundle.getInstance().getString("message.AttributeValueHolderExpected"));
+             }
+-        }                                                                            
++        }
+     }
+ 
+ }
+-
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/tools/StAX2SAXReader.java	Thu Jul 30 18:04:07 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/tools/StAX2SAXReader.java	Thu Jul 30 18:04:06 2009
+@@ -24,9 +24,9 @@
+  *
+  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
+  */
+- 
+ 
+ 
++
+ package com.sun.xml.internal.fastinfoset.tools;
+ 
+ import javax.xml.namespace.QName;
+@@ -40,27 +40,27 @@
+ import com.sun.xml.internal.fastinfoset.CommonResourceBundle;
+ 
+ public class StAX2SAXReader {
+-    
++
+     /**
+      * Content handler where events are pushed.
+      */
+     ContentHandler _handler;
+-    
++
+     /**
+      * Lexical handler to report lexical events.
+      */
+     LexicalHandler _lexicalHandler;
+-    
++
+     /**
+      * XML stream reader where events are pulled.
+      */
+     XMLStreamReader _reader;
+-    
++
+     public StAX2SAXReader(XMLStreamReader reader, ContentHandler handler) {
+         _handler = handler;
+         _reader = reader;
+     }
+-    
++
+     public StAX2SAXReader(XMLStreamReader reader) {
+         _reader = reader;
+     }
+@@ -72,7 +72,7 @@
+     public void setLexicalHandler(LexicalHandler lexicalHandler) {
+         _lexicalHandler = lexicalHandler;
+     }
+-        
++
+     public void adapt() throws XMLStreamException, SAXException {
+         QName qname;
+         String prefix, localPart;
+@@ -80,11 +80,11 @@
+         char[] buffer;
+         int nsc;
+         int nat;
+-        
++
+         _handler.startDocument();
+-        
++
+         try {
+-            
++
+             while (_reader.hasNext()) {
+                 int event = _reader.next();
+ 
+@@ -94,7 +94,7 @@
+                     // Report namespace events first
+                     nsc = _reader.getNamespaceCount();
+                     for (int i = 0; i < nsc; i++) {
+-                        _handler.startPrefixMapping(_reader.getNamespacePrefix(i), 
++                        _handler.startPrefixMapping(_reader.getNamespacePrefix(i),
+                             _reader.getNamespaceURI(i));
+                     }
+ 
+@@ -112,7 +112,7 @@
+                         attrs.addAttribute(_reader.getAttributeNamespace(i),
+                                            q.getLocalPart(),
+                                            qName,
+-                                           _reader.getAttributeType(i), 
++                                           _reader.getAttributeType(i),
+                                            _reader.getAttributeValue(i));
+                     }
+ 
+@@ -122,9 +122,9 @@
+                     localPart = qname.getLocalPart();
+ 
+                     _handler.startElement(_reader.getNamespaceURI(),
+-                                          localPart, 
+-                                          (prefix.length() > 0) ? 
+-                                              (prefix + ":" + localPart) : localPart, 
++                                          localPart,
++                                          (prefix.length() > 0) ?
++                                              (prefix + ":" + localPart) : localPart,
+                                           attrs);
+                     break;
+                 }
+@@ -135,9 +135,9 @@
+                     localPart = qname.getLocalPart();
+ 
+                     _handler.endElement(_reader.getNamespaceURI(),
+-                                        localPart, 
++                                        localPart,
+                                         (prefix.length() > 0) ?
+-                                            (prefix + ":" + localPart) : localPart); 
++                                            (prefix + ":" + localPart) : localPart);
+ 
+                     // Report end namespace events
+                     nsc = _reader.getNamespaceCount();
+@@ -166,9 +166,8 @@
+             _handler.endDocument();     // flush whatever we have
+             throw e;
+         }
+-        
++
+         _handler.endDocument();
+     }
+ 
+ }
+-
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/tools/TransformInputOutput.java	Thu Jul 30 18:04:10 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/tools/TransformInputOutput.java	Thu Jul 30 18:04:10 2009
+@@ -44,11 +44,11 @@
+ import org.xml.sax.SAXException;
+ 
+ public abstract class TransformInputOutput {
+-    
++
+     /** Creates a new instance of TransformInputOutput */
+     public TransformInputOutput() {
+     }
+-    
++
+     public void parse(String[] args) throws Exception {
+         InputStream in = null;
+         OutputStream out = null;
+@@ -64,18 +64,18 @@
+         } else {
+             throw new IllegalArgumentException(CommonResourceBundle.getInstance().getString("message.optinalFileNotSpecified"));
+         }
+-        
++
+         parse(in, out);
+     }
+-    
++
+     abstract public void parse(InputStream in, OutputStream out) throws Exception;
+-    
++
+     // parse alternative with current working directory parameter
+     // is used to process xml documents, which have external imported entities
+     public void parse(InputStream in, OutputStream out, String workingDirectory) throws Exception {
+         throw new UnsupportedOperationException();
+     }
+-        
++
+     private static URI currentJavaWorkingDirectory;
+     static {
+         currentJavaWorkingDirectory = new File(System.getProperty("user.dir")).toURI();
+@@ -99,22 +99,22 @@
+             }
+         };
+     }
+-    
++
+     private static URI convertToNewWorkingDirectory(URI oldwd, URI newwd, URI file) throws IOException, URISyntaxException {
+         String oldwdStr = oldwd.toString();
+         String newwdStr = newwd.toString();
+         String fileStr = file.toString();
+-        
++
+         String cmpStr = null;
+         // In simpliest case <user.dir>/file.xml - do it faster
+         if (fileStr.startsWith(oldwdStr) && (cmpStr = fileStr.substring(oldwdStr.length())).indexOf('/') == -1) {
+             return new URI(newwdStr + '/' + cmpStr);
+         }
+-        
++
+         String[] oldwdSplit = oldwdStr.split("/");
+         String[] newwdSplit = newwdStr.split("/");
+         String[] fileSplit = fileStr.split("/");
+-        
++
+         int diff;
+         for(diff = 0; diff<oldwdSplit.length & diff<fileSplit.length; diff++) {
+             if (!oldwdSplit[diff].equals(fileSplit[diff])) {
+@@ -121,7 +121,7 @@
+                 break;
+             }
+         }
+-        
++
+         int diffNew;
+         for(diffNew=0; diffNew<newwdSplit.length && diffNew<fileSplit.length; diffNew++) {
+             if (!newwdSplit[diffNew].equals(fileSplit[diffNew])) {
+@@ -128,7 +128,7 @@
+                 break;
+             }
+         }
+-        
++
+         //Workaround for case, when extrnal imported entity has imports other entity
+         //in that case systemId has correct path, not based on user.dir
+         if (diffNew > diff) {
+@@ -141,12 +141,12 @@
+             resultStr.append(newwdSplit[i]);
+             resultStr.append('/');
+         }
+-                
++
+         for(int i=diff; i<fileSplit.length; i++) {
+             resultStr.append(fileSplit[i]);
+             if (i < fileSplit.length - 1) resultStr.append('/');
+         }
+-        
++
+         return new URI(resultStr.toString());
+     }
+ }
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/tools/VocabularyGenerator.java	Thu Jul 30 18:04:14 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/tools/VocabularyGenerator.java	Thu Jul 30 18:04:13 2009
+@@ -24,9 +24,9 @@
+  *
+  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
+  */
+- 
+ 
+ 
++
+ package com.sun.xml.internal.fastinfoset.tools;
+ 
+ import com.sun.xml.internal.fastinfoset.QualifiedName;
+@@ -50,27 +50,27 @@
+ import com.sun.xml.internal.org.jvnet.fastinfoset.FastInfosetSerializer;
+ 
+ public class VocabularyGenerator extends DefaultHandler implements LexicalHandler {
+-    
++
+     protected SerializerVocabulary _serializerVocabulary;
+     protected ParserVocabulary _parserVocabulary;
+-    protected com.sun.xml.internal.org.jvnet.fastinfoset.Vocabulary _v;    
+-    
+-    protected int attributeValueSizeConstraint = FastInfosetSerializer.ATTRIBUTE_VALUE_SIZE_CONSTRAINT;
+-    
+-    protected int characterContentChunkSizeContraint = FastInfosetSerializer.CHARACTER_CONTENT_CHUNK_SIZE_CONSTRAINT;
+-    
++    protected com.sun.xml.internal.org.jvnet.fastinfoset.Vocabulary _v;
++
++    protected int attributeValueSizeConstraint = FastInfosetSerializer.MAX_ATTRIBUTE_VALUE_SIZE;
++
++    protected int characterContentChunkSizeContraint = FastInfosetSerializer.MAX_CHARACTER_CONTENT_CHUNK_SIZE;
++
+     /** Creates a new instance of VocabularyGenerator */
+     public VocabularyGenerator() {
+         _serializerVocabulary = new SerializerVocabulary();
+         _parserVocabulary = new ParserVocabulary();
+-        
++
+         _v = new com.sun.xml.internal.org.jvnet.fastinfoset.Vocabulary();
+     }
+-    
++
+     public VocabularyGenerator(SerializerVocabulary serializerVocabulary) {
+         _serializerVocabulary = serializerVocabulary;
+         _parserVocabulary = new ParserVocabulary();
+-        
++
+         _v = new com.sun.xml.internal.org.jvnet.fastinfoset.Vocabulary();
+     }
+ 
+@@ -77,30 +77,30 @@
+     public VocabularyGenerator(ParserVocabulary parserVocabulary) {
+         _serializerVocabulary = new SerializerVocabulary();
+         _parserVocabulary = parserVocabulary;
+-        
++
+         _v = new com.sun.xml.internal.org.jvnet.fastinfoset.Vocabulary();
+     }
+-    
++
+     /** Creates a new instance of VocabularyGenerator */
+     public VocabularyGenerator(SerializerVocabulary serializerVocabulary, ParserVocabulary parserVocabulary) {
+         _serializerVocabulary = serializerVocabulary;
+         _parserVocabulary = parserVocabulary;
+-        
++
+         _v = new com.sun.xml.internal.org.jvnet.fastinfoset.Vocabulary();
+     }
+-    
++
+     public com.sun.xml.internal.org.jvnet.fastinfoset.Vocabulary getVocabulary() {
+         return _v;
+     }
+-    
++
+     public void setCharacterContentChunkSizeLimit(int size) {
+         if (size < 0 ) {
+             size = 0;
+         }
+-                
++
+         characterContentChunkSizeContraint = size;
+     }
+-    
++
+     public int getCharacterContentChunkSizeLimit() {
+         return characterContentChunkSizeContraint;
+     }
+@@ -109,22 +109,22 @@
+         if (size < 0 ) {
+             size = 0;
+         }
+-        
++
+         attributeValueSizeConstraint = size;
+     }
+-    
++
+     public int getAttributeValueSizeLimit() {
+         return attributeValueSizeConstraint;
+     }
+-    
++
+     // ContentHandler
+-    
++
+     public void startDocument() throws SAXException {
+     }
+ 
+     public void endDocument() throws SAXException {
+     }
+-    
++
+     public void startPrefixMapping(String prefix, String uri) throws SAXException {
+         addToTable(prefix, _v.prefixes, _serializerVocabulary.prefix, _parserVocabulary.prefix);
+         addToTable(uri, _v.namespaceNames, _serializerVocabulary.namespaceName, _parserVocabulary.namespaceName);
+@@ -134,13 +134,13 @@
+     }
+ 
+     public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException {
+-        addToNameTable(namespaceURI, qName, localName, 
++        addToNameTable(namespaceURI, qName, localName,
+                 _v.elements, _serializerVocabulary.elementName, _parserVocabulary.elementName, false);
+-        
+-        for (int a = 0; a < atts.getLength(); a++) {            
+-            addToNameTable(atts.getURI(a), atts.getQName(a), atts.getLocalName(a), 
++
++        for (int a = 0; a < atts.getLength(); a++) {
++            addToNameTable(atts.getURI(a), atts.getQName(a), atts.getLocalName(a),
+                     _v.attributes, _serializerVocabulary.attributeName, _parserVocabulary.attributeName, true);
+-        
++
+             String value = atts.getValue(a);
+             if (value.length() < attributeValueSizeConstraint) {
+                 addToTable(value, _v.attributeValues, _serializerVocabulary.attributeValue, _parserVocabulary.attributeValue);
+@@ -150,44 +150,44 @@
+ 
+     public void endElement(String namespaceURI, String localName, String qName) throws SAXException {
+     }
+-        
++
+     public void characters(char[] ch, int start, int length) throws SAXException {
+         if (length < characterContentChunkSizeContraint) {
+             addToCharArrayTable(new CharArray(ch, start, length, true));
+         }
+-    }    
++    }
+ 
+     public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException {
+     }
+-    
++
+     public void processingInstruction(String target, String data) throws SAXException {
+     }
+-    
++
+     public void setDocumentLocator(org.xml.sax.Locator locator) {
+     }
+-    
++
+     public void skippedEntity(String name) throws SAXException {
+     }
+-    
+-       
+ 
++
++
+     // LexicalHandler
+-    
++
+     public void comment(char[] ch, int start, int length) throws SAXException {
+     }
+-  
++
+     public void startCDATA() throws SAXException {
+     }
+-  
++
+     public void endCDATA() throws SAXException {
+     }
+-    
++
+     public void startDTD(String name, String publicId, String systemId) throws SAXException {
+     }
+ 
+     public void endDTD() throws SAXException {
+     }
+-    
++
+     public void startEntity(String name) throws SAXException {
+     }
+ 
+@@ -194,16 +194,16 @@
+     public void endEntity(String name) throws SAXException {
+     }
+ 
+-    
++
+     public void addToTable(String s, Set v, StringIntMap m, StringArray a) {
+         if (s.length() == 0) {
+             return;
+         }
+-        
++
+         if (m.obtainIndex(s) == KeyIntMap.NOT_PRESENT) {
+             a.add(s);
+         }
+-        
++
+         v.add(s);
+     }
+ 
+@@ -211,25 +211,25 @@
+         if (s.length() == 0) {
+             return;
+         }
+-        
++
+         if (m.obtainIndex(s) == KeyIntMap.NOT_PRESENT) {
+             a.add(s);
+         }
+-        
++
+         v.add(s);
+     }
+-    
++
+     public void addToCharArrayTable(CharArray c) {
+         if (_serializerVocabulary.characterContentChunk.obtainIndex(c.ch, c.start, c.length, false) == KeyIntMap.NOT_PRESENT) {
+             _parserVocabulary.characterContentChunk.add(c.ch, c.length);
+         }
+-        
++
+         _v.characterContentChunks.add(c.toString());
+     }
+ 
+-    public void addToNameTable(String namespaceURI, String qName, String localName, 
++    public void addToNameTable(String namespaceURI, String qName, String localName,
+             Set v, LocalNameQualifiedNamesMap m, QualifiedNameArray a,
+-            boolean isAttribute) throws SAXException {        
++            boolean isAttribute) throws SAXException {
+         LocalNameQualifiedNamesMap.Entry entry = m.obtainEntry(qName);
+         if (entry._valueIndex > 0) {
+             QualifiedName[] names = entry._value;
+@@ -237,11 +237,11 @@
+                 if ((namespaceURI == names[i].namespaceName || namespaceURI.equals(names[i].namespaceName))) {
+                     return;
+                 }
+-            }                
+-        } 
+-        
++            }
++        }
++
+         String prefix = getPrefixFromQualifiedName(qName);
+-        
++
+         int namespaceURIIndex = -1;
+         int prefixIndex = -1;
+         int localNameIndex = -1;
+@@ -251,7 +251,7 @@
+                 throw new SAXException(CommonResourceBundle.getInstance().
+                         getString("message.namespaceURINotIndexed", new Object[]{Integer.valueOf(namespaceURIIndex)}));
+             }
+-            
++
+             if (prefix.length() > 0) {
+                 prefixIndex = _serializerVocabulary.prefix.get(prefix);
+                 if (prefixIndex == KeyIntMap.NOT_PRESENT) {
+@@ -260,13 +260,13 @@
+                 }
+             }
+         }
+-        
++
+         localNameIndex = _serializerVocabulary.localName.obtainIndex(localName);
+         if (localNameIndex == KeyIntMap.NOT_PRESENT) {
+             _parserVocabulary.localName.add(localName);
+             localNameIndex = _parserVocabulary.localName.getSize() - 1;
+         }
+-        QualifiedName name = new QualifiedName(prefix, namespaceURI, localName, m.getNextIndex(), 
++        QualifiedName name = new QualifiedName(prefix, namespaceURI, localName, m.getNextIndex(),
+                 prefixIndex, namespaceURIIndex, localNameIndex);
+         if (isAttribute) {
+             name.createAttributeValues(DuplicateAttributeVerifier.MAP_SIZE);
+@@ -273,10 +273,10 @@
+         }
+         entry.addQualifiedName(name);
+         a.add(name);
+-        
++
+         v.add(name.getQName());
+     }
+-        
++
+     public static String getPrefixFromQualifiedName(String qName) {
+         int i = qName.indexOf(':');
+         String prefix = "";
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/tools/XML_DOM_FI.java	Thu Jul 30 18:04:17 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/tools/XML_DOM_FI.java	Thu Jul 30 18:04:17 2009
+@@ -34,10 +34,10 @@
+ import org.w3c.dom.Document;
+ 
+ public class XML_DOM_FI extends TransformInputOutput {
+-    
++
+     public XML_DOM_FI() {
+     }
+-    
++
+     public void parse(InputStream document, OutputStream finf, String workingDirectory) throws Exception {
+         DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+         dbf.setNamespaceAware(true);
+@@ -46,19 +46,19 @@
+             db.setEntityResolver(createRelativePathResolver(workingDirectory));
+         }
+         Document d = db.parse(document);
+-        
++
+         DOMDocumentSerializer s = new DOMDocumentSerializer();
+         s.setOutputStream(finf);
+         s.serialize(d);
+     }
+-    
++
+     public void parse(InputStream document, OutputStream finf) throws Exception {
+         parse(document, finf, null);
+     }
+-    
++
+     public static void main(String[] args) throws Exception {
+         XML_DOM_FI p = new XML_DOM_FI();
+         p.parse(args);
+     }
+-    
++
+ }
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/tools/XML_DOM_SAX_FI.java	Thu Jul 30 18:04:21 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/tools/XML_DOM_SAX_FI.java	Thu Jul 30 18:04:20 2009
+@@ -41,10 +41,10 @@
+ import org.w3c.dom.Document;
+ 
+ public class XML_DOM_SAX_FI extends TransformInputOutput {
+-    
++
+     public XML_DOM_SAX_FI() {
+     }
+-    
++
+     public void parse(InputStream document, OutputStream finf, String workingDirectory) throws Exception {
+         DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+         dbf.setNamespaceAware(true);
+@@ -53,19 +53,19 @@
+             db.setEntityResolver(createRelativePathResolver(workingDirectory));
+         }
+         Document d = db.parse(document);
+-        
++
+         TransformerFactory tf = TransformerFactory.newInstance();
+         Transformer t = tf.newTransformer();
+         t.transform(new DOMSource(d), new FastInfosetResult(finf));
+     }
+-    
++
+     public void parse(InputStream document, OutputStream finf) throws Exception {
+         parse(document, finf, null);
+     }
+-    
++
+     public static void main(String[] args) throws Exception {
+         XML_DOM_SAX_FI p = new XML_DOM_SAX_FI();
+         p.parse(args);
+     }
+-    
++
+ }
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/tools/XML_SAX_FI.java	Thu Jul 30 18:04:24 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/tools/XML_SAX_FI.java	Thu Jul 30 18:04:24 2009
+@@ -38,38 +38,38 @@
+ import org.xml.sax.XMLReader;
+ 
+ public class XML_SAX_FI extends TransformInputOutput {
+-    
++
+     public XML_SAX_FI() {
+     }
+-    
++
+     public void parse(InputStream xml, OutputStream finf, String workingDirectory) throws Exception {
+         SAXParser saxParser = getParser();
+         SAXDocumentSerializer documentSerializer = getSerializer(finf);
+-        
++
+         XMLReader reader = saxParser.getXMLReader();
+         reader.setProperty("http://xml.org/sax/properties/lexical-handler", documentSerializer);
+         reader.setContentHandler(documentSerializer);
+-        
++
+         if (workingDirectory != null) {
+             reader.setEntityResolver(createRelativePathResolver(workingDirectory));
+         }
+         reader.parse(new InputSource(xml));
+     }
+-    
++
+     public void parse(InputStream xml, OutputStream finf) throws Exception {
+         parse(xml, finf, null);
+     }
+-    
++
+     public void convert(Reader reader, OutputStream finf) throws Exception {
+         InputSource is = new InputSource(reader);
+-        
++
+         SAXParser saxParser = getParser();
+         SAXDocumentSerializer documentSerializer = getSerializer(finf);
+-        
++
+         saxParser.setProperty("http://xml.org/sax/properties/lexical-handler", documentSerializer);
+         saxParser.parse(is, documentSerializer);
+     }
+-    
++
+     private SAXParser getParser() {
+         SAXParserFactory saxParserFactory = SAXParserFactory.newInstance();
+         saxParserFactory.setNamespaceAware(true);
+@@ -79,13 +79,13 @@
+             return null;
+         }
+     }
+-    
++
+     private SAXDocumentSerializer getSerializer(OutputStream finf) {
+         SAXDocumentSerializer documentSerializer = new SAXDocumentSerializer();
+         documentSerializer.setOutputStream(finf);
+         return documentSerializer;
+     }
+-    
++
+     public static void main(String[] args) throws Exception {
+         XML_SAX_FI s = new XML_SAX_FI();
+         s.parse(args);
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/tools/XML_SAX_StAX_FI.java	Thu Jul 30 18:04:28 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/tools/XML_SAX_StAX_FI.java	Thu Jul 30 18:04:27 2009
+@@ -37,40 +37,40 @@
+ import org.xml.sax.XMLReader;
+ 
+ public class XML_SAX_StAX_FI extends TransformInputOutput {
+-    
++
+     public XML_SAX_StAX_FI() {
+     }
+-    
++
+     public void parse(InputStream xml, OutputStream finf, String workingDirectory) throws Exception {
+         StAXDocumentSerializer documentSerializer = new StAXDocumentSerializer();
+         documentSerializer.setOutputStream(finf);
+-        
++
+         SAX2StAXWriter saxTostax = new SAX2StAXWriter(documentSerializer);
+-        
++
+         SAXParserFactory saxParserFactory = SAXParserFactory.newInstance();
+         saxParserFactory.setNamespaceAware(true);
+         SAXParser saxParser = saxParserFactory.newSAXParser();
+-        
++
+         XMLReader reader = saxParser.getXMLReader();
+         reader.setProperty("http://xml.org/sax/properties/lexical-handler", saxTostax);
+         reader.setContentHandler(saxTostax);
+-        
++
+         if (workingDirectory != null) {
+             reader.setEntityResolver(createRelativePathResolver(workingDirectory));
+         }
+         reader.parse(new InputSource(xml));
+-        
++
+         xml.close();
+         finf.close();
+     }
+-    
++
+     public void parse(InputStream xml, OutputStream finf) throws Exception {
+         parse(xml, finf, null);
+     }
+-    
++
+     public static void main(String[] args) throws Exception {
+         XML_SAX_StAX_FI s = new XML_SAX_StAX_FI();
+         s.parse(args);
+     }
+-    
++
+ }
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/util/CharArray.java	Thu Jul 30 18:04:31 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/util/CharArray.java	Thu Jul 30 18:04:31 2009
+@@ -24,8 +24,8 @@
+  *
+  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
+  */
+- 
+ 
++
+ package com.sun.xml.internal.fastinfoset.util;
+ 
+ public class CharArray implements CharSequence {
+@@ -32,16 +32,16 @@
+     public char[] ch;
+     public int start;
+     public int length;
+-                                                                                
++
+     protected int _hash;
+ 
+     protected CharArray() {
+     }
+-    
++
+     public CharArray(char[] _ch, int _start, int _length, boolean copy) {
+         set(_ch, _start, _length, copy);
+     }
+-    
++
+     public final void set(char[] _ch, int _start, int _length, boolean copy) {
+         if (copy) {
+             ch = new char[_length];
+@@ -55,7 +55,7 @@
+         }
+         _hash = 0;
+     }
+-    
++
+     public final void cloneArray() {
+         char[] _ch = new char[length];
+         System.arraycopy(ch, start, _ch, 0, length);
+@@ -62,11 +62,11 @@
+         ch = _ch;
+         start = 0;
+     }
+-                                                                                
++
+     public String toString() {
+         return new String(ch, start, length);
+     }
+-                                                                                
++
+     public int hashCode() {
+         if (_hash == 0) {
+             // Same hash code algorithm as used for String
+@@ -85,15 +85,15 @@
+         for (int i = start; i < start + length; i++) {
+             hash = 31*hash + ch[i];
+         }
+-        
++
+         return hash;
+     }
+-    
++
+     public final boolean equalsCharArray(CharArray cha) {
+         if (this == cha) {
+             return true;
+         }
+-        
++
+         if (length == cha.length) {
+             int n = length;
+             int i = start;
+@@ -104,7 +104,7 @@
+             }
+             return true;
+         }
+-        
++
+         return false;
+     }
+ 
+@@ -119,10 +119,10 @@
+             }
+             return true;
+         }
+-        
++
+         return false;
+     }
+-    
++
+     public boolean equals(Object obj) {
+         if (this == obj) {
+             return true;
+@@ -144,7 +144,7 @@
+     }
+ 
+     // CharSequence interface
+-    
++
+     public final int length() {
+         return length;
+     }
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/util/CharArrayArray.java	Thu Jul 30 18:04:35 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/util/CharArrayArray.java	Thu Jul 30 18:04:35 2009
+@@ -24,19 +24,19 @@
+  *
+  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
+  */
+- 
+ 
+ 
++
+ package com.sun.xml.internal.fastinfoset.util;
+ 
+ import com.sun.xml.internal.fastinfoset.CommonResourceBundle;
+ 
+ public class CharArrayArray extends ValueArray {
+-    
++
+     private CharArray[] _array;
+-    
++
+     private CharArrayArray _readOnlyArray;
+-    
++
+     public CharArrayArray(int initialCapacity, int maximumCapacity) {
+         _array = new CharArray[initialCapacity];
+         _maximumCapacity = maximumCapacity;
+@@ -45,7 +45,7 @@
+     public CharArrayArray() {
+         this(DEFAULT_CAPACITY, MAXIMUM_CAPACITY);
+     }
+-    
++
+     public final void clear() {
+         for (int i = 0; i < _size; i++) {
+             _array[i] = null;
+@@ -56,12 +56,12 @@
+     public final CharArray[] getArray() {
+         return _array;
+     }
+-    
++
+     public final void setReadOnlyArray(ValueArray readOnlyArray, boolean clear) {
+         if (!(readOnlyArray instanceof CharArrayArray)) {
+             throw new IllegalArgumentException(CommonResourceBundle.getInstance().getString("message.illegalClass", new Object[]{readOnlyArray}));
+-        }       
+-        
++        }
++
+         setReadOnlyArray((CharArrayArray)readOnlyArray, clear);
+     }
+ 
+@@ -69,33 +69,33 @@
+         if (readOnlyArray != null) {
+             _readOnlyArray = readOnlyArray;
+             _readOnlyArraySize = readOnlyArray.getSize();
+-                        
++
+             if (clear) {
+                 clear();
+             }
+         }
+     }
+-    
++
+     public final CharArray get(int i) {
+         if (_readOnlyArray == null) {
+             return _array[i];
+         } else {
+             if (i < _readOnlyArraySize) {
+-               return _readOnlyArray.get(i); 
++               return _readOnlyArray.get(i);
+             } else {
+                 return _array[i - _readOnlyArraySize];
+             }
+         }
+    }
+-    
++
+     public final void add(CharArray s) {
+         if (_size == _array.length) {
+             resize();
+         }
+-            
++
+        _array[_size++] = s;
+     }
+-    
++
+     protected final void resize() {
+         if (_size == _maximumCapacity) {
+             throw new ValueArrayResourceException(CommonResourceBundle.getInstance().getString("message.arrayMaxCapacity"));
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/util/CharArrayIntMap.java	Thu Jul 30 18:04:39 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/util/CharArrayIntMap.java	Thu Jul 30 18:04:38 2009
+@@ -24,8 +24,8 @@
+  *
+  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
+  */
+- 
+ 
++
+ package com.sun.xml.internal.fastinfoset.util;
+ 
+ import com.sun.xml.internal.fastinfoset.CommonResourceBundle;
+@@ -36,13 +36,13 @@
+ 
+     // Total character count of Map
+     protected int _totalCharacterCount;
+-    
++
+     static class Entry extends BaseEntry {
+         final char[] _ch;
+         final int _start;
+         final int _length;
+         Entry _next;
+-        
++
+         public Entry(char[] ch, int start, int length, int hash, int value, Entry next) {
+             super(hash, value);
+             _ch = ch;
+@@ -50,7 +50,7 @@
+             _length = length;
+             _next = next;
+         }
+-        
++
+         public final boolean equalsCharArray(char[] ch, int start, int length) {
+             if (_length == length) {
+                 int n = _length;
+@@ -65,21 +65,21 @@
+ 
+             return false;
+         }
+-        
++
+     }
+-    
++
+     private Entry[] _table;
+-    
++
+     public CharArrayIntMap(int initialCapacity, float loadFactor) {
+         super(initialCapacity, loadFactor);
+ 
+-        _table = new Entry[_capacity];        
++        _table = new Entry[_capacity];
+     }
+-    
++
+     public CharArrayIntMap(int initialCapacity) {
+         this(initialCapacity, DEFAULT_LOAD_FACTOR);
+     }
+-    
++
+     public CharArrayIntMap() {
+         this(DEFAULT_INITIAL_CAPACITY, DEFAULT_LOAD_FACTOR);
+     }
+@@ -96,27 +96,47 @@
+         if (!(readOnlyMap instanceof CharArrayIntMap)) {
+             throw new IllegalArgumentException(CommonResourceBundle.getInstance().
+                     getString("message.illegalClass", new Object[]{readOnlyMap}));
+-        }       
+-        
++        }
++
+         setReadOnlyMap((CharArrayIntMap)readOnlyMap, clear);
+     }
+-    
++
+     public final void setReadOnlyMap(CharArrayIntMap readOnlyMap, boolean clear) {
+         _readOnlyMap = readOnlyMap;
+         if (_readOnlyMap != null) {
+             _readOnlyMapSize = _readOnlyMap.size();
+-            
++
+             if (clear) {
+                 clear();
+             }
+         }  else {
+             _readOnlyMapSize = 0;
+-        }     
++        }
+     }
+-    
++
++    /**
++     * Method returns an index of the passed character buffer in
++     * <code>CharArrayIntMap</code>.
++     *
++     * @return index of character buffer in <code>CharArrayIntMap</code>,
++     * otherwise NOT_PRESENT.
++     */
++    public final int get(char[] ch, int start, int length) {
++        final int hash = hashHash(CharArray.hashCode(ch, start, length));
++        return get(ch, start, length, hash);
++    }
++
++    /**
++     * Method returns an index of the passed character buffer in
++     * <code>CharArrayIntMap</code>. If character buffer is not in
++     * <code>CharArrayIntMap</code> - it will be added.
++     *
++     * @return index of character buffer in <code>CharArrayIntMap</code>, or
++     * NOT_PRESENT if character buffer was just added.
++     */
+     public final int obtainIndex(char[] ch, int start, int length, boolean clone) {
+         final int hash = hashHash(CharArray.hashCode(ch, start, length));
+-        
++
+         if (_readOnlyMap != null) {
+             final int index = _readOnlyMap.get(ch, start, length, hash);
+             if (index != -1) {
+@@ -123,7 +143,7 @@
+                 return index;
+             }
+         }
+-        
++
+         final int tableIndex = indexFor(hash, _table.length);
+         for (Entry e = _table[tableIndex]; e != null; e = e._next) {
+             if (e._hash == hash && e.equalsCharArray(ch, start, length)) {
+@@ -138,11 +158,11 @@
+             ch = chClone;
+             start = 0;
+         }
+-        
+-        addEntry(ch, start, length, hash, _size + _readOnlyMapSize, tableIndex);        
++
++        addEntry(ch, start, length, hash, _size + _readOnlyMapSize, tableIndex);
+         return NOT_PRESENT;
+     }
+-    
++
+     public final int getTotalCharacterCount() {
+         return _totalCharacterCount;
+     }
+@@ -161,19 +181,19 @@
+                 return e._value;
+             }
+         }
+-                
+-        return -1;
++
++        return NOT_PRESENT;
+     }
+ 
+     private final void addEntry(char[] ch, int start, int length, int hash, int value, int bucketIndex) {
+-	Entry e = _table[bucketIndex];
++        Entry e = _table[bucketIndex];
+         _table[bucketIndex] = new Entry(ch, start, length, hash, value, e);
+         _totalCharacterCount += length;
+                 if (_size++ >= _threshold) {
+             resize(2 * _table.length);
+-        }        
++        }
+     }
+-    
++
+     private final void resize(int newCapacity) {
+         _capacity = newCapacity;
+         Entry[] oldTable = _table;
+@@ -186,7 +206,7 @@
+         Entry[] newTable = new Entry[_capacity];
+         transfer(newTable);
+         _table = newTable;
+-        _threshold = (int)(_capacity * _loadFactor);        
++        _threshold = (int)(_capacity * _loadFactor);
+     }
+ 
+     private final void transfer(Entry[] newTable) {
+@@ -198,7 +218,7 @@
+                 src[j] = null;
+                 do {
+                     Entry next = e._next;
+-                    int i = indexFor(e._hash, newCapacity);  
++                    int i = indexFor(e._hash, newCapacity);
+                     e._next = newTable[i];
+                     newTable[i] = e;
+                     e = next;
+@@ -205,5 +225,5 @@
+                 } while (e != null);
+             }
+         }
+-    }        
++    }
+ }
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/util/CharArrayString.java	Thu Jul 30 18:04:42 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/util/CharArrayString.java	Thu Jul 30 18:04:42 2009
+@@ -24,14 +24,14 @@
+  *
+  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
+  */
+- 
+ 
+ 
++
+ package com.sun.xml.internal.fastinfoset.util;
+ 
+ public class CharArrayString extends CharArray {
+     protected String _s;
+-    
++
+     public CharArrayString(String s) {
+         this(s, true);
+     }
+@@ -44,15 +44,15 @@
+             length = ch.length;
+         }
+     }
+-    
++
+     public String toString() {
+         return _s;
+     }
+-                                                                                
++
+     public int hashCode() {
+         return _s.hashCode();
+     }
+-                                                                                
++
+     public boolean equals(Object obj) {
+         if (this == obj) {
+             return true;
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/util/ContiguousCharArrayArray.java	Thu Jul 30 18:04:46 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/util/ContiguousCharArrayArray.java	Thu Jul 30 18:04:45 2009
+@@ -32,22 +32,22 @@
+ public class ContiguousCharArrayArray extends ValueArray {
+     public static final int INITIAL_CHARACTER_SIZE = 512;
+     public static final int MAXIMUM_CHARACTER_SIZE = Integer.MAX_VALUE;
+-    
++
+     protected int _maximumCharacterSize;
+-    
++
+     public int[] _offset;
+     public int[] _length;
+-    
++
+     public char[] _array;
+     public int _arrayIndex;
+     public int _readOnlyArrayIndex;
+-    
++
+     private String[] _cachedStrings;
+-    
++
+     public int _cachedIndex;
+-    
++
+     private ContiguousCharArrayArray _readOnlyArray;
+-    
++
+     public ContiguousCharArrayArray(int initialCapacity, int maximumCapacity,
+             int initialCharacterSize, int maximumCharacterSize) {
+         _offset = new int[initialCapacity];
+@@ -56,16 +56,16 @@
+         _maximumCapacity = maximumCapacity;
+         _maximumCharacterSize = maximumCharacterSize;
+     }
+-    
++
+     public ContiguousCharArrayArray() {
+         this(DEFAULT_CAPACITY, MAXIMUM_CAPACITY,
+                 INITIAL_CHARACTER_SIZE, MAXIMUM_CHARACTER_SIZE);
+     }
+-    
++
+     public final void clear() {
+         _arrayIndex = _readOnlyArrayIndex;
+         _size = _readOnlyArraySize;
+-        
++
+         if (_cachedStrings != null) {
+             for (int i = _readOnlyArraySize; i < _cachedStrings.length; i++) {
+                 _cachedStrings[i] = null;
+@@ -72,29 +72,29 @@
+             }
+         }
+     }
+-    
++
+     public final int getArrayIndex() {
+         return _arrayIndex;
+     }
+-    
++
+     public final void setReadOnlyArray(ValueArray readOnlyArray, boolean clear) {
+         if (!(readOnlyArray instanceof ContiguousCharArrayArray)) {
+             throw new IllegalArgumentException(CommonResourceBundle.getInstance().getString("message.illegalClass", new Object[]{readOnlyArray}));
+         }
+-        
++
+         setReadOnlyArray((ContiguousCharArrayArray)readOnlyArray, clear);
+     }
+-    
++
+     public final void setReadOnlyArray(ContiguousCharArrayArray readOnlyArray, boolean clear) {
+         if (readOnlyArray != null) {
+             _readOnlyArray = readOnlyArray;
+             _readOnlyArraySize = readOnlyArray.getSize();
+             _readOnlyArrayIndex = readOnlyArray.getArrayIndex();
+-            
++
+             if (clear) {
+                 clear();
+             }
+-            
++
+             _array = getCompleteCharArray();
+             _offset = getCompleteOffsetArray();
+             _length = getCompleteLengthArray();
+@@ -101,7 +101,7 @@
+             _size = _readOnlyArraySize;
+         }
+     }
+-    
++
+     public final char[] getCompleteCharArray() {
+         if (_readOnlyArray == null) {
+             return _array;
+@@ -112,7 +112,7 @@
+             return a;
+         }
+     }
+-    
++
+     public final int[] getCompleteOffsetArray() {
+         if (_readOnlyArray == null) {
+             return _offset;
+@@ -123,7 +123,7 @@
+             return a;
+         }
+     }
+-    
++
+     public final int[] getCompleteLengthArray() {
+         if (_readOnlyArray == null) {
+             return _length;
+@@ -134,91 +134,91 @@
+             return a;
+         }
+     }
+-        
++
+     public final String getString(int i) {
+         if (_cachedStrings != null && i < _cachedStrings.length) {
+             final String s = _cachedStrings[i];
+             return (s != null) ? s : (_cachedStrings[i] = new String(_array, _offset[i], _length[i]));
+         }
+-        
++
+         final String[] newCachedStrings = new String[_offset.length];
+         if (_cachedStrings != null && i >= _cachedStrings.length) {
+             System.arraycopy(_cachedStrings, 0, newCachedStrings, 0, _cachedStrings.length);
+         }
+         _cachedStrings = newCachedStrings;
+-        
++
+         return _cachedStrings[i] = new String(_array, _offset[i], _length[i]);
+     }
+-    
++
+     public final void ensureSize(int l) {
+         if (_arrayIndex + l >= _array.length) {
+             resizeArray(_arrayIndex + l);
+-        }        
++        }
+     }
+-    
++
+     public final void add(int l) {
+         if (_size == _offset.length) {
+             resize();
+         }
+-        
++
+         _cachedIndex = _size;
+         _offset[_size] = _arrayIndex;
+         _length[_size++] = l;
+-                
++
+         _arrayIndex += l;
+     }
+-    
++
+     public final int add(char[] c, int l) {
+         if (_size == _offset.length) {
+             resize();
+         }
+-        
++
+         final int oldArrayIndex = _arrayIndex;
+         final int arrayIndex = oldArrayIndex + l;
+-        
++
+         _cachedIndex = _size;
+         _offset[_size] = oldArrayIndex;
+         _length[_size++] = l;
+-        
++
+         if (arrayIndex >= _array.length) {
+             resizeArray(arrayIndex);
+         }
+-        
++
+         System.arraycopy(c, 0, _array, oldArrayIndex, l);
+-        
++
+         _arrayIndex = arrayIndex;
+         return oldArrayIndex;
+     }
+-    
++
+     protected final void resize() {
+         if (_size == _maximumCapacity) {
+             throw new ValueArrayResourceException(CommonResourceBundle.getInstance().getString("message.arrayMaxCapacity"));
+         }
+-        
++
+         int newSize = _size * 3 / 2 + 1;
+         if (newSize > _maximumCapacity) {
+             newSize = _maximumCapacity;
+         }
+-        
++
+         final int[] offset = new int[newSize];
+         System.arraycopy(_offset, 0, offset, 0, _size);
+         _offset = offset;
+-        
++
+         final int[] length = new int[newSize];
+         System.arraycopy(_length, 0, length, 0, _size);
+         _length = length;
+     }
+-    
++
+     protected final void resizeArray(int requestedSize) {
+         if (_arrayIndex == _maximumCharacterSize) {
+             throw new ValueArrayResourceException(CommonResourceBundle.getInstance().getString("message.maxNumberOfCharacters"));
+         }
+-        
++
+         int newSize = requestedSize * 3 / 2 + 1;
+         if (newSize > _maximumCharacterSize) {
+             newSize = _maximumCharacterSize;
+         }
+-        
++
+         final char[] array = new char[newSize];
+         System.arraycopy(_array, 0, array, 0, _arrayIndex);
+         _array = array;
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/util/DuplicateAttributeVerifier.java	Thu Jul 30 18:04:50 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/util/DuplicateAttributeVerifier.java	Thu Jul 30 18:04:49 2009
+@@ -32,29 +32,29 @@
+ 
+ public class DuplicateAttributeVerifier {
+     public static final int MAP_SIZE = 256;
+-    
++
+     public int _currentIteration;
+-    
+-    private static class Entry {
++
++    public static class Entry {
+         private int iteration;
+         private int value;
+-        
++
+         private Entry hashNext;
+-        
++
+         private Entry poolNext;
+     }
+-    
++
+     private Entry[] _map;
+-       
++
+     public final Entry _poolHead;
+     public Entry _poolCurrent;
+     private Entry _poolTail;
+-    
+-    
++
++
+     public DuplicateAttributeVerifier() {
+         _poolTail = _poolHead = new Entry();
+     }
+-    
++
+     public final void clear() {
+         _currentIteration = 0;
+ 
+@@ -63,10 +63,10 @@
+             e.iteration = 0;
+             e = e.poolNext;
+         }
+-        
++
+         reset();
+     }
+-    
++
+     public final void reset() {
+         _poolCurrent = _poolHead;
+         if (_map == null) {
+@@ -73,7 +73,7 @@
+             _map = new Entry[MAP_SIZE];
+         }
+     }
+-    
++
+     private final void increasePool(int capacity) {
+         if (_map == null) {
+             _map = new Entry[MAP_SIZE];
+@@ -89,12 +89,12 @@
+             _poolCurrent = tail.poolNext;
+         }
+     }
+-    
++
+     public final void checkForDuplicateAttribute(int hash, int value) throws FastInfosetException {
+         if (_poolCurrent == null) {
+             increasePool(16);
+         }
+-        
++
+         // Get next free entry
+         final Entry newEntry = _poolCurrent;
+         _poolCurrent = _poolCurrent.poolNext;
+@@ -113,11 +113,11 @@
+                     throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.duplicateAttribute"));
+                 }
+             } while ((e = e.hashNext) != null);
+-            
++
+             newEntry.hashNext = head;
+             _map[hash] = newEntry;
+             newEntry.iteration = _currentIteration;
+             newEntry.value = value;
+-        }        
++        }
+     }
+ }
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/util/FixedEntryStringIntMap.java	Thu Jul 30 18:04:53 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/util/FixedEntryStringIntMap.java	Thu Jul 30 18:04:52 2009
+@@ -24,20 +24,20 @@
+  *
+  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
+  */
+- 
+ 
+ 
++
+ package com.sun.xml.internal.fastinfoset.util;
+ 
+ import com.sun.xml.internal.fastinfoset.CommonResourceBundle;
+ 
+ public class FixedEntryStringIntMap extends StringIntMap {
+-    
++
+     private Entry _fixedEntry;
+ 
+     public FixedEntryStringIntMap(String fixedEntry, int initialCapacity, float loadFactor) {
+         super(initialCapacity, loadFactor);
+-        
++
+         // Add the fixed entry
+         final int hash = hashHash(fixedEntry.hashCode());
+         final int tableIndex = indexFor(hash, _table.length);
+@@ -46,7 +46,7 @@
+             resize(2 * _table.length);
+         }
+     }
+-    
++
+     public FixedEntryStringIntMap(String fixedEntry, int initialCapacity) {
+         this(fixedEntry, initialCapacity, DEFAULT_LOAD_FACTOR);
+     }
+@@ -60,7 +60,7 @@
+             _table[i] = null;
+         }
+         _lastEntry = NULL_ENTRY;
+-        
++
+         if (_fixedEntry != null) {
+             final int tableIndex = indexFor(_fixedEntry._hash, _table.length);
+             _table[tableIndex] = _fixedEntry;
+@@ -77,11 +77,11 @@
+         if (!(readOnlyMap instanceof FixedEntryStringIntMap)) {
+             throw new IllegalArgumentException(CommonResourceBundle.getInstance().
+                     getString("message.illegalClass", new Object[]{readOnlyMap}));
+-        }       
+-        
++        }
++
+         setReadOnlyMap((FixedEntryStringIntMap)readOnlyMap, clear);
+     }
+-    
++
+     public final void setReadOnlyMap(FixedEntryStringIntMap readOnlyMap, boolean clear) {
+         _readOnlyMap = readOnlyMap;
+         if (_readOnlyMap != null) {
+@@ -93,9 +93,9 @@
+             }
+         }  else {
+             _readOnlyMapSize = 0;
+-        }     
++        }
+     }
+-    
++
+     private final void removeFixedEntry() {
+         if (_fixedEntry != null) {
+             final int tableIndex = indexFor(_fixedEntry._hash, _table.length);
+@@ -109,9 +109,9 @@
+                 }
+                 previousEntry._next = _fixedEntry._next;
+             }
+-            
++
+             _fixedEntry = null;
+             _size--;
+         }
+-    }    
++    }
+ }
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/util/KeyIntMap.java	Thu Jul 30 18:04:57 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/util/KeyIntMap.java	Thu Jul 30 18:04:56 2009
+@@ -24,15 +24,15 @@
+  *
+  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
+  */
+- 
+ 
+ 
++
+ package com.sun.xml.internal.fastinfoset.util;
+ import com.sun.xml.internal.fastinfoset.CommonResourceBundle;
+ 
+ public abstract class KeyIntMap {
+     public static final int NOT_PRESENT = -1;
+-    
++
+     /**
+      * The default initial capacity - MUST be a power of two.
+      */
+@@ -49,21 +49,21 @@
+      * The load factor used when none specified in constructor.
+      **/
+     static final float DEFAULT_LOAD_FACTOR = 0.75f;
+-    
++
+     int _readOnlyMapSize;
+-    
++
+     /**
+      * The number of key-value mappings contained in this identity hash map.
+      */
+     int _size;
+-  
++
+     int _capacity;
+-    
++
+     /**
+      * The next size value at which to resize (capacity * load factor).
+      */
+     int _threshold;
+-  
++
+     /**
+      * The load factor for the hash table.
+      */
+@@ -78,7 +78,7 @@
+             _value = value;
+         }
+     }
+- 
++
+     public KeyIntMap(int initialCapacity, float loadFactor) {
+         if (initialCapacity < 0)
+             throw new IllegalArgumentException(CommonResourceBundle.getInstance().
+@@ -92,7 +92,7 @@
+         // Find a power of 2 >= initialCapacity
+         if (initialCapacity != DEFAULT_INITIAL_CAPACITY) {
+             _capacity = 1;
+-            while (_capacity < initialCapacity) 
++            while (_capacity < initialCapacity)
+                 _capacity <<= 1;
+ 
+             _loadFactor = loadFactor;
+@@ -100,10 +100,10 @@
+         } else {
+             _capacity = DEFAULT_INITIAL_CAPACITY;
+             _loadFactor = DEFAULT_LOAD_FACTOR;
+-            _threshold = (int)(DEFAULT_INITIAL_CAPACITY * DEFAULT_LOAD_FACTOR);        
++            _threshold = (int)(DEFAULT_INITIAL_CAPACITY * DEFAULT_LOAD_FACTOR);
+         }
+     }
+-    
++
+     public KeyIntMap(int initialCapacity) {
+         this(initialCapacity, DEFAULT_LOAD_FACTOR);
+     }
+@@ -119,10 +119,10 @@
+     }
+ 
+     public abstract void clear();
+-    
++
+     public abstract void setReadOnlyMap(KeyIntMap readOnlyMap, boolean clear);
+ 
+-    
++
+     public static final int hashHash(int h) {
+         h += ~(h << 9);
+         h ^=  (h >>> 14);
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/util/LocalNameQualifiedNamesMap.java	Thu Jul 30 18:05:00 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/util/LocalNameQualifiedNamesMap.java	Thu Jul 30 18:04:59 2009
+@@ -24,9 +24,9 @@
+  *
+  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
+  */
+- 
+ 
+ 
++
+ package com.sun.xml.internal.fastinfoset.util;
+ 
+ import com.sun.xml.internal.fastinfoset.QualifiedName;
+@@ -35,9 +35,9 @@
+ public class LocalNameQualifiedNamesMap extends KeyIntMap {
+ 
+     private LocalNameQualifiedNamesMap _readOnlyMap;
+-   
++
+     private int _index;
+-    
++
+     public static class Entry {
+         final String _key;
+         final int _hash;
+@@ -44,7 +44,7 @@
+         public QualifiedName[] _value;
+         public int _valueIndex;
+         Entry _next;
+-        
++
+         public Entry(String key, int hash, Entry next) {
+             _key = key;
+             _hash = hash;
+@@ -51,7 +51,7 @@
+             _next = next;
+             _value = new QualifiedName[1];
+         }
+-        
++
+         public void addQualifiedName(QualifiedName name) {
+             if (_valueIndex < _value.length) {
+                 _value[_valueIndex++] = name;
+@@ -58,20 +58,20 @@
+             } else if (_valueIndex == _value.length) {
+                 QualifiedName[] newValue = new QualifiedName[_valueIndex * 3 / 2 + 1];
+                 System.arraycopy(_value, 0, newValue, 0, _valueIndex);
+-                _value = newValue;              
++                _value = newValue;
+                 _value[_valueIndex++] = name;
+             }
+         }
+     }
+-    
++
+     private Entry[] _table;
+-    
++
+     public LocalNameQualifiedNamesMap(int initialCapacity, float loadFactor) {
+         super(initialCapacity, loadFactor);
+ 
+-        _table = new Entry[_capacity];        
++        _table = new Entry[_capacity];
+     }
+-    
++
+     public LocalNameQualifiedNamesMap(int initialCapacity) {
+         this(initialCapacity, DEFAULT_LOAD_FACTOR);
+     }
+@@ -79,14 +79,14 @@
+     public LocalNameQualifiedNamesMap() {
+         this(DEFAULT_INITIAL_CAPACITY, DEFAULT_LOAD_FACTOR);
+     }
+-        
++
+     public final void clear() {
+         for (int i = 0; i < _table.length; i++) {
+             _table[i] = null;
+         }
+         _size = 0;
+-        
+-        if (_readOnlyMap != null) {        
++
++        if (_readOnlyMap != null) {
+             _index = _readOnlyMap.getIndex();
+         } else {
+             _index = 0;
+@@ -97,11 +97,11 @@
+         if (!(readOnlyMap instanceof LocalNameQualifiedNamesMap)) {
+             throw new IllegalArgumentException(CommonResourceBundle.getInstance().
+                     getString("message.illegalClass", new Object[]{readOnlyMap}));
+-        }       
+-        
++        }
++
+         setReadOnlyMap((LocalNameQualifiedNamesMap)readOnlyMap, clear);
+     }
+-    
++
+     public final void setReadOnlyMap(LocalNameQualifiedNamesMap readOnlyMap, boolean clear) {
+         _readOnlyMap = readOnlyMap;
+         if (_readOnlyMap != null) {
+@@ -113,24 +113,24 @@
+         }  else {
+             _readOnlyMapSize = 0;
+             _index = 0;
+-        }     
++        }
+     }
+-    
++
+     public final boolean isQNameFromReadOnlyMap(QualifiedName name) {
+         return (_readOnlyMap != null && name.index <= _readOnlyMap.getIndex());
+     }
+-    
++
+     public final int getNextIndex() {
+         return _index++;
+     }
+ 
+     public final int getIndex() {
+-        return _index;        
++        return _index;
+     }
+-    
++
+     public final Entry obtainEntry(String key) {
+         final int hash = hashHash(key.hashCode());
+-        
++
+         if (_readOnlyMap != null) {
+             final Entry entry = _readOnlyMap.getEntry(key, hash);
+             if (entry != null) {
+@@ -137,7 +137,7 @@
+                 return entry;
+             }
+         }
+-        
++
+         final int tableIndex = indexFor(hash, _table.length);
+         for (Entry e = _table[tableIndex]; e != null; e = e._next) {
+             if (e._hash == hash && eq(key, e._key)) {
+@@ -145,12 +145,12 @@
+             }
+         }
+ 
+-        return addEntry(key, hash, tableIndex);        
++        return addEntry(key, hash, tableIndex);
+     }
+-    
++
+     public final Entry obtainDynamicEntry(String key) {
+         final int hash = hashHash(key.hashCode());
+-        
++
+         final int tableIndex = indexFor(hash, _table.length);
+         for (Entry e = _table[tableIndex]; e != null; e = e._next) {
+             if (e._hash == hash && eq(key, e._key)) {
+@@ -158,7 +158,7 @@
+             }
+         }
+ 
+-        return addEntry(key, hash, tableIndex);        
++        return addEntry(key, hash, tableIndex);
+     }
+ 
+     private final Entry getEntry(String key, int hash) {
+@@ -175,22 +175,22 @@
+                 return e;
+             }
+         }
+-                
++
+         return null;
+     }
+ 
+ 
+     private final Entry addEntry(String key, int hash, int bucketIndex) {
+-	Entry e = _table[bucketIndex];
++        Entry e = _table[bucketIndex];
+         _table[bucketIndex] = new Entry(key, hash, e);
+         e = _table[bucketIndex];
+         if (_size++ >= _threshold) {
+             resize(2 * _table.length);
+         }
+-        
++
+         return e;
+     }
+-    
++
+     private final void resize(int newCapacity) {
+         _capacity = newCapacity;
+         Entry[] oldTable = _table;
+@@ -203,7 +203,7 @@
+         Entry[] newTable = new Entry[_capacity];
+         transfer(newTable);
+         _table = newTable;
+-        _threshold = (int)(_capacity * _loadFactor);        
++        _threshold = (int)(_capacity * _loadFactor);
+     }
+ 
+     private final void transfer(Entry[] newTable) {
+@@ -215,7 +215,7 @@
+                 src[j] = null;
+                 do {
+                     Entry next = e._next;
+-                    int i = indexFor(e._hash, newCapacity);  
++                    int i = indexFor(e._hash, newCapacity);
+                     e._next = newTable[i];
+                     newTable[i] = e;
+                     e = next;
+@@ -223,7 +223,7 @@
+             }
+         }
+     }
+-        
++
+     private final boolean eq(String x, String y) {
+         return x == y || x.equals(y);
+     }
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/util/NamespaceContextImplementation.java	Thu Jul 30 18:05:04 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/util/NamespaceContextImplementation.java	Thu Jul 30 18:05:03 2009
+@@ -38,31 +38,31 @@
+  */
+ final public class NamespaceContextImplementation implements NamespaceContext {
+     private static int DEFAULT_SIZE = 8;
+-    
++
+     private String[] prefixes = new String[DEFAULT_SIZE];
+     private String[] namespaceURIs = new String[DEFAULT_SIZE];
+     private int namespacePosition;
+-    
++
+     private int[] contexts = new int[DEFAULT_SIZE];
+     private int contextPosition;
+-    
++
+     private int currentContext;
+-    
++
+     public NamespaceContextImplementation() {
+         prefixes[0] = "xml";
+         namespaceURIs[0] = "http://www.w3.org/XML/1998/namespace";
+         prefixes[1] = "xmlns";
+         namespaceURIs[1] = "http://www.w3.org/2000/xmlns/";
+-        
++
+         currentContext = namespacePosition = 2;
+     }
+-    
+-    
++
++
+     public String getNamespaceURI(String prefix) {
+         if (prefix == null) throw new IllegalArgumentException();
+-        
++
+         prefix = prefix.intern();
+-        
++
+         for (int i = namespacePosition - 1; i >= 0; i--) {
+             final String declaredPrefix = prefixes[i];
+             if (declaredPrefix == prefix) {
+@@ -69,108 +69,113 @@
+                 return namespaceURIs[i];
+             }
+         }
+-        
++
+         return "";
+     }
+-    
++
+     public String getPrefix(String namespaceURI) {
+         if (namespaceURI == null) throw new IllegalArgumentException();
+-        
++
+         // namespaceURI = namespaceURI.intern();
+-        
++
+         for (int i = namespacePosition - 1; i >= 0; i--) {
+             final String declaredNamespaceURI = namespaceURIs[i];
+             if (declaredNamespaceURI == namespaceURI || declaredNamespaceURI.equals(namespaceURI)) {
+                 final String declaredPrefix = prefixes[i];
+-                
++
+                 // Check if prefix is out of scope
+-                for (++i; i < namespacePosition; i++)
+-                    if (declaredPrefix == prefixes[i])
+-                        return null;
+-                
+-                return declaredPrefix;
++                boolean isOutOfScope = false;
++                for (int j = i + 1; j < namespacePosition; j++)
++                    if (declaredPrefix == prefixes[j]) {
++                        isOutOfScope = true;
++                        break;
++                    }
++
++                if (!isOutOfScope) {
++                    return declaredPrefix;
++                }
+             }
+         }
+-        
++
+         return null;
+     }
+-    
++
+     public String getNonDefaultPrefix(String namespaceURI) {
+         if (namespaceURI == null) throw new IllegalArgumentException();
+-        
++
+         // namespaceURI = namespaceURI.intern();
+-        
++
+         for (int i = namespacePosition - 1; i >= 0; i--) {
+             final String declaredNamespaceURI = namespaceURIs[i];
+             if ((declaredNamespaceURI == namespaceURI || declaredNamespaceURI.equals(namespaceURI)) &&
+                 prefixes[i].length() > 0){
+                 final String declaredPrefix = prefixes[i];
+-                
++
+                 // Check if prefix is out of scope
+                 for (++i; i < namespacePosition; i++)
+                     if (declaredPrefix == prefixes[i])
+                         return null;
+-                
++
+                 return declaredPrefix;
+             }
+         }
+-        
++
+         return null;
+     }
+ 
+     public Iterator getPrefixes(String namespaceURI) {
+         if (namespaceURI == null) throw new IllegalArgumentException();
+-        
++
+         // namespaceURI = namespaceURI.intern();
+-        
++
+         List l = new ArrayList();
+-        
++
+         NAMESPACE_LOOP: for (int i = namespacePosition - 1; i >= 0; i--) {
+             final String declaredNamespaceURI = namespaceURIs[i];
+             if (declaredNamespaceURI == namespaceURI || declaredNamespaceURI.equals(namespaceURI)) {
+                 final String declaredPrefix = prefixes[i];
+-                
++
+                 // Check if prefix is out of scope
+                 for (int j = i + 1; j < namespacePosition; j++)
+                     if (declaredPrefix == prefixes[j])
+                         continue NAMESPACE_LOOP;
+-                
++
+                 l.add(declaredPrefix);
+             }
+         }
+-        
++
+         return l.iterator();
+     }
+-    
+-    
++
++
+     public String getPrefix(int index) {
+         return prefixes[index];
+     }
+-    
++
+     public String getNamespaceURI(int index) {
+         return namespaceURIs[index];
+     }
+-    
++
+     public int getCurrentContextStartIndex() {
+         return currentContext;
+     }
+-    
++
+     public int getCurrentContextEndIndex() {
+         return namespacePosition;
+     }
+-    
++
+     public boolean isCurrentContextEmpty() {
+         return currentContext == namespacePosition;
+     }
+-    
++
+     public void declarePrefix(String prefix, String namespaceURI) {
+         prefix = prefix.intern();
+         namespaceURI = namespaceURI.intern();
+-        
++
+         // Ignore the "xml" or "xmlns" declarations
+         if (prefix == "xml" || prefix == "xmlns")
+             return;
+-        
++
+         // Replace any previous declaration
+         for (int i = currentContext; i < namespacePosition; i++) {
+             final String declaredPrefix = prefixes[i];
+@@ -180,46 +185,46 @@
+                 return;
+             }
+         }
+-        
++
+         if (namespacePosition == namespaceURIs.length)
+             resizeNamespaces();
+-        
++
+         // Add new declaration
+         prefixes[namespacePosition] = prefix;
+         namespaceURIs[namespacePosition++] = namespaceURI;
+     }
+-    
++
+     private void resizeNamespaces() {
+         final int newLength = namespaceURIs.length * 3 / 2 + 1;
+-        
++
+         String[] newPrefixes = new String[newLength];
+         System.arraycopy(prefixes, 0, newPrefixes, 0, prefixes.length);
+         prefixes = newPrefixes;
+-        
++
+         String[] newNamespaceURIs = new String[newLength];
+         System.arraycopy(namespaceURIs, 0, newNamespaceURIs, 0, namespaceURIs.length);
+         namespaceURIs = newNamespaceURIs;
+     }
+-    
++
+     public void pushContext() {
+         if (contextPosition == contexts.length)
+             resizeContexts();
+-        
++
+         contexts[contextPosition++] = currentContext = namespacePosition;
+     }
+-    
++
+     private void resizeContexts() {
+         int[] newContexts = new int[contexts.length * 3 / 2 + 1];
+         System.arraycopy(contexts, 0, newContexts, 0, contexts.length);
+         contexts = newContexts;
+     }
+-    
++
+     public void popContext() {
+         if (contextPosition > 0) {
+             namespacePosition = currentContext = contexts[--contextPosition];
+         }
+     }
+-    
++
+     public void reset() {
+         currentContext = namespacePosition = 2;
+     }
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/util/PrefixArray.java	Thu Jul 30 18:05:07 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/util/PrefixArray.java	Thu Jul 30 18:05:07 2009
+@@ -35,11 +35,11 @@
+ 
+ public class PrefixArray extends ValueArray {
+     public static final int PREFIX_MAP_SIZE = 64;
+-    
++
+     private int _initialCapacity;
+-    
++
+     public String[] _array;
+-    
++
+     private PrefixArray _readOnlyArray;
+ 
+     private static class PrefixEntry {
+@@ -48,14 +48,14 @@
+     }
+ 
+     private PrefixEntry[] _prefixMap = new PrefixEntry[PREFIX_MAP_SIZE];
+-    
++
+     private PrefixEntry _prefixPool;
+-    
++
+     private static class NamespaceEntry {
+         private NamespaceEntry next;
+         private int declarationId;
+         private int namespaceIndex;
+-        
++
+         private String prefix;
+         private String namespaceName;
+         private int prefixEntryIndex;
+@@ -62,17 +62,17 @@
+     }
+ 
+     private NamespaceEntry _namespacePool;
+-    
++
+     private NamespaceEntry[] _inScopeNamespaces;
+-    
++
+     public int[] _currentInScope;
+-    
++
+     public int _declarationId;
+-    
++
+     public PrefixArray(int initialCapacity, int maximumCapacity) {
+         _initialCapacity = initialCapacity;
+         _maximumCapacity = maximumCapacity;
+-        
++
+         _array = new String[initialCapacity];
+         // Sizes of _inScopeNamespaces and _currentInScope need to be two
+         // greater than _array because 0 represents the empty string and
+@@ -79,10 +79,10 @@
+         // 1 represents the xml prefix
+         _inScopeNamespaces = new NamespaceEntry[initialCapacity + 2];
+         _currentInScope = new int[initialCapacity + 2];
+-        
++
+         increaseNamespacePool(initialCapacity);
+         increasePrefixPool(initialCapacity);
+-        
++
+         initializeEntries();
+     }
+ 
+@@ -93,18 +93,18 @@
+     private final void initializeEntries() {
+         _inScopeNamespaces[0] = _namespacePool;
+         _namespacePool = _namespacePool.next;
+-        _inScopeNamespaces[0].next = null;        
++        _inScopeNamespaces[0].next = null;
+         _inScopeNamespaces[0].prefix = "";
+         _inScopeNamespaces[0].namespaceName = "";
+         _inScopeNamespaces[0].namespaceIndex = _currentInScope[0] = 0;
+-        
++
+         int index = KeyIntMap.indexFor(KeyIntMap.hashHash(_inScopeNamespaces[0].prefix.hashCode()), _prefixMap.length);
+         _prefixMap[index] = _prefixPool;
+         _prefixPool = _prefixPool.next;
+         _prefixMap[index].next = null;
+         _prefixMap[index].prefixId = 0;
+-        
+-        
++
++
+         _inScopeNamespaces[1] = _namespacePool;
+         _namespacePool = _namespacePool.next;
+         _inScopeNamespaces[1].next = null;
+@@ -111,7 +111,7 @@
+         _inScopeNamespaces[1].prefix = EncodingConstants.XML_NAMESPACE_PREFIX;
+         _inScopeNamespaces[1].namespaceName = EncodingConstants.XML_NAMESPACE_NAME;
+         _inScopeNamespaces[1].namespaceIndex = _currentInScope[1] = 1;
+-        
++
+         index = KeyIntMap.indexFor(KeyIntMap.hashHash(_inScopeNamespaces[1].prefix.hashCode()), _prefixMap.length);
+         if (_prefixMap[index] == null) {
+             _prefixMap[index] = _prefixPool;
+@@ -125,12 +125,12 @@
+         }
+         _prefixMap[index].prefixId = 1;
+     }
+-    
++
+     private final void increaseNamespacePool(int capacity) {
+         if (_namespacePool == null) {
+             _namespacePool = new NamespaceEntry();
+         }
+-        
++
+         for (int i = 0; i < capacity; i++) {
+             NamespaceEntry ne = new NamespaceEntry();
+             ne.next = _namespacePool;
+@@ -137,12 +137,12 @@
+             _namespacePool = ne;
+         }
+     }
+-    
++
+     private final void increasePrefixPool(int capacity) {
+         if (_prefixPool == null) {
+             _prefixPool = new PrefixEntry();
+         }
+-        
++
+         for (int i = 0; i < capacity; i++) {
+             PrefixEntry pe = new PrefixEntry();
+             pe.next = _prefixPool;
+@@ -159,7 +159,7 @@
+         }
+         return i;
+     }
+-    
++
+     public int countPrefixPool() {
+         int i = 0;
+         PrefixEntry e = _prefixPool;
+@@ -169,7 +169,7 @@
+         }
+         return i;
+     }
+-    
++
+     public final void clear() {
+         for (int i = _readOnlyArraySize; i < _size; i++) {
+             _array[i] = null;
+@@ -180,36 +180,36 @@
+     public final void clearCompletely() {
+         _prefixPool = null;
+         _namespacePool = null;
+-        
++
+         for (int i = 0; i < _size + 2; i++) {
+             _currentInScope[i] = 0;
+-            _inScopeNamespaces[i] = null;            
++            _inScopeNamespaces[i] = null;
+         }
+-        
++
+         for (int i = 0; i < _prefixMap.length; i++) {
+             _prefixMap[i] = null;
+         }
+-                
++
+         increaseNamespacePool(_initialCapacity);
+         increasePrefixPool(_initialCapacity);
+-        
++
+         initializeEntries();
+-        
++
+         _declarationId = 0;
+-        
++
+         clear();
+     }
+-    
++
+     public final String[] getArray() {
+         return _array;
+     }
+-    
++
+     public final void setReadOnlyArray(ValueArray readOnlyArray, boolean clear) {
+         if (!(readOnlyArray instanceof PrefixArray)) {
+             throw new IllegalArgumentException(CommonResourceBundle.getInstance().
+                     getString("message.illegalClass", new Object[]{readOnlyArray}));
+-        }       
+-        
++        }
++
+         setReadOnlyArray((PrefixArray)readOnlyArray, clear);
+     }
+ 
+@@ -217,15 +217,15 @@
+         if (readOnlyArray != null) {
+             _readOnlyArray = readOnlyArray;
+             _readOnlyArraySize = readOnlyArray.getSize();
+-            
++
+             clearCompletely();
+-            
++
+             // Resize according to size of read only arrays
+             _inScopeNamespaces = new NamespaceEntry[_readOnlyArraySize + _inScopeNamespaces.length];
+             _currentInScope = new int[_readOnlyArraySize + _currentInScope.length];
+             // Intialize first two entries
+             initializeEntries();
+-            
++
+             if (clear) {
+                 clear();
+             }
+@@ -245,20 +245,20 @@
+             return a;
+         }
+     }
+-    
++
+     public final String get(int i) {
+         return _array[i];
+    }
+- 
++
+     public final int add(String s) {
+         if (_size == _array.length) {
+             resize();
+         }
+-            
++
+        _array[_size++] = s;
+        return _size;
+     }
+-    
++
+     protected final void resize() {
+         if (_size == _maximumCapacity) {
+             throw new ValueArrayResourceException(CommonResourceBundle.getInstance().getString("message.arrayMaxCapacity"));
+@@ -280,9 +280,9 @@
+ 
+         final int[] newCurrentInScope = new int[newSize];
+         System.arraycopy(_currentInScope, 0, newCurrentInScope, 0, _currentInScope.length);
+-        _currentInScope = newCurrentInScope;            
++        _currentInScope = newCurrentInScope;
+     }
+-    
++
+     public final void clearDeclarationIds() {
+         for (int i = 0; i < _size; i++) {
+             final NamespaceEntry e = _inScopeNamespaces[i];
+@@ -293,12 +293,12 @@
+ 
+         _declarationId = 1;
+     }
+-    
++
+     public final void pushScope(int prefixIndex, int namespaceIndex) throws FastInfosetException {
+         if (_namespacePool == null) {
+             increaseNamespacePool(16);
+         }
+-        
++
+         final NamespaceEntry e = _namespacePool;
+         _namespacePool = e.next;
+ 
+@@ -307,13 +307,13 @@
+             e.declarationId = _declarationId;
+             e.namespaceIndex = _currentInScope[prefixIndex] = ++namespaceIndex;
+             e.next = null;
+-            
++
+             _inScopeNamespaces[prefixIndex] = e;
+         } else if (current.declarationId < _declarationId) {
+             e.declarationId = _declarationId;
+             e.namespaceIndex = _currentInScope[prefixIndex] = ++namespaceIndex;
+             e.next = current;
+-            
++
+             current.declarationId = 0;
+             _inScopeNamespaces[prefixIndex] = e;
+         } else {
+@@ -320,7 +320,7 @@
+             throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.duplicateNamespaceAttribute"));
+         }
+     }
+-    
++
+     public final void pushScopeWithPrefixEntry(String prefix, String namespaceName,
+             int prefixIndex, int namespaceIndex) throws FastInfosetException {
+         if (_namespacePool == null) {
+@@ -329,7 +329,7 @@
+         if (_prefixPool == null) {
+             increasePrefixPool(16);
+         }
+-        
++
+         final NamespaceEntry e = _namespacePool;
+         _namespacePool = e.next;
+ 
+@@ -338,37 +338,37 @@
+             e.declarationId = _declarationId;
+             e.namespaceIndex = _currentInScope[prefixIndex] = ++namespaceIndex;
+             e.next = null;
+-            
++
+             _inScopeNamespaces[prefixIndex] = e;
+         } else if (current.declarationId < _declarationId) {
+             e.declarationId = _declarationId;
+             e.namespaceIndex = _currentInScope[prefixIndex] = ++namespaceIndex;
+             e.next = current;
+-            
++
+             current.declarationId = 0;
+             _inScopeNamespaces[prefixIndex] = e;
+         } else {
+             throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.duplicateNamespaceAttribute"));
+         }
+- 
++
+         final PrefixEntry p = _prefixPool;
+         _prefixPool = _prefixPool.next;
+         p.prefixId = prefixIndex;
+-                
++
+         e.prefix = prefix;
+         e.namespaceName = namespaceName;
+         e.prefixEntryIndex = KeyIntMap.indexFor(KeyIntMap.hashHash(prefix.hashCode()), _prefixMap.length);
+-        
++
+         final PrefixEntry pCurrent = _prefixMap[e.prefixEntryIndex];
+         p.next = pCurrent;
+         _prefixMap[e.prefixEntryIndex] = p;
+     }
+-    
++
+     public final void popScope(int prefixIndex) {
+         final NamespaceEntry e = _inScopeNamespaces[++prefixIndex];
+         _inScopeNamespaces[prefixIndex] = e.next;
+         _currentInScope[prefixIndex] = (e.next != null) ? e.next.namespaceIndex : 0;
+-        
++
+         e.next = _namespacePool;
+         _namespacePool = e;
+     }
+@@ -375,14 +375,14 @@
+ 
+     public final void popScopeWithPrefixEntry(int prefixIndex) {
+         final NamespaceEntry e = _inScopeNamespaces[++prefixIndex];
+-        
++
+         _inScopeNamespaces[prefixIndex] = e.next;
+         _currentInScope[prefixIndex] = (e.next != null) ? e.next.namespaceIndex : 0;
+-        
++
+         e.prefix = e.namespaceName = null;
+         e.next = _namespacePool;
+         _namespacePool = e;
+-        
++
+         PrefixEntry current = _prefixMap[e.prefixEntryIndex];
+         if (current.prefixId == prefixIndex) {
+             _prefixMap[e.prefixEntryIndex] = current.next;
+@@ -400,10 +400,10 @@
+                 }
+                 prev = current;
+                 current = current.next;
+-            }        
+-        }        
++            }
++        }
+     }
+-    
++
+     public final String getNamespaceFromPrefix(String prefix) {
+         final int index = KeyIntMap.indexFor(KeyIntMap.hashHash(prefix.hashCode()), _prefixMap.length);
+         PrefixEntry pe = _prefixMap[index];
+@@ -414,10 +414,10 @@
+             }
+             pe = pe.next;
+         }
+-        
++
+         return null;
+     }
+-    
++
+     public final String getPrefixFromNamespace(String namespaceName) {
+         int position = 0;
+         while (++position < _size + 2) {
+@@ -426,33 +426,33 @@
+                 return ne.prefix;
+             }
+         }
+-        
++
+         return null;
+     }
+-    
++
+     public final Iterator getPrefixes() {
+         return new Iterator() {
+             int _position = 1;
+             NamespaceEntry _ne = _inScopeNamespaces[_position];
+-            
++
+             public boolean hasNext() {
+                 return _ne != null;
+             }
+-            
++
+             public Object next() {
+                 if (_position == _size + 2) {
+                     throw new NoSuchElementException();
+                 }
+-                
++
+                 final String prefix = _ne.prefix;
+-                moveToNext();                
++                moveToNext();
+                 return prefix;
+             }
+-            
++
+             public void remove() {
+                 throw new UnsupportedOperationException();
+             }
+-            
++
+             private final void moveToNext() {
+                 while (++_position < _size + 2) {
+                     _ne = _inScopeNamespaces[_position];
+@@ -462,38 +462,38 @@
+                 }
+                 _ne = null;
+             }
+-            
+-        };        
++
++        };
+     }
+-    
++
+     public final Iterator getPrefixesFromNamespace(final String namespaceName) {
+         return new Iterator() {
+             String _namespaceName = namespaceName;
+             int _position = 0;
+             NamespaceEntry _ne;
+-            
++
+             {
+                 moveToNext();
+             }
+-            
++
+             public boolean hasNext() {
+                 return _ne != null;
+             }
+-            
++
+             public Object next() {
+                 if (_position == _size + 2) {
+                     throw new NoSuchElementException();
+                 }
+-                                
++
+                 final String prefix = _ne.prefix;
+                 moveToNext();
+                 return prefix;
+             }
+-            
++
+             public void remove() {
+                 throw new UnsupportedOperationException();
+             }
+-            
++
+             private final void moveToNext() {
+                 while (++_position < _size + 2) {
+                     _ne = _inScopeNamespaces[_position];
+@@ -503,6 +503,6 @@
+                 }
+                 _ne = null;
+             }
+-        };        
++        };
+     }
+ }
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/util/QualifiedNameArray.java	Thu Jul 30 18:05:11 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/util/QualifiedNameArray.java	Thu Jul 30 18:05:10 2009
+@@ -24,9 +24,9 @@
+  *
+  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
+  */
+- 
+ 
+ 
++
+ package com.sun.xml.internal.fastinfoset.util;
+ 
+ import com.sun.xml.internal.fastinfoset.QualifiedName;
+@@ -33,11 +33,11 @@
+ import com.sun.xml.internal.fastinfoset.CommonResourceBundle;
+ 
+ public class QualifiedNameArray extends ValueArray {
+-    
++
+     public QualifiedName[] _array;
+-    
++
+     private QualifiedNameArray _readOnlyArray;
+-        
++
+     public QualifiedNameArray(int initialCapacity, int maximumCapacity) {
+         _array = new QualifiedName[initialCapacity];
+         _maximumCapacity = maximumCapacity;
+@@ -46,7 +46,7 @@
+     public QualifiedNameArray() {
+         this(DEFAULT_CAPACITY, MAXIMUM_CAPACITY);
+     }
+-    
++
+     public final void clear() {
+         _size = _readOnlyArraySize;
+     }
+@@ -54,13 +54,13 @@
+     public final QualifiedName[] getArray() {
+         return _array;
+     }
+-    
++
+     public final void setReadOnlyArray(ValueArray readOnlyArray, boolean clear) {
+         if (!(readOnlyArray instanceof QualifiedNameArray)) {
+             throw new IllegalArgumentException(CommonResourceBundle.getInstance().
+                     getString("message.illegalClass", new Object[]{readOnlyArray}));
+-        }       
+-        
++        }
++
+         setReadOnlyArray((QualifiedNameArray)readOnlyArray, clear);
+     }
+ 
+@@ -68,11 +68,11 @@
+         if (readOnlyArray != null) {
+             _readOnlyArray = readOnlyArray;
+             _readOnlyArraySize = readOnlyArray.getSize();
+-                        
++
+             if (clear) {
+                 clear();
+             }
+-            
++
+             _array = getCompleteArray();
+             _size = _readOnlyArraySize;
+         }
+@@ -88,16 +88,16 @@
+             return a;
+         }
+     }
+- 
++
+     public final QualifiedName getNext() {
+         return (_size == _array.length) ? null : _array[_size];
+     }
+-    
++
+     public final void add(QualifiedName s) {
+         if (_size == _array.length) {
+             resize();
+         }
+-            
++
+        _array[_size++] = s;
+     }
+ 
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/util/StringArray.java	Thu Jul 30 18:05:14 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/util/StringArray.java	Thu Jul 30 18:05:14 2009
+@@ -24,20 +24,20 @@
+  *
+  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
+  */
+- 
+ 
+ 
++
+ package com.sun.xml.internal.fastinfoset.util;
+ import com.sun.xml.internal.fastinfoset.CommonResourceBundle;
+ 
+ public class StringArray extends ValueArray {
+-    
++
+     public String[] _array;
+-    
++
+     private StringArray _readOnlyArray;
+ 
+     private boolean _clear;
+-    
++
+     public StringArray(int initialCapacity, int maximumCapacity, boolean clear) {
+         _array = new String[initialCapacity];
+         _maximumCapacity = maximumCapacity;
+@@ -58,13 +58,13 @@
+     public final String[] getArray() {
+         return _array;
+     }
+-    
++
+     public final void setReadOnlyArray(ValueArray readOnlyArray, boolean clear) {
+         if (!(readOnlyArray instanceof StringArray)) {
+             throw new IllegalArgumentException(CommonResourceBundle.getInstance().
+                     getString("message.illegalClass", new Object[]{readOnlyArray}));
+-        }       
+-        
++        }
++
+         setReadOnlyArray((StringArray)readOnlyArray, clear);
+     }
+ 
+@@ -72,7 +72,7 @@
+         if (readOnlyArray != null) {
+             _readOnlyArray = readOnlyArray;
+             _readOnlyArraySize = readOnlyArray.getSize();
+-           
++
+             if (clear) {
+                 clear();
+             }
+@@ -92,20 +92,20 @@
+             return a;
+         }
+     }
+-    
++
+     public final String get(int i) {
+         return _array[i];
+     }
+- 
++
+     public final int add(String s) {
+         if (_size == _array.length) {
+             resize();
+         }
+-            
++
+        _array[_size++] = s;
+        return _size;
+     }
+-    
++
+     protected final void resize() {
+         if (_size == _maximumCapacity) {
+             throw new ValueArrayResourceException(CommonResourceBundle.getInstance().getString("message.arrayMaxCapacity"));
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/util/StringIntMap.java	Thu Jul 30 18:05:18 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/util/StringIntMap.java	Thu Jul 30 18:05:17 2009
+@@ -24,9 +24,9 @@
+  *
+  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
+  */
+- 
+ 
+ 
++
+ package com.sun.xml.internal.fastinfoset.util;
+ 
+ import com.sun.xml.internal.fastinfoset.CommonResourceBundle;
+@@ -33,13 +33,13 @@
+ 
+ public class StringIntMap extends KeyIntMap {
+     protected static final Entry NULL_ENTRY = new Entry(null, 0, -1, null);
+-    
++
+     protected StringIntMap _readOnlyMap;
+-    
++
+     protected static class Entry extends BaseEntry {
+         final String _key;
+         Entry _next;
+-        
++
+         public Entry(String key, int hash, int value, Entry next) {
+             super(hash, value);
+             _key = key;
+@@ -46,22 +46,22 @@
+             _next = next;
+         }
+     }
+-    
++
+     protected Entry _lastEntry = NULL_ENTRY;
+-    
++
+     protected Entry[] _table;
+-    
++
+     protected int _index;
+-    
++
+     // Total character count of Map
+     protected int _totalCharacterCount;
+-    
++
+     public StringIntMap(int initialCapacity, float loadFactor) {
+         super(initialCapacity, loadFactor);
+ 
+         _table = new Entry[_capacity];
+     }
+-    
++
+     public StringIntMap(int initialCapacity) {
+         this(initialCapacity, DEFAULT_LOAD_FACTOR);
+     }
+@@ -84,17 +84,17 @@
+         if (!(readOnlyMap instanceof StringIntMap)) {
+             throw new IllegalArgumentException(CommonResourceBundle.getInstance().
+                     getString("message.illegalClass", new Object[]{readOnlyMap}));
+-        }       
+-        
++        }
++
+         setReadOnlyMap((StringIntMap)readOnlyMap, clear);
+     }
+-    
++
+     public final void setReadOnlyMap(StringIntMap readOnlyMap, boolean clear) {
+         _readOnlyMap = readOnlyMap;
+         if (_readOnlyMap != null) {
+             _readOnlyMapSize = _readOnlyMap.size();
+             _index = _size + _readOnlyMapSize;
+-            
++
+             if (clear) {
+                 clear();
+             }
+@@ -101,20 +101,20 @@
+         }  else {
+             _readOnlyMapSize = 0;
+             _index = _size;
+-        }     
++        }
+     }
+-    
++
+     public final int getNextIndex() {
+         return _index++;
+     }
+-    
++
+     public final int getIndex() {
+-        return _index;        
++        return _index;
+     }
+-    
++
+     public final int obtainIndex(String key) {
+         final int hash = hashHash(key.hashCode());
+-        
++
+         if (_readOnlyMap != null) {
+             final int index = _readOnlyMap.get(key, hash);
+             if (index != -1) {
+@@ -121,7 +121,7 @@
+                 return index;
+             }
+         }
+-        
++
+         final int tableIndex = indexFor(hash, _table.length);
+         for (Entry e = _table[tableIndex]; e != null; e = e._next) {
+             if (e._hash == hash && eq(key, e._key)) {
+@@ -129,7 +129,7 @@
+             }
+         }
+ 
+-        addEntry(key, hash, tableIndex);        
++        addEntry(key, hash, tableIndex);
+         return NOT_PRESENT;
+     }
+ 
+@@ -142,14 +142,14 @@
+     public final int get(String key) {
+         if (key == _lastEntry._key)
+             return _lastEntry._value;
+-        
++
+         return get(key, hashHash(key.hashCode()));
+     }
+-    
++
+     public final int getTotalCharacterCount() {
+         return _totalCharacterCount;
+     }
+-    
++
+     private final int get(String key, int hash) {
+         if (_readOnlyMap != null) {
+             final int i = _readOnlyMap.get(key, hash);
+@@ -165,13 +165,13 @@
+                 return e._value;
+             }
+         }
+-                
+-        return -1;
++
++        return NOT_PRESENT;
+     }
+ 
+ 
+     private final void addEntry(String key, int hash, int bucketIndex) {
+-	Entry e = _table[bucketIndex];
++        Entry e = _table[bucketIndex];
+         _table[bucketIndex] = new Entry(key, hash, _index++, e);
+         _totalCharacterCount += key.length();
+         if (_size++ >= _threshold) {
+@@ -178,7 +178,7 @@
+             resize(2 * _table.length);
+         }
+     }
+-    
++
+     protected final void resize(int newCapacity) {
+         _capacity = newCapacity;
+         Entry[] oldTable = _table;
+@@ -191,7 +191,7 @@
+         Entry[] newTable = new Entry[_capacity];
+         transfer(newTable);
+         _table = newTable;
+-        _threshold = (int)(_capacity * _loadFactor);        
++        _threshold = (int)(_capacity * _loadFactor);
+     }
+ 
+     private final void transfer(Entry[] newTable) {
+@@ -203,7 +203,7 @@
+                 src[j] = null;
+                 do {
+                     Entry next = e._next;
+-                    int i = indexFor(e._hash, newCapacity);  
++                    int i = indexFor(e._hash, newCapacity);
+                     e._next = newTable[i];
+                     newTable[i] = e;
+                     e = next;
+@@ -211,7 +211,7 @@
+             }
+         }
+     }
+-        
++
+     private final boolean eq(String x, String y) {
+         return x == y || x.equals(y);
+     }
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/util/ValueArray.java	Thu Jul 30 18:05:22 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/util/ValueArray.java	Thu Jul 30 18:05:21 2009
+@@ -24,9 +24,9 @@
+  *
+  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
+  */
+- 
+ 
+ 
++
+ package com.sun.xml.internal.fastinfoset.util;
+ 
+ public abstract class ValueArray {
+@@ -34,11 +34,11 @@
+     public static final int MAXIMUM_CAPACITY = Integer.MAX_VALUE;
+ 
+     protected int _size;
+-    
+-    protected int _readOnlyArraySize;  
+-    
++
++    protected int _readOnlyArraySize;
++
+     protected int _maximumCapacity;
+-            
++
+     public int getSize() {
+         return _size;
+     }
+@@ -46,12 +46,12 @@
+     public int getMaximumCapacity() {
+         return _maximumCapacity;
+     }
+-    
++
+     public void setMaximumCapacity(int maximumCapacity) {
+         _maximumCapacity = maximumCapacity;
+     }
+-    
++
+     public abstract void setReadOnlyArray(ValueArray array, boolean clear);
+-    
++
+     public abstract void clear();
+ }
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/util/ValueArrayResourceException.java	Thu Jul 30 18:05:25 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/util/ValueArrayResourceException.java	Thu Jul 30 18:05:24 2009
+@@ -24,15 +24,15 @@
+  *
+  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
+  */
+- 
+ 
++
+ package com.sun.xml.internal.fastinfoset.util;
+ 
+ public class ValueArrayResourceException extends RuntimeException {
+-    
++
+     public ValueArrayResourceException() {
+     }
+-    
++
+     public ValueArrayResourceException(String message) {
+         super(message);
+     }
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/vocab/ParserVocabulary.java	Thu Jul 30 18:05:28 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/vocab/ParserVocabulary.java	Thu Jul 30 18:05:28 2009
+@@ -24,9 +24,9 @@
+  *
+  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
+  */
+- 
+ 
+ 
++
+ package com.sun.xml.internal.fastinfoset.vocab;
+ 
+ import com.sun.xml.internal.fastinfoset.EncodingConstants;
+@@ -46,26 +46,26 @@
+ import javax.xml.namespace.QName;
+ 
+ public class ParserVocabulary extends Vocabulary {
+-    public static final String IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS_PEOPERTY = 
++    public static final String IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS_PEOPERTY =
+         "com.sun.xml.internal.fastinfoset.vocab.ParserVocabulary.IdentifyingStringTable.maximumItems";
+-    public static final String NON_IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS_PEOPERTY = 
++    public static final String NON_IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS_PEOPERTY =
+         "com.sun.xml.internal.fastinfoset.vocab.ParserVocabulary.NonIdentifyingStringTable.maximumItems";
+-    public static final String NON_IDENTIFYING_STRING_TABLE_MAXIMUM_CHARACTERS_PEOPERTY = 
++    public static final String NON_IDENTIFYING_STRING_TABLE_MAXIMUM_CHARACTERS_PEOPERTY =
+         "com.sun.xml.internal.fastinfoset.vocab.ParserVocabulary.NonIdentifyingStringTable.maximumCharacters";
+ 
+     protected static final int IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS =
+             getIntegerValueFromProperty(IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS_PEOPERTY);
+-    protected static final int NON_IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS = 
++    protected static final int NON_IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS =
+             getIntegerValueFromProperty(NON_IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS_PEOPERTY);
+     protected static final int NON_IDENTIFYING_STRING_TABLE_MAXIMUM_CHARACTERS =
+             getIntegerValueFromProperty(NON_IDENTIFYING_STRING_TABLE_MAXIMUM_CHARACTERS_PEOPERTY);
+-        
++
+     private static int getIntegerValueFromProperty(String property) {
+         String value = System.getProperty(property);
+         if (value == null) {
+             return Integer.MAX_VALUE;
+         }
+-        
++
+         try {
+             return Math.max(Integer.parseInt(value), ValueArray.DEFAULT_CAPACITY);
+         } catch (NumberFormatException e) {
+@@ -72,7 +72,7 @@
+             return Integer.MAX_VALUE;
+         }
+     }
+-    
++
+     public final CharArrayArray restrictedAlphabet = new CharArrayArray(ValueArray.DEFAULT_CAPACITY, 256);
+     public final StringArray encodingAlgorithm = new StringArray(ValueArray.DEFAULT_CAPACITY, 256, true);
+ 
+@@ -90,9 +90,9 @@
+     public final QualifiedNameArray attributeName;
+ 
+     public final ValueArray[] tables = new ValueArray[12];
+-    
++
+     protected SerializerVocabulary _readOnlyVocabulary;
+-    
++
+     /** Creates a new instance of ParserVocabulary */
+     public ParserVocabulary() {
+         namespaceName = new StringArray(ValueArray.DEFAULT_CAPACITY, IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS, false);
+@@ -103,9 +103,9 @@
+         attributeValue = new StringArray(ValueArray.DEFAULT_CAPACITY, NON_IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS, true);
+         otherString = new CharArrayArray(ValueArray.DEFAULT_CAPACITY, NON_IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS);
+ 
+-        characterContentChunk = new ContiguousCharArrayArray(ValueArray.DEFAULT_CAPACITY, 
+-                NON_IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS, 
+-                ContiguousCharArrayArray.INITIAL_CHARACTER_SIZE, 
++        characterContentChunk = new ContiguousCharArrayArray(ValueArray.DEFAULT_CAPACITY,
++                NON_IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS,
++                ContiguousCharArrayArray.INITIAL_CHARACTER_SIZE,
+                 NON_IDENTIFYING_STRING_TABLE_MAXIMUM_CHARACTERS);
+ 
+         elementName = new QualifiedNameArray(ValueArray.DEFAULT_CAPACITY, IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS);
+@@ -125,25 +125,25 @@
+         tables[ATTRIBUTE_NAME] = attributeName;
+     }
+ 
+-    
++
+     public ParserVocabulary(com.sun.xml.internal.org.jvnet.fastinfoset.Vocabulary v) {
+         this();
+-        
++
+         convertVocabulary(v);
+     }
+-    
++
+     void setReadOnlyVocabulary(ParserVocabulary readOnlyVocabulary, boolean clear) {
+         for (int i = 0; i < tables.length; i++) {
+             tables[i].setReadOnlyArray(readOnlyVocabulary.tables[i], clear);
+         }
+     }
+-    
++
+     public void setInitialVocabulary(ParserVocabulary initialVocabulary, boolean clear) {
+         setExternalVocabularyURI(null);
+         setInitialReadOnlyVocabulary(true);
+         setReadOnlyVocabulary(initialVocabulary, clear);
+     }
+-    
++
+     public void setReferencedVocabulary(String referencedVocabularyURI, ParserVocabulary referencedVocabulary, boolean clear) {
+         if (!referencedVocabularyURI.equals(getExternalVocabularyURI())) {
+             setInitialReadOnlyVocabulary(false);
+@@ -151,13 +151,13 @@
+             setReadOnlyVocabulary(referencedVocabulary, clear);
+         }
+     }
+-    
++
+     public void clear() {
+         for (int i = 0; i < tables.length; i++) {
+             tables[i].clear();
+-        }        
++        }
+     }
+-    
++
+     private void convertVocabulary(com.sun.xml.internal.org.jvnet.fastinfoset.Vocabulary v) {
+         final StringIntMap prefixMap = new FixedEntryStringIntMap(
+                 EncodingConstants.XML_NAMESPACE_PREFIX, 8);
+@@ -164,7 +164,7 @@
+         final StringIntMap namespaceNameMap = new FixedEntryStringIntMap(
+                 EncodingConstants.XML_NAMESPACE_NAME, 8);
+         final StringIntMap localNameMap = new StringIntMap();
+-                
++
+         addToTable(v.restrictedAlphabets.iterator(), restrictedAlphabet);
+         addToTable(v.encodingAlgorithms.iterator(), encodingAlgorithm);
+         addToTable(v.prefixes.iterator(), prefix, prefixMap);
+@@ -178,89 +178,89 @@
+         addToTable(v.elements.iterator(), elementName, false,
+                 prefixMap, namespaceNameMap, localNameMap);
+         addToTable(v.attributes.iterator(), attributeName, true,
+-                prefixMap, namespaceNameMap, localNameMap);                            
++                prefixMap, namespaceNameMap, localNameMap);
+     }
+-    
++
+     private void addToTable(Iterator i, StringArray a) {
+         while (i.hasNext()) {
+             addToTable((String)i.next(), a, null);
+-        }        
++        }
+     }
+-    
++
+     private void addToTable(Iterator i, StringArray a, StringIntMap m) {
+         while (i.hasNext()) {
+             addToTable((String)i.next(), a, m);
+-        }        
++        }
+     }
+-    
++
+     private void addToTable(String s, StringArray a, StringIntMap m) {
+         if (s.length() == 0) {
+             return;
+         }
+-        
++
+         if (m != null) m.obtainIndex(s);
+         a.add(s);
+     }
+-    
++
+     private void addToTable(Iterator i, PrefixArray a, StringIntMap m) {
+         while (i.hasNext()) {
+             addToTable((String)i.next(), a, m);
+-        }        
++        }
+     }
+-    
++
+     private void addToTable(String s, PrefixArray a, StringIntMap m) {
+         if (s.length() == 0) {
+             return;
+         }
+-        
++
+         if (m != null) m.obtainIndex(s);
+         a.add(s);
+     }
+-    
++
+     private void addToTable(Iterator i, ContiguousCharArrayArray a) {
+         while (i.hasNext()) {
+             addToTable((String)i.next(), a);
+-        }        
++        }
+     }
+-    
++
+     private void addToTable(String s, ContiguousCharArrayArray a) {
+         if (s.length() == 0) {
+             return;
+         }
+-        
++
+         char[] c = s.toCharArray();
+         a.add(c, c.length);
+     }
+-    
++
+     private void addToTable(Iterator i, CharArrayArray a) {
+         while (i.hasNext()) {
+             addToTable((String)i.next(), a);
+-        }        
++        }
+     }
+-    
++
+     private void addToTable(String s, CharArrayArray a) {
+         if (s.length() == 0) {
+             return;
+         }
+-        
++
+         char[] c = s.toCharArray();
+         a.add(new CharArray(c, 0, c.length, false));
+     }
+-    
++
+     private void addToTable(Iterator i, QualifiedNameArray a,
+-            boolean isAttribute, 
+-            StringIntMap prefixMap, StringIntMap namespaceNameMap, 
++            boolean isAttribute,
++            StringIntMap prefixMap, StringIntMap namespaceNameMap,
+             StringIntMap localNameMap) {
+         while (i.hasNext()) {
+             addToNameTable((QName)i.next(), a, isAttribute,
+                     prefixMap, namespaceNameMap, localNameMap);
+-        }        
++        }
+     }
+-    
+-    private void addToNameTable(QName n, QualifiedNameArray a, 
++
++    private void addToNameTable(QName n, QualifiedNameArray a,
+             boolean isAttribute,
+-            StringIntMap prefixMap, StringIntMap namespaceNameMap, 
+-            StringIntMap localNameMap) {            
++            StringIntMap prefixMap, StringIntMap namespaceNameMap,
++            StringIntMap localNameMap) {
+         int namespaceURIIndex = -1;
+         int prefixIndex = -1;
+         if (n.getNamespaceURI().length() > 0) {
+@@ -269,7 +269,7 @@
+                 namespaceURIIndex = namespaceName.getSize();
+                 namespaceName.add(n.getNamespaceURI());
+             }
+-            
++
+             if (n.getPrefix().length() > 0) {
+                 prefixIndex = prefixMap.obtainIndex(n.getPrefix());
+                 if (prefixIndex == KeyIntMap.NOT_PRESENT) {
+@@ -278,19 +278,19 @@
+                 }
+             }
+         }
+-        
++
+         int localNameIndex = localNameMap.obtainIndex(n.getLocalPart());
+         if (localNameIndex == KeyIntMap.NOT_PRESENT) {
+             localNameIndex = localName.getSize();
+             localName.add(n.getLocalPart());
+         }
+-        
++
+         QualifiedName name = new QualifiedName(n.getPrefix(), n.getNamespaceURI(), n.getLocalPart(),
+-                a.getSize(), 
++                a.getSize(),
+                 prefixIndex, namespaceURIIndex, localNameIndex);
+         if (isAttribute) {
+             name.createAttributeValues(DuplicateAttributeVerifier.MAP_SIZE);
+         }
+         a.add(name);
+-    }    
++    }
+ }
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/vocab/SerializerVocabulary.java	Thu Jul 30 18:05:32 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/vocab/SerializerVocabulary.java	Thu Jul 30 18:05:31 2009
+@@ -24,8 +24,8 @@
+  *
+  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
+  */
+- 
+ 
++
+ package com.sun.xml.internal.fastinfoset.vocab;
+ 
+ import com.sun.xml.internal.fastinfoset.EncodingConstants;
+@@ -54,13 +54,13 @@
+ 
+     public final LocalNameQualifiedNamesMap elementName;
+     public final LocalNameQualifiedNamesMap attributeName;
+-    
++
+     public final KeyIntMap[] tables = new KeyIntMap[12];
+ 
+     protected boolean _useLocalNameAsKey;
+-    
++
+     protected SerializerVocabulary _readOnlyVocabulary;
+-    
++
+     public SerializerVocabulary() {
+         tables[RESTRICTED_ALPHABET] = restrictedAlphabet = new StringIntMap(4);
+         tables[ENCODING_ALGORITHM] = encodingAlgorithm = new StringIntMap(4);
+@@ -73,22 +73,22 @@
+         tables[OTHER_STRING] = otherString = new CharArrayIntMap(4);
+         tables[CHARACTER_CONTENT_CHUNK] = characterContentChunk = new CharArrayIntMap();
+         tables[ELEMENT_NAME] = elementName = new LocalNameQualifiedNamesMap();
+-        tables[ATTRIBUTE_NAME] = attributeName = new LocalNameQualifiedNamesMap();        
++        tables[ATTRIBUTE_NAME] = attributeName = new LocalNameQualifiedNamesMap();
+     }
+-        
+-    public SerializerVocabulary(com.sun.xml.internal.org.jvnet.fastinfoset.Vocabulary v, 
++
++    public SerializerVocabulary(com.sun.xml.internal.org.jvnet.fastinfoset.Vocabulary v,
+             boolean useLocalNameAsKey) {
+         this();
+-        
++
+         _useLocalNameAsKey = useLocalNameAsKey;
+         convertVocabulary(v);
+     }
+-    
++
+     public SerializerVocabulary getReadOnlyVocabulary() {
+         return _readOnlyVocabulary;
+     }
+-    
+-    protected void setReadOnlyVocabulary(SerializerVocabulary readOnlyVocabulary, 
++
++    protected void setReadOnlyVocabulary(SerializerVocabulary readOnlyVocabulary,
+             boolean clear) {
+         for (int i = 0; i < tables.length; i++) {
+             tables[i].setReadOnlyMap(readOnlyVocabulary.tables[i], clear);
+@@ -95,26 +95,26 @@
+         }
+     }
+ 
+-    public void setInitialVocabulary(SerializerVocabulary initialVocabulary, 
++    public void setInitialVocabulary(SerializerVocabulary initialVocabulary,
+             boolean clear) {
+         setExternalVocabularyURI(null);
+         setInitialReadOnlyVocabulary(true);
+         setReadOnlyVocabulary(initialVocabulary, clear);
+     }
+-    
+-    public void setExternalVocabulary(String externalVocabularyURI, 
++
++    public void setExternalVocabulary(String externalVocabularyURI,
+             SerializerVocabulary externalVocabulary, boolean clear) {
+         setInitialReadOnlyVocabulary(false);
+         setExternalVocabularyURI(externalVocabularyURI);
+         setReadOnlyVocabulary(externalVocabulary, clear);
+     }
+-    
++
+     public void clear() {
+         for (int i = 0; i < tables.length; i++) {
+             tables[i].clear();
+         }
+     }
+-    
++
+     private void convertVocabulary(com.sun.xml.internal.org.jvnet.fastinfoset.Vocabulary v) {
+         addToTable(v.restrictedAlphabets.iterator(), restrictedAlphabet);
+         addToTable(v.encodingAlgorithms.iterator(), encodingAlgorithm);
+@@ -127,45 +127,45 @@
+         addToTable(v.otherStrings.iterator(), otherString);
+         addToTable(v.characterContentChunks.iterator(), characterContentChunk);
+         addToTable(v.elements.iterator(), elementName);
+-        addToTable(v.attributes.iterator(), attributeName);                            
++        addToTable(v.attributes.iterator(), attributeName);
+     }
+-    
++
+     private void addToTable(Iterator i, StringIntMap m) {
+         while (i.hasNext()) {
+             addToTable((String)i.next(), m);
+-        }        
++        }
+     }
+-    
++
+     private void addToTable(String s, StringIntMap m) {
+         if (s.length() == 0) {
+             return;
+         }
+-        
++
+         m.obtainIndex(s);
+     }
+-    
++
+     private void addToTable(Iterator i, CharArrayIntMap m) {
+         while (i.hasNext()) {
+             addToTable((String)i.next(), m);
+-        }        
++        }
+     }
+-    
++
+     private void addToTable(String s, CharArrayIntMap m) {
+         if (s.length() == 0) {
+             return;
+         }
+-        
++
+         char[] c = s.toCharArray();
+         m.obtainIndex(c, 0, c.length, false);
+     }
+-    
++
+     private void addToTable(Iterator i, LocalNameQualifiedNamesMap m) {
+         while (i.hasNext()) {
+             addToNameTable((QName)i.next(), m);
+-        }        
++        }
+     }
+-    
+-    private void addToNameTable(QName n, LocalNameQualifiedNamesMap m) {                
++
++    private void addToNameTable(QName n, LocalNameQualifiedNamesMap m) {
+         int namespaceURIIndex = -1;
+         int prefixIndex = -1;
+         if (n.getNamespaceURI().length() > 0) {
+@@ -173,7 +173,7 @@
+             if (namespaceURIIndex == KeyIntMap.NOT_PRESENT) {
+                 namespaceURIIndex = namespaceName.get(n.getNamespaceURI());
+             }
+-            
++
+             if (n.getPrefix().length() > 0) {
+                 prefixIndex = prefix.obtainIndex(n.getPrefix());
+                 if (prefixIndex == KeyIntMap.NOT_PRESENT) {
+@@ -181,26 +181,26 @@
+                 }
+             }
+         }
+-        
++
+         int localNameIndex = localName.obtainIndex(n.getLocalPart());
+         if (localNameIndex == KeyIntMap.NOT_PRESENT) {
+             localNameIndex = localName.get(n.getLocalPart());
+         }
+-        
++
+         QualifiedName name = new QualifiedName(n.getPrefix(), n.getNamespaceURI(), n.getLocalPart(),
+-                m.getNextIndex(), 
++                m.getNextIndex(),
+                 prefixIndex, namespaceURIIndex, localNameIndex);
+-        
++
+         LocalNameQualifiedNamesMap.Entry entry = null;
+         if (_useLocalNameAsKey) {
+             entry = m.obtainEntry(n.getLocalPart());
+         } else {
+             String qName = (prefixIndex == -1)
+-                ? n.getLocalPart() 
++                ? n.getLocalPart()
+                 : n.getPrefix() + ":" + n.getLocalPart();
+             entry = m.obtainEntry(qName);
+         }
+-        
++
+         entry.addQualifiedName(name);
+-    }    
++    }
+ }
+--- old/src/share/classes/com/sun/xml/internal/fastinfoset/vocab/Vocabulary.java	Thu Jul 30 18:05:36 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/vocab/Vocabulary.java	Thu Jul 30 18:05:35 2009
+@@ -24,9 +24,9 @@
+  *
+  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
+  */
+- 
+ 
+ 
++
+ package com.sun.xml.internal.fastinfoset.vocab;
+ 
+ 
+@@ -43,11 +43,11 @@
+     public static final int CHARACTER_CONTENT_CHUNK = 9;
+     public static final int ELEMENT_NAME = 10;
+     public static final int ATTRIBUTE_NAME = 11;
+-        
++
+     protected boolean _hasInitialReadOnlyVocabulary;
+-    
++
+     protected String _referencedVocabularyURI;
+-    
++
+     public boolean hasInitialVocabulary() {
+         return _hasInitialReadOnlyVocabulary;
+     }
+@@ -55,15 +55,15 @@
+     protected void setInitialReadOnlyVocabulary(boolean hasInitialReadOnlyVocabulary) {
+         _hasInitialReadOnlyVocabulary = hasInitialReadOnlyVocabulary;
+     }
+-    
++
+     public boolean hasExternalVocabulary() {
+         return _referencedVocabularyURI != null;
+     }
+-    
++
+     public String getExternalVocabularyURI() {
+         return _referencedVocabularyURI;
+     }
+-    
++
+     protected void setExternalVocabularyURI(String referencedVocabularyURI) {
+         _referencedVocabularyURI = referencedVocabularyURI;
+     }
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/SOAPExceptionImpl.java	Thu Jul 30 18:05:39 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/SOAPExceptionImpl.java	Thu Jul 30 18:05:38 2009
+@@ -22,11 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * $Id: SOAPExceptionImpl.java,v 1.3 2006/01/27 12:49:17 vj135062 Exp $
+- * $Revision: 1.3 $
+- * $Date: 2006/01/27 12:49:17 $
+- */
+ 
+ 
+ package com.sun.xml.internal.messaging.saaj;
+@@ -60,7 +55,7 @@
+      */
+     public SOAPExceptionImpl() {
+         super();
+-	this.cause = null;
++        this.cause = null;
+     }
+ 
+     /**
+@@ -71,7 +66,7 @@
+      */
+     public SOAPExceptionImpl(String reason) {
+         super(reason);
+-	this.cause = null;
++        this.cause = null;
+     }
+ 
+     /**
+@@ -94,8 +89,8 @@
+      * with the given <code>Throwable</code> object.
+      */
+     public SOAPExceptionImpl(Throwable cause) {
+-	super (cause.toString());
+-	initCause(cause);
++        super (cause.toString());
++        initCause(cause);
+     }
+ 
+     /**
+@@ -102,40 +97,40 @@
+      * Returns the detail message for this <code>SOAPExceptionImpl</code>
+      * object.
+      * <P>
+-     * If there is an embedded <code>Throwable</code> object, and if the 
+-     * <code>SOAPExceptionImpl</code> object has no detail message of its 
+-     * own, this method will return the detail message from the embedded 
++     * If there is an embedded <code>Throwable</code> object, and if the
++     * <code>SOAPExceptionImpl</code> object has no detail message of its
++     * own, this method will return the detail message from the embedded
+      * <code>Throwable</code> object.
+      *
+-     * @return the error or warning message for this 
+-     *         <code>SOAPExceptionImpl</code> or, if it has none, the 
++     * @return the error or warning message for this
++     *         <code>SOAPExceptionImpl</code> or, if it has none, the
+      *         message of the embedded <code>Throwable</code> object,
+      *         if there is one
+      */
+     public String getMessage() {
+-   	String message = super.getMessage ();
+-	if (message == null && cause != null) {
+-	    return cause.getMessage();	
+-	} else {
+-	    return message;
+-	}
++        String message = super.getMessage ();
++        if (message == null && cause != null) {
++            return cause.getMessage();
++        } else {
++            return message;
++        }
+     }
+ 
+     /**
+-     * Returns the <code>Throwable</code> object embedded in this 
+-     * <code>SOAPExceptionImpl</code> if there is one. Otherwise, this method 
++     * Returns the <code>Throwable</code> object embedded in this
++     * <code>SOAPExceptionImpl</code> if there is one. Otherwise, this method
+      * returns <code>null</code>.
+      *
+-     * @return the embedded <code>Throwable</code> object or <code>null</code> 
++     * @return the embedded <code>Throwable</code> object or <code>null</code>
+      *         if there is none
+      */
+ 
+     public Throwable getCause() {
+-	return cause;
++        return cause;
+     }
+ 
+     /**
+-     * Initializes the <code>cause</code> field of this <code>SOAPExceptionImpl</code> 
++     * Initializes the <code>cause</code> field of this <code>SOAPExceptionImpl</code>
+      * object with the given <code>Throwable</code> object.
+      * <P>
+      * This method can be called at most once.  It is generally called from
+@@ -144,7 +139,7 @@
+      * If this <code>SOAPExceptionImpl</code> object was created with the
+      * constructor {@link #SOAPExceptionImpl(Throwable)} or
+      * {@link #SOAPExceptionImpl(String,Throwable)}, meaning that its
+-     * <code>cause</code> field already has a value, this method cannot be 
++     * <code>cause</code> field already has a value, this method cannot be
+      * called even once.
+      *
+      * @param  cause the <code>Throwable</code> object that caused this
+@@ -159,23 +154,23 @@
+      *         cannot be its own cause.)
+      * @throws IllegalStateException if this <code>SOAPExceptionImpl</code> object
+      *         was created with {@link #SOAPExceptionImpl(Throwable)} or
+-     *         {@link #SOAPExceptionImpl(String,Throwable)}, or this 
++     *         {@link #SOAPExceptionImpl(String,Throwable)}, or this
+      *         method has already been called on this <code>SOAPExceptionImpl</code>
+      *         object
+      */
+-    public synchronized Throwable initCause(Throwable cause) 
++    public synchronized Throwable initCause(Throwable cause)
+     {
+-   	if(this.cause != null) {
+-	    throw new IllegalStateException("Can't override cause");
+-	}
+-	if(cause == this) {
+-	    throw new IllegalArgumentException("Self-causation not permitted");	
+-	}
+-	this.cause = cause;
++        if(this.cause != null) {
++            throw new IllegalStateException("Can't override cause");
++        }
++        if(cause == this) {
++            throw new IllegalArgumentException("Self-causation not permitted");
++        }
++        this.cause = cause;
+ 
+-	return this;
++        return this;
+     }
+-    
++
+     public void printStackTrace() {
+         super.printStackTrace();
+         if (cause != null) {
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/HttpSOAPConnection.java	Thu Jul 30 18:05:43 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/HttpSOAPConnection.java	Thu Jul 30 18:05:42 2009
+@@ -22,11 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * $Id: HttpSOAPConnection.java,v 1.41 2006/01/27 12:49:17 vj135062 Exp $
+- * $Revision: 1.41 $
+- * $Date: 2006/01/27 12:49:17 $
+- */
+ 
+ 
+ package com.sun.xml.internal.messaging.saaj.client.p2p;
+@@ -54,7 +49,7 @@
+  *
+  */
+ public class HttpSOAPConnection extends SOAPConnection {
+-    
++
+     public static final String vmVendor = System.getProperty("java.vendor.url");
+     private static final String sunVmVendor = "http://java.sun.com/";
+     private static final String ibmVmVendor = "http://www.ibm.com/";
+@@ -66,8 +61,8 @@
+         Logger.getLogger(LogDomainConstants.HTTP_CONN_DOMAIN,
+                          "com.sun.xml.internal.messaging.saaj.client.p2p.LocalStrings");
+ 
+-    public static final String defaultProxyHost = null;
+-    public static  final int defaultProxyPort = -1;
++    private static final String defaultProxyHost = null;
++    private static final int defaultProxyPort = -1;
+ 
+     MessageFactory messageFactory = null;
+ 
+@@ -80,8 +75,8 @@
+         try {
+             messageFactory = MessageFactory.newInstance(SOAPConstants.DYNAMIC_SOAP_PROTOCOL);
+         } catch (NoSuchMethodError ex) {
+-	            //fallback to default SOAP 1.1 in this case for backward compatibility
+-	            messageFactory = MessageFactory.newInstance();
++            //fallback to default SOAP 1.1 in this case for backward compatibility
++            messageFactory = MessageFactory.newInstance();
+         } catch (Exception ex) {
+             log.log(Level.SEVERE, "SAAJ0001.p2p.cannot.create.msg.factory", ex);
+             throw new SOAPExceptionImpl("Unable to create message factory", ex);
+@@ -105,19 +100,18 @@
+             throw new SOAPExceptionImpl("Connection is closed");
+         }
+ 
+-        Class urlEndpointClass = null;       
++        Class urlEndpointClass = null;
+         ClassLoader loader = Thread.currentThread().getContextClassLoader();
+-
+         try {
+-                if (loader != null) {
+-	                urlEndpointClass = loader.loadClass(JAXM_URLENDPOINT);
+-	        } else {
+- 	                urlEndpointClass = Class.forName(JAXM_URLENDPOINT);
+-	            }
+-	        } catch (ClassNotFoundException ex) {
+-	            //Do nothing. URLEndpoint is available only when JAXM is there.
+-	            log.finest("SAAJ0090.p2p.endpoint.available.only.for.JAXM");
+- 	        }
++            if (loader != null) {
++                urlEndpointClass = loader.loadClass(JAXM_URLENDPOINT);
++            } else {
++                urlEndpointClass = Class.forName(JAXM_URLENDPOINT);
++            }
++        } catch (ClassNotFoundException ex) {
++            //Do nothing. URLEndpoint is available only when JAXM is there.
++            log.finest("SAAJ0090.p2p.endpoint.available.only.for.JAXM");
++        }
+ 
+         if (urlEndpointClass != null) {
+             if (urlEndpointClass.isInstance(endPoint)) {
+@@ -193,7 +187,7 @@
+     private String proxyHost = null;
+ 
+     static class PriviledgedSetProxyAction implements PrivilegedExceptionAction {
+-                                                                                                                                             
++
+         String proxyHost = null;
+         int proxyPort = 0;
+ 
+@@ -201,11 +195,11 @@
+             this.proxyHost = host;
+             this.proxyPort = port;
+         }
+-                                                                                                                                             
++
+         public Object run() throws Exception {
+             System.setProperty("http.proxyHost", proxyHost);
+             System.setProperty("http.proxyPort", new Integer(proxyPort).toString());
+-            log.log(Level.FINE, "SAAJ0050.p2p.proxy.host", 
++            log.log(Level.FINE, "SAAJ0050.p2p.proxy.host",
+                     new String[] { proxyHost });
+             log.log(Level.FINE, "SAAJ0051.p2p.proxy.port",
+                     new String[] { new Integer(proxyPort).toString() });
+@@ -217,13 +211,13 @@
+     public void setProxy(String host, int port) {
+         try {
+             proxyPort = port;
+-            PriviledgedSetProxyAction ps = new PriviledgedSetProxyAction(host, port); 
++            PriviledgedSetProxyAction ps = new PriviledgedSetProxyAction(host, port);
+             proxyHost = (String) AccessController.doPrivileged(ps);
+         } catch (Exception e) {
+             throw new RuntimeException(e);
+         }
+     }
+-    
++
+     public String getProxyHost() {
+         return proxyHost;
+     }
+@@ -399,7 +393,7 @@
+                     httpConnection.getContentLength() == -1
+                         ? bytes.length
+                         : httpConnection.getContentLength();
+-                        
++
+                 // If no reply message is returned,
+                 // content-Length header field value is expected to be zero.
+                 if (length == 0) {
+@@ -409,7 +403,7 @@
+                     ByteInputStream in = new ByteInputStream(bytes, length);
+                     response = messageFactory.createMessage(headers, in);
+                 }
+-                        
++
+                 httpIn.close();
+                 httpConnection.disconnect();
+ 
+@@ -654,28 +648,29 @@
+ 
+         return ret;
+     }
++
+     //private static String SSL_PKG = "com.sun.net.ssl.internal.www.protocol";
+     //private static String SSL_PROVIDER =
+-	      //  "com.sun.net.ssl.internal.ssl.Provider";
++      //  "com.sun.net.ssl.internal.ssl.Provider";
+     private static final String SSL_PKG;
+-    private static  final String SSL_PROVIDER;
+-    
+-    
+-    static {    
+- 	        if (isIBMVM) {
+- 	            SSL_PKG ="com.ibm.net.ssl.internal.www.protocol";
+- 	            SSL_PROVIDER ="com.ibm.net.ssl.internal.ssl.Provider";
+- 	        } else {
+- 	            //if not IBM VM default to Sun.
+- 	            SSL_PKG = "com.sun.net.ssl.internal.www.protocol";
+- 	            SSL_PROVIDER ="com.sun.net.ssl.internal.ssl.Provider";
+- 	        }
+- 	    }
++    private static final String SSL_PROVIDER;
++
++    static {
++        if (isIBMVM) {
++            SSL_PKG ="com.ibm.net.ssl.internal.www.protocol";
++            SSL_PROVIDER ="com.ibm.net.ssl.internal.ssl.Provider";
++        } else {
++            //if not IBM VM default to Sun.
++            SSL_PKG = "com.sun.net.ssl.internal.www.protocol";
++            SSL_PROVIDER ="com.sun.net.ssl.internal.ssl.Provider";
++        }
++    }
++
+     private void initHttps() {
+         //if(!setHttps) {
+         String pkgs = System.getProperty("java.protocol.handler.pkgs");
+         log.log(Level.FINE,
+-                "SAAJ0053.p2p.providers", 
++                "SAAJ0053.p2p.providers",
+                 new String[] { pkgs });
+ 
+         if (pkgs == null || pkgs.indexOf(SSL_PKG) < 0) {
+@@ -685,7 +680,7 @@
+                 pkgs = pkgs + "|" + SSL_PKG;
+             System.setProperty("java.protocol.handler.pkgs", pkgs);
+             log.log(Level.FINE,
+-                    "SAAJ0054.p2p.set.providers", 
++                    "SAAJ0054.p2p.set.providers",
+                     new String[] { pkgs });
+             try {
+                 Class c = Class.forName(SSL_PROVIDER);
+@@ -740,7 +735,7 @@
+     private static final int dL = 0;
+     private void d(String s) {
+         log.log(Level.SEVERE,
+-                "SAAJ0013.p2p.HttpSOAPConnection", 
++                "SAAJ0013.p2p.HttpSOAPConnection",
+                 new String[] { s });
+         System.err.println("HttpSOAPConnection: " + s);
+     }
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/HttpSOAPConnectionFactory.java	Thu Jul 30 18:05:46 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/HttpSOAPConnectionFactory.java	Thu Jul 30 18:05:46 2009
+@@ -22,11 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * $Id: HttpSOAPConnectionFactory.java,v 1.6 2006/01/27 12:49:18 vj135062 Exp $
+- * $Revision: 1.6 $
+- * $Date: 2006/01/27 12:49:18 $
+- */
+ 
+ 
+ package com.sun.xml.internal.messaging.saaj.client.p2p;
+@@ -46,4 +41,3 @@
+         return new HttpSOAPConnection();
+     }
+ }
+-
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/LocalStrings.properties	Thu Jul 30 18:05:50 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/LocalStrings.properties	Thu Jul 30 18:05:49 2009
+@@ -53,4 +53,3 @@
+ # Trace messages
+ SAAJ0090.p2p.endpoint.available.only.for.JAXM=SAAJ0090: URLEndpoint is available only when JAXM is there
+ SAAJ0091.p2p.https.auth.in.POST.true=SAAJ0091: HTTPS Authorization in POST set to true
+- 
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/Header.java	Thu Jul 30 18:05:53 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/Header.java	Thu Jul 30 18:05:53 2009
+@@ -42,7 +42,7 @@
+     /**
+      * Returns the name of this header.
+      *
+-     * @return 		name of the header
++     * @return          name of the header
+      */
+     String getName();
+ 
+@@ -49,7 +49,7 @@
+     /**
+      * Returns the value of this header.
+      *
+-     * @return 		value of the header
++     * @return          value of the header
+      */
+     String getValue();
+ }
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/MessagingException.java	Thu Jul 30 18:05:57 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/MessagingException.java	Thu Jul 30 18:05:56 2009
+@@ -51,29 +51,29 @@
+      * Constructs a MessagingException with no detail message.
+      */
+     public MessagingException() {
+-	super();
++        super();
+     }
+ 
+     /**
+      * Constructs a MessagingException with the specified detail message.
+-     * @param s		the detail message
++     * @param s         the detail message
+      */
+     public MessagingException(String s) {
+-	super(s);
++        super(s);
+     }
+ 
+     /**
+-     * Constructs a MessagingException with the specified 
++     * Constructs a MessagingException with the specified
+      * Exception and detail message. The specified exception is chained
+      * to this exception.
+-     * @param s		the detail message
+-     * @param e		the embedded exception
+-     * @see	#getNextException
+-     * @see	#setNextException
++     * @param s         the detail message
++     * @param e         the embedded exception
++     * @see     #getNextException
++     * @see     #setNextException
+      */
+     public MessagingException(String s, Exception e) {
+-	super(s);
+-	next = e;
++        super(s);
++        next = e;
+     }
+ 
+     /**
+@@ -81,34 +81,34 @@
+      * next exception is a MessagingException, the chain
+      * may extend further.
+      *
+-     * @return	next Exception, null if none.
++     * @return  next Exception, null if none.
+      */
+     public Exception getNextException() {
+-	return next;
++        return next;
+     }
+ 
+     /**
+      * Add an exception to the end of the chain. If the end
+-     * is <strong>not</strong> a MessagingException, this 
++     * is <strong>not</strong> a MessagingException, this
+      * exception cannot be added to the end.
+      *
+-     * @param	ex	the new end of the Exception chain
+-     * @return		<code>true</code> if the this Exception
+-     *			was added, <code>false</code> otherwise.
++     * @param   ex      the new end of the Exception chain
++     * @return          <code>true</code> if the this Exception
++     *                  was added, <code>false</code> otherwise.
+      */
+     public synchronized boolean setNextException(Exception ex) {
+-	Exception theEnd = this;
+-	while (theEnd instanceof MessagingException &&
+-	       ((MessagingException)theEnd).next != null) {
+-	    theEnd = ((MessagingException)theEnd).next;
+-	}
+-	// If the end is a MessagingException, we can add this 
+-	// exception to the chain.
+-	if (theEnd instanceof MessagingException) {
+-	    ((MessagingException)theEnd).next = ex;
+-	    return true;
+-	} else
+-	    return false;
++        Exception theEnd = this;
++        while (theEnd instanceof MessagingException &&
++               ((MessagingException)theEnd).next != null) {
++            theEnd = ((MessagingException)theEnd).next;
++        }
++        // If the end is a MessagingException, we can add this
++        // exception to the chain.
++        if (theEnd instanceof MessagingException) {
++            ((MessagingException)theEnd).next = ex;
++            return true;
++        } else
++            return false;
+     }
+ 
+     /**
+@@ -116,31 +116,31 @@
+      * exception if there is one.
+      */
+     public String getMessage() {
+-	if (next == null)
+-	    return super.getMessage();
+-	Exception n = next;
+-	String s = super.getMessage();
+-	StringBuffer sb = new StringBuffer(s == null ? "" : s);
+-	while (n != null) {
+-	    sb.append(";\n  nested exception is:\n\t");
+-	    if (n instanceof MessagingException) {
+-		MessagingException mex = (MessagingException)n;
+-		sb.append(n.getClass().toString());
+-		String msg = mex.getSuperMessage();
+-		if (msg != null) {
+-		    sb.append(": ");
+-		    sb.append(msg);
+-		}
+-		n = mex.next;
+-	    } else {
+-		sb.append(n.toString());
+-		n = null;
+-	    }
+-	}
+-	return sb.toString();
++        if (next == null)
++            return super.getMessage();
++        Exception n = next;
++        String s = super.getMessage();
++        StringBuffer sb = new StringBuffer(s == null ? "" : s);
++        while (n != null) {
++            sb.append(";\n  nested exception is:\n\t");
++            if (n instanceof MessagingException) {
++                MessagingException mex = (MessagingException)n;
++                sb.append(n.getClass().toString());
++                String msg = mex.getSuperMessage();
++                if (msg != null) {
++                    sb.append(": ");
++                    sb.append(msg);
++                }
++                n = mex.next;
++            } else {
++                sb.append(n.toString());
++                n = null;
++            }
++        }
++        return sb.toString();
+     }
+ 
+     private String getSuperMessage() {
+-	return super.getMessage();
++        return super.getMessage();
+     }
+ }
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/MultipartDataSource.java	Thu Jul 30 18:06:00 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/MultipartDataSource.java	Thu Jul 30 18:06:00 2009
+@@ -47,9 +47,9 @@
+  * This interface will typically be implemented by providers that
+  * preparse multipart bodies, for example an IMAP provider.
+  *
+- * @version	1.6, 02/03/27
+- * @author	John Mani
+- * @see		javax.activation.DataSource
++ * @version     1.6, 02/03/27
++ * @author      John Mani
++ * @see         javax.activation.DataSource
+  */
+ 
+ public interface MultipartDataSource extends DataSource {
+@@ -67,7 +67,7 @@
+      * @param index     the index of the desired MimeBodyPart
+      * @return          the MimeBodyPart
+      * @exception       IndexOutOfBoundsException if the given index
+-     *			is out of range.
++     *                  is out of range.
+      * @exception       MessagingException
+      */
+     public MimeBodyPart getBodyPart(int index) throws MessagingException;
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/BMMimeMultipart.java	Thu Jul 30 18:06:04 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/BMMimeMultipart.java	Thu Jul 30 18:06:03 2009
+@@ -79,12 +79,12 @@
+     private boolean begining = true;
+ 
+     int[] bcs = new int[256];
+-    int[] gss = null; 
++    int[] gss = null;
+     private static final int BUFFER_SIZE = 4096;
+     private byte[] buffer = new byte[BUFFER_SIZE];
+     private byte[] prevBuffer = new byte[BUFFER_SIZE];
+     private BitSet lastPartFound = new BitSet(1);
+- 
++
+     // cached inputstream which is possibly partially consumed
+     private InputStream in = null;
+     private String boundary = null;
+@@ -98,7 +98,7 @@
+      * Default constructor. An empty MimeMultipart object
+      * is created. Its content type is set to "multipart/mixed".
+      * A unique boundary string is generated and this string is
+-     * setup as the "boundary" parameter for the 
++     * setup as the "boundary" parameter for the
+      * <code>contentType</code> field. <p>
+      *
+      * MimeBodyParts may be added later.
+@@ -105,29 +105,29 @@
+      */
+     public BMMimeMultipart() {
+         super();
+-	//this("mixed");
++        //this("mixed");
+     }
+ 
+     /**
+      * Construct a MimeMultipart object of the given subtype.
+      * A unique boundary string is generated and this string is
+-     * setup as the "boundary" parameter for the 
++     * setup as the "boundary" parameter for the
+      * <code>contentType</code> field. <p>
+      *
+      * MimeBodyParts may be added later.
+      */
+     public BMMimeMultipart(String subtype) {
+-	super(subtype);
+-	/*
+-	 * Compute a boundary string.
+-	String boundary = UniqueValue.getUniqueBoundaryValue();
+-	ContentType cType = new ContentType("multipart", subtype, null);
++        super(subtype);
++        /*
++         * Compute a boundary string.
++        String boundary = UniqueValue.getUniqueBoundaryValue();
++        ContentType cType = new ContentType("multipart", subtype, null);
+         contentType.setParameter("boundary", boundary);
+-	 */
++         */
+     }
+ 
+     /**
+-     * Constructs a MimeMultipart object and its bodyparts from the 
++     * Constructs a MimeMultipart object and its bodyparts from the
+      * given DataSource. <p>
+      *
+      * This constructor handles as a special case the situation where the
+@@ -135,7 +135,7 @@
+      * method just invokes the superclass (i.e., Multipart) constructor
+      * that takes a MultipartDataSource object. <p>
+      *
+-     * Otherwise, the DataSource is assumed to provide a MIME multipart 
++     * Otherwise, the DataSource is assumed to provide a MIME multipart
+      * byte stream.  The <code>parsed</code> flag is set to false.  When
+      * the data for the body parts are needed, the parser extracts the
+      * "boundary" parameter from the content type of this DataSource,
+@@ -142,23 +142,23 @@
+      * skips the 'preamble' and reads bytes till the terminating
+      * boundary and creates MimeBodyParts for each part of the stream.
+      *
+-     * @param	ds	DataSource, can be a MultipartDataSource
++     * @param   ds      DataSource, can be a MultipartDataSource
+      */
+-    public BMMimeMultipart(DataSource ds, ContentType ct) 
++    public BMMimeMultipart(DataSource ds, ContentType ct)
+         throws MessagingException {
+         super(ds,ct);
+         boundary = ct.getParameter("boundary");
+         /*
+-	if (ds instanceof MultipartDataSource) {
+-	    // ask super to do this for us.
+-	    setMultipartDataSource((MultipartDataSource)ds);
+-	    return;
+-	}
++        if (ds instanceof MultipartDataSource) {
++            // ask super to do this for us.
++            setMultipartDataSource((MultipartDataSource)ds);
++            return;
++        }
+ 
+-	// 'ds' was not a MultipartDataSource, we have
+-	// to parse this ourself.
+-	parsed = false;
+-	this.ds = ds;
++        // 'ds' was not a MultipartDataSource, we have
++        // to parse this ourself.
++        parsed = false;
++        this.ds = ds;
+         if (ct==null)
+             contentType = new ContentType(ds.getContentType());
+         else
+@@ -168,7 +168,7 @@
+     }
+ 
+     public InputStream initStream() throws MessagingException {
+-                                                                                
++
+         if (in == null) {
+             try {
+                 in = ds.getInputStream();
+@@ -179,7 +179,7 @@
+             } catch (Exception ex) {
+                 throw new MessagingException("No inputstream from datasource");
+             }
+-                                                                                
++
+             if (!in.markSupported()) {
+                 throw new MessagingException(
+                     "InputStream does not support Marking");
+@@ -195,12 +195,12 @@
+      * method is called by all other methods that need data for
+      * the body parts, to make sure the data has been parsed.
+      *
+-     * @since	JavaMail 1.2
++     * @since   JavaMail 1.2
+      */
+     protected  void parse() throws  MessagingException {
+-	if (parsed)
+-	    return;
+-	
++        if (parsed)
++            return;
++
+         initStream();
+ 
+         SharedInputStream sin = null;
+@@ -209,16 +209,16 @@
+         }
+ 
+         String bnd = "--" + boundary;
+-	byte[] bndbytes = ASCIIUtility.getBytes(bnd);
+-	try {
++        byte[] bndbytes = ASCIIUtility.getBytes(bnd);
++        try {
+             parse(in, bndbytes, sin);
+-	} catch (IOException ioex) {
+-	    throw new MessagingException("IO Error", ioex);
+-	} catch (Exception ex) {
+-	    throw new MessagingException("Error", ex);
+-	}
++        } catch (IOException ioex) {
++            throw new MessagingException("IO Error", ioex);
++        } catch (Exception ex) {
++            throw new MessagingException("Error", ex);
++        }
+ 
+-	parsed = true;
++        parsed = true;
+     }
+ 
+     public boolean lastBodyPartFound() {
+@@ -226,7 +226,7 @@
+     }
+ 
+     public MimeBodyPart getNextPart(
+-        InputStream stream, byte[] pattern, SharedInputStream sin) 
++        InputStream stream, byte[] pattern, SharedInputStream sin)
+         throws Exception {
+ 
+         if (!stream.markSupported()) {
+@@ -241,7 +241,7 @@
+             }
+             begining = false;
+         }
+-        
++
+         if (lastBodyPartFound()) {
+             throw new Exception("No parts found in Multipart InputStream");
+         }
+@@ -255,7 +255,7 @@
+             }
+             long[] v = new long[1];
+             v[0] = -1; // just to ensure the code later sets it correctly
+-            b = readBody(stream, pattern, v, null, sin); 
++            b = readBody(stream, pattern, v, null, sin);
+             // looks like this check has to be disabled
+             // it is allowed to have Mime Package without closing boundary
+             /*
+@@ -264,17 +264,17 @@
+                     "End of Stream encountered without closing boundary");
+             }
+             */
+-            long end = v[0]; 
++            long end = v[0];
+             MimeBodyPart mbp = createMimeBodyPart(sin.newStream(start, end));
+             addBodyPart(mbp);
+             return mbp;
+-            
++
+         } else {
+             InternetHeaders headers = createInternetHeaders(stream);
+             ByteOutputStream baos = new ByteOutputStream();
+-            b = readBody(stream, pattern, null,baos, null); 
++            b = readBody(stream, pattern, null,baos, null);
+             // looks like this check has to be disabled
+-            // in the old impl it is allowed to have Mime Package 
++            // in the old impl it is allowed to have Mime Package
+             // without closing boundary
+             /*
+             if ((b == -1) && !lastBodyPartFound()) {
+@@ -290,9 +290,9 @@
+     }
+ 
+     public boolean parse(
+-        InputStream stream, byte[] pattern, SharedInputStream sin) 
++        InputStream stream, byte[] pattern, SharedInputStream sin)
+         throws Exception {
+-    
++
+         while (!lastPartFound.get(0) && (b != -1)) {
+            getNextPart(stream, pattern, sin);
+         }
+@@ -333,8 +333,8 @@
+     }
+ 
+     private int readBody(
+-        InputStream is, byte[] pattern, long[] posVector, 
+-        ByteOutputStream baos, SharedInputStream sin) 
++        InputStream is, byte[] pattern, long[] posVector,
++        ByteOutputStream baos, SharedInputStream sin)
+         throws Exception {
+         if (!find(is, pattern, posVector, baos, sin)) {
+             throw new Exception(
+@@ -344,7 +344,7 @@
+     }
+ 
+     private boolean skipPreamble(
+-        InputStream is, byte[] pattern, SharedInputStream sin) 
++        InputStream is, byte[] pattern, SharedInputStream sin)
+         throws Exception {
+         if (!find(is, pattern, sin)) {
+             return false;
+@@ -356,8 +356,8 @@
+         return true;
+     }
+ 
+-    
+-    public int  readNext(InputStream is, byte[] buff, int patternLength, 
++
++    public int  readNext(InputStream is, byte[] buff, int patternLength,
+         BitSet eof, long[] posVector, SharedInputStream sin)
+         throws Exception {
+ 
+@@ -388,9 +388,9 @@
+         return bufferLength;
+     }
+ 
+-    public boolean find(InputStream is, byte[] pattern, SharedInputStream sin) 
++    public boolean find(InputStream is, byte[] pattern, SharedInputStream sin)
+         throws Exception {
+-	int i;
++        int i;
+         int l = pattern.length;
+         int lx = l -1;
+         int bufferLength = 0;
+@@ -397,27 +397,27 @@
+         BitSet eof = new BitSet(1);
+         long[] posVector = new long[1];
+ 
+-	while (true) {
+-	    is.mark(l);
++        while (true) {
++            is.mark(l);
+             bufferLength = readNext(is, buffer, l, eof, posVector, sin);
+-	    if (eof.get(0)) {
+-		// End of stream
+-		return false;
+-	    }
+-	
++            if (eof.get(0)) {
++                // End of stream
++                return false;
++            }
++
+             /*
+-	    if (bufferLength < l) {
+-	        //is.reset();
+-		return false;
+-	    }*/
++            if (bufferLength < l) {
++                //is.reset();
++                return false;
++            }*/
+ 
+-	    for(i = lx; i >= 0; i--) {
+-	        if (buffer[i] != pattern[i]) {
+-	            break;
+-		}
+-	    }
++            for(i = lx; i >= 0; i--) {
++                if (buffer[i] != pattern[i]) {
++                    break;
++                }
++            }
+ 
+-	    if (i < 0) {
++            if (i < 0) {
+                 // found the boundary, skip *LWSP-char and CRLF
+                 if (!skipLWSPAndCRLF(is)) {
+                     throw new Exception("Boundary does not terminate with CRLF");
+@@ -428,13 +428,13 @@
+             int s = Math.max(i + 1 - bcs[buffer[i] & 0x7f], gss[i]);
+             is.reset();
+             is.skip(s);
+-	}
++        }
+     }
+ 
+     public boolean find(
+-        InputStream is, byte[] pattern, long[] posVector, 
++        InputStream is, byte[] pattern, long[] posVector,
+         ByteOutputStream out, SharedInputStream sin) throws Exception {
+-	int i;
++        int i;
+         int l = pattern.length;
+         int lx = l -1;
+         int bufferLength = 0;
+@@ -445,8 +445,8 @@
+         boolean first = true;
+         BitSet eof = new BitSet(1);
+ 
+-	while (true) {
+-	    is.mark(l);
++        while (true) {
++            is.mark(l);
+             if (!first) {
+                 tmp = prevBuffer;
+                 prevBuffer = buffer;
+@@ -458,10 +458,10 @@
+ 
+             bufferLength = readNext(is, buffer, l, eof, posVector, sin);
+ 
+-	    if (bufferLength == -1) {
+-		// End of stream
++            if (bufferLength == -1) {
++                // End of stream
+                 // looks like it is allowed to not have a closing boundary
+-		//return false;
++                //return false;
+                 //if (sin != null) {
+                  //   posVector[0] = endPos;
+                 //}
+@@ -470,9 +470,9 @@
+                     out.write(prevBuffer, 0, s);
+                 }
+                 return true;
+-	    }
+-	
+-	    if (bufferLength < l) {
++            }
++
++            if (bufferLength < l) {
+                 if (sin != null) {
+                     //endPos = sin.getPosition();
+                     //posVector[0] = endPos;
+@@ -483,24 +483,24 @@
+                 }
+                 // looks like it is allowed to not have a closing boundary
+                 // in the old implementation
+-		//return false;
++                //return false;
+                 b = -1;
+                 return true;
+-	    }
++            }
+ 
+-	    for(i = lx; i >= 0; i--) {
+-	        if (buffer[i] != pattern[i]) {
+-	            break;
+-		}
+-	    }
++            for(i = lx; i >= 0; i--) {
++                if (buffer[i] != pattern[i]) {
++                    break;
++                }
++            }
+ 
+-	    if (i < 0) {
++            if (i < 0) {
+                 if (s > 0) {
+                     //looks like the earlier impl allowed just an LF
+                     // so if s == 1 : it must be an LF
+                     // if s == 2 : it must be a CR LF
+                     if (s <= 2) {
+-                        //it could be "some-char\n" so write some-char 
++                        //it could be "some-char\n" so write some-char
+                         if (s == 2) {
+                             if (prevBuffer[1] == '\n') {
+                                 if (prevBuffer[0] != '\r' && prevBuffer[0] != '\n') {
+@@ -509,13 +509,13 @@
+                                 if (sin != null) {
+                                     posVector[0] = endPos;
+                                 }
+-                                
++
+                             } else {
+                                 throw new Exception(
+                                         "Boundary characters encountered in part Body " +
+                                         "without a preceeding CRLF");
+-                            }                                   
+-                           
++                            }
++
+                         } else if (s==1) {
+                             if (prevBuffer[0] != '\n') {
+                                 throw new Exception(
+@@ -527,8 +527,8 @@
+                                 }
+                             }
+                         }
+-                        
+-                    } else if (s > 2) { 
++
++                    } else if (s > 2) {
+                         if ((prevBuffer[s-2] == '\r') && (prevBuffer[s-1] == '\n')) {
+                             if (sin != null) {
+                                 posVector[0] = endPos - 2;
+@@ -547,7 +547,7 @@
+                                 "Boundary characters encountered in part Body " +
+                                 "without a preceeding CRLF");
+                         }
+-                    } 
++                    }
+                 }
+                 // found the boundary, skip *LWSP-char and CRLF
+                 if (!skipLWSPAndCRLF(is)) {
+@@ -555,7 +555,7 @@
+                     //   "Boundary does not terminate with CRLF");
+                 }
+                 return true;
+-            } 
++            }
+ 
+             if ((s > 0) && (sin == null)) {
+                 if (prevBuffer[s-1] == (byte)13) {
+@@ -562,11 +562,11 @@
+                     // if buffer[0] == (byte)10
+                     if (buffer[0] == (byte)10) {
+                         int j=lx-1;
+-	                for(j = lx-1; j > 0; j--) {
+-	                    if (buffer[j+1] != pattern[j]) {
+-	                        break;
+-		             }
+-	                 }
++                        for(j = lx-1; j > 0; j--) {
++                            if (buffer[j+1] != pattern[j]) {
++                                break;
++                             }
++                         }
+                          if (j == 0) {
+                              // matched the pattern excluding the last char of the pattern
+                              // so dont write the CR into stream
+@@ -577,7 +577,7 @@
+                     } else {
+                         out.write(prevBuffer, 0, s);
+                     }
+-                } else { 
++                } else {
+                     out.write(prevBuffer, 0, s);
+                 }
+             }
+@@ -588,7 +588,7 @@
+             if (first) {
+                 first = false;
+             }
+-	}
++        }
+     }
+ 
+     private boolean skipLWSPAndCRLF(InputStream is) throws Exception {
+@@ -597,7 +597,7 @@
+         //looks like old impl allowed just a \n as well
+         if (b == '\n') {
+             return true;
+-        } 
++        }
+ 
+         if (b == '\r') {
+             b = is.read();
+@@ -607,7 +607,7 @@
+             }
+             if (b == '\n') {
+                 return true;
+-            } else {     
++            } else {
+                 throw new Exception(
+                     "transport padding after a Mime Boundary  should end in a CRLF, found CR only");
+             }
+@@ -638,7 +638,7 @@
+                    return true;
+                 }
+             }
+-        } 
++        }
+ 
+         if (b == -1) {
+             // the last boundary need not have CRLF
+@@ -650,29 +650,29 @@
+         }
+         return false;
+     }
+-    
++
+     private void compile(byte[] pattern) {
+-	int l = pattern.length;
++        int l = pattern.length;
+ 
+-	int i;
+-	int j;
++        int i;
++        int j;
+ 
+-	// Copied from J2SE 1.4 regex code
+-	// java.util.regex.Pattern.java
++        // Copied from J2SE 1.4 regex code
++        // java.util.regex.Pattern.java
+ 
+-	// Initialise Bad Character Shift table
+-	for (i = 0; i < l; i++) {
+-	    bcs[pattern[i]] = i + 1;
+-	}
++        // Initialise Bad Character Shift table
++        for (i = 0; i < l; i++) {
++            bcs[pattern[i]] = i + 1;
++        }
+ 
+-	// Initialise Good Suffix Shift table
+-	gss = new int[l];
++        // Initialise Good Suffix Shift table
++        gss = new int[l];
+   NEXT: for (i = l; i > 0; i--) {
+             // j is the beginning index of suffix being considered
+             for (j = l - 1; j >= i; j--) {
+-	        // Testing for good suffix
+-	        if (pattern[j] == pattern[j - i]) {
+-	            // pattern[j..len] is a good suffix
++                // Testing for good suffix
++                if (pattern[j] == pattern[j - i]) {
++                    // pattern[j..len] is a good suffix
+                     gss[j - 1] = i;
+                 } else {
+                    // No match. The array has already been
+@@ -684,7 +684,7 @@
+                 gss[--j] = i;
+             }
+         }
+-	gss[l - 1] = 1;
++        gss[l - 1] = 1;
+     }
+ 
+ 
+@@ -701,7 +701,7 @@
+         if (in != null) {
+             contentType.setParameter("boundary", this.boundary);
+         }
+-                                                                                
++
+         String bnd = "--" + contentType.getParameter("boundary");
+         for (int i = 0; i < parts.size(); i++) {
+             OutputUtil.writeln(bnd, os); // put out boundary
+@@ -708,7 +708,7 @@
+             ((MimeBodyPart)parts.get(i)).writeTo(os);
+             OutputUtil.writeln(os); // put out empty line
+         }
+-                                                                                
++
+         if (in != null) {
+             OutputUtil.writeln(bnd, os); // put out boundary
+             if ((os instanceof ByteOutputStream) && lazyAttachments) {
+@@ -717,11 +717,11 @@
+                 ByteOutputStream baos = new ByteOutputStream(in.available());
+                 baos.write(in);
+                 baos.writeTo(os);
+-                // reset the inputstream so that we can support a 
++                // reset the inputstream so that we can support a
+                 //getAttachment later
+                 in = baos.newInputStream();
+             }
+-     
++
+             // this will endup writing the end boundary
+         } else {
+         // put out last boundary
+@@ -729,11 +729,11 @@
+             OutputUtil.writeAsAscii("--", os);
+         }
+     }
+-                                                                                
++
+     public void setInputStream(InputStream is) {
+         this.in = is;
+     }
+-    
++
+     public InputStream getInputStream() {
+         return this.in;
+     }
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/ContentDisposition.java	Thu Jul 30 18:06:08 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/ContentDisposition.java	Thu Jul 30 18:06:07 2009
+@@ -43,7 +43,7 @@
+ public class ContentDisposition {
+ 
+     private String disposition; // disposition
+-    private ParameterList list;	// parameter list
++    private ParameterList list; // parameter list
+ 
+     /**
+      * No-arg Constructor.
+@@ -53,80 +53,80 @@
+     /**
+      * Constructor.
+      *
+-     * @param	disposition	disposition
+-     * @param	list	ParameterList
+-     * @since		JavaMail 1.2
++     * @param   disposition     disposition
++     * @param   list    ParameterList
++     * @since           JavaMail 1.2
+      */
+     public ContentDisposition(String disposition, ParameterList list) {
+-	this.disposition = disposition;
+-	this.list = list;
++        this.disposition = disposition;
++        this.list = list;
+     }
+ 
+     /**
+      * Constructor that takes a ContentDisposition string. The String
+-     * is parsed into its constituents: dispostion and parameters. 
+-     * A ParseException is thrown if the parse fails. 
++     * is parsed into its constituents: dispostion and parameters.
++     * A ParseException is thrown if the parse fails.
+      *
+-     * @param	s	the ContentDisposition string.
+-     * @exception	ParseException if the parse fails.
+-     * @since		JavaMail 1.2
++     * @param   s       the ContentDisposition string.
++     * @exception       ParseException if the parse fails.
++     * @since           JavaMail 1.2
+      */
+     public ContentDisposition(String s) throws ParseException {
+-	HeaderTokenizer h = new HeaderTokenizer(s, HeaderTokenizer.MIME);
+-	HeaderTokenizer.Token tk;
++        HeaderTokenizer h = new HeaderTokenizer(s, HeaderTokenizer.MIME);
++        HeaderTokenizer.Token tk;
+ 
+-	// First "disposition" ..
+-	tk = h.next();
+-	if (tk.getType() != HeaderTokenizer.Token.ATOM)
+-	    throw new ParseException();
+-	disposition = tk.getValue();
++        // First "disposition" ..
++        tk = h.next();
++        if (tk.getType() != HeaderTokenizer.Token.ATOM)
++            throw new ParseException();
++        disposition = tk.getValue();
+ 
+-	// Then parameters ..
+-	String rem = h.getRemainder();
+-	if (rem != null)
+-	    list = new ParameterList(rem);
++        // Then parameters ..
++        String rem = h.getRemainder();
++        if (rem != null)
++            list = new ParameterList(rem);
+     }
+ 
+     /**
+      * Return the disposition value.
+      * @return the disposition
+-     * @since		JavaMail 1.2
++     * @since           JavaMail 1.2
+      */
+     public String getDisposition() {
+-	return disposition;
++        return disposition;
+     }
+ 
+     /**
+      * Return the specified parameter value. Returns <code>null</code>
+      * if this parameter is absent.
+-     * @return	parameter value
+-     * @since		JavaMail 1.2
++     * @return  parameter value
++     * @since           JavaMail 1.2
+      */
+     public String getParameter(String name) {
+-	if (list == null)
+-	    return null;
++        if (list == null)
++            return null;
+ 
+-	return list.get(name);
++        return list.get(name);
+     }
+ 
+     /**
+-     * Return a ParameterList object that holds all the available 
++     * Return a ParameterList object that holds all the available
+      * parameters. Returns null if no parameters are available.
+      *
+-     * @return	ParameterList
+-     * @since		JavaMail 1.2
++     * @return  ParameterList
++     * @since           JavaMail 1.2
+      */
+     public ParameterList getParameterList() {
+-	return list;
++        return list;
+     }
+ 
+     /**
+      * Set the primary type. Overrides existing primary type.
+-     * @param	primaryType	primary type
+-     * @since		JavaMail 1.2
++     * @param   primaryType     primary type
++     * @since           JavaMail 1.2
+      */
+     public void setDisposition(String disposition) {
+-	this.disposition = disposition;
++        this.disposition = disposition;
+     }
+ 
+     /**
+@@ -133,24 +133,24 @@
+      * Set the specified parameter. If this parameter already exists,
+      * it is replaced by this new value.
+      *
+-     * @param	name	parameter name
+-     * @param	value	parameter value
+-     * @since		JavaMail 1.2
++     * @param   name    parameter name
++     * @param   value   parameter value
++     * @since           JavaMail 1.2
+      */
+     public void setParameter(String name, String value) {
+-	if (list == null)
+-	    list = new ParameterList();
++        if (list == null)
++            list = new ParameterList();
+ 
+-	list.set(name, value);
++        list.set(name, value);
+     }
+ 
+     /**
+      * Set a new ParameterList.
+-     * @param	list	ParameterList
+-     * @since		JavaMail 1.2
++     * @param   list    ParameterList
++     * @since           JavaMail 1.2
+      */
+     public void setParameterList(ParameterList list) {
+-	this.list = list;
++        this.list = list;
+     }
+ 
+     /**
+@@ -158,22 +158,22 @@
+      * this ContentDisposition. Returns <code>null</code> if
+      * the conversion failed.
+      *
+-     * @return	RFC2045 style string
+-     * @since		JavaMail 1.2
++     * @return  RFC2045 style string
++     * @since           JavaMail 1.2
+      */
+     public String toString() {
+-	if (disposition == null)
+-	    return null;
++        if (disposition == null)
++            return null;
+ 
+-	if (list == null)
+-	    return disposition;
++        if (list == null)
++            return disposition;
+ 
+-	StringBuffer sb = new StringBuffer(disposition);
++        StringBuffer sb = new StringBuffer(disposition);
+ 
+-        // append the parameter list  
+-        // use the length of the string buffer + the length of 
++        // append the parameter list
++        // use the length of the string buffer + the length of
+         // the header name formatted as follows "Content-Disposition: "
+-	sb.append(list.toString(sb.length() + 21));
+-	return sb.toString();
++        sb.append(list.toString(sb.length() + 21));
++        return sb.toString();
+     }
+ }
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/ContentType.java	Thu Jul 30 18:06:11 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/ContentType.java	Thu Jul 30 18:06:11 2009
+@@ -41,9 +41,9 @@
+  */
+ public final class ContentType {
+ 
+-    private String primaryType;	// primary type
+-    private String subType;	// subtype
+-    private ParameterList list;	// parameter list
++    private String primaryType; // primary type
++    private String subType;     // subtype
++    private ParameterList list; // parameter list
+ 
+     /**
+      * No-arg Constructor.
+@@ -53,9 +53,9 @@
+     /**
+      * Constructor.
+      *
+-     * @param	primaryType	primary type
+-     * @param	subType	subType
+-     * @param	list	ParameterList
++     * @param   primaryType     primary type
++     * @param   subType subType
++     * @param   list    ParameterList
+      */
+     public ContentType(String primaryType, String subType,
+                        ParameterList list) {
+@@ -69,36 +69,36 @@
+     /**
+      * Constructor that takes a Content-Type string. The String
+      * is parsed into its constituents: primaryType, subType
+-     * and parameters. A ParseException is thrown if the parse fails. 
++     * and parameters. A ParseException is thrown if the parse fails.
+      *
+-     * @param	s	the Content-Type string.
+-     * @exception	ParseException if the parse fails.
++     * @param   s       the Content-Type string.
++     * @exception       ParseException if the parse fails.
+      */
+     public ContentType(String s) throws ParseException {
+-	HeaderTokenizer h = new HeaderTokenizer(s, HeaderTokenizer.MIME);
+-	HeaderTokenizer.Token tk;
++        HeaderTokenizer h = new HeaderTokenizer(s, HeaderTokenizer.MIME);
++        HeaderTokenizer.Token tk;
+ 
+-	// First "type" ..
+-	tk = h.next();
+-	if (tk.getType() != HeaderTokenizer.Token.ATOM)
+-	    throw new ParseException();
+-	primaryType = tk.getValue();
++        // First "type" ..
++        tk = h.next();
++        if (tk.getType() != HeaderTokenizer.Token.ATOM)
++            throw new ParseException();
++        primaryType = tk.getValue();
+ 
+-	// The '/' separator ..
+-	tk = h.next();
+-	if ((char)tk.getType() != '/')
+-	    throw new ParseException();
++        // The '/' separator ..
++        tk = h.next();
++        if ((char)tk.getType() != '/')
++            throw new ParseException();
+ 
+-	// Then "subType" ..
+-	tk = h.next();
+-	if (tk.getType() != HeaderTokenizer.Token.ATOM)
+-	    throw new ParseException();
+-	subType = tk.getValue();
++        // Then "subType" ..
++        tk = h.next();
++        if (tk.getType() != HeaderTokenizer.Token.ATOM)
++            throw new ParseException();
++        subType = tk.getValue();
+ 
+-	// Finally parameters ..
+-	String rem = h.getRemainder();
+-	if (rem != null)
+-	    list = new ParameterList(rem);
++        // Finally parameters ..
++        String rem = h.getRemainder();
++        if (rem != null)
++            list = new ParameterList(rem);
+     }
+ 
+     public ContentType copy() {
+@@ -110,7 +110,7 @@
+      * @return the primary type
+      */
+     public String getPrimaryType() {
+-	return primaryType;
++        return primaryType;
+     }
+ 
+     /**
+@@ -118,7 +118,7 @@
+      * @return the subType
+      */
+     public String getSubType() {
+-	return subType;
++        return subType;
+     }
+ 
+     /**
+@@ -129,45 +129,45 @@
+      * @return the type
+      */
+     public String getBaseType() {
+-	return primaryType + '/' + subType;
++        return primaryType + '/' + subType;
+     }
+ 
+     /**
+      * Return the specified parameter value. Returns <code>null</code>
+      * if this parameter is absent.
+-     * @return	parameter value
++     * @return  parameter value
+      */
+     public String getParameter(String name) {
+-	if (list == null)
+-	    return null;
++        if (list == null)
++            return null;
+ 
+-	return list.get(name);
++        return list.get(name);
+     }
+ 
+     /**
+-     * Return a ParameterList object that holds all the available 
++     * Return a ParameterList object that holds all the available
+      * parameters. Returns null if no parameters are available.
+      *
+-     * @return	ParameterList
++     * @return  ParameterList
+      */
+     public ParameterList getParameterList() {
+-	return list;
++        return list;
+     }
+ 
+     /**
+      * Set the primary type. Overrides existing primary type.
+-     * @param	primaryType	primary type
++     * @param   primaryType     primary type
+      */
+     public void setPrimaryType(String primaryType) {
+-	this.primaryType = primaryType;
++        this.primaryType = primaryType;
+     }
+ 
+     /**
+      * Set the subType. Overrides existing subType
+-     * @param	subType	subType
++     * @param   subType subType
+      */
+     public void setSubType(String subType) {
+-	this.subType = subType;
++        this.subType = subType;
+     }
+ 
+     /**
+@@ -174,22 +174,22 @@
+      * Set the specified parameter. If this parameter already exists,
+      * it is replaced by this new value.
+      *
+-     * @param	name	parameter name
+-     * @param	value	parameter value
++     * @param   name    parameter name
++     * @param   value   parameter value
+      */
+     public void setParameter(String name, String value) {
+-	if (list == null)
+-	    list = new ParameterList();
++        if (list == null)
++            list = new ParameterList();
+ 
+-	list.set(name, value);
++        list.set(name, value);
+     }
+ 
+     /**
+      * Set a new ParameterList.
+-     * @param	list	ParameterList
++     * @param   list    ParameterList
+      */
+     public void setParameterList(ParameterList list) {
+-	this.list = list;
++        this.list = list;
+     }
+ 
+     /**
+@@ -197,26 +197,26 @@
+      * this Content-Type. Returns <code>null</code> if
+      * the conversion failed.
+      *
+-     * @return	RFC2045 style string
++     * @return  RFC2045 style string
+      */
+     public String toString() {
+-	if (primaryType == null || subType == null) // need both
+-	    return null;
++        if (primaryType == null || subType == null) // need both
++            return null;
+ 
+-	StringBuffer sb = new StringBuffer();
+-	sb.append(primaryType).append('/').append(subType);
+-	if (list != null)
++        StringBuffer sb = new StringBuffer();
++        sb.append(primaryType).append('/').append(subType);
++        if (list != null)
+         // Http Binding section of the "SOAP with attachments" specification says,
+         // "SOAP message senders should send Content-Type headers on a single long line."
+         // (http://www.w3.org/TR/SOAP-attachments#HTTPBinding)
+             sb.append(list.toString());
+-        
+-	return sb.toString();
++
++        return sb.toString();
+     }
+ 
+     /**
+      * Match with the specified ContentType object. This method
+-     * compares <strong>only the <code>primaryType</code> and 
++     * compares <strong>only the <code>primaryType</code> and
+      * <code>subType</code> </strong>. The parameters of both operands
+      * are ignored. <p>
+      *
+@@ -225,34 +225,34 @@
+      * and <strong>"text/plain; charset=foobar"</strong>.
+      *
+      * If the <code>subType</code> of either operand is the special
+-     * character '*', then the subtype is ignored during the match. 
+-     * For example, this method will return <code>true</code> when 
+-     * comparing the ContentTypes for <strong>"text/plain"</strong> 
++     * character '*', then the subtype is ignored during the match.
++     * For example, this method will return <code>true</code> when
++     * comparing the ContentTypes for <strong>"text/plain"</strong>
+      * and <strong>"text/*" </strong>
+      *
+      * @param   cType to compare this against
+      */
+     public boolean match(ContentType cType) {
+-	// Match primaryType
+-	if (!primaryType.equalsIgnoreCase(cType.getPrimaryType()))
+-	    return false;
+-	
+-	String sType = cType.getSubType();
++        // Match primaryType
++        if (!primaryType.equalsIgnoreCase(cType.getPrimaryType()))
++            return false;
+ 
+-	// If either one of the subTypes is wildcarded, return true
+-	if ((subType.charAt(0) == '*') || (sType.charAt(0) == '*'))
+-	    return true;
+-	
+-	// Match subType
+-	if (!subType.equalsIgnoreCase(sType))
+-	    return false;
++        String sType = cType.getSubType();
+ 
+-	return true;
++        // If either one of the subTypes is wildcarded, return true
++        if ((subType.charAt(0) == '*') || (sType.charAt(0) == '*'))
++            return true;
++
++        // Match subType
++        if (!subType.equalsIgnoreCase(sType))
++            return false;
++
++        return true;
+     }
+ 
+     /**
+      * Match with the specified content-type string. This method
+-     * compares <strong>only the <code>primaryType</code> and 
++     * compares <strong>only the <code>primaryType</code> and
+      * <code>subType</code> </strong>.
+      * The parameters of both operands are ignored. <p>
+      *
+@@ -260,17 +260,17 @@
+      * comparing the ContentType for <strong>"text/plain"</strong>
+      * with <strong>"text/plain; charset=foobar"</strong>.
+      *
+-     * If the <code>subType</code> of either operand is the special 
+-     * character '*', then the subtype is ignored during the match. 
+-     * For example, this method will return <code>true</code> when 
+-     * comparing the ContentType for <strong>"text/plain"</strong> 
++     * If the <code>subType</code> of either operand is the special
++     * character '*', then the subtype is ignored during the match.
++     * For example, this method will return <code>true</code> when
++     * comparing the ContentType for <strong>"text/plain"</strong>
+      * with <strong>"text/*" </strong>
+      */
+     public boolean match(String s) {
+-	try {
+-	    return match(new ContentType(s));
+-	} catch (ParseException pex) {
+-	    return false;
+-	}
++        try {
++            return match(new ContentType(s));
++        } catch (ParseException pex) {
++            return false;
++        }
+     }
+ }
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/HeaderTokenizer.java	Thu Jul 30 18:06:15 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/HeaderTokenizer.java	Thu Jul 30 18:06:14 2009
+@@ -37,7 +37,7 @@
+  *
+  * This class handles folded headers (ie headers with embedded
+  * CRLF SPACE sequences). The folds are removed in the returned
+- * tokens. 
++ * tokens.
+  *
+  * @version 1.9, 02/03/27
+  * @author  John Mani
+@@ -46,78 +46,78 @@
+ public class HeaderTokenizer {
+ 
+     /**
+-     * The Token class represents tokens returned by the 
++     * The Token class represents tokens returned by the
+      * HeaderTokenizer.
+      */
+     public static class Token {
+ 
+-	private int type;
+-	private String value;
++        private int type;
++        private String value;
+ 
+-	/**
+-	 * Token type indicating an ATOM.
+-	 */
+-	public static final int ATOM 		= -1;
++        /**
++         * Token type indicating an ATOM.
++         */
++        public static final int ATOM            = -1;
+ 
+-	/**
+-	 * Token type indicating a quoted string. The value 
+-	 * field contains the string without the quotes.
+- 	 */
+-	public static final int QUOTEDSTRING 	= -2;
++        /**
++         * Token type indicating a quoted string. The value
++         * field contains the string without the quotes.
++         */
++        public static final int QUOTEDSTRING    = -2;
+ 
+-	/**
+-	 * Token type indicating a comment. The value field 
+-	 * contains the comment string without the comment 
+-	 * start and end symbols.
+-	 */
+-	public static final int COMMENT		= -3;
++        /**
++         * Token type indicating a comment. The value field
++         * contains the comment string without the comment
++         * start and end symbols.
++         */
++        public static final int COMMENT         = -3;
+ 
+-	/**
+-	 * Token type indicating end of input.
+-	 */
+-	public static final int  EOF 		= -4;
++        /**
++         * Token type indicating end of input.
++         */
++        public static final int  EOF            = -4;
+ 
+-	/**
+-	 * Constructor.
+-	 * @param	type	Token type
+-	 * @param	value	Token value
+-	 */
+-	public Token(int type, String value) {
+-	     this.type = type;
+-	     this.value = value;
+-	}
++        /**
++         * Constructor.
++         * @param       type    Token type
++         * @param       value   Token value
++         */
++        public Token(int type, String value) {
++             this.type = type;
++             this.value = value;
++        }
+ 
+-	/**
+-	 * Return the type of the token. If the token represents a
+-	 * delimiter or a control character, the type is that character
+-	 * itself, converted to an integer. Otherwise, it's value is 
+-	 * one of the following:
+-	 * <ul>
+-	 * <li><code>ATOM</code> A sequence of ASCII characters 
+-	 *	delimited by either SPACE, CTL, "(", <"> or the 
+-	 *	specified SPECIALS
+-	 * <li><code>QUOTEDSTRING</code> A sequence of ASCII characters
+-	 *	within quotes
+-	 * <li><code>COMMENT</code> A sequence of ASCII characters 
+-	 *	within "(" and ")".
+-	 * <li><code>EOF</code> End of header
+-	 * </ul>
+-	 */
+-	public int getType() {
+-	    return type;
+-	}
++        /**
++         * Return the type of the token. If the token represents a
++         * delimiter or a control character, the type is that character
++         * itself, converted to an integer. Otherwise, it's value is
++         * one of the following:
++         * <ul>
++         * <li><code>ATOM</code> A sequence of ASCII characters
++         *      delimited by either SPACE, CTL, "(", <"> or the
++         *      specified SPECIALS
++         * <li><code>QUOTEDSTRING</code> A sequence of ASCII characters
++         *      within quotes
++         * <li><code>COMMENT</code> A sequence of ASCII characters
++         *      within "(" and ")".
++         * <li><code>EOF</code> End of header
++         * </ul>
++         */
++        public int getType() {
++            return type;
++        }
+ 
+-	/**
+-	 * Returns the value of the token just read. When the current
+-	 * token is a quoted string, this field contains the body of the
+-	 * string, without the quotes. When the current token is a comment,
+-	 * this field contains the body of the comment.
+-	 *
+-	 * @return	token value
+-	 */
+-	public String getValue() {
+-	    return value;
+-	}
++        /**
++         * Returns the value of the token just read. When the current
++         * token is a quoted string, this field contains the body of the
++         * string, without the quotes. When the current token is a comment,
++         * this field contains the body of the comment.
++         *
++         * @return      token value
++         */
++        public String getValue() {
++            return value;
++        }
+     }
+ 
+     private String string; // the string to be tokenized
+@@ -144,31 +144,31 @@
+     /**
+      * Constructor that takes a rfc822 style header.
+      *
+-     * @param	header	The rfc822 header to be tokenized
+-     * @param	delimiters      Set of delimiter characters 
+-     *				to be used to delimit ATOMS. These
+-     *				are usually <code>RFC822</code> or 
+-     *				<code>MIME</code>
++     * @param   header  The rfc822 header to be tokenized
++     * @param   delimiters      Set of delimiter characters
++     *                          to be used to delimit ATOMS. These
++     *                          are usually <code>RFC822</code> or
++     *                          <code>MIME</code>
+      * @param   skipComments  If true, comments are skipped and
+-     *				not returned as tokens
++     *                          not returned as tokens
+      */
+     public HeaderTokenizer(String header, String delimiters,
+-    			   boolean skipComments) {
+-	string = (header == null) ? "" : header; // paranoia ?!
+-	this.skipComments = skipComments;
+-	this.delimiters = delimiters;
+-	currentPos = nextPos = peekPos = 0;
+-	maxPos = string.length();
++                           boolean skipComments) {
++        string = (header == null) ? "" : header; // paranoia ?!
++        this.skipComments = skipComments;
++        this.delimiters = delimiters;
++        currentPos = nextPos = peekPos = 0;
++        maxPos = string.length();
+     }
+ 
+     /**
+      * Constructor. Comments are ignored and not returned as tokens
+      *
+-     * @param	header  The header that is tokenized
+-     * @param	delimiters  The delimiters to be used
++     * @param   header  The header that is tokenized
++     * @param   delimiters  The delimiters to be used
+      */
+     public HeaderTokenizer(String header, String delimiters) {
+-	this(header, delimiters, true);
++        this(header, delimiters, true);
+     }
+ 
+     /**
+@@ -177,7 +177,7 @@
+      * returned as tokens
+      */
+     public HeaderTokenizer(String header)  {
+-	this(header, RFC822);
++        this(header, RFC822);
+     }
+ 
+     /**
+@@ -186,16 +186,16 @@
+      * Clients sit in a loop calling next() to parse successive
+      * tokens until an EOF Token is returned.
+      *
+-     * @return		the next Token
+-     * @exception	ParseException if the parse fails
++     * @return          the next Token
++     * @exception       ParseException if the parse fails
+      */
+-    public Token next() throws ParseException { 
+-	Token tk;
++    public Token next() throws ParseException {
++        Token tk;
+ 
+-	currentPos = nextPos; // setup currentPos
+-	tk = getNext();
+-	nextPos = peekPos = currentPos; // update currentPos and peekPos
+-	return tk;
++        currentPos = nextPos; // setup currentPos
++        tk = getNext();
++        nextPos = peekPos = currentPos; // update currentPos and peekPos
++        return tk;
+     }
+ 
+     /**
+@@ -204,141 +204,141 @@
+      * will return successive tokens, until <code>next()</code> is
+      * called. <p>
+      *
+-     * @return		the next Token
+-     * @exception	ParseException if the parse fails
++     * @return          the next Token
++     * @exception       ParseException if the parse fails
+      */
+     public Token peek() throws ParseException {
+-	Token tk;
++        Token tk;
+ 
+-	currentPos = peekPos; // setup currentPos
+-	tk = getNext();
+-	peekPos = currentPos; // update peekPos
+-	return tk;
++        currentPos = peekPos; // setup currentPos
++        tk = getNext();
++        peekPos = currentPos; // update peekPos
++        return tk;
+     }
+ 
+     /**
+      * Return the rest of the Header.
+      *
+-     * @return String	rest of header. null is returned if we are
+-     *			already at end of header
++     * @return String   rest of header. null is returned if we are
++     *                  already at end of header
+      */
+     public String getRemainder() {
+-	return string.substring(nextPos);
++        return string.substring(nextPos);
+     }
+ 
+     /*
+      * Return the next token starting from 'currentPos'. After the
+-     * parse, 'currentPos' is updated to point to the start of the 
++     * parse, 'currentPos' is updated to point to the start of the
+      * next token.
+      */
+     private Token getNext() throws ParseException {
+-	// If we're already at end of string, return EOF
+-	if (currentPos >= maxPos)
+-	    return EOFToken;
++        // If we're already at end of string, return EOF
++        if (currentPos >= maxPos)
++            return EOFToken;
+ 
+-	// Skip white-space, position currentPos beyond the space
+-	if (skipWhiteSpace() == Token.EOF)
+-	    return EOFToken;
++        // Skip white-space, position currentPos beyond the space
++        if (skipWhiteSpace() == Token.EOF)
++            return EOFToken;
+ 
+-	char c; 
+-	int start; 
+-	boolean filter = false;
+-	
+-	c = string.charAt(currentPos);
++        char c;
++        int start;
++        boolean filter = false;
+ 
+-	// Check or Skip comments and position currentPos
+-	// beyond the comment
+-	while (c == '(') {
+-	    // Parsing comment ..
+-	    int nesting;
+-	    for (start = ++currentPos, nesting = 1; 
+-		 nesting > 0 && currentPos < maxPos;
+-		 currentPos++) {
+-		c = string.charAt(currentPos);
+-		if (c == '\\') {  // Escape sequence
+-		    currentPos++; // skip the escaped character
+-		    filter = true;
+-		} else if (c == '\r')
+-		    filter = true;
+-		else if (c == '(')
+-		    nesting++;
+-		else if (c == ')')
+-		    nesting--;
+-	    }
+-	    if (nesting != 0)
+-		throw new ParseException("Unbalanced comments");
++        c = string.charAt(currentPos);
+ 
+-	    if (!skipComments) {
+-		// Return the comment, if we are asked to.
+-		// Note that the comment start & end markers are ignored.
+-		String s;
+-		if (filter) // need to go thru the token again.
+-		    s = filterToken(string, start, currentPos-1);
+-		else
+-		    s = string.substring(start,currentPos-1);
++        // Check or Skip comments and position currentPos
++        // beyond the comment
++        while (c == '(') {
++            // Parsing comment ..
++            int nesting;
++            for (start = ++currentPos, nesting = 1;
++                 nesting > 0 && currentPos < maxPos;
++                 currentPos++) {
++                c = string.charAt(currentPos);
++                if (c == '\\') {  // Escape sequence
++                    currentPos++; // skip the escaped character
++                    filter = true;
++                } else if (c == '\r')
++                    filter = true;
++                else if (c == '(')
++                    nesting++;
++                else if (c == ')')
++                    nesting--;
++            }
++            if (nesting != 0)
++                throw new ParseException("Unbalanced comments");
+ 
+-		return new Token(Token.COMMENT, s);
+-	    }
++            if (!skipComments) {
++                // Return the comment, if we are asked to.
++                // Note that the comment start & end markers are ignored.
++                String s;
++                if (filter) // need to go thru the token again.
++                    s = filterToken(string, start, currentPos-1);
++                else
++                    s = string.substring(start,currentPos-1);
+ 
+-	    // Skip any whitespace after the comment.
+-	    if (skipWhiteSpace() == Token.EOF)
+-		return EOFToken;
+-	    c = string.charAt(currentPos);
+-	}
++                return new Token(Token.COMMENT, s);
++            }
+ 
+-	// Check for quoted-string and position currentPos 
+-	//  beyond the terminating quote
+-	if (c == '"') {
+-	    for (start = ++currentPos; currentPos < maxPos; currentPos++) {
+-		c = string.charAt(currentPos);
+-		if (c == '\\') { // Escape sequence
+-		    currentPos++;
+-		    filter = true;
+-		} else if (c == '\r')
+-		    filter = true;
+-		else if (c == '"') {
+-		    currentPos++;
+-		    String s;
++            // Skip any whitespace after the comment.
++            if (skipWhiteSpace() == Token.EOF)
++                return EOFToken;
++            c = string.charAt(currentPos);
++        }
+ 
+-		    if (filter)
+-			s = filterToken(string, start, currentPos-1);
+-		    else
+-			s = string.substring(start,currentPos-1);
++        // Check for quoted-string and position currentPos
++        //  beyond the terminating quote
++        if (c == '"') {
++            for (start = ++currentPos; currentPos < maxPos; currentPos++) {
++                c = string.charAt(currentPos);
++                if (c == '\\') { // Escape sequence
++                    currentPos++;
++                    filter = true;
++                } else if (c == '\r')
++                    filter = true;
++                else if (c == '"') {
++                    currentPos++;
++                    String s;
+ 
+-		    return new Token(Token.QUOTEDSTRING, s);
+-		}
+-	    }
+-	    throw new ParseException("Unbalanced quoted string");
+-	}
+-	
+-	// Check for SPECIAL or CTL
+-	if (c < 040 || c >= 0177 || delimiters.indexOf(c) >= 0) {
+-	    currentPos++; // re-position currentPos
+-	    char ch[] = new char[1];
+-	    ch[0] = c;
+-	    return new Token((int)c, new String(ch));
+-	}
++                    if (filter)
++                        s = filterToken(string, start, currentPos-1);
++                    else
++                        s = string.substring(start,currentPos-1);
+ 
+-	// Check for ATOM
+-	for (start = currentPos; currentPos < maxPos; currentPos++) {
+-	    c = string.charAt(currentPos);
+-	    // ATOM is delimited by either SPACE, CTL, "(", <"> 
+-	    // or the specified SPECIALS
+-	    if (c < 040 || c >= 0177 || c == '(' || c == ' ' ||
+-		c == '"' || delimiters.indexOf(c) >= 0)
+-		break;
+-	}
+-	return new Token(Token.ATOM, string.substring(start, currentPos));
++                    return new Token(Token.QUOTEDSTRING, s);
++                }
++            }
++            throw new ParseException("Unbalanced quoted string");
++        }
++
++        // Check for SPECIAL or CTL
++        if (c < 040 || c >= 0177 || delimiters.indexOf(c) >= 0) {
++            currentPos++; // re-position currentPos
++            char ch[] = new char[1];
++            ch[0] = c;
++            return new Token((int)c, new String(ch));
++        }
++
++        // Check for ATOM
++        for (start = currentPos; currentPos < maxPos; currentPos++) {
++            c = string.charAt(currentPos);
++            // ATOM is delimited by either SPACE, CTL, "(", <">
++            // or the specified SPECIALS
++            if (c < 040 || c >= 0177 || c == '(' || c == ' ' ||
++                c == '"' || delimiters.indexOf(c) >= 0)
++                break;
++        }
++        return new Token(Token.ATOM, string.substring(start, currentPos));
+     }
+ 
+     // Skip SPACE, HT, CR and NL
+     private int skipWhiteSpace() {
+-	char c;
+-	for (; currentPos < maxPos; currentPos++)
+-	    if (((c = string.charAt(currentPos)) != ' ') && 
+-		(c != '\t') && (c != '\r') && (c != '\n'))
+-		return currentPos;
+-	return Token.EOF;
++        char c;
++        for (; currentPos < maxPos; currentPos++)
++            if (((c = string.charAt(currentPos)) != ' ') &&
++                (c != '\t') && (c != '\r') && (c != '\n'))
++                return currentPos;
++        return Token.EOF;
+     }
+ 
+     /* Process escape sequences and embedded LWSPs from a comment or
+@@ -345,37 +345,37 @@
+      * quoted string.
+      */
+     private static String filterToken(String s, int start, int end) {
+-	StringBuffer sb = new StringBuffer();
+-	char c;
+-	boolean gotEscape = false;
+-	boolean gotCR = false;
++        StringBuffer sb = new StringBuffer();
++        char c;
++        boolean gotEscape = false;
++        boolean gotCR = false;
+ 
+-	for (int i = start; i < end; i++) {
+-	    c = s.charAt(i);
+-	    if (c == '\n' && gotCR) {
+-		// This LF is part of an unescaped 
+-		// CRLF sequence (i.e, LWSP). Skip it.
+-		gotCR = false;
+-		continue;
+-	    }
++        for (int i = start; i < end; i++) {
++            c = s.charAt(i);
++            if (c == '\n' && gotCR) {
++                // This LF is part of an unescaped
++                // CRLF sequence (i.e, LWSP). Skip it.
++                gotCR = false;
++                continue;
++            }
+ 
+-	    gotCR = false;
+-	    if (!gotEscape) {
+-		// Previous character was NOT '\'
+-		if (c == '\\') // skip this character
+-		    gotEscape = true;
+-		else if (c == '\r') // skip this character
+-		    gotCR = true;
+-		else // append this character
+-		    sb.append(c);
+-	    } else {
+-		// Previous character was '\'. So no need to 
+-		// bother with any special processing, just 
+-		// append this character
+-		sb.append(c);
+-		gotEscape = false;
+-	    }
+-	}
+-	return sb.toString();
++            gotCR = false;
++            if (!gotEscape) {
++                // Previous character was NOT '\'
++                if (c == '\\') // skip this character
++                    gotEscape = true;
++                else if (c == '\r') // skip this character
++                    gotCR = true;
++                else // append this character
++                    sb.append(c);
++            } else {
++                // Previous character was '\'. So no need to
++                // bother with any special processing, just
++                // append this character
++                sb.append(c);
++                gotEscape = false;
++            }
++        }
++        return sb.toString();
+     }
+ }
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/InternetHeaders.java	Thu Jul 30 18:06:19 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/InternetHeaders.java	Thu Jul 30 18:06:18 2009
+@@ -68,7 +68,7 @@
+  *
+  * @author John Mani
+  * @author Bill Shannon
+- * @see	MimeUtility
++ * @see MimeUtility
+  */
+ public final class InternetHeaders {
+ 
+@@ -94,7 +94,7 @@
+      * For efficiency, wrap a BufferedInputStream around the actual
+      * input stream and pass it as the parameter.
+      *
+-     * @param	is RFC822 input stream
++     * @param   is RFC822 input stream
+      */
+     public InternetHeaders(InputStream is) throws MessagingException {
+         load(is);
+@@ -109,7 +109,7 @@
+      * object, so any existing headers in this object will not be
+      * affected.
+      *
+-     * @param	is RFC822 input stream
++     * @param   is RFC822 input stream
+      */
+     public void load(InputStream is) throws MessagingException {
+         // Read header lines until a blank line. It is valid
+@@ -116,7 +116,7 @@
+         // to have BodyParts with no header lines.
+         String line;
+         LineInputStream lis = new LineInputStream(is);
+-        String prevline = null;	// the previous header line, as a string
++        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();
+ 
+@@ -155,8 +155,8 @@
+      * values are String objects.  Returns <code>null</code>
+      * if no headers with the specified name exist.
+      *
+-     * @param	name header name
+-     * @return		array of header values, or null if none
++     * @param   name header name
++     * @return          array of header values, or null if none
+      */
+     public String[] getHeader(String name) {
+         // XXX - should we just step through in index order?
+@@ -185,7 +185,7 @@
+      * @param delimiter delimiter
+      * @return the value fields for all headers with
+      *         this name, or null if none
+-     * @param	name header name
++     * @param   name header name
+      */
+     public String getHeader(String name, String delimiter) {
+         String[] s = getHeader(name);
+@@ -211,8 +211,8 @@
+      * <p/>
+      * Note that RFC822 headers can only contain US-ASCII characters
+      *
+-     * @param	name	header name
+-     * @param	value	header value
++     * @param   name    header name
++     * @param   value   header value
+      */
+     public void setHeader(String name, String value) {
+         boolean found = false;
+@@ -245,8 +245,8 @@
+      * <p/>
+      * Note that RFC822 headers can only contain US-ASCII characters.
+      *
+-     * @param	name	header name
+-     * @param	value	header value
++     * @param   name    header name
++     * @param   value   header value
+      */
+     public void addHeader(String name, String value) {
+         int pos = headers.size();
+@@ -266,7 +266,7 @@
+     /**
+      * Remove all header entries that match the given name
+      *
+-     * @param	name header name
++     * @param   name header name
+      */
+     public void removeHeader(String name) {
+         for (int i = 0; i < headers.size(); i++) {
+@@ -282,7 +282,7 @@
+      * Return all the headers as an Enumeration of
+      * {@link Header} objects.
+      *
+-     * @return	Header objects
++     * @return  Header objects
+      */
+     public FinalArrayList getAllHeaders() {
+         return headers; // conceptually it should be read-only, but for performance reason I'm not wrapping it here
+@@ -295,7 +295,7 @@
+      * <p/>
+      * Note that RFC822 headers can only contain US-ASCII characters
+      *
+-     * @param	line	raw RFC822 header line
++     * @param   line    raw RFC822 header line
+      */
+     public void addHeaderLine(String line) {
+         try {
+@@ -381,7 +381,7 @@
+ 
+         int j;
+         if (name.equalsIgnoreCase("Content-Description")) {
+-            // Content-Description should retain the folded whitespace after header unfolding - 
++            // Content-Description should retain the folded whitespace after header unfolding -
+             // rf. RFC2822 section 2.2.3, rf. RFC2822 section 3.2.3
+             for (j = i + 1; j < line.length(); j++) {
+                 char c = line.charAt(j);
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimeBodyPart.java	Thu Jul 30 18:06:22 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimeBodyPart.java	Thu Jul 30 18:06:22 2009
+@@ -94,13 +94,13 @@
+     private static boolean setDefaultTextCharset = true;
+ 
+     static {
+-	try {
+-	    String s = System.getProperty("mail.mime.setdefaulttextcharset");
+-	    // default to true
+-	    setDefaultTextCharset = s == null || !s.equalsIgnoreCase("false");
+-	} catch (SecurityException sex) {
+-	    // ignore it
+-	}
++        try {
++            String s = System.getProperty("mail.mime.setdefaulttextcharset");
++            // default to true
++            setDefaultTextCharset = s == null || !s.equalsIgnoreCase("false");
++        } catch (SecurityException sex) {
++            // ignore it
++        }
+     }
+ 
+     /*
+@@ -130,7 +130,7 @@
+      * the content of this body part.  In this case, <code>content</code>
+      * will be null.
+      *
+-     * @since	JavaMail 1.2
++     * @since   JavaMail 1.2
+      */
+     private InputStream contentStream;
+ 
+@@ -145,7 +145,7 @@
+     /**
+      * The <code>MimeMultipart</code> object containing this <code>MimeBodyPart</code>,
+      * if known.
+-     * @since	JavaMail 1.1
++     * @since   JavaMail 1.1
+      */
+     private MimeMultipart parent;
+ 
+@@ -165,13 +165,13 @@
+      * beginning of a valid MIME body part and must terminate at the end
+      * of that body part. <p>
+      *
+-     * Note that the "boundary" string that delimits body parts must 
+-     * <strong>not</strong> be included in the input stream. The intention 
++     * Note that the "boundary" string that delimits body parts must
++     * <strong>not</strong> be included in the input stream. The intention
+      * is that the MimeMultipart parser will extract each body part's bytes
+-     * from a multipart stream and feed them into this constructor, without 
++     * from a multipart stream and feed them into this constructor, without
+      * the delimiter strings.
+      *
+-     * @param	is	the body part Input Stream
++     * @param   is      the body part Input Stream
+      */
+     public MimeBodyPart(InputStream is) throws MessagingException {
+         if (!(is instanceof ByteArrayInputStream) &&
+@@ -203,8 +203,8 @@
+      *
+      * Used by providers.
+      *
+-     * @param	headers	The header of this part
+-     * @param	content	bytes representing the body of this part.
++     * @param   headers The header of this part
++     * @param   content bytes representing the body of this part.
+      */
+     public MimeBodyPart(InternetHeaders headers, byte[] content, int len) {
+         this.headers = headers;
+@@ -225,7 +225,7 @@
+      * or <code>null</code> if not known.
+      */
+     public MimeMultipart getParent() {
+-	return parent;
++        return parent;
+     }
+ 
+     /**
+@@ -234,10 +234,10 @@
+      * <code>addBodyPart</code> method.  <code>parent</code> may be
+      * <code>null</code> if the <code>MimeBodyPart</code> is being removed
+      * from its containing <code>MimeMultipart</code>.
+-     * @since	JavaMail 1.1
++     * @since   JavaMail 1.1
+      */
+     public void setParent(MimeMultipart parent) {
+-	this.parent = parent;
++        this.parent = parent;
+     }
+ 
+     /**
+@@ -257,20 +257,20 @@
+      * @return size in bytes, or -1 if not known
+      */
+     public int getSize() {
+-	if (content != null)
+-	    return contentLength;
+-	if (contentStream != null) {
+-	    try {
+-		int size = contentStream.available();
+-		// only believe the size if it's greate than zero, since zero
+-		// is the default returned by the InputStream class itself
+-		if (size > 0)
+-		    return size;
+-	    } catch (IOException ex) {
+-		// ignore it
+-	    }
+-	}
+-	return -1;
++        if (content != null)
++            return contentLength;
++        if (contentStream != null) {
++            try {
++                int size = contentStream.available();
++                // only believe the size if it's greate than zero, since zero
++                // is the default returned by the InputStream class itself
++                if (size > 0)
++                    return size;
++            } catch (IOException ex) {
++                // ignore it
++            }
++        }
++        return -1;
+     }
+ 
+     /**
+@@ -277,16 +277,16 @@
+      * Return the number of lines for the content of this MimeBodyPart.
+      * Return -1 if this number cannot be determined. <p>
+      *
+-     * Note that this number may not be an exact measure of the 
+-     * content length and may or may not account for any transfer 
++     * Note that this number may not be an exact measure of the
++     * content length and may or may not account for any transfer
+      * encoding of the content. <p>
+      *
+      * This implementation returns -1.
+      *
+      * @return number of lines, or -1 if not known
+-     */  
++     */
+      public int getLineCount() {
+-	return -1;
++        return -1;
+      }
+ 
+     /**
+@@ -298,19 +298,19 @@
+      * This implementation uses <code>getHeader(name)</code>
+      * to obtain the requisite header field.
+      *
+-     * @return	Content-Type of this body part
++     * @return  Content-Type of this body part
+      */
+     public String getContentType() {
+-	String s = getHeader("Content-Type", null);
+-	if (s == null)
+-	    s = "text/plain";
+-	
+-	return s;
++        String s = getHeader("Content-Type", null);
++        if (s == null)
++            s = "text/plain";
++
++        return s;
+     }
+ 
+     /**
+      * Is this MimeBodyPart of the specified MIME type?  This method
+-     * compares <strong>only the <code>primaryType</code> and 
++     * compares <strong>only the <code>primaryType</code> and
+      * <code>subType</code></strong>.
+      * The parameters of the content types are ignored. <p>
+      *
+@@ -362,8 +362,8 @@
+      * If the disposition is null, any existing "Content-Disposition"
+      * header field is removed.
+      *
+-     * @exception	IllegalStateException if this body part is
+-     *			obtained from a READ_ONLY folder.
++     * @exception       IllegalStateException if this body part is
++     *                  obtained from a READ_ONLY folder.
+      */
+     public void setDisposition(String disposition) throws MessagingException {
+         if (disposition == null)
+@@ -401,7 +401,7 @@
+         if (s == null)
+             return null;
+ 
+-        s = s.trim();	// get rid of trailing spaces
++        s = s.trim();   // get rid of trailing spaces
+         // quick check for known values to avoid unnecessary use
+         // of tokenizer.
+         if (s.equalsIgnoreCase("7bit") || s.equalsIgnoreCase("8bit") ||
+@@ -430,7 +430,7 @@
+ 
+     /**
+      * Returns the value of the "Content-ID" header field. Returns
+-     * <code>null</code> if the field is unavailable or its value is 
++     * <code>null</code> if the field is unavailable or its value is
+      * absent. <p>
+      *
+      * This implementation uses <code>getHeader(name)</code>
+@@ -437,27 +437,27 @@
+      * to obtain the requisite header field.
+      */
+     public String getContentID() {
+-	return getHeader("Content-ID", null);
++        return getHeader("Content-ID", null);
+     }
+ 
+     /**
+      * Set the "Content-ID" header field of this body part.
+-     * If the <code>cid</code> parameter is null, any existing 
++     * If the <code>cid</code> parameter is null, any existing
+      * "Content-ID" is removed.
+      *
+-     * @exception	IllegalStateException if this body part is
+-     *			obtained from a READ_ONLY folder.
+-     * @since		JavaMail 1.3
++     * @exception       IllegalStateException if this body part is
++     *                  obtained from a READ_ONLY folder.
++     * @since           JavaMail 1.3
+      */
+     public void setContentID(String cid) {
+-	if (cid == null)
+-	    removeHeader("Content-ID");
+-	else
+-	    setHeader("Content-ID", cid);
++        if (cid == null)
++            removeHeader("Content-ID");
++        else
++            setHeader("Content-ID", cid);
+     }
+ 
+     /**
+-     * Return the value of the "Content-MD5" header field. Returns 
++     * Return the value of the "Content-MD5" header field. Returns
+      * <code>null</code> if this field is unavailable or its value
+      * is absent. <p>
+      *
+@@ -465,17 +465,17 @@
+      * to obtain the requisite header field.
+      */
+     public String getContentMD5() {
+-	return getHeader("Content-MD5", null);
++        return getHeader("Content-MD5", null);
+     }
+ 
+     /**
+      * Set the "Content-MD5" header field of this body part.
+      *
+-     * @exception	IllegalStateException if this body part is
+-     *			obtained from a READ_ONLY folder.
++     * @exception       IllegalStateException if this body part is
++     *                  obtained from a READ_ONLY folder.
+      */
+     public void setContentMD5(String md5) {
+-	setHeader("Content-MD5", md5);
++        setHeader("Content-MD5", md5);
+     }
+ 
+     /**
+@@ -520,7 +520,7 @@
+      * Set the Content-Language header of this MimeBodyPart. The
+      * Content-Language header is defined by RFC 1766.
+      *
+-     * @param languages 	array of language tags
++     * @param languages         array of language tags
+      */
+     public void setContentLanguage(String[] languages) {
+         StringBuffer sb = new StringBuffer(languages[0]);
+@@ -531,18 +531,18 @@
+ 
+     /**
+      * Returns the "Content-Description" header field of this body part.
+-     * This typically associates some descriptive information with 
++     * This typically associates some descriptive information with
+      * this part. Returns null if this field is unavailable or its
+      * value is absent. <p>
+      *
+      * If the Content-Description field is encoded as per RFC 2047,
+-     * it is decoded and converted into Unicode. If the decoding or 
++     * it is decoded and converted into Unicode. If the decoding or
+      * conversion fails, the raw data is returned as is. <p>
+      *
+      * This implementation uses <code>getHeader(name)</code>
+      * to obtain the requisite header field.
+-     * 
+-     * @return	content description
++     *
++     * @return  content description
+      */
+     public String getDescription() {
+         String rawvalue = getHeader("Content-Description", null);
+@@ -559,12 +559,12 @@
+ 
+     /**
+      * Set the "Content-Description" header field for this body part.
+-     * If the description parameter is <code>null</code>, then any 
++     * If the description parameter is <code>null</code>, then any
+      * existing "Content-Description" fields are removed. <p>
+      *
+-     * If the description contains non US-ASCII characters, it will 
+-     * be encoded using the platform's default charset. If the 
+-     * description contains only US-ASCII characters, no encoding 
++     * If the description contains non US-ASCII characters, it will
++     * be encoded using the platform's default charset. If the
++     * description contains only US-ASCII characters, no encoding
+      * is done and it is used as is. <p>
+      *
+      * Note that if the charset encoding process fails, a
+@@ -571,10 +571,10 @@
+      * MessagingException is thrown, and an UnsupportedEncodingException
+      * is included in the chain of nested exceptions within the
+      * MessagingException.
+-     * 
++     *
+      * @param description content description
+-     * @exception	IllegalStateException if this body part is
+-     *			obtained from a READ_ONLY folder.
++     * @exception       IllegalStateException if this body part is
++     *                  obtained from a READ_ONLY folder.
+      * @exception       MessagingException An
+      *                  UnsupportedEncodingException may be included
+      *                  in the exception chain if the charset
+@@ -581,17 +581,17 @@
+      *                  conversion fails.
+      */
+     public void setDescription(String description) throws MessagingException {
+-	setDescription(description, null);
++        setDescription(description, null);
+     }
+ 
+     /**
+      * Set the "Content-Description" header field for this body part.
+-     * If the description parameter is <code>null</code>, then any 
++     * If the description parameter is <code>null</code>, then any
+      * existing "Content-Description" fields are removed. <p>
+      *
+-     * If the description contains non US-ASCII characters, it will 
+-     * be encoded using the specified charset. If the description 
+-     * contains only US-ASCII characters, no encoding  is done and 
++     * If the description contains non US-ASCII characters, it will
++     * be encoded using the specified charset. If the description
++     * contains only US-ASCII characters, no encoding  is done and
+      * it is used as is. <p>
+      *
+      * Note that if the charset encoding process fails, a
+@@ -599,17 +599,17 @@
+      * is included in the chain of nested exceptions within the
+      * MessagingException.
+      *
+-     * @param	description	Description
+-     * @param	charset		Charset for encoding
+-     * @exception	IllegalStateException if this body part is
+-     *			obtained from a READ_ONLY folder.
++     * @param   description     Description
++     * @param   charset         Charset for encoding
++     * @exception       IllegalStateException if this body part is
++     *                  obtained from a READ_ONLY folder.
+      * @exception       MessagingException An
+      *                  UnsupportedEncodingException may be included
+      *                  in the exception chain if the charset
+      *                  conversion fails.
+      */
+-    public void setDescription(String description, String charset) 
+-		throws MessagingException {
++    public void setDescription(String description, String charset)
++                throws MessagingException {
+         if (description == null) {
+             removeHeader("Content-Description");
+             return;
+@@ -632,7 +632,7 @@
+      * the "Content-Type" header field of this body part.
+      * Returns <code>null</code> if both are absent.
+      *
+-     * @return	filename
++     * @return  filename
+      */
+     public String getFileName() throws MessagingException {
+         String filename = null;
+@@ -650,7 +650,7 @@
+             try {
+                 ContentType ct = new ContentType(s);
+                 filename = ct.getParameter("name");
+-            } catch (ParseException pex) { }	// ignore it
++            } catch (ParseException pex) { }    // ignore it
+             }
+         }
+         return filename;
+@@ -662,8 +662,8 @@
+      * Sets the "filename" parameter of the "Content-Disposition"
+      * header field of this body part.
+      *
+-     * @exception	IllegalStateException if this body part is
+-     *			obtained from a READ_ONLY folder.
++     * @exception       IllegalStateException if this body part is
++     *                  obtained from a READ_ONLY folder.
+      */
+     public void setFileName(String filename) throws MessagingException {
+         // Set the Content-Disposition "filename" parameter
+@@ -685,7 +685,7 @@
+             ContentType cType = new ContentType(s);
+             cType.setParameter("name", filename);
+             setHeader("Content-Type", cType.toString());
+-            } catch (ParseException pex) { }	// ignore it
++            } catch (ParseException pex) { }    // ignore it
+         }
+     }
+ 
+@@ -695,17 +695,17 @@
+      * This implementation obtains the input stream from the DataHandler.
+      * That is, it invokes getDataHandler().getInputStream();
+      *
+-     * @return 		an InputStream
++     * @return          an InputStream
+      * @exception       IOException this is typically thrown by the
+-     *			DataHandler. Refer to the documentation for
+-     *			javax.activation.DataHandler for more details.
++     *                  DataHandler. Refer to the documentation for
++     *                  javax.activation.DataHandler for more details.
+      *
+-     * @see	#getContentStream
+-     * @see 	DataHandler#getInputStream
++     * @see     #getContentStream
++     * @see     DataHandler#getInputStream
+      */
+-    public InputStream getInputStream() 
+-		throws IOException {
+-	return getDataHandler().getInputStream();
++    public InputStream getInputStream()
++                throws IOException {
++        return getDataHandler().getInputStream();
+     }
+ 
+    /**
+@@ -713,16 +713,16 @@
+      * when creating a DataHandler object for the content. Subclasses
+      * that can provide a separate input stream for just the MimeBodyPart
+      * content might want to override this method. <p>
+-     * 
++     *
+      * @see #content
+      */
+     /*package*/ InputStream getContentStream() throws MessagingException {
+-	if (contentStream != null)
+-	    return ((SharedInputStream)contentStream).newStream(0, -1);
+-	if (content != null)
+-	    return new ByteArrayInputStream(content,start,contentLength);
+-	
+-	throw new MessagingException("No content");
++        if (contentStream != null)
++            return ((SharedInputStream)contentStream).newStream(0, -1);
++        if (content != null)
++            return new ByteArrayInputStream(content,start,contentLength);
++
++        throw new MessagingException("No content");
+     }
+ 
+     /**
+@@ -736,12 +736,12 @@
+      * This implementation simply calls the <code>getContentStream</code>
+      * method.
+      *
+-     * @see	#getInputStream
+-     * @see	#getContentStream
+-     * @since	JavaMail 1.2
++     * @see     #getInputStream
++     * @see     #getContentStream
++     * @since   JavaMail 1.2
+      */
+     public InputStream getRawInputStream() throws MessagingException {
+-	return getContentStream();
++        return getContentStream();
+     }
+ 
+     /**
+@@ -758,7 +758,7 @@
+ 
+     /**
+      * Return the content as a java object. The type of the object
+-     * returned is of course dependent on the content itself. For 
++     * returned is of course dependent on the content itself. For
+      * example, the native format of a text/plain content is usually
+      * a String object. The native format for a "multipart"
+      * content is always a MimeMultipart subclass. For content types that are
+@@ -770,21 +770,21 @@
+      *
+      * @return          Object
+      * @exception       IOException this is typically thrown by the
+-     *			DataHandler. Refer to the documentation for
+-     *			javax.activation.DataHandler for more details.
+-     */  
++     *                  DataHandler. Refer to the documentation for
++     *                  javax.activation.DataHandler for more details.
++     */
+     public Object getContent() throws IOException {
+-	return getDataHandler().getContent();
++        return getDataHandler().getContent();
+     }
+ 
+     /**
+      * This method provides the mechanism to set this body part's content.
+      * The given DataHandler object should wrap the actual content.
+-     * 
++     *
+      * @param   dh      The DataHandler for the content
+-     * @exception	IllegalStateException if this body part is
+-     *			obtained from a READ_ONLY folder.
+-     */                 
++     * @exception       IllegalStateException if this body part is
++     *                  obtained from a READ_ONLY folder.
++     */
+     public void setDataHandler(DataHandler dh) {
+         this.dh = dh;
+         this.content = null;
+@@ -803,17 +803,17 @@
+      * a DataContentHandler for "application/x-foobar" should be installed.
+      * Refer to the Java Activation Framework for more information.
+      *
+-     * @param	o	the content object
+-     * @param	type	Mime type of the object
+-     * @exception	IllegalStateException if this body part is
+-     *			obtained from a READ_ONLY folder.
++     * @param   o       the content object
++     * @param   type    Mime type of the object
++     * @exception       IllegalStateException if this body part is
++     *                  obtained from a READ_ONLY folder.
+      */
+     public void setContent(Object o, String type) {
+-	if (o instanceof MimeMultipart) {
+-	    setContent((MimeMultipart)o);
+-	} else {
+-	    setDataHandler(new DataHandler(o, type));
+-	}
++        if (o instanceof MimeMultipart) {
++            setContent((MimeMultipart)o);
++        } else {
++            setDataHandler(new DataHandler(o, type));
++        }
+     }
+ 
+     /**
+@@ -830,10 +830,10 @@
+      * If the charset is already known, use the
+      * setText() version that takes the charset parameter.
+      *
+-     * @see	#setText(String text, String charset)
++     * @see     #setText(String text, String charset)
+      */
+     public void setText(String text) {
+-	setText(text, null);
++        setText(text, null);
+     }
+ 
+     /**
+@@ -845,25 +845,25 @@
+      */
+     public void setText(String text, String charset) {
+         if (charset == null) {
+-	    if (MimeUtility.checkAscii(text) != MimeUtility.ALL_ASCII)
+-		charset = MimeUtility.getDefaultMIMECharset();
+-	    else
+-		charset = "us-ascii";
+-	}
++            if (MimeUtility.checkAscii(text) != MimeUtility.ALL_ASCII)
++                charset = MimeUtility.getDefaultMIMECharset();
++            else
++                charset = "us-ascii";
++        }
+         setContent(text, "text/plain; charset=" +
+                 MimeUtility.quote(charset, HeaderTokenizer.MIME));
+     }
+- 
++
+     /**
+      * This method sets the body part's content to a MimeMultipart object.
+      *
+-     * @param  mp      	The multipart object that is the Message's content
+-     * @exception	IllegalStateException if this body part is
+-     *			obtained from a READ_ONLY folder.
++     * @param  mp       The multipart object that is the Message's content
++     * @exception       IllegalStateException if this body part is
++     *                  obtained from a READ_ONLY folder.
+      */
+     public void setContent(MimeMultipart mp) {
+-	setDataHandler(new DataHandler(mp, mp.getContentType().toString()));
+-	mp.setParent(this);
++        setDataHandler(new DataHandler(mp, mp.getContentType().toString()));
++        mp.setParent(this);
+     }
+ 
+     /**
+@@ -870,13 +870,13 @@
+      * Output the body part as an RFC 822 format stream.
+      *
+      * @exception MessagingException
+-     * @exception IOException	if an error occurs writing to the
+-     *				stream or if an error is generated
+-     *				by the javax.activation layer.
++     * @exception IOException   if an error occurs writing to the
++     *                          stream or if an error is generated
++     *                          by the javax.activation layer.
+      * @see DataHandler#writeTo
+      */
+     public void writeTo(OutputStream os)
+-				throws IOException, MessagingException {
++                                throws IOException, MessagingException {
+ 
+         // First, write out the header
+         List hdrLines = headers.getAllHeaderLines();
+@@ -914,24 +914,24 @@
+      * @param   name    name of header
+      * @return  array of headers
+      * @see     MimeUtility
+-     */  
++     */
+     public String[] getHeader(String name) {
+-	return headers.getHeader(name);
++        return headers.getHeader(name);
+     }
+ 
+     /**
+      * Get all the headers for this header name, returned as a single
+      * String, with headers separated by the delimiter. If the
+-     * delimiter is <code>null</code>, only the first header is 
++     * delimiter is <code>null</code>, only the first header is
+      * returned.
+      *
+-     * @param name		the name of this header
+-     * @param delimiter		delimiter between fields in returned string
+-     * @return			the value fields for all headers with 
+-     *				this name
++     * @param name              the name of this header
++     * @param delimiter         delimiter between fields in returned string
++     * @return                  the value fields for all headers with
++     *                          this name
+      */
+     public String getHeader(String name, String delimiter) {
+-	return headers.getHeader(name, delimiter);
++        return headers.getHeader(name, delimiter);
+     }
+ 
+     /**
+@@ -946,9 +946,9 @@
+      * @see     MimeUtility
+      */
+     public void setHeader(String name, String value) {
+-	headers.setHeader(name, value);
++        headers.setHeader(name, value);
+     }
+- 
++
+     /**
+      * Add this value to the existing values for this header_name.
+      * Note that RFC 822 headers must contain only US-ASCII
+@@ -960,7 +960,7 @@
+      * @see     MimeUtility
+      */
+     public void addHeader(String name, String value) {
+-	headers.addHeader(name, value);    
++        headers.addHeader(name, value);
+     }
+ 
+     /**
+@@ -967,9 +967,9 @@
+      * Remove all headers with this name.
+      */
+     public void removeHeader(String name) {
+-	headers.removeHeader(name);
++        headers.removeHeader(name);
+     }
+- 
++
+     /**
+      * Return all the headers from this Message as an Enumeration of
+      * Header objects.
+@@ -983,7 +983,7 @@
+      * Add a header line to this body part
+      */
+     public void addHeaderLine(String line) {
+-	headers.addHeaderLine(line);
++        headers.addHeaderLine(line);
+     }
+ 
+     /**
+@@ -1030,7 +1030,7 @@
+ 
+             // Content-Transfer-Encoding, but only if we don't
+             // already have one
+-            if (!composite) {	// not allowed on composite parts
++            if (!composite) {   // not allowed on composite parts
+                 if (getHeader("Content-Transfer-Encoding") == null)
+                     setEncoding(MimeUtility.getEncoding(dh));
+ 
+@@ -1087,6 +1087,6 @@
+     }
+ 
+     private void setEncoding(String encoding) {
+-	    setHeader("Content-Transfer-Encoding", encoding);
++            setHeader("Content-Transfer-Encoding", encoding);
+     }
+ }
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimeMultipart.java	Thu Jul 30 18:06:26 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimeMultipart.java	Thu Jul 30 18:06:25 2009
+@@ -102,7 +102,7 @@
+     /**
+      * The <code>MimeBodyPart</code> containing this <code>MimeMultipart</code>,
+      * if known.
+-     * @since	JavaMail 1.1
++     * @since   JavaMail 1.1
+      */
+     protected MimeBodyPart parent;
+ 
+@@ -110,7 +110,7 @@
+      * Default constructor. An empty MimeMultipart object
+      * is created. Its content type is set to "multipart/mixed".
+      * A unique boundary string is generated and this string is
+-     * setup as the "boundary" parameter for the 
++     * setup as the "boundary" parameter for the
+      * <code>contentType</code> field. <p>
+      *
+      * MimeBodyParts may be added later.
+@@ -122,29 +122,29 @@
+     /**
+      * Construct a MimeMultipart object of the given subtype.
+      * A unique boundary string is generated and this string is
+-     * setup as the "boundary" parameter for the 
++     * setup as the "boundary" parameter for the
+      * <code>contentType</code> field. <p>
+      *
+      * MimeBodyParts may be added later.
+      */
+     public MimeMultipart(String subtype) {
+-	//super();
+-	/*
+-	 * Compute a boundary string.
+-	 */
+-	String boundary = UniqueValue.getUniqueBoundaryValue();
+-	contentType = new ContentType("multipart", subtype, null);
+-	contentType.setParameter("boundary", boundary);
++        //super();
++        /*
++         * Compute a boundary string.
++         */
++        String boundary = UniqueValue.getUniqueBoundaryValue();
++        contentType = new ContentType("multipart", subtype, null);
++        contentType.setParameter("boundary", boundary);
+     }
+ 
+     /**
+-     * Constructs a MimeMultipart object and its bodyparts from the 
++     * Constructs a MimeMultipart object and its bodyparts from the
+      * given DataSource. <p>
+      *
+      * This constructor handles as a special case the situation where the
+      * given DataSource is a MultipartDataSource object.
+      *
+-     * Otherwise, the DataSource is assumed to provide a MIME multipart 
++     * Otherwise, the DataSource is assumed to provide a MIME multipart
+      * byte stream.  The <code>parsed</code> flag is set to false.  When
+      * the data for the body parts are needed, the parser extracts the
+      * "boundary" parameter from the content type of this DataSource,
+@@ -151,7 +151,7 @@
+      * skips the 'preamble' and reads bytes till the terminating
+      * boundary and creates MimeBodyParts for each part of the stream.
+      *
+-     * @param	ds	DataSource, can be a MultipartDataSource
++     * @param   ds      DataSource, can be a MultipartDataSource
+      * @param ct
+      *      This must be the same information as {@link DataSource#getContentType()}.
+      *      All the callers of this method seem to have this object handy, so
+@@ -173,19 +173,19 @@
+      * MimeMultipart object created by the client. The default subtype
+      * of such a multipart object is "mixed". <p>
+      *
+-     * @param	subtype		Subtype
++     * @param   subtype         Subtype
+      */
+     public  void setSubType(String subtype) {
+-    	contentType.setSubType(subtype);
++        contentType.setSubType(subtype);
+     }
+ 
+     /**
+      * Return the number of enclosed MimeBodyPart objects.
+      *
+-     * @return		number of parts
++     * @return          number of parts
+      */
+     public  int getCount() throws MessagingException {
+-    	parse();
++        parse();
+         if (parts == null)
+             return 0;
+ 
+@@ -195,13 +195,13 @@
+     /**
+      * Get the specified MimeBodyPart.  BodyParts are numbered starting at 0.
+      *
+-     * @param index	the index of the desired MimeBodyPart
+-     * @return		the MimeBodyPart
++     * @param index     the index of the desired MimeBodyPart
++     * @return          the MimeBodyPart
+      * @exception       MessagingException if no such MimeBodyPart exists
+      */
+     public  MimeBodyPart getBodyPart(int index)
+-			throws MessagingException {
+-    	parse();
++                        throws MessagingException {
++        parse();
+         if (parts == null)
+             throw new IndexOutOfBoundsException("No such BodyPart");
+ 
+@@ -209,24 +209,24 @@
+     }
+ 
+     /**
+-     * Get the MimeBodyPart referred to by the given ContentID (CID). 
++     * Get the MimeBodyPart referred to by the given ContentID (CID).
+      * Returns null if the part is not found.
+      *
+-     * @param  CID 	the ContentID of the desired part
++     * @param  CID      the ContentID of the desired part
+      * @return          the MimeBodyPart
+      */
+     public  MimeBodyPart getBodyPart(String CID)
+-			throws MessagingException {
+-	parse();
++                        throws MessagingException {
++        parse();
+ 
+-	int count = getCount();
+-	for (int i = 0; i < count; i++) {
+-	   MimeBodyPart part = getBodyPart(i);
+-	   String s = part.getContentID();
+-	   if (s != null && s.equals(CID))
+-		return part;    
+-	}
+-	return null;
++        int count = getCount();
++        for (int i = 0; i < count; i++) {
++           MimeBodyPart part = getBodyPart(i);
++           String s = part.getContentID();
++           if (s != null && s.equals(CID))
++                return part;
++        }
++        return null;
+     }
+ 
+     /**
+@@ -241,14 +241,14 @@
+      * method is invoked on the Message object containing this
+      * MimeMultipart. This is typically done as part of the Message
+      * send process, however note that a client is free to call
+-     * it any number of times. So if the header updating process is 
++     * it any number of times. So if the header updating process is
+      * expensive for a specific MimeMultipart subclass, then it
+      * might itself want to track whether its internal state actually
+      * did change, and do the header updating only if necessary.
+      */
+     protected void updateHeaders() throws MessagingException {
+-	for (int i = 0; i < parts.size(); i++)
+-	    ((MimeBodyPart)parts.get(i)).updateHeaders();
++        for (int i = 0; i < parts.size(); i++)
++            ((MimeBodyPart)parts.get(i)).updateHeaders();
+     }
+ 
+     /**
+@@ -279,185 +279,185 @@
+      * method is called by all other methods that need data for
+      * the body parts, to make sure the data has been parsed.
+      *
+-     * @since	JavaMail 1.2
++     * @since   JavaMail 1.2
+      */
+     protected  void parse() throws MessagingException {
+-	if (parsed)
+-	    return;
+-	
+-	InputStream in;
+-	SharedInputStream sin = null;
+-	long start = 0, end = 0;
++        if (parsed)
++            return;
+ 
+-	try {
+-	    in = ds.getInputStream();
+-	    if (!(in instanceof ByteArrayInputStream) &&
+-		!(in instanceof BufferedInputStream) &&
+-		!(in instanceof SharedInputStream))
+-		in = new BufferedInputStream(in);
+-	} catch (Exception ex) {
+-	    throw new MessagingException("No inputstream from datasource");
+-	}
+-	if (in instanceof SharedInputStream)
+-	    sin = (SharedInputStream)in;
++        InputStream in;
++        SharedInputStream sin = null;
++        long start = 0, end = 0;
+ 
++        try {
++            in = ds.getInputStream();
++            if (!(in instanceof ByteArrayInputStream) &&
++                !(in instanceof BufferedInputStream) &&
++                !(in instanceof SharedInputStream))
++                in = new BufferedInputStream(in);
++        } catch (Exception ex) {
++            throw new MessagingException("No inputstream from datasource");
++        }
++        if (in instanceof SharedInputStream)
++            sin = (SharedInputStream)in;
++
+         String boundary = "--" + contentType.getParameter("boundary");
+-	byte[] bndbytes = ASCIIUtility.getBytes(boundary);
+-	int bl = bndbytes.length;
++        byte[] bndbytes = ASCIIUtility.getBytes(boundary);
++        int bl = bndbytes.length;
+ 
+-	try {
+-	    // Skip the preamble
+-	    LineInputStream lin = new LineInputStream(in);
+-	    String line;
+-	    while ((line = lin.readLine()) != null) {
+-		/*
+-		 * Strip trailing whitespace.  Can't use trim method
+-		 * because it's too aggressive.  Some bogus MIME
+-		 * messages will include control characters in the
+-		 * boundary string.
+-		 */
+-		int i;
+-		for (i = line.length() - 1; i >= 0; i--) {
+-		    char c = line.charAt(i);
+-		    if (!(c == ' ' || c == '\t'))
+-			break;
+-		}
+-		line = line.substring(0, i + 1);
+-		if (line.equals(boundary))
+-		    break;
+-	    }
+-	    if (line == null)
+-		throw new MessagingException("Missing start boundary");
+-	    
+-	    /*
+-	     * Read and process body parts until we see the
+-	     * terminating boundary line (or EOF).
+-	     */
+-	    boolean done = false;
+-	getparts:
+-	    while (!done) {
+-		InternetHeaders headers = null;
+-		if (sin != null) {
+-		    start = sin.getPosition();
+-		    // skip headers
+-		    while ((line = lin.readLine()) != null && line.length() > 0)
+-			;
+-		    if (line == null) {
+-			//throw new MessagingException("EOF skipping headers");
+-			// assume there's just a missing end boundary
+-			break getparts;
+-		    }
+-		} else {
+-		    // collect the headers for this body part
+-		    headers = createInternetHeaders(in);
+-		}
++        try {
++            // Skip the preamble
++            LineInputStream lin = new LineInputStream(in);
++            String line;
++            while ((line = lin.readLine()) != null) {
++                /*
++                 * Strip trailing whitespace.  Can't use trim method
++                 * because it's too aggressive.  Some bogus MIME
++                 * messages will include control characters in the
++                 * boundary string.
++                 */
++                int i;
++                for (i = line.length() - 1; i >= 0; i--) {
++                    char c = line.charAt(i);
++                    if (!(c == ' ' || c == '\t'))
++                        break;
++                }
++                line = line.substring(0, i + 1);
++                if (line.equals(boundary))
++                    break;
++            }
++            if (line == null)
++                throw new MessagingException("Missing start boundary");
+ 
+-		if (!in.markSupported())
+-		    throw new MessagingException("Stream doesn't support mark");
++            /*
++             * Read and process body parts until we see the
++             * terminating boundary line (or EOF).
++             */
++            boolean done = false;
++        getparts:
++            while (!done) {
++                InternetHeaders headers = null;
++                if (sin != null) {
++                    start = sin.getPosition();
++                    // skip headers
++                    while ((line = lin.readLine()) != null && line.length() > 0)
++                        ;
++                    if (line == null) {
++                        //throw new MessagingException("EOF skipping headers");
++                        // assume there's just a missing end boundary
++                        break getparts;
++                    }
++                } else {
++                    // collect the headers for this body part
++                    headers = createInternetHeaders(in);
++                }
+ 
+-		ByteOutputStream buf = null;
+-		// if we don't have a shared input stream, we copy the data
+-		if (sin == null)
+-		    buf = new ByteOutputStream();
+-		int b;
+-		boolean bol = true;    // beginning of line flag
+-		// the two possible end of line characters
+-		int eol1 = -1, eol2 = -1;
++                if (!in.markSupported())
++                    throw new MessagingException("Stream doesn't support mark");
+ 
+-		/*
+-		 * Read and save the content bytes in buf.
+-		 */
+-		for (;;) {
+-		    if (bol) {
+-			/*
+-			 * At the beginning of a line, check whether the
+-			 * next line is a boundary.
+-			 */
+-			int i;
+-			in.mark(bl + 4 + 1000); // bnd + "--\r\n" + lots of LWSP
+-			// read bytes, matching against the boundary
+-			for (i = 0; i < bl; i++)
+-			    if (in.read() != bndbytes[i])
+-				break;
+-			if (i == bl) {
+-			    // matched the boundary, check for last boundary
+-			    int b2 = in.read();
+-			    if (b2 == '-') {
+-				if (in.read() == '-') {
+-				    done = true;
+-				    break;	// ignore trailing text
+-				}
+-			    }
+-			    // skip linear whitespace
+-			    while (b2 == ' ' || b2 == '\t')
+-				b2 = in.read();
+-			    // check for end of line
+-			    if (b2 == '\n')
+-				break;	// got it!  break out of the loop
+-			    if (b2 == '\r') {
+-				in.mark(1);
+-				if (in.read() != '\n')
+-				    in.reset();
+-				break;	// got it!  break out of the loop
+-			    }
+-			}
+-			// failed to match, reset and proceed normally
+-			in.reset();
++                ByteOutputStream buf = null;
++                // if we don't have a shared input stream, we copy the data
++                if (sin == null)
++                    buf = new ByteOutputStream();
++                int b;
++                boolean bol = true;    // beginning of line flag
++                // the two possible end of line characters
++                int eol1 = -1, eol2 = -1;
+ 
+-			// if this is not the first line, write out the
+-			// end of line characters from the previous line
+-			if (buf != null && eol1 != -1) {
+-			    buf.write(eol1);
+-			    if (eol2 != -1)
+-				buf.write(eol2);
+-			    eol1 = eol2 = -1;
+-			}
+-		    }
++                /*
++                 * Read and save the content bytes in buf.
++                 */
++                for (;;) {
++                    if (bol) {
++                        /*
++                         * At the beginning of a line, check whether the
++                         * next line is a boundary.
++                         */
++                        int i;
++                        in.mark(bl + 4 + 1000); // bnd + "--\r\n" + lots of LWSP
++                        // read bytes, matching against the boundary
++                        for (i = 0; i < bl; i++)
++                            if (in.read() != bndbytes[i])
++                                break;
++                        if (i == bl) {
++                            // matched the boundary, check for last boundary
++                            int b2 = in.read();
++                            if (b2 == '-') {
++                                if (in.read() == '-') {
++                                    done = true;
++                                    break;      // ignore trailing text
++                                }
++                            }
++                            // skip linear whitespace
++                            while (b2 == ' ' || b2 == '\t')
++                                b2 = in.read();
++                            // check for end of line
++                            if (b2 == '\n')
++                                break;  // got it!  break out of the loop
++                            if (b2 == '\r') {
++                                in.mark(1);
++                                if (in.read() != '\n')
++                                    in.reset();
++                                break;  // got it!  break out of the loop
++                            }
++                        }
++                        // failed to match, reset and proceed normally
++                        in.reset();
+ 
+-		    // read the next byte
+-		    if ((b = in.read()) < 0) {
+-			done = true;
+-			break;
+-		    }
++                        // if this is not the first line, write out the
++                        // end of line characters from the previous line
++                        if (buf != null && eol1 != -1) {
++                            buf.write(eol1);
++                            if (eol2 != -1)
++                                buf.write(eol2);
++                            eol1 = eol2 = -1;
++                        }
++                    }
+ 
+-		    /*
+-		     * If we're at the end of the line, save the eol characters
+-		     * to be written out before the beginning of the next line.
+-		     */
+-		    if (b == '\r' || b == '\n') {
+-			bol = true;
+-			if (sin != null)
+-			    end = sin.getPosition() - 1;
+-			eol1 = b;
+-			if (b == '\r') {
+-			    in.mark(1);
+-			    if ((b = in.read()) == '\n')
+-				eol2 = b;
+-			    else
+-				in.reset();
+-			}
+-		    } else {
+-			bol = false;
+-			if (buf != null)
+-			    buf.write(b);
+-		    }
+-		}
++                    // read the next byte
++                    if ((b = in.read()) < 0) {
++                        done = true;
++                        break;
++                    }
+ 
+-		/*
+-		 * Create a MimeBody element to represent this body part.
+-		 */
+-		MimeBodyPart part;
+-		if (sin != null)
+-		    part = createMimeBodyPart(sin.newStream(start, end));
+-		else
+-		    part = createMimeBodyPart(headers, buf.getBytes(), buf.getCount());
+-		addBodyPart(part);
+-	    }
+-	} catch (IOException ioex) {
+-	    throw new MessagingException("IO Error", ioex);
+-	}
++                    /*
++                     * If we're at the end of the line, save the eol characters
++                     * to be written out before the beginning of the next line.
++                     */
++                    if (b == '\r' || b == '\n') {
++                        bol = true;
++                        if (sin != null)
++                            end = sin.getPosition() - 1;
++                        eol1 = b;
++                        if (b == '\r') {
++                            in.mark(1);
++                            if ((b = in.read()) == '\n')
++                                eol2 = b;
++                            else
++                                in.reset();
++                        }
++                    } else {
++                        bol = false;
++                        if (buf != null)
++                            buf.write(b);
++                    }
++                }
+ 
+-	parsed = true;
++                /*
++                 * Create a MimeBody element to represent this body part.
++                 */
++                MimeBodyPart part;
++                if (sin != null)
++                    part = createMimeBodyPart(sin.newStream(start, end));
++                else
++                    part = createMimeBodyPart(headers, buf.getBytes(), buf.getCount());
++                addBodyPart(part);
++            }
++        } catch (IOException ioex) {
++            throw new MessagingException("IO Error", ioex);
++        }
++
++        parsed = true;
+     }
+ 
+     /**
+@@ -467,13 +467,13 @@
+      * necessary.  This implementation simply constructs and returns
+      * an InternetHeaders object.
+      *
+-     * @param	is	the InputStream to read the headers from
+-     * @exception  	MessagingException
+-     * @since		JavaMail 1.2
++     * @param   is      the InputStream to read the headers from
++     * @exception       MessagingException
++     * @since           JavaMail 1.2
+      */
+     protected InternetHeaders createInternetHeaders(InputStream is)
+-				throws MessagingException {
+-	return new InternetHeaders(is);
++                                throws MessagingException {
++        return new InternetHeaders(is);
+     }
+ 
+     /**
+@@ -483,12 +483,12 @@
+      * necessary.  This implementation simply constructs and returns
+      * a MimeBodyPart object.
+      *
+-     * @param	headers		the headers for the body part
+-     * @param	content		the content of the body part
+-     * @since			JavaMail 1.2
++     * @param   headers         the headers for the body part
++     * @param   content         the content of the body part
++     * @since                   JavaMail 1.2
+      */
+     protected MimeBodyPart createMimeBodyPart(InternetHeaders headers, byte[] content, int len) {
+-	    return new MimeBodyPart(headers, content,len);
++            return new MimeBodyPart(headers, content,len);
+     }
+ 
+     /**
+@@ -498,12 +498,12 @@
+      * necessary.  This implementation simply constructs and returns
+      * a MimeBodyPart object.
+      *
+-     * @param	is		InputStream containing the body part
+-     * @exception  		MessagingException
+-     * @since			JavaMail 1.2
++     * @param   is              InputStream containing the body part
++     * @exception               MessagingException
++     * @since                   JavaMail 1.2
+      */
+     protected MimeBodyPart createMimeBodyPart(InputStream is) throws MessagingException {
+-	    return new MimeBodyPart(is);
++            return new MimeBodyPart(is);
+     }
+ 
+     /**
+@@ -519,16 +519,16 @@
+      * needs to create an appropriate MimeMultipart subclass that represents
+      * a specific multipart subtype.
+      *
+-     * @param	mp	MimeMultipart datasource
++     * @param   mp      MimeMultipart datasource
+      */
+ 
+     protected void setMultipartDataSource(MultipartDataSource mp)
+-			throws MessagingException {
+-	contentType = new ContentType(mp.getContentType());
++                        throws MessagingException {
++        contentType = new ContentType(mp.getContentType());
+ 
+-	int count = mp.getCount();
+-	for (int i = 0; i < count; i++)
+-	    addBodyPart(mp.getBodyPart(i));
++        int count = mp.getCount();
++        for (int i = 0; i < count; i++)
++            addBodyPart(mp.getBodyPart(i));
+     }
+ 
+     /**
+@@ -537,11 +537,11 @@
+      * This implementation just returns the value of the
+      * <code>contentType</code> field.
+      *
+-     * @return 	content-type
+-     * @see	#contentType
++     * @return  content-type
++     * @see     #contentType
+      */
+     public ContentType getContentType() {
+-	    return contentType;
++            return contentType;
+     }
+ 
+     /**
+@@ -548,17 +548,17 @@
+      * Remove the specified part from the multipart message.
+      * Shifts all the parts after the removed part down one.
+      *
+-     * @param   part	The part to remove
+-     * @return		true if part removed, false otherwise
+-     * @exception	MessagingException if no such MimeBodyPart exists
++     * @param   part    The part to remove
++     * @return          true if part removed, false otherwise
++     * @exception       MessagingException if no such MimeBodyPart exists
+      */
+     public boolean removeBodyPart(MimeBodyPart part) throws MessagingException {
+-	if (parts == null)
+-	    throw new MessagingException("No such body part");
++        if (parts == null)
++            throw new MessagingException("No such body part");
+ 
+-	boolean ret = parts.remove(part);
+-	part.setParent(null);
+-	return ret;
++        boolean ret = parts.remove(part);
++        part.setParent(null);
++        return ret;
+     }
+ 
+     /**
+@@ -565,17 +565,17 @@
+      * Remove the part at specified location (starting from 0).
+      * Shifts all the parts after the removed part down one.
+      *
+-     * @param   index	Index of the part to remove
++     * @param   index   Index of the part to remove
+      * @exception       IndexOutOfBoundsException if the given index
+-     *			is out of range.
++     *                  is out of range.
+      */
+     public void removeBodyPart(int index) {
+-	if (parts == null)
+-	    throw new IndexOutOfBoundsException("No such BodyPart");
++        if (parts == null)
++            throw new IndexOutOfBoundsException("No such BodyPart");
+ 
+-	MimeBodyPart part = (MimeBodyPart)parts.get(index);
+-	parts.remove(index);
+-	part.setParent(null);
++        MimeBodyPart part = (MimeBodyPart)parts.get(index);
++        parts.remove(index);
++        part.setParent(null);
+     }
+ 
+     /**
+@@ -585,11 +585,11 @@
+      * @param  part  The MimeBodyPart to be appended
+      */
+     public synchronized void addBodyPart(MimeBodyPart part) {
+-	if (parts == null)
+-	    parts = new FinalArrayList();
++        if (parts == null)
++            parts = new FinalArrayList();
+ 
+-	parts.add(part);
+-	part.setParent(this);
++        parts.add(part);
++        part.setParent(this);
+     }
+ 
+     /**
+@@ -603,20 +603,20 @@
+      * @param  index Location where to insert the part
+      */
+     public synchronized void addBodyPart(MimeBodyPart part, int index) {
+-	if (parts == null)
+-	    parts = new FinalArrayList();
++        if (parts == null)
++            parts = new FinalArrayList();
+ 
+-	parts.add(index,part);
+-	part.setParent(this);
++        parts.add(index,part);
++        part.setParent(this);
+     }
+ 
+     /**
+      * Return the <code>MimeBodyPart</code> that contains this <code>MimeMultipart</code>
+      * object, or <code>null</code> if not known.
+-     * @since	JavaMail 1.1
++     * @since   JavaMail 1.1
+      */
+     MimeBodyPart getParent() {
+-	return parent;
++        return parent;
+     }
+ 
+     /**
+@@ -626,9 +626,9 @@
+      * <code>parent</code> may be <code>null</code> if the
+      * <code>MimeMultipart</code> is being removed from its containing
+      * <code>MimeBodyPart</code>.
+-     * @since	JavaMail 1.1
++     * @since   JavaMail 1.1
+      */
+     void setParent(MimeBodyPart parent) {
+-	this.parent = parent;
++        this.parent = parent;
+     }
+ }
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimePartDataSource.java	Thu Jul 30 18:06:30 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimePartDataSource.java	Thu Jul 30 18:06:29 2009
+@@ -41,7 +41,7 @@
+  * A utility class that implements a DataSource out of
+  * a MimeBodyPart. This class is primarily meant for service providers.
+  *
+- * @author 	John Mani
++ * @author      John Mani
+  */
+ 
+ public final class MimePartDataSource implements DataSource {
+@@ -51,7 +51,7 @@
+      * Constructor, that constructs a DataSource from a MimeBodyPart.
+      */
+     public MimePartDataSource(MimeBodyPart part) {
+-	this.part = part;
++        this.part = part;
+     }
+ 
+     /**
+@@ -65,21 +65,21 @@
+      * using the <code>getContentStream()</code> method and decodes
+      * it using the <code>MimeUtility.decode()</code> method.
+      *
+-     * @return 	decoded input stream
++     * @return  decoded input stream
+      */
+     public InputStream getInputStream() throws IOException {
+ 
+-	try {
++        try {
+         InputStream is = part.getContentStream();
+ 
+-	    String encoding = part.getEncoding();
+-	    if (encoding != null)
+-		return MimeUtility.decode(is, encoding);
+-	    else
+-		return is;
+-	} catch (MessagingException mex) {
+-	    throw new IOException(mex.getMessage());
+-	}
++            String encoding = part.getEncoding();
++            if (encoding != null)
++                return MimeUtility.decode(is, encoding);
++            else
++                return is;
++        } catch (MessagingException mex) {
++            throw new IOException(mex.getMessage());
++        }
+     }
+ 
+     /**
+@@ -88,7 +88,7 @@
+      * This implementation throws the UnknownServiceException.
+      */
+     public OutputStream getOutputStream() throws IOException {
+-	throw new UnknownServiceException();
++        throw new UnknownServiceException();
+     }
+ 
+     /**
+@@ -107,10 +107,10 @@
+      * This implementation just returns an empty string.
+      */
+     public String getName() {
+-	try {
+-		return part.getFileName();
+-	} catch (MessagingException mex) {
++        try {
++                return part.getFileName();
++        } catch (MessagingException mex) {
+         return "";
+-	}
++        }
+     }
+ }
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimeUtility.java	Thu Jul 30 18:06:33 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimeUtility.java	Thu Jul 30 18:06:33 2009
+@@ -43,7 +43,7 @@
+  * This is a utility class that provides various MIME related
+  * functionality. <p>
+  *
+- * There are a set of methods to encode and decode MIME headers as 
++ * There are a set of methods to encode and decode MIME headers as
+  * per RFC 2047. A brief description on handling such headers is
+  * given below: <p>
+  *
+@@ -62,18 +62,18 @@
+  * the String into another charset and then do the transfer-encoding.
+  * <p>
+  * Note that to get the actual bytes of a mail-safe String (say,
+- * for sending over SMTP), one must do 
++ * for sending over SMTP), one must do
+  * <p><blockquote><pre>
+  *
+- *	byte[] bytes = string.getBytes("iso-8859-1");	
++ *      byte[] bytes = string.getBytes("iso-8859-1");
+  *
+  * </pre></blockquote><p>
+- * 
++ *
+  * The <code>setHeader</code> and <code>addHeader</code> methods
+  * on MimeMessage and MimeBodyPart assume that the given header values
+  * are Unicode strings that contain only US-ASCII characters. Hence
+  * the callers of those methods must insure that the values they pass
+- * do not contain non US-ASCII characters. The methods in this class 
++ * do not contain non US-ASCII characters. The methods in this class
+  * help do this. <p>
+  *
+  * The <code>getHeader</code> family of methods on MimeMessage and
+@@ -132,25 +132,25 @@
+     private static boolean foldText = true;
+ 
+     static {
+-	try {
+-	    String s = System.getProperty("mail.mime.decodetext.strict");
+-	    // default to true
+-	    decodeStrict = s == null || !s.equalsIgnoreCase("false");
+-	    s = System.getProperty("mail.mime.encodeeol.strict");
+-	    // default to false
+-	    encodeEolStrict = s != null && s.equalsIgnoreCase("true");
+-	    s = System.getProperty("mail.mime.foldencodedwords");
+-	    // default to false
+-	    foldEncodedWords = s != null && s.equalsIgnoreCase("true");
+-	    s = System.getProperty("mail.mime.foldtext");
+-	    // default to true
+-	    foldText = s == null || !s.equalsIgnoreCase("false");
+-	} catch (SecurityException sex) {
+-	    // ignore it
+-	}
++        try {
++            String s = System.getProperty("mail.mime.decodetext.strict");
++            // default to true
++            decodeStrict = s == null || !s.equalsIgnoreCase("false");
++            s = System.getProperty("mail.mime.encodeeol.strict");
++            // default to false
++            encodeEolStrict = s != null && s.equalsIgnoreCase("true");
++            s = System.getProperty("mail.mime.foldencodedwords");
++            // default to false
++            foldEncodedWords = s != null && s.equalsIgnoreCase("true");
++            s = System.getProperty("mail.mime.foldtext");
++            // default to true
++            foldText = s == null || !s.equalsIgnoreCase("false");
++        } catch (SecurityException sex) {
++            // ignore it
++        }
+     }
+-		
+ 
++
+     /**
+      * Get the content-transfer-encoding that should be applied
+      * to the input stream of this datasource, to make it mailsafe. <p>
+@@ -170,43 +170,43 @@
+      * encoding is "base64".
+      * </ul>
+      *
+-     * @param	ds	DataSource
+-     * @return		the encoding. This is either "7bit",
+-     *			"quoted-printable" or "base64"
+-     */ 
++     * @param   ds      DataSource
++     * @return          the encoding. This is either "7bit",
++     *                  "quoted-printable" or "base64"
++     */
+     public static String getEncoding(DataSource ds) {
+-	ContentType cType = null;
+-	InputStream is = null;
+-	String encoding = null;
++        ContentType cType = null;
++        InputStream is = null;
++        String encoding = null;
+ 
+-	try {
+-	    cType = new ContentType(ds.getContentType());
+-	    is = ds.getInputStream();
+-	} catch (Exception ex) {
+-	    return "base64"; // what else ?!
+-	}
++        try {
++            cType = new ContentType(ds.getContentType());
++            is = ds.getInputStream();
++        } catch (Exception ex) {
++            return "base64"; // what else ?!
++        }
+ 
+-	boolean isText = cType.match("text/*");
+-	// if not text, stop processing when we see non-ASCII
+-	int i = checkAscii(is, ALL, !isText);
+-	switch (i) {
+-	case ALL_ASCII:
+-	    encoding = "7bit"; // all ascii
+-	    break;
+-	case MOSTLY_ASCII:
+-	    encoding = "quoted-printable"; // mostly ascii
+-	    break;
+-	default:
+-	    encoding = "base64"; // mostly binary
+-	    break;
+-	}
++        boolean isText = cType.match("text/*");
++        // if not text, stop processing when we see non-ASCII
++        int i = checkAscii(is, ALL, !isText);
++        switch (i) {
++        case ALL_ASCII:
++            encoding = "7bit"; // all ascii
++            break;
++        case MOSTLY_ASCII:
++            encoding = "quoted-printable"; // mostly ascii
++            break;
++        default:
++            encoding = "base64"; // mostly binary
++            break;
++        }
+ 
+-	// Close the input stream
+-	try {
+-	    is.close();
+-	} catch (IOException ioex) { }
++        // Close the input stream
++        try {
++            is.close();
++        } catch (IOException ioex) { }
+ 
+-	return encoding;
++        return encoding;
+     }
+ 
+     /**
+@@ -220,66 +220,66 @@
+      * <code>DataHandler</code> uses a thread, a pair of pipe streams,
+      * and the <code>writeTo</code> method to produce the data. <p>
+      *
+-     * @since	JavaMail 1.2
++     * @since   JavaMail 1.2
+      */
+     public static String getEncoding(DataHandler dh) {
+-	ContentType cType = null;
+-	String encoding = null;
++        ContentType cType = null;
++        String encoding = null;
+ 
+-	/*
+-	 * Try to pick the most efficient means of determining the
+-	 * encoding.  If this DataHandler was created using a DataSource,
+-	 * the getEncoding(DataSource) method is typically faster.  If
+-	 * the DataHandler was created with an object, this method is
+-	 * much faster.  To distinguish the two cases, we use a heuristic.
+-	 * A DataHandler created with an object will always have a null name.
+-	 * A DataHandler created with a DataSource will usually have a
+-	 * non-null name.
+-	 *
+-	 * XXX - This is actually quite a disgusting hack, but it makes
+-	 *	 a common case run over twice as fast.
+-	 */
+-	if (dh.getName() != null)
+-	    return getEncoding(dh.getDataSource());
++        /*
++         * Try to pick the most efficient means of determining the
++         * encoding.  If this DataHandler was created using a DataSource,
++         * the getEncoding(DataSource) method is typically faster.  If
++         * the DataHandler was created with an object, this method is
++         * much faster.  To distinguish the two cases, we use a heuristic.
++         * A DataHandler created with an object will always have a null name.
++         * A DataHandler created with a DataSource will usually have a
++         * non-null name.
++         *
++         * XXX - This is actually quite a disgusting hack, but it makes
++         *       a common case run over twice as fast.
++         */
++        if (dh.getName() != null)
++            return getEncoding(dh.getDataSource());
+ 
+-	try {
+-	    cType = new ContentType(dh.getContentType());
+-	} catch (Exception ex) {
+-	    return "base64"; // what else ?!
+-	}
++        try {
++            cType = new ContentType(dh.getContentType());
++        } catch (Exception ex) {
++            return "base64"; // what else ?!
++        }
+ 
+-	if (cType.match("text/*")) {
+-	    // Check all of the available bytes
+-	    AsciiOutputStream aos = new AsciiOutputStream(false, false);
+-	    try {
+-		dh.writeTo(aos);
+-	    } catch (IOException ex) { }	// ignore it
+-	    switch (aos.getAscii()) {
+-	    case ALL_ASCII:
+-		encoding = "7bit"; // all ascii
+-		break;
+-	    case MOSTLY_ASCII:
+-		encoding = "quoted-printable"; // mostly ascii
+-		break;
+-	    default:
+-		encoding = "base64"; // mostly binary
+-		break;
+-	    }
+-	} else { // not "text"
+-	    // Check all of available bytes, break out if we find
+-	    // at least one non-US-ASCII character
+-	    AsciiOutputStream aos =
+-			new AsciiOutputStream(true, encodeEolStrict);
+-	    try {
+-		dh.writeTo(aos);
+-	    } catch (IOException ex) { }	// ignore it
+-	    if (aos.getAscii() == ALL_ASCII) // all ascii
+-		encoding = "7bit";
+-	    else // found atleast one non-ascii character, use b64 
+-		encoding = "base64";
+-	}
++        if (cType.match("text/*")) {
++            // Check all of the available bytes
++            AsciiOutputStream aos = new AsciiOutputStream(false, false);
++            try {
++                dh.writeTo(aos);
++            } catch (IOException ex) { }        // ignore it
++            switch (aos.getAscii()) {
++            case ALL_ASCII:
++                encoding = "7bit"; // all ascii
++                break;
++            case MOSTLY_ASCII:
++                encoding = "quoted-printable"; // mostly ascii
++                break;
++            default:
++                encoding = "base64"; // mostly binary
++                break;
++            }
++        } else { // not "text"
++            // Check all of available bytes, break out if we find
++            // at least one non-US-ASCII character
++            AsciiOutputStream aos =
++                        new AsciiOutputStream(true, encodeEolStrict);
++            try {
++                dh.writeTo(aos);
++            } catch (IOException ex) { }        // ignore it
++            if (aos.getAscii() == ALL_ASCII) // all ascii
++                encoding = "7bit";
++            else // found atleast one non-ascii character, use b64
++                encoding = "base64";
++        }
+ 
+-	return encoding;
++        return encoding;
+     }
+ 
+     /**
+@@ -289,57 +289,57 @@
+      * "7bit", "8bit", and "binary". In addition, "uuencode" is also
+      * supported.
+      *
+-     * @param	is		input stream
+-     * @param	encoding	the encoding of the stream.
+-     * @return			decoded input stream.
++     * @param   is              input stream
++     * @param   encoding        the encoding of the stream.
++     * @return                  decoded input stream.
+      */
+     public static InputStream decode(InputStream is, String encoding)
+-		throws MessagingException {
+-	if (encoding.equalsIgnoreCase("base64"))
+-	    return new BASE64DecoderStream(is);
+-	else if (encoding.equalsIgnoreCase("quoted-printable"))
+-	    return new QPDecoderStream(is);
+-	else if (encoding.equalsIgnoreCase("uuencode") ||
+-		 encoding.equalsIgnoreCase("x-uuencode") ||
+-		 encoding.equalsIgnoreCase("x-uue"))
+-	    return new UUDecoderStream(is);
+-	else if (encoding.equalsIgnoreCase("binary") ||
+-		 encoding.equalsIgnoreCase("7bit") ||
+-		 encoding.equalsIgnoreCase("8bit"))
+-	    return is;
+-	else
+-	    throw new MessagingException("Unknown encoding: " + encoding);
++                throws MessagingException {
++        if (encoding.equalsIgnoreCase("base64"))
++            return new BASE64DecoderStream(is);
++        else if (encoding.equalsIgnoreCase("quoted-printable"))
++            return new QPDecoderStream(is);
++        else if (encoding.equalsIgnoreCase("uuencode") ||
++                 encoding.equalsIgnoreCase("x-uuencode") ||
++                 encoding.equalsIgnoreCase("x-uue"))
++            return new UUDecoderStream(is);
++        else if (encoding.equalsIgnoreCase("binary") ||
++                 encoding.equalsIgnoreCase("7bit") ||
++                 encoding.equalsIgnoreCase("8bit"))
++            return is;
++        else
++            throw new MessagingException("Unknown encoding: " + encoding);
+     }
+ 
+     /**
+-     * Wrap an encoder around the given output stream. 
+-     * All the encodings defined in RFC 2045 are supported here. 
++     * Wrap an encoder around the given output stream.
++     * All the encodings defined in RFC 2045 are supported here.
+      * They include "base64", "quoted-printable", "7bit", "8bit" and
+      * "binary". In addition, "uuencode" is also supported.
+      *
+-     * @param	os		output stream
+-     * @param	encoding	the encoding of the stream. 
+-     * @return			output stream that applies the
+-     *				specified encoding.
++     * @param   os              output stream
++     * @param   encoding        the encoding of the stream.
++     * @return                  output stream that applies the
++     *                          specified encoding.
+      */
+     public static OutputStream encode(OutputStream os, String encoding)
+-		throws MessagingException {
++                throws MessagingException {
+         if (encoding == null)
+-	    return os;
+-	else if (encoding.equalsIgnoreCase("base64"))
+-	    return new BASE64EncoderStream(os);
+-	else if (encoding.equalsIgnoreCase("quoted-printable"))
+-	    return new QPEncoderStream(os);
+-	else if (encoding.equalsIgnoreCase("uuencode") ||
+-		 encoding.equalsIgnoreCase("x-uuencode") ||
+-		 encoding.equalsIgnoreCase("x-uue"))
+-	    return new UUEncoderStream(os);
+-	else if (encoding.equalsIgnoreCase("binary") ||
+-		 encoding.equalsIgnoreCase("7bit") ||
+-		 encoding.equalsIgnoreCase("8bit"))
+-	    return os;
+-	else
+-	    throw new MessagingException("Unknown encoding: " +encoding);
++            return os;
++        else if (encoding.equalsIgnoreCase("base64"))
++            return new BASE64EncoderStream(os);
++        else if (encoding.equalsIgnoreCase("quoted-printable"))
++            return new QPEncoderStream(os);
++        else if (encoding.equalsIgnoreCase("uuencode") ||
++                 encoding.equalsIgnoreCase("x-uuencode") ||
++                 encoding.equalsIgnoreCase("x-uue"))
++            return new UUEncoderStream(os);
++        else if (encoding.equalsIgnoreCase("binary") ||
++                 encoding.equalsIgnoreCase("7bit") ||
++                 encoding.equalsIgnoreCase("8bit"))
++            return os;
++        else
++            throw new MessagingException("Unknown encoding: " +encoding);
+     }
+ 
+     /**
+@@ -387,11 +387,11 @@
+      * characters. If the string contains only US-ASCII characters,
+      * it is returned as-is.  If the string contains non US-ASCII
+      * characters, it is first character-encoded using the platform's
+-     * default charset, then transfer-encoded using either the B or 
+-     * Q encoding. The resulting bytes are then returned as a Unicode 
++     * default charset, then transfer-encoded using either the B or
++     * Q encoding. The resulting bytes are then returned as a Unicode
+      * string containing only ASCII  characters. <p>
+      *
+-     * Note that this method should be used to encode only 
++     * Note that this method should be used to encode only
+      * "unstructured" RFC 822 headers. <p>
+      *
+      * Example of usage:
+@@ -400,7 +400,7 @@
+      *  MimeBodyPart part = ...
+      *  String rawvalue = "FooBar Mailer, Japanese version 1.1"
+      *  try {
+-     *    // If we know for sure that rawvalue contains only US-ASCII 
++     *    // If we know for sure that rawvalue contains only US-ASCII
+      *    // characters, we can skip the encoding part
+      *    part.setHeader("X-mailer", MimeUtility.encodeText(rawvalue));
+      *  } catch (UnsupportedEncodingException e) {
+@@ -410,14 +410,14 @@
+      *  }
+      *
+      * </pre></blockquote><p>
+-     * 
+-     * @param	text	unicode string
+-     * @return	Unicode string containing only US-ASCII characters
++     *
++     * @param   text    unicode string
++     * @return  Unicode string containing only US-ASCII characters
+      * @exception UnsupportedEncodingException if the encoding fails
+      */
+     public static String encodeText(String text)
+-			throws UnsupportedEncodingException {
+-	return encodeText(text, null, null);
++                        throws UnsupportedEncodingException {
++        return encodeText(text, null, null);
+     }
+ 
+     /**
+@@ -429,26 +429,26 @@
+      * it is returned as-is.  If the string contains non US-ASCII
+      * characters, it is first character-encoded using the specified
+      * charset, then transfer-encoded using either the B or Q encoding.
+-     * The resulting bytes are then returned as a Unicode string 
++     * The resulting bytes are then returned as a Unicode string
+      * containing only ASCII characters. <p>
+      *
+-     * Note that this method should be used to encode only 
+-     * "unstructured" RFC 822 headers. 
+-     * 
+-     * @param	text	the header value
+-     * @param	charset	the charset. If this parameter is null, the
+-     *		platform's default chatset is used.
+-     * @param	encoding the encoding to be used. Currently supported
+-     *		values are "B" and "Q". If this parameter is null, then
+-     *		the "Q" encoding is used if most of characters to be
+-     *		encoded are in the ASCII charset, otherwise "B" encoding
+-     *		is used.
+-     * @return	Unicode string containing only US-ASCII characters
++     * Note that this method should be used to encode only
++     * "unstructured" RFC 822 headers.
++     *
++     * @param   text    the header value
++     * @param   charset the charset. If this parameter is null, the
++     *          platform's default chatset is used.
++     * @param   encoding the encoding to be used. Currently supported
++     *          values are "B" and "Q". If this parameter is null, then
++     *          the "Q" encoding is used if most of characters to be
++     *          encoded are in the ASCII charset, otherwise "B" encoding
++     *          is used.
++     * @return  Unicode string containing only US-ASCII characters
+      */
+     public static String encodeText(String text, String charset,
+-				    String encoding)
+-			throws UnsupportedEncodingException {
+-	return encodeWord(text, charset, encoding, false);
++                                    String encoding)
++                        throws UnsupportedEncodingException {
++        return encodeWord(text, charset, encoding, false);
+     }
+ 
+     /**
+@@ -479,75 +479,75 @@
+      *
+      * </pre></blockquote><p>
+      *
+-     * @param	etext	the possibly encoded value
++     * @param   etext   the possibly encoded value
+      * @exception       UnsupportedEncodingException if the charset
+-     *			conversion failed.
++     *                  conversion failed.
+      */
+     public static String decodeText(String etext)
+-		throws UnsupportedEncodingException {
+-	/*
+-	 * We look for sequences separated by "linear-white-space".
+-	 * (as per RFC 2047, Section 6.1.1)
+-	 * RFC 822 defines "linear-white-space" as SPACE | HT | CR | NL.
+-	 */
+-	String lwsp = " \t\n\r";
+-	StringTokenizer st;
++                throws UnsupportedEncodingException {
++        /*
++         * We look for sequences separated by "linear-white-space".
++         * (as per RFC 2047, Section 6.1.1)
++         * RFC 822 defines "linear-white-space" as SPACE | HT | CR | NL.
++         */
++        String lwsp = " \t\n\r";
++        StringTokenizer st;
+ 
+-	/*
+-	 * First, lets do a quick run thru the string and check
+-	 * whether the sequence "=?"  exists at all. If none exists,
+-	 * we know there are no encoded-words in here and we can just
+-	 * return the string as-is, without suffering thru the later 
+-	 * decoding logic. 
+-	 * This handles the most common case of unencoded headers 
+-	 * efficiently.
+-	 */
+-	if (etext.indexOf("=?") == -1)
+-	    return etext;
++        /*
++         * First, lets do a quick run thru the string and check
++         * whether the sequence "=?"  exists at all. If none exists,
++         * we know there are no encoded-words in here and we can just
++         * return the string as-is, without suffering thru the later
++         * decoding logic.
++         * This handles the most common case of unencoded headers
++         * efficiently.
++         */
++        if (etext.indexOf("=?") == -1)
++            return etext;
+ 
+-	// Encoded words found. Start decoding ...
++        // Encoded words found. Start decoding ...
+ 
+-	st = new StringTokenizer(etext, lwsp, true);
+-	StringBuffer sb = new StringBuffer();  // decode buffer
+-	StringBuffer wsb = new StringBuffer(); // white space buffer
+-	boolean prevWasEncoded = false;
++        st = new StringTokenizer(etext, lwsp, true);
++        StringBuffer sb = new StringBuffer();  // decode buffer
++        StringBuffer wsb = new StringBuffer(); // white space buffer
++        boolean prevWasEncoded = false;
+ 
+-	while (st.hasMoreTokens()) {
+-	    char c;
+-	    String s = st.nextToken();
+-	    // If whitespace, append it to the whitespace buffer
+-	    if (((c = s.charAt(0)) == ' ') || (c == '\t') ||
+-		(c == '\r') || (c == '\n'))
+-		wsb.append(c);
+-	    else {
+-		// Check if token is an 'encoded-word' ..
+-		String word;
+-		try {
+-		    word = decodeWord(s);
+-		    // Yes, this IS an 'encoded-word'.
+-		    if (!prevWasEncoded && wsb.length() > 0) {
+-			// if the previous word was also encoded, we
+-			// should ignore the collected whitespace. Else
+-			// we include the whitespace as well.
+-			sb.append(wsb);
+-		    }
+-		    prevWasEncoded = true;
+-		} catch (ParseException pex) {
+-		    // This is NOT an 'encoded-word'.
+-		    word = s;
+-		    // possibly decode inner encoded words
+-		    if (!decodeStrict)
+-			word = decodeInnerWords(word);
+-		    // include colleced whitespace ..
+-		    if (wsb.length() > 0)
+-			sb.append(wsb);
+-		    prevWasEncoded = false;
+-		}
+-		sb.append(word); // append the actual word
+-		wsb.setLength(0); // reset wsb for reuse
+-	    }
+-	}
+-	return sb.toString();
++        while (st.hasMoreTokens()) {
++            char c;
++            String s = st.nextToken();
++            // If whitespace, append it to the whitespace buffer
++            if (((c = s.charAt(0)) == ' ') || (c == '\t') ||
++                (c == '\r') || (c == '\n'))
++                wsb.append(c);
++            else {
++                // Check if token is an 'encoded-word' ..
++                String word;
++                try {
++                    word = decodeWord(s);
++                    // Yes, this IS an 'encoded-word'.
++                    if (!prevWasEncoded && wsb.length() > 0) {
++                        // if the previous word was also encoded, we
++                        // should ignore the collected whitespace. Else
++                        // we include the whitespace as well.
++                        sb.append(wsb);
++                    }
++                    prevWasEncoded = true;
++                } catch (ParseException pex) {
++                    // This is NOT an 'encoded-word'.
++                    word = s;
++                    // possibly decode inner encoded words
++                    if (!decodeStrict)
++                        word = decodeInnerWords(word);
++                    // include colleced whitespace ..
++                    if (wsb.length() > 0)
++                        sb.append(wsb);
++                    prevWasEncoded = false;
++                }
++                sb.append(word); // append the actual word
++                wsb.setLength(0); // reset wsb for reuse
++            }
++        }
++        return sb.toString();
+     }
+ 
+     /**
+@@ -558,22 +558,22 @@
+      * characters. If the string contains only US-ASCII characters,
+      * it is returned as-is.  If the string contains non US-ASCII
+      * characters, it is first character-encoded using the platform's
+-     * default charset, then transfer-encoded using either the B or 
+-     * Q encoding. The resulting bytes are then returned as a Unicode 
++     * default charset, then transfer-encoded using either the B or
++     * Q encoding. The resulting bytes are then returned as a Unicode
+      * string containing only ASCII  characters. <p>
+-     * 
++     *
+      * This method is meant to be used when creating RFC 822 "phrases".
+      * The InternetAddress class, for example, uses this to encode
+      * it's 'phrase' component.
+      *
+-     * @param	text	unicode string
+-     * @return	Array of Unicode strings containing only US-ASCII 
+-     *		characters.
++     * @param   text    unicode string
++     * @return  Array of Unicode strings containing only US-ASCII
++     *          characters.
+      * @exception UnsupportedEncodingException if the encoding fails
+      */
+-    public static String encodeWord(String word) 
+-			throws UnsupportedEncodingException {
+-	return encodeWord(word, null, null);
++    public static String encodeWord(String word)
++                        throws UnsupportedEncodingException {
++        return encodeWord(word, null, null);
+     }
+ 
+     /**
+@@ -585,221 +585,221 @@
+      * it is returned as-is.  If the string contains non US-ASCII
+      * characters, it is first character-encoded using the specified
+      * charset, then transfer-encoded using either the B or Q encoding.
+-     * The resulting bytes are then returned as a Unicode string 
++     * The resulting bytes are then returned as a Unicode string
+      * containing only ASCII characters. <p>
+-     * 
+-     * @param	text	unicode string
+-     * @param	charset	the MIME charset
+-     * @param	encoding the encoding to be used. Currently supported
+-     *		values are "B" and "Q". If this parameter is null, then
+-     *		the "Q" encoding is used if most of characters to be
+-     *		encoded are in the ASCII charset, otherwise "B" encoding
+-     *		is used.
+-     * @return	Unicode string containing only US-ASCII characters
++     *
++     * @param   text    unicode string
++     * @param   charset the MIME charset
++     * @param   encoding the encoding to be used. Currently supported
++     *          values are "B" and "Q". If this parameter is null, then
++     *          the "Q" encoding is used if most of characters to be
++     *          encoded are in the ASCII charset, otherwise "B" encoding
++     *          is used.
++     * @return  Unicode string containing only US-ASCII characters
+      * @exception UnsupportedEncodingException if the encoding fails
+      */
+-    public static String encodeWord(String word, String charset, 
+-				    String encoding)
+-    			throws UnsupportedEncodingException {
+-	return encodeWord(word, charset, encoding, true);
++    public static String encodeWord(String word, String charset,
++                                    String encoding)
++                        throws UnsupportedEncodingException {
++        return encodeWord(word, charset, encoding, true);
+     }
+ 
+     /*
+      * Encode the given string. The parameter 'encodingWord' should
+      * be true if a RFC 822 "word" token is being encoded and false if a
+-     * RFC 822 "text" token is being encoded. This is because the 
++     * RFC 822 "text" token is being encoded. This is because the
+      * "Q" encoding defined in RFC 2047 has more restrictions when
+      * encoding "word" tokens. (Sigh)
+-     */ 
++     */
+     private static String encodeWord(String string, String charset,
+-				     String encoding, boolean encodingWord)
+-			throws UnsupportedEncodingException {
++                                     String encoding, boolean encodingWord)
++                        throws UnsupportedEncodingException {
+ 
+-	// If 'string' contains only US-ASCII characters, just
+-	// return it.
+-	int ascii = checkAscii(string);
+-	if (ascii == ALL_ASCII)
+-	    return string;
++        // If 'string' contains only US-ASCII characters, just
++        // return it.
++        int ascii = checkAscii(string);
++        if (ascii == ALL_ASCII)
++            return string;
+ 
+-	// Else, apply the specified charset conversion.
+-	String jcharset;
+-	if (charset == null) { // use default charset
+-	    jcharset = getDefaultJavaCharset(); // the java charset
+-	    charset = getDefaultMIMECharset(); // the MIME equivalent
+-	} else // MIME charset -> java charset
+-	    jcharset = javaCharset(charset);
++        // Else, apply the specified charset conversion.
++        String jcharset;
++        if (charset == null) { // use default charset
++            jcharset = getDefaultJavaCharset(); // the java charset
++            charset = getDefaultMIMECharset(); // the MIME equivalent
++        } else // MIME charset -> java charset
++            jcharset = javaCharset(charset);
+ 
+-	// If no transfer-encoding is specified, figure one out.
+-	if (encoding == null) {
+-	    if (ascii != MOSTLY_NONASCII)
+-		encoding = "Q";
+-	    else
+-		encoding = "B";
+-	}
++        // If no transfer-encoding is specified, figure one out.
++        if (encoding == null) {
++            if (ascii != MOSTLY_NONASCII)
++                encoding = "Q";
++            else
++                encoding = "B";
++        }
+ 
+-	boolean b64;
+-	if (encoding.equalsIgnoreCase("B")) 
+-	    b64 = true;
+-	else if (encoding.equalsIgnoreCase("Q"))
+-	    b64 = false;
+-	else
+-	    throw new UnsupportedEncodingException(
+-			"Unknown transfer encoding: " + encoding);
++        boolean b64;
++        if (encoding.equalsIgnoreCase("B"))
++            b64 = true;
++        else if (encoding.equalsIgnoreCase("Q"))
++            b64 = false;
++        else
++            throw new UnsupportedEncodingException(
++                        "Unknown transfer encoding: " + encoding);
+ 
+-	StringBuffer outb = new StringBuffer(); // the output buffer
+-	doEncode(string, b64, jcharset, 
+-		 // As per RFC 2047, size of an encoded string should not
+-		 // exceed 75 bytes.
+-		 // 7 = size of "=?", '?', 'B'/'Q', '?', "?="
+-		 75 - 7 - charset.length(), // the available space
+-		 "=?" + charset + "?" + encoding + "?", // prefix
+-		 true, encodingWord, outb);
++        StringBuffer outb = new StringBuffer(); // the output buffer
++        doEncode(string, b64, jcharset,
++                 // As per RFC 2047, size of an encoded string should not
++                 // exceed 75 bytes.
++                 // 7 = size of "=?", '?', 'B'/'Q', '?', "?="
++                 75 - 7 - charset.length(), // the available space
++                 "=?" + charset + "?" + encoding + "?", // prefix
++                 true, encodingWord, outb);
+ 
+-	return outb.toString();
++        return outb.toString();
+     }
+ 
+-    private static void doEncode(String string, boolean b64, 
+-		String jcharset, int avail, String prefix, 
+-		boolean first, boolean encodingWord, StringBuffer buf) 
+-			throws UnsupportedEncodingException {
++    private static void doEncode(String string, boolean b64,
++                String jcharset, int avail, String prefix,
++                boolean first, boolean encodingWord, StringBuffer buf)
++                        throws UnsupportedEncodingException {
+ 
+-	// First find out what the length of the encoded version of
+-	// 'string' would be.
+-	byte[] bytes = string.getBytes(jcharset);
+-	int len;
+-	if (b64) // "B" encoding
+-	    len = BEncoderStream.encodedLength(bytes);
+-	else // "Q"
+-	    len = QEncoderStream.encodedLength(bytes, encodingWord);
+-	
+-	int size;
+-	if ((len > avail) && ((size = string.length()) > 1)) { 
+-	    // If the length is greater than 'avail', split 'string'
+-	    // into two and recurse.
+-	    doEncode(string.substring(0, size/2), b64, jcharset, 
+-		     avail, prefix, first, encodingWord, buf);
+-	    doEncode(string.substring(size/2, size), b64, jcharset,
+-		     avail, prefix, false, encodingWord, buf);
+-	} else {
+-	    // length <= than 'avail'. Encode the given string
+-	    ByteArrayOutputStream os = new ByteArrayOutputStream(BUFFER_SIZE);
+-	    OutputStream eos; // the encoder
+-	    if (b64) // "B" encoding
+-		eos = new BEncoderStream(os);
+-	    else // "Q" encoding
+-		eos = new QEncoderStream(os, encodingWord);
+-	    
+-	    try { // do the encoding
+-		eos.write(bytes);
+-		eos.close();
+-	    } catch (IOException ioex) { }
++        // First find out what the length of the encoded version of
++        // 'string' would be.
++        byte[] bytes = string.getBytes(jcharset);
++        int len;
++        if (b64) // "B" encoding
++            len = BEncoderStream.encodedLength(bytes);
++        else // "Q"
++            len = QEncoderStream.encodedLength(bytes, encodingWord);
+ 
+-	    byte[] encodedBytes = os.toByteArray(); // the encoded stuff
+-	    // Now write out the encoded (all ASCII) bytes into our
+-	    // StringBuffer
+-	    if (!first) // not the first line of this sequence
+-		if (foldEncodedWords)
+-		    buf.append("\r\n "); // start a continuation line
+-		else
+-		    buf.append(" "); // line will be folded later
++        int size;
++        if ((len > avail) && ((size = string.length()) > 1)) {
++            // If the length is greater than 'avail', split 'string'
++            // into two and recurse.
++            doEncode(string.substring(0, size/2), b64, jcharset,
++                     avail, prefix, first, encodingWord, buf);
++            doEncode(string.substring(size/2, size), b64, jcharset,
++                     avail, prefix, false, encodingWord, buf);
++        } else {
++            // length <= than 'avail'. Encode the given string
++            ByteArrayOutputStream os = new ByteArrayOutputStream(BUFFER_SIZE);
++            OutputStream eos; // the encoder
++            if (b64) // "B" encoding
++                eos = new BEncoderStream(os);
++            else // "Q" encoding
++                eos = new QEncoderStream(os, encodingWord);
+ 
+-	    buf.append(prefix);
+-	    for (int i = 0; i < encodedBytes.length; i++)
+-		buf.append((char)encodedBytes[i]);
+-	    buf.append("?="); // terminate the current sequence
+-	}
++            try { // do the encoding
++                eos.write(bytes);
++                eos.close();
++            } catch (IOException ioex) { }
++
++            byte[] encodedBytes = os.toByteArray(); // the encoded stuff
++            // Now write out the encoded (all ASCII) bytes into our
++            // StringBuffer
++            if (!first) // not the first line of this sequence
++                if (foldEncodedWords)
++                    buf.append("\r\n "); // start a continuation line
++                else
++                    buf.append(" "); // line will be folded later
++
++            buf.append(prefix);
++            for (int i = 0; i < encodedBytes.length; i++)
++                buf.append((char)encodedBytes[i]);
++            buf.append("?="); // terminate the current sequence
++        }
+     }
+ 
+     /**
+      * The string is parsed using the rules in RFC 2047 for parsing
+-     * an "encoded-word". If the parse fails, a ParseException is 
+-     * thrown. Otherwise, it is transfer-decoded, and then 
++     * an "encoded-word". If the parse fails, a ParseException is
++     * thrown. Otherwise, it is transfer-decoded, and then
+      * charset-converted into Unicode. If the charset-conversion
+      * fails, an UnsupportedEncodingException is thrown.<p>
+      *
+-     * @param	eword	the possibly encoded value
++     * @param   eword   the possibly encoded value
+      * @exception       ParseException if the string is not an
+-     *			encoded-word as per RFC 2047.
++     *                  encoded-word as per RFC 2047.
+      * @exception       UnsupportedEncodingException if the charset
+-     *			conversion failed.
++     *                  conversion failed.
+      */
+     public static String decodeWord(String eword)
+-		throws ParseException, UnsupportedEncodingException {
++                throws ParseException, UnsupportedEncodingException {
+ 
+-	if (!eword.startsWith("=?")) // not an encoded word
+-	    throw new ParseException();
+-	
+-	// get charset
+-	int start = 2; int pos; 
+-	if ((pos = eword.indexOf('?', start)) == -1)
+-	    throw new ParseException();
+-	String charset = javaCharset(eword.substring(start, pos));
++        if (!eword.startsWith("=?")) // not an encoded word
++            throw new ParseException();
+ 
+-	// get encoding
+-	start = pos+1;
+-	if ((pos = eword.indexOf('?', start)) == -1)
+-	    throw new ParseException();
+-	String encoding = eword.substring(start, pos);
++        // get charset
++        int start = 2; int pos;
++        if ((pos = eword.indexOf('?', start)) == -1)
++            throw new ParseException();
++        String charset = javaCharset(eword.substring(start, pos));
+ 
+-	// get encoded-sequence
+-	start = pos+1;
+-	if ((pos = eword.indexOf("?=", start)) == -1)
+-	    throw new ParseException();
+-	String word = eword.substring(start, pos);
++        // get encoding
++        start = pos+1;
++        if ((pos = eword.indexOf('?', start)) == -1)
++            throw new ParseException();
++        String encoding = eword.substring(start, pos);
+ 
+-	try {
+-	    // Extract the bytes from word
+-	    ByteArrayInputStream bis = 
+-		new ByteArrayInputStream(ASCIIUtility.getBytes(word));
++        // get encoded-sequence
++        start = pos+1;
++        if ((pos = eword.indexOf("?=", start)) == -1)
++            throw new ParseException();
++        String word = eword.substring(start, pos);
+ 
+-	    // Get the appropriate decoder
+-	    InputStream is;
+-	    if (encoding.equalsIgnoreCase("B")) 
+-		is = new BASE64DecoderStream(bis);
+-	    else if (encoding.equalsIgnoreCase("Q"))
+-		is = new QDecoderStream(bis);
+-	    else
+-		throw new UnsupportedEncodingException(
+-				"unknown encoding: " + encoding);
++        try {
++            // Extract the bytes from word
++            ByteArrayInputStream bis =
++                new ByteArrayInputStream(ASCIIUtility.getBytes(word));
+ 
+-	    // For b64 & q, size of decoded word <= size of word. So
+-	    // the decoded bytes must fit into the 'bytes' array. This
+-	    // is certainly more efficient than writing bytes into a
+-	    // ByteArrayOutputStream and then pulling out the byte[]
+-	    // from it.
+-	    int count = bis.available();
+-	    byte[] bytes = new byte[count];
+-	    // count is set to the actual number of decoded bytes 
+-	    count = is.read(bytes, 0, count);
++            // Get the appropriate decoder
++            InputStream is;
++            if (encoding.equalsIgnoreCase("B"))
++                is = new BASE64DecoderStream(bis);
++            else if (encoding.equalsIgnoreCase("Q"))
++                is = new QDecoderStream(bis);
++            else
++                throw new UnsupportedEncodingException(
++                                "unknown encoding: " + encoding);
+ 
+-	    // Finally, convert the decoded bytes into a String using
+-	    // the specified charset
+-	    String s = new String(bytes, 0, count, charset);
+-	    if (pos + 2 < eword.length()) {
+-		// there's still more text in the string
+-		String rest = eword.substring(pos + 2);
+-		if (!decodeStrict)
+-		    rest = decodeInnerWords(rest);
+-		s += rest;
+-	    }
+-	    return s;
+-	} catch (UnsupportedEncodingException uex) {
+-	    // explicitly catch and rethrow this exception, otherwise
+-	    // the below IOException catch will swallow this up!
+-	    throw uex;
+-	} catch (IOException ioex) {
+-	    // Shouldn't happen.
+-	    throw new ParseException();
+-	} catch (IllegalArgumentException iex) {
+-	    /* An unknown charset of the form ISO-XXX-XXX, will cause
+-	     * the JDK to throw an IllegalArgumentException ... Since the
+-	     * JDK will attempt to create a classname using this string,
+-	     * but valid classnames must not contain the character '-',
+-	     * and this results in an IllegalArgumentException, rather than
+-	     * the expected UnsupportedEncodingException. Yikes
+-	     */
+-	    throw new UnsupportedEncodingException();
+-	}
++            // For b64 & q, size of decoded word <= size of word. So
++            // the decoded bytes must fit into the 'bytes' array. This
++            // is certainly more efficient than writing bytes into a
++            // ByteArrayOutputStream and then pulling out the byte[]
++            // from it.
++            int count = bis.available();
++            byte[] bytes = new byte[count];
++            // count is set to the actual number of decoded bytes
++            count = is.read(bytes, 0, count);
++
++            // Finally, convert the decoded bytes into a String using
++            // the specified charset
++            String s = new String(bytes, 0, count, charset);
++            if (pos + 2 < eword.length()) {
++                // there's still more text in the string
++                String rest = eword.substring(pos + 2);
++                if (!decodeStrict)
++                    rest = decodeInnerWords(rest);
++                s += rest;
++            }
++            return s;
++        } catch (UnsupportedEncodingException uex) {
++            // explicitly catch and rethrow this exception, otherwise
++            // the below IOException catch will swallow this up!
++            throw uex;
++        } catch (IOException ioex) {
++            // Shouldn't happen.
++            throw new ParseException();
++        } catch (IllegalArgumentException iex) {
++            /* An unknown charset of the form ISO-XXX-XXX, will cause
++             * the JDK to throw an IllegalArgumentException ... Since the
++             * JDK will attempt to create a classname using this string,
++             * but valid classnames must not contain the character '-',
++             * and this results in an IllegalArgumentException, rather than
++             * the expected UnsupportedEncodingException. Yikes
++             */
++            throw new UnsupportedEncodingException();
++        }
+     }
+ 
+     /**
+@@ -808,28 +808,28 @@
+      * produce such incorrect encodings.
+      */
+     private static String decodeInnerWords(String word)
+-				throws UnsupportedEncodingException {
+-	int start = 0, i;
+-	StringBuffer buf = new StringBuffer();
+-	while ((i = word.indexOf("=?", start)) >= 0) {
+-	    buf.append(word.substring(start, i));
+-	    int end = word.indexOf("?=", i);
+-	    if (end < 0)
+-		break;
+-	    String s = word.substring(i, end + 2);
+-	    try {
+-		s = decodeWord(s);
+-	    } catch (ParseException pex) {
+-		// ignore it, just use the original string
+-	    }
+-	    buf.append(s);
+-	    start = end + 2;
+-	}
+-	if (start == 0)
+-	    return word;
+-	if (start < word.length())
+-	    buf.append(word.substring(start));
+-	return buf.toString();
++                                throws UnsupportedEncodingException {
++        int start = 0, i;
++        StringBuffer buf = new StringBuffer();
++        while ((i = word.indexOf("=?", start)) >= 0) {
++            buf.append(word.substring(start, i));
++            int end = word.indexOf("?=", i);
++            if (end < 0)
++                break;
++            String s = word.substring(i, end + 2);
++            try {
++                s = decodeWord(s);
++            } catch (ParseException pex) {
++                // ignore it, just use the original string
++            }
++            buf.append(s);
++            start = end + 2;
++        }
++        if (start == 0)
++            return word;
++        if (start < word.length())
++            buf.append(word.substring(start));
++        return buf.toString();
+     }
+ 
+     /**
+@@ -839,55 +839,55 @@
+      * The <code>HeaderTokenizer</code> class defines two special
+      * sets of delimiters - MIME and RFC 822. <p>
+      *
+-     * This method is typically used during the generation of 
++     * This method is typically used during the generation of
+      * RFC 822 and MIME header fields.
+      *
+-     * @param	word	word to be quoted
+-     * @param	specials the set of special characters
+-     * @return		the possibly quoted word
+-     * @see	javax.mail.internet.HeaderTokenizer#MIME
+-     * @see	javax.mail.internet.HeaderTokenizer#RFC822
++     * @param   word    word to be quoted
++     * @param   specials the set of special characters
++     * @return          the possibly quoted word
++     * @see     javax.mail.internet.HeaderTokenizer#MIME
++     * @see     javax.mail.internet.HeaderTokenizer#RFC822
+      */
+     public static String quote(String word, String specials) {
+-	int len = word.length();
++        int len = word.length();
+ 
+-	/*
+-	 * Look for any "bad" characters, Escape and
+-	 *  quote the entire string if necessary.
+-	 */
+-	boolean needQuoting = false;
+-	for (int i = 0; i < len; i++) {
+-	    char c = word.charAt(i);
+-	    if (c == '"' || c == '\\' || c == '\r' || c == '\n') {
+-		// need to escape them and then quote the whole string
+-		StringBuffer sb = new StringBuffer(len + 3);
+-		sb.append('"');
+-		sb.append(word.substring(0, i));
+-		int lastc = 0;
+-		for (int j = i; j < len; j++) {
+-		    char cc = word.charAt(j);
+-		    if ((cc == '"') || (cc == '\\') || 
+-			(cc == '\r') || (cc == '\n'))
+-			if (cc == '\n' && lastc == '\r')
+-			    ;	// do nothing, CR was already escaped
+-			else
+-			    sb.append('\\');	// Escape the character
+-		    sb.append(cc);
+-		    lastc = cc;
+-		}
+-		sb.append('"');
+-		return sb.toString();
+-	    } else if (c < 040 || c >= 0177 || specials.indexOf(c) >= 0)
+-		// These characters cause the string to be quoted
+-		needQuoting = true;
+-	}
++        /*
++         * Look for any "bad" characters, Escape and
++         *  quote the entire string if necessary.
++         */
++        boolean needQuoting = false;
++        for (int i = 0; i < len; i++) {
++            char c = word.charAt(i);
++            if (c == '"' || c == '\\' || c == '\r' || c == '\n') {
++                // need to escape them and then quote the whole string
++                StringBuffer sb = new StringBuffer(len + 3);
++                sb.append('"');
++                sb.append(word.substring(0, i));
++                int lastc = 0;
++                for (int j = i; j < len; j++) {
++                    char cc = word.charAt(j);
++                    if ((cc == '"') || (cc == '\\') ||
++                        (cc == '\r') || (cc == '\n'))
++                        if (cc == '\n' && lastc == '\r')
++                            ;   // do nothing, CR was already escaped
++                        else
++                            sb.append('\\');    // Escape the character
++                    sb.append(cc);
++                    lastc = cc;
++                }
++                sb.append('"');
++                return sb.toString();
++            } else if (c < 040 || c >= 0177 || specials.indexOf(c) >= 0)
++                // These characters cause the string to be quoted
++                needQuoting = true;
++        }
+ 
+-	if (needQuoting) {
+-	    StringBuffer sb = new StringBuffer(len + 2);
+-	    sb.append('"').append(word).append('"');
+-	    return sb.toString();
+-	} else 
+-	    return word;
++        if (needQuoting) {
++            StringBuffer sb = new StringBuffer(len + 2);
++            sb.append('"').append(word).append('"');
++            return sb.toString();
++        } else
++            return word;
+     }
+ 
+     /**
+@@ -901,59 +901,59 @@
+      * Note that line breaks in the string aren't escaped; they probably
+      * should be.
+      *
+-     * @param	used	characters used in line so far
+-     * @param	s	the string to fold
+-     * @return		the folded string
++     * @param   used    characters used in line so far
++     * @param   s       the string to fold
++     * @return          the folded string
+      */
+     /*public*/ static String fold(int used, String s) {
+-	if (!foldText)
+-	    return s;
++        if (!foldText)
++            return s;
+ 
+-	int end;
+-	char c;
+-	// Strip trailing spaces
+-	for (end = s.length() - 1; end >= 0; end--) {
+-	    c = s.charAt(end);
+-	    if (c != ' ' && c != '\t')
+-		break;
+-	}
+-	if (end != s.length() - 1)
+-	    s = s.substring(0, end + 1);
++        int end;
++        char c;
++        // Strip trailing spaces
++        for (end = s.length() - 1; end >= 0; end--) {
++            c = s.charAt(end);
++            if (c != ' ' && c != '\t')
++                break;
++        }
++        if (end != s.length() - 1)
++            s = s.substring(0, end + 1);
+ 
+-	// if the string fits now, just return it
+-	if (used + s.length() <= 76)
+-	    return s;
++        // if the string fits now, just return it
++        if (used + s.length() <= 76)
++            return s;
+ 
+-	// have to actually fold the string
+-	StringBuffer sb = new StringBuffer(s.length() + 4);
+-	char lastc = 0;
+-	while (used + s.length() > 76) {
+-	    int lastspace = -1;
+-	    for (int i = 0; i < s.length(); i++) {
+-		if (lastspace != -1 && used + i > 76)
+-		    break;
+-		c = s.charAt(i);
+-		if (c == ' ' || c == '\t')
+-		    if (!(lastc == ' ' || lastc == '\t'))
+-			lastspace = i;
+-		lastc = c;
+-	    }
+-	    if (lastspace == -1) {
+-		// no space, use the whole thing
+-		sb.append(s);
+-		s = "";
+-		used = 0;
+-		break;
+-	    }
+-	    sb.append(s.substring(0, lastspace));
+-	    sb.append("\r\n");
+-	    lastc = s.charAt(lastspace);
+-	    sb.append(lastc);
+-	    s = s.substring(lastspace + 1);
+-	    used = 1;
+-	}
+-	sb.append(s);
+-	return sb.toString();
++        // have to actually fold the string
++        StringBuffer sb = new StringBuffer(s.length() + 4);
++        char lastc = 0;
++        while (used + s.length() > 76) {
++            int lastspace = -1;
++            for (int i = 0; i < s.length(); i++) {
++                if (lastspace != -1 && used + i > 76)
++                    break;
++                c = s.charAt(i);
++                if (c == ' ' || c == '\t')
++                    if (!(lastc == ' ' || lastc == '\t'))
++                        lastspace = i;
++                lastc = c;
++            }
++            if (lastspace == -1) {
++                // no space, use the whole thing
++                sb.append(s);
++                s = "";
++                used = 0;
++                break;
++            }
++            sb.append(s.substring(0, lastspace));
++            sb.append("\r\n");
++            lastc = s.charAt(lastspace);
++            sb.append(lastc);
++            s = s.substring(lastspace + 1);
++            used = 1;
++        }
++        sb.append(s);
++        return sb.toString();
+     }
+ 
+     /**
+@@ -960,58 +960,58 @@
+      * Unfold a folded header.  Any line breaks that aren't escaped and
+      * are followed by whitespace are removed.
+      *
+-     * @param	s	the string to unfold
+-     * @return		the unfolded string
++     * @param   s       the string to unfold
++     * @return          the unfolded string
+      */
+     /*public*/ static String unfold(String s) {
+-	if (!foldText)
+-	    return s;
++        if (!foldText)
++            return s;
+ 
+-	StringBuffer sb = null;
+-	int i;
+-	while ((i = indexOfAny(s, "\r\n")) >= 0) {
+-	    int start = i;
+-	    int l = s.length();
+-	    i++;		// skip CR or NL
+-	    if (i < l && s.charAt(i - 1) == '\r' && s.charAt(i) == '\n')
+-		i++;	// skip LF
+-	    if (start == 0 || s.charAt(start - 1) != '\\') {
+-		char c;
+-		// if next line starts with whitespace, skip all of it
+-		// XXX - always has to be true?
+-		if (i < l && ((c = s.charAt(i)) == ' ' || c == '\t')) {
+-		    i++;	// skip whitespace
+-		    while (i < l && ((c = s.charAt(i)) == ' ' || c == '\t'))
+-			i++;
+-		    if (sb == null)
+-			sb = new StringBuffer(s.length());
+-		    if (start != 0) {
+-			sb.append(s.substring(0, start));
+-			sb.append(' ');
+-		    }
+-		    s = s.substring(i);
+-		    continue;
+-		}
+-		// it's not a continuation line, just leave it in
+-		if (sb == null)
+-		    sb = new StringBuffer(s.length());
+-		sb.append(s.substring(0, i));
+-		s = s.substring(i);
+-	    } else {
+-		// there's a backslash at "start - 1"
+-		// strip it out, but leave in the line break
+-		if (sb == null)
+-		    sb = new StringBuffer(s.length());
+-		sb.append(s.substring(0, start - 1));
+-		sb.append(s.substring(start, i));
+-		s = s.substring(i);
+-	    }
+-	}
+-	if (sb != null) {
+-	    sb.append(s);
+-	    return sb.toString();
+-	} else
+-	    return s;
++        StringBuffer sb = null;
++        int i;
++        while ((i = indexOfAny(s, "\r\n")) >= 0) {
++            int start = i;
++            int l = s.length();
++            i++;                // skip CR or NL
++            if (i < l && s.charAt(i - 1) == '\r' && s.charAt(i) == '\n')
++                i++;    // skip LF
++            if (start == 0 || s.charAt(start - 1) != '\\') {
++                char c;
++                // if next line starts with whitespace, skip all of it
++                // XXX - always has to be true?
++                if (i < l && ((c = s.charAt(i)) == ' ' || c == '\t')) {
++                    i++;        // skip whitespace
++                    while (i < l && ((c = s.charAt(i)) == ' ' || c == '\t'))
++                        i++;
++                    if (sb == null)
++                        sb = new StringBuffer(s.length());
++                    if (start != 0) {
++                        sb.append(s.substring(0, start));
++                        sb.append(' ');
++                    }
++                    s = s.substring(i);
++                    continue;
++                }
++                // it's not a continuation line, just leave it in
++                if (sb == null)
++                    sb = new StringBuffer(s.length());
++                sb.append(s.substring(0, i));
++                s = s.substring(i);
++            } else {
++                // there's a backslash at "start - 1"
++                // strip it out, but leave in the line break
++                if (sb == null)
++                    sb = new StringBuffer(s.length());
++                sb.append(s.substring(0, start - 1));
++                sb.append(s.substring(start, i));
++                s = s.substring(i);
++            }
++        }
++        if (sb != null) {
++            sb.append(s);
++            return sb.toString();
++        } else
++            return s;
+     }
+ 
+     /**
+@@ -1021,36 +1021,36 @@
+      * This should be a method on String.
+      */
+     private static int indexOfAny(String s, String any) {
+-	return indexOfAny(s, any, 0);
++        return indexOfAny(s, any, 0);
+     }
+ 
+     private static int indexOfAny(String s, String any, int start) {
+-	try {
+-	    int len = s.length();
+-	    for (int i = start; i < len; i++) {
+-		if (any.indexOf(s.charAt(i)) >= 0)
+-		    return i;
+-	    }
+-	    return -1;
+-	} catch (StringIndexOutOfBoundsException e) {
+-	    return -1;
+-	}
++        try {
++            int len = s.length();
++            for (int i = start; i < len; i++) {
++                if (any.indexOf(s.charAt(i)) >= 0)
++                    return i;
++            }
++            return -1;
++        } catch (StringIndexOutOfBoundsException e) {
++            return -1;
++        }
+     }
+ 
+     /**
+      * Convert a MIME charset name into a valid Java charset name. <p>
+      *
+-     * @param charset	the MIME charset name
++     * @param charset   the MIME charset name
+      * @return  the Java charset equivalent. If a suitable mapping is
+-     *		not available, the passed in charset is itself returned.
++     *          not available, the passed in charset is itself returned.
+      */
+     public static String javaCharset(String charset) {
+-	if (mime2java == null || charset == null)
+-	    // no mapping table, or charset parameter is null
+-	    return charset;
++        if (mime2java == null || charset == null)
++            // no mapping table, or charset parameter is null
++            return charset;
+ 
+-	String alias = (String)mime2java.get(charset.toLowerCase());
+-	return alias == null ? charset : alias;
++        String alias = (String)mime2java.get(charset.toLowerCase());
++        return alias == null ? charset : alias;
+     }
+ 
+     /**
+@@ -1061,18 +1061,18 @@
+      * method then.
+      *
+      * @param   charset    the JDK charset
+-     * @return      	the MIME/IANA equivalent. If a mapping
+-     *			is not possible, the passed in charset itself
+-     *			is returned.
+-     * @since		JavaMail 1.1
++     * @return          the MIME/IANA equivalent. If a mapping
++     *                  is not possible, the passed in charset itself
++     *                  is returned.
++     * @since           JavaMail 1.1
+      */
+     public static String mimeCharset(String charset) {
+-	if (java2mime == null || charset == null) 
+-	    // no mapping table or charset param is null
+-	    return charset;
++        if (java2mime == null || charset == null)
++            // no mapping table or charset param is null
++            return charset;
+ 
+-	String alias = (String)java2mime.get(charset.toLowerCase());
+-	return alias == null ? charset : alias;
++        String alias = (String)java2mime.get(charset.toLowerCase());
++        return alias == null ? charset : alias;
+     }
+ 
+     private static String defaultJavaCharset;
+@@ -1079,49 +1079,49 @@
+     private static String defaultMIMECharset;
+ 
+     /**
+-     * Get the default charset corresponding to the system's current 
++     * Get the default charset corresponding to the system's current
+      * default locale.  If the System property <code>mail.mime.charset</code>
+      * is set, a system charset corresponding to this MIME charset will be
+      * returned. <p>
+-     * 
+-     * @return	the default charset of the system's default locale, 
+-     * 		as a Java charset. (NOT a MIME charset)
+-     * @since	JavaMail 1.1
++     *
++     * @return  the default charset of the system's default locale,
++     *          as a Java charset. (NOT a MIME charset)
++     * @since   JavaMail 1.1
+      */
+     public static String getDefaultJavaCharset() {
+-	if (defaultJavaCharset == null) {
+-	    /*
+-	     * If mail.mime.charset is set, it controls the default
+-	     * Java charset as well.
+-	     */
+-	    String mimecs = null;
+-	    try {
+-		mimecs = System.getProperty("mail.mime.charset");
+-	    } catch (SecurityException ex) { }	// ignore it
+-	    if (mimecs != null && mimecs.length() > 0) {
+-		defaultJavaCharset = javaCharset(mimecs);
+-		return defaultJavaCharset;
+-	    }
++        if (defaultJavaCharset == null) {
++            /*
++             * If mail.mime.charset is set, it controls the default
++             * Java charset as well.
++             */
++            String mimecs = null;
++            try {
++                mimecs = System.getProperty("mail.mime.charset");
++            } catch (SecurityException ex) { }  // ignore it
++            if (mimecs != null && mimecs.length() > 0) {
++                defaultJavaCharset = javaCharset(mimecs);
++                return defaultJavaCharset;
++            }
+ 
+-	    try {
+-		defaultJavaCharset = System.getProperty("file.encoding", 
+-							"8859_1");
+-	    } catch (SecurityException sex) {
+-		
+-		class NullInputStream extends InputStream {
+-		    public int read() {
+-			return 0;
+-		    }
+-		}
+-		InputStreamReader reader = 
+-			new InputStreamReader(new NullInputStream());
+-		defaultJavaCharset = reader.getEncoding();
+-		if (defaultJavaCharset == null)
+-		    defaultJavaCharset = "8859_1";
+-	    }
+-	}
++            try {
++                defaultJavaCharset = System.getProperty("file.encoding",
++                                                        "8859_1");
++            } catch (SecurityException sex) {
+ 
+-	return defaultJavaCharset;
++                class NullInputStream extends InputStream {
++                    public int read() {
++                        return 0;
++                    }
++                }
++                InputStreamReader reader =
++                        new InputStreamReader(new NullInputStream());
++                defaultJavaCharset = reader.getEncoding();
++                if (defaultJavaCharset == null)
++                    defaultJavaCharset = "8859_1";
++            }
++        }
++
++        return defaultJavaCharset;
+     }
+ 
+     /*
+@@ -1128,14 +1128,14 @@
+      * Get the default MIME charset for this locale.
+      */
+     static String getDefaultMIMECharset() {
+-	if (defaultMIMECharset == null) {
+-	    try {
+-		defaultMIMECharset = System.getProperty("mail.mime.charset");
+-	    } catch (SecurityException ex) { }	// ignore it
+-	}
+-	if (defaultMIMECharset == null)
+-	    defaultMIMECharset = mimeCharset(getDefaultJavaCharset());
+-	return defaultMIMECharset;
++        if (defaultMIMECharset == null) {
++            try {
++                defaultMIMECharset = System.getProperty("mail.mime.charset");
++            } catch (SecurityException ex) { }  // ignore it
++        }
++        if (defaultMIMECharset == null)
++            defaultMIMECharset = mimeCharset(getDefaultJavaCharset());
++        return defaultMIMECharset;
+     }
+ 
+     // Tables to map MIME charset names to Java names and vice versa.
+@@ -1144,185 +1144,185 @@
+     private static Hashtable java2mime;
+ 
+     static {
+-	java2mime = new Hashtable(40);
+-	mime2java = new Hashtable(10);
++        java2mime = new Hashtable(40);
++        mime2java = new Hashtable(10);
+ 
+-	try {
+-	    // Use this class's classloader to load the mapping file
+-	    // XXX - we should use SecuritySupport, but it's in another package
+-	    InputStream is = 
+-		    com.sun.xml.internal.messaging.saaj.packaging.mime.internet.MimeUtility.class.getResourceAsStream(
+-		    "/META-INF/javamail.charset.map");
++        try {
++            // Use this class's classloader to load the mapping file
++            // XXX - we should use SecuritySupport, but it's in another package
++            InputStream is =
++                    com.sun.xml.internal.messaging.saaj.packaging.mime.internet.MimeUtility.class.getResourceAsStream(
++                    "/META-INF/javamail.charset.map");
+ 
+-	    if (is != null) {
+-		is = new LineInputStream(is);
++            if (is != null) {
++                is = new LineInputStream(is);
+ 
+-		// Load the JDK-to-MIME charset mapping table
+-		loadMappings((LineInputStream)is, java2mime);
++                // Load the JDK-to-MIME charset mapping table
++                loadMappings((LineInputStream)is, java2mime);
+ 
+-		// Load the MIME-to-JDK charset mapping table
+-		loadMappings((LineInputStream)is, mime2java);
+-	    }
+-	} catch (Exception ex) { }
++                // Load the MIME-to-JDK charset mapping table
++                loadMappings((LineInputStream)is, mime2java);
++            }
++        } catch (Exception ex) { }
+ 
+-	// If we didn't load the tables, e.g., because we didn't have
+-	// permission, load them manually.  The entries here should be
+-	// the same as the default javamail.charset.map.
+-	if (java2mime.isEmpty()) {
+-	    java2mime.put("8859_1", "ISO-8859-1");
+-	    java2mime.put("iso8859_1", "ISO-8859-1");
+-	    java2mime.put("ISO8859-1", "ISO-8859-1");
++        // If we didn't load the tables, e.g., because we didn't have
++        // permission, load them manually.  The entries here should be
++        // the same as the default javamail.charset.map.
++        if (java2mime.isEmpty()) {
++            java2mime.put("8859_1", "ISO-8859-1");
++            java2mime.put("iso8859_1", "ISO-8859-1");
++            java2mime.put("ISO8859-1", "ISO-8859-1");
+ 
+-	    java2mime.put("8859_2", "ISO-8859-2");
+-	    java2mime.put("iso8859_2", "ISO-8859-2");
+-	    java2mime.put("ISO8859-2", "ISO-8859-2");
++            java2mime.put("8859_2", "ISO-8859-2");
++            java2mime.put("iso8859_2", "ISO-8859-2");
++            java2mime.put("ISO8859-2", "ISO-8859-2");
+ 
+-	    java2mime.put("8859_3", "ISO-8859-3");
+-	    java2mime.put("iso8859_3", "ISO-8859-3");
+-	    java2mime.put("ISO8859-3", "ISO-8859-3");
++            java2mime.put("8859_3", "ISO-8859-3");
++            java2mime.put("iso8859_3", "ISO-8859-3");
++            java2mime.put("ISO8859-3", "ISO-8859-3");
+ 
+-	    java2mime.put("8859_4", "ISO-8859-4");
+-	    java2mime.put("iso8859_4", "ISO-8859-4");
+-	    java2mime.put("ISO8859-4", "ISO-8859-4");
++            java2mime.put("8859_4", "ISO-8859-4");
++            java2mime.put("iso8859_4", "ISO-8859-4");
++            java2mime.put("ISO8859-4", "ISO-8859-4");
+ 
+-	    java2mime.put("8859_5", "ISO-8859-5");
+-	    java2mime.put("iso8859_5", "ISO-8859-5");
+-	    java2mime.put("ISO8859-5", "ISO-8859-5");
++            java2mime.put("8859_5", "ISO-8859-5");
++            java2mime.put("iso8859_5", "ISO-8859-5");
++            java2mime.put("ISO8859-5", "ISO-8859-5");
+ 
+-	    java2mime.put("8859_6", "ISO-8859-6");
+-	    java2mime.put("iso8859_6", "ISO-8859-6");
+-	    java2mime.put("ISO8859-6", "ISO-8859-6");
++            java2mime.put("8859_6", "ISO-8859-6");
++            java2mime.put("iso8859_6", "ISO-8859-6");
++            java2mime.put("ISO8859-6", "ISO-8859-6");
+ 
+-	    java2mime.put("8859_7", "ISO-8859-7");
+-	    java2mime.put("iso8859_7", "ISO-8859-7");
+-	    java2mime.put("ISO8859-7", "ISO-8859-7");
++            java2mime.put("8859_7", "ISO-8859-7");
++            java2mime.put("iso8859_7", "ISO-8859-7");
++            java2mime.put("ISO8859-7", "ISO-8859-7");
+ 
+-	    java2mime.put("8859_8", "ISO-8859-8");
+-	    java2mime.put("iso8859_8", "ISO-8859-8");
+-	    java2mime.put("ISO8859-8", "ISO-8859-8");
++            java2mime.put("8859_8", "ISO-8859-8");
++            java2mime.put("iso8859_8", "ISO-8859-8");
++            java2mime.put("ISO8859-8", "ISO-8859-8");
+ 
+-	    java2mime.put("8859_9", "ISO-8859-9");
+-	    java2mime.put("iso8859_9", "ISO-8859-9");
+-	    java2mime.put("ISO8859-9", "ISO-8859-9");
++            java2mime.put("8859_9", "ISO-8859-9");
++            java2mime.put("iso8859_9", "ISO-8859-9");
++            java2mime.put("ISO8859-9", "ISO-8859-9");
+ 
+-	    java2mime.put("SJIS", "Shift_JIS");
+-	    java2mime.put("MS932", "Shift_JIS");
+-	    java2mime.put("JIS", "ISO-2022-JP");
+-	    java2mime.put("ISO2022JP", "ISO-2022-JP");
+-	    java2mime.put("EUC_JP", "euc-jp");
+-	    java2mime.put("KOI8_R", "koi8-r");
+-	    java2mime.put("EUC_CN", "euc-cn");
+-	    java2mime.put("EUC_TW", "euc-tw");
+-	    java2mime.put("EUC_KR", "euc-kr");
+-	}
+-	if (mime2java.isEmpty()) {
+-	    mime2java.put("iso-2022-cn", "ISO2022CN");
+-	    mime2java.put("iso-2022-kr", "ISO2022KR");
+-	    mime2java.put("utf-8", "UTF8");
+-	    mime2java.put("utf8", "UTF8");
+-	    mime2java.put("ja_jp.iso2022-7", "ISO2022JP");
+-	    mime2java.put("ja_jp.eucjp", "EUCJIS");
+-	    mime2java.put("euc-kr", "KSC5601");
+-	    mime2java.put("euckr", "KSC5601");
+-	    mime2java.put("us-ascii", "ISO-8859-1");
+-	    mime2java.put("x-us-ascii", "ISO-8859-1");
+-	}
++            java2mime.put("SJIS", "Shift_JIS");
++            java2mime.put("MS932", "Shift_JIS");
++            java2mime.put("JIS", "ISO-2022-JP");
++            java2mime.put("ISO2022JP", "ISO-2022-JP");
++            java2mime.put("EUC_JP", "euc-jp");
++            java2mime.put("KOI8_R", "koi8-r");
++            java2mime.put("EUC_CN", "euc-cn");
++            java2mime.put("EUC_TW", "euc-tw");
++            java2mime.put("EUC_KR", "euc-kr");
++        }
++        if (mime2java.isEmpty()) {
++            mime2java.put("iso-2022-cn", "ISO2022CN");
++            mime2java.put("iso-2022-kr", "ISO2022KR");
++            mime2java.put("utf-8", "UTF8");
++            mime2java.put("utf8", "UTF8");
++            mime2java.put("ja_jp.iso2022-7", "ISO2022JP");
++            mime2java.put("ja_jp.eucjp", "EUCJIS");
++            mime2java.put("euc-kr", "KSC5601");
++            mime2java.put("euckr", "KSC5601");
++            mime2java.put("us-ascii", "ISO-8859-1");
++            mime2java.put("x-us-ascii", "ISO-8859-1");
++        }
+     }
+ 
+     private static void loadMappings(LineInputStream is, Hashtable table) {
+-	String currLine;
++        String currLine;
+ 
+-	while (true) {
+-	    try {
+-		currLine = is.readLine();
+-	    } catch (IOException ioex) {
+-		break; // error in reading, stop
+-	    }
++        while (true) {
++            try {
++                currLine = is.readLine();
++            } catch (IOException ioex) {
++                break; // error in reading, stop
++            }
+ 
+-	    if (currLine == null) // end of file, stop
+-		break;
+-	    if (currLine.startsWith("--") && currLine.endsWith("--"))
+-		// end of this table
+-		break;	
++            if (currLine == null) // end of file, stop
++                break;
++            if (currLine.startsWith("--") && currLine.endsWith("--"))
++                // end of this table
++                break;
+ 
+-	    // ignore empty lines and comments
+-	    if (currLine.trim().length() == 0 || currLine.startsWith("#"))
+-		continue;
+-	    
+-	    // A valid entry is of the form <key><separator><value>
+-	    // where, <separator> := SPACE | HT. Parse this
+-	    StringTokenizer tk = new StringTokenizer(currLine, " \t");
+-	    try {
+-		String key = tk.nextToken();
+-		String value = tk.nextToken();
+-		table.put(key.toLowerCase(), value);
+-	    } catch (NoSuchElementException nex) { }
+-	}
++            // ignore empty lines and comments
++            if (currLine.trim().length() == 0 || currLine.startsWith("#"))
++                continue;
++
++            // A valid entry is of the form <key><separator><value>
++            // where, <separator> := SPACE | HT. Parse this
++            StringTokenizer tk = new StringTokenizer(currLine, " \t");
++            try {
++                String key = tk.nextToken();
++                String value = tk.nextToken();
++                table.put(key.toLowerCase(), value);
++            } catch (NoSuchElementException nex) { }
++        }
+     }
+ 
+-    static final int ALL_ASCII 		= 1;
+-    static final int MOSTLY_ASCII 	= 2;
+-    static final int MOSTLY_NONASCII 	= 3;
++    static final int ALL_ASCII          = 1;
++    static final int MOSTLY_ASCII       = 2;
++    static final int MOSTLY_NONASCII    = 3;
+ 
+-    /** 
++    /**
+      * Check if the given string contains non US-ASCII characters.
+-     * @param	s	string
+-     * @return		ALL_ASCII if all characters in the string 
+-     *			belong to the US-ASCII charset. MOSTLY_ASCII
+-     *			if more than half of the available characters
+-     *			are US-ASCII characters. Else MOSTLY_NONASCII.
++     * @param   s       string
++     * @return          ALL_ASCII if all characters in the string
++     *                  belong to the US-ASCII charset. MOSTLY_ASCII
++     *                  if more than half of the available characters
++     *                  are US-ASCII characters. Else MOSTLY_NONASCII.
+      */
+     static int checkAscii(String s) {
+-	int ascii = 0, non_ascii = 0;
+-	int l = s.length();
++        int ascii = 0, non_ascii = 0;
++        int l = s.length();
+ 
+-	for (int i = 0; i < l; i++) {
+-	    if (nonascii((int)s.charAt(i))) // non-ascii
+-		non_ascii++;
+-	    else
+-		ascii++;
+-	}
++        for (int i = 0; i < l; i++) {
++            if (nonascii((int)s.charAt(i))) // non-ascii
++                non_ascii++;
++            else
++                ascii++;
++        }
+ 
+-	if (non_ascii == 0)
+-	    return ALL_ASCII;
+-	if (ascii > non_ascii)
+-	    return MOSTLY_ASCII;
++        if (non_ascii == 0)
++            return ALL_ASCII;
++        if (ascii > non_ascii)
++            return MOSTLY_ASCII;
+ 
+-	return MOSTLY_NONASCII;
++        return MOSTLY_NONASCII;
+     }
+ 
+-    /** 
++    /**
+      * Check if the given byte array contains non US-ASCII characters.
+-     * @param	b	byte array
+-     * @return		ALL_ASCII if all characters in the string 
+-     *			belong to the US-ASCII charset. MOSTLY_ASCII
+-     *			if more than half of the available characters
+-     *			are US-ASCII characters. Else MOSTLY_NONASCII.
++     * @param   b       byte array
++     * @return          ALL_ASCII if all characters in the string
++     *                  belong to the US-ASCII charset. MOSTLY_ASCII
++     *                  if more than half of the available characters
++     *                  are US-ASCII characters. Else MOSTLY_NONASCII.
+      *
+      * XXX - this method is no longer used
+      */
+     static int checkAscii(byte[] b) {
+-	int ascii = 0, non_ascii = 0;
++        int ascii = 0, non_ascii = 0;
+ 
+-	for (int i=0; i < b.length; i++) {
+-	    // The '&' operator automatically causes b[i] to be promoted
+-	    // to an int, and we mask out the higher bytes in the int 
+-	    // so that the resulting value is not a negative integer.
+-	    if (nonascii(b[i] & 0xff)) // non-ascii
+-		non_ascii++;
+-	    else
+-		ascii++;
+-	}
+-	
+-	if (non_ascii == 0)
+-	    return ALL_ASCII;
+-	if (ascii > non_ascii)
+-	    return MOSTLY_ASCII;
+-	
+-	return MOSTLY_NONASCII;
++        for (int i=0; i < b.length; i++) {
++            // The '&' operator automatically causes b[i] to be promoted
++            // to an int, and we mask out the higher bytes in the int
++            // so that the resulting value is not a negative integer.
++            if (nonascii(b[i] & 0xff)) // non-ascii
++                non_ascii++;
++            else
++                ascii++;
++        }
++
++        if (non_ascii == 0)
++            return ALL_ASCII;
++        if (ascii > non_ascii)
++            return MOSTLY_ASCII;
++
++        return MOSTLY_NONASCII;
+     }
+ 
+-    /** 
++    /**
+      * Check if the given input stream contains non US-ASCII characters.
+      * Upto <code>max</code> bytes are checked. If <code>max</code> is
+      * set to <code>ALL</code>, then all the bytes available in this
+@@ -1331,97 +1331,97 @@
+      * found and MOSTLY_NONASCII is returned. Else, the check continues
+      * till <code>max</code> bytes or till the end of stream.
+      *
+-     * @param	is	the input stream
+-     * @param	max	maximum bytes to check for. The special value
+-     *			ALL indicates that all the bytes in this input
+-     *			stream must be checked.
+-     * @param	breakOnNonAscii if <code>true</code>, then terminate the
+-     *			the check when the first non-US-ASCII character
+-     *			is found.
+-     * @return		ALL_ASCII if all characters in the string 
+-     *			belong to the US-ASCII charset. MOSTLY_ASCII
+-     *			if more than half of the available characters
+-     *			are US-ASCII characters. Else MOSTLY_NONASCII.
++     * @param   is      the input stream
++     * @param   max     maximum bytes to check for. The special value
++     *                  ALL indicates that all the bytes in this input
++     *                  stream must be checked.
++     * @param   breakOnNonAscii if <code>true</code>, then terminate the
++     *                  the check when the first non-US-ASCII character
++     *                  is found.
++     * @return          ALL_ASCII if all characters in the string
++     *                  belong to the US-ASCII charset. MOSTLY_ASCII
++     *                  if more than half of the available characters
++     *                  are US-ASCII characters. Else MOSTLY_NONASCII.
+      */
+     static int checkAscii(InputStream is, int max, boolean breakOnNonAscii) {
+-	int ascii = 0, non_ascii = 0;
+-	int len;
+-	int block = 4096;
+-	int linelen = 0;
+-	boolean longLine = false, badEOL = false;
+-	boolean checkEOL = encodeEolStrict && breakOnNonAscii;
+-	byte buf[] = null;
+-	if (max != 0) {
+-	    block = (max == ALL) ? 4096 : Math.min(max, 4096);
+-	    buf = new byte[block]; 
+-	}
+-	while (max != 0) {
+-	    try {
+-		if ((len = is.read(buf, 0, block)) == -1)
+-		    break;
+-		int lastb = 0;
+-		for (int i = 0; i < len; i++) {
+-	    	    // The '&' operator automatically causes b[i] to 
+-		    // be promoted to an int, and we mask out the higher
+-		    // bytes in the int so that the resulting value is 
+-		    // not a negative integer.
+-		    int b = buf[i] & 0xff;
+-		    if (checkEOL &&
+-			    ((lastb == '\r' && b != '\n') ||
+-			    (lastb != '\r' && b == '\n')))
+-			badEOL = true;
+-		    if (b == '\r' || b == '\n')
+-			linelen = 0;
+-		    else {
+-			linelen++;
+-			if (linelen > 998)	// 1000 - CRLF
+-			    longLine = true;
+-		    }
+-		    if (nonascii(b)) {	// non-ascii
+-		        if (breakOnNonAscii) // we are done
+-			    return MOSTLY_NONASCII;
+-		        else
+-			    non_ascii++;
+-		    } else
+-		        ascii++;
+-		    lastb = b;
+-		}
+-	    } catch (IOException ioex) {
+-		break;
+-	    }
+-	    if (max != ALL)
+-		max -= len;
+-	}
++        int ascii = 0, non_ascii = 0;
++        int len;
++        int block = 4096;
++        int linelen = 0;
++        boolean longLine = false, badEOL = false;
++        boolean checkEOL = encodeEolStrict && breakOnNonAscii;
++        byte buf[] = null;
++        if (max != 0) {
++            block = (max == ALL) ? 4096 : Math.min(max, 4096);
++            buf = new byte[block];
++        }
++        while (max != 0) {
++            try {
++                if ((len = is.read(buf, 0, block)) == -1)
++                    break;
++                int lastb = 0;
++                for (int i = 0; i < len; i++) {
++                    // The '&' operator automatically causes b[i] to
++                    // be promoted to an int, and we mask out the higher
++                    // bytes in the int so that the resulting value is
++                    // not a negative integer.
++                    int b = buf[i] & 0xff;
++                    if (checkEOL &&
++                            ((lastb == '\r' && b != '\n') ||
++                            (lastb != '\r' && b == '\n')))
++                        badEOL = true;
++                    if (b == '\r' || b == '\n')
++                        linelen = 0;
++                    else {
++                        linelen++;
++                        if (linelen > 998)      // 1000 - CRLF
++                            longLine = true;
++                    }
++                    if (nonascii(b)) {  // non-ascii
++                        if (breakOnNonAscii) // we are done
++                            return MOSTLY_NONASCII;
++                        else
++                            non_ascii++;
++                    } else
++                        ascii++;
++                    lastb = b;
++                }
++            } catch (IOException ioex) {
++                break;
++            }
++            if (max != ALL)
++                max -= len;
++        }
+ 
+-	if (max == 0 && breakOnNonAscii)
+-	    // We have been told to break on the first non-ascii character.
+-	    // We haven't got any non-ascii character yet, but then we
+-	    // have not checked all of the available bytes either. So we
+-	    // cannot say for sure that this input stream is ALL_ASCII,
+-	    // and hence we must play safe and return MOSTLY_NONASCII
++        if (max == 0 && breakOnNonAscii)
++            // We have been told to break on the first non-ascii character.
++            // We haven't got any non-ascii character yet, but then we
++            // have not checked all of the available bytes either. So we
++            // cannot say for sure that this input stream is ALL_ASCII,
++            // and hence we must play safe and return MOSTLY_NONASCII
+ 
+-	    return MOSTLY_NONASCII;
++            return MOSTLY_NONASCII;
+ 
+-	if (non_ascii == 0) { // no non-us-ascii characters so far
+-	    // If we're looking at non-text data, and we saw CR without LF
+-	    // or vice versa, consider this mostly non-ASCII so that it
+-	    // will be base64 encoded (since the quoted-printable encoder
+-	    // doesn't encode this case properly).
+-	    if (badEOL)
+-		return MOSTLY_NONASCII;
+-	    // if we've seen a long line, we degrade to mostly ascii
+-	    else if (longLine)
+-		return MOSTLY_ASCII;
+-	    else
+-		return ALL_ASCII;
+-	}
+-	if (ascii > non_ascii) // mostly ascii
+-	    return MOSTLY_ASCII;
+-	return MOSTLY_NONASCII;
++        if (non_ascii == 0) { // no non-us-ascii characters so far
++            // If we're looking at non-text data, and we saw CR without LF
++            // or vice versa, consider this mostly non-ASCII so that it
++            // will be base64 encoded (since the quoted-printable encoder
++            // doesn't encode this case properly).
++            if (badEOL)
++                return MOSTLY_NONASCII;
++            // if we've seen a long line, we degrade to mostly ascii
++            else if (longLine)
++                return MOSTLY_ASCII;
++            else
++                return ALL_ASCII;
++        }
++        if (ascii > non_ascii) // mostly ascii
++            return MOSTLY_ASCII;
++        return MOSTLY_NONASCII;
+     }
+ 
+     static final boolean nonascii(int b) {
+-	return b >= 0177 || (b < 040 && b != '\r' && b != '\n' && b != '\t');
++        return b >= 0177 || (b < 040 && b != '\r' && b != '\n' && b != '\t');
+     }
+ }
+ 
+@@ -1440,45 +1440,45 @@
+     private int ret = 0;
+ 
+     public AsciiOutputStream(boolean breakOnNonAscii, boolean encodeEolStrict) {
+-	this.breakOnNonAscii = breakOnNonAscii;
+-	checkEOL = encodeEolStrict && breakOnNonAscii;
++        this.breakOnNonAscii = breakOnNonAscii;
++        checkEOL = encodeEolStrict && breakOnNonAscii;
+     }
+ 
+     public void write(int b) throws IOException {
+-	check(b);
++        check(b);
+     }
+ 
+     public void write(byte b[]) throws IOException {
+-	write(b, 0, b.length);
++        write(b, 0, b.length);
+     }
+ 
+     public void write(byte b[], int off, int len) throws IOException {
+-	len += off;
+-	for (int i = off; i < len ; i++)
+-	    check(b[i]);
++        len += off;
++        for (int i = off; i < len ; i++)
++            check(b[i]);
+     }
+ 
+     private final void check(int b) throws IOException {
+-	b &= 0xff;
+-	if (checkEOL &&
+-		((lastb == '\r' && b != '\n') || (lastb != '\r' && b == '\n')))
+-	    badEOL = true;
+-	if (b == '\r' || b == '\n')
+-	    linelen = 0;
+-	else {
+-	    linelen++;
+-	    if (linelen > 998)	// 1000 - CRLF
+-		longLine = true;
+-	}
+-	if (MimeUtility.nonascii(b)) { // non-ascii
+-	    non_ascii++;
+-	    if (breakOnNonAscii) {	// we are done
+-		ret = MimeUtility.MOSTLY_NONASCII;
+-		throw new EOFException();
+-	    }
+-	} else
+-	    ascii++;
+-	lastb = b;
++        b &= 0xff;
++        if (checkEOL &&
++                ((lastb == '\r' && b != '\n') || (lastb != '\r' && b == '\n')))
++            badEOL = true;
++        if (b == '\r' || b == '\n')
++            linelen = 0;
++        else {
++            linelen++;
++            if (linelen > 998)  // 1000 - CRLF
++                longLine = true;
++        }
++        if (MimeUtility.nonascii(b)) { // non-ascii
++            non_ascii++;
++            if (breakOnNonAscii) {      // we are done
++                ret = MimeUtility.MOSTLY_NONASCII;
++                throw new EOFException();
++            }
++        } else
++            ascii++;
++        lastb = b;
+     }
+ 
+     /**
+@@ -1485,23 +1485,23 @@
+      * Return ASCII-ness of data stream.
+      */
+     public int getAscii() {
+-	if (ret != 0)
+-	    return ret;
+-	// If we're looking at non-text data, and we saw CR without LF
+-	// or vice versa, consider this mostly non-ASCII so that it
+-	// will be base64 encoded (since the quoted-printable encoder
+-	// doesn't encode this case properly).
+-	if (badEOL)
+-	    return MimeUtility.MOSTLY_NONASCII;
+-	else if (non_ascii == 0) { // no non-us-ascii characters so far
+-	    // if we've seen a long line, we degrade to mostly ascii
+-	    if (longLine)
+-		return MimeUtility.MOSTLY_ASCII;
+-	    else
+-		return MimeUtility.ALL_ASCII;
+-	}
+-	if (ascii > non_ascii) // mostly ascii
+-	    return MimeUtility.MOSTLY_ASCII;
+-	return MimeUtility.MOSTLY_NONASCII;
++        if (ret != 0)
++            return ret;
++        // If we're looking at non-text data, and we saw CR without LF
++        // or vice versa, consider this mostly non-ASCII so that it
++        // will be base64 encoded (since the quoted-printable encoder
++        // doesn't encode this case properly).
++        if (badEOL)
++            return MimeUtility.MOSTLY_NONASCII;
++        else if (non_ascii == 0) { // no non-us-ascii characters so far
++            // if we've seen a long line, we degrade to mostly ascii
++            if (longLine)
++                return MimeUtility.MOSTLY_ASCII;
++            else
++                return MimeUtility.ALL_ASCII;
++        }
++        if (ascii > non_ascii) // mostly ascii
++            return MimeUtility.MOSTLY_ASCII;
++        return MimeUtility.MOSTLY_NONASCII;
+     }
+ }
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/ParameterList.java	Thu Jul 30 18:06:37 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/ParameterList.java	Thu Jul 30 18:06:37 2009
+@@ -59,77 +59,77 @@
+     /**
+      * Constructor that takes a parameter-list string. The String
+      * is parsed and the parameters are collected and stored internally.
+-     * A ParseException is thrown if the parse fails. 
+-     * Note that an empty parameter-list string is valid and will be 
++     * A ParseException is thrown if the parse fails.
++     * Note that an empty parameter-list string is valid and will be
+      * parsed into an empty ParameterList.
+      *
+-     * @param	s	the parameter-list string.
+-     * @exception	ParseException if the parse fails.
++     * @param   s       the parameter-list string.
++     * @exception       ParseException if the parse fails.
+      */
+     public ParameterList(String s) throws ParseException {
+-	HeaderTokenizer h = new HeaderTokenizer(s, HeaderTokenizer.MIME);
+-	HeaderTokenizer.Token tk;
+-	int type;
+-	String name;
++        HeaderTokenizer h = new HeaderTokenizer(s, HeaderTokenizer.MIME);
++        HeaderTokenizer.Token tk;
++        int type;
++        String name;
+ 
+         list = new HashMap();
+-	while (true) {
+-	    tk = h.next();
+-	    type = tk.getType();
++        while (true) {
++            tk = h.next();
++            type = tk.getType();
+ 
+-	    if (type == HeaderTokenizer.Token.EOF) // done
+-		return;
++            if (type == HeaderTokenizer.Token.EOF) // done
++                return;
+ 
+-	    if ((char)type == ';') {
+-		// expect parameter name
+-		tk = h.next();
+-		// tolerate trailing semicolon, even though it violates the spec
+-		if (tk.getType() == HeaderTokenizer.Token.EOF)
+-		    return;
+-		// parameter name must be a MIME Atom
+-		if (tk.getType() != HeaderTokenizer.Token.ATOM)
+-		    throw new ParseException();
+-		name = tk.getValue().toLowerCase();
++            if ((char)type == ';') {
++                // expect parameter name
++                tk = h.next();
++                // tolerate trailing semicolon, even though it violates the spec
++                if (tk.getType() == HeaderTokenizer.Token.EOF)
++                    return;
++                // parameter name must be a MIME Atom
++                if (tk.getType() != HeaderTokenizer.Token.ATOM)
++                    throw new ParseException();
++                name = tk.getValue().toLowerCase();
+ 
+-		// expect '='
+-		tk = h.next();
+-		if ((char)tk.getType() != '=')
+-		    throw new ParseException();
+-		
+-		// expect parameter value
+-		tk = h.next();
+-		type = tk.getType();
+-		// parameter value must be a MIME Atom or Quoted String
+-		if (type != HeaderTokenizer.Token.ATOM &&
+-		    type != HeaderTokenizer.Token.QUOTEDSTRING)
+-		    throw new ParseException();
+-		
+-		list.put(name, tk.getValue());
+-	    } else
+-		throw new ParseException();
+-	}
++                // expect '='
++                tk = h.next();
++                if ((char)tk.getType() != '=')
++                    throw new ParseException();
++
++                // expect parameter value
++                tk = h.next();
++                type = tk.getType();
++                // parameter value must be a MIME Atom or Quoted String
++                if (type != HeaderTokenizer.Token.ATOM &&
++                    type != HeaderTokenizer.Token.QUOTEDSTRING)
++                    throw new ParseException();
++
++                list.put(name, tk.getValue());
++            } else
++                throw new ParseException();
++        }
+     }
+ 
+     /**
+      * Return the number of parameters in this list.
+-     * 
++     *
+      * @return  number of parameters.
+      */
+     public int size() {
+-	return list.size();
++        return list.size();
+     }
+ 
+     /**
+-     * Returns the value of the specified parameter. Note that 
++     * Returns the value of the specified parameter. Note that
+      * parameter names are case-insensitive.
+      *
+-     * @param name	parameter name.
+-     * @return		Value of the parameter. Returns 
+-     *			<code>null</code> if the parameter is not 
+-     *			present.
++     * @param name      parameter name.
++     * @return          Value of the parameter. Returns
++     *                  <code>null</code> if the parameter is not
++     *                  present.
+      */
+     public String get(String name) {
+-	return (String)list.get(name.trim().toLowerCase());
++        return (String)list.get(name.trim().toLowerCase());
+     }
+ 
+     /**
+@@ -136,11 +136,11 @@
+      * Set a parameter. If this parameter already exists, it is
+      * replaced by this new value.
+      *
+-     * @param	name 	name of the parameter.
+-     * @param	value	value of the parameter.
++     * @param   name    name of the parameter.
++     * @param   value   value of the parameter.
+      */
+     public void set(String name, String value) {
+-	list.put(name.trim().toLowerCase(), value);
++        list.put(name.trim().toLowerCase(), value);
+     }
+ 
+     /**
+@@ -147,10 +147,10 @@
+      * Removes the specified parameter from this ParameterList.
+      * This method does nothing if the parameter is not present.
+      *
+-     * @param	name	name of the parameter.
++     * @param   name    name of the parameter.
+      */
+     public void remove(String name) {
+-	list.remove(name.trim().toLowerCase());
++        list.remove(name.trim().toLowerCase());
+     }
+ 
+     /**
+@@ -160,24 +160,24 @@
+      * @return Enumeration of all parameter names in this list.
+      */
+     public Iterator getNames() {
+-	return list.keySet().iterator();
++        return list.keySet().iterator();
+     }
+-    
+-    
++
++
+     /**
+      * Convert this ParameterList into a MIME String. If this is
+      * an empty list, an empty string is returned.
+      *
+-     * @return		String
++     * @return          String
+      */
+     public String toString() {
+-	return toString(0);
++        return toString(0);
+     }
+ 
+     /**
+      * Convert this ParameterList into a MIME String. If this is
+      * an empty list, an empty string is returned.
+-     *   
++     *
+      * The 'used' parameter specifies the number of character positions
+      * already taken up in the field into which the resulting parameter
+      * list is to be inserted. It's used to determine where to fold the
+@@ -187,7 +187,7 @@
+      *                  the field into which the parameter list is to
+      *                  be inserted.
+      * @return          String
+-     */  
++     */
+     public String toString(int used) {
+         StringBuffer sb = new StringBuffer();
+         Iterator itr = list.entrySet().iterator();
+@@ -203,29 +203,29 @@
+                 sb.append("\r\n\t"); // .. start new continuation line
+                 used = 8; // account for the starting <tab> char
+             }
+-	    sb.append(name).append('=');
+-	    used += name.length() + 1;
+-	    if (used + value.length() > 76) { // still overflows ...
+-		// have to fold value
+-		String s = MimeUtility.fold(used, value);
+-		sb.append(s);
+-		int lastlf = s.lastIndexOf('\n');
+-		if (lastlf >= 0)	// always true
+-		    used += s.length() - lastlf - 1;
+-		else
+-		    used += s.length();
+-	    } else {
+-		sb.append(value);
+-		used += value.length();
+-	    }
++            sb.append(name).append('=');
++            used += name.length() + 1;
++            if (used + value.length() > 76) { // still overflows ...
++                // have to fold value
++                String s = MimeUtility.fold(used, value);
++                sb.append(s);
++                int lastlf = s.lastIndexOf('\n');
++                if (lastlf >= 0)        // always true
++                    used += s.length() - lastlf - 1;
++                else
++                    used += s.length();
++            } else {
++                sb.append(value);
++                used += value.length();
++            }
+         }
+- 
++
+         return sb.toString();
+     }
+-  
++
+     // Quote a parameter value token if required.
+     private String quote(String value) {
+-	return MimeUtility.quote(value, HeaderTokenizer.MIME);
++        return MimeUtility.quote(value, HeaderTokenizer.MIME);
+     }
+ 
+     public ParameterList copy() {
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/ParseException.java	Thu Jul 30 18:06:41 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/ParseException.java	Thu Jul 30 18:06:40 2009
+@@ -33,7 +33,7 @@
+ import com.sun.xml.internal.messaging.saaj.packaging.mime.MessagingException;
+ 
+ /**
+- * The exception thrown due to an error in parsing RFC822 
++ * The exception thrown due to an error in parsing RFC822
+  * or MIME headers
+  *
+  * @author John Mani
+@@ -45,14 +45,14 @@
+      * Constructs a ParseException with no detail message.
+      */
+     public ParseException() {
+-	super();
++        super();
+     }
+ 
+     /**
+      * Constructs a ParseException with the specified detail message.
+-     * @param s		the detail message
++     * @param s         the detail message
+      */
+     public ParseException(String s) {
+-	super(s);
++        super(s);
+     }
+ }
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/SharedInputStream.java	Thu Jul 30 18:06:45 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/SharedInputStream.java	Thu Jul 30 18:06:44 2009
+@@ -52,7 +52,7 @@
+      * Return the current position in the InputStream, as an
+      * offset from the beginning of the InputStream.
+      *
+-     * @return	the current position
++     * @return  the current position
+      */
+     public long getPosition();
+ 
+@@ -64,9 +64,9 @@
+      * at the same place as this stream.  The returned InputStream
+      * will also implement the SharedInputStream interface.
+      *
+-     * @param	start	the starting position
+-     * @param	end	the ending position + 1
+-     * @return		the new stream
++     * @param   start   the starting position
++     * @param   end     the ending position + 1
++     * @return          the new stream
+      */
+     public InputStream newStream(long start, long end);
+ 
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/UniqueValue.java	Thu Jul 30 18:06:48 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/UniqueValue.java	Thu Jul 30 18:06:48 2009
+@@ -59,12 +59,12 @@
+      * and the current time (in milliseconds).
+      */
+     public static String getUniqueBoundaryValue() {
+-	StringBuffer s = new StringBuffer();
++        StringBuffer s = new StringBuffer();
+ 
+-	// Unique string is ----=_Part_<part>_<hashcode>.<currentTime>
+-	s.append("----=_Part_").append(part++).append("_").
+-	  append(s.hashCode()).append('.').
+-	  append(System.currentTimeMillis());
+-	return s.toString();
++        // Unique string is ----=_Part_<part>_<hashcode>.<currentTime>
++        s.append("----=_Part_").append(part++).append("_").
++          append(s.hashCode()).append('.').
++          append(System.currentTimeMillis());
++        return s.toString();
+     }
+ }
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/ASCIIUtility.java	Thu Jul 30 18:06:52 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/ASCIIUtility.java	Thu Jul 30 18:06:51 2009
+@@ -37,98 +37,98 @@
+ 
+     // Private constructor so that this class is not instantiated
+     private ASCIIUtility() { }
+-	
+-    	
++
++
+     /**
+-     * Convert the bytes within the specified range of the given byte 
+-     * array into a signed integer in the given radix . The range extends 
++     * Convert the bytes within the specified range of the given byte
++     * array into a signed integer in the given radix . The range extends
+      * from <code>start</code> till, but not including <code>end</code>. <p>
+      *
+      * Based on java.lang.Integer.parseInt()
+      */
+     public static int parseInt(byte[] b, int start, int end, int radix)
+-		throws NumberFormatException {
+-	if (b == null)
+-	    throw new NumberFormatException("null");
+-	
+-	int result = 0;
+-	boolean negative = false;
+-	int i = start;
+-	int limit;
+-	int multmin;
+-	int digit;
++                throws NumberFormatException {
++        if (b == null)
++            throw new NumberFormatException("null");
+ 
+-	if (end > start) {
+-	    if (b[i] == '-') {
+-		negative = true;
+-		limit = Integer.MIN_VALUE;
+-		i++;
+-	    } else {
+-		limit = -Integer.MAX_VALUE;
+-	    }
+-	    multmin = limit / radix;
+-	    if (i < end) {
+-		digit = Character.digit((char)b[i++], radix);
+-		if (digit < 0) {
+-		    throw new NumberFormatException(
+-			"illegal number: " + toString(b, start, end)
+-			);
+-		} else {
+-		    result = -digit;
+-		}
+-	    }
+-	    while (i < end) {
+-		// Accumulating negatively avoids surprises near MAX_VALUE
+-		digit = Character.digit((char)b[i++], radix);
+-		if (digit < 0) {
+-		    throw new NumberFormatException("illegal number");
+-		}
+-		if (result < multmin) {
+-		    throw new NumberFormatException("illegal number");
+-		}
+-		result *= radix;
+-		if (result < limit + digit) {
+-		    throw new NumberFormatException("illegal number");
+-		}
+-		result -= digit;
+-	    }
+-	} else {
+-	    throw new NumberFormatException("illegal number");
+-	}
+-	if (negative) {
+-	    if (i > start + 1) {
+-		return result;
+-	    } else {	/* Only got "-" */
+-		throw new NumberFormatException("illegal number");
+-	    }
+-	} else {
+-	    return -result;
+-	}
++        int result = 0;
++        boolean negative = false;
++        int i = start;
++        int limit;
++        int multmin;
++        int digit;
++
++        if (end > start) {
++            if (b[i] == '-') {
++                negative = true;
++                limit = Integer.MIN_VALUE;
++                i++;
++            } else {
++                limit = -Integer.MAX_VALUE;
++            }
++            multmin = limit / radix;
++            if (i < end) {
++                digit = Character.digit((char)b[i++], radix);
++                if (digit < 0) {
++                    throw new NumberFormatException(
++                        "illegal number: " + toString(b, start, end)
++                        );
++                } else {
++                    result = -digit;
++                }
++            }
++            while (i < end) {
++                // Accumulating negatively avoids surprises near MAX_VALUE
++                digit = Character.digit((char)b[i++], radix);
++                if (digit < 0) {
++                    throw new NumberFormatException("illegal number");
++                }
++                if (result < multmin) {
++                    throw new NumberFormatException("illegal number");
++                }
++                result *= radix;
++                if (result < limit + digit) {
++                    throw new NumberFormatException("illegal number");
++                }
++                result -= digit;
++            }
++        } else {
++            throw new NumberFormatException("illegal number");
++        }
++        if (negative) {
++            if (i > start + 1) {
++                return result;
++            } else {    /* Only got "-" */
++                throw new NumberFormatException("illegal number");
++            }
++        } else {
++            return -result;
++        }
+     }
+ 
+     /**
+-     * Convert the bytes within the specified range of the given byte 
++     * Convert the bytes within the specified range of the given byte
+      * array into a String. The range extends from <code>start</code>
+      * till, but not including <code>end</code>. <p>
+      */
+     public static String toString(byte[] b, int start, int end) {
+-	int size = end - start;
+-	char[] theChars = new char[size];
++        int size = end - start;
++        char[] theChars = new char[size];
+ 
+-	for (int i = 0, j = start; i < size; )
+-	    theChars[i++] = (char)(b[j++]&0xff);
+-	
+-	return new String(theChars);
++        for (int i = 0, j = start; i < size; )
++            theChars[i++] = (char)(b[j++]&0xff);
++
++        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;
++        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;
+     }
+ 
+     /**
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/BASE64DecoderStream.java	Thu Jul 30 18:06:55 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/BASE64DecoderStream.java	Thu Jul 30 18:06:55 2009
+@@ -37,31 +37,31 @@
+  * a FilterInputStream, so one can just wrap this class around
+  * any input stream and read bytes from this filter. The decoding
+  * is done as the bytes are read out.
+- * 
++ *
+  * @author John Mani
+  * @author Bill Shannon
+  */
+ 
+ public class BASE64DecoderStream extends FilterInputStream {
+-    private byte[] buffer; 	// cache of decoded bytes
+-    private int bufsize = 0;	// size of the cache
+-    private int index = 0;	// index into the cache
++    private byte[] buffer;      // cache of decoded bytes
++    private int bufsize = 0;    // size of the cache
++    private int index = 0;      // index into the cache
+ 
+-    /** 
++    /**
+      * Create a BASE64 decoder that decodes the specified input stream
+-     * @param in	the input stream
++     * @param in        the input stream
+      */
+     public BASE64DecoderStream(InputStream in) {
+-	super(in);
+-	buffer = new byte[3];
++        super(in);
++        buffer = new byte[3];
+     }
+ 
+     /**
+      * Read the next decoded byte from this input stream. The byte
+-     * is returned as an <code>int</code> in the range <code>0</code> 
+-     * to <code>255</code>. If no byte is available because the end of 
++     * is returned as an <code>int</code> in the range <code>0</code>
++     * to <code>255</code>. If no byte is available because the end of
+      * the stream has been reached, the value <code>-1</code> is returned.
+-     * This method blocks until input data is available, the end of the 
++     * This method blocks until input data is available, the end of the
+      * stream is detected, or an exception is thrown.
+      *
+      * @return     next byte of data, or <code>-1</code> if the end of the
+@@ -70,13 +70,13 @@
+      * @see        java.io.FilterInputStream#in
+      */
+     public int read() throws IOException {
+-	if (index >= bufsize) {
+-	    decode(); // Fills up buffer
+-	    if (bufsize == 0) // buffer is empty
+-		return -1;
+-	    index = 0; // reset index into buffer
+-	}
+-	return buffer[index++] & 0xff; // Zero off the MSB
++        if (index >= bufsize) {
++            decode(); // Fills up buffer
++            if (bufsize == 0) // buffer is empty
++                return -1;
++            index = 0; // reset index into buffer
++        }
++        return buffer[index++] & 0xff; // Zero off the MSB
+     }
+ 
+     /**
+@@ -94,17 +94,17 @@
+      * @exception  IOException  if an I/O error occurs.
+      */
+     public int read(byte[] buf, int off, int len) throws IOException {
+-	int i, c;
+-	for (i = 0; i < len; i++) {
+-	    if ((c = read()) == -1) {
+-		if (i == 0) // At end of stream, so we should
+-		    i = -1; // return -1 , NOT 0.
+-		break;
+-	    }
+-	    buf[off+i] = (byte)c;
+-	}
++        int i, c;
++        for (i = 0; i < len; i++) {
++            if ((c = read()) == -1) {
++                if (i == 0) // At end of stream, so we should
++                    i = -1; // return -1 , NOT 0.
++                break;
++            }
++            buf[off+i] = (byte)c;
++        }
+ 
+-	return i;
++        return i;
+     }
+ 
+     /**
+@@ -112,7 +112,7 @@
+      * does not support marks
+      */
+     public boolean markSupported() {
+-	return false; // Maybe later ..
++        return false; // Maybe later ..
+     }
+ 
+     /**
+@@ -120,77 +120,77 @@
+      * stream without blocking. However, this figure is only
+      * a close approximation in case the original encoded stream
+      * contains embedded CRLFs; since the CRLFs are discarded, not decoded
+-     */ 
++     */
+     public int available() throws IOException {
+-	 // This is only an estimate, since in.available()
+-	 // might include CRLFs too ..
+-	 return ((in.available() * 3)/4 + (bufsize-index));
++         // This is only an estimate, since in.available()
++         // might include CRLFs too ..
++         return ((in.available() * 3)/4 + (bufsize-index));
+     }
+ 
+     /**
+      * This character array provides the character to value map
+      * based on RFC1521.
+-     */  
++     */
+     private final static char pem_array[] = {
+-	'A','B','C','D','E','F','G','H', // 0
+-	'I','J','K','L','M','N','O','P', // 1
+-	'Q','R','S','T','U','V','W','X', // 2
+-	'Y','Z','a','b','c','d','e','f', // 3
+-	'g','h','i','j','k','l','m','n', // 4
+-	'o','p','q','r','s','t','u','v', // 5
+-	'w','x','y','z','0','1','2','3', // 6
+-	'4','5','6','7','8','9','+','/'  // 7
++        'A','B','C','D','E','F','G','H', // 0
++        'I','J','K','L','M','N','O','P', // 1
++        'Q','R','S','T','U','V','W','X', // 2
++        'Y','Z','a','b','c','d','e','f', // 3
++        'g','h','i','j','k','l','m','n', // 4
++        'o','p','q','r','s','t','u','v', // 5
++        'w','x','y','z','0','1','2','3', // 6
++        '4','5','6','7','8','9','+','/'  // 7
+     };
+ 
+     private final static byte pem_convert_array[] = new byte[256];
+ 
+     static {
+-	for (int i = 0; i < 255; i++)
+-	    pem_convert_array[i] = -1;
+-	for(int i = 0; i < pem_array.length; i++)
+-	    pem_convert_array[pem_array[i]] = (byte) i;
++        for (int i = 0; i < 255; i++)
++            pem_convert_array[i] = -1;
++        for(int i = 0; i < pem_array.length; i++)
++            pem_convert_array[pem_array[i]] = (byte) i;
+     }
+ 
+     /* The decoder algorithm */
+     private byte[] decode_buffer = new byte[4];
+     private void decode() throws IOException {
+-	bufsize = 0;
+-	/*
+-	 * We need 4 valid base64 characters before we start decoding.
+-	 * We skip anything that's not a valid base64 character (usually
+-	 * just CRLF).
+-	 */
+-	int got = 0;
+-	while (got < 4) {
+-	    int i = in.read();
+-	    if (i == -1) {
+-		if (got == 0)
+-		    return;	// EOF before any data is ok
+-		throw new IOException("Error in encoded stream, got " + got);
+-	    }
+-	    if (i >= 0 && i < 256 && i == '=' || pem_convert_array[i] != -1)
+-		decode_buffer[got++] = (byte)i;
+-	}
++        bufsize = 0;
++        /*
++         * We need 4 valid base64 characters before we start decoding.
++         * We skip anything that's not a valid base64 character (usually
++         * just CRLF).
++         */
++        int got = 0;
++        while (got < 4) {
++            int i = in.read();
++            if (i == -1) {
++                if (got == 0)
++                    return;     // EOF before any data is ok
++                throw new IOException("Error in encoded stream, got " + got);
++            }
++            if (i >= 0 && i < 256 && i == '=' || pem_convert_array[i] != -1)
++                decode_buffer[got++] = (byte)i;
++        }
+ 
+-	byte a, b;
+-	a = pem_convert_array[decode_buffer[0] & 0xff];
+-	b = pem_convert_array[decode_buffer[1] & 0xff];
+-	// The first decoded byte
+-	buffer[bufsize++] = (byte)(((a << 2) & 0xfc) | ((b >>> 4) & 3));
++        byte a, b;
++        a = pem_convert_array[decode_buffer[0] & 0xff];
++        b = pem_convert_array[decode_buffer[1] & 0xff];
++        // The first decoded byte
++        buffer[bufsize++] = (byte)(((a << 2) & 0xfc) | ((b >>> 4) & 3));
+ 
+-	if (decode_buffer[2] == '=') // End of this BASE64 encoding
+-	    return;
+-	a = b;
+-	b = pem_convert_array[decode_buffer[2] & 0xff];
+-	// The second decoded byte
+-	buffer[bufsize++] = (byte)(((a << 4) & 0xf0) | ((b >>> 2) & 0xf));
++        if (decode_buffer[2] == '=') // End of this BASE64 encoding
++            return;
++        a = b;
++        b = pem_convert_array[decode_buffer[2] & 0xff];
++        // The second decoded byte
++        buffer[bufsize++] = (byte)(((a << 4) & 0xf0) | ((b >>> 2) & 0xf));
+ 
+-	if (decode_buffer[3] == '=') // End of this BASE64 encoding
+-	    return;
+-	a = b;
+-	b = pem_convert_array[decode_buffer[3] & 0xff];
+-	// The third decoded byte
+-	buffer[bufsize++] = (byte)(((a << 6) & 0xc0) | (b & 0x3f));
++        if (decode_buffer[3] == '=') // End of this BASE64 encoding
++            return;
++        a = b;
++        b = pem_convert_array[decode_buffer[3] & 0xff];
++        // The third decoded byte
++        buffer[bufsize++] = (byte)(((a << 6) & 0xc0) | (b & 0x3f));
+     }
+ 
+     /**
+@@ -203,53 +203,53 @@
+      *       Whitespace is not ignored.
+      */
+     public static byte[] decode(byte[] inbuf) {
+-	int size = (inbuf.length / 4) * 3;
+-	if (size == 0)
+-	    return inbuf;
++        int size = (inbuf.length / 4) * 3;
++        if (size == 0)
++            return inbuf;
+ 
+-	if (inbuf[inbuf.length - 1] == '=') {
+-	    size--;
+-	    if (inbuf[inbuf.length - 2] == '=')
+-		size--;
+-	}
+-	byte[] outbuf = new byte[size];
++        if (inbuf[inbuf.length - 1] == '=') {
++            size--;
++            if (inbuf[inbuf.length - 2] == '=')
++                size--;
++        }
++        byte[] outbuf = new byte[size];
+ 
+-	int inpos = 0, outpos = 0;
+-	size = inbuf.length;
+-	while (size > 0) {
+-	    byte a, b;
+-	    a = pem_convert_array[inbuf[inpos++] & 0xff];
+-	    b = pem_convert_array[inbuf[inpos++] & 0xff];
+-	    // The first decoded byte
+-	    outbuf[outpos++] = (byte)(((a << 2) & 0xfc) | ((b >>> 4) & 3));
++        int inpos = 0, outpos = 0;
++        size = inbuf.length;
++        while (size > 0) {
++            byte a, b;
++            a = pem_convert_array[inbuf[inpos++] & 0xff];
++            b = pem_convert_array[inbuf[inpos++] & 0xff];
++            // The first decoded byte
++            outbuf[outpos++] = (byte)(((a << 2) & 0xfc) | ((b >>> 4) & 3));
+ 
+-	    if (inbuf[inpos] == '=') // End of this BASE64 encoding
+-		return outbuf;
+-	    a = b;
+-	    b = pem_convert_array[inbuf[inpos++] & 0xff];
+-	    // The second decoded byte
+-	    outbuf[outpos++] = (byte)(((a << 4) & 0xf0) | ((b >>> 2) & 0xf));
++            if (inbuf[inpos] == '=') // End of this BASE64 encoding
++                return outbuf;
++            a = b;
++            b = pem_convert_array[inbuf[inpos++] & 0xff];
++            // The second decoded byte
++            outbuf[outpos++] = (byte)(((a << 4) & 0xf0) | ((b >>> 2) & 0xf));
+ 
+-	    if (inbuf[inpos] == '=') // End of this BASE64 encoding
+-		return outbuf;
+-	    a = b;
+-	    b = pem_convert_array[inbuf[inpos++] & 0xff];
+-	    // The third decoded byte
+-	    outbuf[outpos++] = (byte)(((a << 6) & 0xc0) | (b & 0x3f));
+-	    size -= 4;
+-	}
+-	return outbuf;
++            if (inbuf[inpos] == '=') // End of this BASE64 encoding
++                return outbuf;
++            a = b;
++            b = pem_convert_array[inbuf[inpos++] & 0xff];
++            // The third decoded byte
++            outbuf[outpos++] = (byte)(((a << 6) & 0xc0) | (b & 0x3f));
++            size -= 4;
++        }
++        return outbuf;
+     }
+ 
+     /*** begin TEST program ***
+     public static void main(String argv[]) throws Exception {
+-    	FileInputStream infile = new FileInputStream(argv[0]);
+-	BASE64DecoderStream decoder = new BASE64DecoderStream(infile);
+-	int c;
++        FileInputStream infile = new FileInputStream(argv[0]);
++        BASE64DecoderStream decoder = new BASE64DecoderStream(infile);
++        int c;
+ 
+-	while ((c = decoder.read()) != -1)
+-	    System.out.print((char)c);
+-	System.out.flush();
++        while ((c = decoder.read()) != -1)
++            System.out.print((char)c);
++        System.out.flush();
+     }
+     *** end TEST program ***/
+ }
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/BASE64EncoderStream.java	Thu Jul 30 18:06:59 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/BASE64EncoderStream.java	Thu Jul 30 18:06:58 2009
+@@ -37,27 +37,27 @@
+  * a FilterOutputStream, so one can just wrap this class around
+  * any output stream and write bytes into this filter. The Encoding
+  * is done as the bytes are written out.
+- * 
++ *
+  * @author John Mani
+  * @author Bill Shannon
+  */
+ 
+ public class BASE64EncoderStream extends FilterOutputStream {
+-    private byte[] buffer; 	// cache of bytes that are yet to be encoded
+-    private int bufsize = 0;	// size of the cache
+-    private int count = 0; 	// number of bytes that have been output
+-    private int bytesPerLine;	// number of bytes per line
++    private byte[] buffer;      // cache of bytes that are yet to be encoded
++    private int bufsize = 0;    // size of the cache
++    private int count = 0;      // number of bytes that have been output
++    private int bytesPerLine;   // number of bytes per line
+ 
+     /**
+      * Create a BASE64 encoder that encodes the specified input stream
+      * @param out        the output stream
+      * @param bytesPerLine  number of bytes per line. The encoder inserts
+-     * 			 a CRLF sequence after the specified number of bytes
++     *                   a CRLF sequence after the specified number of bytes
+      */
+     public BASE64EncoderStream(OutputStream out, int bytesPerLine) {
+-	super(out);
+-	buffer = new byte[3];
+-	this.bytesPerLine = bytesPerLine;
++        super(out);
++        buffer = new byte[3];
++        this.bytesPerLine = bytesPerLine;
+     }
+ 
+     /**
+@@ -66,7 +66,7 @@
+      * @param out        the output stream
+      */
+     public BASE64EncoderStream(OutputStream out) {
+-	this(out, 76);	
++        this(out, 76);
+     }
+ 
+     /**
+@@ -80,8 +80,8 @@
+      * @exception  IOException  if an I/O error occurs.
+      */
+     public void write(byte[] b, int off, int len) throws IOException {
+-	for (int i = 0; i < len; i++)
+-	    write(b[off + i]);
++        for (int i = 0; i < len; i++)
++            write(b[off + i]);
+     }
+ 
+     /**
+@@ -90,7 +90,7 @@
+      * @exception  IOException  if an I/O error occurs.
+      */
+     public void write(byte[] b) throws IOException {
+-	write(b, 0, b.length);
++        write(b, 0, b.length);
+     }
+ 
+     /**
+@@ -99,24 +99,24 @@
+      * @exception  IOException  if an I/O error occurs.
+      */
+     public void write(int c) throws IOException {
+-	buffer[bufsize++] = (byte)c;
+-	if (bufsize == 3) { // Encoding unit = 3 bytes
+-	    encode();
+-	    bufsize = 0;
+-	}
++        buffer[bufsize++] = (byte)c;
++        if (bufsize == 3) { // Encoding unit = 3 bytes
++            encode();
++            bufsize = 0;
++        }
+     }
+ 
+     /**
+      * Flushes this output stream and forces any buffered output bytes
+-     * to be encoded out to the stream. 
++     * to be encoded out to the stream.
+      * @exception  IOException  if an I/O error occurs.
+      */
+     public void flush() throws IOException {
+-	if (bufsize > 0) { // If there's unencoded characters in the buffer ..
+-	    encode();      // .. encode them
+-	    bufsize = 0;
+-	}
+-	out.flush();
++        if (bufsize > 0) { // If there's unencoded characters in the buffer ..
++            encode();      // .. encode them
++            bufsize = 0;
++        }
++        out.flush();
+     }
+ 
+     /**
+@@ -124,60 +124,60 @@
+      * and closes this output stream
+      */
+     public void close() throws IOException {
+-	flush();
+-	out.close();
++        flush();
++        out.close();
+     }
+ 
+     /** This array maps the characters to their 6 bit values */
+     private final static char pem_array[] = {
+-	'A','B','C','D','E','F','G','H', // 0
+-	'I','J','K','L','M','N','O','P', // 1
+-	'Q','R','S','T','U','V','W','X', // 2
+-	'Y','Z','a','b','c','d','e','f', // 3
+-	'g','h','i','j','k','l','m','n', // 4
+-	'o','p','q','r','s','t','u','v', // 5
+-	'w','x','y','z','0','1','2','3', // 6
+-	'4','5','6','7','8','9','+','/'  // 7
++        'A','B','C','D','E','F','G','H', // 0
++        'I','J','K','L','M','N','O','P', // 1
++        'Q','R','S','T','U','V','W','X', // 2
++        'Y','Z','a','b','c','d','e','f', // 3
++        'g','h','i','j','k','l','m','n', // 4
++        'o','p','q','r','s','t','u','v', // 5
++        'w','x','y','z','0','1','2','3', // 6
++        '4','5','6','7','8','9','+','/'  // 7
+     };
+ 
+     private void encode() throws IOException {
+-	// If writing out this encoded unit will cause overflow,
+-	// start a new line.
+-	if (count + 4 > bytesPerLine) {
+-	    out.write('\r');
+-	    out.write('\n');
+-	    count = 0;
+-	}
++        // If writing out this encoded unit will cause overflow,
++        // start a new line.
++        if (count + 4 > bytesPerLine) {
++            out.write('\r');
++            out.write('\n');
++            count = 0;
++        }
+ 
+-	byte a, b, c;
+-	if (bufsize == 1) {
+-	    a = buffer[0];
+-	    b = 0;
+-	    c = 0;
+-	    out.write(pem_array[(a >>> 2) & 0x3F]);
+-	    out.write(pem_array[((a << 4) & 0x30) + ((b >>> 4) & 0xf)]);
+-	    out.write('='); // pad character
+-	    out.write('='); // pad character
+-	} else if (bufsize == 2) {
+-	    a = buffer[0];
+-	    b = buffer[1];
+-	    c = 0;
+-	    out.write(pem_array[(a >>> 2) & 0x3F]);
+-	    out.write(pem_array[((a << 4) & 0x30) + ((b >>> 4) & 0xf)]);
+-	    out.write(pem_array[((b << 2) & 0x3c) + ((c >>> 6) & 0x3)]);
+-	    out.write('='); // pad character
+-	} else {
+-	    a = buffer[0];
+-	    b = buffer[1];
+-	    c = buffer[2];
+-	    out.write(pem_array[(a >>> 2) & 0x3F]);
+-	    out.write(pem_array[((a << 4) & 0x30) + ((b >>> 4) & 0xf)]);
+-	    out.write(pem_array[((b << 2) & 0x3c) + ((c >>> 6) & 0x3)]);
+-	    out.write(pem_array[c & 0x3F]);
++        byte a, b, c;
++        if (bufsize == 1) {
++            a = buffer[0];
++            b = 0;
++            c = 0;
++            out.write(pem_array[(a >>> 2) & 0x3F]);
++            out.write(pem_array[((a << 4) & 0x30) + ((b >>> 4) & 0xf)]);
++            out.write('='); // pad character
++            out.write('='); // pad character
++        } else if (bufsize == 2) {
++            a = buffer[0];
++            b = buffer[1];
++            c = 0;
++            out.write(pem_array[(a >>> 2) & 0x3F]);
++            out.write(pem_array[((a << 4) & 0x30) + ((b >>> 4) & 0xf)]);
++            out.write(pem_array[((b << 2) & 0x3c) + ((c >>> 6) & 0x3)]);
++            out.write('='); // pad character
++        } else {
++            a = buffer[0];
++            b = buffer[1];
++            c = buffer[2];
++            out.write(pem_array[(a >>> 2) & 0x3F]);
++            out.write(pem_array[((a << 4) & 0x30) + ((b >>> 4) & 0xf)]);
++            out.write(pem_array[((b << 2) & 0x3c) + ((c >>> 6) & 0x3)]);
++            out.write(pem_array[c & 0x3F]);
+         }
+ 
+-	// increment count
+-	count += 4;
++        // increment count
++        count += 4;
+     }
+ 
+     /**
+@@ -187,57 +187,57 @@
+      * entire content of a MIME part.
+      */
+     public static byte[] encode(byte[] inbuf) {
+-	if (inbuf.length == 0)
+-	    return inbuf;
+-	byte[] outbuf = new byte[((inbuf.length + 2) / 3) * 4];
+-	int inpos = 0, outpos = 0;
+-	int size = inbuf.length;
+-	while (size > 0) {
+-	    byte a, b, c;
+-	    if (size == 1) {
+-		a = inbuf[inpos++];
+-		b = 0;
+-		c = 0;
+-		outbuf[outpos++] = (byte)pem_array[(a >>> 2) & 0x3F];
+-		outbuf[outpos++] =
+-			(byte)pem_array[((a << 4) & 0x30) + ((b >>> 4) & 0xf)];
+-		outbuf[outpos++] = (byte)'=';  // pad character
+-		outbuf[outpos++] = (byte)'=';  // pad character
+-	    } else if (size == 2) {
+-		a = inbuf[inpos++];
+-		b = inbuf[inpos++];
+-		c = 0;
+-		outbuf[outpos++] = (byte)pem_array[(a >>> 2) & 0x3F];
+-		outbuf[outpos++] =
+-			(byte)pem_array[((a << 4) & 0x30) + ((b >>> 4) & 0xf)];
+-		outbuf[outpos++] =
+-			(byte)pem_array[((b << 2) & 0x3c) + ((c >>> 6) & 0x3)];
+-		outbuf[outpos++] = (byte)'=';  // pad character
+-	    } else {
+-		a = inbuf[inpos++];
+-		b = inbuf[inpos++];
+-		c = inbuf[inpos++];
+-		outbuf[outpos++] = (byte)pem_array[(a >>> 2) & 0x3F];
+-		outbuf[outpos++] =
+-			(byte)pem_array[((a << 4) & 0x30) + ((b >>> 4) & 0xf)];
+-		outbuf[outpos++] =
+-			(byte)pem_array[((b << 2) & 0x3c) + ((c >>> 6) & 0x3)];
+-		outbuf[outpos++] = (byte)pem_array[c & 0x3F];
+-	    }
+-	    size -= 3;
+-	}
+-	return outbuf;
++        if (inbuf.length == 0)
++            return inbuf;
++        byte[] outbuf = new byte[((inbuf.length + 2) / 3) * 4];
++        int inpos = 0, outpos = 0;
++        int size = inbuf.length;
++        while (size > 0) {
++            byte a, b, c;
++            if (size == 1) {
++                a = inbuf[inpos++];
++                b = 0;
++                c = 0;
++                outbuf[outpos++] = (byte)pem_array[(a >>> 2) & 0x3F];
++                outbuf[outpos++] =
++                        (byte)pem_array[((a << 4) & 0x30) + ((b >>> 4) & 0xf)];
++                outbuf[outpos++] = (byte)'=';  // pad character
++                outbuf[outpos++] = (byte)'=';  // pad character
++            } else if (size == 2) {
++                a = inbuf[inpos++];
++                b = inbuf[inpos++];
++                c = 0;
++                outbuf[outpos++] = (byte)pem_array[(a >>> 2) & 0x3F];
++                outbuf[outpos++] =
++                        (byte)pem_array[((a << 4) & 0x30) + ((b >>> 4) & 0xf)];
++                outbuf[outpos++] =
++                        (byte)pem_array[((b << 2) & 0x3c) + ((c >>> 6) & 0x3)];
++                outbuf[outpos++] = (byte)'=';  // pad character
++            } else {
++                a = inbuf[inpos++];
++                b = inbuf[inpos++];
++                c = inbuf[inpos++];
++                outbuf[outpos++] = (byte)pem_array[(a >>> 2) & 0x3F];
++                outbuf[outpos++] =
++                        (byte)pem_array[((a << 4) & 0x30) + ((b >>> 4) & 0xf)];
++                outbuf[outpos++] =
++                        (byte)pem_array[((b << 2) & 0x3c) + ((c >>> 6) & 0x3)];
++                outbuf[outpos++] = (byte)pem_array[c & 0x3F];
++            }
++            size -= 3;
++        }
++        return outbuf;
+     }
+ 
+     /*** begin TEST program
+     public static void main(String argv[]) throws Exception {
+-	FileInputStream infile = new FileInputStream(argv[0]);
+-	BASE64EncoderStream encoder = new BASE64EncoderStream(System.out);
+-	int c;
++        FileInputStream infile = new FileInputStream(argv[0]);
++        BASE64EncoderStream encoder = new BASE64EncoderStream(System.out);
++        int c;
+ 
+-	while ((c = infile.read()) != -1)
+-	    encoder.write(c);
+-	encoder.close();
++        while ((c = infile.read()) != -1)
++            encoder.write(c);
++        encoder.close();
+     }
+     *** end TEST program **/
+ }
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/BEncoderStream.java	Thu Jul 30 18:07:03 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/BEncoderStream.java	Thu Jul 30 18:07:02 2009
+@@ -36,7 +36,7 @@
+  * This class implements a 'B' Encoder as defined by RFC2047 for
+  * encoding MIME headers. It subclasses the BASE64EncoderStream
+  * class.
+- * 
++ *
+  * @author John Mani
+  */
+ 
+@@ -47,9 +47,9 @@
+      * @param out        the output stream
+      */
+     public BEncoderStream(OutputStream out) {
+-	super(out, Integer.MAX_VALUE); // MAX_VALUE is 2^31, should
+-				       // suffice (!) to indicate that
+-				       // CRLFs should not be inserted
++        super(out, Integer.MAX_VALUE); // MAX_VALUE is 2^31, should
++                                       // suffice (!) to indicate that
++                                       // CRLFs should not be inserted
+     }
+ 
+     /**
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/LineInputStream.java	Thu Jul 30 18:07:06 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/LineInputStream.java	Thu Jul 30 18:07:06 2009
+@@ -35,13 +35,13 @@
+ /**
+  * This class is to support reading CRLF terminated lines that
+  * contain only US-ASCII characters from an input stream. Provides
+- * functionality that is similar to the deprecated 
++ * functionality that is similar to the deprecated
+  * <code>DataInputStream.readLine()</code>. Expected use is to read
+  * lines as String objects from a RFC822 stream.
+  *
+- * It is implemented as a FilterInputStream, so one can just wrap 
++ * It is implemented as a FilterInputStream, so one can just wrap
+  * this class around any input stream and read bytes from this filter.
+- * 
++ *
+  * @author John Mani
+  */
+ 
+@@ -50,62 +50,62 @@
+     private char[] lineBuffer = null; // reusable byte buffer
+ 
+     public LineInputStream(InputStream in) {
+-	super(in);
++        super(in);
+     }
+ 
+     /**
+-     * Read a line containing only ASCII characters from the input 
++     * Read a line containing only ASCII characters from the input
+      * stream. A line is terminated by a CR or NL or CR-NL sequence.
+      * A common error is a CR-CR-NL sequence, which will also terminate
+      * a line.
+-     * The line terminator is not returned as part of the returned 
++     * The line terminator is not returned as part of the returned
+      * String. Returns null if no data is available. <p>
+      *
+-     * This class is similar to the deprecated 
++     * This class is similar to the deprecated
+      * <code>DataInputStream.readLine()</code>
+      */
+     public String readLine() throws IOException {
+-	InputStream in = this.in;
+-	char[] buf = lineBuffer;
++        InputStream in = this.in;
++        char[] buf = lineBuffer;
+ 
+-	if (buf == null)
+-	    buf = lineBuffer = new char[128];
++        if (buf == null)
++            buf = lineBuffer = new char[128];
+ 
+-	int c1;
+-	int room = buf.length;
+-	int offset = 0;
++        int c1;
++        int room = buf.length;
++        int offset = 0;
+ 
+-	while ((c1 = in.read()) != -1) {
+-	    if (c1 == '\n') // Got NL, outa here.
+-		break;
+-	    else if (c1 == '\r') {
+-		// Got CR, is the next char NL ?
+-		int c2 = in.read();
+-		if (c2 == '\r')		// discard extraneous CR
+-		    c2 = in.read();
+-		if (c2 != '\n') {
+-		    // If not NL, push it back
+-		    if (!(in instanceof PushbackInputStream))
+-			in = this.in = new PushbackInputStream(in);
+-		    ((PushbackInputStream)in).unread(c2);
+-		}
+-		break; // outa here.
+-	    }
++        while ((c1 = in.read()) != -1) {
++            if (c1 == '\n') // Got NL, outa here.
++                break;
++            else if (c1 == '\r') {
++                // Got CR, is the next char NL ?
++                int c2 = in.read();
++                if (c2 == '\r')         // discard extraneous CR
++                    c2 = in.read();
++                if (c2 != '\n') {
++                    // If not NL, push it back
++                    if (!(in instanceof PushbackInputStream))
++                        in = this.in = new PushbackInputStream(in);
++                    ((PushbackInputStream)in).unread(c2);
++                }
++                break; // outa here.
++            }
+ 
+-	    // Not CR, NL or CR-NL ...
+-	    // .. Insert the byte into our byte buffer
+-	    if (--room < 0) { // No room, need to grow.
+-		buf = new char[offset + 128];
+-		room = buf.length - offset - 1;
+-		System.arraycopy(lineBuffer, 0, buf, 0, offset);
+-		lineBuffer = buf;
+-	    }
+-	    buf[offset++] = (char)c1;
+-	}
++            // Not CR, NL or CR-NL ...
++            // .. Insert the byte into our byte buffer
++            if (--room < 0) { // No room, need to grow.
++                buf = new char[offset + 128];
++                room = buf.length - offset - 1;
++                System.arraycopy(lineBuffer, 0, buf, 0, offset);
++                lineBuffer = buf;
++            }
++            buf[offset++] = (char)c1;
++        }
+ 
+-	if ((c1 == -1) && (offset == 0))
+-	    return null;
+-	
+-	return String.copyValueOf(buf, 0, offset);
++        if ((c1 == -1) && (offset == 0))
++            return null;
++
++        return String.copyValueOf(buf, 0, offset);
+     }
+ }
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/QDecoderStream.java	Thu Jul 30 18:07:10 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/QDecoderStream.java	Thu Jul 30 18:07:09 2009
+@@ -36,7 +36,7 @@
+ /**
+  * This class implements a Q Decoder as defined in RFC 2047
+  * for decoding MIME headers. It subclasses the QPDecoderStream class.
+- * 
++ *
+  * @author John Mani
+  */
+ 
+@@ -47,7 +47,7 @@
+      * @param in        the input stream
+      */
+     public QDecoderStream(InputStream in) {
+-	super(in);
++        super(in);
+     }
+ 
+     /**
+@@ -63,21 +63,21 @@
+      * @exception  IOException  if an I/O error occurs.
+      */
+     public int read() throws IOException {
+-	int c = in.read();
++        int c = in.read();
+ 
+-	if (c == '_') // Return '_' as ' '
+-	    return ' ';
+-	else if (c == '=') {
+-	    // QP Encoded atom. Get the next two bytes ..
+-	    ba[0] = (byte)in.read();
+-	    ba[1] = (byte)in.read();
+-	    // .. and decode them
+-	    try {
+-		return ASCIIUtility.parseInt(ba, 0, 2, 16);
+-	    } catch (NumberFormatException nex) {
+-		throw new IOException("Error in QP stream " + nex.getMessage());
+-	    }
+-	} else
+-	    return c;
++        if (c == '_') // Return '_' as ' '
++            return ' ';
++        else if (c == '=') {
++            // QP Encoded atom. Get the next two bytes ..
++            ba[0] = (byte)in.read();
++            ba[1] = (byte)in.read();
++            // .. and decode them
++            try {
++                return ASCIIUtility.parseInt(ba, 0, 2, 16);
++            } catch (NumberFormatException nex) {
++                throw new IOException("Error in QP stream " + nex.getMessage());
++            }
++        } else
++            return c;
+     }
+ }
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/QEncoderStream.java	Thu Jul 30 18:07:14 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/QEncoderStream.java	Thu Jul 30 18:07:13 2009
+@@ -34,9 +34,9 @@
+ import java.io.OutputStream;
+ 
+ /**
+- * This class implements a Q Encoder as defined by RFC 2047 for 
++ * This class implements a Q Encoder as defined by RFC 2047 for
+  * encoding MIME headers. It subclasses the QPEncoderStream class.
+- * 
++ *
+  * @author John Mani
+  */
+ 
+@@ -50,17 +50,17 @@
+      * Create a Q encoder that encodes the specified input stream
+      * @param out        the output stream
+      * @param encodingWord true if we are Q-encoding a word within a
+-     *			phrase.
++     *                  phrase.
+      */
+     public QEncoderStream(OutputStream out, boolean encodingWord) {
+-	super(out, Integer.MAX_VALUE); // MAX_VALUE is 2^31, should
+-				       // suffice (!) to indicate that
+-				       // CRLFs should not be inserted
+-				       // when encoding rfc822 headers
++        super(out, Integer.MAX_VALUE); // MAX_VALUE is 2^31, should
++                                       // suffice (!) to indicate that
++                                       // CRLFs should not be inserted
++                                       // when encoding rfc822 headers
+ 
+-	// a RFC822 "word" token has more restrictions than a
+-	// RFC822 "text" token.
+-	specials = encodingWord ? WORD_SPECIALS : TEXT_SPECIALS;
++        // a RFC822 "word" token has more restrictions than a
++        // RFC822 "text" token.
++        specials = encodingWord ? WORD_SPECIALS : TEXT_SPECIALS;
+     }
+ 
+     /**
+@@ -69,14 +69,14 @@
+      * @exception  IOException  if an I/O error occurs.
+      */
+     public void write(int c) throws IOException {
+-	c = c & 0xff; // Turn off the MSB.
+-	if (c == ' ')
+-	    output('_', false);
+-	else if (c < 040 || c >= 0177 || specials.indexOf(c) >= 0)
+-	    // Encoding required. 
+-	    output(c, true);
+-	else // No encoding required
+-	    output(c, false);
++        c = c & 0xff; // Turn off the MSB.
++        if (c == ' ')
++            output('_', false);
++        else if (c < 040 || c >= 0177 || specials.indexOf(c) >= 0)
++            // Encoding required.
++            output(c, true);
++        else // No encoding required
++            output(c, false);
+     }
+ 
+     /**
+@@ -83,17 +83,17 @@
+      * Returns the length of the encoded version of this byte array.
+      */
+     public static int encodedLength(byte[] b, boolean encodingWord) {
+-	int len = 0;
+-	String specials = encodingWord ? WORD_SPECIALS: TEXT_SPECIALS;
+-	for (int i = 0; i < b.length; i++) {
+-	    int c = b[i] & 0xff; // Mask off MSB
+-	    if (c < 040 || c >= 0177 || specials.indexOf(c) >= 0)
+-		// needs encoding
+-		len += 3; // Q-encoding is 1 -> 3 conversion
+-	    else
+-		len++;
+-	}
+-	return len;
++        int len = 0;
++        String specials = encodingWord ? WORD_SPECIALS: TEXT_SPECIALS;
++        for (int i = 0; i < b.length; i++) {
++            int c = b[i] & 0xff; // Mask off MSB
++            if (c < 040 || c >= 0177 || specials.indexOf(c) >= 0)
++                // needs encoding
++                len += 3; // Q-encoding is 1 -> 3 conversion
++            else
++                len++;
++        }
++        return len;
+     }
+ 
+     /**** begin TEST program ***
+@@ -101,7 +101,7 @@
+         FileInputStream infile = new FileInputStream(argv[0]);
+         QEncoderStream encoder = new QEncoderStream(System.out);
+         int c;
+- 
++
+         while ((c = infile.read()) != -1)
+             encoder.write(c);
+         encoder.close();
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/QPDecoderStream.java	Thu Jul 30 18:07:17 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/QPDecoderStream.java	Thu Jul 30 18:07:17 2009
+@@ -37,7 +37,7 @@
+  * a FilterInputStream, so one can just wrap this class around
+  * any input stream and read bytes from this filter. The decoding
+  * is done as the bytes are read out.
+- * 
++ *
+  * @author John Mani
+  */
+ 
+@@ -46,12 +46,12 @@
+     protected int spaces = 0;
+ 
+     /**
+-     * Create a Quoted Printable decoder that decodes the specified 
++     * Create a Quoted Printable decoder that decodes the specified
+      * input stream.
+      * @param in        the input stream
+      */
+     public QPDecoderStream(InputStream in) {
+-	super(new PushbackInputStream(in, 2)); // pushback of size=2
++        super(new PushbackInputStream(in, 2)); // pushback of size=2
+     }
+ 
+     /**
+@@ -67,72 +67,72 @@
+      * @exception  IOException  if an I/O error occurs.
+      */
+     public int read() throws IOException {
+-	if (spaces > 0) {
+-	    // We have cached space characters, return one
+-	    spaces--;
+-	    return ' ';
+-	}
+-	
+-	int c = in.read();
++        if (spaces > 0) {
++            // We have cached space characters, return one
++            spaces--;
++            return ' ';
++        }
+ 
+-	if (c == ' ') { 
+-	    // Got space, keep reading till we get a non-space char
+-	    while ((c = in.read()) == ' ')
+-		spaces++;
++        int c = in.read();
+ 
+-	    if (c == '\r' || c == '\n' || c == -1)
+-		// If the non-space char is CR/LF/EOF, the spaces we got
+-	    	// so far is junk introduced during transport. Junk 'em.
+-		spaces = 0;
+-    	    else {
+-		// The non-space char is NOT CR/LF, the spaces are valid.
+-		((PushbackInputStream)in).unread(c);
+-		c = ' ';
+-	    }
+-	    return c; // return either <SPACE> or <CR/LF>
+-	}
+-	else if (c == '=') {
+-	    // QP Encoded atom. Decode the next two bytes
+-	    int a = in.read();
++        if (c == ' ') {
++            // Got space, keep reading till we get a non-space char
++            while ((c = in.read()) == ' ')
++                spaces++;
+ 
+-	    if (a == '\n') {
+-		/* Hmm ... not really confirming QP encoding, but lets
+-		 * allow this as a LF terminated encoded line .. and
+-		 * consider this a soft linebreak and recurse to fetch 
+-		 * the next char.
+-		 */
+-		return read();
+-	    } else if (a == '\r') {
+-		// Expecting LF. This forms a soft linebreak to be ignored.
+-		int b = in.read();
+-		if (b != '\n') 
+-		    /* Not really confirming QP encoding, but
+-		     * lets allow this as well.
+-		     */
+-		    ((PushbackInputStream)in).unread(b);
+-		return read();
+-	    } else if (a == -1) {
+-	   	// Not valid QP encoding, but we be nice and tolerant here !
+-		return -1;
+-	    } else {
+-		ba[0] = (byte)a;
+-		ba[1] = (byte)in.read();
+-		try {
+-		    return ASCIIUtility.parseInt(ba, 0, 2, 16);
+-		} catch (NumberFormatException nex) {
+-		    /*
+-		    System.err.println(
+-		     	"Illegal characters in QP encoded stream: " + 
+-		     	ASCIIUtility.toString(ba, 0, 2)
+-		    );
+-		    */
++            if (c == '\r' || c == '\n' || c == -1)
++                // If the non-space char is CR/LF/EOF, the spaces we got
++                // so far is junk introduced during transport. Junk 'em.
++                spaces = 0;
++            else {
++                // The non-space char is NOT CR/LF, the spaces are valid.
++                ((PushbackInputStream)in).unread(c);
++                c = ' ';
++            }
++            return c; // return either <SPACE> or <CR/LF>
++        }
++        else if (c == '=') {
++            // QP Encoded atom. Decode the next two bytes
++            int a = in.read();
+ 
+-		    ((PushbackInputStream)in).unread(ba);
+-		    return c;
+-		}
+-	    }
+-	}
+-	return c;
++            if (a == '\n') {
++                /* Hmm ... not really confirming QP encoding, but lets
++                 * allow this as a LF terminated encoded line .. and
++                 * consider this a soft linebreak and recurse to fetch
++                 * the next char.
++                 */
++                return read();
++            } else if (a == '\r') {
++                // Expecting LF. This forms a soft linebreak to be ignored.
++                int b = in.read();
++                if (b != '\n')
++                    /* Not really confirming QP encoding, but
++                     * lets allow this as well.
++                     */
++                    ((PushbackInputStream)in).unread(b);
++                return read();
++            } else if (a == -1) {
++                // Not valid QP encoding, but we be nice and tolerant here !
++                return -1;
++            } else {
++                ba[0] = (byte)a;
++                ba[1] = (byte)in.read();
++                try {
++                    return ASCIIUtility.parseInt(ba, 0, 2, 16);
++                } catch (NumberFormatException nex) {
++                    /*
++                    System.err.println(
++                        "Illegal characters in QP encoded stream: " +
++                        ASCIIUtility.toString(ba, 0, 2)
++                    );
++                    */
++
++                    ((PushbackInputStream)in).unread(ba);
++                    return c;
++                }
++            }
++        }
++        return c;
+     }
+ 
+     /**
+@@ -150,15 +150,15 @@
+      * @exception  IOException  if an I/O error occurs.
+      */
+     public int read(byte[] buf, int off, int len) throws IOException {
+-	int i, c;
+-	for (i = 0; i < len; i++) {
+-	    if ((c = read()) == -1) {
+-		if (i == 0) // At end of stream, so we should
+-		    i = -1; // return -1 , NOT 0.
+-		break;
+-	    }
+-	    buf[off+i] = (byte)c;
+-	}
++        int i, c;
++        for (i = 0; i < len; i++) {
++            if ((c = read()) == -1) {
++                if (i == 0) // At end of stream, so we should
++                    i = -1; // return -1 , NOT 0.
++                break;
++            }
++            buf[off+i] = (byte)c;
++        }
+         return i;
+     }
+ 
+@@ -167,7 +167,7 @@
+      * does not support marks
+      */
+     public boolean markSupported() {
+-	return false;
++        return false;
+     }
+ 
+     /**
+@@ -178,9 +178,9 @@
+      * of the original input stream.
+      */
+     public int available() throws IOException {
+-	// This is bogus ! We don't really know how much
+-	// bytes are available *after* decoding
+-	return in.available();
++        // This is bogus ! We don't really know how much
++        // bytes are available *after* decoding
++        return in.available();
+     }
+ 
+     /**** begin TEST program
+@@ -188,7 +188,7 @@
+         FileInputStream infile = new FileInputStream(argv[0]);
+         QPDecoderStream decoder = new QPDecoderStream(infile);
+         int c;
+- 
++
+         while ((c = decoder.read()) != -1)
+             System.out.print((char)c);
+         System.out.println();
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/QPEncoderStream.java	Thu Jul 30 18:07:21 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/QPEncoderStream.java	Thu Jul 30 18:07:20 2009
+@@ -37,13 +37,13 @@
+  * a FilterOutputStream, so one can just wrap this class around
+  * any output stream and write bytes into this filter. The Encoding
+  * is done as the bytes are written out.
+- * 
++ *
+  * @author John Mani
+  */
+ 
+ public class QPEncoderStream extends FilterOutputStream {
+-    private int count = 0; 	// number of bytes that have been output
+-    private int bytesPerLine;	// number of bytes per line
++    private int count = 0;      // number of bytes that have been output
++    private int bytesPerLine;   // number of bytes per line
+     private boolean gotSpace = false;
+     private boolean gotCR = false;
+ 
+@@ -55,10 +55,10 @@
+      *                   of bytes.
+      */
+     public QPEncoderStream(OutputStream out, int bytesPerLine) {
+-	super(out);
+-	// Subtract 1 to account for the '=' in the soft-return 
+-	// at the end of a line
+-	this.bytesPerLine = bytesPerLine - 1;
++        super(out);
++        // Subtract 1 to account for the '=' in the soft-return
++        // at the end of a line
++        this.bytesPerLine = bytesPerLine - 1;
+     }
+ 
+     /**
+@@ -67,7 +67,7 @@
+      * @param out        the output stream
+      */
+     public QPEncoderStream(OutputStream out) {
+-	this(out, 76);	
++        this(out, 76);
+     }
+ 
+     /**
+@@ -81,8 +81,8 @@
+      * @exception  IOException  if an I/O error occurs.
+      */
+     public void write(byte[] b, int off, int len) throws IOException {
+-	for (int i = 0; i < len; i++)
+-	    write(b[off + i]);
++        for (int i = 0; i < len; i++)
++            write(b[off + i]);
+     }
+ 
+     /**
+@@ -91,7 +91,7 @@
+      * @exception  IOException  if an I/O error occurs.
+      */
+     public void write(byte[] b) throws IOException {
+-	write(b, 0, b.length);
++        write(b, 0, b.length);
+     }
+ 
+     /**
+@@ -100,37 +100,37 @@
+      * @exception  IOException  if an I/O error occurs.
+      */
+     public void write(int c) throws IOException {
+-	c = c & 0xff; // Turn off the MSB.
+-	if (gotSpace) { // previous character was <SPACE>
+-	    if (c == '\r' || c == '\n')
+-		// if CR/LF, we need to encode the <SPACE> char
+-		output(' ', true);
+-	    else // no encoding required, just output the char
+-		output(' ', false);
+-	    gotSpace = false;
+-	}
++        c = c & 0xff; // Turn off the MSB.
++        if (gotSpace) { // previous character was <SPACE>
++            if (c == '\r' || c == '\n')
++                // if CR/LF, we need to encode the <SPACE> char
++                output(' ', true);
++            else // no encoding required, just output the char
++                output(' ', false);
++            gotSpace = false;
++        }
+ 
+-	if (c == '\r') {
+-	    gotCR = true;
+-	    outputCRLF();
+-	} else {
+-	    if (c == '\n') {
+-		if (gotCR) 
+-		    // This is a CRLF sequence, we already output the 
+-		    // corresponding CRLF when we got the CR, so ignore this
+-		    ;
+-		else
+-		    outputCRLF();
+-	    } else if (c == ' ') {
+-		gotSpace = true;
+-	    } else if (c < 040 || c >= 0177 || c == '=')
+-		// Encoding required. 
+-		output(c, true);
+-	    else // No encoding required
+-		output(c, false);
+-	    // whatever it was, it wasn't a CR
+-	    gotCR = false;
+-	}
++        if (c == '\r') {
++            gotCR = true;
++            outputCRLF();
++        } else {
++            if (c == '\n') {
++                if (gotCR)
++                    // This is a CRLF sequence, we already output the
++                    // corresponding CRLF when we got the CR, so ignore this
++                    ;
++                else
++                    outputCRLF();
++            } else if (c == ' ') {
++                gotSpace = true;
++            } else if (c < 040 || c >= 0177 || c == '=')
++                // Encoding required.
++                output(c, true);
++            else // No encoding required
++                output(c, false);
++            // whatever it was, it wasn't a CR
++            gotCR = false;
++        }
+     }
+ 
+     /**
+@@ -139,7 +139,7 @@
+      * @exception  IOException  if an I/O error occurs.
+      */
+     public void flush() throws IOException {
+-	out.flush();
++        out.flush();
+     }
+ 
+     /**
+@@ -147,41 +147,41 @@
+      * and closes this output stream
+      */
+     public void close() throws IOException {
+-	out.close();
++        out.close();
+     }
+ 
+     private void outputCRLF() throws IOException {
+-	out.write('\r');
+-	out.write('\n');
+-	count = 0;
++        out.write('\r');
++        out.write('\n');
++        count = 0;
+     }
+ 
+     // The encoding table
+     private final static char hex[] = {
+-	'0','1', '2', '3', '4', '5', '6', '7',
+-	'8','9', 'A', 'B', 'C', 'D', 'E', 'F'
++        '0','1', '2', '3', '4', '5', '6', '7',
++        '8','9', 'A', 'B', 'C', 'D', 'E', 'F'
+     };
+ 
+     protected void output(int c, boolean encode) throws IOException {
+-	if (encode) {
+-	    if ((count += 3) > bytesPerLine) {
+-		out.write('=');
+-	    	out.write('\r');
+-	    	out.write('\n');
+-		count = 3; // set the next line's length
+-	    }
+-	    out.write('=');
+-	    out.write(hex[c >> 4]);
+-	    out.write(hex[c & 0xf]);
+-	} else {
+-	    if (++count > bytesPerLine) {
+-		out.write('=');
+-	    	out.write('\r');
+-	    	out.write('\n');
+-		count = 1; // set the next line's length
+-	    }
+-	    out.write(c);
+-	}
++        if (encode) {
++            if ((count += 3) > bytesPerLine) {
++                out.write('=');
++                out.write('\r');
++                out.write('\n');
++                count = 3; // set the next line's length
++            }
++            out.write('=');
++            out.write(hex[c >> 4]);
++            out.write(hex[c & 0xf]);
++        } else {
++            if (++count > bytesPerLine) {
++                out.write('=');
++                out.write('\r');
++                out.write('\n');
++                count = 1; // set the next line's length
++            }
++            out.write(c);
++        }
+     }
+ 
+     /**** begin TEST program ***
+@@ -189,7 +189,7 @@
+         FileInputStream infile = new FileInputStream(argv[0]);
+         QPEncoderStream encoder = new QPEncoderStream(System.out);
+         int c;
+- 
++
+         while ((c = infile.read()) != -1)
+             encoder.write(c);
+         encoder.close();
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/UUDecoderStream.java	Thu Jul 30 18:07:24 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/UUDecoderStream.java	Thu Jul 30 18:07:24 2009
+@@ -37,7 +37,7 @@
+  * a FilterInputStream, so one can just wrap this class around
+  * any input stream and read bytes from this filter. The decoding
+  * is done as the bytes are read out.
+- * 
++ *
+  * @author John Mani
+  * @author Bill Shannon
+  */
+@@ -46,9 +46,9 @@
+     private String name;
+     private int mode;
+ 
+-    private byte[] buffer; 	// cache of decoded bytes
+-    private int bufsize = 0;	// size of the cache
+-    private int index = 0;	// index into the cache
++    private byte[] buffer;      // cache of decoded bytes
++    private int bufsize = 0;    // size of the cache
++    private int index = 0;      // index into the cache
+     private boolean gotPrefix = false;
+     private boolean gotEnd = false;
+     private LineInputStream lin;
+@@ -58,9 +58,9 @@
+      * @param in        the input stream
+      */
+     public UUDecoderStream(InputStream in) {
+-	super(in);
+-	lin = new LineInputStream(in);
+-	buffer = new byte[45]; // max decoded chars in a line = 45
++        super(in);
++        lin = new LineInputStream(in);
++        buffer = new byte[45]; // max decoded chars in a line = 45
+     }
+ 
+     /**
+@@ -71,7 +71,7 @@
+      * This method blocks until input data is available, the end of the
+      * stream is detected, or an exception is thrown.
+      *
+-     * @return     next byte of data, or <code>-1</code> if the end of 
++     * @return     next byte of data, or <code>-1</code> if the end of
+      *             stream is reached.
+      * @exception  IOException  if an I/O error occurs.
+      * @see        java.io.FilterInputStream#in
+@@ -78,36 +78,36 @@
+      */
+ 
+     public int read() throws IOException {
+-	if (index >= bufsize) {
+-	    readPrefix();
+-	    if (!decode())
+-		return -1;
+-	    index = 0; // reset index into buffer
+-	}
+-	return buffer[index++] & 0xff; // return lower byte
++        if (index >= bufsize) {
++            readPrefix();
++            if (!decode())
++                return -1;
++            index = 0; // reset index into buffer
++        }
++        return buffer[index++] & 0xff; // return lower byte
+     }
+ 
+     public int read(byte[] buf, int off, int len) throws IOException {
+-	int i, c;
+-	for (i = 0; i < len; i++) {
+-	    if ((c = read()) == -1) {
+-		if (i == 0) // At end of stream, so we should
+-		    i = -1; // return -1, NOT 0.
+-		break;
+-	    }
+-	    buf[off+i] = (byte)c;
+-	}
+-	return i;
++        int i, c;
++        for (i = 0; i < len; i++) {
++            if ((c = read()) == -1) {
++                if (i == 0) // At end of stream, so we should
++                    i = -1; // return -1, NOT 0.
++                break;
++            }
++            buf[off+i] = (byte)c;
++        }
++        return i;
+     }
+ 
+     public boolean markSupported() {
+-	return false;
++        return false;
+     }
+ 
+     public int available() throws IOException {
+-	 // This is only an estimate, since in.available()
+-	 // might include CRLFs too ..
+-	 return ((in.available() * 3)/4 + (bufsize-index));
++         // This is only an estimate, since in.available()
++         // might include CRLFs too ..
++         return ((in.available() * 3)/4 + (bufsize-index));
+     }
+ 
+     /**
+@@ -118,8 +118,8 @@
+      * @exception  IOException  if an I/O error occurs.
+      */
+     public String getName() throws IOException {
+-	readPrefix();
+-	return name;
++        readPrefix();
++        return name;
+     }
+ 
+     /**
+@@ -130,8 +130,8 @@
+      * @exception  IOException  if an I/O error occurs.
+      */
+     public int getMode() throws IOException {
+-	readPrefix();
+-	return mode;
++        readPrefix();
++        return mode;
+     }
+ 
+     /**
+@@ -140,117 +140,117 @@
+      * Search for this prefix and gobble it up.
+      */
+     private void readPrefix() throws IOException {
+-	if (gotPrefix) // got the prefix
+-	    return;
++        if (gotPrefix) // got the prefix
++            return;
+ 
+-	String s;
+-	for (;;) {
+-	    // read till we get the prefix: "begin MODE FILENAME"
+-	    s = lin.readLine(); // NOTE: readLine consumes CRLF pairs too
+-	    if (s == null)
+-		throw new IOException("UUDecoder error: No Begin");
+-	    if (s.regionMatches(true, 0, "begin", 0, 5)) {
+-		try {
+-		    mode = Integer.parseInt(s.substring(6,9));
+-		} catch (NumberFormatException ex) {
+-		    throw new IOException("UUDecoder error: " + ex.toString());
+-		}
+-		name = s.substring(10);
+-		gotPrefix = true;
+-		return;
+-	    }
+-	}
++        String s;
++        for (;;) {
++            // read till we get the prefix: "begin MODE FILENAME"
++            s = lin.readLine(); // NOTE: readLine consumes CRLF pairs too
++            if (s == null)
++                throw new IOException("UUDecoder error: No Begin");
++            if (s.regionMatches(true, 0, "begin", 0, 5)) {
++                try {
++                    mode = Integer.parseInt(s.substring(6,9));
++                } catch (NumberFormatException ex) {
++                    throw new IOException("UUDecoder error: " + ex.toString());
++                }
++                name = s.substring(10);
++                gotPrefix = true;
++                return;
++            }
++        }
+     }
+ 
+     private boolean decode() throws IOException {
+ 
+-	if (gotEnd)
+-	    return false;
+-	bufsize = 0;
+-	String line;
+-	do {
+-	    line = lin.readLine();
++        if (gotEnd)
++            return false;
++        bufsize = 0;
++        String line;
++        do {
++            line = lin.readLine();
+ 
+-	    /*
+-	     * Improperly encoded data sometimes omits the zero length
+-	     * line that starts with a space character, we detect the
+-	     * following "end" line here.
+-	     */
+-	    if (line == null)
+-		throw new IOException("Missing End");
+-	    if (line.regionMatches(true, 0, "end", 0, 3)) {
+-		gotEnd = true;
+-		return false;
+-	    }
+-	} while (line.length() == 0);
+-	int count = line.charAt(0);
+-	if (count < ' ')
+-	    throw new IOException("Buffer format error");
++            /*
++             * Improperly encoded data sometimes omits the zero length
++             * line that starts with a space character, we detect the
++             * following "end" line here.
++             */
++            if (line == null)
++                throw new IOException("Missing End");
++            if (line.regionMatches(true, 0, "end", 0, 3)) {
++                gotEnd = true;
++                return false;
++            }
++        } while (line.length() == 0);
++        int count = line.charAt(0);
++        if (count < ' ')
++            throw new IOException("Buffer format error");
+ 
+-	/*
+-	 * The first character in a line is the number of original (not
+-	 *  the encoded atoms) characters in the line. Note that all the
+-	 *  code below has to handle the <SPACE> character that indicates
+-	 *  end of encoded stream.
+-	 */
+-	count = (count - ' ') & 0x3f;
++        /*
++         * The first character in a line is the number of original (not
++         *  the encoded atoms) characters in the line. Note that all the
++         *  code below has to handle the <SPACE> character that indicates
++         *  end of encoded stream.
++         */
++        count = (count - ' ') & 0x3f;
+ 
+-	if (count == 0) {
+-	    line = lin.readLine();
+-	    if (line == null || !line.regionMatches(true, 0, "end", 0, 3))
+-		throw new IOException("Missing End");
+-	    gotEnd = true;
+-	    return false;
+-	}
++        if (count == 0) {
++            line = lin.readLine();
++            if (line == null || !line.regionMatches(true, 0, "end", 0, 3))
++                throw new IOException("Missing End");
++            gotEnd = true;
++            return false;
++        }
+ 
+-	int need = ((count * 8)+5)/6;
++        int need = ((count * 8)+5)/6;
+ //System.out.println("count " + count + ", need " + need + ", len " + line.length());
+-	if (line.length() < need + 1)
+-	    throw new IOException("Short buffer error");
+-	    
+-	int i = 1;
+-	byte a, b;
+-	/*
+-	 * A correct uuencoder always encodes 3 characters at a time, even
+-	 * if there aren't 3 characters left.  But since some people out
+-	 * there have broken uuencoders we handle the case where they
+-	 * don't include these "unnecessary" characters.
+-	 */
+-	while (bufsize < count) {
+-	    // continue decoding until we get 'count' decoded chars
+-	    a = (byte)((line.charAt(i++) - ' ') & 0x3f);
+-	    b = (byte)((line.charAt(i++) - ' ') & 0x3f);
+-	    buffer[bufsize++] = (byte)(((a << 2) & 0xfc) | ((b >>> 4) & 3));
++        if (line.length() < need + 1)
++            throw new IOException("Short buffer error");
+ 
+-	    if (bufsize < count) {
+-		a = b;
+-		b = (byte)((line.charAt(i++) - ' ') & 0x3f);
+-		buffer[bufsize++] =
+-				(byte)(((a << 4) & 0xf0) | ((b >>> 2) & 0xf));
+-	    }
++        int i = 1;
++        byte a, b;
++        /*
++         * A correct uuencoder always encodes 3 characters at a time, even
++         * if there aren't 3 characters left.  But since some people out
++         * there have broken uuencoders we handle the case where they
++         * don't include these "unnecessary" characters.
++         */
++        while (bufsize < count) {
++            // continue decoding until we get 'count' decoded chars
++            a = (byte)((line.charAt(i++) - ' ') & 0x3f);
++            b = (byte)((line.charAt(i++) - ' ') & 0x3f);
++            buffer[bufsize++] = (byte)(((a << 2) & 0xfc) | ((b >>> 4) & 3));
+ 
+-	    if (bufsize < count) {
+-		a = b;
+-		b = (byte)((line.charAt(i++) - ' ') & 0x3f);
+-		buffer[bufsize++] = (byte)(((a << 6) & 0xc0) | (b & 0x3f));
+-	    }
+-	}
+-	return true;
++            if (bufsize < count) {
++                a = b;
++                b = (byte)((line.charAt(i++) - ' ') & 0x3f);
++                buffer[bufsize++] =
++                                (byte)(((a << 4) & 0xf0) | ((b >>> 2) & 0xf));
++            }
++
++            if (bufsize < count) {
++                a = b;
++                b = (byte)((line.charAt(i++) - ' ') & 0x3f);
++                buffer[bufsize++] = (byte)(((a << 6) & 0xc0) | (b & 0x3f));
++            }
++        }
++        return true;
+     }
+ 
+     /*** begin TEST program *****
+     public static void main(String argv[]) throws Exception {
+-    	FileInputStream infile = new FileInputStream(argv[0]);
+-	UUDecoderStream decoder = new UUDecoderStream(infile);
+-	int c;
++        FileInputStream infile = new FileInputStream(argv[0]);
++        UUDecoderStream decoder = new UUDecoderStream(infile);
++        int c;
+ 
+-	try {
+-	    while ((c = decoder.read()) != -1)
+-		System.out.write(c);
+-	    System.out.flush();
+-	} catch (Exception e) {
+-	    e.printStackTrace();
+-	}
++        try {
++            while ((c = decoder.read()) != -1)
++                System.out.write(c);
++            System.out.flush();
++        } catch (Exception e) {
++            e.printStackTrace();
++        }
+     }
+     **** end TEST program ****/
+ }
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/UUEncoderStream.java	Thu Jul 30 18:07:28 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/UUEncoderStream.java	Thu Jul 30 18:07:27 2009
+@@ -37,17 +37,17 @@
+  * a FilterOutputStream, so one can just wrap this class around
+  * any output stream and write bytes into this filter. The Encoding
+  * is done as the bytes are written out.
+- * 
++ *
+  * @author John Mani
+  */
+ 
+ public class UUEncoderStream extends FilterOutputStream {
+-    private byte[] buffer; 	// cache of bytes that are yet to be encoded
+-    private int bufsize = 0;	// size of the cache
++    private byte[] buffer;      // cache of bytes that are yet to be encoded
++    private int bufsize = 0;    // size of the cache
+     private boolean wrotePrefix = false;
+ 
+-    protected String name; 	// name of file
+-    protected int mode;		// permissions mode
++    protected String name;      // name of file
++    protected int mode;         // permissions mode
+ 
+     /**
+      * Create a UUencoder that encodes the specified input stream
+@@ -54,16 +54,16 @@
+      * @param out        the output stream
+      */
+     public UUEncoderStream(OutputStream out) {
+-	this(out, "encoder.buf", 644);
++        this(out, "encoder.buf", 644);
+     }
+ 
+     /**
+      * Create a UUencoder that encodes the specified input stream
+      * @param out        the output stream
+-     * @param name	 Specifies a name for the encoded buffer
++     * @param name       Specifies a name for the encoded buffer
+      */
+     public UUEncoderStream(OutputStream out, String name) {
+-	this(out, name, 644);	
++        this(out, name, 644);
+     }
+ 
+     /**
+@@ -70,13 +70,13 @@
+      * Create a UUencoder that encodes the specified input stream
+      * @param out        the output stream
+      * @param name       Specifies a name for the encoded buffer
+-     * @param mode	 Specifies permission mode for the encoded buffer
++     * @param mode       Specifies permission mode for the encoded buffer
+      */
+     public UUEncoderStream(OutputStream out, String name, int mode) {
+-	super(out);
+-	this.name = name;
+-	this.mode = mode;
+-	buffer = new byte[45];
++        super(out);
++        this.name = name;
++        this.mode = mode;
++        buffer = new byte[45];
+     }
+ 
+     /**
+@@ -85,44 +85,44 @@
+      * you start writing into the output stream
+      */
+     public void setNameMode(String name, int mode) {
+-	this.name = name;
+-	this.mode = mode;
++        this.name = name;
++        this.mode = mode;
+     }
+ 
+     public void write(byte[] b, int off, int len) throws IOException {
+-	for (int i = 0; i < len; i++)
+-	    write(b[off + i]);
++        for (int i = 0; i < len; i++)
++            write(b[off + i]);
+     }
+ 
+     public void write(byte[] data) throws IOException {
+-	write(data, 0, data.length);
++        write(data, 0, data.length);
+     }
+ 
+     public void write(int c) throws IOException {
+-	/* buffer up characters till we get a line's worth, then encode
+-	 * and write them out. Max number of characters allowed per 
+-	 * line is 45.
+-	 */
+-	buffer[bufsize++] = (byte)c;
+-	if (bufsize == 45) {
+-	    writePrefix();
+-	    encode();
+-	    bufsize = 0;
+-	}
++        /* buffer up characters till we get a line's worth, then encode
++         * and write them out. Max number of characters allowed per
++         * line is 45.
++         */
++        buffer[bufsize++] = (byte)c;
++        if (bufsize == 45) {
++            writePrefix();
++            encode();
++            bufsize = 0;
++        }
+     }
+ 
+     public void flush() throws IOException {
+-	if (bufsize > 0) { // If there's unencoded characters in the buffer
+-	    writePrefix();
+-	    encode();      // .. encode them
+-	}
+-	writeSuffix();
+-	out.flush();
++        if (bufsize > 0) { // If there's unencoded characters in the buffer
++            writePrefix();
++            encode();      // .. encode them
++        }
++        writeSuffix();
++        out.flush();
+     }
+ 
+     public void close() throws IOException {
+-	flush();
+-	out.close();
++        flush();
++        out.close();
+     }
+ 
+     /**
+@@ -129,12 +129,12 @@
+      * Write out the prefix: "begin <mode> <name>"
+      */
+     private void writePrefix() throws IOException {
+-	if (!wrotePrefix) {
+-	    PrintStream ps = new PrintStream(out);
+-	    ps.println("begin " + mode + " " + name);
+-	    ps.flush();
+-	    wrotePrefix = true;
+-	}
++        if (!wrotePrefix) {
++            PrintStream ps = new PrintStream(out);
++            ps.println("begin " + mode + " " + name);
++            ps.flush();
++            wrotePrefix = true;
++        }
+     }
+ 
+     /**
+@@ -142,64 +142,64 @@
+      * containing the single word "end" (terminated by a newline)
+      */
+     private void writeSuffix() throws IOException {
+-	PrintStream ps = new PrintStream(out);
+-	ps.println(" \nend");
+-	ps.flush();
++        PrintStream ps = new PrintStream(out);
++        ps.println(" \nend");
++        ps.flush();
+     }
+ 
+     /**
+-     * Encode a line. 
++     * Encode a line.
+      * Start off with the character count, followed by the encoded atoms
+      * and terminate with LF. (or is it CRLF or the local line-terminator ?)
+      * Take three bytes and encodes them into 4 characters
+-     * If bufsize if not a multiple of 3, the remaining bytes are filled 
+-     * with '1'. This insures that the last line won't end in spaces 
++     * If bufsize if not a multiple of 3, the remaining bytes are filled
++     * with '1'. This insures that the last line won't end in spaces
+      * and potentiallly be truncated.
+      */
+     private void encode() throws IOException {
+-	byte a, b, c;
+-	int c1, c2, c3, c4;
+-	int i = 0;
++        byte a, b, c;
++        int c1, c2, c3, c4;
++        int i = 0;
+ 
+-	// Start off with the count of characters in the line
+-	out.write((bufsize & 0x3f) + ' ');
++        // Start off with the count of characters in the line
++        out.write((bufsize & 0x3f) + ' ');
+ 
+-	while (i < bufsize) {
+-	    a = buffer[i++];
+-	    if (i < bufsize) {
+-		b = buffer[i++];
+-		if (i < bufsize)
+-		    c = buffer[i++];
+-		else // default c to 1
+-		    c = 1;
+-	    }
+-	    else { // default b & c to 1
+-		b = 1;
+-		c = 1;
+-	    }
++        while (i < bufsize) {
++            a = buffer[i++];
++            if (i < bufsize) {
++                b = buffer[i++];
++                if (i < bufsize)
++                    c = buffer[i++];
++                else // default c to 1
++                    c = 1;
++            }
++            else { // default b & c to 1
++                b = 1;
++                c = 1;
++            }
+ 
+-	    c1 = (a >>> 2) & 0x3f;
+-	    c2 = ((a << 4) & 0x30) | ((b >>> 4) & 0xf);
+-	    c3 = ((b << 2) & 0x3c) | ((c >>> 6) & 0x3);
+-	    c4 = c & 0x3f;
+-	    out.write(c1 + ' ');
+-	    out.write(c2 + ' ');
+-	    out.write(c3 + ' ');
+-	    out.write(c4 + ' ');
+-	}
+-	// Terminate with LF. (should it be CRLF or local line-terminator ?)
+-	out.write('\n');
++            c1 = (a >>> 2) & 0x3f;
++            c2 = ((a << 4) & 0x30) | ((b >>> 4) & 0xf);
++            c3 = ((b << 2) & 0x3c) | ((c >>> 6) & 0x3);
++            c4 = c & 0x3f;
++            out.write(c1 + ' ');
++            out.write(c2 + ' ');
++            out.write(c3 + ' ');
++            out.write(c4 + ' ');
++        }
++        // Terminate with LF. (should it be CRLF or local line-terminator ?)
++        out.write('\n');
+     }
+ 
+     /**** begin TEST program *****
+     public static void main(String argv[]) throws Exception {
+-	FileInputStream infile = new FileInputStream(argv[0]);
+-	UUEncoderStream encoder = new UUEncoderStream(System.out);
+-	int c;
++        FileInputStream infile = new FileInputStream(argv[0]);
++        UUEncoderStream encoder = new UUEncoderStream(System.out);
++        int c;
+ 
+-	while ((c = infile.read()) != -1)
+-	    encoder.write(c);
+-	encoder.close();
++        while ((c = infile.read()) != -1)
++            encoder.write(c);
++        encoder.close();
+     }
+     **** end TEST program *****/
+ }
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/AttachmentPartImpl.java	Thu Jul 30 18:07:32 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/AttachmentPartImpl.java	Thu Jul 30 18:07:31 2009
+@@ -22,11 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * $Id: AttachmentPartImpl.java,v 1.1.1.1.2.1 2007/11/27 07:19:29 kumarjayanti Exp $
+- * $Revision: 1.1.1.1.2.1 $
+- * $Date: 2007/11/27 07:19:29 $
+- */
+ 
+ 
+ package com.sun.xml.internal.messaging.saaj.soap;
+@@ -92,7 +87,7 @@
+                     "application/fastinfoset"
+                         + hndlrStr
+                         + "com.sun.xml.internal.messaging.saaj.soap.FastInfosetDataContentHandler");
+-		/* Image DataContentHandler handles all image types
++                /* Image DataContentHandler handles all image types
+                 mailMap.addMailcap(
+                     "image/jpeg"
+                         + hndlrStr
+@@ -100,7 +95,7 @@
+                 mailMap.addMailcap(
+                     "image/gif"
+                         + hndlrStr
+-                        + "com.sun.xml.internal.messaging.saaj.soap.GifDataContentHandler");*/
++                        + "com.sun.xml.internal.messaging.saaj.soap.GifDataContentHandler"); */
+                 /*mailMap.addMailcap(
+                     "multipart/*"
+                         + hndlrStr
+@@ -142,7 +137,7 @@
+ 
+         if ((rawContent == null) && (dataHandler == null))
+             return 0;
+- 
++
+         if (rawContent != null) {
+             try {
+                 return rawContent.getSize();
+@@ -167,7 +162,7 @@
+             bytes = bout.getBytes();
+             if (bytes != null)
+                 return bytes.length;
+-        } 
++        }
+         return -1;
+     }
+ 
+@@ -220,7 +215,7 @@
+         this.dataHandler = dataHandler;
+         rawContent = null;
+ 
+-        log.log( 
++        log.log(
+             Level.FINE,
+             "SAAJ0580.soap.set.Content-Type",
+             new String[] { dataHandler.getContentType()});
+@@ -288,7 +283,7 @@
+             if (rawContent != null) {
+                 copyMimeHeaders(headers, rawContent);
+                 return rawContent;
+-            } 
++            }
+ 
+             MimeBodyPart envelope = new MimeBodyPart();
+ 
+@@ -336,8 +331,8 @@
+                 ex);
+         }
+     }
+- 
+-    public  void setBase64Content(InputStream content, String contentType) 
++
++    public  void setBase64Content(InputStream content, String contentType)
+         throws SOAPException {
+         dataHandler = null;
+         try {
+@@ -345,7 +340,7 @@
+             InternetHeaders hdrs = new InternetHeaders();
+             hdrs.setHeader("Content-Type", contentType);
+             //TODO: reading the entire attachment here is ineffcient. Somehow the MimeBodyPart
+-            // Ctor with inputStream causes problems based on the InputStream 
++            // Ctor with inputStream causes problems based on the InputStream
+             // has markSupported()==true
+             ByteOutputStream bos = new ByteOutputStream();
+             bos.write(decoded);
+@@ -354,7 +349,7 @@
+         } catch (Exception e) {
+             log.log(Level.SEVERE, "SAAJ0578.soap.attachment.setbase64content.exception", e);
+             throw new SOAPExceptionImpl(e.getLocalizedMessage());
+-        } 
++        }
+     }
+ 
+     public  InputStream getBase64Content() throws SOAPException {
+@@ -378,7 +373,7 @@
+             throw new SOAPExceptionImpl("No data handler/content associated with this attachment");
+         }
+ 
+-        //TODO: Write a BASE64EncoderInputStream instead, 
++        //TODO: Write a BASE64EncoderInputStream instead,
+         // this code below is inefficient
+         // where we are trying to read the whole attachment first
+         int len;
+@@ -387,7 +382,7 @@
+         if (stream != null) {
+             try {
+                 ByteArrayOutputStream bos = new ByteArrayOutputStream(size);
+-                //TODO: try and optimize this on the same lines as 
++                //TODO: try and optimize this on the same lines as
+                 // ByteOutputStream : to eliminate the temp buffer here
+                 OutputStream ret = MimeUtility.encode(bos, "base64");
+                 buf = new byte[size];
+@@ -395,7 +390,7 @@
+                     ret.write(buf, 0, len);
+                 }
+                 ret.flush();
+-                buf = bos.toByteArray(); 
++                buf = bos.toByteArray();
+                 return new ByteArrayInputStream(buf);
+             } catch (Exception e) {
+                 // throw new SOAPException
+@@ -409,7 +404,7 @@
+         }
+     }
+ 
+-    public void setRawContent(InputStream content, String contentType) 
++    public void setRawContent(InputStream content, String contentType)
+         throws SOAPException {
+         dataHandler = null;
+         try {
+@@ -416,7 +411,7 @@
+             InternetHeaders hdrs = new InternetHeaders();
+             hdrs.setHeader("Content-Type", contentType);
+             //TODO: reading the entire attachment here is ineffcient. Somehow the MimeBodyPart
+-            // Ctor with inputStream causes problems based on whether the InputStream has 
++            // Ctor with inputStream causes problems based on whether the InputStream has
+             // markSupported()==true or false
+             ByteOutputStream bos = new ByteOutputStream();
+             bos.write(content);
+@@ -429,7 +424,7 @@
+     }
+ 
+    /*
+-    public void setRawContentBytes(byte[] content, String contentType) 
++    public void setRawContentBytes(byte[] content, String contentType)
+         throws SOAPException {
+         if (content == null) {
+             throw new SOAPExceptionImpl("Null content passed to setRawContentBytes");
+@@ -447,7 +442,7 @@
+     } */
+ 
+     public void setRawContentBytes(
+-        byte[] content, int off, int len, String contentType) 
++        byte[] content, int off, int len, String contentType)
+         throws SOAPException {
+         if (content == null) {
+             throw new SOAPExceptionImpl("Null content passed to setRawContentBytes");
+@@ -459,7 +454,7 @@
+             rawContent = new MimeBodyPart(hdrs, content, off, len);
+             setMimeHeader("Content-Type", contentType);
+         } catch (Exception e) {
+-            log.log(Level.SEVERE, 
++            log.log(Level.SEVERE,
+                 "SAAJ0576.soap.attachment.setrawcontent.exception", e);
+             throw new SOAPExceptionImpl(e.getLocalizedMessage());
+         }
+@@ -477,7 +472,7 @@
+             try {
+                 return dataHandler.getInputStream();
+             } catch (IOException e) {
+-                log.severe("SAAJ0574.soap.attachment.datahandler.ioexception"); 
++                log.severe("SAAJ0574.soap.attachment.datahandler.ioexception");
+                 throw new SOAPExceptionImpl("DataHandler error" + e);
+             }
+         } else {
+@@ -502,7 +497,7 @@
+                 ret = dataHandler.getInputStream();
+                 return ASCIIUtility.getBytes(ret);
+             } catch (IOException e) {
+-                log.severe("SAAJ0574.soap.attachment.datahandler.ioexception"); 
++                log.severe("SAAJ0574.soap.attachment.datahandler.ioexception");
+                 throw new SOAPExceptionImpl("DataHandler error" + e);
+             }
+         } else {
+@@ -521,4 +516,3 @@
+     }
+ 
+ }
+-
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/Envelope.java	Thu Jul 30 18:07:35 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/Envelope.java	Thu Jul 30 18:07:35 2009
+@@ -22,11 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * $Id: Envelope.java,v 1.8 2006/01/27 12:49:26 vj135062 Exp $
+- * $Revision: 1.8 $
+- * $Date: 2006/01/27 12:49:26 $
+- */
+ 
+ 
+ package com.sun.xml.internal.messaging.saaj.soap;
+@@ -53,7 +48,7 @@
+      * Output the content.
+      */
+     void output(OutputStream out) throws IOException;
+-    
++
+     /**
+      * Output the content.
+      */
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/EnvelopeFactory.java	Thu Jul 30 18:07:39 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/EnvelopeFactory.java	Thu Jul 30 18:07:38 2009
+@@ -22,11 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * 
+- * 
+- * 
+- */
+ 
+ 
+ package com.sun.xml.internal.messaging.saaj.soap;
+@@ -54,15 +49,15 @@
+  * underlying implementations.
+  */
+ public class EnvelopeFactory {
+-    
++
+     protected static final Logger
+         log = Logger.getLogger(LogDomainConstants.SOAP_DOMAIN,
+         "com.sun.xml.internal.messaging.saaj.soap.LocalStrings");
+-    
++
+     private static ParserPool parserPool = new ParserPool(5);
+-        
++
+     public static Envelope createEnvelope(Source src, SOAPPartImpl soapPart)
+-        throws SOAPException 
++        throws SOAPException
+     {
+         // Insert SAX filter to disallow Document Type Declarations since
+         // they are not legal in SOAP
+@@ -85,6 +80,9 @@
+                     e);
+             }
+             InputSource is = SAXSource.sourceToInputSource(src);
++            if (is.getEncoding()== null && soapPart.getSourceCharsetEncoding() != null) {
++                is.setEncoding(soapPart.getSourceCharsetEncoding());
++            }
+             XMLReader rejectFilter;
+             try {
+                 rejectFilter = new RejectDoctypeSaxFilter(saxParser);
+@@ -96,13 +94,13 @@
+             }
+             src = new SAXSource(rejectFilter, is);
+         }
+-        
++
+         try {
+             Transformer transformer =
+                 EfficientStreamingTransformer.newTransformer();
+             DOMResult result = new DOMResult(soapPart);
+             transformer.transform(src, result);
+-            
++
+             Envelope env = (Envelope) soapPart.getEnvelope();
+             if (saxParser != null) {
+                 parserPool.put(saxParser);
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/FastInfosetDataContentHandler.java	Thu Jul 30 18:07:42 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/FastInfosetDataContentHandler.java	Thu Jul 30 18:07:42 2009
+@@ -22,11 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * $Id: FastInfosetDataContentHandler.java,v 1.1.1.1 2006/01/27 13:10:56 kumarjayanti Exp $
+- * $Revision: 1.1.1.1 $
+- * $Date: 2006/01/27 13:10:56 $
+- */
+ 
+ 
+ package com.sun.xml.internal.messaging.saaj.soap;
+@@ -59,7 +54,7 @@
+     public DataFlavor[] getTransferDataFlavors() { // throws Exception;
+         DataFlavor flavors[] = new DataFlavor[1];
+         flavors[0] = new ActivationDataFlavor(
+-                FastInfosetReflection.getFastInfosetSource_class(), 
++                FastInfosetReflection.getFastInfosetSource_class(),
+                 "application/fastinfoset", "Fast Infoset");
+         return flavors;
+     }
+@@ -71,7 +66,7 @@
+      * @return The constructed Object.
+      */
+     public Object getTransferData(DataFlavor flavor, DataSource dataSource)
+-        throws IOException 
++        throws IOException
+     {
+         if (flavor.getMimeType().startsWith("application/fastinfoset")) {
+             try {
+@@ -103,22 +98,22 @@
+      *  which one to support)
+      */
+     public void writeTo(Object obj, String mimeType, OutputStream os)
+-        throws IOException 
++        throws IOException
+     {
+         if (!mimeType.equals("application/fastinfoset")) {
+-            throw new IOException("Invalid content type \"" + mimeType 
++            throw new IOException("Invalid content type \"" + mimeType
+                 + "\" for FastInfosetDCH");
+         }
+-        
+-        try {            
++
++        try {
+             InputStream is = FastInfosetReflection.FastInfosetSource_getInputStream(
+                 (Source) obj);
+-            
+-	    int n; byte[] buffer = new byte[4096];
++
++            int n; byte[] buffer = new byte[4096];
+             while ((n = is.read(buffer)) != -1) {
+                 os.write(buffer, 0, n);
+             }
+-        } 
++        }
+         catch (Exception ex) {
+             throw new IOException(
+                 "Error copying FI source to output stream " + ex.getMessage());
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/GifDataContentHandler.java	Thu Jul 30 18:07:46 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/GifDataContentHandler.java	Thu Jul 30 18:07:45 2009
+@@ -22,11 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * $Id: GifDataContentHandler.java,v 1.2.2.1 2007/11/27 07:19:29 kumarjayanti Exp $
+- * $Revision: 1.2.2.1 $
+- * $Date: 2007/11/27 07:19:29 $
+- */
+ 
+ 
+ package com.sun.xml.internal.messaging.saaj.soap;
+@@ -34,6 +29,7 @@
+ import java.awt.datatransfer.DataFlavor;
+ import java.io.*;
+ import java.awt.*;
++
+ import javax.activation.*;
+ 
+ /**
+@@ -79,26 +75,26 @@
+     }
+ 
+     public Object getContent(DataSource ds) throws IOException {
+-	InputStream is = ds.getInputStream();
+-	int pos = 0;
+-	int count;
+-	byte buf[] = new byte[1024];
++        InputStream is = ds.getInputStream();
++        int pos = 0;
++        int count;
++        byte buf[] = new byte[1024];
+ 
+-	while ((count = is.read(buf, pos, buf.length - pos)) != -1) {
+-	    pos += count;
+-	    if (pos >= buf.length) {
+-		int size = buf.length;
+-		if (size < 256*1024)
+-		    size += size;
+-		else
+-		    size += 256*1024;
+-		byte tbuf[] = new byte[size];
+-		System.arraycopy(buf, 0, tbuf, 0, pos);
+-		buf = tbuf;
+-	    }
+-	}
+-	Toolkit tk = Toolkit.getDefaultToolkit();
+-	return tk.createImage(buf, 0, pos);
++        while ((count = is.read(buf, pos, buf.length - pos)) != -1) {
++            pos += count;
++            if (pos >= buf.length) {
++                int size = buf.length;
++                if (size < 256*1024)
++                    size += size;
++                else
++                    size += 256*1024;
++                byte tbuf[] = new byte[size];
++                System.arraycopy(buf, 0, tbuf, 0, pos);
++                buf = tbuf;
++            }
++        }
++        Toolkit tk = Toolkit.getDefaultToolkit();
++        return tk.createImage(buf, 0, pos);
+     }
+ 
+     /**
+@@ -105,14 +101,14 @@
+      * Write the object to the output stream, using the specified MIME type.
+      */
+     public void writeTo(Object obj, String type, OutputStream os)
+-			throws IOException {
+-	if (obj != null && !(obj instanceof Image))
+-	    throw new IOException("\"" + getDF().getMimeType() +
+-		"\" DataContentHandler requires Image object, " +
+-		"was given object of type " + obj.getClass().toString());
++                        throws IOException {
++        if (obj != null && !(obj instanceof Image))
++            throw new IOException("\"" + getDF().getMimeType() +
++                "\" DataContentHandler requires Image object, " +
++                "was given object of type " + obj.getClass().toString());
+ 
+-	throw new IOException(getDF().getMimeType() + " encoding not supported");
++        throw new IOException(getDF().getMimeType() + " encoding not supported");
+     }
+-    
+ 
++
+ }
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ImageDataContentHandler.java	Thu Jul 30 18:07:49 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ImageDataContentHandler.java	Thu Jul 30 18:07:49 2009
+@@ -22,11 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * $Id: ImageDataContentHandler.java,v 1.1.1.1.2.1 2007/11/27 07:19:28 kumarjayanti Exp $
+- * $Revision: 1.1.1.1.2.1 $
+- * $Date: 2007/11/27 07:19:28 $
+- */
+ 
+ 
+ package com.sun.xml.internal.messaging.saaj.soap;
+@@ -52,7 +47,7 @@
+     protected static final Logger log =
+         Logger.getLogger(LogDomainConstants.SOAP_DOMAIN,
+                          "com.sun.xml.internal.messaging.saaj.soap.LocalStrings");
+-    
++
+     private DataFlavor[] flavor;
+ 
+     public ImageDataContentHandler() {
+@@ -72,7 +67,7 @@
+      *
+      * @return The DataFlavors.
+      */
+-    public DataFlavor[] getTransferDataFlavors() { 
++    public DataFlavor[] getTransferDataFlavors() {
+         return flavor;
+     }
+ 
+@@ -128,7 +123,7 @@
+                 bufImage = render((Image)obj);
+             } else {
+                 log.log(Level.SEVERE,
+-                    "SAAJ0520.soap.invalid.obj.type", 
++                    "SAAJ0520.soap.invalid.obj.type",
+                     new String[] { obj.getClass().toString() });
+                 throw new IOException(
+                     "ImageDataContentHandler requires Image object, "
+@@ -145,7 +140,7 @@
+                 stream = ImageIO.createImageOutputStream(os);
+                 writer.setOutput(stream);
+                 writer.write(bufImage);
+-		writer.dispose();
++                writer.dispose();
+                 stream.close();
+             } else {
+                 log.log(Level.SEVERE, "SAAJ0526.soap.unsupported.mime.type",
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/JpegDataContentHandler.java	Thu Jul 30 18:07:53 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/JpegDataContentHandler.java	Thu Jul 30 18:07:52 2009
+@@ -22,11 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * $Id: JpegDataContentHandler.java,v 1.1.1.1.2.1 2007/11/27 07:19:29 kumarjayanti Exp $
+- * $Revision: 1.1.1.1.2.1 $
+- * $Date: 2007/11/27 07:19:29 $
+- */
+ 
+ 
+ package com.sun.xml.internal.messaging.saaj.soap;
+@@ -86,10 +81,10 @@
+             if (df.getRepresentationClass().getName().equals(STR_SRC)) {
+                 InputStream inputStream = null;
+                 BufferedImage jpegLoadImage = null;
+-                
++
+                 try {
+                     inputStream = ds.getInputStream();
+-                    jpegLoadImage = ImageIO.read(inputStream); 
++                    jpegLoadImage = ImageIO.read(inputStream);
+ 
+                 } catch (Exception e) {
+                     System.out.println(e);
+@@ -146,8 +141,8 @@
+                 tracker.addImage(img, 0);
+                 tracker.waitForAll();
+                 if (tracker.isErrorAny()) {
+-			throw new IOException("Error while loading image");
+-		}
++                        throw new IOException("Error while loading image");
++                }
+                 bufImage =
+                     new BufferedImage(
+                         img.getWidth(null),
+@@ -157,7 +152,6 @@
+                 Graphics g = bufImage.createGraphics();
+                 g.drawImage(img, 0, 0, null);
+             }
+-
+             ImageIO.write(bufImage, "jpeg", os);
+ 
+         } catch (Exception ex) {
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/LocalStrings.properties	Thu Jul 30 18:07:56 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/LocalStrings.properties	Thu Jul 30 18:07:56 2009
+@@ -105,4 +105,3 @@
+ 
+ # Info messages
+ SAAJ0580.soap.set.Content-Type=SAAJ0580: Content-Type set to {0}
+- 
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/MessageFactoryImpl.java	Thu Jul 30 18:08:00 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/MessageFactoryImpl.java	Thu Jul 30 18:07:59 2009
+@@ -22,11 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * 
+- * 
+- * 
+- */
+ 
+ 
+ package com.sun.xml.internal.messaging.saaj.soap;
+@@ -61,23 +56,23 @@
+     protected  OutputStream listener;
+ 
+     protected boolean lazyAttachments = false;
+-    
++
+     public  OutputStream listen(OutputStream newListener) {
+         OutputStream oldListener = listener;
+         listener = newListener;
+         return oldListener;
+     }
+-    
++
+     public SOAPMessage createMessage() throws SOAPException {
+         throw new UnsupportedOperationException();
+     }
+ 
+-    public SOAPMessage createMessage(boolean isFastInfoset, 
+-        boolean acceptFastInfoset) throws SOAPException 
++    public SOAPMessage createMessage(boolean isFastInfoset,
++        boolean acceptFastInfoset) throws SOAPException
+     {
+         throw new UnsupportedOperationException();
+     }
+-    
++
+     public SOAPMessage createMessage(MimeHeaders headers, InputStream in)
+         throws SOAPException, IOException {
+         String contentTypeString = MessageImpl.getContentType(headers);
+@@ -98,7 +93,7 @@
+                 log.severe("SAAJ0530.soap.unknown.Content-Type");
+                 throw new SOAPExceptionImpl("Unrecognized Content-Type");
+             }
+-        } catch (ParseException e) {            
++        } catch (ParseException e) {
+             log.severe("SAAJ0531.soap.cannot.parse.Content-Type");
+             throw new SOAPExceptionImpl(
+                 "Unable to parse content type: " + e.getMessage());
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/MessageImpl.java	Thu Jul 30 18:08:03 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/MessageImpl.java	Thu Jul 30 18:08:03 2009
+@@ -22,11 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * 
+- * 
+- * 
+- */
+ 
+ 
+ package com.sun.xml.internal.messaging.saaj.soap;
+@@ -80,7 +75,7 @@
+     protected static final int MIME_MULTIPART_XOP_FLAG = 14; // 01110
+     protected static final int XOP_FLAG = 13;                // 01101
+     protected static final int FI_ENCODED_FLAG     = 16;     // 10000
+-    
++
+     protected MimeHeaders headers;
+     protected SOAPPartImpl soapPart;
+     protected FinalArrayList attachments;
+@@ -97,16 +92,16 @@
+      * True if this part is encoded using Fast Infoset.
+      * MIME -> application/fastinfoset
+      */
+-    protected boolean isFastInfoset = false;  
+-    
++    protected boolean isFastInfoset = false;
++
+     /**
+      * True if the Accept header of this message includes
+      * application/fastinfoset
+      */
+     protected boolean acceptFastInfoset = false;
+-    
++
+     protected MimeMultipart mmp = null;
+-    
++
+     // if attachments are present, don't read the entire message in byte stream in saveTo()
+     private boolean optimizeAttachmentProcessing = true;
+ 
+@@ -151,7 +146,7 @@
+      *      must be all lower case
+      */
+     private static boolean isSoap1_1Type(String primary, String sub) {
+-        return primary.equals("text") && sub.equals("xml")
++        return primary.equalsIgnoreCase("text") && sub.equalsIgnoreCase("xml")
+             || primary.equals("application")
+                && sub.equals("fastinfoset");
+     }
+@@ -194,7 +189,7 @@
+         this(false, false);
+         attachmentsInitialized = true;
+     }
+-    
++
+     /**
+       * Construct a new message. This will be invoked before message
+       * sends.
+@@ -202,7 +197,7 @@
+     protected MessageImpl(boolean isFastInfoset, boolean acceptFastInfoset) {
+         this.isFastInfoset = isFastInfoset;
+         this.acceptFastInfoset = acceptFastInfoset;
+-        
++
+         headers = new MimeHeaders();
+         headers.setHeader("Accept", getExpectedAcceptHeader());
+     }
+@@ -244,11 +239,11 @@
+         String type = contentType.getParameter("type");
+         if(type==null)
+             return false;
+-                                                                                                                             
++
+         type = type.toLowerCase();
+         if(!type.startsWith("application/xop+xml"))
+             return false;
+-                                                                                                                             
++
+         String startinfo = contentType.getParameter("start-info");
+         if(startinfo == null)
+             return false;
+@@ -255,7 +250,7 @@
+         startinfo = startinfo.toLowerCase();
+         return isEqualToSoap1_2Type(startinfo) || isEqualToSoap1_1Type(startinfo);
+     }
+- 
++
+     private static boolean isSOAPBodyXOPPackage(ContentType contentType){
+         String primary = contentType.getPrimaryType();
+         String sub = contentType.getSubType();
+@@ -268,7 +263,7 @@
+         }
+         return false;
+     }
+-    
++
+     /**
+      * Construct a message from an input stream. When messages are
+      * received, there's two parts -- the transport headers and the
+@@ -445,7 +440,7 @@
+                             throw new SOAPExceptionImpl(e);
+                         }
+                     }
+-                } 
++                }
+ 
+                 ContentType soapPartCType = new ContentType(
+                                             soapMessagePart.getContentType());
+@@ -486,7 +481,7 @@
+     public boolean acceptFastInfoset() {
+         return acceptFastInfoset;
+     }
+-    
++
+     public void setIsFastInfoset(boolean value) {
+         if (value != isFastInfoset) {
+             isFastInfoset = value;
+@@ -496,7 +491,7 @@
+             saved = false;      // ensure transcoding if necessary
+         }
+     }
+-    
++
+     public Object getProperty(String property) {
+         return (String) properties.get(property);
+     }
+@@ -520,7 +515,7 @@
+                     env.setOmitXmlDecl("yes");
+                 }
+             } catch (Exception e) {
+-                log.log(Level.SEVERE, "SAAJ0591.soap.exception.in.set.property", 
++                log.log(Level.SEVERE, "SAAJ0591.soap.exception.in.set.property",
+                     new Object[] {e.getMessage(), "javax.xml.soap.write-xml-declaration"});
+                 throw new RuntimeException(e);
+             }
+@@ -531,7 +526,7 @@
+             try {
+                 ((EnvelopeImpl) getSOAPPart().getEnvelope()).setCharsetEncoding((String)value);
+             } catch (Exception e) {
+-                log.log(Level.SEVERE, "SAAJ0591.soap.exception.in.set.property", 
++                log.log(Level.SEVERE, "SAAJ0591.soap.exception.in.set.property",
+                     new Object[] {e.getMessage(), "javax.xml.soap.character-set-encoding"});
+                 throw new RuntimeException(e);
+             }
+@@ -539,7 +534,7 @@
+     }
+ 
+     protected abstract boolean isCorrectSoapVersion(int contentTypeId);
+-    
++
+     protected abstract String getExpectedContentType();
+     protected abstract String getExpectedAcceptHeader();
+ 
+@@ -570,7 +565,7 @@
+                 if (isEqualToSoap1_1Type(type)) {
+                     return (type.equals("application/fastinfoset") ?
+                            FI_ENCODED_FLAG : 0) | MIME_MULTIPART_FLAG | SOAP1_1_FLAG;
+-                } 
++                }
+                 else if (isEqualToSoap1_2Type(type)) {
+                     return (type.equals("application/soap+fastinfoset") ?
+                            FI_ENCODED_FLAG : 0) | MIME_MULTIPART_FLAG | SOAP1_2_FLAG;
+@@ -588,17 +583,17 @@
+                 throw new SOAPExceptionImpl(
+                     "Invalid Content-Type: " + primary + '/' + sub);
+             }
+-        } 
++        }
+         else if (isSoap1_1Type(primary, sub)) {
+             return (primary.equalsIgnoreCase("application")
+                     && sub.equalsIgnoreCase("fastinfoset") ?
+-                        FI_ENCODED_FLAG : 0) 
++                        FI_ENCODED_FLAG : 0)
+                    | PLAIN_XML_FLAG | SOAP1_1_FLAG;
+-        } 
++        }
+         else if (isSoap1_2Type(primary, sub)) {
+             return (primary.equalsIgnoreCase("application")
+                     && sub.equalsIgnoreCase("soap+fastinfoset") ?
+-                        FI_ENCODED_FLAG : 0) 
++                        FI_ENCODED_FLAG : 0)
+                    | PLAIN_XML_FLAG | SOAP1_2_FLAG;
+         } else if(isSOAPBodyXOPPackage(contentType)){
+             return XOP_FLAG;
+@@ -635,7 +630,7 @@
+         else
+             return values[0];
+     }
+-    
++
+     /*
+      * Get the complete ContentType value along with optional parameters.
+      */
+@@ -848,6 +843,7 @@
+             }
+         }
+         attachments = f;
++       // needsSave();
+     }
+ 
+     public AttachmentPart createAttachmentPart() {
+@@ -854,7 +850,7 @@
+         return new AttachmentPartImpl();
+     }
+ 
+-    public  AttachmentPart getAttachment(SOAPElement element) 
++    public  AttachmentPart getAttachment(SOAPElement element)
+         throws SOAPException {
+         try {
+             initializeAllAttachments();
+@@ -893,7 +889,7 @@
+         return null;
+     }
+ 
+-    
++
+     private AttachmentPart getAttachmentPart(String uri) throws SOAPException {
+         AttachmentPart _part;
+         try {
+@@ -900,10 +896,10 @@
+             if (uri.startsWith("cid:")) {
+                 // rfc2392
+                 uri = '<'+uri.substring("cid:".length())+'>';
+-                
++
+                 MimeHeaders headersToMatch = new MimeHeaders();
+                 headersToMatch.addHeader(CONTENT_ID, uri);
+-                
++
+                 Iterator i = this.getAttachments(headersToMatch);
+                 _part = (i == null) ? null : (AttachmentPart)i.next();
+             } else {
+@@ -910,7 +906,7 @@
+                 // try content-location
+                 MimeHeaders headersToMatch = new MimeHeaders();
+                 headersToMatch.addHeader(CONTENT_LOCATION, uri);
+-                   
++
+                 Iterator i = this.getAttachments(headersToMatch);
+                 _part = (i == null) ? null : (AttachmentPart)i.next();
+             }
+@@ -918,11 +914,11 @@
+             // try  auto-generated JAXRPC CID
+             if (_part == null) {
+                 Iterator j = this.getAttachments();
+-                    
++
+                 while (j.hasNext()) {
+                     AttachmentPart p = (AttachmentPart)j.next();
+                     String cl = p.getContentId();
+-                    if (cl != null) {    
++                    if (cl != null) {
+                         // obtain the partname
+                         int eqIndex = cl.indexOf("=");
+                         if (eqIndex > -1) {
+@@ -932,10 +928,10 @@
+                                  break;
+                             }
+                         }
+-                    } 
++                    }
+                 }
+             }
+-            
++
+         } catch (Exception se) {
+             log.log(Level.SEVERE, "SAAJ0590.soap.unable.to.locate.attachment", new Object[] {uri});
+             throw new SOAPExceptionImpl(se);
+@@ -942,7 +938,7 @@
+         }
+         return _part;
+     }
+-    
++
+     private final ByteInputStream getHeaderBytes()
+         throws IOException {
+         SOAPPartImpl sp = (SOAPPartImpl) getSOAPPart();
+@@ -963,13 +959,13 @@
+         try {
+             SOAPPartImpl soapPart = (SOAPPartImpl) getSOAPPart();
+             MimeBodyPart mimeSoapPart = soapPart.getMimePart();
+-            
++
+             /*
+              * Get content type from this message instead of soapPart
+              * to ensure agreement if soapPart is transcoded (XML <-> FI)
+              */
+-            ContentType soapPartCtype = new ContentType(getExpectedContentType());          
+-            
++            ContentType soapPartCtype = new ContentType(getExpectedContentType());
++
+             if (!isFastInfoset) {
+                 soapPartCtype.setParameter("charset", initCharset());
+             }
+@@ -977,11 +973,11 @@
+ 
+             MimeMultipart headerAndBody = null;
+ 
+-            if (!switchOffBM && !switchOffLazyAttachment && 
++            if (!switchOffBM && !switchOffLazyAttachment &&
+                    (multiPart != null) && !attachmentsInitialized) {
+                 headerAndBody = new BMMimeMultipart();
+                 headerAndBody.addBodyPart(mimeSoapPart);
+-                if (attachments != null) { 
++                if (attachments != null) {
+                     for (Iterator eachAttachment = attachments.iterator();
+                          eachAttachment.hasNext();) {
+                         headerAndBody.addBodyPart(
+@@ -999,7 +995,7 @@
+                         setLazyAttachments(lazyAttachments);
+                 }
+ 
+-            } else { 
++            } else {
+                 headerAndBody = new MimeMultipart();
+                 headerAndBody.addBodyPart(mimeSoapPart);
+ 
+@@ -1081,7 +1077,7 @@
+         /*if (countAttachments() == 0) {*/
+         int attachmentCount = (attachments == null) ? 0 : attachments.size();
+         if (attachmentCount == 0) {
+-            if (!switchOffBM && !switchOffLazyAttachment && 
++            if (!switchOffBM && !switchOffLazyAttachment &&
+                 !attachmentsInitialized && (multiPart != null)) {
+                 // so there might be attachments
+                 attachmentCount = 1;
+@@ -1106,10 +1102,10 @@
+                             "Unable to get header stream in saveChanges: ",
+                             ex);
+                 }
+-                
++
+                 messageBytes = in.getBytes();
+                 messageByteCount = in.getCount();
+-                
++
+                 headers.setHeader(
+                         "Content-Type",
+                         getExpectedContentType() +
+@@ -1139,7 +1135,7 @@
+             if (soapAction == null || soapAction.length == 0)
+                 headers.setHeader("SOAPAction", "\"\"");
+ 
+-        } 
++        }
+         */
+ 
+         saved = true;
+@@ -1157,7 +1153,7 @@
+             soapPartCtype.setParameter("charset", charset);
+             mimeSoapPart.setHeader("Content-Type", soapPartCtype.toString());
+             headerAndBody.addBodyPart(mimeSoapPart);
+-                                                                                                                                
++
+             for (Iterator eachAttachement = getAttachments();
+                 eachAttachement.hasNext();
+                 ) {
+@@ -1165,23 +1161,23 @@
+                     ((AttachmentPartImpl) eachAttachement.next())
+                         .getMimePart());
+             }
+-                                                                                                                                
++
+             ContentType contentType = headerAndBody.getContentType();
+-                                                                                                                                
++
+             ParameterList l = contentType.getParameterList();
+-                                                                                                                                
++
+             //lets not write start-info for now till we get servlet fix done
+             l.set("start-info", getExpectedContentType());//+";charset="+initCharset());
+-                                                                                                                                
++
+             // set content type depending on SOAP version
+             l.set("type", "application/xop+xml");
+ 
+-            if (isCorrectSoapVersion(SOAP1_2_FLAG)) { 
++            if (isCorrectSoapVersion(SOAP1_2_FLAG)) {
+                  String action = getAction();
+                  if(action != null)
+                      l.set("action", action);
+             }
+-       
++
+             l.set("boundary", contentType.getParameter("boundary"));
+             ContentType nct = new ContentType("Multipart", "Related", l);
+             headers.setHeader(
+@@ -1189,7 +1185,7 @@
+                 convertToSingleLine(nct.toString()));
+             // TBD
+             //    Set content length MIME header here.
+-                                                                                                                                
++
+             return headerAndBody;
+         } catch (SOAPException ex) {
+             throw ex;
+@@ -1200,7 +1196,7 @@
+                     + "a MimeMultipart object",
+                 ex);
+         }
+-                                                                                                                                
++
+     }
+ 
+     private boolean hasXOPContent() throws ParseException {
+@@ -1231,12 +1227,12 @@
+                         ((BMMimeMultipart)multiPart).setInputStream(
+                                 ((BMMimeMultipart)mmp).getInputStream());
+                     }
+-                } 
++                }
+             } catch(Exception ex){
+                 log.severe("SAAJ0540.soap.err.saving.multipart.msg");
+                 throw new SOAPExceptionImpl(
+                         "Error during saving a multipart message",
+-                        ex);                
++                        ex);
+             }
+         }
+ 
+@@ -1247,12 +1243,12 @@
+             if (soapAction == null || soapAction.length == 0)
+                 headers.setHeader("SOAPAction", "\"\"");
+ 
+-        } 
+-        
++        }
++
+         messageBytes = null;
+         needsSave();
+     }
+-    
++
+     public SOAPBody getSOAPBody() throws SOAPException {
+         SOAPBody body = getSOAPPart().getEnvelope().getBody();
+         /*if (body == null) {
+@@ -1269,7 +1265,7 @@
+         return hdr;
+     }
+ 
+-    private void initializeAllAttachments () 
++    private void initializeAllAttachments ()
+         throws MessagingException, SOAPException {
+         if (switchOffBM || switchOffLazyAttachment) {
+             return;
+@@ -1278,10 +1274,10 @@
+         if (attachmentsInitialized || (multiPart == null)) {
+             return;
+         }
+-                                                                                
++
+         if (attachments == null)
+             attachments = new FinalArrayList();
+-                                                                                
++
+         int count = multiPart.getCount();
+         for (int i=0; i < count; i++ ) {
+             initializeAttachment(multiPart.getBodyPart(i));
+@@ -1290,12 +1286,12 @@
+         //multiPart = null;
+         needsSave();
+      }
+-                                                                                
++
+     private void initializeAttachment(MimeBodyPart mbp) throws SOAPException {
+         AttachmentPartImpl attachmentPart = new AttachmentPartImpl();
+         DataHandler attachmentHandler = mbp.getDataHandler();
+         attachmentPart.setDataHandler(attachmentHandler);
+-                                                                                
++
+         AttachmentPartImpl.copyMimeHeaders(mbp, attachmentPart);
+         attachments.add(attachmentPart);
+     }
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/MultipartDataContentHandler.java	Thu Jul 30 18:08:07 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/MultipartDataContentHandler.java	Thu Jul 30 18:08:07 2009
+@@ -22,11 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * $Id: MultipartDataContentHandler.java,v 1.3 2006/01/27 12:49:28 vj135062 Exp $
+- * $Revision: 1.3 $
+- * $Date: 2006/01/27 12:49:28 $
+- */
+ 
+ 
+ package com.sun.xml.internal.messaging.saaj.soap;
+@@ -40,9 +35,9 @@
+ 
+ public class MultipartDataContentHandler implements DataContentHandler {
+     private ActivationDataFlavor myDF = new ActivationDataFlavor(
+-	    com.sun.xml.internal.messaging.saaj.packaging.mime.internet.MimeMultipart.class,
+-	    "multipart/mixed", 
+-	    "Multipart");
++            com.sun.xml.internal.messaging.saaj.packaging.mime.internet.MimeMultipart.class,
++            "multipart/mixed",
++            "Multipart");
+ 
+     /**
+      * Return the DataFlavors for this <code>DataContentHandler</code>.
+@@ -50,7 +45,7 @@
+      * @return The DataFlavors
+      */
+     public DataFlavor[] getTransferDataFlavors() { // throws Exception;
+-	return new DataFlavor[] { myDF };
++        return new DataFlavor[] { myDF };
+     }
+ 
+     /**
+@@ -61,47 +56,46 @@
+      * @return String object
+      */
+     public Object getTransferData(DataFlavor df, DataSource ds) {
+-	// use myDF.equals to be sure to get ActivationDataFlavor.equals,
+-	// which properly ignores Content-Type parameters in comparison
+-	if (myDF.equals(df))
+-	    return getContent(ds);
+-	else
+-	    return null;
++        // use myDF.equals to be sure to get ActivationDataFlavor.equals,
++        // which properly ignores Content-Type parameters in comparison
++        if (myDF.equals(df))
++            return getContent(ds);
++        else
++            return null;
+     }
+-    
++
+     /**
+      * Return the content.
+      */
+     public Object getContent(DataSource ds) {
+-	try {
+-	    return new MimeMultipart(
+-                ds, new ContentType(ds.getContentType())); 
+-	} catch (Exception e) {
+-	    return null;
+-	}
++        try {
++            return new MimeMultipart(
++                ds, new ContentType(ds.getContentType()));
++        } catch (Exception e) {
++            return null;
++        }
+     }
+-    
++
+     /**
+      * Write the object to the output stream, using the specific MIME type.
+      */
+-    public void writeTo(Object obj, String mimeType, OutputStream os) 
+-			throws IOException {
+-	if (obj instanceof MimeMultipart) {
+-	    try {
++    public void writeTo(Object obj, String mimeType, OutputStream os)
++                        throws IOException {
++        if (obj instanceof MimeMultipart) {
++            try {
+                 //TODO: temporarily allow only ByteOutputStream
+                 // Need to add writeTo(OutputStream) on MimeMultipart
+-                ByteOutputStream baos = null; 
++                ByteOutputStream baos = null;
+                 if (os instanceof ByteOutputStream) {
+                     baos = (ByteOutputStream)os;
+                 } else {
+-                    throw new IOException("Input Stream expected to be a com.sun.xml.internal.messaging.saaj.util.ByteOutputStream, but found " + 
++                    throw new IOException("Input Stream expected to be a com.sun.xml.internal.messaging.saaj.util.ByteOutputStream, but found " +
+                         os.getClass().getName());
+                 }
+-		((MimeMultipart)obj).writeTo(baos);
+-	    } catch (Exception e) {
+-		throw new IOException(e.toString());
+-	    }
+-	}
++                ((MimeMultipart)obj).writeTo(baos);
++            } catch (Exception e) {
++                throw new IOException(e.toString());
++            }
++        }
+     }
+ }
+-
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/SAAJMetaFactoryImpl.java	Thu Jul 30 18:08:11 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/SAAJMetaFactoryImpl.java	Thu Jul 30 18:08:10 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.messaging.saaj.soap;
+ 
+ import javax.xml.soap.SAAJMetaFactory;
+@@ -48,13 +49,13 @@
+         } else if (SOAPConstants.SOAP_1_2_PROTOCOL.equals(protocol)) {
+               return new com.sun.xml.internal.messaging.saaj.soap.ver1_2.SOAPMessageFactory1_2Impl();
+         } else if (SOAPConstants.DYNAMIC_SOAP_PROTOCOL.equals(protocol)) {
+-              return new com.sun.xml.internal.messaging.saaj.soap.dynamic.SOAPMessageFactoryDynamicImpl(); 
++              return new com.sun.xml.internal.messaging.saaj.soap.dynamic.SOAPMessageFactoryDynamicImpl();
+         } else {
+             log.log(
+                 Level.SEVERE,
+                 "SAAJ0569.soap.unknown.protocol",
+                 new Object[] {protocol, "MessageFactory"});
+-            throw new SOAPException("Unknown Protocol: " + protocol + 
++            throw new SOAPException("Unknown Protocol: " + protocol +
+                                         "  specified for creating MessageFactory");
+         }
+     }
+@@ -66,13 +67,13 @@
+         } else if (SOAPConstants.SOAP_1_2_PROTOCOL.equals(protocol)) {
+             return new com.sun.xml.internal.messaging.saaj.soap.ver1_2.SOAPFactory1_2Impl();
+         } else if (SOAPConstants.DYNAMIC_SOAP_PROTOCOL.equals(protocol)) {
+-            return new com.sun.xml.internal.messaging.saaj.soap.dynamic.SOAPFactoryDynamicImpl(); 
++            return new com.sun.xml.internal.messaging.saaj.soap.dynamic.SOAPFactoryDynamicImpl();
+         } else {
+             log.log(
+                 Level.SEVERE,
+                 "SAAJ0569.soap.unknown.protocol",
+                 new Object[] {protocol, "SOAPFactory"});
+-            throw new SOAPException("Unknown Protocol: " + protocol + 
++            throw new SOAPException("Unknown Protocol: " + protocol +
+                                         "  specified for creating SOAPFactory");
+         }
+     }
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPDocument.java	Thu Jul 30 18:08:14 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPDocument.java	Thu Jul 30 18:08:14 2009
+@@ -22,9 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * $Id: SOAPDocument.java,v 1.5 2006/01/27 12:49:28 vj135062 Exp $
+- */
+ 
+ 
+ 
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPDocumentFragment.java	Thu Jul 30 18:08:18 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPDocumentFragment.java	Thu Jul 30 18:08:17 2009
+@@ -22,9 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * $Id: SOAPDocumentFragment.java,v 1.6 2006/01/27 12:49:28 vj135062 Exp $
+- */
+ 
+ 
+ 
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPDocumentImpl.java	Thu Jul 30 18:08:21 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPDocumentImpl.java	Thu Jul 30 18:08:21 2009
+@@ -22,9 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * 
+- */
+ 
+ 
+ 
+@@ -45,10 +42,10 @@
+ 
+ public class SOAPDocumentImpl extends DocumentImpl implements SOAPDocument {
+ 
+-    protected static final  Logger log =
++    protected static final Logger log =
+         Logger.getLogger(LogDomainConstants.SOAP_DOMAIN,
+                          "com.sun.xml.internal.messaging.saaj.soap.LocalStrings");
+-    
++
+     SOAPPartImpl enclosingSOAPPart;
+ 
+     public SOAPDocumentImpl(SOAPPartImpl enclosingDocument) {
+@@ -135,7 +132,7 @@
+     }
+ 
+     public EntityReference createEntityReference(String name)
+-        throws DOMException {        
++        throws DOMException {
+             log.severe("SAAJ0543.soap.entity.refs.not.allowed.in.docs");
+             throw new UnsupportedOperationException("Entity References are not allowed in SOAP documents");
+     }
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPFactoryImpl.java	Thu Jul 30 18:08:25 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPFactoryImpl.java	Thu Jul 30 18:08:24 2009
+@@ -22,11 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * 
+- * 
+- * 
+- */
+ 
+ 
+ package com.sun.xml.internal.messaging.saaj.soap;
+@@ -59,10 +54,10 @@
+     public SOAPElement createElement(String tagName) throws SOAPException {
+          if (tagName == null) {
+              log.log(
+-                 Level.SEVERE,"SAAJ0567.soap.null.input", 
++                 Level.SEVERE,"SAAJ0567.soap.null.input",
+                  new Object[] {"tagName","SOAPFactory.createElement"});
+              throw new SOAPException("Null tagName argument passed to createElement");
+-         } 
++         }
+         return ElementFactory.createElement(createDocument(),
+                         NameImpl.createFromTagName(tagName));
+     }
+@@ -71,7 +66,7 @@
+         // @since SAAJ 1.3
+         // If the Name was null it would cause a NullPointerException in earlier release
+         if (name == null) {
+-            log.log(Level.SEVERE,"SAAJ0567.soap.null.input", 
++            log.log(Level.SEVERE,"SAAJ0567.soap.null.input",
+                         new Object[] {"name","SOAPFactory.createElement"});
+             throw new SOAPException("Null name argument passed to createElement");
+         }
+@@ -80,7 +75,7 @@
+ 
+     public SOAPElement createElement(QName qname) throws SOAPException {
+         if (qname == null) {
+-            log.log(Level.SEVERE,"SAAJ0567.soap.null.input", 
++            log.log(Level.SEVERE,"SAAJ0567.soap.null.input",
+                         new Object[] {"qname","SOAPFactory.createElement"});
+             throw new SOAPException("Null qname argument passed to createElement");
+         }
+@@ -96,7 +91,7 @@
+         // if prefix !=null but localName== null then in earlier releases it would create
+         // a Qualified Name  <prefix>:null which is not meaningful
+         if (localName == null) {
+-            log.log(Level.SEVERE,"SAAJ0567.soap.null.input", 
++            log.log(Level.SEVERE,"SAAJ0567.soap.null.input",
+                         new Object[] {"localName","SOAPFactory.createElement"});
+             throw new SOAPException("Null localName argument passed to createElement");
+         }
+@@ -106,27 +101,27 @@
+     public Name createName(String localName, String prefix, String uri)
+         throws SOAPException {
+         // @since SAAJ 1.3
+-        // if localName==null, earlier impl would create Name with localName="" 
++        // if localName==null, earlier impl would create Name with localName=""
+         // which is absurd.
+         if (localName == null) {
+             log.log(
+-                 Level.SEVERE,"SAAJ0567.soap.null.input", 
++                 Level.SEVERE,"SAAJ0567.soap.null.input",
+                  new Object[] {"localName","SOAPFactory.createName"});
+             throw new SOAPException("Null localName argument passed to createName");
+-        } 
++        }
+         return NameImpl.create(localName, prefix, uri);
+     }
+ 
+     public Name createName(String localName) throws SOAPException {
+         // @since SAAJ 1.3
+-        // if localName==null, earlier impl would create Name with localName=null 
++        // if localName==null, earlier impl would create Name with localName=null
+         // which is absurd.
+         if (localName == null) {
+             log.log(
+-                Level.SEVERE,"SAAJ0567.soap.null.input", 
++                Level.SEVERE,"SAAJ0567.soap.null.input",
+                 new Object[] {"localName","SOAPFactory.createName"});
+             throw new SOAPException("Null localName argument passed to createName");
+-        } 
++        }
+         return NameImpl.createFromUnqualifiedName(localName);
+     }
+ 
+@@ -143,10 +138,10 @@
+ 
+         if (element instanceof SOAPElement) {
+             return (SOAPElement) element;
+-        } 
++        }
+ 
+         SOAPElement copy = createElement(
+-                                element.getLocalName(), 
++                                element.getLocalName(),
+                                 element.getPrefix(),
+                                 element.getNamespaceURI());
+ 
+@@ -166,7 +161,7 @@
+             org.w3c.dom.Node imported = ownerDoc.importNode(next, true);
+             copy.appendChild(imported);
+         }
+-        
++
+         return copy;
+     }
+ 
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPIOException.java	Thu Jul 30 18:08:28 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPIOException.java	Thu Jul 30 18:08:28 2009
+@@ -23,7 +23,6 @@
+  * have any questions.
+  */
+ 
+-
+ /**
+  * Created on Nov 19, 2002
+  *
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPPartImpl.java	Thu Jul 30 18:08:32 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPPartImpl.java	Thu Jul 30 18:08:31 2009
+@@ -22,11 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * 
+- * 
+- * 
+- */
+ 
+ 
+ package com.sun.xml.internal.messaging.saaj.soap;
+@@ -76,16 +71,16 @@
+ 
+     // Records the charset encoding of the input stream source if provided.
+     protected String sourceCharsetEncoding = null;
+-   
++
+     /**
+      * Reference to containing message (may be null)
+      */
+     protected MessageImpl message;
+-    
++
+     protected SOAPPartImpl() {
+         this(null);
+     }
+-    
++
+     protected SOAPPartImpl(MessageImpl message) {
+         document = new SOAPDocumentImpl(this);
+         headers = new MimeHeaders();
+@@ -92,7 +87,7 @@
+         this.message = message;
+         headers.setHeader("Content-Type", getContentType());
+     }
+-    
++
+     protected abstract String getContentType();
+     protected abstract Envelope createEnvelopeFromSource()
+     throws SOAPException;
+@@ -99,7 +94,7 @@
+     protected abstract Envelope createEmptyEnvelope(String prefix)
+     throws SOAPException;
+     protected abstract SOAPPartImpl duplicateType();
+-    
++
+     protected String getContentTypeString() {
+         return getContentType();
+     }
+@@ -107,9 +102,9 @@
+     public boolean isFastInfoset() {
+         return (message != null) ? message.isFastInfoset() : false;
+     }
+-    
++
+     public SOAPEnvelope getEnvelope() throws SOAPException {
+-        
++
+         // If there is no SOAP envelope already created, then create
+         // one from a source if one exists. If there is a newer source
+         // then use that source.
+@@ -131,7 +126,7 @@
+         }
+         return envelope;
+     }
+-    
++
+     protected void lookForEnvelope() throws SOAPException {
+         Element envelopeChildElement = document.doGetDocumentElement();
+         if (envelopeChildElement == null || envelopeChildElement instanceof Envelope) {
+@@ -155,39 +150,39 @@
+             }
+         }
+     }
+-    
++
+     public void removeAllMimeHeaders() {
+         headers.removeAllHeaders();
+     }
+-    
++
+     public void removeMimeHeader(String header) {
+         headers.removeHeader(header);
+     }
+-    
++
+     public String[] getMimeHeader(String name) {
+         return headers.getHeader(name);
+     }
+-    
++
+     public void setMimeHeader(String name, String value) {
+         headers.setHeader(name, value);
+     }
+-    
++
+     public void addMimeHeader(String name, String value) {
+         headers.addHeader(name, value);
+     }
+-    
++
+     public Iterator getAllMimeHeaders() {
+         return headers.getAllHeaders();
+     }
+-    
++
+     public Iterator getMatchingMimeHeaders(String[] names) {
+         return headers.getMatchingHeaders(names);
+     }
+-    
++
+     public Iterator getNonMatchingMimeHeaders(String[] names) {
+         return headers.getNonMatchingHeaders(names);
+     }
+-    
++
+     public Source getContent() throws SOAPException {
+         if (source != null) {
+             InputStream bis = null;
+@@ -215,16 +210,16 @@
+             }
+             return source;
+         }
+-        
++
+         return ((Envelope) getEnvelope()).getContent();
+     }
+-    
++
+     public void setContent(Source source) throws SOAPException {
+         try {
+             if (source instanceof StreamSource) {
+                 InputStream is = ((StreamSource) source).getInputStream();
+                 Reader rdr = ((StreamSource) source).getReader();
+-                
++
+                 if (is != null) {
+                     this.source = new JAXMStreamSource(is);
+                 } else if (rdr != null) {
+@@ -237,7 +232,7 @@
+             else if (FastInfosetReflection.isFastInfosetSource(source)) {
+                 // InputStream is = source.getInputStream()
+                 InputStream is = FastInfosetReflection.FastInfosetSource_getInputStream(source);
+-                
++
+                 /*
+                  * Underlying stream must be ByteInputStream for getContentAsStream(). We pay the
+                  * cost of copying the underlying bytes here to avoid multiple copies every time
+@@ -260,23 +255,23 @@
+         }
+         catch (Exception ex) {
+             ex.printStackTrace();
+-            
++
+             log.severe("SAAJ0545.soap.cannot.set.src.for.part");
+             throw new SOAPExceptionImpl(
+             "Error setting the source for SOAPPart: " + ex.getMessage());
+         }
+     }
+-    
++
+     public ByteInputStream getContentAsStream() throws IOException {
+         if (source != null) {
+             InputStream is = null;
+-            
++
+             // Allow message to be transcode if so requested
+             if (source instanceof StreamSource && !isFastInfoset()) {
+                 is = ((StreamSource) source).getInputStream();
+             }
+-            else if (FastInfosetReflection.isFastInfosetSource(source) && 
+-                isFastInfoset()) 
++            else if (FastInfosetReflection.isFastInfosetSource(source) &&
++                isFastInfoset())
+             {
+                 try {
+                     // InputStream is = source.getInputStream()
+@@ -286,7 +281,7 @@
+                     throw new IOException(e.toString());
+                 }
+             }
+-            
++
+             if (is != null) {
+                 if (!(is instanceof ByteInputStream)) {
+                     log.severe("SAAJ0546.soap.stream.incorrect.type");
+@@ -297,11 +292,11 @@
+             // need to do something here for reader...
+             // for now we'll see if we can fallback...
+         }
+-        
++
+         ByteOutputStream b = new ByteOutputStream();
+-        
++
+         Envelope env = null;
+-        
++
+         try {
+             env = (Envelope) getEnvelope();
+             env.output(b, isFastInfoset());
+@@ -312,17 +307,17 @@
+             "SOAP exception while trying to externalize: ",
+             soapException);
+         }
+-        
++
+         return b.newInputStream();
+     }
+-    
++
+     MimeBodyPart getMimePart() throws SOAPException {
+         try {
+             MimeBodyPart headerEnvelope = new MimeBodyPart();
+-            
++
+             headerEnvelope.setDataHandler(getDataHandler());
+             AttachmentPartImpl.copyMimeHeaders(headers, headerEnvelope);
+-            
++
+             return headerEnvelope;
+         } catch (SOAPException ex) {
+             throw ex;
+@@ -331,25 +326,25 @@
+             throw new SOAPExceptionImpl("Unable to externalize header", ex);
+         }
+     }
+-    
++
+     MimeHeaders getMimeHeaders() {
+         return headers;
+     }
+-    
++
+     DataHandler getDataHandler() {
+         DataSource ds = new DataSource() {
+             public OutputStream getOutputStream() throws IOException {
+                 throw new IOException("Illegal Operation");
+             }
+-            
++
+             public String getContentType() {
+                 return getContentTypeString();
+             }
+-            
++
+             public String getName() {
+                 return getContentId();
+             }
+-            
++
+             public InputStream getInputStream() throws IOException {
+                 return getContentAsStream();
+             }
+@@ -356,20 +351,20 @@
+         };
+         return new DataHandler(ds);
+     }
+-    
++
+     public SOAPDocumentImpl getDocument() {
+         handleNewSource();
+         return document;
+     }
+-    
++
+     public SOAPPartImpl getSOAPPart() {
+         return this;
+     }
+-    
++
+     public DocumentType getDoctype() {
+         return document.getDoctype();
+     }
+-    
++
+     // Forward all of these calls to the document to ensure that they work the
+     // same way whether they are called from here or directly from the document.
+     // If the document needs any help from this SOAPPart then
+@@ -377,7 +372,7 @@
+     public DOMImplementation getImplementation() {
+         return document.getImplementation();
+     }
+-    
++
+     public Element getDocumentElement() {
+         // If there is no SOAP envelope already created, then create
+         // one from a source if one exists. If there is a newer source
+@@ -388,7 +383,7 @@
+         }
+         return document.getDocumentElement();
+     }
+-    
++
+     protected void doGetDocumentElement() {
+         handleNewSource();
+         try {
+@@ -396,27 +391,27 @@
+         } catch (SOAPException e) {
+         }
+     }
+-    
++
+     public Element createElement(String tagName) throws DOMException {
+         return document.createElement(tagName);
+     }
+-    
++
+     public DocumentFragment createDocumentFragment() {
+         return document.createDocumentFragment();
+     }
+-    
++
+     public org.w3c.dom.Text createTextNode(String data) {
+         return document.createTextNode(data);
+     }
+-    
++
+     public Comment createComment(String data) {
+         return document.createComment(data);
+     }
+-    
++
+     public CDATASection createCDATASection(String data) throws DOMException {
+         return document.createCDATASection(data);
+     }
+-    
++
+     public ProcessingInstruction createProcessingInstruction(
+     String target,
+     String data)
+@@ -423,21 +418,21 @@
+     throws DOMException {
+         return document.createProcessingInstruction(target, data);
+     }
+-    
++
+     public Attr createAttribute(String name) throws DOMException {
+         return document.createAttribute(name);
+     }
+-    
++
+     public EntityReference createEntityReference(String name)
+     throws DOMException {
+         return document.createEntityReference(name);
+     }
+-    
++
+     public NodeList getElementsByTagName(String tagname) {
+         handleNewSource();
+         return document.getElementsByTagName(tagname);
+     }
+-    
++
+     public org.w3c.dom.Node importNode(
+         org.w3c.dom.Node importedNode,
+         boolean deep)
+@@ -445,17 +440,17 @@
+         handleNewSource();
+         return document.importNode(importedNode, deep);
+     }
+-    
++
+     public Element createElementNS(String namespaceURI, String qualifiedName)
+     throws DOMException {
+         return document.createElementNS(namespaceURI, qualifiedName);
+     }
+-    
++
+     public Attr createAttributeNS(String namespaceURI, String qualifiedName)
+     throws DOMException {
+         return document.createAttributeNS(namespaceURI, qualifiedName);
+     }
+-    
++
+     public NodeList getElementsByTagNameNS(
+         String namespaceURI,
+         String localName) {
+@@ -462,7 +457,7 @@
+         handleNewSource();
+         return document.getElementsByTagNameNS(namespaceURI, localName);
+     }
+-    
++
+     public Element getElementById(String elementId) {
+         handleNewSource();
+         return document.getElementById(elementId);
+@@ -472,90 +467,90 @@
+         handleNewSource();
+         return document.appendChild(newChild);
+     }
+-    
++
+     public org.w3c.dom.Node cloneNode(boolean deep) {
+         handleNewSource();
+         return document.cloneNode(deep);
+     }
+-    
++
+     protected SOAPPartImpl doCloneNode() {
+         handleNewSource();
+         SOAPPartImpl newSoapPart = duplicateType();
+-        
++
+         newSoapPart.headers = MimeHeadersUtil.copy(this.headers);
+         newSoapPart.source = this.source;
+         return newSoapPart;
+     }
+-    
++
+     public NamedNodeMap getAttributes() {
+         return document.getAttributes();
+     }
+-    
++
+     public NodeList getChildNodes() {
+         handleNewSource();
+         return document.getChildNodes();
+     }
+-    
++
+     public org.w3c.dom.Node getFirstChild() {
+         handleNewSource();
+         return document.getFirstChild();
+     }
+-    
++
+     public org.w3c.dom.Node getLastChild() {
+         handleNewSource();
+         return document.getLastChild();
+     }
+-    
++
+     public String getLocalName() {
+         return document.getLocalName();
+     }
+-    
++
+     public String getNamespaceURI() {
+         return document.getNamespaceURI();
+     }
+-    
++
+     public org.w3c.dom.Node getNextSibling() {
+         handleNewSource();
+         return document.getNextSibling();
+     }
+-    
++
+     public String getNodeName() {
+         return document.getNodeName();
+     }
+-    
++
+     public short getNodeType() {
+         return document.getNodeType();
+     }
+-    
++
+     public String getNodeValue() throws DOMException {
+         return document.getNodeValue();
+     }
+-    
++
+     public Document getOwnerDocument() {
+         return document.getOwnerDocument();
+     }
+-    
++
+     public org.w3c.dom.Node getParentNode() {
+         return document.getParentNode();
+     }
+-    
++
+     public String getPrefix() {
+         return document.getPrefix();
+     }
+-    
++
+     public org.w3c.dom.Node getPreviousSibling() {
+         return document.getPreviousSibling();
+     }
+-    
++
+     public boolean hasAttributes() {
+         return document.hasAttributes();
+     }
+-    
++
+     public boolean hasChildNodes() {
+         handleNewSource();
+         return document.hasChildNodes();
+     }
+-    
++
+     public org.w3c.dom.Node insertBefore(
+         org.w3c.dom.Node arg0,
+         org.w3c.dom.Node arg1)
+@@ -563,22 +558,22 @@
+         handleNewSource();
+         return document.insertBefore(arg0, arg1);
+     }
+-    
++
+     public boolean isSupported(String arg0, String arg1) {
+         return document.isSupported(arg0, arg1);
+     }
+-    
++
+     public void normalize() {
+         handleNewSource();
+         document.normalize();
+     }
+-    
++
+     public org.w3c.dom.Node removeChild(org.w3c.dom.Node arg0)
+         throws DOMException {
+         handleNewSource();
+         return document.removeChild(arg0);
+     }
+-    
++
+     public org.w3c.dom.Node replaceChild(
+         org.w3c.dom.Node arg0,
+         org.w3c.dom.Node arg1)
+@@ -586,11 +581,11 @@
+         handleNewSource();
+         return document.replaceChild(arg0, arg1);
+     }
+-    
++
+     public void setNodeValue(String arg0) throws DOMException {
+         document.setNodeValue(arg0);
+     }
+-    
++
+     public void setPrefix(String arg0) throws DOMException {
+         document.setPrefix(arg0);
+     }
+@@ -602,7 +597,7 @@
+              getEnvelope();
+          } catch (SOAPException e) {
+          }
+-      }  
++      }
+     }
+ 
+     protected XMLDeclarationParser lookForXmlDecl() throws SOAPException {
+@@ -612,20 +607,20 @@
+ 
+             InputStream inputStream = ((StreamSource) source).getInputStream();
+             if (inputStream != null) {
+-                if (sourceCharsetEncoding == null) {
++                if (getSourceCharsetEncoding() == null) {
+                     reader = new InputStreamReader(inputStream);
+                 } else {
+                     try {
+                         reader =
+                             new InputStreamReader(
+-                                inputStream, sourceCharsetEncoding);
++                                inputStream, getSourceCharsetEncoding());
+                     } catch (UnsupportedEncodingException uee) {
+                         log.log(
+                             Level.SEVERE,
+                             "SAAJ0551.soap.unsupported.encoding",
+-                            new Object[] {sourceCharsetEncoding});
++                            new Object[] {getSourceCharsetEncoding()});
+                         throw new SOAPExceptionImpl(
+-                            "Unsupported encoding " + sourceCharsetEncoding,
++                            "Unsupported encoding " + getSourceCharsetEncoding(),
+                             uee);
+                     }
+                 }
+@@ -659,7 +654,7 @@
+         this.sourceCharsetEncoding = charset;
+     }
+ 
+-    public org.w3c.dom.Node renameNode(org.w3c.dom.Node n, String namespaceURI, String qualifiedName) 
++    public org.w3c.dom.Node renameNode(org.w3c.dom.Node n, String namespaceURI, String qualifiedName)
+         throws DOMException {
+         handleNewSource();
+         return document.renameNode(n, namespaceURI, qualifiedName);
+@@ -797,4 +792,8 @@
+     public void detachNode() {
+         // Nothing seems to be required to be done here
+     }
++
++    public String getSourceCharsetEncoding() {
++        return sourceCharsetEncoding;
++    }
+ }
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPVersionMismatchException.java	Thu Jul 30 18:08:36 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPVersionMismatchException.java	Thu Jul 30 18:08:35 2009
+@@ -22,11 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * $Id: SOAPVersionMismatchException.java,v 1.6 2006/01/27 12:49:29 vj135062 Exp $
+- * $Revision: 1.6 $
+- * $Date: 2006/01/27 12:49:29 $
+- */
+ 
+ 
+ 
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/StringDataContentHandler.java	Thu Jul 30 18:08:39 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/StringDataContentHandler.java	Thu Jul 30 18:08:39 2009
+@@ -22,11 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * $Id: StringDataContentHandler.java,v 1.6 2006/01/27 12:49:29 vj135062 Exp $
+- * $Revision: 1.6 $
+- * $Date: 2006/01/27 12:49:29 $
+- */
+ 
+ 
+ package com.sun.xml.internal.messaging.saaj.soap;
+@@ -35,127 +30,139 @@
+ import java.io.*;
+ 
+ import javax.activation.*;
++import com.sun.xml.internal.messaging.saaj.packaging.mime.internet.MimeUtility;
++import com.sun.xml.internal.messaging.saaj.packaging.mime.util.ASCIIUtility;
++import com.sun.xml.internal.messaging.saaj.packaging.mime.internet.ContentType;
+ 
+ /**
+  * JAF data content handler for text/plain --> String
+  *
+- * @author Anil Vijendran
+  */
+ public class StringDataContentHandler implements DataContentHandler {
+-    /**
+-     * return the DataFlavors for this <code>DataContentHandler</code>
+-     * @return The DataFlavors.
+-     */
+-    public DataFlavor[] getTransferDataFlavors() { // throws Exception;
+-        DataFlavor flavors[] = new DataFlavor[2];
++    private static ActivationDataFlavor myDF = new ActivationDataFlavor(
++        java.lang.String.class,
++        "text/plain",
++        "Text String");
+ 
+-        try {
+-            flavors[0] =
+-                new ActivationDataFlavor(
+-                    Class.forName("java.lang.String"),
+-                    "text/plain",
+-                    "text string");
+-        } catch (Exception e) {
+-        }
++    protected ActivationDataFlavor getDF() {
++        return myDF;
++    }
+ 
+-        flavors[1] = new DataFlavor("text/plain", "Plain Text");
+-        return flavors;
++    /**
++     * Return the DataFlavors for this <code>DataContentHandler</code>.
++     *
++     * @return The DataFlavors
++     */
++    public DataFlavor[] getTransferDataFlavors() {
++        return new DataFlavor[] { getDF() };
+     }
+ 
+     /**
+-     * return the Transfer Data of type DataFlavor from InputStream
+-     * @param df The DataFlavor.
+-     * @param ins The InputStream corresponding to the data.
+-     * @return The constructed Object.
++     * Return the Transfer Data of type DataFlavor from InputStream.
++     *
++     * @param df The DataFlavor
++     * @param ds The DataSource corresponding to the data
++     * @return String object
+      */
+-    public Object getTransferData(DataFlavor df, DataSource ds) {
++    public Object getTransferData(DataFlavor df, DataSource ds)
++                        throws IOException {
++        // use myDF.equals to be sure to get ActivationDataFlavor.equals,
++        // which properly ignores Content-Type parameters in comparison
++        if (getDF().equals(df))
++            return getContent(ds);
++        else
++            return null;
++    }
+ 
+-        // this is sort of hacky, but will work for the
+-        // sake of testing...
+-        if (df.getMimeType().startsWith("text/plain")) {
+-            if (df
+-                .getRepresentationClass()
+-                .getName()
+-                .equals("java.lang.String")) {
+-                // spit out String
+-                StringBuffer buf = new StringBuffer();
+-                char data[] = new char[1024];
+-                // InputStream is = null;
+-                InputStreamReader isr = null;
+-                int bytes_read = 0;
+-                int total_bytes = 0;
++    public Object getContent(DataSource ds) throws IOException {
++        String enc = null;
++        InputStreamReader is = null;
+ 
+-                try {
+-                    isr = new InputStreamReader(ds.getInputStream());
++        try {
++            enc = getCharset(ds.getContentType());
++            is = new InputStreamReader(ds.getInputStream(), enc);
++        } catch (IllegalArgumentException iex) {
++            /*
++             * An unknown charset of the form ISO-XXX-XXX will cause
++             * the JDK to throw an IllegalArgumentException.  The
++             * JDK will attempt to create a classname using this string,
++             * but valid classnames must not contain the character '-',
++             * and this results in an IllegalArgumentException, rather than
++             * the expected UnsupportedEncodingException.  Yikes.
++             */
++            throw new UnsupportedEncodingException(enc);
++        }
+ 
+-                    while (true) {
+-                        bytes_read = isr.read(data);
+-                        if (bytes_read > 0)
+-                            buf.append(data, 0, bytes_read);
+-                        else
+-                            break;
+-                        total_bytes += bytes_read;
+-                    }
+-                } catch (Exception e) {
+-                }
++        try {
++            int pos = 0;
++            int count;
++            char buf[] = new char[1024];
+ 
+-                return buf.toString();
+-
+-            } else if (
+-                df.getRepresentationClass().getName().equals(
+-                    "java.io.InputStream")) {
+-                // spit out InputStream
+-                try {
+-                    return ds.getInputStream();
+-                } catch (Exception e) {
++            while ((count = is.read(buf, pos, buf.length - pos)) != -1) {
++                pos += count;
++                if (pos >= buf.length) {
++                    int size = buf.length;
++                    if (size < 256*1024)
++                        size += size;
++                    else
++                        size += 256*1024;
++                    char tbuf[] = new char[size];
++                    System.arraycopy(buf, 0, tbuf, 0, pos);
++                    buf = tbuf;
+                 }
+             }
+-
++            return new String(buf, 0, pos);
++        } finally {
++            try {
++                is.close();
++            } catch (IOException ex) { }
+         }
+-        return null;
+     }
+ 
+     /**
+-     *
++     * Write the object to the output stream, using the specified MIME type.
+      */
+-    public Object getContent(DataSource ds) { // throws Exception;
+-        StringBuffer buf = new StringBuffer();
+-        char data[] = new char[1024];
+-        // InputStream is = null;
+-        InputStreamReader isr = null;
+-        int bytes_read = 0;
+-        int total_bytes = 0;
++    public void writeTo(Object obj, String type, OutputStream os)
++                        throws IOException {
++        if (!(obj instanceof String))
++            throw new IOException("\"" + getDF().getMimeType() +
++                "\" DataContentHandler requires String object, " +
++                "was given object of type " + obj.getClass().toString());
+ 
+-        try {
+-            isr = new InputStreamReader(ds.getInputStream());
++        String enc = null;
++        OutputStreamWriter osw = null;
+ 
+-            while (true) {
+-                bytes_read = isr.read(data);
+-                if (bytes_read > 0)
+-                    buf.append(data, 0, bytes_read);
+-                else
+-                    break;
+-                total_bytes += bytes_read;
+-            }
+-        } catch (Exception e) {
++        try {
++            enc = getCharset(type);
++            osw = new OutputStreamWriter(os, enc);
++        } catch (IllegalArgumentException iex) {
++            /*
++             * An unknown charset of the form ISO-XXX-XXX will cause
++             * the JDK to throw an IllegalArgumentException.  The
++             * JDK will attempt to create a classname using this string,
++             * but valid classnames must not contain the character '-',
++             * and this results in an IllegalArgumentException, rather than
++             * the expected UnsupportedEncodingException.  Yikes.
++             */
++            throw new UnsupportedEncodingException(enc);
+         }
+ 
+-        return buf.toString();
++        String s = (String)obj;
++        osw.write(s, 0, s.length());
++        osw.flush();
+     }
+-    /**
+-     * construct an object from a byte stream
+-     * (similar semantically to previous method, we are deciding
+-     *  which one to support)
+-     */
+-    public void writeTo(Object obj, String mimeType, OutputStream os)
+-        throws IOException {
+-        if (!mimeType.startsWith("text/plain"))
+-            throw new IOException(
+-                "Invalid type \"" + mimeType + "\" on StringDCH");
+ 
+-        Writer out = new OutputStreamWriter(os);
+-        out.write((String) obj);
+-        out.flush();
++    private String getCharset(String type) {
++        try {
++            ContentType ct = new ContentType(type);
++            String charset = ct.getParameter("charset");
++            if (charset == null)
++                // If the charset parameter is absent, use US-ASCII.
++                charset = "us-ascii";
++            return MimeUtility.javaCharset(charset);
++        } catch (Exception ex) {
++            return null;
++        }
+     }
+ 
+ }
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/XmlDataContentHandler.java	Thu Jul 30 18:08:43 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/XmlDataContentHandler.java	Thu Jul 30 18:08:42 2009
+@@ -22,11 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * $Id: XmlDataContentHandler.java,v 1.12 2006/01/27 12:49:30 vj135062 Exp $
+- * $Revision: 1.12 $
+- * $Date: 2006/01/27 12:49:30 $
+- */
+ 
+ 
+ package com.sun.xml.internal.messaging.saaj.soap;
+@@ -81,7 +76,7 @@
+      */
+     public Object getTransferData(DataFlavor flavor, DataSource dataSource)
+         throws IOException {
+-        if (flavor.getMimeType().startsWith("text/xml") || 
++        if (flavor.getMimeType().startsWith("text/xml") ||
+                 flavor.getMimeType().startsWith("application/xml")) {
+             if (flavor.getRepresentationClass().getName().equals(STR_SRC)) {
+                 return new StreamSource(dataSource.getInputStream());
+@@ -104,19 +99,25 @@
+      */
+     public void writeTo(Object obj, String mimeType, OutputStream os)
+         throws IOException {
+-        if (!mimeType.equals("text/xml") && !mimeType.equals("application/xml"))
++        if (!mimeType.startsWith("text/xml") && !mimeType.startsWith("application/xml"))
+             throw new IOException(
+                 "Invalid content type \"" + mimeType + "\" for XmlDCH");
+ 
+-            
++
+         try {
+             Transformer transformer = EfficientStreamingTransformer.newTransformer();
+             StreamResult result = new StreamResult(os);
+             if (obj instanceof DataSource) {
+-                // Streaming transform applies only to javax.xml.transform.StreamSource 
+-                transformer.transform((Source) getContent((DataSource)obj), result);                
++                // Streaming transform applies only to javax.xml.transform.StreamSource
++                transformer.transform((Source) getContent((DataSource)obj), result);
+             } else {
+-                transformer.transform((Source) obj, result);
++                Source src=null;
++                if (obj instanceof String) {
++                     src= new StreamSource(new java.io.StringReader((String) obj));
++                } else {
++                    src=(Source) obj;
++                }
++                transformer.transform(src, result);
+             }
+         } catch (Exception ex) {
+             throw new IOException(
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/dynamic/SOAPFactoryDynamicImpl.java	Thu Jul 30 18:08:46 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/dynamic/SOAPFactoryDynamicImpl.java	Thu Jul 30 18:08:46 2009
+@@ -22,9 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * $Id: SOAPFactoryDynamicImpl.java,v 1.2 2006/01/27 12:49:32 vj135062 Exp $
+- */
+ 
+ 
+ 
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/dynamic/SOAPMessageFactoryDynamicImpl.java	Thu Jul 30 18:08:50 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/dynamic/SOAPMessageFactoryDynamicImpl.java	Thu Jul 30 18:08:49 2009
+@@ -22,9 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * $Id: SOAPMessageFactoryDynamicImpl.java,v 1.4 2006/01/27 12:49:32 vj135062 Exp $
+- */
+ 
+ 
+ 
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/BodyElementImpl.java	Thu Jul 30 18:08:53 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/BodyElementImpl.java	Thu Jul 30 18:08:53 2009
+@@ -22,11 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * $Id: BodyElementImpl.java,v 1.14 2006/01/27 12:49:33 vj135062 Exp $
+- * $Revision: 1.14 $
+- * $Date: 2006/01/27 12:49:33 $
+- */
+ 
+ 
+ package com.sun.xml.internal.messaging.saaj.soap.impl;
+@@ -44,7 +39,7 @@
+ public abstract class BodyElementImpl
+     extends ElementImpl
+     implements SOAPBodyElement {
+-        
++
+     public BodyElementImpl(SOAPDocumentImpl ownerDoc, Name qname) {
+         super(ownerDoc, qname);
+     }
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/BodyImpl.java	Thu Jul 30 18:08:57 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/BodyImpl.java	Thu Jul 30 18:08:56 2009
+@@ -22,11 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * $Id: BodyImpl.java,v 1.41 2006/01/27 12:49:34 vj135062 Exp $
+- * $Revision: 1.41 $
+- * $Date: 2006/01/27 12:49:34 $
+- */
+ 
+ 
+ package com.sun.xml.internal.messaging.saaj.soap.impl;
+@@ -87,7 +82,7 @@
+         String faultString,
+         Locale locale)
+         throws SOAPException {
+-        
++
+         SOAPFault fault = addFault();
+         fault.setFaultCode(faultCode);
+         fault.setFaultString(faultString, locale);
+@@ -214,7 +209,7 @@
+     public SOAPBodyElement addDocument(Document document)
+         throws SOAPException {
+         /*
+-                
++
+                 Element rootNode =
+                     document.getDocumentElement();
+                 // Causes all deferred nodes to be inflated
+@@ -245,12 +240,12 @@
+                 newBodyElement = (SOAPBodyElement) i.next();
+         }
+         return newBodyElement;
+-        //*/        
++        //*/
+     }
+ 
+     protected SOAPElement convertToSoapElement(Element element) {
+         if ((element instanceof SOAPBodyElement) &&
+-            //this check is required because ElementImpl currently 
++            //this check is required because ElementImpl currently
+             // implements SOAPBodyElement
+             !(element.getClass().equals(ElementImpl.class))) {
+             return (SOAPElement) element;
+@@ -304,7 +299,7 @@
+ 
+         Document document = null;
+         try {
+-            DocumentBuilderFactory factory = 
++            DocumentBuilderFactory factory =
+                 new com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl();
+             factory.setNamespaceAware(true);
+             DocumentBuilder builder = factory.newDocumentBuilder();
+@@ -322,7 +317,7 @@
+             throw new SOAPExceptionImpl(
+                 "Unable to extract Document from body", e);
+         }
+-            
++
+         firstBodyElement.detachNode();
+ 
+         return document;
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/CDATAImpl.java	Thu Jul 30 18:09:00 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/CDATAImpl.java	Thu Jul 30 18:09:00 2009
+@@ -22,11 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * 
+- * 
+- * 
+- */
+ 
+ 
+ package com.sun.xml.internal.messaging.saaj.soap.impl;
+@@ -46,7 +41,7 @@
+     protected static final Logger log =
+         Logger.getLogger(LogDomainConstants.SOAP_IMPL_DOMAIN,
+                          "com.sun.xml.internal.messaging.saaj.soap.impl.LocalStrings");
+-    
++
+     static final String cdataUC = "<![CDATA[";
+     static final String cdataLC = "<![cdata[";
+ 
+@@ -58,7 +53,7 @@
+         String nodeValue = getNodeValue();
+         return (nodeValue.equals("") ? null : nodeValue);
+     }
+-    
++
+     public void setValue(String text) {
+         setNodeValue(text);
+     }
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/CommentImpl.java	Thu Jul 30 18:09:04 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/CommentImpl.java	Thu Jul 30 18:09:03 2009
+@@ -22,11 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * 
+- * 
+- * 
+- */
+ 
+ 
+ package com.sun.xml.internal.messaging.saaj.soap.impl;
+@@ -45,7 +40,7 @@
+ 
+ public class CommentImpl
+     extends com.sun.org.apache.xerces.internal.dom.CommentImpl
+-    implements javax.xml.soap.Text, org.w3c.dom.Comment { 
++    implements javax.xml.soap.Text, org.w3c.dom.Comment {
+ 
+     protected static final Logger log =
+         Logger.getLogger(LogDomainConstants.SOAP_IMPL_DOMAIN,
+@@ -52,7 +47,7 @@
+                          "com.sun.xml.internal.messaging.saaj.soap.impl.LocalStrings");
+     protected static ResourceBundle rb =
+         log.getResourceBundle();
+-    
++
+     public CommentImpl(SOAPDocumentImpl ownerDoc, String text) {
+         super(ownerDoc, text);
+     }
+@@ -61,12 +56,12 @@
+         String nodeValue = getNodeValue();
+         return (nodeValue.equals("") ? null : nodeValue);
+     }
+-    
++
+     public void setValue(String text) {
+         setNodeValue(text);
+     }
+-    
+ 
++
+     public void setParentElement(SOAPElement element) throws SOAPException {
+         if (element == null) {
+             log.severe("SAAJ0112.impl.no.null.to.parent.elem");
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/DetailEntryImpl.java	Thu Jul 30 18:09:08 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/DetailEntryImpl.java	Thu Jul 30 18:09:07 2009
+@@ -22,11 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * $Id: DetailEntryImpl.java,v 1.8 2006/01/27 12:49:34 vj135062 Exp $
+- * $Revision: 1.8 $
+- * $Date: 2006/01/27 12:49:34 $
+- */
+ 
+ 
+ package com.sun.xml.internal.messaging.saaj.soap.impl;
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/DetailImpl.java	Thu Jul 30 18:09:11 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/DetailImpl.java	Thu Jul 30 18:09:10 2009
+@@ -22,13 +22,9 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * $Id: DetailImpl.java,v 1.16 2006/01/27 12:49:34 vj135062 Exp $
+- * $Revision: 1.16 $
+- * $Date: 2006/01/27 12:49:34 $
+- */
+ 
+ 
++
+ package com.sun.xml.internal.messaging.saaj.soap.impl;
+ 
+ import java.util.Iterator;
+@@ -125,4 +121,28 @@
+        return true;
+    }
+ 
++    //overriding this method since the only two uses of this method
++    // are in ElementImpl and DetailImpl
++    //whereas the original base impl does the correct job for calls to it inside ElementImpl
++    // But it would not work for DetailImpl.
++    protected SOAPElement circumventBug5034339(SOAPElement element) {
++
++        Name elementName = element.getElementName();
++        if (!isNamespaceQualified(elementName)) {
++            String prefix = elementName.getPrefix();
++            String defaultNamespace = getNamespaceURI(prefix);
++            if (defaultNamespace != null) {
++                Name newElementName =
++                    NameImpl.create(
++                        elementName.getLocalName(),
++                        elementName.getPrefix(),
++                        defaultNamespace);
++                SOAPElement newElement = createDetailEntry(newElementName);
++                replaceChild(newElement, element);
++                return newElement;
++            }
++        }
++        return element;
++    }
++
+ }
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/ElementFactory.java	Thu Jul 30 18:09:15 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/ElementFactory.java	Thu Jul 30 18:09:14 2009
+@@ -22,11 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * $Id: ElementFactory.java,v 1.16 2006/01/27 12:49:35 vj135062 Exp $
+- * $Revision: 1.16 $
+- * $Date: 2006/01/27 12:49:35 $
+- */
+ 
+ 
+ package com.sun.xml.internal.messaging.saaj.soap.impl;
+@@ -152,8 +147,8 @@
+                 return new Detail1_2Impl(ownerDocument, prefix);
+             }
+         }
+-        if (localName.equalsIgnoreCase("faultcode") 
+-            || localName.equalsIgnoreCase("faultstring") 
++        if (localName.equalsIgnoreCase("faultcode")
++            || localName.equalsIgnoreCase("faultstring")
+             || localName.equalsIgnoreCase("faultactor")) {
+             // SOAP 1.2 does not have fault(code/string/actor)
+             // So there is no else case required
+@@ -166,7 +161,7 @@
+ 
+         return null;
+     }
+-    
++
+     protected static void invalidCreate(String msg) {
+         throw new TreeException(msg);
+     }
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/ElementImpl.java	Thu Jul 30 18:09:18 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/ElementImpl.java	Thu Jul 30 18:09:17 2009
+@@ -22,11 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * 
+- * 
+- * 
+- */
+ 
+ 
+ package com.sun.xml.internal.messaging.saaj.soap.impl;
+@@ -38,7 +33,6 @@
+ import javax.xml.namespace.QName;
+ import javax.xml.soap.*;
+ 
+-import com.sun.org.apache.xerces.internal.xni.NamespaceContext;
+ import org.w3c.dom.*;
+ import org.w3c.dom.Node;
+ 
+@@ -64,6 +58,19 @@
+         Logger.getLogger(LogDomainConstants.SOAP_IMPL_DOMAIN,
+                          "com.sun.xml.internal.messaging.saaj.soap.impl.LocalStrings");
+ 
++    /**
++     * XML Information Set REC
++     * all namespace attributes (including those named xmlns,
++     * whose [prefix] property has no value) have a namespace URI of http://www.w3.org/2000/xmlns/
++     */
++    public final static String XMLNS_URI = "http://www.w3.org/2000/xmlns/".intern();
++
++    /**
++     * The XML Namespace ("http://www.w3.org/XML/1998/namespace"). This is
++     * the Namespace URI that is automatically mapped to the "xml" prefix.
++     */
++    public final static String XML_URI = "http://www.w3.org/XML/1998/namespace".intern();
++
+     public ElementImpl(SOAPDocumentImpl ownerDoc, Name name) {
+         super(
+             ownerDoc,
+@@ -128,7 +135,7 @@
+         throws SOAPException {
+         String uri = getNamespaceURI(prefix);
+         if (uri == null) {
+-            log.log( 
++            log.log(
+                 Level.SEVERE,
+                 "SAAJ0101.impl.parent.of.body.elem.mustbe.body",
+                 new String[] { prefix });
+@@ -141,11 +148,11 @@
+     public String getNamespaceURI(String prefix) {
+ 
+         if ("xmlns".equals(prefix)) {
+-            return NamespaceContext.XMLNS_URI;
++            return XMLNS_URI;
+         }
+-        
++
+         if("xml".equals(prefix)) {
+-            return NamespaceContext.XML_URI;
++            return XML_URI;
+         }
+ 
+         if ("".equals(prefix)) {
+@@ -167,11 +174,11 @@
+                         }
+                     }*/
+                     if (((Element) currentAncestor).hasAttributeNS(
+-                            NamespaceContext.XMLNS_URI, "xmlns")) {
++                            XMLNS_URI, "xmlns")) {
+ 
+                         String uri =
+                             ((Element) currentAncestor).getAttributeNS(
+-                                NamespaceContext.XMLNS_URI, "xmlns");
++                                XMLNS_URI, "xmlns");
+                         if ("".equals(uri))
+                             return null;
+                         else {
+@@ -185,12 +192,12 @@
+         } else if (prefix != null) {
+             // Find if there's an ancester whose name contains this prefix
+             org.w3c.dom.Node currentAncestor = this;
+-            
++
+ //            String uri = currentAncestor.lookupNamespaceURI(prefix);
+ //            return uri;
+             while (currentAncestor != null &&
+                    !(currentAncestor instanceof Document)) {
+-                
++
+                /* if (prefix.equals(currentAncestor.getPrefix())) {
+                     String uri = currentAncestor.getNamespaceURI();
+                     // this is because the javadoc says getNamespaceURI() is not a computed value
+@@ -202,11 +209,11 @@
+                 //if (uri != null) {
+                 //    return uri;
+                 //}
+-                
++
+                 if (((Element) currentAncestor).hasAttributeNS(
+-                        NamespaceContext.XMLNS_URI, prefix)) {
++                        XMLNS_URI, prefix)) {
+                     return ((Element) currentAncestor).getAttributeNS(
+-                               NamespaceContext.XMLNS_URI, prefix);
++                               XMLNS_URI, prefix);
+                 }
+ 
+                 currentAncestor = currentAncestor.getParentNode();
+@@ -222,13 +229,13 @@
+         return replaceElementWithSOAPElement(this,copy);
+     }
+ 
+-    public QName createQName(String localName, String prefix) 
++    public QName createQName(String localName, String prefix)
+         throws SOAPException {
+         String uri = getNamespaceURI(prefix);
+         if (uri == null) {
+             log.log(Level.SEVERE, "SAAJ0102.impl.cannot.locate.ns",
+                     new Object[] {prefix});
+-            throw new SOAPException("Unable to locate namespace for prefix " 
++            throw new SOAPException("Unable to locate namespace for prefix "
+                                     + prefix);
+         }
+         return new QName(uri, localName, prefix);
+@@ -291,7 +298,7 @@
+         String prefix,
+         String uri)
+         throws SOAPException {
+-        
++
+         SOAPElement newElement = createElement(NameImpl.create(localName, prefix, uri));
+         addNode(newElement);
+         return convertToSoapElement(newElement);
+@@ -308,7 +315,7 @@
+             || (SOAPConstants.URI_NS_SOAP_1_2_ENVELOPE).equals(elementURI)) {
+ 
+ 
+-            if ("Envelope".equalsIgnoreCase(localName) || 
++            if ("Envelope".equalsIgnoreCase(localName) ||
+                 "Header".equalsIgnoreCase(localName) || "Body".equalsIgnoreCase(localName)) {
+                 log.severe("SAAJ0103.impl.cannot.add.fragements");
+                 throw new SOAPExceptionImpl(
+@@ -319,7 +326,7 @@
+             if ("Fault".equalsIgnoreCase(localName) && !"Body".equalsIgnoreCase(this.getLocalName())) {
+                 log.severe("SAAJ0154.impl.adding.fault.to.nonbody");
+                 throw new SOAPExceptionImpl("Cannot add a SOAPFault as a child of " + this.getLocalName());
+-            } 
++            }
+ 
+             if ("Detail".equalsIgnoreCase(localName) && !"Fault".equalsIgnoreCase(this.getLocalName())) {
+                 log.severe("SAAJ0155.impl.adding.detail.nonfault");
+@@ -338,7 +345,7 @@
+                    throw new SOAPExceptionImpl("Cannot add SOAPFault as a child of a non-Empty SOAPBody");
+                }
+             }
+-        }    
++        }
+ 
+         // preserve the encodingStyle attr as it may get lost in the import
+         String encodingStyle = element.getEncodingStyle();
+@@ -405,7 +412,7 @@
+ 
+         if (getOwnerDocument() instanceof DocumentFragment)
+             return;
+-                                                                                
++
+         if (newElement instanceof ElementImpl) {
+             ElementImpl element = (ElementImpl) newElement;
+             QName elementName = element.getElementQName();
+@@ -472,7 +479,7 @@
+     private void addAttributeBare(Name name, String value) {
+         addAttributeBare(
+             name.getURI(),
+-            name.getPrefix(), 
++            name.getPrefix(),
+             name.getQualifiedName(),
+             value);
+     }
+@@ -479,7 +486,7 @@
+     private void addAttributeBare(QName name, String value) {
+         addAttributeBare(
+             name.getNamespaceURI(),
+-            name.getPrefix(), 
++            name.getPrefix(),
+             getQualifiedName(name),
+             value);
+     }
+@@ -486,15 +493,15 @@
+ 
+     private void addAttributeBare(
+         String uri,
+-        String prefix, 
++        String prefix,
+         String qualifiedName,
+         String value) {
+ 
+         uri = uri.length() == 0 ? null : uri;
+         if (qualifiedName.equals("xmlns")) {
+-            uri = NamespaceContext.XMLNS_URI;
++            uri = XMLNS_URI;
+         }
+-        
++
+         if (uri == null) {
+             setAttribute(qualifiedName, value);
+         } else {
+@@ -505,9 +512,9 @@
+     public SOAPElement addNamespaceDeclaration(String prefix, String uri)
+         throws SOAPException {
+         if (prefix.length() > 0) {
+-            setAttributeNS(NamespaceContext.XMLNS_URI, "xmlns:" + prefix, uri);
++            setAttributeNS(XMLNS_URI, "xmlns:" + prefix, uri);
+         } else {
+-            setAttributeNS(NamespaceContext.XMLNS_URI, "xmlns", uri);
++            setAttributeNS(XMLNS_URI, "xmlns", uri);
+         }
+         //Fix for CR:6474641
+         //tryToFindEncodingStyleAttributeName();
+@@ -515,7 +522,7 @@
+     }
+ 
+     public String getAttributeValue(Name name) {
+-        return getAttributeValueFrom(this, name); 
++        return getAttributeValueFrom(this, name);
+     }
+ 
+     public String getAttributeValue(QName qname) {
+@@ -667,7 +674,7 @@
+             Name name = (Name) eachAttribute.next();
+             copy.addAttributeBare(name, getAttributeValueFrom(element, name));
+         }
+-        
++
+         Iterator eachChild = getChildElementsFrom(element);
+         while (eachChild.hasNext()) {
+             Node nextChild = (Node) eachChild.next();
+@@ -728,7 +735,7 @@
+     public Iterator getChildElements(final QName qname) {
+         return getChildElements(qname.getNamespaceURI(), qname.getLocalPart());
+     }
+-    
++
+     private Iterator getChildElements(final String nameUri, final String nameLocal) {
+         return new Iterator() {
+             Iterator eachElement = getChildElementNodes();
+@@ -867,10 +874,10 @@
+             javax.xml.soap.Node n = (javax.xml.soap.Node) i.next();
+             if (n.getNodeType() == org.w3c.dom.Node.TEXT_NODE ||
+                 n.getNodeType() == org.w3c.dom.Node.CDATA_SECTION_NODE) {
+-                // TODO: Hack to fix text node split into multiple lines.                
++                // TODO: Hack to fix text node split into multiple lines.
+                 normalize();
+                 // Should remove the normalization step when this gets fixed in
+-                // DOM/Xerces.                
++                // DOM/Xerces.
+                 return (javax.xml.soap.Node) n;
+             }
+         }
+@@ -1066,7 +1073,7 @@
+       return getAttributeValueFrom(
+           element,
+           name.getURI(),
+-          name.getLocalName(), 
++          name.getLocalName(),
+           name.getPrefix(),
+           name.getQualifiedName());
+     }
+@@ -1073,7 +1080,7 @@
+ 
+     private static String getAttributeValueFrom(
+         Element element,
+-        String uri, 
++        String uri,
+         String localName,
+         String prefix,
+         String qualifiedName) {
+@@ -1169,7 +1176,7 @@
+         int index = qualifiedName.indexOf(':');
+         if (index < 0)
+             return qualifiedName;
+-        else 
++        else
+             return qualifiedName.substring(index + 1);
+     }
+ 
+@@ -1182,7 +1189,7 @@
+         int index = qualifiedName.indexOf(':');
+         if (index < 0)
+             return "";
+-        else 
++        else
+             return qualifiedName.substring(0, index);
+     }
+ 
+@@ -1229,7 +1236,7 @@
+             prefix = qualifiedName.substring(0, index);
+             localName = qualifiedName.substring(index + 1);
+         }
+-        
++
+         // Workaround for bug 6467808 - This needs to be fixed in JAXP
+ 
+         // Rolling back this fix, this is a wrong fix, infact its causing other regressions in JAXWS tck and
+@@ -1239,7 +1246,7 @@
+ //                (SOAPConstants.URI_NS_SOAP_1_1_ENVELOPE.equals(value) ||
+ //                SOAPConstants.URI_NS_SOAP_1_2_ENVELOPE.equals(value)))
+ //            return;
+-        
++
+         super.setAttributeNS(namespaceURI,qualifiedName,value);
+         //String tmpLocalName = this.getLocalName();
+         String tmpURI = this.getNamespaceURI();
+@@ -1256,7 +1263,7 @@
+                 setIdAttributeNS(namespaceURI,localName,true);
+             }
+         }
+-                                                                                                                               
++
+     }
+ 
+ }
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/EnvelopeImpl.java	Thu Jul 30 18:09:22 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/EnvelopeImpl.java	Thu Jul 30 18:09:21 2009
+@@ -22,11 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * $Id: EnvelopeImpl.java,v 1.1.1.1 2006/01/27 13:10:56 kumarjayanti Exp $
+- * $Revision: 1.1.1.1 $
+- * $Date: 2006/01/27 13:10:56 $
+- */
+ 
+ 
+ package com.sun.xml.internal.messaging.saaj.soap.impl;
+@@ -64,7 +59,7 @@
+     String omitXmlDecl = "yes";
+     String charset = "utf-8";
+     String xmlDecl = null;
+-    
++
+     protected EnvelopeImpl(SOAPDocumentImpl ownerDoc, Name name) {
+         super(ownerDoc, name);
+     }
+@@ -98,16 +93,16 @@
+     public SOAPHeader addHeader() throws SOAPException {
+         return addHeader(null);
+     }
+-    
++
+     public SOAPHeader addHeader(String prefix) throws SOAPException {
+-        
++
+         if (prefix == null || prefix.equals("")) {
+             prefix = getPrefix();
+         }
+-        
++
+         NameImpl headerName = getHeaderName(prefix);
+         NameImpl bodyName = getBodyName(prefix);
+-        
++
+         HeaderImpl header = null;
+         SOAPElement firstChild = null;
+ 
+@@ -152,7 +147,7 @@
+     public SOAPBody addBody() throws SOAPException {
+         return addBody(null);
+     }
+-    
++
+     public SOAPBody addBody(String prefix) throws SOAPException {
+         lookForBody();
+ 
+@@ -159,7 +154,7 @@
+         if (prefix == null || prefix.equals("")) {
+             prefix = getPrefix();
+         }
+-        
++
+         if (body == null) {
+             NameImpl bodyName = getBodyName(prefix);
+             body = (BodyImpl) createElement(bodyName);
+@@ -230,7 +225,7 @@
+         if (namespace == null) {
+             log.log(
+                 Level.SEVERE,
+-                "SAAJ0126.impl.cannot.locate.ns", 
++                "SAAJ0126.impl.cannot.locate.ns",
+                 new String[] { prefix });
+             throw new SOAPExceptionImpl(
+                 "Unable to locate namespace for prefix " + prefix);
+@@ -241,23 +236,23 @@
+     public Name createName(String localName) throws SOAPException {
+         return NameImpl.createFromUnqualifiedName(localName);
+     }
+-    
++
+     public void setOmitXmlDecl(String value) {
+-        this.omitXmlDecl = value;        
++        this.omitXmlDecl = value;
+     }
+ 
+     public void setXmlDecl(String value) {
+-        this.xmlDecl = value;        
++        this.xmlDecl = value;
+     }
+-    
++
+     private String getOmitXmlDecl() {
+         return this.omitXmlDecl;
+     }
+-    
++
+     public void setCharsetEncoding(String value) {
+         charset = value;
+     }
+-    
++
+     public void output(OutputStream out) throws IOException {
+         try {
+             Transformer transformer =
+@@ -268,14 +263,14 @@
+                 /*omitXmlDecl);*/
+             // no equivalent for "setExpandEmptyElements"
+             transformer.setOutputProperty(
+-                OutputKeys.ENCODING, 
++                OutputKeys.ENCODING,
+                 charset);
+ 
+             if (omitXmlDecl.equals("no") && xmlDecl == null) {
+-                xmlDecl = "<?xml version=\"" + getOwnerDocument().getXmlVersion() + "\" encoding=\"" + 
++                xmlDecl = "<?xml version=\"" + getOwnerDocument().getXmlVersion() + "\" encoding=\"" +
+                     charset + "\" ?>";
+             }
+-        
++
+            StreamResult result = new StreamResult(out);
+             if (xmlDecl != null) {
+                 OutputStreamWriter writer = new OutputStreamWriter(out, charset);
+@@ -283,17 +278,17 @@
+                 writer.flush();
+                 result = new StreamResult(writer);
+             }
+-           
+ 
++
+             log.log(
+                 Level.FINE,
+-                "SAAJ0190.impl.set.xml.declaration", 
+-                new String[] { omitXmlDecl });                
++                "SAAJ0190.impl.set.xml.declaration",
++                new String[] { omitXmlDecl });
+             log.log(
+                 Level.FINE,
+-                "SAAJ0191.impl.set.encoding", 
++                "SAAJ0191.impl.set.encoding",
+                 new String[] { charset });
+-                
++
+             //StreamResult result = new StreamResult(out);
+             transformer.transform(getContent(), result);
+         } catch (Exception ex) {
+@@ -300,12 +295,12 @@
+             throw new IOException(ex.getMessage());
+         }
+     }
+-            
++
+     /**
+      * Serialize to FI if boolean parameter set.
+      */
+-    public void output(OutputStream out, boolean isFastInfoset) 
+-        throws IOException 
++    public void output(OutputStream out, boolean isFastInfoset)
++        throws IOException
+     {
+         if (!isFastInfoset) {
+             output(out);
+@@ -314,7 +309,7 @@
+             try {
+                 // Run transform and generate FI output from content
+                 Source source = getContent();
+-                Transformer transformer = EfficientStreamingTransformer.newTransformer(); 
++                Transformer transformer = EfficientStreamingTransformer.newTransformer();
+                     transformer.transform(getContent(),
+                         FastInfosetReflection.FastInfosetResult_new(out));
+             }
+@@ -367,4 +362,3 @@
+                                 + newName.getLocalPart());
+      }
+ }
+-
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/FaultElementImpl.java	Thu Jul 30 18:09:26 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/FaultElementImpl.java	Thu Jul 30 18:09:25 2009
+@@ -22,11 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * $Id: FaultElementImpl.java,v 1.10 2006/01/27 12:49:35 vj135062 Exp $
+- * $Revision: 1.10 $
+- * $Date: 2006/01/27 12:49:35 $
+- */
+ 
+ 
+ package com.sun.xml.internal.messaging.saaj.soap.impl;
+@@ -42,14 +37,14 @@
+ import com.sun.xml.internal.messaging.saaj.soap.name.NameImpl;
+ 
+ public abstract class FaultElementImpl
+-    extends ElementImpl 
++    extends ElementImpl
+     implements SOAPFaultElement {
+ 
+-    protected FaultElementImpl(SOAPDocumentImpl ownerDoc, NameImpl qname) { 
++    protected FaultElementImpl(SOAPDocumentImpl ownerDoc, NameImpl qname) {
+         super(ownerDoc, qname);
+     }
+ 
+-    protected FaultElementImpl(SOAPDocumentImpl ownerDoc, QName qname) { 
++    protected FaultElementImpl(SOAPDocumentImpl ownerDoc, QName qname) {
+         super(ownerDoc, qname);
+     }
+ 
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/FaultImpl.java	Thu Jul 30 18:09:29 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/FaultImpl.java	Thu Jul 30 18:09:28 2009
+@@ -22,11 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * $Id: FaultImpl.java,v 1.2 2006/11/16 17:39:10 kumarjayanti Exp $
+- * $Revision: 1.2 $
+- * $Date: 2006/11/16 17:39:10 $
+- */
+ 
+ 
+ package com.sun.xml.internal.messaging.saaj.soap.impl;
+@@ -100,7 +95,7 @@
+         throws SOAPException {
+ 
+         if (prefix == null || prefix.equals("")) {
+-            if (uri == null || uri.equals("")) {
++            if (uri == null) {
+                 log.severe("SAAJ0140.impl.no.ns.URI");
+                 throw new SOAPExceptionImpl("No NamespaceURI, SOAP requires faultcode content to be a QName");
+             }
+@@ -117,11 +112,11 @@
+             this.faultCodeElement = addFaultCodeElement();
+         else
+             this.faultCodeElement.removeContents();
+- 
++
+         if (uri == null || uri.equals("")) {
+             uri = this.faultCodeElement.getNamespaceURI(prefix);
+         }
+-        if (uri == null || uri.equals("")) {
++        if (uri == null) {
+             log.severe("SAAJ0140.impl.no.ns.URI");
+             throw new SOAPExceptionImpl("No NamespaceURI, SOAP requires faultcode content to be a QName");
+         } else {
+@@ -214,7 +209,7 @@
+     }
+ 
+     public SOAPElement setElementQName(QName newName) throws SOAPException {
+-        
++
+         log.log(
+             Level.SEVERE,
+             "SAAJ0146.impl.invalid.name.change.requested",
+@@ -224,7 +219,7 @@
+     }
+ 
+     protected SOAPElement convertToSoapElement(Element element) {
+-        if (element instanceof SOAPFaultElement) { 
++        if (element instanceof SOAPFaultElement) {
+             return (SOAPElement) element;
+         } else if (element instanceof SOAPElement) {
+             SOAPElement soapElement = (SOAPElement) element;
+@@ -235,7 +230,7 @@
+                     soapElement.getElementName().getLocalName();
+                 if (isStandardFaultElement(localName))
+                     return replaceElementWithSOAPElement(
+-                               element, 
++                               element,
+                                createSOAPFaultElement(soapElement.getElementQName()));
+                 return soapElement;
+             }
+@@ -256,7 +251,7 @@
+         }
+     }
+ 
+-    private SOAPFaultElement addFaultCodeElement() throws SOAPException {
++    protected SOAPFaultElement addFaultCodeElement() throws SOAPException {
+         if (this.faultCodeElement == null)
+             findFaultCodeElement();
+         if (this.faultCodeElement == null) {
+@@ -311,7 +306,7 @@
+         return addElement(NameImpl.convertToName(name));
+     }
+ 
+-    protected FaultElementImpl addSOAPFaultElement(String localName) 
++    protected FaultElementImpl addSOAPFaultElement(String localName)
+         throws SOAPException {
+ 
+         FaultElementImpl faultElem = createSOAPFaultElement(localName);
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/HeaderElementImpl.java	Thu Jul 30 18:09:33 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/HeaderElementImpl.java	Thu Jul 30 18:09:32 2009
+@@ -22,11 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * $Id: HeaderElementImpl.java,v 1.26 2006/01/27 12:49:35 vj135062 Exp $
+- * $Revision: 1.26 $
+- * $Date: 2006/01/27 12:49:35 $
+- */
+ 
+ 
+ package com.sun.xml.internal.messaging.saaj.soap.impl;
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/HeaderImpl.java	Thu Jul 30 18:09:36 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/HeaderImpl.java	Thu Jul 30 18:09:36 2009
+@@ -22,11 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * $Id: HeaderImpl.java,v 1.33 2006/01/27 12:49:35 vj135062 Exp $
+- * $Revision: 1.33 $
+- * $Date: 2006/01/27 12:49:35 $
+- */
+ 
+ 
+ package com.sun.xml.internal.messaging.saaj.soap.impl;
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/LocalStrings.properties	Thu Jul 30 18:09:40 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/LocalStrings.properties	Thu Jul 30 18:09:39 2009
+@@ -46,7 +46,7 @@
+ SAAJ0123.impl.no.reserved.xmlns=SAAJ0123: Cannot declare reserved xmlns prefix
+ SAAJ0124.impl.qualified.name.cannot.be.xmlns=SAAJ0124: Qualified name cannot be xmlns
+ #SAAJ0125.impl.URI.cannot.be.null=SAAJ0125: URI cannot be null
+-SAAJ0126.impl.cannot.locate.ns=SAAJ0126: Unable to locate namespace for prefix {0} 
++SAAJ0126.impl.cannot.locate.ns=SAAJ0126: Unable to locate namespace for prefix {0}
+ SAAJ0127.impl.no.null.for.parent.elem=SAAJ0127: Cannot pass NULL to setParentElement
+ 
+ SAAJ0130.impl.header.elem.parent.mustbe.header=SAAJ0130: Parent of a SOAPHeaderElement has to be a SOAPHeader
+@@ -83,4 +83,3 @@
+ # Info messages
+ SAAJ0190.impl.set.xml.declaration=SAAJ0190: Omit XML declaration set to {0}
+ SAAJ0191.impl.set.encoding=SAAJ0191: Encoding is set to {0}
+- 
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/TextImpl.java	Thu Jul 30 18:09:43 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/TextImpl.java	Thu Jul 30 18:09:43 2009
+@@ -22,11 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * 
+- * 
+- * 
+- */
+ 
+ 
+ package com.sun.xml.internal.messaging.saaj.soap.impl;
+@@ -46,7 +41,7 @@
+     protected static final Logger log =
+         Logger.getLogger(LogDomainConstants.SOAP_IMPL_DOMAIN,
+                          "com.sun.xml.internal.messaging.saaj.soap.impl.LocalStrings");
+-    
++
+     public TextImpl(SOAPDocumentImpl ownerDoc, String text) {
+         super(ownerDoc, text);
+     }
+@@ -55,7 +50,7 @@
+         String nodeValue = getNodeValue();
+         return (nodeValue.equals("") ? null : nodeValue);
+     }
+-    
++
+     public void setValue(String text) {
+         setNodeValue(text);
+     }
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/TreeException.java	Thu Jul 30 18:09:47 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/TreeException.java	Thu Jul 30 18:09:46 2009
+@@ -22,11 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * $Id: TreeException.java,v 1.5 2006/01/27 12:49:36 vj135062 Exp $
+- * $Revision: 1.5 $
+- * $Date: 2006/01/27 12:49:36 $
+- */
+ 
+ 
+ package com.sun.xml.internal.messaging.saaj.soap.impl;
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/name/LocalStrings.properties	Thu Jul 30 18:09:50 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/name/LocalStrings.properties	Thu Jul 30 18:09:50 2009
+@@ -28,4 +28,3 @@
+ # Error messages
+ SAAJ0201.name.not.created.from.null.tag=SAAJ0201: Cannot create a name from a null tag
+ SAAJ0202.name.invalid.arg.format=SAAJ0202: Argument "{0}" must be of the form: prefix:localName
+- 
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/name/NameImpl.java	Thu Jul 30 18:09:54 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/name/NameImpl.java	Thu Jul 30 18:09:53 2009
+@@ -22,11 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * 
+- * 
+- * 
+- */
+ 
+ 
+ package com.sun.xml.internal.messaging.saaj.soap.name;
+@@ -38,10 +33,8 @@
+ import javax.xml.soap.Name;
+ import javax.xml.soap.SOAPConstants;
+ 
+-import com.sun.org.apache.xerces.internal.xni.NamespaceContext;
++//import com.sun.org.apache.xerces.internal.xni.NamespaceContext;
+ import org.w3c.dom.Element;
+-
+-import com.sun.xml.internal.messaging.saaj.soap.impl.ElementImpl;
+ import com.sun.xml.internal.messaging.saaj.util.LogDomainConstants;
+ 
+ public class NameImpl implements Name {
+@@ -66,7 +59,14 @@
+     protected static final Logger log =
+         Logger.getLogger(LogDomainConstants.NAMING_DOMAIN,
+                          "com.sun.xml.internal.messaging.saaj.soap.name.LocalStrings");
+-    
++
++    /**
++     * XML Information Set REC
++     * all namespace attributes (including those named xmlns,
++     * whose [prefix] property has no value) have a namespace URI of http://www.w3.org/2000/xmlns/
++     */
++    public final static String XMLNS_URI = "http://www.w3.org/2000/xmlns/".intern();
++
+     protected NameImpl(String name) {
+         this.localName = name == null ? "" : name;
+     }
+@@ -77,23 +77,23 @@
+         this.prefix = prefix == null ? "" : prefix;
+ 
+         if (this.prefix.equals("xmlns") && this.uri.equals("")) {
+-            this.uri = NamespaceContext.XMLNS_URI;
++            this.uri = XMLNS_URI;
+         }
+-        if (this.uri.equals(NamespaceContext.XMLNS_URI) && this.prefix.equals("")) {
++        if (this.uri.equals(XMLNS_URI) && this.prefix.equals("")) {
+             this.prefix = "xmlns";
+         }
+     }
+ 
+     public static Name convertToName(QName qname) {
+-        return new NameImpl(qname.getLocalPart(), 
+-                            qname.getPrefix(), 
++        return new NameImpl(qname.getLocalPart(),
++                            qname.getPrefix(),
+                             qname.getNamespaceURI());
+     }
+ 
+     public static QName convertToQName(Name name) {
+         return new QName(name.getURI(),
+-			 name.getLocalName(),
+-                         name.getPrefix()); 
++                         name.getLocalName(),
++                         name.getPrefix());
+     }
+ 
+     public static NameImpl createFromUnqualifiedName(String name) {
+@@ -129,7 +129,7 @@
+     protected static int getPrefixSeparatorIndex(String qualifiedName) {
+         int index = qualifiedName.indexOf(':');
+         if (index < 0) {
+-            log.log( 
++            log.log(
+                 Level.SEVERE,
+                 "SAAJ0202.name.invalid.arg.format",
+                 new String[] { qualifiedName });
+@@ -470,7 +470,7 @@
+     FaultElement1_1Name(String localName) {
+         super(localName);
+     }
+-    
++
+     FaultElement1_1Name(String localName, String prefix) {
+         super(localName, prefix, "");
+     }
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Body1_1Impl.java	Thu Jul 30 18:09:57 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Body1_1Impl.java	Thu Jul 30 18:09:57 2009
+@@ -22,9 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * $Id: Body1_1Impl.java,v 1.14 2006/01/27 12:49:38 vj135062 Exp $
+- */
+ 
+ 
+ 
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/BodyElement1_1Impl.java	Thu Jul 30 18:10:01 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/BodyElement1_1Impl.java	Thu Jul 30 18:10:00 2009
+@@ -22,9 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * $Id: BodyElement1_1Impl.java,v 1.13 2006/01/27 12:49:39 vj135062 Exp $
+- */
+ 
+ 
+ 
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Detail1_1Impl.java	Thu Jul 30 18:10:05 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Detail1_1Impl.java	Thu Jul 30 18:10:04 2009
+@@ -22,9 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * $Id: Detail1_1Impl.java,v 1.12 2006/01/27 12:49:40 vj135062 Exp $
+- */
+ 
+ 
+ 
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/DetailEntry1_1Impl.java	Thu Jul 30 18:10:08 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/DetailEntry1_1Impl.java	Thu Jul 30 18:10:08 2009
+@@ -22,9 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * $Id: DetailEntry1_1Impl.java,v 1.13 2006/01/27 12:49:40 vj135062 Exp $
+- */
+ 
+ 
+ 
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Envelope1_1Impl.java	Thu Jul 30 18:10:12 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Envelope1_1Impl.java	Thu Jul 30 18:10:11 2009
+@@ -22,9 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * $Id: Envelope1_1Impl.java,v 1.8 2006/01/27 12:49:41 vj135062 Exp $
+- */
+ 
+ 
+ 
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Fault1_1Impl.java	Thu Jul 30 18:10:15 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Fault1_1Impl.java	Thu Jul 30 18:10:15 2009
+@@ -22,9 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * 
+- */
+ 
+ 
+ 
+@@ -315,4 +312,65 @@
+                        (NameImpl)qname);
+     }
+ 
++    public void setFaultCode(String faultCode, String prefix, String uri)
++        throws SOAPException {
++        if (prefix == null || prefix.equals("")) {
++            if (uri != null && !"".equals(uri)) {
++                prefix = getNamespacePrefix(uri);
++                if (prefix == null || prefix.equals("")) {
++                    prefix = "ns0";
++                }
++            }
++        }
++
++
++        if (this.faultCodeElement == null)
++            findFaultCodeElement();
++
++        if (this.faultCodeElement == null)
++            this.faultCodeElement = addFaultCodeElement();
++        else
++            this.faultCodeElement.removeContents();
++
++        if (uri == null || uri.equals("")) {
++            if (prefix != null && !"".equals("prefix")) {
++                uri = this.faultCodeElement.getNamespaceURI(prefix);
++            }
++        }
++
++//        if (standardFaultCode(faultCode) &&
++//                ((uri == null) || uri.equals(""))) {
++//             log.log(Level.WARNING, "SAAJ0306.ver1_1.faultcode.incorrect.namespace", new Object[]{faultCode});
++//               // throw new SOAPExceptionImpl("Namespace Error, Standard Faultcode: " +  faultCode + ", should be in SOAP 1.1 Namespace");
++//        }
++
++        if (uri == null) {
++            //SOAP 1.1 Allows this
++            if (prefix != null && !"".equals(prefix)) {
++                log.severe("SAAJ0140.impl.no.ns.URI");
++                throw new SOAPExceptionImpl("No NamespaceURI, SOAP requires faultcode content to be a QName");
++            }
++        } else {
++            checkIfStandardFaultCode(faultCode, uri);
++            ((FaultElementImpl) this.faultCodeElement).ensureNamespaceIsDeclared(prefix, uri);
++        }
++
++        if (prefix == null || "".equals(prefix)) {
++            finallySetFaultCode(faultCode);
++        } else {
++            finallySetFaultCode(prefix + ":" + faultCode);
++        }
++    }
++
++    private boolean standardFaultCode(String faultCode) {
++        if (faultCode.equals("VersionMismatch") || faultCode.equals("MustUnderstand")
++            || faultCode.equals("Client") || faultCode.equals("Server")) {
++            return true;
++        }
++        if (faultCode.startsWith("VersionMismatch.") || faultCode.startsWith("MustUnderstand.")
++            || faultCode.startsWith("Client.") || faultCode.startsWith("Server.")) {
++            return true;
++        }
++        return false;
++    }
+ }
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/FaultElement1_1Impl.java	Thu Jul 30 18:10:19 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/FaultElement1_1Impl.java	Thu Jul 30 18:10:18 2009
+@@ -22,9 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * $Id: FaultElement1_1Impl.java,v 1.12 2006/01/27 12:49:41 vj135062 Exp $
+- */
+ 
+ 
+ 
+@@ -56,7 +53,7 @@
+                                String localName) {
+         super(ownerDoc, NameImpl.createFaultElement1_1Name(localName));
+     }
+-    
++
+     public FaultElement1_1Impl(SOAPDocumentImpl ownerDoc,
+                                String localName,
+                                String prefix) {
+@@ -65,7 +62,7 @@
+     }
+ 
+     protected boolean isStandardFaultElement() {
+-        String localName = elementQName.getLocalPart(); 
++        String localName = elementQName.getLocalPart();
+         if (localName.equalsIgnoreCase("faultcode") ||
+             localName.equalsIgnoreCase("faultstring") ||
+             localName.equalsIgnoreCase("faultactor")) {
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Header1_1Impl.java	Thu Jul 30 18:10:23 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Header1_1Impl.java	Thu Jul 30 18:10:22 2009
+@@ -22,9 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * 
+- */
+ 
+ 
+ 
+@@ -49,11 +46,11 @@
+ import com.sun.xml.internal.messaging.saaj.util.LogDomainConstants;
+ 
+ public class Header1_1Impl extends HeaderImpl {
+-    
++
+     protected static final Logger log =
+         Logger.getLogger(LogDomainConstants.SOAP_VER1_1_DOMAIN,
+                          "com.sun.xml.internal.messaging.saaj.soap.ver1_1.LocalStrings");
+-        
++
+     public Header1_1Impl(SOAPDocumentImpl ownerDocument, String prefix) {
+             super(ownerDocument, NameImpl.createHeader1_1Name(prefix));
+     }
+@@ -81,7 +78,7 @@
+     }
+ 
+     public SOAPHeaderElement addNotUnderstoodHeaderElement(QName name)
+-        throws SOAPException {            
++        throws SOAPException {
+         log.log(
+             Level.SEVERE,
+             "SAAJ0301.ver1_1.hdr.op.unsupported.in.SOAP1.1",
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/HeaderElement1_1Impl.java	Thu Jul 30 18:10:26 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/HeaderElement1_1Impl.java	Thu Jul 30 18:10:25 2009
+@@ -22,9 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * 
+- */
+ 
+ 
+ 
+@@ -48,11 +45,11 @@
+ import com.sun.xml.internal.messaging.saaj.util.LogDomainConstants;
+ 
+ public class HeaderElement1_1Impl extends HeaderElementImpl {
+-    
++
+     protected static final Logger log =
+         Logger.getLogger(LogDomainConstants.SOAP_VER1_1_DOMAIN,
+                          "com.sun.xml.internal.messaging.saaj.soap.ver1_1.LocalStrings");
+-    
++
+     public HeaderElement1_1Impl(SOAPDocumentImpl ownerDoc, Name qname) {
+         super(ownerDoc, qname);
+     }
+@@ -95,7 +92,7 @@
+     }
+ 
+     // relay not supported by SOAP 1.1
+-    protected NameImpl getRelayAttributeName() {        
++    protected NameImpl getRelayAttributeName() {
+         log.log(
+             Level.SEVERE,
+             "SAAJ0302.ver1_1.hdr.attr.unsupported.in.SOAP1.1",
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/LocalStrings.properties	Thu Jul 30 18:10:30 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/LocalStrings.properties	Thu Jul 30 18:10:29 2009
+@@ -29,7 +29,7 @@
+ # Error messages
+ SAAJ0301.ver1_1.hdr.op.unsupported.in.SOAP1.1=SAAJ0301: Operation {0} not supported by SOAP 1.1
+ SAAJ0302.ver1_1.hdr.attr.unsupported.in.SOAP1.1=SAAJ0302: {0} not supported by SOAP 1.1
+-SAAJ0303.ver1_1.msg.op.unsupported.in.SOAP1.1=SAAJ0303: Operation {0} not supported by SOAP 1.1 
+-SAAJ0304.ver1_1.msg.invalid.SOAP1.1=SAAJ0304: InputStream does not represent a valid SOAP 1.1 Message 
++SAAJ0303.ver1_1.msg.op.unsupported.in.SOAP1.1=SAAJ0303: Operation {0} not supported by SOAP 1.1
++SAAJ0304.ver1_1.msg.invalid.SOAP1.1=SAAJ0304: InputStream does not represent a valid SOAP 1.1 Message
+ SAAJ0305.ver1_2.detail.exists.error=SAAJ0305: Cannot add Detail, Detail already exists
+- 
++SAAJ0306.ver1_1.faultcode.incorrect.namespace=SAAJ0306: Namespace Warning, Standard Faultcode {0}, should ideally be in SOAP 1.1 Namespace
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Message1_1Impl.java	Thu Jul 30 18:10:33 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Message1_1Impl.java	Thu Jul 30 18:10:32 2009
+@@ -22,9 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * 
+- */
+ 
+ 
+ 
+@@ -47,15 +44,15 @@
+ import com.sun.xml.internal.messaging.saaj.util.LogDomainConstants;
+ 
+ public class Message1_1Impl extends MessageImpl implements SOAPConstants {
+-    
++
+     protected static final Logger log =
+         Logger.getLogger(LogDomainConstants.SOAP_VER1_1_DOMAIN,
+                          "com.sun.xml.internal.messaging.saaj.soap.ver1_1.LocalStrings");
+-   
++
+     public Message1_1Impl() {
+         super();
+     }
+-    
++
+     public Message1_1Impl(boolean isFastInfoset, boolean acceptFastInfoset) {
+         super(isFastInfoset, acceptFastInfoset);
+     }
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/SOAPFactory1_1Impl.java	Thu Jul 30 18:10:40 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/SOAPFactory1_1Impl.java	Thu Jul 30 18:10:39 2009
+@@ -22,9 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * $Id: SOAPFactory1_1Impl.java,v 1.1.1.1 2006/01/27 13:10:57 kumarjayanti Exp $
+- */
+ 
+ 
+ 
+@@ -52,7 +49,7 @@
+         return new Detail1_1Impl(createDocument());
+     }
+ 
+-    public SOAPFault createFault(String reasonText, QName faultCode) 
++    public SOAPFault createFault(String reasonText, QName faultCode)
+         throws SOAPException {
+         if (faultCode == null) {
+             throw new IllegalArgumentException("faultCode argument for createFault was passed NULL");
+@@ -61,10 +58,8 @@
+             throw new IllegalArgumentException("reasonText argument for createFault was passed NULL");
+         }
+         Fault1_1Impl fault = new Fault1_1Impl(createDocument(), null);
+-        fault.setFaultString(reasonText);
+-        
+         fault.setFaultCode(faultCode);
+-       
++        fault.setFaultString(reasonText);
+         return fault;
+     }
+ 
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/SOAPMessageFactory1_1Impl.java	Thu Jul 30 18:10:44 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/SOAPMessageFactory1_1Impl.java	Thu Jul 30 18:10:43 2009
+@@ -22,9 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * $Id: SOAPMessageFactory1_1Impl.java,v 1.7 2006/01/27 12:49:42 vj135062 Exp $
+- */
+ 
+ 
+ 
+@@ -49,12 +46,12 @@
+         return new Message1_1Impl();
+     }
+ 
+-    public SOAPMessage createMessage(boolean isFastInfoset, 
+-        boolean acceptFastInfoset) throws SOAPException 
++    public SOAPMessage createMessage(boolean isFastInfoset,
++        boolean acceptFastInfoset) throws SOAPException
+     {
+         return new Message1_1Impl(isFastInfoset, acceptFastInfoset);
+     }
+-    
++
+     public SOAPMessage createMessage(MimeHeaders headers, InputStream in)
+         throws IOException, SOAPExceptionImpl {
+         if ((headers == null) || (getContentType(headers) == null)) {
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/SOAPPart1_1Impl.java	Thu Jul 30 18:10:47 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/SOAPPart1_1Impl.java	Thu Jul 30 18:10:47 2009
+@@ -22,9 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * 
+- */
+ 
+ 
+ 
+@@ -55,7 +52,7 @@
+     public SOAPPart1_1Impl() {
+         super();
+      }
+-    
++
+     public SOAPPart1_1Impl(MessageImpl message) {
+         super(message);
+     }
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Body1_2Impl.java	Thu Jul 30 18:10:51 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Body1_2Impl.java	Thu Jul 30 18:10:50 2009
+@@ -22,9 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * 
+- */
+ 
+ 
+ 
+@@ -49,11 +46,11 @@
+ import com.sun.xml.internal.messaging.saaj.soap.name.NameImpl;
+ 
+ public class Body1_2Impl extends BodyImpl {
+-    
+-    protected static  final Logger log =
++
++    protected static final Logger log =
+         Logger.getLogger(Body1_2Impl.class.getName(),
+                          "com.sun.xml.internal.messaging.saaj.soap.ver1_2.LocalStrings");
+-    
++
+     public Body1_2Impl(SOAPDocumentImpl ownerDocument, String prefix) {
+             super(ownerDocument, NameImpl.createBody1_2Name(prefix));
+     }
+@@ -155,7 +152,7 @@
+     }
+ 
+     protected SOAPElement addElement(Name name) throws SOAPException {
+-        if (hasFault()) {            
++        if (hasFault()) {
+             log.severe("SAAJ0402.ver1_2.only.fault.allowed.in.body");
+             throw new SOAPExceptionImpl(
+                 "No other element except Fault allowed in SOAPBody");
+@@ -164,7 +161,7 @@
+     }
+ 
+     protected SOAPElement addElement(QName name) throws SOAPException {
+-        if (hasFault()) {            
++        if (hasFault()) {
+             log.severe("SAAJ0402.ver1_2.only.fault.allowed.in.body");
+             throw new SOAPExceptionImpl(
+                 "No other element except Fault allowed in SOAPBody");
+@@ -173,7 +170,7 @@
+     }
+ 
+     public SOAPElement addChildElement(Name name) throws SOAPException {
+-        if (hasFault()) {            
++        if (hasFault()) {
+             log.severe("SAAJ0402.ver1_2.only.fault.allowed.in.body");
+             throw new SOAPExceptionImpl(
+                 "No other element except Fault allowed in SOAPBody");
+@@ -182,7 +179,7 @@
+     }
+ 
+     public SOAPElement addChildElement(QName name) throws SOAPException {
+-        if (hasFault()) {            
++        if (hasFault()) {
+             log.severe("SAAJ0402.ver1_2.only.fault.allowed.in.body");
+             throw new SOAPExceptionImpl(
+                 "No other element except Fault allowed in SOAPBody");
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/BodyElement1_2Impl.java	Thu Jul 30 18:10:54 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/BodyElement1_2Impl.java	Thu Jul 30 18:10:54 2009
+@@ -22,9 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * $Id: BodyElement1_2Impl.java,v 1.13 2006/01/27 12:49:44 vj135062 Exp $
+- */
+ 
+ 
+ 
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Detail1_2Impl.java	Thu Jul 30 18:10:58 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Detail1_2Impl.java	Thu Jul 30 18:10:57 2009
+@@ -22,9 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * 
+- */
+ 
+ 
+ 
+@@ -75,7 +72,7 @@
+      * Override setEncodingStyle of ElementImpl to restrict adding encodingStyle
+      * attribute to SOAP Detail (SOAP 1.2 spec, part 1, section 5.1.1)
+      */
+-    public void setEncodingStyle(String encodingStyle) throws SOAPException {        
++    public void setEncodingStyle(String encodingStyle) throws SOAPException {
+         log.severe("SAAJ0403.ver1_2.no.encodingStyle.in.detail");
+         throw new SOAPExceptionImpl("EncodingStyle attribute cannot appear in Detail");
+     }
+@@ -83,7 +80,7 @@
+     public SOAPElement addAttribute(Name name, String value)
+         throws SOAPException {
+         if (name.getLocalName().equals("encodingStyle")
+-            && name.getURI().equals(NameImpl.SOAP12_NAMESPACE)) {                
++            && name.getURI().equals(NameImpl.SOAP12_NAMESPACE)) {
+             setEncodingStyle(value);
+         }
+         return super.addAttribute(name, value);
+@@ -92,7 +89,7 @@
+     public SOAPElement addAttribute(QName name, String value)
+         throws SOAPException {
+         if (name.getLocalPart().equals("encodingStyle")
+-            && name.getNamespaceURI().equals(NameImpl.SOAP12_NAMESPACE)) {                
++            && name.getNamespaceURI().equals(NameImpl.SOAP12_NAMESPACE)) {
+             setEncodingStyle(value);
+         }
+         return super.addAttribute(name, value);
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/DetailEntry1_2Impl.java	Thu Jul 30 18:11:01 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/DetailEntry1_2Impl.java	Thu Jul 30 18:11:01 2009
+@@ -22,9 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * $Id: DetailEntry1_2Impl.java,v 1.13 2006/01/27 12:49:45 vj135062 Exp $
+- */
+ 
+ 
+ 
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Envelope1_2Impl.java	Thu Jul 30 18:11:05 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Envelope1_2Impl.java	Thu Jul 30 18:11:04 2009
+@@ -22,9 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * 
+- */
+ 
+ 
+ 
+@@ -50,7 +47,7 @@
+     protected static final Logger log =
+         Logger.getLogger(Envelope1_2Impl.class.getName(),
+                          "com.sun.xml.internal.messaging.saaj.soap.ver1_2.LocalStrings");
+-    
++
+     public Envelope1_2Impl(SOAPDocumentImpl ownerDoc, String prefix) {
+         super(ownerDoc, NameImpl.createEnvelope1_2Name(prefix));
+     }
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Fault1_2Impl.java	Thu Jul 30 18:11:08 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Fault1_2Impl.java	Thu Jul 30 18:11:07 2009
+@@ -22,9 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * 
+- */
+ 
+ 
+ 
+@@ -50,7 +47,7 @@
+ 
+ 
+ public class Fault1_2Impl extends FaultImpl {
+-        
++
+     protected static final Logger log =
+         Logger.getLogger(
+             LogDomainConstants.SOAP_VER1_2_DOMAIN,
+@@ -180,7 +177,7 @@
+         if (this.faultStringElement == null)
+             findReasonElement();
+         SOAPElement reasonText;
+-        
++
+         if (this.faultStringElement == null) {
+             this.faultStringElement = addSOAPFaultElement("Reason");
+             reasonText =
+@@ -197,12 +194,12 @@
+                         getFaultReasonTextName());
+             }
+         }
+-        
++
+         String xmlLang = localeToXmlLang(locale);
+         reasonText.addAttribute(getXmlLangName(), xmlLang);
+         reasonText.addTextNode(text);
+     }
+-    
++
+     private void removeDefaultFaultString() throws SOAPException {
+         SOAPElement reasonText = getFaultReasonTextElement(Locale.getDefault());
+         if (reasonText != null) {
+@@ -547,13 +544,13 @@
+     protected QName getDefaultFaultCode() {
+         return SOAPConstants.SOAP_SENDER_FAULT;
+     }
+-    
++
+      protected FaultElementImpl createSOAPFaultElement(QName qname) {
+          return new FaultElement1_2Impl(
+                        ((SOAPDocument) getOwnerDocument()).getDocument(),
+                        qname);
+     }
+-     
++
+     protected FaultElementImpl createSOAPFaultElement(Name qname) {
+          return new FaultElement1_2Impl(
+                        ((SOAPDocument) getOwnerDocument()).getDocument(),
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/FaultElement1_2Impl.java	Thu Jul 30 18:11:12 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/FaultElement1_2Impl.java	Thu Jul 30 18:11:11 2009
+@@ -22,9 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * $Id: FaultElement1_2Impl.java,v 1.13 2006/01/27 12:49:48 vj135062 Exp $
+- */
+ 
+ 
+ 
+@@ -79,7 +76,7 @@
+         }
+     }
+ 
+-    public void setEncodingStyle(String encodingStyle) throws SOAPException {        
++    public void setEncodingStyle(String encodingStyle) throws SOAPException {
+         log.severe("SAAJ0408.ver1_2.no.encodingStyle.in.fault.child");
+         throw new SOAPExceptionImpl("encodingStyle attribute cannot appear on a Fault child element");
+     }
+@@ -87,7 +84,7 @@
+     public SOAPElement addAttribute(Name name, String value)
+         throws SOAPException {
+         if (name.getLocalName().equals("encodingStyle")
+-            && name.getURI().equals(NameImpl.SOAP12_NAMESPACE)) {                
++            && name.getURI().equals(NameImpl.SOAP12_NAMESPACE)) {
+             setEncodingStyle(value);
+         }
+         return super.addAttribute(name, value);
+@@ -96,7 +93,7 @@
+     public SOAPElement addAttribute(QName name, String value)
+         throws SOAPException {
+         if (name.getLocalPart().equals("encodingStyle")
+-            && name.getNamespaceURI().equals(NameImpl.SOAP12_NAMESPACE)) {                
++            && name.getNamespaceURI().equals(NameImpl.SOAP12_NAMESPACE)) {
+             setEncodingStyle(value);
+         }
+         return super.addAttribute(name, value);
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Header1_2Impl.java	Thu Jul 30 18:11:15 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Header1_2Impl.java	Thu Jul 30 18:11:15 2009
+@@ -22,9 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * 
+- */
+ 
+ 
+ 
+@@ -52,12 +49,12 @@
+ 
+ 
+ public class Header1_2Impl extends HeaderImpl {
+-    
++
+     protected static final Logger log =
+         Logger.getLogger(
+             LogDomainConstants.SOAP_VER1_2_DOMAIN,
+             "com.sun.xml.internal.messaging.saaj.soap.ver1_2.LocalStrings");
+-        
++
+     public Header1_2Impl(SOAPDocumentImpl ownerDocument, String prefix) {
+         super(ownerDocument, NameImpl.createHeader1_2Name(prefix));
+     }
+@@ -116,7 +113,7 @@
+     protected SOAPHeaderElement createHeaderElement(Name name)
+         throws SOAPException {
+         String uri = name.getURI();
+-        if (uri == null || uri.equals("")) {          
++        if (uri == null || uri.equals("")) {
+             log.severe("SAAJ0413.ver1_2.header.elems.must.be.ns.qualified");
+             throw new SOAPExceptionImpl("SOAP 1.2 header elements must be namespace qualified");
+         }
+@@ -128,7 +125,7 @@
+     protected SOAPHeaderElement createHeaderElement(QName name)
+         throws SOAPException {
+         String uri = name.getNamespaceURI();
+-        if (uri == null || uri.equals("")) {          
++        if (uri == null || uri.equals("")) {
+             log.severe("SAAJ0413.ver1_2.header.elems.must.be.ns.qualified");
+             throw new SOAPExceptionImpl("SOAP 1.2 header elements must be namespace qualified");
+         }
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/HeaderElement1_2Impl.java	Thu Jul 30 18:11:19 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/HeaderElement1_2Impl.java	Thu Jul 30 18:11:18 2009
+@@ -22,9 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * 
+- */
+ 
+ 
+ 
+@@ -50,7 +47,7 @@
+     private static final Logger log =
+         Logger.getLogger(HeaderElement1_2Impl.class.getName(),
+                          "com.sun.xml.internal.messaging.saaj.soap.ver1_2.LocalStrings");
+-       
++
+     public HeaderElement1_2Impl(SOAPDocumentImpl ownerDoc, Name qname) {
+         super(ownerDoc, qname);
+     }
+@@ -69,7 +66,7 @@
+     }
+ 
+     // Actor equivalent to Role in SOAP 1.2
+-    protected NameImpl getActorAttributeName() {              
++    protected NameImpl getActorAttributeName() {
+         return getRoleAttributeName();
+     }
+ 
+@@ -77,7 +74,7 @@
+         return NameImpl.create("mustUnderstand", null, NameImpl.SOAP12_NAMESPACE);
+     }
+ 
+-    // mustUnderstand attribute has literal value "true" or "false" 
++    // mustUnderstand attribute has literal value "true" or "false"
+     protected String getMustunderstandLiteralValue(boolean mustUnderstand) {
+         return (mustUnderstand == true ? "true" : "false");
+     }
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/LocalStrings.properties	Thu Jul 30 18:11:22 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/LocalStrings.properties	Thu Jul 30 18:11:21 2009
+@@ -53,4 +53,3 @@
+ SAAJ0435.ver1_2.code.not.standard=SAAJ0435: {0} is not a standard Code value
+ SAAJ0436.ver1_2.detail.exists.error=SAAJ0436: Cannot add Detail, Detail already exists
+ SAAJ0437.ver1_2.version.mismatch.error=SAAJ0437: Incorrect SOAP version for Detail element, expected SOAP 1.2
+- 
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Message1_2Impl.java	Thu Jul 30 18:11:26 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Message1_2Impl.java	Thu Jul 30 18:11:25 2009
+@@ -22,9 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * $Id: Message1_2Impl.java,v 1.18 2006/01/27 12:49:48 vj135062 Exp $
+- */
+ 
+ 
+ 
+@@ -87,5 +84,5 @@
+        String accept = "application/soap+xml, text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2";
+        return acceptFastInfoset ? ("application/soap+fastinfoset, " + accept) : accept;
+    }
+-    
++
+ }
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/SOAPFactory1_2Impl.java	Thu Jul 30 18:11:29 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/SOAPFactory1_2Impl.java	Thu Jul 30 18:11:28 2009
+@@ -22,9 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * $Id: SOAPFactory1_2Impl.java,v 1.1.1.1 2006/01/27 13:10:57 kumarjayanti Exp $
+- */
+ 
+ 
+ 
+@@ -65,7 +62,7 @@
+         fault.setFaultCode(faultCode);
+         return fault;
+     }
+-                                                                                                           
++
+     public SOAPFault createFault() throws SOAPException {
+         Fault1_2Impl fault = new Fault1_2Impl(createDocument(), null);
+         fault.setFaultCode(fault.getDefaultFaultCode());
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/SOAPMessageFactory1_2Impl.java	Thu Jul 30 18:11:32 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/SOAPMessageFactory1_2Impl.java	Thu Jul 30 18:11:32 2009
+@@ -22,9 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * $Id: SOAPMessageFactory1_2Impl.java,v 1.7 2006/01/27 12:49:48 vj135062 Exp $
+- */
+ 
+ 
+ 
+@@ -49,12 +46,12 @@
+         return new Message1_2Impl();
+     }
+ 
+-    public SOAPMessage createMessage(boolean isFastInfoset, 
+-        boolean acceptFastInfoset) throws SOAPException 
++    public SOAPMessage createMessage(boolean isFastInfoset,
++        boolean acceptFastInfoset) throws SOAPException
+     {
+         return new Message1_2Impl(isFastInfoset, acceptFastInfoset);
+     }
+-    
++
+     public SOAPMessage createMessage(MimeHeaders headers, InputStream in)
+         throws IOException, SOAPExceptionImpl {
+         if ((headers == null) || (getContentType(headers) == null)) {
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/SOAPPart1_2Impl.java	Thu Jul 30 18:11:36 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/SOAPPart1_2Impl.java	Thu Jul 30 18:11:35 2009
+@@ -22,9 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * 
+- */
+ 
+ 
+ 
+@@ -58,7 +55,7 @@
+     public SOAPPart1_2Impl(MessageImpl message) {
+         super(message);
+     }
+-    
++
+     protected String getContentType() {
+         return "application/soap+xml";
+     }
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/util/Base64.java	Thu Jul 30 18:11:39 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/Base64.java	Thu Jul 30 18:11:39 2009
+@@ -22,11 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * $Id: Base64.java,v 1.4 2006/01/27 12:49:50 vj135062 Exp $
+- * $Revision: 1.4 $
+- * $Date: 2006/01/27 12:49:50 $
+- */
+ 
+ 
+ package com.sun.xml.internal.messaging.saaj.util;
+@@ -43,7 +38,7 @@
+  * This class is used by XML Schema binary format validation
+  *
+  * @author Jeffrey Rodriguez
+- * @version $Revision: 1.4 $ $Date: 2006/01/27 12:49:50 $
++ * @version
+  */
+ public final class Base64 {
+ 
+@@ -230,50 +225,49 @@
+     }
+ 
+     static final int base64[]= {
+-	64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+-	    64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+-	    64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 62, 64, 64, 64, 63,
+-	    52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 64, 64, 64, 64, 64, 64,
+-	    64,  0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14,
+-	    15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 64, 64, 64, 64, 64,
+-	    64, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
+-	    41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 64, 64, 64, 64, 64,
+-	    64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+-	    64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+-	    64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+-	    64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+-	    64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+-	    64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+-	    64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+-	    64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64
++        64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
++            64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
++            64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 62, 64, 64, 64, 63,
++            52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 64, 64, 64, 64, 64, 64,
++            64,  0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14,
++            15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 64, 64, 64, 64, 64,
++            64, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
++            41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 64, 64, 64, 64, 64,
++            64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
++            64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
++            64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
++            64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
++            64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
++            64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
++            64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
++            64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64
+     };
+ 
+     public static String base64Decode( String orig ) {
+-	char chars[]=orig.toCharArray();
+-	StringBuffer sb=new StringBuffer();
+-	int i=0;
++        char chars[]=orig.toCharArray();
++        StringBuffer sb=new StringBuffer();
++        int i=0;
+ 
+-	int shift = 0;   // # of excess bits stored in accum
+-	int acc = 0;
+-	
+-	for (i=0; i<chars.length; i++) {
+-	    int v = base64[ chars[i] & 0xFF ];
+-	    
+-	    if ( v >= 64 ) {
+-		if( chars[i] != '=' )
+-		    System.out.println("Wrong char in base64: " + chars[i]);
+-	    } else {
+-		acc= ( acc << 6 ) | v;
+-		shift += 6;
+-		if ( shift >= 8 ) {
+-		    shift -= 8;
+-		    sb.append( (char) ((acc >> shift) & 0xff));
+-		}
+-	    }
+-	}
+-	return sb.toString();
++        int shift = 0;   // # of excess bits stored in accum
++        int acc = 0;
++
++        for (i=0; i<chars.length; i++) {
++            int v = base64[ chars[i] & 0xFF ];
++
++            if ( v >= 64 ) {
++                if( chars[i] != '=' )
++                    System.out.println("Wrong char in base64: " + chars[i]);
++            } else {
++                acc= ( acc << 6 ) | v;
++                shift += 6;
++                if ( shift >= 8 ) {
++                    shift -= 8;
++                    sb.append( (char) ((acc >> shift) & 0xff));
++                }
++            }
++        }
++        return sb.toString();
+     }
+ 
+ 
+ }
+-
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/util/ByteInputStream.java	Thu Jul 30 18:11:43 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/ByteInputStream.java	Thu Jul 30 18:11:42 2009
+@@ -22,12 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * $Id: ByteInputStream.java,v 1.6 2006/01/27 12:49:51 vj135062 Exp $ $Revision:
+- * 1.3 $ $Date: 2006/01/27 12:49:51 $
+- */
+-
+-
+ package com.sun.xml.internal.messaging.saaj.util;
+ 
+ import java.io.ByteArrayInputStream;
+@@ -37,11 +31,11 @@
+ 
+ public class ByteInputStream extends ByteArrayInputStream {
+     private static final byte[] EMPTY_ARRAY = new byte[0];
+-    
++
+     public ByteInputStream() {
+         this(EMPTY_ARRAY, 0);
+     }
+-    
++
+     public ByteInputStream(byte buf[], int length) {
+         super(buf, 0, length);
+     }
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/util/ByteOutputStream.java	Thu Jul 30 18:11:46 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/ByteOutputStream.java	Thu Jul 30 18:11:46 2009
+@@ -22,10 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * $Id: ByteOutputStream.java,v 1.7 2006/01/27 12:49:51 vj135062 Exp $
+- * $Revision: 1.7 $ $Date: 2006/01/27 12:49:51 $
+- */
+ 
+ 
+ package com.sun.xml.internal.messaging.saaj.util;
+@@ -114,7 +110,7 @@
+     }
+ 
+     public void write(byte[] b) {
+-    	write(b, 0, b.length);
++        write(b, 0, b.length);
+     }
+ 
+     /**
+@@ -140,7 +136,7 @@
+     }
+ 
+     /**
+-     * Evil buffer reallocation method. 
++     * Evil buffer reallocation method.
+      * Don't use it unless you absolutely have to.
+      *
+      * @deprecated
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/util/CharReader.java	Thu Jul 30 18:11:50 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/CharReader.java	Thu Jul 30 18:11:49 2009
+@@ -22,11 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * $Id: CharReader.java,v 1.6 2006/01/27 12:49:51 vj135062 Exp $
+- * $Revision: 1.6 $
+- * $Date: 2006/01/27 12:49:51 $
+- */
+ 
+ 
+ package com.sun.xml.internal.messaging.saaj.util;
+@@ -43,7 +38,7 @@
+     public CharReader(char buf[], int offset, int length) {
+         super(buf, offset, length);
+     }
+-        
++
+     public char[] getChars() {
+         return buf;
+     }
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/util/CharWriter.java	Thu Jul 30 18:11:53 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/CharWriter.java	Thu Jul 30 18:11:53 2009
+@@ -22,11 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * $Id: CharWriter.java,v 1.6 2006/01/27 12:49:51 vj135062 Exp $
+- * $Revision: 1.6 $
+- * $Date: 2006/01/27 12:49:51 $
+- */
+ 
+ 
+ package com.sun.xml.internal.messaging.saaj.util;
+@@ -39,15 +34,15 @@
+     public CharWriter () {
+         super();
+     }
+-        
++
+     public CharWriter(int size) {
+         super(size);
+     }
+-        
++
+     public char[] getChars() {
+         return buf;
+     }
+-    
++
+     public int getCount() {
+         return count;
+     }
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/util/FastInfosetReflection.java	Thu Jul 30 18:11:57 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/FastInfosetReflection.java	Thu Jul 30 18:11:56 2009
+@@ -22,11 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * $Id: FastInfosetReflection.java,v 1.2 2006/06/06 18:46:01 sandoz Exp $
+- * $Revision: 1.2 $
+- * $Date: 2006/06/06 18:46:01 $
+- */
+ 
+ 
+ 
+@@ -47,62 +42,62 @@
+  * @author Paul.Sandoz@sun.com
+  */
+ public class FastInfosetReflection {
+-    
++
+     /**
+      * FI DOMDocumentParser constructor using reflection.
+      */
+     static Constructor fiDOMDocumentParser_new;
+-    
++
+     /**
+      * FI <code>DOMDocumentParser.parse()</code> method via reflection.
+      */
+     static Method fiDOMDocumentParser_parse;
+-    
++
+     /**
+      * FI DOMDocumentSerializer constructor using reflection.
+      */
+     static Constructor fiDOMDocumentSerializer_new;
+-    
++
+     /**
+      * FI <code>FastInfosetSource.serialize(Document)</code> method via reflection.
+      */
+     static Method fiDOMDocumentSerializer_serialize;
+-    
++
+     /**
+      * FI <code>FastInfosetSource.setOutputStream(OutputStream)</code> method via reflection.
+      */
+     static Method fiDOMDocumentSerializer_setOutputStream;
+-    
++
+     /**
+      * FI FastInfosetSource constructor using reflection.
+      */
+     static Class fiFastInfosetSource_class;
+-    
++
+     /**
+      * FI FastInfosetSource constructor using reflection.
+      */
+     static Constructor fiFastInfosetSource_new;
+-    
++
+     /**
+      * FI <code>FastInfosetSource.getInputStream()</code> method via reflection.
+      */
+     static Method fiFastInfosetSource_getInputStream;
+-       
++
+     /**
+      * FI <code>FastInfosetSource.setInputSTream()</code> method via reflection.
+      */
+     static Method fiFastInfosetSource_setInputStream;
+-    
++
+     /**
+      * FI FastInfosetResult constructor using reflection.
+      */
+     static Constructor fiFastInfosetResult_new;
+-    
++
+     /**
+      * FI <code>FastInfosetResult.getOutputSTream()</code> method via reflection.
+      */
+     static Method fiFastInfosetResult_getOutputStream;
+-    
++
+     static {
+         try {
+             Class clazz = null;
+@@ -109,28 +104,28 @@
+             clazz =
+                 Class.forName("com.sun.xml.internal.fastinfoset.dom.DOMDocumentParser");
+             fiDOMDocumentParser_new = clazz.getConstructor(null);
+-            fiDOMDocumentParser_parse = clazz.getMethod("parse", 
++            fiDOMDocumentParser_parse = clazz.getMethod("parse",
+                 new Class[] { org.w3c.dom.Document.class, java.io.InputStream.class });
+-            
++
+             clazz = Class.forName("com.sun.xml.internal.fastinfoset.dom.DOMDocumentSerializer");
+             fiDOMDocumentSerializer_new = clazz.getConstructor(null);
+-            fiDOMDocumentSerializer_serialize = clazz.getMethod("serialize", 
++            fiDOMDocumentSerializer_serialize = clazz.getMethod("serialize",
+                 new Class[] { org.w3c.dom.Node.class });
+             fiDOMDocumentSerializer_setOutputStream = clazz.getMethod("setOutputStream",
+                 new Class[] { java.io.OutputStream.class });
+-            
++
+             fiFastInfosetSource_class = clazz = Class.forName("com.sun.xml.internal.org.jvnet.fastinfoset.FastInfosetSource");
+             fiFastInfosetSource_new = clazz.getConstructor(
+                 new Class[] { java.io.InputStream.class });
+-            fiFastInfosetSource_getInputStream = clazz.getMethod("getInputStream", null);          
+-            fiFastInfosetSource_setInputStream = clazz.getMethod("setInputStream", 
+-                new Class[] { java.io.InputStream.class });          
+-            
++            fiFastInfosetSource_getInputStream = clazz.getMethod("getInputStream", null);
++            fiFastInfosetSource_setInputStream = clazz.getMethod("setInputStream",
++                new Class[] { java.io.InputStream.class });
++
+             clazz = Class.forName("com.sun.xml.internal.org.jvnet.fastinfoset.FastInfosetResult");
+             fiFastInfosetResult_new = clazz.getConstructor(
+                 new Class[] { java.io.OutputStream.class });
+-            fiFastInfosetResult_getOutputStream = clazz.getMethod("getOutputStream", null);           
+-        } 
++            fiFastInfosetResult_getOutputStream = clazz.getMethod("getOutputStream", null);
++        }
+         catch (Exception e) {
+             // falls through
+         }
+@@ -144,9 +139,9 @@
+         }
+         return fiDOMDocumentParser_new.newInstance(null);
+     }
+-    
+-    public static void DOMDocumentParser_parse(Object parser, 
+-        Document d, InputStream s) throws Exception 
++
++    public static void DOMDocumentParser_parse(Object parser,
++        Document d, InputStream s) throws Exception
+     {
+         if (fiDOMDocumentParser_parse == null) {
+             throw new RuntimeException("Unable to locate Fast Infoset implementation");
+@@ -153,9 +148,9 @@
+         }
+         fiDOMDocumentParser_parse.invoke(parser, new Object[] { d, s });
+     }
+-    
++
+     // -- DOMDocumentSerializer-------------------------------------------
+-    
++
+     public static Object DOMDocumentSerializer_new() throws Exception {
+         if (fiDOMDocumentSerializer_new == null) {
+             throw new RuntimeException("Unable to locate Fast Infoset implementation");
+@@ -162,7 +157,7 @@
+         }
+         return fiDOMDocumentSerializer_new.newInstance(null);
+     }
+-    
++
+     public static void DOMDocumentSerializer_serialize(Object serializer, Node node)
+         throws Exception
+     {
+@@ -171,7 +166,7 @@
+         }
+         fiDOMDocumentSerializer_serialize.invoke(serializer, new Object[] { node });
+     }
+-    
++
+     public static void DOMDocumentSerializer_setOutputStream(Object serializer,
+         OutputStream os) throws Exception
+     {
+@@ -180,9 +175,9 @@
+         }
+         fiDOMDocumentSerializer_setOutputStream.invoke(serializer, new Object[] { os });
+     }
+-    
++
+     // -- FastInfosetSource ----------------------------------------------
+-    
++
+     public static boolean isFastInfosetSource(Source source) {
+         return source.getClass().getName().equals(
+             "com.sun.xml.internal.org.jvnet.fastinfoset.FastInfosetSource");
+@@ -192,20 +187,20 @@
+         if (fiFastInfosetSource_class == null) {
+             throw new RuntimeException("Unable to locate Fast Infoset implementation");
+         }
+-        
++
+         return fiFastInfosetSource_class;
+     }
+-    public static Source FastInfosetSource_new(InputStream is) 
+-        throws Exception 
++    public static Source FastInfosetSource_new(InputStream is)
++        throws Exception
+     {
+         if (fiFastInfosetSource_new == null) {
+             throw new RuntimeException("Unable to locate Fast Infoset implementation");
+         }
+-        return (Source) fiFastInfosetSource_new.newInstance(new Object[] { is });        
++        return (Source) fiFastInfosetSource_new.newInstance(new Object[] { is });
+     }
+-    
+-    public static InputStream FastInfosetSource_getInputStream(Source source) 
+-        throws Exception 
++
++    public static InputStream FastInfosetSource_getInputStream(Source source)
++        throws Exception
+     {
+         if (fiFastInfosetSource_getInputStream == null) {
+             throw new RuntimeException("Unable to locate Fast Infoset implementation");
+@@ -212,7 +207,7 @@
+         }
+         return (InputStream) fiFastInfosetSource_getInputStream.invoke(source, null);
+     }
+-    
++
+     public static void FastInfosetSource_setInputStream(Source source,
+         InputStream is) throws Exception
+     {
+@@ -221,25 +216,25 @@
+         }
+         fiFastInfosetSource_setInputStream.invoke(source, new Object[] { is });
+     }
+-    
++
+     // -- FastInfosetResult ----------------------------------------------
+-    
++
+     public static boolean isFastInfosetResult(Result result) {
+         return result.getClass().getName().equals(
+-            "com.sun.xml.internal.org.jvnet.fastinfoset.FastInfosetResult");        
++            "com.sun.xml.internal.org.jvnet.fastinfoset.FastInfosetResult");
+     }
+-    
+-    public static Result FastInfosetResult_new(OutputStream os) 
+-        throws Exception 
++
++    public static Result FastInfosetResult_new(OutputStream os)
++        throws Exception
+     {
+         if (fiFastInfosetResult_new == null) {
+             throw new RuntimeException("Unable to locate Fast Infoset implementation");
+         }
+-        return (Result) fiFastInfosetResult_new.newInstance(new Object[] { os });                
++        return (Result) fiFastInfosetResult_new.newInstance(new Object[] { os });
+     }
+-    
+-    public static OutputStream FastInfosetResult_getOutputStream(Result result) 
+-        throws Exception 
++
++    public static OutputStream FastInfosetResult_getOutputStream(Result result)
++        throws Exception
+     {
+         if (fiFastInfosetResult_getOutputStream == null) {
+             throw new RuntimeException("Unable to locate Fast Infoset implementation");
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/util/FinalArrayList.java	Thu Jul 30 18:12:00 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/FinalArrayList.java	Thu Jul 30 18:12:00 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.messaging.saaj.util;
+ 
+ import java.util.ArrayList;
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/util/JAXMStreamSource.java	Thu Jul 30 18:12:04 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/JAXMStreamSource.java	Thu Jul 30 18:12:03 2009
+@@ -22,11 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * $Id: JAXMStreamSource.java,v 1.9 2006/01/27 12:49:51 vj135062 Exp $
+- * $Revision: 1.9 $
+- * $Date: 2006/01/27 12:49:51 $
+- */
+ 
+ 
+ package com.sun.xml.internal.messaging.saaj.util;
+@@ -43,15 +38,15 @@
+ public class JAXMStreamSource extends StreamSource {
+     ByteInputStream in;
+     Reader reader;
+-    
++
+     public JAXMStreamSource(InputStream is) throws IOException {
+-		if (is instanceof ByteInputStream) {
+-			this.in = (ByteInputStream)is;
+-		} else {
+-			ByteOutputStream bout = new ByteOutputStream();
++                if (is instanceof ByteInputStream) {
++                        this.in = (ByteInputStream)is;
++                } else {
++                        ByteOutputStream bout = new ByteOutputStream();
+                         bout.write(is);
+-			this.in = bout.newInputStream();
+-		}
++                        this.in = bout.newInputStream();
++                }
+     }
+ 
+     public JAXMStreamSource(Reader rdr) throws IOException {
+@@ -58,25 +53,25 @@
+         CharWriter cout = new CharWriter();
+         char[] temp = new char[1024];
+         int len;
+-                                                                                
++
+         while (-1 != (len = rdr.read(temp)))
+             cout.write(temp, 0, len);
+-                                                                                
++
+         this.reader = new CharReader(cout.getChars(), cout.getCount());
+     }
+ 
+     public InputStream getInputStream() {
+-	return in;
++        return in;
+     }
+-    
++
+     public Reader getReader() {
+-	return reader;
++        return reader;
+     }
+ 
+     public void reset() throws IOException {
+-	    if (in != null)
+-		in.reset();
+-	    if (reader != null)
+-		reader.reset();
++            if (in != null)
++                in.reset();
++            if (reader != null)
++                reader.reset();
+     }
+ }
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/util/JaxmURI.java	Thu Jul 30 18:12:07 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/JaxmURI.java	Thu Jul 30 18:12:07 2009
+@@ -22,11 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * $Id: JaxmURI.java,v 1.4 2006/01/27 12:49:51 vj135062 Exp $
+- * $Revision: 1.4 $
+- * $Date: 2006/01/27 12:49:51 $
+- */
+ 
+ 
+ package com.sun.xml.internal.messaging.saaj.util;
+@@ -33,7 +28,7 @@
+ 
+ // Imported from: org.apache.xerces.util
+ // Needed to work around differences in JDK1.2 and 1.3 and deal with userInfo
+-    
++
+ import java.io.IOException;
+ import java.io.Serializable;
+ 
+@@ -67,7 +62,7 @@
+ * default port for a specific scheme). Rather, it only knows the
+ * grammar and basic set of operations that can be applied to a URI.
+ *
+-* @version  $Id: JaxmURI.java,v 1.4 2006/01/27 12:49:51 vj135062 Exp $
++* @version
+ *
+ **********************************************************************/
+  public class JaxmURI implements Serializable {
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/util/LocalStrings.properties	Thu Jul 30 18:12:11 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/LocalStrings.properties	Thu Jul 30 18:12:11 2009
+@@ -31,4 +31,3 @@
+ SAAJ0603.util.setProperty.exception=SAAJ0603: Can't create RejectDoctypSaxFilter because XMLReader.setProperty threw an exception. See stack trace for detalis
+ 
+ # Info messages
+- 
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/util/LogDomainConstants.java	Thu Jul 30 18:12:15 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/LogDomainConstants.java	Thu Jul 30 18:12:14 2009
+@@ -22,11 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * $Id: LogDomainConstants.java,v 1.5 2006/01/27 12:49:52 vj135062 Exp $
+- * $Revision: 1.5 $
+- * $Date: 2006/01/27 12:49:52 $
+- */
+ 
+ 
+ 
+@@ -43,34 +38,34 @@
+ public interface LogDomainConstants {
+ 
+     // TBD -- this should be configurable from a properties
+-    // file or something .. Leaving it as it is for now.     
+-    public static String MODULE_TOPLEVEL_DOMAIN = 
++    // file or something .. Leaving it as it is for now.
++    public static String MODULE_TOPLEVEL_DOMAIN =
+                     "javax.xml.messaging.saaj";
+ 
+-    // First Level Domain 
+-    public static String CLIENT_DOMAIN = 
++    // First Level Domain
++    public static String CLIENT_DOMAIN =
+                 MODULE_TOPLEVEL_DOMAIN + ".client";
+-    
+-    public static String SOAP_DOMAIN = 
++
++    public static String SOAP_DOMAIN =
+                 MODULE_TOPLEVEL_DOMAIN + ".soap";
+ 
+-    public static String UTIL_DOMAIN = 
++    public static String UTIL_DOMAIN =
+                 MODULE_TOPLEVEL_DOMAIN + ".util";
+ 
+     // Second Level Domain
+-    public static String HTTP_CONN_DOMAIN = 
++    public static String HTTP_CONN_DOMAIN =
+                   CLIENT_DOMAIN + ".p2p";
+-    
+-    public static String NAMING_DOMAIN =  
++
++    public static String NAMING_DOMAIN =
+                 SOAP_DOMAIN + ".name";
+ 
+-    public static String SOAP_IMPL_DOMAIN = 
++    public static String SOAP_IMPL_DOMAIN =
+                   SOAP_DOMAIN + ".impl";
+ 
+-    public static String SOAP_VER1_1_DOMAIN = 
++    public static String SOAP_VER1_1_DOMAIN =
+                   SOAP_DOMAIN + ".ver1_1";
+-    
+-    public static String SOAP_VER1_2_DOMAIN = 
++
++    public static String SOAP_VER1_2_DOMAIN =
+                   SOAP_DOMAIN + ".ver1_2";
+ 
+ }
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/util/MimeHeadersUtil.java	Thu Jul 30 18:12:18 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/MimeHeadersUtil.java	Thu Jul 30 18:12:17 2009
+@@ -22,9 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * $Id: MimeHeadersUtil.java,v 1.5 2006/01/27 12:49:52 vj135062 Exp $
+- */
+ 
+ 
+ 
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/util/NamespaceContextIterator.java	Thu Jul 30 18:12:22 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/NamespaceContextIterator.java	Thu Jul 30 18:12:21 2009
+@@ -22,9 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * $Id: NamespaceContextIterator.java,v 1.8 2006/01/27 12:49:52 vj135062 Exp $
+- */
+ 
+ 
+ 
+@@ -102,7 +99,7 @@
+     public Object next() {
+         return getNext();
+     }
+-    
++
+     public Attr nextNamespaceAttr() {
+         return getNext();
+     }
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/util/ParseUtil.java	Thu Jul 30 18:12:25 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/ParseUtil.java	Thu Jul 30 18:12:24 2009
+@@ -22,11 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * $Id: ParseUtil.java,v 1.5 2006/01/27 12:49:52 vj135062 Exp $
+- * $Revision: 1.5 $
+- * $Date: 2006/01/27 12:49:52 $
+- */
+ 
+ 
+ package com.sun.xml.internal.messaging.saaj.util;
+@@ -44,7 +39,7 @@
+ 
+     /**
+      * Returns a new String constructed from the specified String by replacing
+-     * the URL escape sequences and UTF8 encoding with the characters they 
++     * the URL escape sequences and UTF8 encoding with the characters they
+      * represent.
+      */
+     public static String decode(String s) {
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/util/ParserPool.java	Thu Jul 30 18:12:29 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/ParserPool.java	Thu Jul 30 18:12:28 2009
+@@ -22,11 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * $Id: ParserPool.java,v 1.5 2006/01/27 12:49:52 vj135062 Exp $
+- * $Revision: 1.5 $
+- * $Date: 2006/01/27 12:49:52 $
+- */
+ 
+ 
+ 
+@@ -48,7 +43,7 @@
+     private int capacity;
+ 
+     public ParserPool(int capacity) {
+-		this.capacity = capacity;
++                this.capacity = capacity;
+         factory = new com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl(); //SAXParserFactory.newInstance();
+         factory.setNamespaceAware(true);
+         parsers = new Stack();
+@@ -55,7 +50,7 @@
+     }
+ 
+     public synchronized SAXParser get() throws ParserConfigurationException,
+-		SAXException {
++                SAXException {
+ 
+         try {
+             return (SAXParser) parsers.pop();
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/util/RejectDoctypeSaxFilter.java	Thu Jul 30 18:12:32 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/RejectDoctypeSaxFilter.java	Thu Jul 30 18:12:32 2009
+@@ -23,7 +23,6 @@
+  * have any questions.
+  */
+ 
+-
+ package com.sun.xml.internal.messaging.saaj.util;
+ 
+ import java.util.logging.Logger;
+@@ -45,7 +44,7 @@
+  * because they are not legal in SOAP.  If the user of this class sets a
+  * LexicalHandler, then it forwards events to that handler.
+  *
+- * 
++ *
+  * @author Edwin Goei
+  */
+ 
+@@ -53,11 +52,11 @@
+     protected static final Logger log =
+     Logger.getLogger(LogDomainConstants.UTIL_DOMAIN,
+     "com.sun.xml.internal.messaging.saaj.util.LocalStrings");
+-    
++
+     /** Standard SAX 2.0 ext property */
+     static final String LEXICAL_HANDLER_PROP =
+     "http://xml.org/sax/properties/lexical-handler";
+-    
++
+     static final String WSU_NS = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd".intern();
+     static final String SIGNATURE_LNAME = "Signature".intern();
+     static final String ENCRYPTED_DATA_LNAME = "EncryptedData".intern();
+@@ -64,10 +63,10 @@
+     static final String DSIG_NS = "http://www.w3.org/2000/09/xmldsig#".intern();
+     static final String XENC_NS = "http://www.w3.org/2001/04/xmlenc#".intern();
+     static final String ID_NAME = "ID".intern();
+-    
++
+     /** LexicalHandler to forward events to, if any */
+     private LexicalHandler lexicalHandler;
+-    
++
+     public RejectDoctypeSaxFilter(SAXParser saxParser) throws SOAPException {
+         XMLReader xmlReader;
+         try {
+@@ -78,7 +77,7 @@
+             "Couldn't get an XMLReader while constructing a RejectDoctypeSaxFilter",
+             e);
+         }
+-        
++
+         // Set ourselves up to be the SAX LexicalHandler
+         try {
+             xmlReader.setProperty(LEXICAL_HANDLER_PROP, this);
+@@ -88,11 +87,11 @@
+             "Couldn't set the lexical handler property while constructing a RejectDoctypeSaxFilter",
+             e);
+         }
+-        
++
+         // Set the parent XMLReader of this SAX filter
+         setParent(xmlReader);
+     }
+-    
++
+     /*
+      * Override setProperty() to capture any LexicalHandler that is set for
+      * forwarding of events.
+@@ -105,53 +104,53 @@
+             super.setProperty(name, value);
+         }
+     }
+-    
++
+     //
+     // Beginning of SAX LexicalHandler callbacks...
+     //
+-    
++
+     public void startDTD(String name, String publicId, String systemId)
+     throws SAXException {
+         throw new SAXException("Document Type Declaration is not allowed");
+     }
+-    
++
+     public void endDTD() throws SAXException {
+     }
+-    
++
+     public void startEntity(String name) throws SAXException {
+         if (lexicalHandler != null) {
+             lexicalHandler.startEntity(name);
+         }
+     }
+-    
++
+     public void endEntity(String name) throws SAXException {
+         if (lexicalHandler != null) {
+             lexicalHandler.endEntity(name);
+         }
+     }
+-    
++
+     public void startCDATA() throws SAXException {
+         if (lexicalHandler != null) {
+             lexicalHandler.startCDATA();
+         }
+     }
+-    
++
+     public void endCDATA() throws SAXException {
+         if (lexicalHandler != null) {
+             lexicalHandler.endCDATA();
+         }
+     }
+-    
++
+     public void comment(char[] ch, int start, int length) throws SAXException {
+         if (lexicalHandler != null) {
+             lexicalHandler.comment(ch, start, length);
+         }
+     }
+-    
++
+     //
+     // End of SAX LexicalHandler callbacks
+     //
+-    
++
+     public void startElement(String namespaceURI, String localName,
+     String qName, Attributes atts)   throws SAXException{
+         if(atts != null ){
+@@ -168,7 +167,7 @@
+                         attrImpl.addAttribute(atts.getURI(i), atts.getLocalName(i),
+                         atts.getQName(i), ID_NAME, atts.getValue(i));
+                     }else{
+-			 attrImpl.addAttribute(atts.getURI(i), atts.getLocalName(i), atts.getQName(i), atts.getType(i), atts.getValue(i));
++                         attrImpl.addAttribute(atts.getURI(i), atts.getLocalName(i), atts.getQName(i), atts.getType(i), atts.getValue(i));
+                     }
+                 }else{
+                     attrImpl.addAttribute(atts.getURI(i), atts.getLocalName(i),
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/util/TeeInputStream.java	Thu Jul 30 18:12:36 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/TeeInputStream.java	Thu Jul 30 18:12:35 2009
+@@ -23,11 +23,10 @@
+  * have any questions.
+  */
+ 
+-
+ /*
+  * Created on Feb 28, 2003
+  *
+- * To change this generated comment go to 
++ * To change this generated comment go to
+  * Window>Preferences>Java>Code Generation>Code Template
+  */
+ package com.sun.xml.internal.messaging.saaj.util;
+@@ -40,7 +39,7 @@
+ public class TeeInputStream extends InputStream {
+     protected InputStream source;
+     protected OutputStream copySink;
+-    
++
+     public TeeInputStream(InputStream source, OutputStream sink) {
+         super();
+         this.copySink = sink;
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/util/XMLDeclarationParser.java	Thu Jul 30 18:12:39 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/XMLDeclarationParser.java	Thu Jul 30 18:12:39 2009
+@@ -22,7 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-
+ package com.sun.xml.internal.messaging.saaj.util;
+ 
+ import java.io.*;
+@@ -31,12 +30,12 @@
+ 
+ import javax.xml.transform.TransformerException;
+ 
+-/* 
++/*
+  * Class that parses the very first construct in the document i.e.
+  *  <?xml ... ?>
+  *
+  * @author Panos Kougiouris (panos@acm.org)
+- * @version $Revision: 1.1.1.1 $ $Date: 2006/01/27 13:10:58 $
++ * @version
+  */
+ 
+ public class XMLDeclarationParser {
+@@ -46,7 +45,7 @@
+     private String xmlDecl = null;
+     static String gt16 = null;
+     static String utf16Decl = null;
+-   
++
+     static {
+          try {
+              gt16 = new String(">".getBytes("utf-16"));
+@@ -111,7 +110,7 @@
+             return;
+         }
+         m_hasHeader = true;
+-        
++
+         if (utf16) {
+             xmlDecl = new String(decl.getBytes(), "utf-16");
+             xmlDecl = xmlDecl.substring(xmlDecl.indexOf("<"));
+@@ -180,4 +179,3 @@
+     }
+ 
+ }
+-    
+--- old/src/share/classes/com/sun/xml/internal/messaging/saaj/util/transform/EfficientStreamingTransformer.java	Thu Jul 30 18:12:43 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/messaging/saaj/util/transform/EfficientStreamingTransformer.java	Thu Jul 30 18:12:42 2009
+@@ -23,7 +23,6 @@
+  * have any questions.
+  */
+ 
+-
+ /*
+  * EfficientStreamingTransformer.java
+  *
+@@ -51,7 +50,7 @@
+ /**
+  * This class is a proxy for a Transformer object with optimizations
+  * for certain cases. If source and result are of type stream, then
+- * bytes are simply copied whenever possible (note that this assumes 
++ * bytes are simply copied whenever possible (note that this assumes
+  * that the input is well formed). In addition, it provides support for
+  * FI using native DOM parsers and serializers.
+  *
+@@ -64,46 +63,46 @@
+ 
+   //static final String version;
+   //static final String vendor;
++  //removing the static :security issue : see CR 6813167
++  private final TransformerFactory transformerFactory = TransformerFactory.newInstance();
+ 
+-  protected static final TransformerFactory transformerFactory = TransformerFactory.newInstance();
++  /**
++  removing support for Java 1.4 and 1.3 : CR6658158
++  static {
++        version = System.getProperty("java.vm.version");
++        vendor = System.getProperty("java.vm.vendor");
++        if (vendor.startsWith("Sun") &&
++            (version.startsWith("1.4") || version.startsWith("1.3"))) {
++            transformerFactory =
++                new com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl();
++        }
++  }*/
+ 
+-   //removing support for Java 1.4 and 1.3 : CR6658158
+-    /*static {
+-    version = System.getProperty("java.vm.version");
+-    vendor = System.getProperty("java.vm.vendor");
+-    if (vendor.startsWith("Sun") && 
+-    (version.startsWith("1.4") || version.startsWith("1.3"))) {
+-    transformerFactory = 
+-    new com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl();
+-    }
+-}
+-*/
+-                                                                                                                                                  
+     /**
+      * TransformerFactory instance.
+      */
+-    
++
+     /**
+      * Underlying XSLT transformer.
+      */
+     private Transformer m_realTransformer = null;
+-    
++
+     /**
+      * Undelying FI DOM parser.
+      */
+     private Object m_fiDOMDocumentParser = null;
+-    
++
+     /**
+      * Underlying FI DOM serializer.
+      */
+     private Object m_fiDOMDocumentSerializer = null;
+-    
++
+     private EfficientStreamingTransformer() {
+     }
+ 
+     private void materialize() throws TransformerException {
+         if (m_realTransformer == null) {
+-            m_realTransformer = transformerFactory.newTransformer(); 
++            m_realTransformer = transformerFactory.newTransformer();
+         }
+     }
+ 
+@@ -270,7 +269,7 @@
+     public void transform(
+         javax.xml.transform.Source source,
+         javax.xml.transform.Result result)
+-        throws javax.xml.transform.TransformerException 
++        throws javax.xml.transform.TransformerException
+     {
+         // StreamSource -> StreamResult
+         if ((source instanceof StreamSource)
+@@ -304,7 +303,7 @@
+                     if (reader.markSupported())
+                         reader.mark(Integer.MAX_VALUE);
+ 
+-                    PushbackReader pushbackReader = new PushbackReader(reader, 4096); 
++                    PushbackReader pushbackReader = new PushbackReader(reader, 4096);
+                     //some size to unread <?xml ....?>
+                     XMLDeclarationParser ev =
+                         new XMLDeclarationParser(pushbackReader);
+@@ -317,7 +316,7 @@
+                     }
+                     Writer writer =
+                         new OutputStreamWriter(os /*, ev.getEncoding()*/);
+-                    ev.writeTo(writer);		// doesn't write any, if no header
++                    ev.writeTo(writer);         // doesn't write any, if no header
+ 
+                     int num;
+                     char[] ac = new char[8192];
+@@ -329,7 +328,7 @@
+                     if (reader.markSupported())
+                         reader.reset();
+                     return;
+-                } 
++                }
+             } catch (IOException e) {
+                 e.printStackTrace();
+                 throw new TransformerException(e.toString());
+@@ -339,7 +338,7 @@
+         }
+         // FastInfosetSource -> DOMResult
+         else if (FastInfosetReflection.isFastInfosetSource(source)
+-                && (result instanceof DOMResult)) 
++                && (result instanceof DOMResult))
+         {
+             try {
+                 // Use reflection to avoid a static dep with FI
+@@ -349,12 +348,12 @@
+ 
+                 // m_fiDOMDocumentParser.parse(document, source.getInputStream())
+                 FastInfosetReflection.DOMDocumentParser_parse(
+-                    m_fiDOMDocumentParser, 
++                    m_fiDOMDocumentParser,
+                     (Document) ((DOMResult) result).getNode(),
+                     FastInfosetReflection.FastInfosetSource_getInputStream(source));
+ 
+                 // We're done!
+-                return;           
++                return;
+             }
+             catch (Exception e) {
+                 throw new TransformerException(e);
+@@ -362,7 +361,7 @@
+         }
+         // DOMSource -> FastInfosetResult
+         else if ((source instanceof DOMSource)
+-                && FastInfosetReflection.isFastInfosetResult(result)) 
++                && FastInfosetReflection.isFastInfosetResult(result))
+         {
+             try {
+                 // Use reflection to avoid a static dep with FI
+@@ -372,16 +371,16 @@
+ 
+                 // m_fiDOMDocumentSerializer.setOutputStream(result.getOutputStream())
+                 FastInfosetReflection.DOMDocumentSerializer_setOutputStream(
+-                    m_fiDOMDocumentSerializer, 
++                    m_fiDOMDocumentSerializer,
+                     FastInfosetReflection.FastInfosetResult_getOutputStream(result));
+ 
+                 // m_fiDOMDocumentSerializer.serialize(node)
+                 FastInfosetReflection.DOMDocumentSerializer_serialize(
+-                    m_fiDOMDocumentSerializer, 
++                    m_fiDOMDocumentSerializer,
+                     ((DOMSource) source).getNode());
+ 
+                 // We're done!
+-                return;                  
++                return;
+             }
+             catch (Exception e) {
+                 throw new TransformerException(e);
+@@ -389,7 +388,7 @@
+         }
+ 
+         // All other cases -- use transformer object
+-        
++
+         materialize();
+         m_realTransformer.transform(source, result);
+     }
+@@ -396,20 +395,24 @@
+ 
+     /**
+      * Threadlocal to hold a Transformer instance for this thread.
++     * removing this optimiztion :  see CR 6813167
+      */
+-    private static ThreadLocal effTransformer = new ThreadLocal(); 
+-    
++    //private static ThreadLocal effTransformer = new ThreadLocal();
++
+     /**
+-     * Return Transformer instance for this thread, allocating a new one if 
+-     * necessary. Note that this method does not clear global parameters, 
++     * Return Transformer instance for this thread, allocating a new one if
++     * necessary. Note that this method does not clear global parameters,
+      * properties or any other data set on a previously used transformer.
+      */
+     public static Transformer newTransformer() {
+-        Transformer tt = (Transformer) effTransformer.get();
++       //removing this optimiztion: see CR 6813167
++        /* Transformer tt = (Transformer) ef U15 :fTransformer.get();
+         if (tt == null) {
+             effTransformer.set(tt = new EfficientStreamingTransformer());
+-        }       
++        }
+         return tt;
++        */
++        return new EfficientStreamingTransformer();
+     }
+ 
+ }
+--- old/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/EncodingAlgorithm.java	Thu Jul 30 18:12:47 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/EncodingAlgorithm.java	Thu Jul 30 18:12:46 2009
+@@ -32,17 +32,17 @@
+ import java.io.OutputStream;
+ 
+ public interface EncodingAlgorithm {
+-    
++
+     public Object decodeFromBytes(byte[] b, int start, int length) throws EncodingAlgorithmException;
+-    
++
+     public Object decodeFromInputStream(InputStream s) throws EncodingAlgorithmException, IOException;
+-    
+ 
++
+     public void encodeToOutputStream(Object data, OutputStream s) throws EncodingAlgorithmException, IOException;
+-    
+-    
++
++
+     public Object convertFromCharacters(char[] ch, int start, int length) throws EncodingAlgorithmException;
+-    
++
+     public void convertToCharacters(Object data, StringBuffer s) throws EncodingAlgorithmException;
+-    
++
+ }
+--- old/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/EncodingAlgorithmException.java	Thu Jul 30 18:12:50 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/EncodingAlgorithmException.java	Thu Jul 30 18:12:49 2009
+@@ -29,11 +29,11 @@
+ package com.sun.xml.internal.org.jvnet.fastinfoset;
+ 
+ public class EncodingAlgorithmException extends FastInfosetException {
+-    
++
+     public EncodingAlgorithmException(String message) {
+         super(message);
+     }
+-    
++
+     public EncodingAlgorithmException(String message, Exception e) {
+         super(message, e);
+     }
+@@ -40,5 +40,5 @@
+ 
+     public EncodingAlgorithmException(Exception e) {
+         super(e);
+-    }    
++    }
+ }
+--- old/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/EncodingAlgorithmIndexes.java	Thu Jul 30 18:12:53 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/EncodingAlgorithmIndexes.java	Thu Jul 30 18:12:53 2009
+@@ -24,11 +24,11 @@
+  *
+  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
+  */
+- 
+ 
++
+ package com.sun.xml.internal.org.jvnet.fastinfoset;
+ 
+-/** 
++/**
+  * The indexes of built-in encoding algorithms.
+  *
+  * <p>The indexes of the built-in encoding algorithms are specified
+--- old/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/ExternalVocabulary.java	Thu Jul 30 18:12:57 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/ExternalVocabulary.java	Thu Jul 30 18:12:56 2009
+@@ -24,8 +24,8 @@
+  *
+  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
+  */
+- 
+ 
++
+ package com.sun.xml.internal.org.jvnet.fastinfoset;
+ 
+ /**
+@@ -36,22 +36,22 @@
+  * @author Paul.Sandoz@Sun.Com
+  */
+ public class ExternalVocabulary {
+-  
++
+     /**
+      * A URI that refers to the external vocabulary.
+      */
+     public final String URI;
+-    
++
+     /**
+      * The vocabulary that is refered to by the URI.
+      */
+     public final Vocabulary vocabulary;
+-    
++
+     public ExternalVocabulary(String URI, Vocabulary vocabulary) {
+         if (URI == null || vocabulary == null) {
+             throw new IllegalArgumentException();
+         }
+-        
++
+         this.URI = URI;
+         this.vocabulary = vocabulary;
+     }
+--- old/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/FastInfosetException.java	Thu Jul 30 18:13:00 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/FastInfosetException.java	Thu Jul 30 18:13:00 2009
+@@ -29,11 +29,11 @@
+ package com.sun.xml.internal.org.jvnet.fastinfoset;
+ 
+ public class FastInfosetException extends Exception {
+-    
++
+     public FastInfosetException(String message) {
+         super(message);
+     }
+-    
++
+     public FastInfosetException(String message, Exception e) {
+         super(message, e);
+     }
+@@ -41,5 +41,5 @@
+     public FastInfosetException(Exception e) {
+         super(e);
+     }
+-    
++
+ }
+--- old/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/FastInfosetParser.java	Thu Jul 30 18:13:04 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/FastInfosetParser.java	Thu Jul 30 18:13:03 2009
+@@ -35,16 +35,16 @@
+  * <p>
+  * This interface contains common methods that are not specific to any
+  * API associated with the parsing of fast infoset documents.
+- * 
++ *
+  * @author Paul.Sandoz@Sun.Com
+  */
+ public interface FastInfosetParser {
+     /**
+-     * The property name to be used for getting and setting the string 
++     * The property name to be used for getting and setting the string
+      * interning property of a parser.
+      *
+      */
+-    public static final String STRING_INTERNING_PROPERTY = 
++    public static final String STRING_INTERNING_PROPERTY =
+         "http://jvnet.org/fastinfoset/parser/properties/string-interning";
+ 
+     /**
+@@ -51,45 +51,45 @@
+      * The property name to be used for getting and setting the buffer size
+      * of a parser.
+      */
+-    public static final String BUFFER_SIZE_PROPERTY = 
++    public static final String BUFFER_SIZE_PROPERTY =
+         "http://jvnet.org/fastinfoset/parser/properties/buffer-size";
+ 
+     /**
+-     * The property name to be used for getting and setting the 
++     * The property name to be used for getting and setting the
+      * Map containing encoding algorithms.
+      *
+-     */    
++     */
+     public static final String REGISTERED_ENCODING_ALGORITHMS_PROPERTY =
+         "http://jvnet.org/fastinfoset/parser/properties/registered-encoding-algorithms";
+-    
++
+    /**
+-     * The property name to be used for getting and setting the 
++     * The property name to be used for getting and setting the
+      * Map containing external vocabularies.
+      *
+-     */    
++     */
+     public static final String EXTERNAL_VOCABULARIES_PROPERTY =
+         "http://jvnet.org/fastinfoset/parser/properties/external-vocabularies";
+-    
++
+    /**
+-     * The property name to be used for getting and setting the 
++     * The property name to be used for getting and setting the
+      * flag, which will indicate whether underlying Parser's
+      * input stream should be really closed
+-     */    
++     */
+     public static final String FORCE_STREAM_CLOSE_PROPERTY =
+         "http://jvnet.org/fastinfoset/parser/properties/force-stream-close";
+-   
++
+     /**
+      * Set the string interning property.
+      *
+-     * <p>If the string interning property is set to true then 
+-     * <code>String</code> objects instantiated for [namespace name], [prefix] 
+-     * and [local name] infoset properties will be interned using the method 
++     * <p>If the string interning property is set to true then
++     * <code>String</code> objects instantiated for [namespace name], [prefix]
++     * and [local name] infoset properties will be interned using the method
+      * {@link String#intern()}.
+      *
+      * @param stringInterning The string interning property.
+      */
+     public void setStringInterning(boolean stringInterning);
+-    
++
+     /**
+      * Return the string interning property.
+      *
+@@ -96,7 +96,7 @@
+      * @return The string interning property.
+      */
+     public boolean getStringInterning();
+-    
++
+     /**
+      * Set the buffer size.
+      *
+@@ -107,8 +107,8 @@
+      * @param bufferSize The requested buffer size.
+      */
+     public void setBufferSize(int bufferSize);
+-    
+-    
++
++
+     /**
+      * Get the buffer size.
+      *
+@@ -115,8 +115,8 @@
+      * @return The buffer size.
+      */
+     public int getBufferSize();
+-    
+ 
++
+     /**
+      * Sets the set of registered encoding algorithms.
+      *
+@@ -123,7 +123,7 @@
+      * @param algorithms The set of registered algorithms.
+      */
+     public void setRegisteredEncodingAlgorithms(Map algorithms);
+-    
++
+     /**
+      * Gets the set of registered encoding algorithms.
+      *
+@@ -139,7 +139,7 @@
+      * @param referencedVocabualries the map of URI to vocabulary.
+      */
+     public void setExternalVocabularies(Map referencedVocabualries);
+-    
++
+     /**
+      * Get the map of referenced external vocabularies.
+      *
+@@ -146,21 +146,21 @@
+      * @return the map of URI to vocabulary.
+      * @deprecated
+      *     The map returned will not be the same instance and contain
+-     *     the same entries as the map set by {@link #setExternalVocabularies} 
++     *     the same entries as the map set by {@link #setExternalVocabularies}
+      *     method.
+      */
+     public Map getExternalVocabularies();
+-    
++
+     /**
+      * Set the parse fragments property.
+      *
+-     * <p>If the parse fragments property is set to true then 
++     * <p>If the parse fragments property is set to true then
+      * fragments of an XML infoset may be parsed.
+      *
+      * @param parseFragments The parse fragments property.
+      */
+     public void setParseFragments(boolean parseFragments);
+-    
++
+     /**
+      * Return the parse fragments property.
+      *
+@@ -167,17 +167,17 @@
+      * @return The parse fragments property.
+      */
+     public boolean getParseFragments();
+-    
++
+     /**
+      * Set the force stream close property.
+      *
+-     * <p>If the force stream property is set to true then 
++     * <p>If the force stream property is set to true then
+      * Parser's underlying InputStream will be closed.
+      *
+      * @param needForceStreamClose The force stream close property.
+      */
+     public void setForceStreamClose(boolean needForceStreamClose);
+-    
++
+     /**
+      * Return the force stream close property.
+      *
+@@ -184,5 +184,5 @@
+      * @return The force stream close property.
+      */
+     public boolean getForceStreamClose();
+-    
++
+ }
+--- old/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/FastInfosetResult.java	Thu Jul 30 18:13:07 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/FastInfosetResult.java	Thu Jul 30 18:13:07 2009
+@@ -24,9 +24,9 @@
+  *
+  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
+  */
+- 
+ 
+ 
++
+ package com.sun.xml.internal.org.jvnet.fastinfoset;
+ 
+ import java.io.OutputStream;
+@@ -41,7 +41,7 @@
+  *
+  *  <P>The derivation of FIResult from SAXResult is an implementation
+  *  detail.<P>
+- *  
++ *
+  *  <P>This implementation is designed for interoperation with JAXP and is not
+  *  not designed with performance in mind. It is recommended that for performant
+  *  interoperation alternative serializer specific solutions be used.<P>
+@@ -55,9 +55,9 @@
+  *  </P>
+  */
+ public class FastInfosetResult extends SAXResult {
+-   
++
+     OutputStream _outputStream;
+-    
++
+     public FastInfosetResult(OutputStream outputStream) {
+         _outputStream = outputStream;
+     }
+@@ -69,18 +69,18 @@
+             setHandler(handler);
+         }
+         ((SAXDocumentSerializer) handler).setOutputStream(_outputStream);
+-        return handler;        
++        return handler;
+     }
+-    
++
+     public LexicalHandler getLexicalHandler() {
+         return (LexicalHandler) getHandler();
+     }
+-    
++
+     public OutputStream getOutputStream() {
+         return _outputStream;
+-    }    
+-    
++    }
++
+     public void setOutputStream(OutputStream outputStream) {
+         _outputStream = outputStream;
+-    }    
++    }
+ }
+--- old/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/FastInfosetSerializer.java	Thu Jul 30 18:13:11 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/FastInfosetSerializer.java	Thu Jul 30 18:13:10 2009
+@@ -36,20 +36,20 @@
+  * This interface contains common methods that are not specific to any
+  * API associated with the serialization of XML Infoset to fast infoset
+  * documents.
+- * 
++ *
+  * @author Paul.Sandoz@Sun.Com
+  */
+ public interface FastInfosetSerializer {
+     /**
+-     * The feature to ignore the document type declaration and the 
++     * The feature to ignore the document type declaration and the
+      * internal subset.
+      * <p>
+      * The default value is false. If true a serializer shall ignore document
+      * type declaration and the internal subset.
+      */
+-    public static final String IGNORE_DTD_FEATURE = 
++    public static final String IGNORE_DTD_FEATURE =
+         "http://jvnet.org/fastinfoset/serializer/feature/ignore/DTD";
+-    
++
+     /**
+      * The feature to ignore comments.
+      * <p>
+@@ -56,7 +56,7 @@
+      * The default value is false. If true a serializer shall ignore comments
+      * and shall not serialize them.
+      */
+-    public static final String IGNORE_COMMENTS_FEATURE = 
++    public static final String IGNORE_COMMENTS_FEATURE =
+         "http://jvnet.org/fastinfoset/serializer/feature/ignore/comments";
+ 
+     /**
+@@ -65,9 +65,9 @@
+      * The default value is false. If true a serializer shall ignore processing
+      * instructions and shall not serialize them.
+      */
+-    public static final String IGNORE_PROCESSING_INSTRUCTIONS_FEATURE = 
++    public static final String IGNORE_PROCESSING_INSTRUCTIONS_FEATURE =
+         "http://jvnet.org/fastinfoset/serializer/feature/ignore/processingInstructions";
+-    
++
+     /**
+      * The feature to ignore text content that consists completely of white
+      * space characters.
+@@ -75,39 +75,45 @@
+      * The default value is false. If true a serializer shall ignore text
+      * content that consists completely of white space characters.
+      */
+-    public static final String IGNORE_WHITE_SPACE_TEXT_CONTENT_FEATURE = 
++    public static final String IGNORE_WHITE_SPACE_TEXT_CONTENT_FEATURE =
+         "http://jvnet.org/fastinfoset/serializer/feature/ignore/whiteSpaceTextContent";
+-    
++
+     /**
+      * The property name to be used for getting and setting the buffer size
+      * of a parser.
+      */
+-    public static final String BUFFER_SIZE_PROPERTY = 
++    public static final String BUFFER_SIZE_PROPERTY =
+         "http://jvnet.org/fastinfoset/parser/properties/buffer-size";
+ 
+     /**
+-     * The property name to be used for getting and setting the 
++     * The property name to be used for getting and setting the
+      * Map containing encoding algorithms.
+      *
+-     */    
++     */
+     public static final String REGISTERED_ENCODING_ALGORITHMS_PROPERTY =
+         "http://jvnet.org/fastinfoset/parser/properties/registered-encoding-algorithms";
+-    
++
+    /**
+-     * The property name to be used for getting and setting the 
++     * The property name to be used for getting and setting the
+      * Map containing external vocabularies.
+      *
+-     */    
++     */
+     public static final String EXTERNAL_VOCABULARIES_PROPERTY =
+         "http://jvnet.org/fastinfoset/parser/properties/external-vocabularies";
+-    
++
+     /**
+-     * The default value for the limit on the size of character content chunks
++     * The default minimum size of the character content chunks,
+      * that will be indexed.
+      */
+-    public final static int CHARACTER_CONTENT_CHUNK_SIZE_CONSTRAINT = 32;
+-    
++    public final static int MIN_CHARACTER_CONTENT_CHUNK_SIZE = 0;
++
+     /**
++     * The default maximum size of the character content chunks,
++     * that will be indexed.
++     */
++    public final static int MAX_CHARACTER_CONTENT_CHUNK_SIZE = 32;
++
++    /**
+      * The default value for limit on the size of indexed Map for attribute values
+      * Limit is measured in bytes not in number of entries
+      */
+@@ -114,13 +120,17 @@
+     public static final int CHARACTER_CONTENT_CHUNK_MAP_MEMORY_CONSTRAINT = Integer.MAX_VALUE;
+ 
+     /**
+-     * The default value for the limit on the size of attribute values
+-     * that will be indexed.
++     * The default minimum size of the attribute values, that will be indexed.
+      */
+-    public final static int ATTRIBUTE_VALUE_SIZE_CONSTRAINT = 32;
+-    
++    public final static int MIN_ATTRIBUTE_VALUE_SIZE = 0;
++
+     /**
+-     * The default value for limit on the size of indexed Map for character content chunks
++     * The default maximum size of the attribute values, that will be indexed.
++     */
++    public final static int MAX_ATTRIBUTE_VALUE_SIZE = 32;
++
++    /**
++     * The default value for limit on the size of indexed Map for attribute values
+      * Limit is measured in bytes not in number of entries
+      */
+     public static final int ATTRIBUTE_VALUE_MAP_MEMORY_CONSTRAINT = Integer.MAX_VALUE;
+@@ -129,60 +139,60 @@
+      * The character encoding scheme string for UTF-8.
+      */
+     public static final String UTF_8 = "UTF-8";
+-    
++
+     /**
+      * The character encoding scheme string for UTF-16BE.
+      */
+     public static final String UTF_16BE = "UTF-16BE";
+-    
++
+     /**
+      * Set the {@link #IGNORE_DTD_FEATURE}.
+      * @param ignoreDTD true if the feature shall be ignored.
+      */
+     public void setIgnoreDTD(boolean ignoreDTD);
+-    
++
+     /**
+      * Get the {@link #IGNORE_DTD_FEATURE}.
+      * @return true if the feature is ignored, false otherwise.
+      */
+     public boolean getIgnoreDTD();
+-    
++
+     /**
+      * Set the {@link #IGNORE_COMMENTS_FEATURE}.
+      * @param ignoreComments true if the feature shall be ignored.
+      */
+     public void setIgnoreComments(boolean ignoreComments);
+-    
++
+     /**
+      * Get the {@link #IGNORE_COMMENTS_FEATURE}.
+      * @return true if the feature is ignored, false otherwise.
+      */
+     public boolean getIgnoreComments();
+-    
++
+     /**
+      * Set the {@link #IGNORE_PROCESSING_INSTRUCTIONS_FEATURE}.
+      * @param ignoreProcesingInstructions true if the feature shall be ignored.
+      */
+     public void setIgnoreProcesingInstructions(boolean ignoreProcesingInstructions);
+-    
++
+     /**
+      * Get the {@link #IGNORE_PROCESSING_INSTRUCTIONS_FEATURE}.
+      * @return true if the feature is ignored, false otherwise.
+      */
+     public boolean getIgnoreProcesingInstructions();
+-    
++
+     /**
+      * Set the {@link #IGNORE_WHITE_SPACE_TEXT_CONTENT_FEATURE}.
+      * @param ignoreWhiteSpaceTextContent true if the feature shall be ignored.
+      */
+     public void setIgnoreWhiteSpaceTextContent(boolean ignoreWhiteSpaceTextContent);
+-    
++
+     /**
+      * Get the {@link #IGNORE_WHITE_SPACE_TEXT_CONTENT_FEATURE}.
+      * @return true if the feature is ignored, false otherwise.
+      */
+     public boolean getIgnoreWhiteSpaceTextContent();
+-    
++
+     /**
+      * Sets the character encoding scheme.
+      *
+@@ -194,7 +204,7 @@
+      * @param characterEncodingScheme The set of registered algorithms.
+      */
+     public void setCharacterEncodingScheme(String characterEncodingScheme);
+-    
++
+     /**
+      * Gets the character encoding scheme.
+      *
+@@ -201,7 +211,7 @@
+      * @return The character encoding scheme.
+      */
+     public String getCharacterEncodingScheme();
+-    
++
+     /**
+      * Sets the set of registered encoding algorithms.
+      *
+@@ -208,7 +218,7 @@
+      * @param algorithms The set of registered algorithms.
+      */
+     public void setRegisteredEncodingAlgorithms(Map algorithms);
+-    
++
+     /**
+      * Gets the set of registered encoding algorithms.
+      *
+@@ -215,34 +225,40 @@
+      * @return The set of registered algorithms.
+      */
+     public Map getRegisteredEncodingAlgorithms();
+-    
++
+     /**
+-     * Sets the limit on the size of character content chunks
++     * Gets the minimum size of character content chunks
+      * that will be indexed.
+      *
+-     * @param size The character content chunk size limit. Any chunk less
+-     * that a length of size limit will be indexed.
++     * @return The minimum character content chunk size.
+      */
+-    public void setCharacterContentChunkSizeLimit(int size);
+-    
++    public int getMinCharacterContentChunkSize();
++
+     /**
+-     * Gets the limit on the size of character content chunks
++     * Sets the minimum size of character content chunks
+      * that will be indexed.
+      *
+-     * @return The character content chunk size limit.
++     * @param size the minimum character content chunk size.
+      */
+-    public int getCharacterContentChunkSizeLimit();
++    public void setMinCharacterContentChunkSize(int size);
+ 
+     /**
+-     * Sets the limit on the memory size of Map of attribute values
++     * Gets the maximum size of character content chunks
+      * that will be indexed.
+      *
+-     * @param size The attribute value size limit. Any value less
+-     * that a length of size limit will be indexed.
++     * @return The maximum character content chunk size.
+      */
+-    public void setCharacterContentChunkMapMemoryLimit(int size);
+-    
++    public int getMaxCharacterContentChunkSize();
++
+     /**
++     * Sets the maximum size of character content chunks
++     * that will be indexed.
++     *
++     * @param size the maximum character content chunk size.
++     */
++    public void setMaxCharacterContentChunkSize(int size);
++
++    /**
+      * Gets the limit on the memory size of Map of attribute values
+      * that will be indexed.
+      *
+@@ -251,32 +267,47 @@
+     public int getCharacterContentChunkMapMemoryLimit();
+ 
+     /**
+-     * Sets the limit on the size of attribute values
++     * Sets the limit on the memory size of Map of attribute values
+      * that will be indexed.
+      *
+      * @param size The attribute value size limit. Any value less
+      * that a length of size limit will be indexed.
+      */
+-    public void setAttributeValueSizeLimit(int size);
+-    
++    public void setCharacterContentChunkMapMemoryLimit(int size);
++
+     /**
+-     * Gets the limit on the size of attribute values
++     * Gets the minimum size of attribute values
+      * that will be indexed.
+      *
+-     * @return The attribute value size limit.
++     * @return The minimum attribute values size.
+      */
+-    public int getAttributeValueSizeLimit();
++    public int getMinAttributeValueSize();
+ 
+     /**
+-     * Sets the limit on the memory size of Map of attribute values
++     * Sets the minimum size of attribute values
+      * that will be indexed.
+      *
+-     * @param size The attribute value size limit. Any value less
+-     * that a length of size limit will be indexed.
++     * @param size the minimum attribute values size.
+      */
+-    public void setAttributeValueMapMemoryLimit(int size);
+-    
++    public void setMinAttributeValueSize(int size);
++
+     /**
++     * Gets the maximum size of attribute values
++     * that will be indexed.
++     *
++     * @return The maximum attribute values size.
++     */
++    public int getMaxAttributeValueSize();
++
++    /**
++     * Sets the maximum size of attribute values
++     * that will be indexed.
++     *
++     * @param size the maximum attribute values size.
++     */
++    public void setMaxAttributeValueSize(int size);
++
++    /**
+      * Gets the limit on the memory size of Map of attribute values
+      * that will be indexed.
+      *
+@@ -285,33 +316,42 @@
+     public int getAttributeValueMapMemoryLimit();
+ 
+     /**
++     * Sets the limit on the memory size of Map of attribute values
++     * that will be indexed.
++     *
++     * @param size The attribute value size limit. Any value less
++     * that a length of size limit will be indexed.
++     */
++    public void setAttributeValueMapMemoryLimit(int size);
++
++    /**
+      * Set the external vocabulary that shall be used when serializing.
+-     * 
+-     * @param v the vocabulary. 
++     *
++     * @param v the vocabulary.
+      */
+     public void setExternalVocabulary(ExternalVocabulary v);
+-    
++
+     /**
+      * Set the application data to be associated with the serializer vocabulary.
+-     * 
+-     * @param data the application data. 
++     *
++     * @param data the application data.
+      */
+     public void setVocabularyApplicationData(VocabularyApplicationData data);
+-    
++
+     /**
+      * Get the application data associated with the serializer vocabulary.
+-     * 
+-     * @return the application data. 
++     *
++     * @return the application data.
+      */
+     public VocabularyApplicationData getVocabularyApplicationData();
+-    
++
+     /**
+      * Reset the serializer for reuse serializing another XML infoset.
+      */
+     public void reset();
+-        
++
+     /**
+-     * Set the OutputStream to serialize the XML infoset to a 
++     * Set the OutputStream to serialize the XML infoset to a
+      * fast infoset document.
+      *
+      * @param s the OutputStream where the fast infoset document is written to.
+--- old/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/FastInfosetSource.java	Thu Jul 30 18:13:14 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/FastInfosetSource.java	Thu Jul 30 18:13:14 2009
+@@ -24,9 +24,9 @@
+  *
+  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
+  */
+- 
+ 
+ 
++
+ package com.sun.xml.internal.org.jvnet.fastinfoset;
+ 
+ import java.io.InputStream;
+@@ -55,14 +55,14 @@
+  *     <LI>The XMLReader object obtained by the getXMLReader method shall
+  *        be used only for parsing the InputSource object returned by
+  *        the getInputSource method.</LI>
+- *     <LI>The InputSource object obtained by the getInputSource method shall 
+- *        be used only for being parsed by the XMLReader object returned by 
++ *     <LI>The InputSource object obtained by the getInputSource method shall
++ *        be used only for being parsed by the XMLReader object returned by
+  *        the getXMLReader method.</LI>
+  *   </UL>
+  *  </P>
+  */
+ public class FastInfosetSource extends SAXSource {
+-   
++
+     public FastInfosetSource(InputStream inputStream) {
+         super(new InputSource(inputStream));
+     }
+@@ -76,11 +76,11 @@
+         ((SAXDocumentParser) reader).setInputStream(getInputStream());
+         return reader;
+     }
+-    
++
+     public InputStream getInputStream() {
+         return getInputSource().getByteStream();
+     }
+-    
++
+     public void setInputStream(InputStream inputStream) {
+         setInputSource(new InputSource(inputStream));
+     }
+--- old/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/RestrictedAlphabet.java	Thu Jul 30 18:13:18 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/RestrictedAlphabet.java	Thu Jul 30 18:13:17 2009
+@@ -24,18 +24,18 @@
+  *
+  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
+  */
+- 
+ 
++
+ package com.sun.xml.internal.org.jvnet.fastinfoset;
+ 
+ public final class RestrictedAlphabet {
+-    
++
+     public static final String NUMERIC_CHARACTERS = "0123456789-+.E ";
+-    
++
+     public static final int NUMERIC_CHARACTERS_INDEX = 0;
+-    
++
+     public static final String DATE_TIME_CHARACTERS = "0123456789-:TZ ";
+ 
+     public static final int DATE_TIME_CHARACTERS_INDEX = 1;
+-    
++
+ }
+--- old/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/Vocabulary.java	Thu Jul 30 18:13:21 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/Vocabulary.java	Thu Jul 30 18:13:21 2009
+@@ -24,8 +24,8 @@
+  *
+  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
+  */
+- 
+ 
++
+ package com.sun.xml.internal.org.jvnet.fastinfoset;
+ 
+ import java.util.LinkedHashSet;
+@@ -38,12 +38,12 @@
+  * Each vocabulary table is represented as a Set. A vocabulary table entry is
+  * represented as an item in the Set.
+  * <p>
+- * The 1st item contained in a Set is assigned the smallest index value, 
++ * The 1st item contained in a Set is assigned the smallest index value,
+  * n say (where n >= 0). The 2nd item is assigned an index value of n + 1. The kth
+  * item is assigned an index value of n + (k - 1).
+  * <p>
+- * A Fast Infoset parser/serializer implementation will tranform the canonical 
+- * representation of a Vocabulary instance into a more optimal form suitable 
++ * A Fast Infoset parser/serializer implementation will tranform the canonical
++ * representation of a Vocabulary instance into a more optimal form suitable
+  * for the efficient usage according to the API implemented by the parsers and
+  * serialziers.
+  */
+@@ -52,59 +52,59 @@
+      * The restricted alphabet table, containing String objects.
+      */
+     public final Set restrictedAlphabets = new LinkedHashSet();
+-    
++
+     /**
+      * The encoding algorithm table, containing String objects.
+      */
+     public final Set encodingAlgorithms = new LinkedHashSet();
+-    
++
+     /**
+      * The prefix table, containing String objects.
+      */
+     public final Set prefixes = new LinkedHashSet();
+-    
++
+     /**
+      * The namespace name table, containing String objects.
+      */
+     public final Set namespaceNames = new LinkedHashSet();
+-    
++
+     /**
+      * The local name table, containing String objects.
+      */
+     public final Set localNames = new LinkedHashSet();
+-    
++
+     /**
+      * The "other NCName" table, containing String objects.
+      */
+     public final Set otherNCNames = new LinkedHashSet();
+-    
++
+     /**
+      * The "other URI" table, containing String objects.
+      */
+     public final Set otherURIs = new LinkedHashSet();
+-    
++
+     /**
+      * The "attribute value" table, containing String objects.
+      */
+     public final Set attributeValues = new LinkedHashSet();
+-    
++
+     /**
+      * The "other string" table, containing String objects.
+      */
+     public final Set otherStrings = new LinkedHashSet();
+-    
++
+     /**
+      * The "character content chunk" table, containing String objects.
+      */
+     public final Set characterContentChunks = new LinkedHashSet();
+-    
++
+     /**
+      * The element table, containing QName objects.
+      */
+     public final Set elements = new LinkedHashSet();
+-    
++
+     /**
+      * The attribute table, containing QName objects.
+      */
+-    public final Set attributes = new LinkedHashSet();    
++    public final Set attributes = new LinkedHashSet();
+ }
+--- old/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/VocabularyApplicationData.java	Thu Jul 30 18:13:25 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/VocabularyApplicationData.java	Thu Jul 30 18:13:24 2009
+@@ -24,8 +24,8 @@
+  *
+  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
+  */
+- 
+ 
++
+ package com.sun.xml.internal.org.jvnet.fastinfoset;
+ 
+ /**
+--- old/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/sax/EncodingAlgorithmAttributes.java	Thu Jul 30 18:13:28 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/sax/EncodingAlgorithmAttributes.java	Thu Jul 30 18:13:28 2009
+@@ -45,7 +45,7 @@
+  * @see org.xml.sax.XMLReader
+  */
+ public interface EncodingAlgorithmAttributes extends Attributes {
+-    
++
+     /**
+      * Return the URI of the encoding algorithm.
+      *
+@@ -52,29 +52,29 @@
+      * <p>If the algorithm data corresponds to a built-in encoding algorithm
+      *    then the null is returned.</p>
+      *
+-     * <p>If the algorithm data corresponds to an application-defined encoding 
++     * <p>If the algorithm data corresponds to an application-defined encoding
+      *    algorithm then the URI of the algorithm is returned.</p>
+      *
+-     * <p>If {@link #getAlgorithmData(int)} returns null then the result of 
++     * <p>If {@link #getAlgorithmData(int)} returns null then the result of
+      *    this method is undefined.<p>
+      *
+-     * @param index The attribute index (zero-based). 
++     * @param index The attribute index (zero-based).
+      * @return The URI. If the index is out of range then null is returned.
+      */
+     public String getAlgorithmURI(int index);
+- 
++
+     /**
+      * Return the index of the encoding algorithm.
+      *
+-     * <p>If {@link #getAlgorithmData(int)} returns null then the result of 
++     * <p>If {@link #getAlgorithmData(int)} returns null then the result of
+      *    this method is undefined.<p>
+      *
+      * @param index The attribute index (zero-based).
+      * @return The algorithm index. If index is out of range then -1 is returned.
+-     * @see com.sun.xml.internal.org.jvnet.fastinfoset.EncodingAlgorithmIndexes       
++     * @see com.sun.xml.internal.org.jvnet.fastinfoset.EncodingAlgorithmIndexes
+      */
+     public int getAlgorithmIndex(int index);
+-    
++
+     /**
+      * Return the data of the encoding algorithm.
+      *
+@@ -81,34 +81,34 @@
+      * <p>If the algorithm data corresponds to a built-in encoding algorithm
+      *    then an Object corresponding to the Java primitive type is returned.</p>
+      *
+-     * <p>If the algorithm data corresponds to an application-defined encoding 
++     * <p>If the algorithm data corresponds to an application-defined encoding
+      *    algorithm then an Object that is an instance of <code>byte[]</code>
+-     *    is returned if there is no EncodingAlgorithm registered for the 
+-     *    application-defined encoding algorithm URI. Otherwise, an Object produced 
++     *    is returned if there is no EncodingAlgorithm registered for the
++     *    application-defined encoding algorithm URI. Otherwise, an Object produced
+      *    from the registeredEncodingAlgorithm is returned.</p>
+      *
+-     * <p>If there no encoding algorithm data associated an attribute then 
++     * <p>If there no encoding algorithm data associated an attribute then
+      *    <code>null</code> is returned.<p>
+      *
+      * @param index The attribute index (zero-based).
+      * @return The data. If the index is out of range then null is returned.
+      */
+-    public Object getAlgorithmData(int index);    
+-    
++    public Object getAlgorithmData(int index);
++
+     /**
+      * Return the alphabet associated with the attribute value.
+      *
+-     * @param index The attribute index (zero-based). 
+-     * @return The alphabet. 
++     * @param index The attribute index (zero-based).
++     * @return The alphabet.
+      *         If the index is out of range then null is returned.
+      *         If there is is no alphabet then null is returned.
+      */
+     public String getAlpababet(int index);
+-    
++
+     /**
+      * Return the whether the attribute value should be indexed or not.
+      *
+-     * @param index The attribute index (zero-based). 
++     * @param index The attribute index (zero-based).
+      * @return True if attribute value should be indexed, otherwise false.
+      */
+     public boolean getToIndex(int index);
+--- old/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/sax/EncodingAlgorithmContentHandler.java	Thu Jul 30 18:13:32 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/sax/EncodingAlgorithmContentHandler.java	Thu Jul 30 18:13:31 2009
+@@ -29,17 +29,17 @@
+ 
+ import org.xml.sax.SAXException;
+ 
+-/** 
++/**
+  * SAX2 extention handler to receive notification of encoding algorithm data.
+  *
+- * <p>This is an optional extension handler for SAX2. XML readers are not 
+- * required to recognize this handler, and it is not part of core-only 
++ * <p>This is an optional extension handler for SAX2. XML readers are not
++ * required to recognize this handler, and it is not part of core-only
+  * SAX2 distributions.</p>
+  *
+  * <p>This interface may be used with with a Fast Infoset
+- * SAX parser to receive notification of encoding algorithm data specified 
+- * in ITU-T Rec. X.891 | ISO/IEC 24824-1 (Fast Infoset) clause 10 and for 
+- * application defined encoding algorithms specified as part of the 
++ * SAX parser to receive notification of encoding algorithm data specified
++ * in ITU-T Rec. X.891 | ISO/IEC 24824-1 (Fast Infoset) clause 10 and for
++ * application defined encoding algorithms specified as part of the
+  * initial vocabulary of a fast infoset document.<p>
+  *
+  * <p>To set the EncodingAlgorithmContentHandler for an XML reader, use the
+@@ -51,7 +51,7 @@
+  * {@link org.xml.sax.SAXNotRecognizedException SAXNotRecognizedException}</p>
+  *
+  * <p>To set the EncodingAlgorithmContentHandler for an Fast Infoset reader, use
+- * {@link com.sun.xml.internal.org.jvnet.fastinfoset.sax.FastInfosetReader#setEncodingAlgorithmContentHandler 
++ * {@link com.sun.xml.internal.org.jvnet.fastinfoset.sax.FastInfosetReader#setEncodingAlgorithmContentHandler
+  *  setEncodingAlgorithmContentHandler} method.<p>
+  *
+  * @see com.sun.xml.internal.org.jvnet.fastinfoset.sax.PrimitiveTypeContentHandler
+@@ -60,7 +60,7 @@
+  */
+ public interface EncodingAlgorithmContentHandler {
+     /**
+-     * Receive notification of encoding algorithm data as an array 
++     * Receive notification of encoding algorithm data as an array
+      * of byte.
+      *
+      * <p>The application must not attempt to read from the array
+@@ -69,13 +69,13 @@
+      * <p>Such notifications will occur for a Fast Infoset SAX parser
+      * when processing encoding algorithm data.<p>
+      *
+-     * <p>The Parser will call the method of this interface to report each 
+-     * encoding algorithm data. Parsers MUST return all contiguous 
++     * <p>The Parser will call the method of this interface to report each
++     * encoding algorithm data. Parsers MUST return all contiguous
+      * characters in a single chunk</p>
+      *
+-     * <p>Parsers may return all contiguous bytes in a single chunk, or 
+-     * they may split it into several chunks providing that the length of 
+-     * each chunk is of the required length to successfully apply the 
++     * <p>Parsers may return all contiguous bytes in a single chunk, or
++     * they may split it into several chunks providing that the length of
++     * each chunk is of the required length to successfully apply the
+      * encoding algorithm to the chunk.</p>
+      *
+      * @param URI the URI of the encoding algorithm
+@@ -86,16 +86,16 @@
+      * @throws org.xml.sax.SAXException any SAX exception, possibly
+      *            wrapping another exception
+      * @see com.sun.xml.internal.org.jvnet.fastinfoset.EncodingAlgorithmIndexes
+-     */    
+-    public void octets(String URI, int algorithm, byte[] b, int start, int length)  throws SAXException;    
++     */
++    public void octets(String URI, int algorithm, byte[] b, int start, int length)  throws SAXException;
+ 
+     /**
+      * Receive notification of encoding algorithm data as an object.
+      *
+      * <p>Such notifications will occur for a Fast Infoset SAX parser
+-     * when processing encoding algorithm data that is converted from an 
++     * when processing encoding algorithm data that is converted from an
+      * array of byte to an object more suitable for processing.<p>
+-     * 
++     *
+      * @param URI the URI of the encoding algorithm
+      * @param algorithm the encoding algorithm index
+      * @param o the encoding algorithm object
+@@ -102,6 +102,6 @@
+      * @throws org.xml.sax.SAXException any SAX exception, possibly
+      *            wrapping another exception
+      * @see com.sun.xml.internal.org.jvnet.fastinfoset.EncodingAlgorithmIndexes
+-     */    
+-    public void object(String URI, int algorithm, Object o)  throws SAXException;    
++     */
++    public void object(String URI, int algorithm, Object o)  throws SAXException;
+ }
+--- old/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/sax/ExtendedContentHandler.java	Thu Jul 30 18:13:35 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/sax/ExtendedContentHandler.java	Thu Jul 30 18:13:35 2009
+@@ -31,7 +31,7 @@
+ import org.xml.sax.SAXException;
+ 
+ public interface ExtendedContentHandler extends ContentHandler {
+-    
++
+     /**
+      * Receive notification of character data.
+      *
+--- old/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/sax/FastInfosetReader.java	Thu Jul 30 18:13:39 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/sax/FastInfosetReader.java	Thu Jul 30 18:13:38 2009
+@@ -39,19 +39,19 @@
+ /**
+  * Interface for reading an Fast Infoset document using callbacks.
+  *
+- * <p>FastInfosetReader is the interface that a Fast Infoset parser's 
+- * SAX2 driver must implement. This interface allows an application to 
++ * <p>FastInfosetReader is the interface that a Fast Infoset parser's
++ * SAX2 driver must implement. This interface allows an application to
+  * to register Fast Infoset specific event handlers for encoding algorithms.</p>
+  *
+- * <p>The reception of encoding algorithm events is determined by 
++ * <p>The reception of encoding algorithm events is determined by
+  * the registration of:
+  * <ul>
+- *    <li>A {@link PrimitiveTypeContentHandler}, for the recieving of events, 
+- *        associated with built-in encoding algorithms, for decoded data that 
++ *    <li>A {@link PrimitiveTypeContentHandler}, for the recieving of events,
++ *        associated with built-in encoding algorithms, for decoded data that
+  *        can be reported as Java primitive types.</li>
+  *    <li>A {@link EncodingAlgorithmContentHandler}, for the recieving of events,
+  *        associated with built-in and application-defined encoding algorithms, for
+- *        decoded data that can be reported as an array of octets or as a Java 
++ *        decoded data that can be reported as an array of octets or as a Java
+  *        Object.</li>
+  *    <li>{@link com.sun.xml.internal.org.jvnet.fastinfoset.EncodingAlgorithm} implementations, for
+  *        the receiving of events, associated with application defined algorithms.
+@@ -60,15 +60,15 @@
+  * </ul>
+  * </p>
+  *
+- * <p>The reporting of element content events for built-in algorithms 
++ * <p>The reporting of element content events for built-in algorithms
+  *    is determimed by the following:
+  * <ul>
+  *    <li>If a PrimitiveContentHandler is registered then decoded data is reported
+  *        as Java primitive types using the corresponding methods on the PrimitiveContentHandler
+  *        interface.</li>
+- *    <li>If a PrimitiveContentHandler is not registered and a 
++ *    <li>If a PrimitiveContentHandler is not registered and a
+  *        EncodingAlgorithmContentHandler is registered then decoded data is reported
+- *        as Java Objects using {@link EncodingAlgorithmContentHandler#object(String, int, Object)}. 
++ *        as Java Objects using {@link EncodingAlgorithmContentHandler#object(String, int, Object)}.
+  *        An Object shall correspond to the Java primitive type that
+  *        would otherwise be reported using the PrimitiveContentHandler.</li>
+  *    <li>If neither is registered then then decoded data is reported as characters.</li>
+@@ -75,49 +75,49 @@
+  * </ul>
+  * </p>
+  *
+- * <p>The reporting of element content events for application-defined algorithms 
++ * <p>The reporting of element content events for application-defined algorithms
+  *    is determimed by the following:
+  * <ul>
+- *    <li>If an EncodingAlgorithmContentHandler is registered and there is no 
++ *    <li>If an EncodingAlgorithmContentHandler is registered and there is no
+  *        EncodingAlgorithm registered for an application-defined encoding algorithm
+  *        then decoded data for such an algoroithm is reported as an array of octets
+- *        using {@link EncodingAlgorithmContentHandler#octets(String, int, byte[], int, int)}; 
+- *        otherwise</li> 
+- *    <li>If there is an EncodingAlgorithm registered for the application-defined 
++ *        using {@link EncodingAlgorithmContentHandler#octets(String, int, byte[], int, int)};
++ *        otherwise</li>
++ *    <li>If there is an EncodingAlgorithm registered for the application-defined
+  *        encoding algorithm then the decoded data is reported as a Java Object,
+  *        returned by decoding according to the EncodingAlgorithm, using
+  *        {@link EncodingAlgorithmContentHandler#object(String, int, Object)}.</li>
+  * </ul>
+  * </p>
+- * 
++ *
+  * <p>The reporting of attribute values for encoding algorithms is achieved using
+  * {@link EncodingAlgorithmAttributes} that extends {@link org.xml.sax.Attributes}.
+- * The registered ContentHandler may cast the attr paramter of the 
+- * {@link org.xml.sax.ContentHandler#startElement(String, String, String, org.xml.sax.Attributes)} 
++ * The registered ContentHandler may cast the attr paramter of the
++ * {@link org.xml.sax.ContentHandler#startElement(String, String, String, org.xml.sax.Attributes)}
+  * to the EncodingAlgorithmAttributes interface to access to encoding algorithm information.
+  * </p>
+  *
+- * <p>The reporting of attribute values for built-in algorithms 
++ * <p>The reporting of attribute values for built-in algorithms
+  *    is determimed by the following:
+  * <ul>
+- *    <li>If a PrimitiveContentHandler or EncodingAlgorithmContentHandler is 
++ *    <li>If a PrimitiveContentHandler or EncodingAlgorithmContentHandler is
+  *        registered then decoded data is reported as Java Objects corresponding
+- *        to the Java primitive types. The Java Objects may be obtained using 
++ *        to the Java primitive types. The Java Objects may be obtained using
+  *        {@link EncodingAlgorithmAttributes#getAlgorithmData(int)}.
+  *    <li>If neither is registered then then decoded data is reported as characters.</li>
+  * </ul>
+  * </p>
+  *
+- * <p>The reporting of attribute values for application-defined algorithms 
++ * <p>The reporting of attribute values for application-defined algorithms
+  *    is determimed by the following:
+  * <ul>
+- *    <li>If an EncodingAlgorithmContentHandler is registered and there is no 
++ *    <li>If an EncodingAlgorithmContentHandler is registered and there is no
+  *        EncodingAlgorithm registered for an application-defined encoding algorithm
+  *        then decoded data for such an algoroithm is reported as Java Object,
+  *        that is an instance of <code>byte[]</code>,
+- *        using {@link EncodingAlgorithmAttributes#getAlgorithmData(int)}; 
+- *        otherwise</li> 
+- *    <li>If there is an EncodingAlgorithm registered for the application-defined 
++ *        using {@link EncodingAlgorithmAttributes#getAlgorithmData(int)};
++ *        otherwise</li>
++ *    <li>If there is an EncodingAlgorithm registered for the application-defined
+  *        encoding algorithm then the decoded data is reported as a Java Object,
+  *        returned by decoding according to the EncodingAlgorithm, using
+  *        {@link EncodingAlgorithmAttributes#getAlgorithmData(int)}.</li>
+@@ -131,21 +131,21 @@
+  */
+ public interface FastInfosetReader extends XMLReader, FastInfosetParser {
+     /**
+-     * The property name to be used for getting and setting the 
++     * The property name to be used for getting and setting the
+      * EncodingAlgorithmContentHandler.
+      *
+-     */    
++     */
+     public static final String ENCODING_ALGORITHM_CONTENT_HANDLER_PROPERTY =
+             "http://jvnet.org/fastinfoset/sax/properties/encoding-algorithm-content-handler";
+-    
++
+     /**
+-     * The property name to be used for getting and setting the 
++     * The property name to be used for getting and setting the
+      * PrimtiveTypeContentHandler.
+      *
+-     */    
++     */
+     public static final String PRIMITIVE_TYPE_CONTENT_HANDLER_PROPERTY =
+             "http://jvnet.org/fastinfoset/sax/properties/primitive-type-content-handler";
+-    
++
+     /**
+      * Parse a fast infoset document from an InputStream.
+      *
+@@ -152,16 +152,16 @@
+      * <p>The application can use this method to instruct the Fast Infoset
+      * reader to begin parsing a fast infoset document from a byte stream.</p>
+      *
+-     * <p>Applications may not invoke this method while a parse is in progress 
+-     * (they should create a new XMLReader instead for each nested XML document). 
+-     * Once a parse is complete, an application may reuse the same 
++     * <p>Applications may not invoke this method while a parse is in progress
++     * (they should create a new XMLReader instead for each nested XML document).
++     * Once a parse is complete, an application may reuse the same
+      * FastInfosetReader object, possibly with a different byte stream.</p>
+      *
+-     * <p>During the parse, the FastInfosetReader will provide information about 
++     * <p>During the parse, the FastInfosetReader will provide information about
+      * the fast infoset document through the registered event handlers.<p>
+      *
+-     * <p> This method is synchronous: it will not return until parsing has ended. 
+-     * If a client application wants to terminate parsing early, it should throw 
++     * <p> This method is synchronous: it will not return until parsing has ended.
++     * If a client application wants to terminate parsing early, it should throw
+      * an exception.<p>
+      *
+      * @param s The byte stream to parse from.
+@@ -188,7 +188,7 @@
+      * @see #setLexicalHandler
+      */
+     public LexicalHandler getLexicalHandler();
+-   
++
+     /**
+      * Allow an application to register a DTD declaration handler.
+      *
+@@ -209,7 +209,7 @@
+      * @see #setLexicalHandler
+      */
+     public DeclHandler getDeclHandler();
+-    
++
+     /**
+      * Allow an application to register an encoding algorithm handler.
+      *
+--- old/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/sax/FastInfosetWriter.java	Thu Jul 30 18:13:42 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/sax/FastInfosetWriter.java	Thu Jul 30 18:13:42 2009
+@@ -30,7 +30,7 @@
+ import org.xml.sax.ContentHandler;
+ import org.xml.sax.ext.LexicalHandler;
+ 
+-public interface FastInfosetWriter extends ContentHandler, LexicalHandler, 
++public interface FastInfosetWriter extends ContentHandler, LexicalHandler,
+         EncodingAlgorithmContentHandler, PrimitiveTypeContentHandler,
+         RestrictedAlphabetContentHandler, ExtendedContentHandler,
+         FastInfosetSerializer {
+--- old/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/sax/PrimitiveTypeContentHandler.java	Thu Jul 30 18:13:46 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/sax/PrimitiveTypeContentHandler.java	Thu Jul 30 18:13:45 2009
+@@ -24,18 +24,18 @@
+  *
+  * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
+  */
+- 
+ 
++
+ package com.sun.xml.internal.org.jvnet.fastinfoset.sax;
+ 
+ import org.xml.sax.SAXException;
+ 
+-/** 
+- * SAX2 extention handler to receive notification of character data as 
++/**
++ * SAX2 extention handler to receive notification of character data as
+  * primtive types.
+  *
+- * <p>This is an optional extension handler for SAX2. XML readers are not 
+- * required to recognize this handler, and it is not part of core-only 
++ * <p>This is an optional extension handler for SAX2. XML readers are not
++ * required to recognize this handler, and it is not part of core-only
+  * SAX2 distributions.</p>
+  *
+  * <p>This interface may be used with with a Fast Infoset
+@@ -56,10 +56,10 @@
+  * {@link com.sun.xml.internal.org.jvnet.fastinfoset.sax.FastInfosetReader#setPrimitiveTypeContentHandler
+  *  setPrimitiveTypeContentHandler} method.<p>
+ 
+- * <p>The Parser will call methods of this interface to report each 
+- * chunk of character data that has been converted to an array of primitive 
+- * types, for example an array of integer or an array of float. Parsers may 
+- * return all contiguous primtive types in a single chunk, or they may split 
++ * <p>The Parser will call methods of this interface to report each
++ * chunk of character data that has been converted to an array of primitive
++ * types, for example an array of integer or an array of float. Parsers may
++ * return all contiguous primtive types in a single chunk, or they may split
+  * it into several chunks</p>
+  *
+  * <p>The application must not attempt to read from the array
+@@ -85,7 +85,7 @@
+      * @param length the number of boolean to read from the array
+      * @throws org.xml.sax.SAXException any SAX exception, possibly
+      *            wrapping another exception
+-     */    
++     */
+     public void booleans(boolean [] b, int start, int length) throws SAXException;
+ 
+     /**
+@@ -97,11 +97,11 @@
+      * <p>Such notifications will occur for a Fast Infoset SAX parser
+      * when processing data encoded using the "base64" encoding
+      * algorithm, see subclause 10.3, or the "hexadecimal" encoding
+-     * algorithm, see subclause 10.2. 
+-     * 
++     * algorithm, see subclause 10.2.
++     *
+      * <p>Such a notification may occur for binary data that would
+      * normally require base 64 encoding and reported as character data
+-     * using the {@link org.xml.sax.ContentHandler#characters characters} 
++     * using the {@link org.xml.sax.ContentHandler#characters characters}
+      * method <p>.
+      *
+      * @param b the array of byte
+@@ -109,9 +109,9 @@
+      * @param length the number of byte to read from the array
+      * @throws org.xml.sax.SAXException any SAX exception, possibly
+      *            wrapping another exception
+-     */    
++     */
+     public void bytes(byte[] b, int start, int length) throws SAXException;
+-    
++
+     /**
+      * Receive notification of character data as an array of short.
+      *
+@@ -127,9 +127,9 @@
+      * @param length the number of short to read from the array
+      * @throws org.xml.sax.SAXException any SAX exception, possibly
+      *            wrapping another exception
+-     */    
++     */
+     public void shorts(short[] s, int start, int length) throws SAXException;
+-    
++
+     /**
+      * Receive notification of character data as an array of int.
+      *
+@@ -145,9 +145,9 @@
+      * @param length the number of int to read from the array
+      * @throws org.xml.sax.SAXException any SAX exception, possibly
+      *            wrapping another exception
+-     */    
++     */
+     public void ints(int [] i, int start, int length) throws SAXException;
+-    
++
+     /**
+      * Receive notification of character data as an array of long.
+      *
+@@ -163,9 +163,9 @@
+      * @param length the number of long to read from the array
+      * @throws org.xml.sax.SAXException any SAX exception, possibly
+      *            wrapping another exception
+-     */    
++     */
+     public void longs(long [] l, int start, int length) throws SAXException;
+-    
++
+     /**
+      * Receive notification of character data as an array of float.
+      *
+@@ -181,9 +181,9 @@
+      * @param length the number of float to read from the array
+      * @throws org.xml.sax.SAXException any SAX exception, possibly
+      *            wrapping another exception
+-     */    
++     */
+     public void floats(float [] f, int start, int length) throws SAXException;
+-    
++
+     /**
+      * Receive notification of character data as an array of double.
+      *
+@@ -199,7 +199,7 @@
+      * @param length the number of double to read from the array
+      * @throws org.xml.sax.SAXException any SAX exception, possibly
+      *            wrapping another exception
+-     */    
++     */
+     public void doubles(double [] d, int start, int length) throws SAXException;
+ 
+     /**
+@@ -215,10 +215,10 @@
+      * @param msblsb the array of long containing pairs of most signficant
+      * bits and least significant bits of the UUIDs
+      * @param start the start position in the array
+-     * @param length the number of long to read from the array. This will 
++     * @param length the number of long to read from the array. This will
+      * be twice the number of UUIDs, which are pairs of two long values
+      * @throws org.xml.sax.SAXException any SAX exception, possibly
+      *            wrapping another exception
+-     */    
++     */
+     public void uuids(long[] msblsb, int start, int length) throws SAXException;
+ }
+--- old/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/sax/RestrictedAlphabetContentHandler.java	Thu Jul 30 18:13:50 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/sax/RestrictedAlphabetContentHandler.java	Thu Jul 30 18:13:49 2009
+@@ -32,8 +32,8 @@
+ public interface RestrictedAlphabetContentHandler {
+ 
+     public void numericCharacters(char ch[], int start, int length) throws SAXException;
+-    
++
+     public void dateTimeCharacters(char ch[], int start, int length) throws SAXException;
+-    
++
+     public void alphabetCharacters(String alphabet, char ch[], int start, int length) throws SAXException;
+ }
+--- old/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/sax/helpers/EncodingAlgorithmAttributesImpl.java	Thu Jul 30 18:13:53 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/sax/helpers/EncodingAlgorithmAttributesImpl.java	Thu Jul 30 18:13:52 2009
+@@ -57,7 +57,7 @@
+  */
+ public class EncodingAlgorithmAttributesImpl implements EncodingAlgorithmAttributes {
+     private static final int DEFAULT_CAPACITY       = 8;
+-    
++
+     private static final int URI_OFFSET             = 0;
+     private static final int LOCALNAME_OFFSET       = 1;
+     private static final int QNAME_OFFSET           = 2;
+@@ -64,23 +64,23 @@
+     private static final int TYPE_OFFSET            = 3;
+     private static final int VALUE_OFFSET           = 4;
+     private static final int ALGORITHMURI_OFFSET    = 5;
+-    
++
+     private static final int SIZE                   = 6;
+-    
++
+     private Map _registeredEncodingAlgorithms;
+-    
++
+     private int _length;
+-    
++
+     private String[] _data;
+-    
++
+     private int[] _algorithmIds;
+-    
++
+     private Object[] _algorithmData;
+-    
++
+     private String[] _alphabets;
+-    
++
+     private boolean[] _toIndex;
+-    
++
+     /**
+      * Construct a new, empty EncodingAlgorithmAttributesImpl object.
+      */
+@@ -87,7 +87,7 @@
+     public EncodingAlgorithmAttributesImpl() {
+         this(null, null);
+     }
+-    
++
+     /**
+      * Copy an existing Attributes object.
+      *
+@@ -99,7 +99,7 @@
+     public EncodingAlgorithmAttributesImpl(Attributes attributes) {
+         this(null, attributes);
+     }
+-    
++
+     /**
+      * Use registered encoding algorithms and copy an existing Attributes object.
+      *
+@@ -117,9 +117,9 @@
+         _algorithmData = new Object[DEFAULT_CAPACITY];
+         _alphabets = new String[DEFAULT_CAPACITY];
+         _toIndex = new boolean[DEFAULT_CAPACITY];
+-        
++
+         _registeredEncodingAlgorithms = registeredEncodingAlgorithms;
+-        
++
+         if (attributes != null) {
+             if (attributes instanceof EncodingAlgorithmAttributes) {
+                 setAttributes((EncodingAlgorithmAttributes)attributes);
+@@ -128,7 +128,7 @@
+             }
+         }
+     }
+-    
++
+     /**
+      * Clear the attribute list for reuse.
+      *
+@@ -140,7 +140,7 @@
+         }
+         _length = 0;
+     }
+-    
++
+     /**
+      * Add an attribute to the end of the list.
+      *
+@@ -148,7 +148,7 @@
+      * to see if the attribute is already in the list: that is
+      * the responsibility of the application.</p>
+      *
+-     * @param uri The Namespace URI, or the empty string if
++     * @param URI The Namespace URI, or the empty string if
+      *        none is available or Namespace processing is not
+      *        being performed.
+      * @param localName The local name, or the empty string if
+@@ -163,7 +163,7 @@
+         if (_length >= _algorithmData.length) {
+             resize();
+         }
+-        
++
+         int i = _length * SIZE;
+         _data[i++] = replaceNull(URI);
+         _data[i++] = replaceNull(localName);
+@@ -172,10 +172,10 @@
+         _data[i++] = replaceNull(value);
+         _toIndex[_length] = false;
+         _alphabets[_length] = null;
+-        
++
+         _length++;
+     }
+-    
++
+     /**
+      * Add an attribute to the end of the list.
+      *
+@@ -183,7 +183,7 @@
+      * to see if the attribute is already in the list: that is
+      * the responsibility of the application.</p>
+      *
+-     * @param uri The Namespace URI, or the empty string if
++     * @param URI The Namespace URI, or the empty string if
+      *        none is available or Namespace processing is not
+      *        being performed.
+      * @param localName The local name, or the empty string if
+@@ -193,7 +193,7 @@
+      * @param type The attribute type as a string.
+      * @param value The attribute value.
+      * @param index True if attribute should be indexed.
+-     * @param index The alphabet associated with the attribute value, 
++     * @param alphabet The alphabet associated with the attribute value,
+      *              may be null if there is no associated alphabet.
+      */
+     public void addAttribute(String URI, String localName, String qName,
+@@ -201,7 +201,7 @@
+         if (_length >= _algorithmData.length) {
+             resize();
+         }
+-        
++
+         int i = _length * SIZE;
+         _data[i++] = replaceNull(URI);
+         _data[i++] = replaceNull(localName);
+@@ -210,10 +210,10 @@
+         _data[i++] = replaceNull(value);
+         _toIndex[_length] = index;
+         _alphabets[_length] = alphabet;
+-        
++
+         _length++;
+     }
+-    
++
+     /**
+      * Add an attribute with built in algorithm data to the end of the list.
+      *
+@@ -221,7 +221,7 @@
+      * to see if the attribute is already in the list: that is
+      * the responsibility of the application.</p>
+      *
+-     * @param uri The Namespace URI, or the empty string if
++     * @param URI The Namespace URI, or the empty string if
+      *        none is available or Namespace processing is not
+      *        being performed.
+      * @param localName The local name, or the empty string if
+@@ -236,7 +236,7 @@
+         if (_length >= _algorithmData.length) {
+             resize();
+         }
+-        
++
+         int i = _length * SIZE;
+         _data[i++] = replaceNull(URI);
+         _data[i++] = replaceNull(localName);
+@@ -248,10 +248,10 @@
+         _algorithmData[_length] = algorithmData;
+         _toIndex[_length] = false;
+         _alphabets[_length] = null;
+-        
++
+         _length++;
+     }
+-    
++
+     /**
+      * Add an attribute with algorithm data to the end of the list.
+      *
+@@ -259,7 +259,7 @@
+      * to see if the attribute is already in the list: that is
+      * the responsibility of the application.</p>
+      *
+-     * @param uri The Namespace URI, or the empty string if
++     * @param URI The Namespace URI, or the empty string if
+      *        none is available or Namespace processing is not
+      *        being performed.
+      * @param localName The local name, or the empty string if
+@@ -275,7 +275,7 @@
+         if (_length >= _algorithmData.length) {
+             resize();
+         }
+-        
++
+         int i = _length * SIZE;
+         _data[i++] = replaceNull(URI);
+         _data[i++] = replaceNull(localName);
+@@ -287,10 +287,10 @@
+         _algorithmData[_length] = algorithmData;
+         _toIndex[_length] = false;
+         _alphabets[_length] = null;
+-        
++
+         _length++;
+     }
+-    
++
+     /**
+      * Replace an attribute value with algorithm data.
+      *
+@@ -306,7 +306,7 @@
+     public void replaceWithAttributeAlgorithmData(int index,
+             String algorithmURI, int algorithmID, Object algorithmData) {
+         if (index < 0 || index >= _length) return;
+-        
++
+         int i = index * SIZE;
+         _data[i + VALUE_OFFSET] = null;
+         _data[i + ALGORITHMURI_OFFSET] = algorithmURI;
+@@ -315,7 +315,7 @@
+         _toIndex[index] = false;
+         _alphabets[index] = null;
+     }
+-    
++
+     /**
+      * Copy an entire Attributes object.
+      *
+@@ -324,11 +324,11 @@
+     public void setAttributes(Attributes atts) {
+         _length = atts.getLength();
+         if (_length > 0) {
+-            
++
+             if (_length >= _algorithmData.length) {
+                 resizeNoCopy();
+             }
+-            
++
+             int index = 0;
+             for (int i = 0; i < _length; i++) {
+                 _data[index++] = atts.getURI(i);
+@@ -342,7 +342,7 @@
+             }
+         }
+     }
+-    
++
+     /**
+      * Copy an entire EncodingAlgorithmAttributes object.
+      *
+@@ -351,11 +351,11 @@
+     public void setAttributes(EncodingAlgorithmAttributes atts) {
+         _length = atts.getLength();
+         if (_length > 0) {
+-            
++
+             if (_length >= _algorithmData.length) {
+                 resizeNoCopy();
+             }
+-            
++
+             int index = 0;
+             for (int i = 0; i < _length; i++) {
+                 _data[index++] = atts.getURI(i);
+@@ -371,13 +371,13 @@
+             }
+         }
+     }
+-    
++
+     // org.xml.sax.Attributes
+-    
++
+     public final int getLength() {
+         return _length;
+     }
+-    
++
+     public final String getLocalName(int index) {
+         if (index >= 0 && index < _length) {
+             return _data[index * SIZE + LOCALNAME_OFFSET];
+@@ -385,7 +385,7 @@
+             return null;
+         }
+     }
+-    
++
+     public final String getQName(int index) {
+         if (index >= 0 && index < _length) {
+             return _data[index * SIZE + QNAME_OFFSET];
+@@ -393,7 +393,7 @@
+             return null;
+         }
+     }
+-    
++
+     public final String getType(int index) {
+         if (index >= 0 && index < _length) {
+             return _data[index * SIZE + TYPE_OFFSET];
+@@ -401,7 +401,7 @@
+             return null;
+         }
+     }
+-    
++
+     public final String getURI(int index) {
+         if (index >= 0 && index < _length) {
+             return _data[index * SIZE + URI_OFFSET];
+@@ -409,7 +409,7 @@
+             return null;
+         }
+     }
+-    
++
+     public final String getValue(int index) {
+         if (index >= 0 && index < _length) {
+             final String value = _data[index * SIZE + VALUE_OFFSET];
+@@ -417,11 +417,11 @@
+         } else {
+             return null;
+         }
+-        
++
+         if (_algorithmData[index] == null || _registeredEncodingAlgorithms == null) {
+             return null;
+         }
+-        
++
+         try {
+             return _data[index * SIZE + VALUE_OFFSET] = convertEncodingAlgorithmDataToString(
+                     _algorithmIds[index],
+@@ -433,7 +433,7 @@
+             return null;
+         }
+     }
+-    
++
+     public final int getIndex(String qName) {
+         for (int index = 0; index < _length; index++) {
+             if (qName.equals(_data[index * SIZE + QNAME_OFFSET])) {
+@@ -442,7 +442,7 @@
+         }
+         return -1;
+     }
+-    
++
+     public final String getType(String qName) {
+         int index = getIndex(qName);
+         if (index >= 0) {
+@@ -451,7 +451,7 @@
+             return null;
+         }
+     }
+-    
++
+     public final String getValue(String qName) {
+         int index = getIndex(qName);
+         if (index >= 0) {
+@@ -460,7 +460,7 @@
+             return null;
+         }
+     }
+-    
++
+     public final int getIndex(String uri, String localName) {
+         for (int index = 0; index < _length; index++) {
+             if (localName.equals(_data[index * SIZE + LOCALNAME_OFFSET]) &&
+@@ -470,7 +470,7 @@
+         }
+         return -1;
+     }
+-    
++
+     public final String getType(String uri, String localName) {
+         int index = getIndex(uri, localName);
+         if (index >= 0) {
+@@ -479,7 +479,7 @@
+             return null;
+         }
+     }
+-    
++
+     public final String getValue(String uri, String localName) {
+         int index = getIndex(uri, localName);
+         if (index >= 0) {
+@@ -488,9 +488,9 @@
+             return null;
+         }
+     }
+-    
++
+     // EncodingAlgorithmAttributes
+-    
++
+     public final String getAlgorithmURI(int index) {
+         if (index >= 0 && index < _length) {
+             return _data[index * SIZE + ALGORITHMURI_OFFSET];
+@@ -498,7 +498,7 @@
+             return null;
+         }
+     }
+-    
++
+     public final int getAlgorithmIndex(int index) {
+         if (index >= 0 && index < _length) {
+             return _algorithmIds[index];
+@@ -506,7 +506,7 @@
+             return -1;
+         }
+     }
+-    
++
+     public final Object getAlgorithmData(int index) {
+         if (index >= 0 && index < _length) {
+             return _algorithmData[index];
+@@ -514,9 +514,9 @@
+             return null;
+         }
+     }
+-    
++
+     // ExtendedAttributes
+-    
++
+     public final String getAlpababet(int index) {
+         if (index >= 0 && index < _length) {
+             return _alphabets[index];
+@@ -524,7 +524,7 @@
+             return null;
+         }
+     }
+-    
++
+     public final boolean getToIndex(int index) {
+         if (index >= 0 && index < _length) {
+             return _toIndex[index];
+@@ -532,36 +532,36 @@
+             return false;
+         }
+     }
+-    
++
+     // -----
+-    
++
+     private final String replaceNull(String s) {
+         return (s != null) ? s : "";
+     }
+-    
++
+     private final void resizeNoCopy() {
+         final int newLength = _length * 3 / 2 + 1;
+-        
++
+         _data = new String[newLength * SIZE];
+         _algorithmIds = new int[newLength];
+         _algorithmData = new Object[newLength];
+     }
+-    
++
+     private final void resize() {
+         final int newLength = _length * 3 / 2 + 1;
+-        
++
+         String[] data = new String[newLength * SIZE];
+         int[] algorithmIds = new int[newLength];
+         Object[] algorithmData = new Object[newLength];
+         String[] alphabets = new String[newLength];
+         boolean[] toIndex = new boolean[newLength];
+-        
++
+         System.arraycopy(_data, 0, data, 0, _length * SIZE);
+         System.arraycopy(_algorithmIds, 0, algorithmIds, 0, _length);
+         System.arraycopy(_algorithmData, 0, algorithmData, 0, _length);
+         System.arraycopy(_alphabets, 0, alphabets, 0, _length);
+         System.arraycopy(_toIndex, 0, toIndex, 0, _length);
+-        
++
+         _data = data;
+         _algorithmIds = algorithmIds;
+         _algorithmData = algorithmData;
+@@ -568,12 +568,12 @@
+         _alphabets = alphabets;
+         _toIndex = toIndex;
+     }
+-    
++
+     private final StringBuffer convertEncodingAlgorithmDataToString(
+             int identifier, String URI, Object data) throws FastInfosetException, IOException {
+         EncodingAlgorithm ea = null;
+         if (identifier < EncodingConstants.ENCODING_ALGORITHM_BUILTIN_END) {
+-            ea = BuiltInEncodingAlgorithmFactory.table[identifier];
++            ea = BuiltInEncodingAlgorithmFactory.getAlgorithm(identifier);
+         } else if (identifier == EncodingAlgorithmIndexes.CDATA) {
+             throw new EncodingAlgorithmException(
+                     CommonResourceBundle.getInstance().getString("message.CDATAAlgorithmNotSupported"));
+@@ -582,7 +582,7 @@
+                 throw new EncodingAlgorithmException(
+                         CommonResourceBundle.getInstance().getString("message.URINotPresent") + identifier);
+             }
+-            
++
+             ea = (EncodingAlgorithm)_registeredEncodingAlgorithms.get(URI);
+             if (ea == null) {
+                 throw new EncodingAlgorithmException(
+@@ -595,7 +595,7 @@
+             throw new EncodingAlgorithmException(
+                     CommonResourceBundle.getInstance().getString("message.identifiers10to31Reserved"));
+         }
+-        
++
+         final StringBuffer sb = new StringBuffer();
+         ea.convertToCharacters(data, sb);
+         return sb;
+--- old/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/sax/helpers/FastInfosetDefaultHandler.java	Thu Jul 30 18:13:57 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/sax/helpers/FastInfosetDefaultHandler.java	Thu Jul 30 18:13:56 2009
+@@ -36,7 +36,7 @@
+ /**
+  * Default base class for SAX event handlers of a {@link FastInfosetReader}.
+  * <p>
+- * This class is available as a convenience for applications: it provides 
++ * This class is available as a convenience for applications: it provides
+  * default implementations for all of the callbacks of the following:
+  * <UL>
+  *   <LI>{@link DefaultHandler}</LI>
+@@ -44,7 +44,7 @@
+  *   <LI>{@link EncodingAlgorithmContentHandler}</LI>
+  *   <LI>{@link PrimitiveTypeContentHandler}</LI>
+  * </UL>
+- * Application writers can extend this class when they need to implement only 
++ * Application writers can extend this class when they need to implement only
+  * part of an interface; parser writers can instantiate this class to provide
+  * default handlers when the application has not supplied its own.
+  */
+@@ -52,22 +52,22 @@
+         LexicalHandler, EncodingAlgorithmContentHandler, PrimitiveTypeContentHandler {
+ 
+     // LexicalHandler
+-    
++
+     public void comment(char[] ch, int start, int length) throws SAXException {
+     }
+-  
++
+     public void startCDATA() throws SAXException {
+     }
+-  
++
+     public void endCDATA() throws SAXException {
+     }
+-    
++
+     public void startDTD(String name, String publicId, String systemId) throws SAXException {
+     }
+ 
+     public void endDTD() throws SAXException {
+     }
+-    
++
+     public void startEntity(String name) throws SAXException {
+     }
+ 
+@@ -74,36 +74,36 @@
+     public void endEntity(String name) throws SAXException {
+     }
+ 
+-    
++
+     // EncodingAlgorithmContentHandler
+-    
++
+     public void octets(String URI, int algorithm, byte[] b, int start, int length)  throws SAXException {
+     }
+ 
+     public void object(String URI, int algorithm, Object o)  throws SAXException {
+     }
+-    
+-    
++
++
+     // PrimitiveTypeContentHandler
+-    
++
+     public void booleans(boolean[] b, int start, int length) throws SAXException {
+     }
+ 
+     public void bytes(byte[] b, int start, int length) throws SAXException {
+     }
+-    
++
+     public void shorts(short[] s, int start, int length) throws SAXException {
+     }
+-    
++
+     public void ints(int[] i, int start, int length) throws SAXException {
+     }
+-    
++
+     public void longs(long[] l, int start, int length) throws SAXException {
+     }
+-    
++
+     public void floats(float[] f, int start, int length) throws SAXException {
+     }
+-    
++
+     public void doubles(double[] d, int start, int length) throws SAXException {
+     }
+ 
+--- old/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/stax/FastInfosetStreamReader.java	Thu Jul 30 18:14:00 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/stax/FastInfosetStreamReader.java	Thu Jul 30 18:14:00 2009
+@@ -32,31 +32,31 @@
+ /**
+  * Fast Infoset Stream Reader.
+  * <p>
+- * This interface provides additional optimized methods to that of 
++ * This interface provides additional optimized methods to that of
+  * {@link javax.xml.stream.XMLStreamReader}.
+  */
+ public interface FastInfosetStreamReader {
+     /**
+      * Peek at the next event.
+-     * 
+-     * @return the event, which will be the same as that returned from 
++     *
++     * @return the event, which will be the same as that returned from
+      *         {@link #next}.
+      */
+     public int peekNext() throws XMLStreamException;
+-    
++
+     // Faster access methods without checks
+-    
++
+     public int accessNamespaceCount();
+-    
++
+     public String accessLocalName();
+-        
++
+     public String accessNamespaceURI();
+-    
++
+     public String accessPrefix();
+-    
++
+     public char[] accessTextCharacters();
+-    
++
+     public int accessTextStart();
+-    
++
+     public int accessTextLength();
+ }
+--- old/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/stax/LowLevelFastInfosetStreamWriter.java	Thu Jul 30 18:14:04 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/fastinfoset/stax/LowLevelFastInfosetStreamWriter.java	Thu Jul 30 18:14:03 2009
+@@ -40,18 +40,18 @@
+  * process and has the knowledge to call the LowLevel methods in the required
+  * order.
+  * <p>
+- * For example, the application may be able to perform efficient information 
++ * For example, the application may be able to perform efficient information
+  * to indexing mapping and to provide certain information in UTF-8 encoded form.
+  * <p>
+  * These methods may be used in conjuction with {@link javax.xml.stream.XMLStreamWriter}
+  * as long as an element fragment written using the efficient streaming methods
+- * are self-contained and no sub-fragment is written using methods from 
++ * are self-contained and no sub-fragment is written using methods from
+  * {@link javax.xml.stream.XMLStreamWriter}.
+  * <p>
+  * The required call sequence is as follows:
+  * <pre>
+- * CALLSEQUENCE    := {@link #startDocument startDocument} 
+- *                    initiateLowLevelWriting ELEMENT 
++ * CALLSEQUENCE    := {@link #startDocument startDocument}
++ *                    initiateLowLevelWriting ELEMENT
+  *                    {@link #endDocument endDocument}
+  *                 |  initiateLowLevelWriting ELEMENT   // for fragment
+  *
+@@ -58,19 +58,19 @@
+  * ELEMENT         := writeLowLevelTerminationAndMark
+  *                    NAMESPACES?
+  *                    ELEMENT_NAME
+- *                    ATTRIBUTES? 
++ *                    ATTRIBUTES?
+  *                    writeLowLevelEndStartElement
+  *                    CONTENTS
+  *                    writeLowLevelEndElement
+  *
+  * NAMESPACES      := writeLowLevelStartNamespaces
+- *                    writeLowLevelNamespace* 
++ *                    writeLowLevelNamespace*
+  *                    writeLowLevelEndNamespaces
+  *
+  * ELEMENT_NAME    := writeLowLevelStartElementIndexed
+  *                 |  writeLowLevelStartNameLiteral
+  *                 |  writeLowLevelStartElement
+- * 
++ *
+  * ATTRUBUTES      := writeLowLevelStartAttributes
+  *                   (ATTRIBUTE_NAME writeLowLevelAttributeValue)*
+  *
+@@ -77,8 +77,8 @@
+  * ATTRIBUTE_NAME  := writeLowLevelAttributeIndexed
+  *                 |  writeLowLevelStartNameLiteral
+  *                 |  writeLowLevelAttribute
+- *       
+  *
++ *
+  * CONTENTS      := (ELEMENT | writeLowLevelText writeLowLevelOctets)*
+  * </pre>
+  * <p>
+@@ -93,7 +93,7 @@
+      */
+     public void initiateLowLevelWriting()
+     throws XMLStreamException;
+-        
++
+     /**
+      * Get the next index to apply to an Element Information Item.
+      * <p>
+@@ -118,15 +118,15 @@
+      * @return the index.
+      */
+     public int getNextAttributeIndex();
+-    
++
+     /**
+-     * Get the current index that was applied to an [local name] of an 
++     * Get the current index that was applied to an [local name] of an
+      * Element or Attribute Information Item.
+      * </pre>
+      * @return the index.
+      */
+     public int getLocalNameIndex();
+-    
++
+     /**
+      * Get the next index to apply to an [local name] of an Element or Attribute
+      * Information Item.
+@@ -145,31 +145,31 @@
+ 
+     public void writeLowLevelStartElementIndexed(int type, int index)
+     throws IOException;
+-    
++
+     /**
+      * Write the start of an element.
+      *
+      * @return true if element is indexed, otherwise false.
+      */
+-    public boolean writeLowLevelStartElement(int type, 
+-            String prefix, String localName, String namespaceURI) 
++    public boolean writeLowLevelStartElement(int type,
++            String prefix, String localName, String namespaceURI)
+             throws IOException;
+-                
++
+     public void writeLowLevelStartNamespaces()
+     throws IOException;
+-    
+-    public void writeLowLevelNamespace(String prefix, String namespaceName) 
++
++    public void writeLowLevelNamespace(String prefix, String namespaceName)
+         throws IOException;
+-    
++
+     public void writeLowLevelEndNamespaces()
+     throws IOException;
+-    
++
+     public void writeLowLevelStartAttributes()
+     throws IOException;
+-        
++
+     public void writeLowLevelAttributeIndexed(int index)
+     throws IOException;
+-    
++
+     /**
+      * Write an attribute.
+      *
+@@ -178,30 +178,30 @@
+     public boolean writeLowLevelAttribute(
+             String prefix, String namespaceURI, String localName)
+             throws IOException;
+-                
++
+     public void writeLowLevelAttributeValue(String value)
+     throws IOException;
+-    
+-    public void writeLowLevelStartNameLiteral(int type, 
++
++    public void writeLowLevelStartNameLiteral(int type,
+             String prefix, byte[] utf8LocalName, String namespaceURI)
+             throws IOException;
+-    
++
+     public void writeLowLevelStartNameLiteral(int type,
+             String prefix, int localNameIndex, String namespaceURI)
+             throws IOException;
+-    
++
+     public void writeLowLevelEndStartElement()
+     throws IOException;
+-    
++
+     public void writeLowLevelEndElement()
+     throws IOException;
+-    
++
+     public void writeLowLevelText(char[] text, int length)
+     throws IOException;
+-    
++
+     public void writeLowLevelText(String text)
+     throws IOException;
+-    
++
+     public void writeLowLevelOctets(byte[] octets, int length)
+     throws IOException;
+ }
+--- old/src/share/classes/com/sun/xml/internal/org/jvnet/staxex/Base64Data.java	Thu Jul 30 18:14:07 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/staxex/Base64Data.java	Thu Jul 30 18:14:07 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.org.jvnet.staxex;
+ 
+ import javax.activation.DataHandler;
+@@ -44,6 +45,7 @@
+ public class Base64Data implements CharSequence, Cloneable {
+ 
+     // either dataHandler or (data,dataLen,mimeType?) must be present
++    // (note that having both is allowed)
+ 
+     private DataHandler dataHandler;
+ 
+@@ -73,6 +75,7 @@
+ 
+     /**
+      * Clone constructor
++     * @param that needs to be cloned
+      */
+     public Base64Data(Base64Data that) {
+         that.get();
+@@ -92,8 +95,10 @@
+     /**
+      * Fills in the data object by a portion of the byte[].
+      *
++     * @param data actual data
+      * @param len
+      *      data[0] to data[len-1] are treated as the data.
++     * @param mimeType MIME type
+      * @param cloneByRef
+      *      true if data[] can be cloned by reference
+      */
+@@ -108,8 +113,10 @@
+     /**
+      * Fills in the data object by a portion of the byte[].
+      *
++     * @param data actual data bytes
+      * @param len
+      *      data[0] to data[len-1] are treated as the data.
++     * @param mimeType MIME type
+      */
+     public void set(byte[] data, int len, String mimeType) {
+         set(data,len,mimeType,false);
+@@ -120,6 +127,7 @@
+      *
+      * @param data
+      *      this buffer may be owned directly by the unmarshaleld JAXB object.
++     * @param mimeType MIME type
+      */
+     public void set(byte[] data,String mimeType) {
+         set(data,data.length,mimeType,false);
+@@ -127,6 +135,8 @@
+ 
+     /**
+      * Fills in the data object by a {@link DataHandler}.
++     *
++     * @param data DataHandler for the data
+      */
+     public void set(DataHandler data) {
+         assert data!=null;
+@@ -135,7 +145,11 @@
+     }
+ 
+     /**
+-     * Gets the raw data.
++     * Gets the raw data. If the returned DataHandler is {@link StreamingDataHandler},
++     * callees may need to downcast to take advantage of its capabilities.
++     *
++     * @see StreamingDataHandler
++     * @return DataHandler for the data
+      */
+     public DataHandler getDataHandler() {
+         if(dataHandler==null){
+@@ -162,6 +176,8 @@
+ 
+     /**
+      * Gets the byte[] of the exact length.
++     *
++     * @return byte[] for data
+      */
+     public byte[] getExact() {
+         get();
+@@ -175,6 +191,9 @@
+ 
+     /**
+      * Gets the data as an {@link InputStream}.
++     *
++     * @return data as InputStream
++     * @throws IOException if i/o error occurs
+      */
+     public InputStream getInputStream() throws IOException {
+         if(dataHandler!=null)
+@@ -186,6 +205,8 @@
+     /**
+      * Returns false if this object only has {@link DataHandler} and therefore
+      * {@link #get()} operation is likely going to be expensive.
++     *
++     * @return false if it has only DataHandler
+      */
+     public boolean hasData() {
+         return data!=null;
+@@ -193,6 +214,8 @@
+ 
+     /**
+      * Gets the raw data. The size of the byte array maybe larger than the actual length.
++     *
++     * @return data as byte[], the array may be larger
+      */
+     public byte[] get() {
+         if(data==null) {
+@@ -212,7 +235,18 @@
+         return data;
+     }
+ 
++    /**
++     * Gets the length of the binary data counted in bytes.
++     *
++     * Note that if this object encapsulates {@link DataHandler},
++     * this method would have to read the whole thing into {@code byte[]}
++     * just to count the length, because {@link DataHandler}
++     * doesn't easily expose the length.
++     *
++     * @return no of bytes
++     */
+     public int getDataLen() {
++        get();
+         return dataLen;
+     }
+ 
+--- old/src/share/classes/com/sun/xml/internal/org/jvnet/staxex/Base64Encoder.java	Thu Jul 30 18:14:11 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/staxex/Base64Encoder.java	Thu Jul 30 18:14:10 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.org.jvnet.staxex;
+ 
+ /**
+--- old/src/share/classes/com/sun/xml/internal/org/jvnet/staxex/ByteArrayOutputStreamEx.java	Thu Jul 30 18:14:14 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/staxex/ByteArrayOutputStreamEx.java	Thu Jul 30 18:14:14 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.org.jvnet.staxex;
+ 
+ import java.io.ByteArrayOutputStream;
+--- old/src/share/classes/com/sun/xml/internal/org/jvnet/staxex/NamespaceContextEx.java	Thu Jul 30 18:14:18 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/staxex/NamespaceContextEx.java	Thu Jul 30 18:14:17 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.org.jvnet.staxex;
+ 
+ import javax.xml.namespace.NamespaceContext;
+--- old/src/share/classes/com/sun/xml/internal/org/jvnet/staxex/XMLStreamReaderEx.java	Thu Jul 30 18:14:22 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/staxex/XMLStreamReaderEx.java	Thu Jul 30 18:14:21 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.org.jvnet.staxex;
+ 
+ import javax.xml.stream.XMLStreamReader;
+@@ -178,7 +179,7 @@
+      * The parser can often do this more efficiently than
+      * {@code getElementText().trim()}.
+      *
+-     * @see #getElementText() 
++     * @see #getElementText()
+      */
+     String getElementTextTrim() throws XMLStreamException;
+ }
+--- old/src/share/classes/com/sun/xml/internal/org/jvnet/staxex/XMLStreamWriterEx.java	Thu Jul 30 18:14:25 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/staxex/XMLStreamWriterEx.java	Thu Jul 30 18:14:25 2009
+@@ -22,13 +22,12 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.org.jvnet.staxex;
+ 
+-import com.sun.xml.internal.org.jvnet.staxex.XMLStreamReaderEx;
+-
+-import javax.xml.stream.XMLStreamWriter;
+-import javax.xml.stream.XMLStreamException;
+ import javax.activation.DataHandler;
++import javax.xml.stream.XMLStreamException;
++import javax.xml.stream.XMLStreamWriter;
+ import java.io.OutputStream;
+ 
+ /**
+@@ -85,6 +84,7 @@
+      *
+      * <p>
+      * (data,start,len) triplet identifies the binary data to be written.
++     * After the method invocation, the callee owns the buffer.
+      *
+      * @param contentType
+      *      this mandatory parameter identifies the MIME type of the binary data.
+@@ -103,7 +103,7 @@
+      * {@link DataHandler#getInputStream()}.
+      *
+      * @param data
+-     *      always non-null.
++     *      always non-null. After this method call, the callee owns the data handler.
+      */
+     void writeBinary(DataHandler data) throws XMLStreamException;
+ 
+@@ -132,7 +132,7 @@
+      * Writes like {@link #writeCharacters(String)} but hides
+      * actual data format.
+      *
+-     * @return
++     * @param data
+      *      The {@link CharSequence} that represents the
+      *      character infoset items to be written.
+      *
+@@ -144,10 +144,6 @@
+      *      as binary data may take advantage of mor efficient
+      *      data representation.)
+      *
+-     *      <p>
+-     *      The object returned from this method belongs to the parser,
+-     *      and its content is guaranteed to be the same only until
+-     *      the {@link #next()} method is invoked.
+      */
+     void writePCDATA(CharSequence data) throws XMLStreamException;
+ 
+--- old/src/share/classes/com/sun/xml/internal/rngom/ast/builder/BuildException.java	Thu Jul 30 18:14:29 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/builder/BuildException.java	Thu Jul 30 18:14:28 2009
+@@ -26,7 +26,7 @@
+ 
+ /**
+  * Signals an error while building schemas.
+- * 
++ *
+  * <p>
+  * Only {@link SchemaBuilder} can throw this exception to
+  * abort the parsing in the middle.
+--- old/src/share/classes/com/sun/xml/internal/rngom/ast/builder/NameClassBuilder.java	Thu Jul 30 18:14:32 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/builder/NameClassBuilder.java	Thu Jul 30 18:14:32 2009
+@@ -32,7 +32,7 @@
+ 
+ 
+ /**
+- * 
++ *
+  * @author
+  *      Kohsuke Kawaguchi (kk@kohsuke.org)
+  */
+@@ -52,7 +52,7 @@
+ //    static final String INHERIT_NS = new String("#inherit");
+ 
+ // similarly, xmlns:* attribute should be rejected by the parser -KK
+-    
++
+     N makeName(String ns, String localName, String prefix, L loc, A anno);
+     N makeNsName(String ns, L loc, A anno);
+     /**
+--- old/src/share/classes/com/sun/xml/internal/rngom/ast/builder/SchemaBuilder.java	Thu Jul 30 18:14:36 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/builder/SchemaBuilder.java	Thu Jul 30 18:14:36 2009
+@@ -48,7 +48,7 @@
+      * classes for this {@link SchemaBuilder}. The
+      * {@link com.sun.xml.internal.rngom.nc.NameClass}es that are built will then be
+      * fed into this {@link SchemaBuilder}to further build RELAX NG patterns.
+-     * 
++     *
+      * @return always return a non-null valid object. This method can (and
+      *         probably should) always return the same object.
+      */
+@@ -86,7 +86,7 @@
+             Context c, String ns, L loc, A anno) throws BuildException;
+ 
+     /**
+-     * 
++     *
+      * @param parent
+      *      The parent scope. null if there's no parent scope.
+      *      For example, if the complete document looks like the following:
+@@ -131,7 +131,7 @@
+     P commentAfter(P p, CL comments) throws BuildException;
+ 
+     /**
+-     * 
++     *
+      * @param current
+      *      Current grammar that we are parsing. This is what contains
+      *      externalRef.
+@@ -169,10 +169,10 @@
+      * skiping comment-related handlings.
+      */
+     boolean usesComments();
+-    
++
+     /**
+      * Called after all the parsing is done.
+-     * 
++     *
+      * <p>
+      * This hook typically allows as {@link SchemaBuilder} to expand
+      * notAllowed (if it's following the simplification as in the spec.)
+--- old/src/share/classes/com/sun/xml/internal/rngom/ast/util/CheckingSchemaBuilder.java	Thu Jul 30 18:14:40 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/rngom/ast/util/CheckingSchemaBuilder.java	Thu Jul 30 18:14:39 2009
+@@ -38,7 +38,7 @@
+ /**
+  * Wraps a {@link SchemaBuilder} and does all the semantic checks
+  * required by the RELAX NG spec.
+- * 
++ *
+  * <h2>Usage</h2>
+  * <p>
+  * Whereas you normally write it as follows:
+@@ -49,17 +49,17 @@
+  * <pre>
+  * YourParsedPattern r = (YourParsedPattern)parseable.parse(new CheckingSchemaBuilder(sb,eh));
+  * </pre>
+- * 
++ *
+  * <p>
+  * The checking is done by using the <tt>rngom.binary</tt> package, so if you are using
+  * that package for parsing schemas, then there's no need to use this.
+- * 
++ *
+  * @author
+  *      Kohsuke Kawaguchi (kk@kohsuke.org)
+  */
+ public class CheckingSchemaBuilder extends SchemaBuilderHost {
+     /**
+-     * 
++     *
+      * @param sb
+      *      Your {@link SchemaBuilder} that parses RELAX NG schemas.
+      * @param eh
+@@ -71,10 +71,10 @@
+     public CheckingSchemaBuilder( SchemaBuilder sb, ErrorHandler eh, DatatypeLibraryFactory dlf ) {
+         super(new SchemaBuilderImpl(eh,dlf,new SchemaPatternBuilder()),sb);
+     }
+-    
++
+     public ParsedPattern expandPattern(ParsedPattern p)
+         throws BuildException, IllegalSchemaException {
+-        
++
+         // just return the result from the user-given SchemaBuilder
+         ParsedPatternHost r = (ParsedPatternHost)super.expandPattern(p);
+         return r.rhs;
+--- old/src/share/classes/com/sun/xml/internal/rngom/binary/AfterPattern.java	Thu Jul 30 18:14:43 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/AfterPattern.java	Thu Jul 30 18:14:43 2009
+@@ -31,9 +31,9 @@
+ public class AfterPattern extends BinaryPattern {
+   AfterPattern(Pattern p1, Pattern p2) {
+     super(false,
+-	  combineHashCode(AFTER_HASH_CODE, p1.hashCode(), p2.hashCode()),
+-	  p1,
+-	  p2);
++          combineHashCode(AFTER_HASH_CODE, p1.hashCode(), p2.hashCode()),
++          p1,
++          p2);
+   }
+ 
+   boolean isNotAllowed() {
+--- old/src/share/classes/com/sun/xml/internal/rngom/binary/Alphabet.java	Thu Jul 30 18:14:47 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/Alphabet.java	Thu Jul 30 18:14:46 2009
+@@ -47,8 +47,8 @@
+ 
+   void checkOverlap(Alphabet a) throws RestrictionViolationException {
+     if (nameClass != null
+-	&& a.nameClass != null
+-	&& nameClass.hasOverlapWith(a.nameClass))
++        && a.nameClass != null
++        && nameClass.hasOverlapWith(a.nameClass))
+       throw new RestrictionViolationException("interleave_element_overlap");
+   }
+ }
+--- old/src/share/classes/com/sun/xml/internal/rngom/binary/AttributePattern.java	Thu Jul 30 18:14:50 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/AttributePattern.java	Thu Jul 30 18:14:50 2009
+@@ -38,10 +38,10 @@
+ 
+   AttributePattern(NameClass nameClass, Pattern value, Locator loc) {
+     super(false,
+-	  EMPTY_CONTENT_TYPE,
+-	  combineHashCode(ATTRIBUTE_HASH_CODE,
+-			  nameClass.hashCode(),
+-			  value.hashCode()));
++          EMPTY_CONTENT_TYPE,
++          combineHashCode(ATTRIBUTE_HASH_CODE,
++                          nameClass.hashCode(),
++                          value.hashCode()));
+     this.nameClass = nameClass;
+     this.p = value;
+     this.loc = loc;
+@@ -62,7 +62,7 @@
+       throw new RestrictionViolationException("start_contains_attribute");
+     case ELEMENT_CONTEXT:
+       if (nameClass.isOpen())
+-	throw new RestrictionViolationException("open_name_class_not_repeated");
++        throw new RestrictionViolationException("open_name_class_not_repeated");
+       break;
+     case ELEMENT_REPEAT_GROUP_CONTEXT:
+       throw new RestrictionViolationException("one_or_more_contains_group_contains_attribute");
+--- old/src/share/classes/com/sun/xml/internal/rngom/binary/ChoicePattern.java	Thu Jul 30 18:14:54 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/ChoicePattern.java	Thu Jul 30 18:14:53 2009
+@@ -30,9 +30,9 @@
+ public class ChoicePattern extends BinaryPattern {
+   ChoicePattern(Pattern p1, Pattern p2) {
+     super(p1.isNullable() || p2.isNullable(),
+-	  combineHashCode(CHOICE_HASH_CODE, p1.hashCode(), p2.hashCode()),
+-	  p1,
+-	  p2);
++          combineHashCode(CHOICE_HASH_CODE, p1.hashCode(), p2.hashCode()),
++          p1,
++          p2);
+   }
+   Pattern expand(SchemaPatternBuilder b) {
+     Pattern ep1 = p1.expand(b);
+@@ -68,4 +68,3 @@
+   }
+ 
+ }
+-
+--- old/src/share/classes/com/sun/xml/internal/rngom/binary/ElementPattern.java	Thu Jul 30 18:14:57 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/ElementPattern.java	Thu Jul 30 18:14:57 2009
+@@ -40,10 +40,10 @@
+ 
+   ElementPattern(NameClass nameClass, Pattern p, Locator loc) {
+     super(false,
+-	  ELEMENT_CONTENT_TYPE,
+-	  combineHashCode(ELEMENT_HASH_CODE,
+-			  nameClass.hashCode(),
+-			  p.hashCode()));
++          ELEMENT_CONTENT_TYPE,
++          combineHashCode(ELEMENT_HASH_CODE,
++                          nameClass.hashCode(),
++                          p.hashCode()));
+     this.nameClass = nameClass;
+     this.origNameClass = nameClass;
+     this.p = p;
+--- old/src/share/classes/com/sun/xml/internal/rngom/binary/GroupPattern.java	Thu Jul 30 18:15:01 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/GroupPattern.java	Thu Jul 30 18:15:00 2009
+@@ -29,9 +29,9 @@
+ public class GroupPattern extends BinaryPattern {
+   GroupPattern(Pattern p1, Pattern p2) {
+     super(p1.isNullable() && p2.isNullable(),
+-	  combineHashCode(GROUP_HASH_CODE, p1.hashCode(), p2.hashCode()),
+-	  p1,
+-	  p2);
++          combineHashCode(GROUP_HASH_CODE, p1.hashCode(), p2.hashCode()),
++          p1,
++          p2);
+   }
+ 
+   Pattern expand(SchemaPatternBuilder b) {
+@@ -51,12 +51,12 @@
+       throw new RestrictionViolationException("data_except_contains_group");
+     }
+     super.checkRestrictions(context == ELEMENT_REPEAT_CONTEXT
+-			    ? ELEMENT_REPEAT_GROUP_CONTEXT
+-			    : context,
+-			    dad,
+-			    alpha);
++                            ? ELEMENT_REPEAT_GROUP_CONTEXT
++                            : context,
++                            dad,
++                            alpha);
+     if (context != LIST_CONTEXT
+-	&& !contentTypeGroupable(p1.getContentType(), p2.getContentType()))
++        && !contentTypeGroupable(p1.getContentType(), p2.getContentType()))
+       throw new RestrictionViolationException("group_string");
+   }
+ 
+--- old/src/share/classes/com/sun/xml/internal/rngom/binary/InterleavePattern.java	Thu Jul 30 18:15:04 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/InterleavePattern.java	Thu Jul 30 18:15:04 2009
+@@ -30,9 +30,9 @@
+ public class InterleavePattern extends BinaryPattern {
+   InterleavePattern(Pattern p1, Pattern p2) {
+     super(p1.isNullable() && p2.isNullable(),
+-	  combineHashCode(INTERLEAVE_HASH_CODE, p1.hashCode(), p2.hashCode()),
+-	  p1,
+-	  p2);
++          combineHashCode(INTERLEAVE_HASH_CODE, p1.hashCode(), p2.hashCode()),
++          p1,
++          p2);
+   }
+   Pattern expand(SchemaPatternBuilder b) {
+     Pattern ep1 = p1.expand(b);
+@@ -67,16 +67,16 @@
+       p2.checkRestrictions(context, dad, a2);
+       a1.checkOverlap(a2);
+       if (alpha != null) {
+-	if (alpha != a1)
+-	  alpha.addAlphabet(a1);
+-	alpha.addAlphabet(a2);
++        if (alpha != a1)
++          alpha.addAlphabet(a1);
++        alpha.addAlphabet(a2);
+       }
+     }
+     if (context != LIST_CONTEXT
+-	&& !contentTypeGroupable(p1.getContentType(), p2.getContentType()))
++        && !contentTypeGroupable(p1.getContentType(), p2.getContentType()))
+       throw new RestrictionViolationException("interleave_string");
+     if (p1.getContentType() == MIXED_CONTENT_TYPE
+-	&& p2.getContentType() == MIXED_CONTENT_TYPE)
++        && p2.getContentType() == MIXED_CONTENT_TYPE)
+       throw new RestrictionViolationException("interleave_text_overlap");
+   }
+ 
+--- old/src/share/classes/com/sun/xml/internal/rngom/binary/ListPattern.java	Thu Jul 30 18:15:08 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/ListPattern.java	Thu Jul 30 18:15:07 2009
+@@ -35,8 +35,8 @@
+ 
+   ListPattern(Pattern p, Locator locator) {
+     super(false,
+-	  DATA_CONTENT_TYPE,
+-	  combineHashCode(LIST_HASH_CODE, p.hashCode()));
++          DATA_CONTENT_TYPE,
++          combineHashCode(LIST_HASH_CODE, p.hashCode()));
+     this.p = p;
+     this.locator = locator;
+   }
+@@ -55,7 +55,7 @@
+ 
+   boolean samePattern(Pattern other) {
+     return (other instanceof ListPattern
+-	    && p == ((ListPattern)other).p);
++            && p == ((ListPattern)other).p);
+   }
+ 
+   public void accept(PatternVisitor visitor) {
+@@ -84,7 +84,7 @@
+       throw e;
+     }
+   }
+-  
++
+   Pattern getOperand() {
+     return p;
+   }
+--- old/src/share/classes/com/sun/xml/internal/rngom/binary/Messages.properties	Thu Jul 30 18:15:11 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/Messages.properties	Thu Jul 30 18:15:11 2009
+@@ -125,4 +125,3 @@
+ # Fragments
+ name_absent_namespace=\"{0}\"
+ name_with_namespace=\"{1}\" from namespace \"{0}\"
+- 
+--- old/src/share/classes/com/sun/xml/internal/rngom/binary/OneOrMorePattern.java	Thu Jul 30 18:15:15 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/OneOrMorePattern.java	Thu Jul 30 18:15:14 2009
+@@ -33,8 +33,8 @@
+ 
+   OneOrMorePattern(Pattern p) {
+     super(p.isNullable(),
+-	  p.getContentType(),
+-	  combineHashCode(ONE_OR_MORE_HASH_CODE, p.hashCode()));
++          p.getContentType(),
++          combineHashCode(ONE_OR_MORE_HASH_CODE, p.hashCode()));
+     this.p = p;
+   }
+ 
+@@ -58,20 +58,20 @@
+     case DATA_EXCEPT_CONTEXT:
+       throw new RestrictionViolationException("data_except_contains_one_or_more");
+     }
+-    
++
+     p.checkRestrictions(context == ELEMENT_CONTEXT
+-			? ELEMENT_REPEAT_CONTEXT
+-			: context,
+-			dad,
+-			alpha);
++                        ? ELEMENT_REPEAT_CONTEXT
++                        : context,
++                        dad,
++                        alpha);
+     if (context != LIST_CONTEXT
+-	&& !contentTypeGroupable(p.getContentType(), p.getContentType()))
++        && !contentTypeGroupable(p.getContentType(), p.getContentType()))
+       throw new RestrictionViolationException("one_or_more_string");
+   }
+ 
+   boolean samePattern(Pattern other) {
+     return (other instanceof OneOrMorePattern
+-	    && p == ((OneOrMorePattern)other).p);
++            && p == ((OneOrMorePattern)other).p);
+   }
+ 
+   public void accept(PatternVisitor visitor) {
+--- old/src/share/classes/com/sun/xml/internal/rngom/binary/PatternBuilder.java	Thu Jul 30 18:15:18 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/PatternBuilder.java	Thu Jul 30 18:15:18 2009
+@@ -79,7 +79,7 @@
+     if (p2 instanceof InterleavePattern) {
+       InterleavePattern ip = (InterleavePattern)p2;
+       if (p1.hashCode() > ip.p1.hashCode())
+-	return makeInterleave(ip.p1, makeInterleave(p1, ip.p2));
++        return makeInterleave(ip.p1, makeInterleave(p1, ip.p2));
+     }
+     else if (p1.hashCode() > p2.hashCode())
+       return makeInterleave(p2, p1);
+@@ -99,8 +99,8 @@
+ 
+   Pattern makeOneOrMore(Pattern p) {
+     if (p == empty
+-	|| p == notAllowed
+-	|| p instanceof OneOrMorePattern)
++        || p == notAllowed
++        || p instanceof OneOrMorePattern)
+       return p;
+     Pattern p1 = new OneOrMorePattern(p);
+     return interner.intern(p1);
+--- old/src/share/classes/com/sun/xml/internal/rngom/binary/RefPattern.java	Thu Jul 30 18:15:22 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/RefPattern.java	Thu Jul 30 18:15:21 2009
+@@ -55,7 +55,7 @@
+   Pattern getPattern() {
+     return p;
+   }
+-  
++
+   void setPattern(Pattern p) {
+     this.p = p;
+   }
+@@ -63,11 +63,11 @@
+   Locator getRefLocator() {
+     return refLoc;
+   }
+-  
++
+   void setRefLocator(Locator loc) {
+     this.refLoc = loc;
+   }
+-  
++
+   void checkRecursion(int depth) throws SAXException {
+     if (checkRecursionDepth == -1) {
+       checkRecursionDepth = depth;
+@@ -77,7 +77,7 @@
+     else if (depth == checkRecursionDepth)
+       // XXX try to recover from this?
+       throw new SAXParseException(SchemaBuilderImpl.localizer.message("recursive_reference", name),
+-				  refLoc);
++                                  refLoc);
+   }
+ 
+   Pattern expand(SchemaPatternBuilder b) {
+@@ -103,7 +103,7 @@
+   byte getReplacementStatus() {
+     return replacementStatus;
+   }
+-  
++
+   void setReplacementStatus(byte replacementStatus) {
+     this.replacementStatus = replacementStatus;
+   }
+@@ -128,4 +128,3 @@
+     return name;
+   }
+ }
+-
+--- old/src/share/classes/com/sun/xml/internal/rngom/binary/SchemaBuilderImpl.java	Thu Jul 30 18:15:25 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/SchemaBuilderImpl.java	Thu Jul 30 18:15:25 2009
+@@ -110,9 +110,9 @@
+         }
+         throw new IllegalSchemaException();
+     }
+-  
++
+   /**
+-   * 
++   *
+    * @param eh
+    *        Error handler to receive errors while building the schema.
+    */
+@@ -124,7 +124,7 @@
+   }
+ 
+   /**
+-   * 
++   *
+    * @param eh
+    *        Error handler to receive errors while building the schema.
+    * @param datatypeLibraryFactory
+@@ -153,7 +153,7 @@
+     this.inheritNs = inheritNs;
+     this.openIncludes = new OpenIncludes(uri, parent.openIncludes);
+   }
+-  
++
+   public NameClassBuilder getNameClassBuilder() {
+       return ncb;
+   }
+@@ -300,7 +300,7 @@
+         dtb.addParameter(name, value, new ValidationContextImpl(context, ns));
+       }
+       catch (DatatypeException e) {
+-	String detail = e.getMessage();
++        String detail = e.getMessage();
+         int pos = e.getIndex();
+         String displayedParam;
+         if (pos == DatatypeException.UNKNOWN)
+@@ -313,10 +313,10 @@
+           else
+             error("invalid_param_display", displayedParam, (Locator)loc);
+         }
+-	else if (detail != null)
+-	  error("invalid_param_detail", detail, (Locator)loc);
+-	else
+-	  error("invalid_param", (Locator)loc);
++        else if (detail != null)
++          error("invalid_param_detail", detail, (Locator)loc);
++        else
++          error("invalid_param", (Locator)loc);
+       }
+     }
+ 
+@@ -334,11 +334,11 @@
+         return pb.makeData(dtb.createDatatype());
+       }
+       catch (DatatypeException e) {
+-	String detail = e.getMessage();
+-	if (detail != null)
+-	  error("invalid_params_detail", detail, (Locator)loc);
+-	else
+-	  error("invalid_params", (Locator)loc);
++        String detail = e.getMessage();
++        if (detail != null)
++          error("invalid_params_detail", detail, (Locator)loc);
++        else
++          error("invalid_params", (Locator)loc);
+         return pb.makeError();
+       }
+     }
+@@ -349,11 +349,11 @@
+         return pb.makeDataExcept(dtb.createDatatype(), (Pattern)except, (Locator)loc);
+       }
+       catch (DatatypeException e) {
+-	String detail = e.getMessage();
+-	if (detail != null)
+-	  error("invalid_params_detail", detail, (Locator)loc);
+-	else
+-	  error("invalid_params", (Locator)loc);
++        String detail = e.getMessage();
++        if (detail != null)
++          error("invalid_params_detail", detail, (Locator)loc);
++        else
++          error("invalid_params", (Locator)loc);
+         return pb.makeError();
+       }
+     }
+@@ -372,11 +372,11 @@
+         return new DataPatternBuilderImpl(dl.createDatatypeBuilder(type));
+       }
+       catch (DatatypeException e) {
+-	String detail = e.getMessage();
+-	if (detail != null)
+-	  error("unsupported_datatype_detail", datatypeLibrary, type, detail, (Locator)loc);
+-	else
+-	  error("unrecognized_datatype", datatypeLibrary, type, (Locator)loc);
++        String detail = e.getMessage();
++        if (detail != null)
++          error("unsupported_datatype_detail", datatypeLibrary, type, detail, (Locator)loc);
++        else
++          error("unrecognized_datatype", datatypeLibrary, type, (Locator)loc);
+       }
+     }
+     return new DummyDataPatternBuilder();
+@@ -431,7 +431,7 @@
+       startRef = g.startRef;
+       defines = g.defines;
+     }
+-    
++
+     public ParsedPattern endGrammar(Location loc, Annotations anno) throws BuildException {
+       for (Enumeration e = defines.keys();
+            e.hasMoreElements();) {
+@@ -719,7 +719,7 @@
+ 
+   public void addText(String value, Location loc, CommentList comments) throws BuildException {
+   }
+-  
++
+   public boolean usesComments() {
+     return false;
+   }
+--- old/src/share/classes/com/sun/xml/internal/rngom/binary/ValuePattern.java	Thu Jul 30 18:15:29 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/ValuePattern.java	Thu Jul 30 18:15:28 2009
+@@ -44,7 +44,7 @@
+     if (!(other instanceof ValuePattern))
+       return false;
+     return (dt.equals(((ValuePattern)other).dt)
+-	    && dt.sameValue(obj, ((ValuePattern)other).obj));
++            && dt.sameValue(obj, ((ValuePattern)other).obj));
+   }
+ 
+   public void accept(PatternVisitor visitor) {
+--- old/src/share/classes/com/sun/xml/internal/rngom/binary/visitor/PatternWalker.java	Thu Jul 30 18:15:32 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/rngom/binary/visitor/PatternWalker.java	Thu Jul 30 18:15:32 2009
+@@ -30,7 +30,7 @@
+ 
+ /**
+  * Walks the pattern tree.
+- * 
++ *
+  * @author
+  *      Kohsuke Kawaguchi (kk@kohsuke.org)
+  */
+--- old/src/share/classes/com/sun/xml/internal/rngom/digested/DOMPrinter.java	Thu Jul 30 18:15:36 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/rngom/digested/DOMPrinter.java	Thu Jul 30 18:15:35 2009
+@@ -42,7 +42,7 @@
+ 
+ /**
+  * Printer of DOM to XML using StAX {@link XMLStreamWriter}.
+- * 
++ *
+  * @author <A href="mailto:demakov@ispras.ru">Alexey Demakov</A>
+  */
+ class DOMPrinter {
+--- old/src/share/classes/com/sun/xml/internal/rngom/dt/CachedDatatypeLibraryFactory.java	Thu Jul 30 18:15:39 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/rngom/dt/CachedDatatypeLibraryFactory.java	Thu Jul 30 18:15:39 2009
+@@ -28,25 +28,25 @@
+ import org.relaxng.datatype.DatatypeLibraryFactory;
+ 
+ /**
+- * 
++ *
+  * @author
+  *      Kohsuke Kawaguchi (kk@kohsuke.org)
+  */
+ public class CachedDatatypeLibraryFactory implements DatatypeLibraryFactory {
+-    
++
+     private String lastUri;
+     private DatatypeLibrary lastLib;
+-    
++
+     private final DatatypeLibraryFactory core;
+-    
++
+     public CachedDatatypeLibraryFactory( DatatypeLibraryFactory core ) {
+         this.core = core;
+     }
+-    
++
+     public DatatypeLibrary createDatatypeLibrary(String namespaceURI) {
+         if( lastUri==namespaceURI )
+             return lastLib;
+-        
++
+         lastUri = namespaceURI;
+         lastLib = core.createDatatypeLibrary(namespaceURI);
+         return lastLib;
+--- old/src/share/classes/com/sun/xml/internal/rngom/dt/CascadingDatatypeLibraryFactory.java	Thu Jul 30 18:15:43 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/rngom/dt/CascadingDatatypeLibraryFactory.java	Thu Jul 30 18:15:42 2009
+@@ -28,8 +28,8 @@
+ import org.relaxng.datatype.DatatypeLibraryFactory;
+ 
+ /**
+- * 
+- * 
++ *
++ *
+  * @author
+  *      Kohsuke Kawaguchi (kk@kohsuke.org)
+  */
+@@ -41,7 +41,7 @@
+         this.factory1 = factory1;
+         this.factory2 = factory2;
+     }
+-    
++
+     public DatatypeLibrary createDatatypeLibrary(String namespaceURI) {
+         DatatypeLibrary lib = factory1.createDatatypeLibrary(namespaceURI);
+         if(lib==null)
+--- old/src/share/classes/com/sun/xml/internal/rngom/dt/builtin/BuiltinDatatypeBuilder.java	Thu Jul 30 18:15:46 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/rngom/dt/builtin/BuiltinDatatypeBuilder.java	Thu Jul 30 18:15:46 2009
+@@ -33,16 +33,16 @@
+ 
+ class BuiltinDatatypeBuilder implements DatatypeBuilder {
+   private final Datatype dt;
+-  
++
+   private static final Localizer localizer = new Localizer(BuiltinDatatypeBuilder.class);
+-  
++
+   BuiltinDatatypeBuilder(Datatype dt) {
+     this.dt = dt;
+   }
+ 
+   public void addParameter(String name,
+-			   String value,
+-			   ValidationContext context) throws DatatypeException {
++                           String value,
++                           ValidationContext context) throws DatatypeException {
+     throw new DatatypeException(localizer.message("builtin_param"));
+   }
+ 
+--- old/src/share/classes/com/sun/xml/internal/rngom/dt/builtin/BuiltinDatatypeLibraryFactory.java	Thu Jul 30 18:15:50 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/rngom/dt/builtin/BuiltinDatatypeLibraryFactory.java	Thu Jul 30 18:15:49 2009
+@@ -46,7 +46,7 @@
+         compatibilityDatatypeLibrary = new CompatibilityDatatypeLibrary(coreFactory);
+         this.core = coreFactory;
+     }
+-    
++
+     public DatatypeLibrary createDatatypeLibrary(String uri) {
+         if (uri.equals(""))
+             return builtinDatatypeLibrary;
+--- old/src/share/classes/com/sun/xml/internal/rngom/dt/builtin/CompatibilityDatatypeLibrary.java	Thu Jul 30 18:15:53 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/rngom/dt/builtin/CompatibilityDatatypeLibrary.java	Thu Jul 30 18:15:53 2009
+@@ -38,7 +38,7 @@
+     CompatibilityDatatypeLibrary(DatatypeLibraryFactory factory) {
+         this.factory = factory;
+     }
+-    
++
+     public DatatypeBuilder createDatatypeBuilder(String type)
+         throws DatatypeException {
+         if (type.equals("ID")
+--- old/src/share/classes/com/sun/xml/internal/rngom/dt/builtin/Messages.properties	Thu Jul 30 18:15:57 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/rngom/dt/builtin/Messages.properties	Thu Jul 30 18:15:56 2009
+@@ -25,4 +25,3 @@
+ 
+ # Properties file specifying messages
+ builtin_param=builtin datatypes do not have any parameters
+- 
+--- old/src/share/classes/com/sun/xml/internal/rngom/nc/AnyNameClass.java	Thu Jul 30 18:16:01 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/rngom/nc/AnyNameClass.java	Thu Jul 30 18:16:00 2009
+@@ -27,9 +27,9 @@
+ import javax.xml.namespace.QName;
+ 
+ final class AnyNameClass extends NameClass {
+-    
++
+     protected AnyNameClass() {} // no instanciation
+-    
++
+     public boolean contains(QName name) {
+         return true;
+     }
+@@ -53,7 +53,7 @@
+     public boolean isOpen() {
+         return true;
+     }
+-    
++
+     private static Object readReplace() {
+         return NameClass.ANY;
+     }
+--- old/src/share/classes/com/sun/xml/internal/rngom/nc/NameClass.java	Thu Jul 30 18:16:04 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/rngom/nc/NameClass.java	Thu Jul 30 18:16:03 2009
+@@ -39,24 +39,24 @@
+     static final int SPECIFICITY_ANY_NAME = 0;
+     static final int SPECIFICITY_NS_NAME = 1;
+     static final int SPECIFICITY_NAME = 2;
+-    
++
+     /**
+      * Returns true if the given {@link QName} is a valid name
+      * for this QName.
+      */
+     public abstract boolean contains(QName name);
+-    
++
+     public abstract int containsSpecificity(QName name);
+-    
++
+     /**
+      * Visitor pattern support.
+      */
+     public abstract <V> V accept(NameClassVisitor<V> visitor);
+-    
++
+     /**
+      * Returns true if the name class accepts infinite number of
+      * {@link QName}s.
+-     * 
++     *
+      * <p>
+      * Intuitively, this method returns true if the name class is
+      * some sort of wildcard.
+@@ -87,10 +87,10 @@
+         return OverlapDetector.overlap(this,nc2);
+     }
+ 
+-    
++
+     /** Sigleton instance that represents "anyName". */
+     public static final NameClass ANY = new AnyNameClass();
+-    
++
+     /**
+      * Sigleton instance that accepts no name.
+      *
+--- old/src/share/classes/com/sun/xml/internal/rngom/nc/NameClassBuilderImpl.java	Thu Jul 30 18:16:07 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/rngom/nc/NameClassBuilderImpl.java	Thu Jul 30 18:16:07 2009
+@@ -35,7 +35,7 @@
+ 
+ 
+ /**
+- * 
++ *
+  * @author
+  *      Kohsuke Kawaguchi (kk@kohsuke.org)
+  */
+@@ -44,7 +44,7 @@
+     L extends Location,
+     A extends Annotations<E,L,CL>,
+     CL extends CommentList<L>> implements NameClassBuilder<NameClass,E,L,A,CL> {
+-    
++
+     public NameClass makeChoice(List<NameClass> nameClasses, L loc, A anno) {
+       NameClass result = nameClasses.get(0);
+       for (int i = 1; i < nameClasses.size(); i++)
+@@ -75,15 +75,15 @@
+     public NameClass makeErrorNameClass() {
+         return NameClass.NULL;
+     }
+-    
++
+     public NameClass annotate(NameClass nc, A anno) throws BuildException {
+       return nc;
+     }
+-    
++
+     public NameClass annotateAfter(NameClass nc, E e) throws BuildException {
+       return nc;
+     }
+-    
++
+     public NameClass commentAfter(NameClass nc, CL comments) throws BuildException {
+       return nc;
+     }
+--- old/src/share/classes/com/sun/xml/internal/rngom/nc/NsNameExceptNameClass.java	Thu Jul 30 18:16:11 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/rngom/nc/NsNameExceptNameClass.java	Thu Jul 30 18:16:10 2009
+@@ -38,7 +38,7 @@
+ 
+   public boolean contains(QName name) {
+     return (this.namespaceURI.equals(name.getNamespaceURI())
+-	    && !nameClass.contains(name));
++            && !nameClass.contains(name));
+   }
+ 
+   public int containsSpecificity(QName name) {
+@@ -50,7 +50,7 @@
+       return false;
+     NsNameExceptNameClass other = (NsNameExceptNameClass)obj;
+     return (namespaceURI.equals(other.namespaceURI)
+-	    && nameClass.equals(other.nameClass));
++            && nameClass.equals(other.nameClass));
+   }
+ 
+   public int hashCode() {
+@@ -65,4 +65,3 @@
+     return true;
+   }
+ }
+-
+--- old/src/share/classes/com/sun/xml/internal/rngom/nc/SimpleNameClass.java	Thu Jul 30 18:16:14 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/rngom/nc/SimpleNameClass.java	Thu Jul 30 18:16:14 2009
+@@ -33,7 +33,7 @@
+     public SimpleNameClass(QName name) {
+         this.name = name;
+     }
+-    
++
+     public SimpleNameClass( String nsUri, String localPart ) {
+         this( new QName(nsUri,localPart) );
+     }
+--- old/src/share/classes/com/sun/xml/internal/rngom/parse/Context.java	Thu Jul 30 18:16:18 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/Context.java	Thu Jul 30 18:16:17 2009
+@@ -29,7 +29,7 @@
+ 
+ /**
+  * Provides contextual information.
+- * 
++ *
+  * This is typically useful for parsing QNames.
+  */
+ public interface Context extends ValidationContext {
+@@ -37,7 +37,7 @@
+      * Enumerates the prefixes bound to namespaces.
+      */
+     Enumeration prefixes();
+-    
++
+     /**
+      * Returns the immutable snapshot of this {@link Context}.
+      */
+--- old/src/share/classes/com/sun/xml/internal/rngom/parse/Messages.properties	Thu Jul 30 18:16:21 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/Messages.properties	Thu Jul 30 18:16:21 2009
+@@ -26,4 +26,3 @@
+ # common messages between XML and compact syntax parser
+ parent_ref_outside_grammar=parentRef is used outside a grammar
+ ref_outside_grammar=ref is used outside a grammar
+- 
+--- old/src/share/classes/com/sun/xml/internal/rngom/parse/Parseable.java	Thu Jul 30 18:16:25 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/Parseable.java	Thu Jul 30 18:16:24 2009
+@@ -29,7 +29,7 @@
+ 
+ /**
+  * An input that can be turned into a RELAX NG pattern.
+- * 
++ *
+  * <p>
+  * This is either a RELAX NG schema in the XML format, or a RELAX NG
+  * schema in the compact syntax.
+@@ -37,11 +37,11 @@
+ public interface Parseable {
+     /**
+      * Parses this {@link Parseable} object into a RELAX NG pattern.
+-     * 
++     *
+      * @param sb
+      *      The builder of the schema object model. This object
+      *      dictates how the actual pattern is constructed.
+-     * 
++     *
+      * @return
+      *      a parsed object. Always returns a non-null valid object.
+      */
+--- old/src/share/classes/com/sun/xml/internal/rngom/parse/compact/CompactSyntax.java	Thu Jul 30 18:16:28 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/compact/CompactSyntax.java	Thu Jul 30 18:16:28 2009
+@@ -89,7 +89,7 @@
+ 
+   /**
+    * String that represents the inherited namespace.
+-   * 
++   *
+    * <p>
+    * HACK: we always allocate a new String instance so that
+    * we can distinguish inherited value from the explicitly
+--- old/src/share/classes/com/sun/xml/internal/rngom/parse/compact/CompactSyntaxTokenManager.java	Thu Jul 30 18:16:33 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/compact/CompactSyntaxTokenManager.java	Thu Jul 30 18:16:32 2009
+@@ -300,7 +300,7 @@
+ private final int jjMoveStringLiteralDfa2_0(long old0, long active0)
+ {
+    if (((active0 &= old0)) == 0L)
+-      return jjStartNfa_0(0, old0); 
++      return jjStartNfa_0(0, old0);
+    try { curChar = input_stream.readChar(); }
+    catch(java.io.IOException e) {
+       jjStopStringLiteralDfa_0(1, active0);
+@@ -344,7 +344,7 @@
+ private final int jjMoveStringLiteralDfa3_0(long old0, long active0)
+ {
+    if (((active0 &= old0)) == 0L)
+-      return jjStartNfa_0(1, old0); 
++      return jjStartNfa_0(1, old0);
+    try { curChar = input_stream.readChar(); }
+    catch(java.io.IOException e) {
+       jjStopStringLiteralDfa_0(2, active0);
+@@ -380,7 +380,7 @@
+ private final int jjMoveStringLiteralDfa4_0(long old0, long active0)
+ {
+    if (((active0 &= old0)) == 0L)
+-      return jjStartNfa_0(2, old0); 
++      return jjStartNfa_0(2, old0);
+    try { curChar = input_stream.readChar(); }
+    catch(java.io.IOException e) {
+       jjStopStringLiteralDfa_0(3, active0);
+@@ -426,7 +426,7 @@
+ private final int jjMoveStringLiteralDfa5_0(long old0, long active0)
+ {
+    if (((active0 &= old0)) == 0L)
+-      return jjStartNfa_0(3, old0); 
++      return jjStartNfa_0(3, old0);
+    try { curChar = input_stream.readChar(); }
+    catch(java.io.IOException e) {
+       jjStopStringLiteralDfa_0(4, active0);
+@@ -466,7 +466,7 @@
+ private final int jjMoveStringLiteralDfa6_0(long old0, long active0)
+ {
+    if (((active0 &= old0)) == 0L)
+-      return jjStartNfa_0(4, old0); 
++      return jjStartNfa_0(4, old0);
+    try { curChar = input_stream.readChar(); }
+    catch(java.io.IOException e) {
+       jjStopStringLiteralDfa_0(5, active0);
+@@ -506,7 +506,7 @@
+ private final int jjMoveStringLiteralDfa7_0(long old0, long active0)
+ {
+    if (((active0 &= old0)) == 0L)
+-      return jjStartNfa_0(5, old0); 
++      return jjStartNfa_0(5, old0);
+    try { curChar = input_stream.readChar(); }
+    catch(java.io.IOException e) {
+       jjStopStringLiteralDfa_0(6, active0);
+@@ -534,7 +534,7 @@
+ private final int jjMoveStringLiteralDfa8_0(long old0, long active0)
+ {
+    if (((active0 &= old0)) == 0L)
+-      return jjStartNfa_0(6, old0); 
++      return jjStartNfa_0(6, old0);
+    try { curChar = input_stream.readChar(); }
+    catch(java.io.IOException e) {
+       jjStopStringLiteralDfa_0(7, active0);
+@@ -560,7 +560,7 @@
+ private final int jjMoveStringLiteralDfa9_0(long old0, long active0)
+ {
+    if (((active0 &= old0)) == 0L)
+-      return jjStartNfa_0(7, old0); 
++      return jjStartNfa_0(7, old0);
+    try { curChar = input_stream.readChar(); }
+    catch(java.io.IOException e) {
+       jjStopStringLiteralDfa_0(8, active0);
+@@ -1501,8 +1501,8 @@
+    }
+ }
+ static final int[] jjnextStates = {
+-   16, 17, 18, 19, 21, 25, 26, 27, 28, 30, 35, 36, 38, 39, 40, 10, 
+-   11, 13, 14, 3, 6, 7, 8, 
++   16, 17, 18, 19, 21, 25, 26, 27, 28, 30, 35, 36, 38, 39, 40, 10,
++   11, 13, 14, 3, 6, 7, 8,
+ };
+ private static final boolean jjCanMove_0(int hiByte, int i1, int i2, long l1, long l2)
+ {
+@@ -1510,7 +1510,7 @@
+    {
+       case 0:
+          return ((jjbitVec2[i2] & l2) != 0L);
+-      default : 
++      default :
+          if ((jjbitVec0[i1] & l1) != 0L)
+             return true;
+          return false;
+@@ -1566,7 +1566,7 @@
+          return ((jjbitVec25[i2] & l2) != 0L);
+       case 215:
+          return ((jjbitVec26[i2] & l2) != 0L);
+-      default : 
++      default :
+          if ((jjbitVec3[i1] & l1) != 0L)
+             return true;
+          return false;
+@@ -1624,7 +1624,7 @@
+          return ((jjbitVec25[i2] & l2) != 0L);
+       case 215:
+          return ((jjbitVec26[i2] & l2) != 0L);
+-      default : 
++      default :
+          if ((jjbitVec3[i1] & l1) != 0L)
+             return true;
+          return false;
+@@ -1631,34 +1631,34 @@
+    }
+ }
+ public static final String[] jjstrLiteralImages = {
+-"", "\133", "\75", "\46\75", "\174\75", "\163\164\141\162\164", 
+-"\144\151\166", "\151\156\143\154\165\144\145", "\176", "\135", 
+-"\147\162\141\155\155\141\162", "\173", "\175", "\156\141\155\145\163\160\141\143\145", 
+-"\144\145\146\141\165\154\164", "\151\156\150\145\162\151\164", "\144\141\164\141\164\171\160\145\163", 
+-"\145\155\160\164\171", "\164\145\170\164", "\156\157\164\101\154\154\157\167\145\144", "\174", "\46", 
+-"\54", "\53", "\77", "\52", "\145\154\145\155\145\156\164", 
+-"\141\164\164\162\151\142\165\164\145", "\50", "\51", "\55", "\154\151\163\164", "\155\151\170\145\144", 
+-"\145\170\164\145\162\156\141\154", "\160\141\162\145\156\164", "\163\164\162\151\156\147", 
+-"\164\157\153\145\156", null, null, null, null, null, null, null, null, null, null, null, null, null, 
++"", "\133", "\75", "\46\75", "\174\75", "\163\164\141\162\164",
++"\144\151\166", "\151\156\143\154\165\144\145", "\176", "\135",
++"\147\162\141\155\155\141\162", "\173", "\175", "\156\141\155\145\163\160\141\143\145",
++"\144\145\146\141\165\154\164", "\151\156\150\145\162\151\164", "\144\141\164\141\164\171\160\145\163",
++"\145\155\160\164\171", "\164\145\170\164", "\156\157\164\101\154\154\157\167\145\144", "\174", "\46",
++"\54", "\53", "\77", "\52", "\145\154\145\155\145\156\164",
++"\141\164\164\162\151\142\165\164\145", "\50", "\51", "\55", "\154\151\163\164", "\155\151\170\145\144",
++"\145\170\164\145\162\156\141\154", "\160\141\162\145\156\164", "\163\164\162\151\156\147",
++"\164\157\153\145\156", null, null, null, null, null, null, null, null, null, null, null, null, null,
+ null, null, null, null, null, null, null, null, null, "\76\76", null, };
+ public static final String[] lexStateNames = {
+-   "DEFAULT", 
+-   "AFTER_SINGLE_LINE_COMMENT", 
+-   "AFTER_DOCUMENTATION", 
++   "DEFAULT",
++   "AFTER_SINGLE_LINE_COMMENT",
++   "AFTER_DOCUMENTATION",
+ };
+ public static final int[] jjnewLexState = {
+-   -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 
+-   -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 2, -1, 1, 2, -1, -1, -1, -1, -1, -1, 
+-   -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 
++   -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
++   -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 2, -1, 1, 2, -1, -1, -1, -1, -1, -1,
++   -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ };
+ static final long[] jjtoToken = {
+-   0x1fc00b1fffffffffL, 
++   0x1fc00b1fffffffffL,
+ };
+ static final long[] jjtoSkip = {
+-   0x148000000000L, 
++   0x148000000000L,
+ };
+ static final long[] jjtoSpecial = {
+-   0x140000000000L, 
++   0x140000000000L,
+ };
+ protected JavaCharStream input_stream;
+ private final int[] jjrounds = new int[43];
+@@ -1725,7 +1725,7 @@
+ int jjmatchedPos;
+ int jjmatchedKind;
+ 
+-public Token getNextToken() 
++public Token getNextToken()
+ {
+   int kind;
+   Token specialToken = null;
+@@ -1734,13 +1734,13 @@
+ 
+   EOFLoop :
+   for (;;)
+-  {   
+-   try   
+-   {     
++  {
++   try
++   {
+       curChar = input_stream.BeginToken();
+-   }     
++   }
+    catch(java.io.IOException e)
+-   {        
++   {
+       jjmatchedKind = 0;
+       matchedToken = jjFillToken();
+       matchedToken.specialToken = specialToken;
+@@ -1793,7 +1793,7 @@
+               }
+               SkipLexicalActions(matchedToken);
+            }
+-           else 
++           else
+               SkipLexicalActions(null);
+          if (jjnewLexState[jjmatchedKind] != -1)
+            curLexState = jjnewLexState[jjmatchedKind];
+--- old/src/share/classes/com/sun/xml/internal/rngom/parse/compact/JavaCharStream.java	Thu Jul 30 18:16:36 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/compact/JavaCharStream.java	Thu Jul 30 18:16:36 2009
+@@ -190,7 +190,7 @@
+   }
+ 
+   public char BeginToken() throws java.io.IOException
+-  {     
++  {
+      if (inBuf > 0)
+      {
+         --inBuf;
+@@ -206,7 +206,7 @@
+      bufpos = -1;
+ 
+      return readChar();
+-  }     
++  }
+ 
+   protected void AdjustBuffSize()
+   {
+@@ -361,7 +361,7 @@
+   }
+ 
+   /**
+-   * @deprecated 
++   * @deprecated
+    * @see #getEndColumn
+    */
+ 
+@@ -370,7 +370,7 @@
+   }
+ 
+   /**
+-   * @deprecated 
++   * @deprecated
+    * @see #getEndLine
+    */
+ 
+@@ -548,7 +548,7 @@
+         bufcolumn[j] = newCol + columnDiff;
+         columnDiff = nextColDiff;
+         i++;
+-     } 
++     }
+ 
+      if (i < len)
+      {
+--- old/src/share/classes/com/sun/xml/internal/rngom/parse/compact/Messages.properties	Thu Jul 30 18:16:40 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/compact/Messages.properties	Thu Jul 30 18:16:39 2009
+@@ -45,4 +45,3 @@
+ illegal_surrogate_pair=illegal surrogate pair
+ relax_ng_namespace=annotations cannot have namespace URI \"http://relaxng.org/ns/structure/1.0\"
+ top_level_follow_annotation=top-level pattern cannot have following annotations
+- 
+--- old/src/share/classes/com/sun/xml/internal/rngom/parse/compact/ParseException.java	Thu Jul 30 18:16:44 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/compact/ParseException.java	Thu Jul 30 18:16:43 2009
+@@ -145,7 +145,7 @@
+         break;
+       }
+       retval += add_escapes(tok.image);
+-      tok = tok.next; 
++      tok = tok.next;
+     }
+     retval += "\" at line " + currentToken.next.beginLine + ", column " + currentToken.next.beginColumn;
+     retval += "." + eol;
+@@ -162,7 +162,7 @@
+    * The end of line string for this machine.
+    */
+   protected String eol = System.getProperty("line.separator", "\n");
+- 
++
+   /**
+    * Used to convert raw characters to their escaped version
+    * when these raw version cannot be used as part of an ASCII
+--- old/src/share/classes/com/sun/xml/internal/rngom/parse/compact/TokenMgrError.java	Thu Jul 30 18:16:47 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/compact/TokenMgrError.java	Thu Jul 30 18:16:47 2009
+@@ -109,7 +109,7 @@
+    /**
+     * Returns a detailed message for the Error when it is thrown by the
+     * token manager to indicate a lexical error.
+-    * Parameters : 
++    * Parameters :
+     *    EOFSeen     : indicates if EOF caused the lexicl error
+     *    curLexState : lexical state in which this error occured
+     *    errorLine   : line number when the error occured
+@@ -129,7 +129,7 @@
+    /**
+     * You can also modify the body of this method to customize your error messages.
+     * For example, cases like LOOP_DETECTED and INVALID_LEXICAL_STATE are not
+-    * of end-users concern, so you can return something like : 
++    * of end-users concern, so you can return something like :
+     *
+     *     "Internal Error : Please file a bug report .... "
+     *
+--- old/src/share/classes/com/sun/xml/internal/rngom/parse/host/AnnotationsHost.java	Thu Jul 30 18:16:51 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/AnnotationsHost.java	Thu Jul 30 18:16:50 2009
+@@ -31,7 +31,7 @@
+ import com.sun.xml.internal.rngom.ast.om.ParsedElementAnnotation;
+ 
+ /**
+- * 
++ *
+  * @author
+  *      Kohsuke Kawaguchi (kk@kohsuke.org)
+  */
+@@ -38,12 +38,12 @@
+ class AnnotationsHost extends Base implements Annotations {
+     final Annotations lhs;
+     final Annotations rhs;
+-    
++
+     AnnotationsHost( Annotations lhs, Annotations rhs ) {
+         this.lhs = lhs;
+         this.rhs = rhs;
+     }
+-    
++
+     public void addAttribute(String ns, String localName, String prefix,
+         String value, Location _loc) throws BuildException {
+         LocationHost loc = cast(_loc);
+@@ -50,19 +50,19 @@
+         lhs.addAttribute(ns, localName, prefix, value, loc.lhs);
+         rhs.addAttribute(ns, localName, prefix, value, loc.rhs);
+     }
+-    
++
+     public void addComment(CommentList _comments) throws BuildException {
+         CommentListHost comments = (CommentListHost) _comments;
+         lhs.addComment(comments==null?null:comments.lhs);
+         rhs.addComment(comments==null?null:comments.rhs);
+     }
+-    
++
+     public void addElement(ParsedElementAnnotation _ea) throws BuildException {
+         ParsedElementAnnotationHost ea = (ParsedElementAnnotationHost) _ea;
+         lhs.addElement(ea.lhs);
+         rhs.addElement(ea.rhs);
+     }
+-    
++
+     public void addLeadingComment(CommentList _comments) throws BuildException {
+         CommentListHost comments = (CommentListHost) _comments;
+         lhs.addLeadingComment(comments.lhs);
+--- old/src/share/classes/com/sun/xml/internal/rngom/parse/host/Base.java	Thu Jul 30 18:16:54 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/Base.java	Thu Jul 30 18:16:54 2009
+@@ -28,7 +28,7 @@
+ import com.sun.xml.internal.rngom.ast.om.Location;
+ 
+ /**
+- * 
++ *
+  * @author
+  *      Kohsuke Kawaguchi (kk@kohsuke.org)
+  */
+@@ -39,7 +39,7 @@
+         else
+             return (AnnotationsHost)ann;
+     }
+-    
++
+     protected LocationHost cast( Location loc ) {
+         if(loc==null)
+             return nullLocation;
+@@ -46,7 +46,7 @@
+         else
+             return (LocationHost)loc;
+     }
+-    
++
+     private static final AnnotationsHost nullAnnotations = new AnnotationsHost(null,null);
+     private static final LocationHost nullLocation = new LocationHost(null,null);
+ }
+--- old/src/share/classes/com/sun/xml/internal/rngom/parse/host/CommentListHost.java	Thu Jul 30 18:16:58 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/CommentListHost.java	Thu Jul 30 18:16:57 2009
+@@ -29,7 +29,7 @@
+ import com.sun.xml.internal.rngom.ast.om.Location;
+ 
+ /**
+- * 
++ *
+  * @author
+  *      Kohsuke Kawaguchi (kk@kohsuke.org)
+  */
+@@ -42,7 +42,7 @@
+         this.lhs = lhs;
+         this.rhs = rhs;
+     }
+-    
++
+     public void addComment(String value, Location _loc) throws BuildException {
+         LocationHost loc = cast(_loc);
+         if(lhs!=null)
+--- old/src/share/classes/com/sun/xml/internal/rngom/parse/host/DataPatternBuilderHost.java	Thu Jul 30 18:17:01 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/DataPatternBuilderHost.java	Thu Jul 30 18:17:01 2009
+@@ -33,7 +33,7 @@
+ import com.sun.xml.internal.rngom.parse.Context;
+ 
+ /**
+- * 
++ *
+  * @author
+  *      Kohsuke Kawaguchi (kk@kohsuke.org)
+  */
+@@ -40,7 +40,7 @@
+ final class DataPatternBuilderHost extends Base implements DataPatternBuilder {
+     final DataPatternBuilder lhs;
+     final DataPatternBuilder rhs;
+-    
++
+     DataPatternBuilderHost( DataPatternBuilder lhs, DataPatternBuilder rhs ) {
+         this.lhs = lhs;
+         this.rhs = rhs;
+@@ -49,7 +49,7 @@
+     public void addParam(String name, String value, Context context, String ns, Location _loc, Annotations _anno) throws BuildException {
+         LocationHost loc = cast(_loc);
+         AnnotationsHost anno = cast(_anno);
+-        
++
+         lhs.addParam( name, value, context, ns, loc.lhs, anno.lhs );
+         rhs.addParam( name, value, context, ns, loc.rhs, anno.rhs );
+     }
+@@ -56,7 +56,7 @@
+ 
+     public void annotation(ParsedElementAnnotation _ea) {
+         ParsedElementAnnotationHost ea = (ParsedElementAnnotationHost) _ea;
+-        
++
+         lhs.annotation(ea.lhs);
+         rhs.annotation(ea.rhs);
+     }
+@@ -64,7 +64,7 @@
+     public ParsedPattern makePattern(Location _loc, Annotations _anno) throws BuildException {
+         LocationHost loc = cast(_loc);
+         AnnotationsHost anno = cast(_anno);
+-        
++
+         return new ParsedPatternHost(
+             lhs.makePattern( loc.lhs, anno.lhs ),
+             rhs.makePattern( loc.rhs, anno.rhs ));
+@@ -74,7 +74,7 @@
+         ParsedPatternHost except = (ParsedPatternHost) _except;
+         LocationHost loc = cast(_loc);
+         AnnotationsHost anno = cast(_anno);
+-        
++
+         return new ParsedPatternHost(
+             lhs.makePattern(except.lhs, loc.lhs, anno.lhs),
+             rhs.makePattern(except.rhs, loc.rhs, anno.rhs));
+--- old/src/share/classes/com/sun/xml/internal/rngom/parse/host/DivHost.java	Thu Jul 30 18:17:05 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/DivHost.java	Thu Jul 30 18:17:04 2009
+@@ -30,7 +30,7 @@
+ import com.sun.xml.internal.rngom.ast.om.Location;
+ 
+ /**
+- * 
++ *
+  * @author
+  *      Kohsuke Kawaguchi (kk@kohsuke.org)
+  */
+@@ -37,7 +37,7 @@
+ public class DivHost extends GrammarSectionHost implements Div {
+     private final Div lhs;
+     private final Div rhs;
+-    
++
+     DivHost(Div lhs, Div rhs) {
+         super(lhs, rhs);
+         this.lhs = lhs;
+@@ -47,9 +47,9 @@
+     public void endDiv(Location _loc, Annotations _anno) throws BuildException {
+         LocationHost loc = cast(_loc);
+         AnnotationsHost anno = cast(_anno);
+-        
++
+         lhs.endDiv( loc.lhs, anno.lhs );
+         rhs.endDiv( loc.rhs, anno.rhs );
+     }
+-    
++
+ }
+--- old/src/share/classes/com/sun/xml/internal/rngom/parse/host/ElementAnnotationBuilderHost.java	Thu Jul 30 18:17:08 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/ElementAnnotationBuilderHost.java	Thu Jul 30 18:17:08 2009
+@@ -31,7 +31,7 @@
+ import com.sun.xml.internal.rngom.ast.om.ParsedElementAnnotation;
+ 
+ /**
+- * 
++ *
+  * @author
+  *      Kohsuke Kawaguchi (kk@kohsuke.org)
+  */
+@@ -38,7 +38,7 @@
+ final class ElementAnnotationBuilderHost extends AnnotationsHost implements ElementAnnotationBuilder {
+     final ElementAnnotationBuilder lhs;
+     final ElementAnnotationBuilder rhs;
+-    
++
+     ElementAnnotationBuilderHost( ElementAnnotationBuilder lhs, ElementAnnotationBuilder rhs ) {
+         super(lhs,rhs);
+         this.lhs = lhs;
+@@ -48,7 +48,7 @@
+     public void addText(String value, Location _loc, CommentList _comments) throws BuildException {
+         LocationHost loc = cast(_loc);
+         CommentListHost comments = (CommentListHost) _comments;
+-        
++
+         lhs.addText( value, loc.lhs, comments==null?null:comments.lhs );
+         rhs.addText( value, loc.rhs, comments==null?null:comments.rhs );
+     }
+--- old/src/share/classes/com/sun/xml/internal/rngom/parse/host/GrammarHost.java	Thu Jul 30 18:17:12 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/GrammarHost.java	Thu Jul 30 18:17:11 2009
+@@ -32,14 +32,14 @@
+ 
+ /**
+  * Wraps {@link Grammar} and provides error checking.
+- * 
++ *
+  * <p>
+  * The following errors are checked by this host:
+- * 
++ *
+  * <ol>
+  *  <li>referenced to undefined patterns.
+  * </ol>
+- * 
++ *
+  * @author
+  *      Kohsuke Kawaguchi (kk@kohsuke.org)
+  */
+@@ -56,7 +56,7 @@
+     public ParsedPattern endGrammar(Location _loc, Annotations _anno) throws BuildException {
+         LocationHost loc = cast(_loc);
+         AnnotationsHost anno = cast(_anno);
+-        
++
+         return new ParsedPatternHost(
+             lhs.endGrammar(loc.lhs, anno.lhs),
+             rhs.endGrammar(loc.rhs, anno.rhs));
+--- old/src/share/classes/com/sun/xml/internal/rngom/parse/host/GrammarSectionHost.java	Thu Jul 30 18:17:15 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/GrammarSectionHost.java	Thu Jul 30 18:17:15 2009
+@@ -35,7 +35,7 @@
+ import com.sun.xml.internal.rngom.ast.om.ParsedPattern;
+ 
+ /**
+- * 
++ *
+  * @author
+  *      Kohsuke Kawaguchi (kk@kohsuke.org)
+  */
+@@ -42,7 +42,7 @@
+ public class GrammarSectionHost extends Base implements GrammarSection {
+     private final GrammarSection lhs;
+     private final GrammarSection rhs;
+-    
++
+     GrammarSectionHost( GrammarSection lhs, GrammarSection rhs ) {
+         this.lhs = lhs;
+         this.rhs = rhs;
+@@ -49,33 +49,33 @@
+         if(lhs==null || rhs==null)
+             throw new IllegalArgumentException();
+     }
+-    
++
+     public void define(String name, Combine combine, ParsedPattern _pattern,
+         Location _loc, Annotations _anno) throws BuildException {
+         ParsedPatternHost pattern = (ParsedPatternHost) _pattern;
+         LocationHost loc = cast(_loc);
+         AnnotationsHost anno = cast(_anno);
+-        
++
+         lhs.define(name, combine, pattern.lhs, loc.lhs, anno.lhs);
+         rhs.define(name, combine, pattern.rhs, loc.rhs, anno.rhs);
+     }
+-    
++
+     public Div makeDiv() {
+         return new DivHost( lhs.makeDiv(), rhs.makeDiv() );
+     }
+-    
++
+     public Include makeInclude() {
+         Include l = lhs.makeInclude();
+         if(l==null) return null;
+         return new IncludeHost( l, rhs.makeInclude() );
+     }
+-    
++
+     public void topLevelAnnotation(ParsedElementAnnotation _ea) throws BuildException {
+         ParsedElementAnnotationHost ea = (ParsedElementAnnotationHost) _ea;
+         lhs.topLevelAnnotation(ea==null?null:ea.lhs);
+         rhs.topLevelAnnotation(ea==null?null:ea.rhs);
+     }
+-    
++
+     public void topLevelComment(CommentList _comments) throws BuildException {
+         CommentListHost comments = (CommentListHost) _comments;
+ 
+--- old/src/share/classes/com/sun/xml/internal/rngom/parse/host/IncludeHost.java	Thu Jul 30 18:17:19 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/IncludeHost.java	Thu Jul 30 18:17:18 2009
+@@ -32,7 +32,7 @@
+ import com.sun.xml.internal.rngom.parse.Parseable;
+ 
+ /**
+- * 
++ *
+  * @author
+  *      Kohsuke Kawaguchi (kk@kohsuke.org)
+  */
+@@ -40,7 +40,7 @@
+ 
+     private final Include lhs;
+     private final Include rhs;
+-    
++
+     IncludeHost(Include lhs, Include rhs) {
+         super(lhs, rhs);
+         this.lhs = lhs;
+@@ -50,7 +50,7 @@
+     public void endInclude(Parseable current, String uri, String ns, Location _loc, Annotations _anno) throws BuildException, IllegalSchemaException {
+         LocationHost loc = cast(_loc);
+         AnnotationsHost anno = cast(_anno);
+-        
++
+         lhs.endInclude( current, uri, ns, loc.lhs, anno.lhs );
+         rhs.endInclude( current, uri, ns, loc.rhs, anno.rhs );
+     }
+--- old/src/share/classes/com/sun/xml/internal/rngom/parse/host/LocationHost.java	Thu Jul 30 18:17:22 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/LocationHost.java	Thu Jul 30 18:17:22 2009
+@@ -27,7 +27,7 @@
+ import com.sun.xml.internal.rngom.ast.om.Location;
+ 
+ /**
+- * 
++ *
+  * @author
+  *      Kohsuke Kawaguchi (kk@kohsuke.org)
+  */
+@@ -34,7 +34,7 @@
+ final class LocationHost implements Location {
+     final Location lhs;
+     final Location rhs;
+-    
++
+     LocationHost( Location lhs, Location rhs ) {
+         this.lhs = lhs;
+         this.rhs = rhs;
+--- old/src/share/classes/com/sun/xml/internal/rngom/parse/host/NameClassBuilderHost.java	Thu Jul 30 18:17:26 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/NameClassBuilderHost.java	Thu Jul 30 18:17:25 2009
+@@ -36,7 +36,7 @@
+ import java.util.ArrayList;
+ 
+ /**
+- * 
++ *
+  * @author
+  *      Kohsuke Kawaguchi (kk@kohsuke.org)
+  */
+@@ -43,7 +43,7 @@
+ final class NameClassBuilderHost extends Base implements NameClassBuilder {
+     final NameClassBuilder lhs;
+     final NameClassBuilder rhs;
+-    
++
+     NameClassBuilderHost( NameClassBuilder lhs, NameClassBuilder rhs ) {
+         this.lhs = lhs;
+         this.rhs = rhs;
+@@ -52,7 +52,7 @@
+     public ParsedNameClass annotate(ParsedNameClass _nc, Annotations _anno) throws BuildException {
+         ParsedNameClassHost nc = (ParsedNameClassHost) _nc;
+         AnnotationsHost anno = cast(_anno);
+-        
++
+         return new ParsedNameClassHost(
+             lhs.annotate(nc.lhs, anno.lhs),
+             rhs.annotate(nc.rhs, anno.rhs) );
+@@ -61,7 +61,7 @@
+     public ParsedNameClass annotateAfter(ParsedNameClass _nc, ParsedElementAnnotation _e) throws BuildException {
+         ParsedNameClassHost nc = (ParsedNameClassHost) _nc;
+         ParsedElementAnnotationHost e = (ParsedElementAnnotationHost) _e;
+-        
++
+         return new ParsedNameClassHost(
+             lhs.annotateAfter(nc.lhs, e.lhs),
+             rhs.annotateAfter(nc.rhs, e.rhs));
+@@ -70,7 +70,7 @@
+     public ParsedNameClass commentAfter(ParsedNameClass _nc, CommentList _comments) throws BuildException {
+         ParsedNameClassHost nc = (ParsedNameClassHost) _nc;
+         CommentListHost comments = (CommentListHost) _comments;
+-        
++
+         return new ParsedNameClassHost(
+             lhs.commentAfter(nc.lhs, comments==null?null:comments.lhs),
+             rhs.commentAfter(nc.rhs, comments==null?null:comments.rhs));
+@@ -85,7 +85,7 @@
+         }
+         LocationHost loc = cast(_loc);
+         AnnotationsHost anno = cast(_anno);
+-        
++
+         return new ParsedNameClassHost(
+             lhs.makeChoice( lnc, loc.lhs, anno.lhs ),
+             rhs.makeChoice( rnc, loc.rhs, anno.rhs ) );
+@@ -94,7 +94,7 @@
+     public ParsedNameClass makeName(String ns, String localName, String prefix, Location _loc, Annotations _anno) {
+         LocationHost loc = cast(_loc);
+         AnnotationsHost anno = cast(_anno);
+-        
++
+         return new ParsedNameClassHost(
+             lhs.makeName( ns, localName, prefix, loc.lhs, anno.lhs ),
+             rhs.makeName( ns, localName, prefix, loc.rhs, anno.rhs ) );
+@@ -103,7 +103,7 @@
+     public ParsedNameClass makeNsName(String ns, Location _loc, Annotations _anno) {
+         LocationHost loc = cast(_loc);
+         AnnotationsHost anno = cast(_anno);
+-        
++
+         return new ParsedNameClassHost(
+             lhs.makeNsName( ns, loc.lhs, anno.lhs ),
+             rhs.makeNsName( ns, loc.rhs, anno.rhs ) );
+@@ -113,7 +113,7 @@
+         ParsedNameClassHost except = (ParsedNameClassHost) _except;
+         LocationHost loc = cast(_loc);
+         AnnotationsHost anno = cast(_anno);
+-        
++
+         return new ParsedNameClassHost(
+             lhs.makeNsName( ns, except.lhs, loc.lhs, anno.lhs ),
+             rhs.makeNsName( ns, except.rhs, loc.rhs, anno.rhs ) );
+@@ -122,7 +122,7 @@
+     public ParsedNameClass makeAnyName(Location _loc, Annotations _anno) {
+         LocationHost loc = cast(_loc);
+         AnnotationsHost anno = cast(_anno);
+-        
++
+         return new ParsedNameClassHost(
+             lhs.makeAnyName( loc.lhs, anno.lhs ),
+             rhs.makeAnyName( loc.rhs, anno.rhs ) );
+@@ -132,7 +132,7 @@
+         ParsedNameClassHost except = (ParsedNameClassHost) _except;
+         LocationHost loc = cast(_loc);
+         AnnotationsHost anno = cast(_anno);
+-        
++
+         return new ParsedNameClassHost(
+             lhs.makeAnyName( except.lhs, loc.lhs, anno.lhs ),
+             rhs.makeAnyName( except.rhs, loc.rhs, anno.rhs ) );
+--- old/src/share/classes/com/sun/xml/internal/rngom/parse/host/ParsedElementAnnotationHost.java	Thu Jul 30 18:17:29 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/ParsedElementAnnotationHost.java	Thu Jul 30 18:17:29 2009
+@@ -27,7 +27,7 @@
+ import com.sun.xml.internal.rngom.ast.om.ParsedElementAnnotation;
+ 
+ /**
+- * 
++ *
+  * @author
+  *      Kohsuke Kawaguchi (kk@kohsuke.org)
+  */
+@@ -34,7 +34,7 @@
+ final class ParsedElementAnnotationHost implements ParsedElementAnnotation {
+     final ParsedElementAnnotation lhs;
+     final ParsedElementAnnotation rhs;
+-    
++
+     ParsedElementAnnotationHost( ParsedElementAnnotation lhs, ParsedElementAnnotation rhs ) {
+         this.lhs = lhs;
+         this.rhs = rhs;
+--- old/src/share/classes/com/sun/xml/internal/rngom/parse/host/ParsedNameClassHost.java	Thu Jul 30 18:17:33 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/ParsedNameClassHost.java	Thu Jul 30 18:17:32 2009
+@@ -27,7 +27,7 @@
+ import com.sun.xml.internal.rngom.ast.om.ParsedNameClass;
+ 
+ /**
+- * 
++ *
+  * @author
+  *      Kohsuke Kawaguchi (kk@kohsuke.org)
+  */
+@@ -34,7 +34,7 @@
+ final class ParsedNameClassHost implements ParsedNameClass {
+     final ParsedNameClass lhs;
+     final ParsedNameClass rhs;
+-    
++
+     ParsedNameClassHost( ParsedNameClass lhs, ParsedNameClass rhs ) {
+         this.lhs = lhs;
+         this.rhs = rhs;
+--- old/src/share/classes/com/sun/xml/internal/rngom/parse/host/ParsedPatternHost.java	Thu Jul 30 18:17:37 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/ParsedPatternHost.java	Thu Jul 30 18:17:36 2009
+@@ -27,7 +27,7 @@
+ import com.sun.xml.internal.rngom.ast.om.ParsedPattern;
+ 
+ /**
+- * 
++ *
+  * @author
+  *      Kohsuke Kawaguchi (kk@kohsuke.org)
+  */
+@@ -34,7 +34,7 @@
+ public class ParsedPatternHost implements ParsedPattern {
+     public final ParsedPattern lhs;
+     public final ParsedPattern rhs;
+-    
++
+     ParsedPatternHost( ParsedPattern lhs, ParsedPattern rhs ) {
+         this.lhs = lhs;
+         this.rhs = rhs;
+--- old/src/share/classes/com/sun/xml/internal/rngom/parse/host/SchemaBuilderHost.java	Thu Jul 30 18:17:40 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/SchemaBuilderHost.java	Thu Jul 30 18:17:39 2009
+@@ -45,7 +45,7 @@
+ import java.util.ArrayList;
+ 
+ /**
+- * 
++ *
+  * @author
+  *      Kohsuke Kawaguchi (kk@kohsuke.org)
+  */
+@@ -52,26 +52,26 @@
+ public class SchemaBuilderHost extends Base implements SchemaBuilder {
+     final SchemaBuilder lhs;
+     final SchemaBuilder rhs;
+-    
++
+     public SchemaBuilderHost( SchemaBuilder lhs, SchemaBuilder rhs ) {
+         this.lhs = lhs;
+         this.rhs = rhs;
+     }
+-    
++
+     public ParsedPattern annotate(ParsedPattern _p, Annotations _anno)
+         throws BuildException {
+-        
++
+         ParsedPatternHost p = (ParsedPatternHost) _p;
+         AnnotationsHost a = cast(_anno);
+-        
++
+         return new ParsedPatternHost(
+             lhs.annotate(p.lhs, a.lhs),
+             rhs.annotate(p.lhs, a.lhs) );
+     }
+-    
++
+     public ParsedPattern annotateAfter(ParsedPattern _p,
+         ParsedElementAnnotation _e) throws BuildException {
+-        
++
+         ParsedPatternHost p = (ParsedPatternHost) _p;
+         ParsedElementAnnotationHost e = (ParsedElementAnnotationHost) _e;
+         return new ParsedPatternHost(
+@@ -78,18 +78,18 @@
+             lhs.annotateAfter(p.lhs, e.lhs),
+             rhs.annotateAfter(p.rhs, e.rhs));
+     }
+-    
++
+     public ParsedPattern commentAfter(ParsedPattern _p, CommentList _comments)
+         throws BuildException {
+-        
++
+         ParsedPatternHost p = (ParsedPatternHost) _p;
+         CommentListHost comments = (CommentListHost) _comments;
+-        
++
+         return new ParsedPatternHost(
+             lhs.commentAfter(p.lhs, comments==null?null:comments.lhs),
+             rhs.commentAfter(p.rhs, comments==null?null:comments.rhs));
+     }
+-    
++
+     public ParsedPattern expandPattern(ParsedPattern _p) throws BuildException, IllegalSchemaException {
+         ParsedPatternHost p = (ParsedPatternHost) _p;
+         return new ParsedPatternHost(
+@@ -96,11 +96,11 @@
+             lhs.expandPattern(p.lhs),
+             rhs.expandPattern(p.rhs));
+     }
+-    
++
+     public NameClassBuilder getNameClassBuilder() throws BuildException {
+         return new NameClassBuilderHost( lhs.getNameClassBuilder(), rhs.getNameClassBuilder() );
+     }
+-    
++
+     public Annotations makeAnnotations(CommentList _comments, Context context) {
+         CommentListHost comments = (CommentListHost) _comments;
+         Annotations l = lhs.makeAnnotations((comments!=null)?comments.lhs:null, context);
+@@ -109,20 +109,20 @@
+             throw new IllegalArgumentException("annotations cannot be null");
+         return new AnnotationsHost(l,r);
+     }
+-    
++
+     public ParsedPattern makeAttribute(ParsedNameClass _nc, ParsedPattern _p,
+         Location _loc, Annotations _anno) throws BuildException {
+-        
++
+         ParsedNameClassHost nc = (ParsedNameClassHost) _nc;
+         ParsedPatternHost p = (ParsedPatternHost) _p;
+         LocationHost loc = cast(_loc);
+         AnnotationsHost anno = cast(_anno);
+-        
++
+         return new ParsedPatternHost(
+             lhs.makeAttribute(nc.lhs, p.lhs, loc.lhs, anno.lhs),
+             rhs.makeAttribute(nc.rhs, p.rhs, loc.rhs, anno.rhs));
+     }
+-    
++
+     public ParsedPattern makeChoice(List patterns,
+         Location _loc, Annotations _anno) throws BuildException {
+ 
+@@ -134,79 +134,79 @@
+         }
+         LocationHost loc = cast(_loc);
+         AnnotationsHost anno = cast(_anno);
+-        
++
+         return new ParsedPatternHost(
+             lhs.makeChoice(lp, loc.lhs, anno.lhs),
+             rhs.makeChoice(rp, loc.rhs, anno.rhs));
+     }
+-    
++
+     public CommentList makeCommentList() {
+         return new CommentListHost(
+             lhs.makeCommentList(),
+             rhs.makeCommentList() );
+     }
+-    
++
+     public DataPatternBuilder makeDataPatternBuilder(String datatypeLibrary,
+         String type, Location _loc) throws BuildException {
+         LocationHost loc = cast(_loc);
+-        
++
+         return new DataPatternBuilderHost(
+             lhs.makeDataPatternBuilder(datatypeLibrary, type, loc.lhs),
+             rhs.makeDataPatternBuilder(datatypeLibrary, type, loc.rhs) );
+     }
+-    
++
+     public ParsedPattern makeElement(ParsedNameClass _nc, ParsedPattern _p,
+         Location _loc, Annotations _anno) throws BuildException {
+-        
++
+         ParsedNameClassHost nc = (ParsedNameClassHost) _nc;
+         ParsedPatternHost p = (ParsedPatternHost) _p;
+         LocationHost loc = cast(_loc);
+         AnnotationsHost anno = cast(_anno);
+-        
++
+         return new ParsedPatternHost(
+             lhs.makeElement(nc.lhs, p.lhs, loc.lhs, anno.lhs),
+             rhs.makeElement(nc.rhs, p.rhs, loc.rhs, anno.rhs));
+     }
+-    
++
+     public ElementAnnotationBuilder makeElementAnnotationBuilder(String ns,
+         String localName, String prefix, Location _loc, CommentList _comments,
+         Context context) {
+         LocationHost loc = cast(_loc);
+         CommentListHost comments = (CommentListHost) _comments;
+-        
++
+         return new ElementAnnotationBuilderHost(
+             lhs.makeElementAnnotationBuilder(ns, localName, prefix, loc.lhs, comments==null?null:comments.lhs, context),
+             rhs.makeElementAnnotationBuilder(ns, localName, prefix, loc.rhs, comments==null?null:comments.rhs, context) );
+     }
+-    
++
+     public ParsedPattern makeEmpty(Location _loc, Annotations _anno) {
+         LocationHost loc = cast(_loc);
+         AnnotationsHost anno = cast(_anno);
+-        
++
+         return new ParsedPatternHost(
+             lhs.makeEmpty(loc.lhs, anno.lhs),
+             rhs.makeEmpty(loc.rhs, anno.rhs));
+     }
+-    
++
+     public ParsedPattern makeErrorPattern() {
+         return new ParsedPatternHost(
+             lhs.makeErrorPattern(),
+             rhs.makeErrorPattern() );
+     }
+-    
++
+     public ParsedPattern makeExternalRef(Parseable current, String uri,
+         String ns, Scope _scope, Location _loc, Annotations _anno)
+         throws BuildException, IllegalSchemaException {
+-        
++
+         ScopeHost scope = (ScopeHost) _scope;
+         LocationHost loc = cast(_loc);
+         AnnotationsHost anno = cast(_anno);
+-        
++
+         return new ParsedPatternHost(
+             lhs.makeExternalRef(current, uri, ns, scope.lhs, loc.lhs, anno.lhs),
+             rhs.makeExternalRef(current, uri, ns, scope.rhs, loc.rhs, anno.rhs) );
+     }
+-    
++
+     public Grammar makeGrammar(Scope _parent) {
+         ScopeHost parent = (ScopeHost) _parent;
+ 
+@@ -248,19 +248,19 @@
+             lhs.makeInterleave(lp, loc.lhs, anno.lhs),
+             rhs.makeInterleave(rp, loc.rhs, anno.rhs));
+     }
+-    
++
+     public ParsedPattern makeList(ParsedPattern _p, Location _loc,
+         Annotations _anno) throws BuildException {
+-        
++
+         ParsedPatternHost p = (ParsedPatternHost) _p;
+         LocationHost loc = cast(_loc);
+         AnnotationsHost anno = cast(_anno);
+-        
++
+         return new ParsedPatternHost(
+             lhs.makeList(p.lhs, loc.lhs, anno.lhs),
+             rhs.makeList(p.rhs, loc.rhs, anno.rhs));
+     }
+-    
++
+     public Location makeLocation(String systemId, int lineNumber,
+         int columnNumber) {
+         return new LocationHost(
+@@ -267,23 +267,23 @@
+             lhs.makeLocation(systemId, lineNumber, columnNumber),
+             rhs.makeLocation(systemId, lineNumber, columnNumber));
+     }
+-    
++
+     public ParsedPattern makeMixed(ParsedPattern _p, Location _loc,
+         Annotations _anno) throws BuildException {
+-        
++
+         ParsedPatternHost p = (ParsedPatternHost) _p;
+         LocationHost loc = cast(_loc);
+         AnnotationsHost anno = cast(_anno);
+-        
++
+         return new ParsedPatternHost(
+             lhs.makeMixed(p.lhs, loc.lhs, anno.lhs),
+             rhs.makeMixed(p.rhs, loc.rhs, anno.rhs));
+     }
+-    
++
+     public ParsedPattern makeNotAllowed(Location _loc, Annotations _anno) {
+         LocationHost loc = cast(_loc);
+         AnnotationsHost anno = cast(_anno);
+-        
++
+         return new ParsedPatternHost(
+             lhs.makeNotAllowed(loc.lhs, anno.lhs),
+             rhs.makeNotAllowed(loc.rhs, anno.rhs));
+@@ -291,23 +291,23 @@
+ 
+     public ParsedPattern makeOneOrMore(ParsedPattern _p, Location _loc,
+         Annotations _anno) throws BuildException {
+-        
++
+         ParsedPatternHost p = (ParsedPatternHost) _p;
+         LocationHost loc = cast(_loc);
+         AnnotationsHost anno = cast(_anno);
+-        
++
+         return new ParsedPatternHost(
+             lhs.makeOneOrMore(p.lhs, loc.lhs, anno.lhs),
+             rhs.makeOneOrMore(p.rhs, loc.rhs, anno.rhs));
+     }
+-    
++
+     public ParsedPattern makeZeroOrMore(ParsedPattern _p, Location _loc,
+         Annotations _anno) throws BuildException {
+-        
++
+         ParsedPatternHost p = (ParsedPatternHost) _p;
+         LocationHost loc = cast(_loc);
+         AnnotationsHost anno = cast(_anno);
+-        
++
+         return new ParsedPatternHost(
+             lhs.makeZeroOrMore(p.lhs, loc.lhs, anno.lhs),
+             rhs.makeZeroOrMore(p.rhs, loc.rhs, anno.rhs));
+@@ -315,36 +315,36 @@
+ 
+     public ParsedPattern makeOptional(ParsedPattern _p, Location _loc,
+         Annotations _anno) throws BuildException {
+-        
++
+         ParsedPatternHost p = (ParsedPatternHost) _p;
+         LocationHost loc = cast(_loc);
+         AnnotationsHost anno = cast(_anno);
+-        
++
+         return new ParsedPatternHost(
+             lhs.makeOptional(p.lhs, loc.lhs, anno.lhs),
+             rhs.makeOptional(p.rhs, loc.rhs, anno.rhs));
+     }
+-    
++
+     public ParsedPattern makeText(Location _loc, Annotations _anno) {
+         LocationHost loc = cast(_loc);
+         AnnotationsHost anno = cast(_anno);
+-        
++
+         return new ParsedPatternHost(
+             lhs.makeText(loc.lhs, anno.lhs),
+             rhs.makeText(loc.rhs, anno.rhs));
+     }
+-    
++
+     public ParsedPattern makeValue(String datatypeLibrary, String type,
+         String value, Context c, String ns, Location _loc, Annotations _anno)
+         throws BuildException {
+         LocationHost loc = cast(_loc);
+         AnnotationsHost anno = cast(_anno);
+-        
++
+         return new ParsedPatternHost(
+             lhs.makeValue(datatypeLibrary,type,value,c,ns,loc.lhs,anno.lhs),
+             rhs.makeValue(datatypeLibrary,type,value,c,ns,loc.rhs,anno.rhs));
+     }
+-    
++
+     public boolean usesComments() {
+         return lhs.usesComments() || rhs.usesComments();
+     }
+--- old/src/share/classes/com/sun/xml/internal/rngom/parse/host/ScopeHost.java	Thu Jul 30 18:17:44 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/host/ScopeHost.java	Thu Jul 30 18:17:43 2009
+@@ -31,7 +31,7 @@
+ import com.sun.xml.internal.rngom.ast.om.ParsedPattern;
+ 
+ /**
+- * 
++ *
+  * @author
+  *      Kohsuke Kawaguchi (kk@kohsuke.org)
+  */
+@@ -38,7 +38,7 @@
+ public class ScopeHost extends GrammarSectionHost implements Scope {
+     protected final Scope lhs;
+     protected final Scope rhs;
+-    
++
+     protected ScopeHost( Scope lhs, Scope rhs ) {
+         super(lhs,rhs);
+         this.lhs = lhs;
+@@ -48,7 +48,7 @@
+     public ParsedPattern makeParentRef(String name, Location _loc, Annotations _anno) throws BuildException {
+         LocationHost loc = cast(_loc);
+         AnnotationsHost anno = cast(_anno);
+-        
++
+         return new ParsedPatternHost(
+             lhs.makeParentRef(name, loc.lhs, anno.lhs),
+             rhs.makeParentRef(name, loc.rhs, anno.rhs));
+@@ -57,7 +57,7 @@
+     public ParsedPattern makeRef(String name, Location _loc, Annotations _anno) throws BuildException {
+         LocationHost loc = cast(_loc);
+         AnnotationsHost anno = cast(_anno);
+-        
++
+         return new ParsedPatternHost(
+             lhs.makeRef(name, loc.lhs, anno.lhs),
+             rhs.makeRef(name, loc.rhs, anno.rhs));
+--- old/src/share/classes/com/sun/xml/internal/rngom/parse/xml/Messages.properties	Thu Jul 30 18:17:47 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/xml/Messages.properties	Thu Jul 30 18:17:47 2009
+@@ -61,4 +61,3 @@
+ undefined_prefix=undefined prefix \"{0}\"
+ value_contains_foreign_element=\"value\" element cannot contain foreign elements
+ wrong_uri_version=namespace URI has wrong version: expected \"{0}\" but got \"{1}\"
+- 
+--- old/src/share/classes/com/sun/xml/internal/rngom/parse/xml/SAXParseable.java	Thu Jul 30 18:17:51 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/xml/SAXParseable.java	Thu Jul 30 18:17:50 2009
+@@ -43,7 +43,7 @@
+ 
+ /**
+  * RELAX NG schema in the XML syntax.
+- * 
++ *
+  */
+ public class SAXParseable implements Parseable {
+   private final InputSource in;
+@@ -60,7 +60,7 @@
+   public SAXParseable(InputSource in, ErrorHandler eh) {
+       this(in,eh,new JAXPXMLReaderCreator());
+   }
+-  
++
+   public ParsedPattern parse(SchemaBuilder schemaBuilder) throws BuildException, IllegalSchemaException {
+     try {
+       XMLReader xr = xrc.createXMLReader();
+--- old/src/share/classes/com/sun/xml/internal/rngom/parse/xml/SchemaParser.java	Thu Jul 30 18:17:54 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/rngom/parse/xml/SchemaParser.java	Thu Jul 30 18:17:54 2009
+@@ -237,31 +237,31 @@
+     }
+ 
+     public void startElement(String namespaceURI,
+-			     String localName,
+-			     String qName,
+-			     Attributes atts) throws SAXException {
++                             String localName,
++                             String qName,
++                             Attributes atts) throws SAXException {
+       xmlBaseHandler.startElement();
+       if (isRelaxNGElement(namespaceURI)) {
+-	State state = createChildState(localName);
+-	if (state == null) {
+-	  xr.setContentHandler(new Skipper(this));
+-	  return;
+-	}
+-	state.setParent(this);
+-	state.set();
+-	state.attributes(atts);
++        State state = createChildState(localName);
++        if (state == null) {
++          xr.setContentHandler(new Skipper(this));
++          return;
++        }
++        state.setParent(this);
++        state.set();
++        state.attributes(atts);
+       }
+       else {
+-	checkForeignElement();
++        checkForeignElement();
+         ForeignElementHandler feh = new ForeignElementHandler(this, getComments());
+         feh.startElement(namespaceURI, localName, qName, atts);
+-	xr.setContentHandler(feh);
++        xr.setContentHandler(feh);
+       }
+     }
+ 
+     public void endElement(String namespaceURI,
+-			   String localName,
+-			   String qName) throws SAXException {
++                           String localName,
++                           String qName) throws SAXException {
+       xmlBaseHandler.endElement();
+       parent.set();
+       end();
+@@ -284,31 +284,31 @@
+     void attributes(Attributes atts) throws SAXException {
+       int len = atts.getLength();
+       for (int i = 0; i < len; i++) {
+-	String uri = atts.getURI(i);
+-	if (uri.length() == 0) {
+-	  String name = atts.getLocalName(i);
+-	  if (name.equals("name"))
+-	    setName(atts.getValue(i).trim());
+-	  else if (name.equals("ns"))
+-	    ns = atts.getValue(i);
+-	  else if (name.equals("datatypeLibrary")) {
+-	    datatypeLibrary = atts.getValue(i);
+-	    checkUri(datatypeLibrary);
+-	    if (!datatypeLibrary.equals("")
+-		&& !Uri.isAbsolute(datatypeLibrary))
+-	      error("relative_datatype_library");
+-	    if (Uri.hasFragmentId(datatypeLibrary))
+-	      error("fragment_identifier_datatype_library");
+-	    datatypeLibrary = Uri.escapeDisallowedChars(datatypeLibrary);
+-	  }
+-	  else
+-	    setOtherAttribute(name, atts.getValue(i));
+-	}
+-	else if (uri.equals(relaxngURI))
+-	  error("qualified_attribute", atts.getLocalName(i));
+-	else if (uri.equals(WellKnownNamespaces.XML)
+-		 && atts.getLocalName(i).equals("base"))
+-	  xmlBaseHandler.xmlBaseAttribute(atts.getValue(i));
++        String uri = atts.getURI(i);
++        if (uri.length() == 0) {
++          String name = atts.getLocalName(i);
++          if (name.equals("name"))
++            setName(atts.getValue(i).trim());
++          else if (name.equals("ns"))
++            ns = atts.getValue(i);
++          else if (name.equals("datatypeLibrary")) {
++            datatypeLibrary = atts.getValue(i);
++            checkUri(datatypeLibrary);
++            if (!datatypeLibrary.equals("")
++                && !Uri.isAbsolute(datatypeLibrary))
++              error("relative_datatype_library");
++            if (Uri.hasFragmentId(datatypeLibrary))
++              error("fragment_identifier_datatype_library");
++            datatypeLibrary = Uri.escapeDisallowedChars(datatypeLibrary);
++          }
++          else
++            setOtherAttribute(name, atts.getValue(i));
++        }
++        else if (uri.equals(relaxngURI))
++          error("qualified_attribute", atts.getLocalName(i));
++        else if (uri.equals(WellKnownNamespaces.XML)
++                 && atts.getLocalName(i).equals("base"))
++          xmlBaseHandler.xmlBaseAttribute(atts.getValue(i));
+         else {
+           if (annotations == null)
+             annotations = schemaBuilder.makeAnnotations(null, getContext());
+@@ -339,16 +339,16 @@
+ 
+     public void characters(char[] ch, int start, int len) throws SAXException {
+       for (int i = 0; i < len; i++) {
+-	switch(ch[start + i]) {
+-	case ' ':
+-	case '\r':
+-	case '\n':
+-	case '\t':
+-	  break;
+-	default:
+-	  error("illegal_characters_ignored");
+-	  break;
+-	}
++        switch(ch[start + i]) {
++        case ' ':
++        case '\r':
++        case '\n':
++        case '\t':
++          break;
++        default:
++          error("illegal_characters_ignored");
++          break;
++        }
+       }
+     }
+ 
+@@ -399,7 +399,7 @@
+                                                            getContext());
+       int len = atts.getLength();
+       for (int i = 0; i < len; i++) {
+-	String uri = atts.getURI(i);
++        String uri = atts.getURI(i);
+         builder.addAttribute(uri, atts.getLocalName(i), findPrefix(atts.getQName(i), uri),
+                              atts.getValue(i), loc);
+       }
+@@ -452,17 +452,17 @@
+     }
+ 
+     public void startElement(String namespaceURI,
+-			     String localName,
+-			     String qName,
+-			     Attributes atts) throws SAXException {
++                             String localName,
++                             String qName,
++                             Attributes atts) throws SAXException {
+       ++level;
+     }
+ 
+     public void endElement(String namespaceURI,
+-			   String localName,
+-			   String qName) throws SAXException {
++                           String localName,
++                           String qName) throws SAXException {
+       if (--level == 0)
+-	nextState.set();
++        nextState.set();
+     }
+ 
+     public void comment(String value) {
+@@ -497,8 +497,8 @@
+     State createChildState(String localName) throws SAXException {
+       State state = (State)patternTable.get(localName);
+       if (state == null) {
+-	error("expected_pattern", localName);
+-	return null;
++        error("expected_pattern", localName);
++        return null;
+       }
+       return state.create();
+     }
+@@ -526,8 +526,8 @@
+ 
+     void end() throws SAXException {
+       if (childPatterns == null) {
+-	error("missing_children");
+-	endChild(schemaBuilder.makeErrorPattern());
++        error("missing_children");
++        endChild(schemaBuilder.makeErrorPattern());
+       }
+       if (comments != null) {
+         int idx = childPatterns.size()-1;
+@@ -631,11 +631,11 @@
+ 
+     void endAttributes() throws SAXException {
+       if (name != null) {
+-	nameClass = expandName(name, getNs(), null);
++        nameClass = expandName(name, getNs(), null);
+         nameClassWasAttribute = true;
+       }
+       else
+-	new NameClassChildState(this, this).set();
++        new NameClassChildState(this, this).set();
+     }
+ 
+     State create() {
+@@ -673,9 +673,9 @@
+ 
+     State createChildState(String localName) throws SAXException {
+       if (grammar == null)
+-	return super.createChildState(localName);
++        return super.createChildState(localName);
+       if (localName.equals("grammar"))
+-	return new MergeGrammarState(grammar);
++        return new MergeGrammarState(grammar);
+       error("expected_grammar", localName);
+       return null;
+     }
+@@ -690,11 +690,11 @@
+ 
+     boolean isRelaxNGElement(String uri) throws SAXException {
+       if (!uri.startsWith(relaxngURIPrefix))
+-	return false;
++        return false;
+       if (!uri.equals(WellKnownNamespaces.RELAX_NG))
+-	warning("wrong_uri_version",
+-		WellKnownNamespaces.RELAX_NG.substring(relaxngURIPrefix.length()),
+-		uri.substring(relaxngURIPrefix.length()));
++        warning("wrong_uri_version",
++                WellKnownNamespaces.RELAX_NG.substring(relaxngURIPrefix.length()),
++                uri.substring(relaxngURIPrefix.length()));
+       relaxngURI = uri;
+       return true;
+     }
+@@ -741,9 +741,9 @@
+ 
+     void setOtherAttribute(String name, String value) throws SAXException {
+       if (name.equals("type"))
+-	type = checkNCName(value.trim());
++        type = checkNCName(value.trim());
+       else
+-	super.setOtherAttribute(name, value);
++        super.setOtherAttribute(name, value);
+     }
+ 
+     public void characters(char[] ch, int start, int len) {
+@@ -789,14 +789,14 @@
+ 
+     State createChildState(String localName) throws SAXException {
+       if (localName.equals("param")) {
+-	if (except != null)
+-	  error("param_after_except");
+-	return new ParamState(dpb);
++        if (except != null)
++          error("param_after_except");
++        return new ParamState(dpb);
+       }
+       if (localName.equals("except")) {
+-	if (except != null)
+-	  error("multiple_except");
+-	return new ChoiceState();
++        if (except != null)
++          error("multiple_except");
++        return new ChoiceState();
+       }
+       error("expected_param_except", localName);
+       return null;
+@@ -804,16 +804,16 @@
+ 
+     void setOtherAttribute(String name, String value) throws SAXException {
+       if (name.equals("type"))
+-	type = checkNCName(value.trim());
++        type = checkNCName(value.trim());
+       else
+-	super.setOtherAttribute(name, value);
++        super.setOtherAttribute(name, value);
+     }
+ 
+     void endAttributes() throws SAXException {
+       if (type == null)
+-	error("missing_type_attribute");
++        error("missing_type_attribute");
+       else
+-	dpb = schemaBuilder.makeDataPatternBuilder(datatypeLibrary, type, startLocation);
++        dpb = schemaBuilder.makeDataPatternBuilder(datatypeLibrary, type, startLocation);
+     }
+ 
+     void endForeignChild(ParsedElementAnnotation ea) {
+@@ -859,7 +859,7 @@
+ 
+     void endAttributes() throws SAXException {
+       if (name == null)
+-	error("missing_name_attribute");
++        error("missing_name_attribute");
+     }
+ 
+     State createChildState(String localName) throws SAXException {
+@@ -877,7 +877,7 @@
+ 
+     void end() throws SAXException {
+       if (name == null)
+-	return;
++        return;
+       if (dpb == null)
+         return;
+       mergeLeadingComments();
+@@ -904,16 +904,16 @@
+ 
+     void endAttributes() throws SAXException {
+       if (name != null) {
+-	String nsUse;
+-	if (ns != null)
+-	  nsUse = ns;
+-	else
+-	  nsUse = "";
+-	nameClass = expandName(name, nsUse, null);
++        String nsUse;
++        if (ns != null)
++          nsUse = ns;
++        else
++          nsUse = "";
++        nameClass = expandName(name, nsUse, null);
+         nameClassWasAttribute = true;
+       }
+       else
+-	new NameClassChildState(this, this).set();
++        new NameClassChildState(this, this).set();
+     }
+ 
+     void endForeignChild(ParsedElementAnnotation ea) {
+@@ -925,7 +925,7 @@
+ 
+     void end() throws SAXException {
+       if (childPatterns == null)
+-	endChild(schemaBuilder.makeText(startLocation, null));
++        endChild(schemaBuilder.makeText(startLocation, null));
+       super.end();
+     }
+ 
+@@ -936,7 +936,7 @@
+     State createChildState(String localName) throws SAXException {
+       State tem = super.createChildState(localName);
+       if (tem != null && childPatterns!=null)
+-	error("attribute_multi_pattern");
++        error("attribute_multi_pattern");
+       return tem;
+     }
+ 
+@@ -945,7 +945,7 @@
+   abstract class SinglePatternContainerState extends PatternContainerState {
+     State createChildState(String localName) throws SAXException {
+       if (childPatterns==null)
+-	return super.createChildState(localName);
++        return super.createChildState(localName);
+       error("too_many_children");
+       return null;
+     }
+@@ -966,16 +966,16 @@
+ 
+     State createChildState(String localName) throws SAXException {
+       if (localName.equals("define"))
+-	return new DefineState(section);
++        return new DefineState(section);
+       if (localName.equals("start"))
+-	return new StartState(section);
++        return new StartState(section);
+       if (localName.equals("include")) {
+-	Include include = section.makeInclude();
+-	if (include != null)
+-	  return new IncludeState(include);
++        Include include = section.makeInclude();
++        if (include != null)
++          return new IncludeState(include);
+       }
+       if (localName.equals("div"))
+-	return new DivState(section.makeDiv());
++        return new DivState(section.makeDiv());
+       error("expected_define", localName);
+       // XXX better errors
+       return null;
+@@ -1017,16 +1017,16 @@
+ 
+     void setOtherAttribute(String name, String value) throws SAXException {
+       if (name.equals("href")) {
+-	href = value;
+-	checkUri(href);
++        href = value;
++        checkUri(href);
+       }
+       else
+-	super.setOtherAttribute(name, value);
++        super.setOtherAttribute(name, value);
+     }
+ 
+     void endAttributes() throws SAXException {
+       if (href == null)
+-	error("missing_href_attribute");
++        error("missing_href_attribute");
+       else
+         href = resolve(href);
+     }
+@@ -1130,16 +1130,16 @@
+ 
+     void setOtherAttribute(String name, String value) throws SAXException {
+       if (name.equals("href")) {
+-	href = value;
+-	checkUri(href);
++        href = value;
++        checkUri(href);
+       }
+       else
+-	super.setOtherAttribute(name, value);
++        super.setOtherAttribute(name, value);
+     }
+ 
+     void endAttributes() throws SAXException {
+       if (href == null)
+-	error("missing_href_attribute");
++        error("missing_href_attribute");
+       else
+         href = resolve(href);
+     }
+@@ -1170,16 +1170,16 @@
+ 
+     void setOtherAttribute(String name, String value) throws SAXException {
+       if (name.equals("combine")) {
+-	value = value.trim();
+-	if (value.equals("choice"))
+-	  combine = GrammarSection.COMBINE_CHOICE;
+-	else if (value.equals("interleave"))
+-	  combine = GrammarSection.COMBINE_INTERLEAVE;
+-	else
+-	  error("combine_attribute_bad_value", value);
++        value = value.trim();
++        if (value.equals("choice"))
++          combine = GrammarSection.COMBINE_CHOICE;
++        else if (value.equals("interleave"))
++          combine = GrammarSection.COMBINE_INTERLEAVE;
++        else
++          error("combine_attribute_bad_value", value);
+       }
+       else
+-	super.setOtherAttribute(name, value);
++        super.setOtherAttribute(name, value);
+     }
+ 
+     ParsedPattern buildPattern(List<ParsedPattern> patterns, Location loc, Annotations anno) throws SAXException {
+@@ -1204,12 +1204,12 @@
+ 
+     void endAttributes() throws SAXException {
+       if (name == null)
+-	error("missing_name_attribute");
++        error("missing_name_attribute");
+     }
+ 
+     void sendPatternToParent(ParsedPattern p) {
+       if (name != null)
+-	section.define(name, combine, p, startLocation, annotations);
++        section.define(name, combine, p, startLocation, annotations);
+     }
+ 
+   }
+@@ -1231,7 +1231,7 @@
+     State createChildState(String localName) throws SAXException {
+       State tem = super.createChildState(localName);
+       if (tem != null && childPatterns!=null)
+-	error("start_multi_pattern");
++        error("start_multi_pattern");
+       return tem;
+     }
+ 
+@@ -1241,8 +1241,8 @@
+     State createChildState(String localName) throws SAXException {
+       State state = (State)nameClassTable.get(localName);
+       if (state == null) {
+-	error("expected_name_class", localName);
+-	return null;
++        error("expected_name_class", localName);
++        return null;
+       }
+       return state.create();
+     }
+@@ -1330,9 +1330,9 @@
+ 
+     State createChildState(String localName) throws SAXException {
+       if (localName.equals("except")) {
+-	if (except != null)
+-	  error("multiple_except");
+-	return new NameClassChoiceState(getContext());
++        if (except != null)
++          error("multiple_except");
++        return new NameClassChoiceState(getContext());
+       }
+       error("expected_except", localName);
+       return null;
+@@ -1344,9 +1344,9 @@
+ 
+     ParsedNameClass makeNameClass() {
+       if (except == null)
+-	return makeNameClassNoExcept();
++        return makeNameClassNoExcept();
+       else
+-	return makeNameClassExcept(except);
++        return makeNameClassExcept(except);
+     }
+ 
+     ParsedNameClass makeNameClassNoExcept() {
+@@ -1398,7 +1398,7 @@
+     void setParent(State parent) {
+       super.setParent(parent);
+       if (parent instanceof NameClassChoiceState)
+-	this.context = ((NameClassChoiceState)parent).context;
++        this.context = ((NameClassChoiceState)parent).context;
+     }
+ 
+     State create() {
+@@ -1407,18 +1407,18 @@
+ 
+     State createChildState(String localName) throws SAXException {
+       if (localName.equals("anyName")) {
+-	if (context >= ANY_NAME_CONTEXT) {
+-	  error(context == ANY_NAME_CONTEXT
+-		? "any_name_except_contains_any_name"
+-		: "ns_name_except_contains_any_name");
+-	  return null;
+-	}
++        if (context >= ANY_NAME_CONTEXT) {
++          error(context == ANY_NAME_CONTEXT
++                ? "any_name_except_contains_any_name"
++                : "ns_name_except_contains_any_name");
++          return null;
++        }
+       }
+       else if (localName.equals("nsName")) {
+-	if (context == NS_NAME_CONTEXT) {
+-	  error("ns_name_except_contains_ns_name");
+-	  return null;
+-	}
++        if (context == NS_NAME_CONTEXT) {
++          error("ns_name_except_contains_ns_name");
++          return null;
++        }
+       }
+       return super.createChildState(localName);
+     }
+@@ -1443,9 +1443,9 @@
+ 
+     void end() throws SAXException {
+       if (nNameClasses == 0) {
+-	error("missing_name_class");
+-	parent.endChild(nameClassBuilder.makeErrorNameClass());
+-	return;
++        error("missing_name_class");
++        parent.endChild(nameClassBuilder.makeErrorNameClass());
++        return;
+       }
+       if (comments != null) {
+         nameClasses[nNameClasses - 1] = nameClassBuilder.commentAfter(nameClasses[nNameClasses - 1], comments);
+@@ -1614,7 +1614,7 @@
+     String localName = checkNCName(name.substring(ic + 1));
+     for (PrefixMapping tem = context.prefixMapping; tem != null; tem = tem.next)
+       if (tem.prefix.equals(prefix))
+-	return nameClassBuilder.makeName(tem.uri, localName, prefix, null, anno);
++        return nameClassBuilder.makeName(tem.uri, localName, prefix, null, anno);
+     error("undefined_prefix", prefix);
+     return nameClassBuilder.makeName("", localName, null, null, anno);
+   }
+@@ -1652,8 +1652,8 @@
+     if (locator == null)
+       return null;
+     return schemaBuilder.makeLocation(locator.getSystemId(),
+-				      locator.getLineNumber(),
+-				      locator.getColumnNumber());
++                                      locator.getLineNumber(),
++                                      locator.getColumnNumber());
+   }
+ 
+   private void checkUri(String s) throws SAXException {
+--- old/src/share/classes/com/sun/xml/internal/rngom/util/Localizer.java	Thu Jul 30 18:17:58 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/rngom/util/Localizer.java	Thu Jul 30 18:17:58 2009
+@@ -39,11 +39,11 @@
+      * will be delegated to the parent.
+      */
+     private final Localizer parent;
+-    
++
+     public Localizer(Class cls) {
+         this(null,cls);
+     }
+-    
++
+     public Localizer(Localizer parent, Class cls) {
+         this.parent = parent;
+         this.cls = cls;
+@@ -60,7 +60,7 @@
+                 throw e;
+         }
+     }
+-    
++
+     public String message(String key) {
+         return MessageFormat.format(getString(key), new Object[]{});
+     }
+--- old/src/share/classes/com/sun/xml/internal/rngom/util/Uri.java	Thu Jul 30 18:18:02 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/rngom/util/Uri.java	Thu Jul 30 18:18:01 2009
+@@ -44,44 +44,44 @@
+     for (;;) {
+       int i = done;
+       for (;;) {
+-	if (i == len) {
+-	  if (done == 0)
+-	    return s;
+-	  break;
+-	}
+-	if (isExcluded(s.charAt(i)))
+-	  break;
+-	i++;
++        if (i == len) {
++          if (done == 0)
++            return s;
++          break;
++        }
++        if (isExcluded(s.charAt(i)))
++          break;
++        i++;
+       }
+       if (buf == null)
+-	buf = new StringBuffer();
++        buf = new StringBuffer();
+       if (i > done) {
+-	buf.append(s.substring(done, i));
+-	done = i;
++        buf.append(s.substring(done, i));
++        done = i;
+       }
+       if (i == len)
+-	break;
++        break;
+       for (i++; i < len && isExcluded(s.charAt(i)); i++)
+-	;
++        ;
+       String tem = s.substring(done, i);
+       byte[] bytes;
+       try {
+-	bytes = tem.getBytes(utf8);
++        bytes = tem.getBytes(utf8);
+       }
+       catch (UnsupportedEncodingException e) {
+-	utf8 = "UTF8";
+-	try {
+-	  bytes = tem.getBytes(utf8);
+-	}
+-	catch (UnsupportedEncodingException e2) {
+-	  // Give up
+-	  return s;
+-	}
++        utf8 = "UTF8";
++        try {
++          bytes = tem.getBytes(utf8);
++        }
++        catch (UnsupportedEncodingException e2) {
++          // Give up
++          return s;
++        }
+       }
+       for (int j = 0; j < bytes.length; j++) {
+-	buf.append('%');
+-	buf.append(HEX_DIGITS.charAt((bytes[j] & 0xFF) >> 4));
+-	buf.append(HEX_DIGITS.charAt(bytes[j] & 0xF));
++        buf.append('%');
++        buf.append(HEX_DIGITS.charAt((bytes[j] & 0xFF) >> 4));
++        buf.append(HEX_DIGITS.charAt(bytes[j] & 0xF));
+       }
+       done = i;
+     }
+@@ -105,7 +105,7 @@
+   private static boolean isDigit(char c) {
+     return '0' <= c && c <= '9';
+   }
+-  
++
+   private static boolean isSchemeChar(char c) {
+     return isAlpha(c) || isDigit(c) || c == '+' || c == '-' || c =='.';
+   }
+@@ -114,11 +114,11 @@
+     int len = s.length();
+     for (int i = 0; i < len; i++)
+       if (s.charAt(i) == '%') {
+-	if (i + 2 >= len)
+-	  return false;
+-	else if (!isHexDigit(s.charAt(i + 1))
+-		 || !isHexDigit(s.charAt(i + 2)))
+-	  return false;
++        if (i + 2 >= len)
++          return false;
++        else if (!isHexDigit(s.charAt(i + 1))
++                 || !isHexDigit(s.charAt(i + 2)))
++          return false;
+       }
+     return true;
+   }
+@@ -133,12 +133,12 @@
+       return true;
+     int i = s.indexOf(':');
+     if (i == 0
+-	|| i + 1 == s.length()
+-	|| !isAlpha(s.charAt(0)))
++        || i + 1 == s.length()
++        || !isAlpha(s.charAt(0)))
+       return false;
+     while (--i > 0)
+       if (!isSchemeChar(s.charAt(i)))
+-	return false;
++        return false;
+     return true;
+   }
+ 
+@@ -145,7 +145,7 @@
+   public static String resolve(String baseUri, String uriReference) {
+     if (!isAbsolute(uriReference) && baseUri != null && isAbsolute(baseUri)) {
+       try {
+-	return new URL(new URL(baseUri), uriReference).toString();
++        return new URL(new URL(baseUri), uriReference).toString();
+       }
+       catch (MalformedURLException e) { }
+     }
+@@ -165,7 +165,7 @@
+       case '#':
+       case '/':
+       case '?':
+-	return false;
++        return false;
+       }
+     }
+     return true;
+--- old/src/share/classes/com/sun/xml/internal/rngom/util/Utf16.java	Thu Jul 30 18:18:05 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/rngom/util/Utf16.java	Thu Jul 30 18:18:05 2009
+@@ -45,4 +45,3 @@
+     return (char)(((c - 0x10000) & 0x3FF) | 0xDC00);
+   }
+ }
+-
+--- old/src/share/classes/com/sun/xml/internal/rngom/xml/sax/JAXPXMLReaderCreator.java	Thu Jul 30 18:18:09 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/rngom/xml/sax/JAXPXMLReaderCreator.java	Thu Jul 30 18:18:08 2009
+@@ -33,7 +33,7 @@
+ /**
+  * {@link XMLReaderCreator} that uses JAXP to create
+  * {@link XMLReader}s.
+- * 
++ *
+  * @author
+  *      Kohsuke Kawaguchi (kk@kohsuke.org)
+  */
+@@ -40,11 +40,11 @@
+ public class JAXPXMLReaderCreator implements XMLReaderCreator {
+ 
+     private final SAXParserFactory spf;
+-    
++
+     public JAXPXMLReaderCreator( SAXParserFactory spf ) {
+         this.spf = spf;
+     }
+-    
++
+     /**
+      * Creates a {@link JAXPXMLReaderCreator} by using
+      * {@link SAXParserFactory#newInstance()}.
+@@ -53,7 +53,7 @@
+         spf = SAXParserFactory.newInstance();
+         spf.setNamespaceAware(true);
+     }
+-    
++
+     /**
+      * @see com.sun.xml.internal.rngom.xml.sax.XMLReaderCreator#createXMLReader()
+      */
+--- old/src/share/classes/com/sun/xml/internal/rngom/xml/sax/XmlBaseHandler.java	Thu Jul 30 18:18:12 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/rngom/xml/sax/XmlBaseHandler.java	Thu Jul 30 18:18:12 2009
+@@ -72,7 +72,7 @@
+ 
+   private static String getBaseUri1(String baseUri, Entry stack) {
+     if (stack == null
+-	|| (baseUri != null && !baseUri.equals(stack.systemId)))
++        || (baseUri != null && !baseUri.equals(stack.systemId)))
+       return baseUri;
+     baseUri = stack.attValue;
+     if (Uri.isAbsolute(baseUri))
+--- old/src/share/classes/com/sun/xml/internal/rngom/xml/util/EncodingMap.java	Thu Jul 30 18:18:16 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/rngom/xml/util/EncodingMap.java	Thu Jul 30 18:18:15 2009
+@@ -35,7 +35,7 @@
+     "US-ASCII", "ASCII",
+     "TIS-620", "TIS620"
+   };
+-      
++
+   static public String getJavaName(String enc) {
+     try {
+       "x".getBytes(enc);
+@@ -42,13 +42,13 @@
+     }
+     catch (UnsupportedEncodingException e) {
+       for (int i = 0; i < aliases.length; i += 2) {
+-	if (enc.equalsIgnoreCase(aliases[i])) {
+-	  try {
+-	    "x".getBytes(aliases[i + 1]);
+-	    return aliases[i + 1];
+-	  }
+-	  catch (UnsupportedEncodingException e2) {}
+-	}
++        if (enc.equalsIgnoreCase(aliases[i])) {
++          try {
++            "x".getBytes(aliases[i + 1]);
++            return aliases[i + 1];
++          }
++          catch (UnsupportedEncodingException e2) {}
++        }
+       }
+     }
+     return enc;
+@@ -58,4 +58,3 @@
+     System.err.println(getJavaName(args[0]));
+   }
+ }
+-  
+--- old/src/share/classes/com/sun/xml/internal/rngom/xml/util/Naming.java	Thu Jul 30 18:18:20 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/rngom/xml/util/Naming.java	Thu Jul 30 18:18:19 2009
+@@ -97,11 +97,11 @@
+       setCharType(nameStartSingles.charAt(i), CT_NMSTRT);
+     for (int i = 0; i < nameStartRanges.length(); i += 2)
+       setCharType(nameStartRanges.charAt(i), nameStartRanges.charAt(i + 1),
+-		  CT_NMSTRT);
++                  CT_NMSTRT);
+     byte[] other = new byte[256];
+     for (int i = 0; i < 256; i++)
+       if (charTypeTable[i] == null)
+-	charTypeTable[i] = other;
++        charTypeTable[i] = other;
+   }
+ 
+   private static void setCharType(char c, int type) {
+@@ -115,16 +115,16 @@
+     byte[] shared = null;
+     do {
+       if ((min & 0xFF) == 0) {
+-	for (; min + 0xFF <= max; min += 0x100) {
+-	  if (shared == null) {
+-	    shared = new byte[256];
+-	    for (int i = 0; i < 256; i++)
+-	      shared[i] = (byte)type;
+-	  }
+-	  charTypeTable[min >> 8] = shared;
+-	  if (min + 0xFF == max)
+-	    return;
+-	}
++        for (; min + 0xFF <= max; min += 0x100) {
++          if (shared == null) {
++            shared = new byte[256];
++            for (int i = 0; i < 256; i++)
++              shared[i] = (byte)type;
++          }
++          charTypeTable[min >> 8] = shared;
++          if (min + 0xFF == max)
++            return;
++        }
+       }
+       setCharType(min, type);
+     } while (min++ != max);
+--- old/src/share/classes/com/sun/xml/internal/stream/buffer/AbstractCreator.java	Thu Jul 30 18:18:23 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/AbstractCreator.java	Thu Jul 30 18:18:22 2009
+@@ -29,9 +29,9 @@
+  * and from infoset in API-specific form.
+  */
+ public class AbstractCreator extends AbstractCreatorProcessor {
+-    
++
+     protected MutableXMLStreamBuffer _buffer;
+-    
++
+     public void setXMLStreamBuffer(MutableXMLStreamBuffer buffer) {
+         if (buffer == null) {
+             throw new NullPointerException("buffer cannot be null");
+@@ -38,12 +38,12 @@
+         }
+         setBuffer(buffer);
+     }
+-    
++
+     public MutableXMLStreamBuffer getXMLStreamBuffer() {
+         return _buffer;
+     }
+-    
+-    
++
++
+     protected final void createBuffer() {
+         setBuffer(new MutableXMLStreamBuffer());
+     }
+@@ -57,7 +57,7 @@
+ 
+     protected final void setBuffer(MutableXMLStreamBuffer buffer) {
+         _buffer = buffer;
+-        
++
+         _currentStructureFragment = _buffer.getStructure();
+         _structure = _currentStructureFragment.getArray();
+         _structurePtr = 0;
+@@ -69,16 +69,16 @@
+         _currentContentCharactersBufferFragment = _buffer.getContentCharactersBuffer();
+         _contentCharactersBuffer = _currentContentCharactersBufferFragment.getArray();
+         _contentCharactersBufferPtr = 0;
+-        
++
+         _currentContentObjectFragment = _buffer.getContentObjects();
+         _contentObjects = _currentContentObjectFragment.getArray();
+         _contentObjectsPtr = 0;
+     }
+-    
++
+     protected final void setHasInternedStrings(boolean hasInternedStrings) {
+         _buffer.setHasInternedStrings(hasInternedStrings);
+     }
+-    
++
+     protected final void storeStructure(int b) {
+         _structure[_structurePtr++] = (byte)b;
+         if (_structurePtr == _structure.length) {
+@@ -85,7 +85,7 @@
+             resizeStructure();
+         }
+     }
+-    
++
+     protected final void resizeStructure() {
+         _structurePtr = 0;
+         if (_currentStructureFragment.getNext() != null) {
+@@ -96,7 +96,7 @@
+             _currentStructureFragment = new FragmentedArray(_structure, _currentStructureFragment);
+         }
+     }
+-    
++
+     protected final void storeStructureString(String s) {
+         _structureStrings[_structureStringsPtr++] = s;
+         if (_structureStringsPtr == _structureStrings.length) {
+@@ -103,7 +103,7 @@
+             resizeStructureStrings();
+         }
+     }
+-    
++
+     protected final void resizeStructureStrings() {
+         _structureStringsPtr = 0;
+         if (_currentStructureStringFragment.getNext() != null) {
+@@ -114,12 +114,12 @@
+             _currentStructureStringFragment = new FragmentedArray(_structureStrings, _currentStructureStringFragment);
+         }
+     }
+-    
++
+     protected final void storeContentString(String s) {
+         storeContentObject(s);
+     }
+-    
+-    protected final void storeContentCharacters(int type, char[] ch, int start, int length) {        
++
++    protected final void storeContentCharacters(int type, char[] ch, int start, int length) {
+         if (_contentCharactersBufferPtr + length >= _contentCharactersBuffer.length) {
+             if (length >= 512) {
+                 storeStructure(type | CONTENT_TYPE_CHAR_ARRAY_COPY);
+@@ -126,7 +126,7 @@
+                 storeContentCharactersCopy(ch, start, length);
+                 return;
+             }
+-            resizeContentCharacters();            
++            resizeContentCharacters();
+         }
+ 
+         if (length < CHAR_ARRAY_LENGTH_SMALL_SIZE) {
+@@ -139,13 +139,13 @@
+             storeStructure(length >> 8);
+             storeStructure(length & 255);
+             System.arraycopy(ch, start, _contentCharactersBuffer, _contentCharactersBufferPtr, length);
+-            _contentCharactersBufferPtr += length;        
++            _contentCharactersBufferPtr += length;
+         } else {
+             storeStructure(type | CONTENT_TYPE_CHAR_ARRAY_COPY);
+             storeContentCharactersCopy(ch, start, length);
+         }
+     }
+-    
++
+     protected final void resizeContentCharacters() {
+         _contentCharactersBufferPtr = 0;
+         if (_currentContentCharactersBufferFragment.getNext() != null) {
+@@ -153,11 +153,11 @@
+             _contentCharactersBuffer = _currentContentCharactersBufferFragment.getArray();
+         } else {
+             _contentCharactersBuffer = new char[_contentCharactersBuffer.length];
+-            _currentContentCharactersBufferFragment = new FragmentedArray(_contentCharactersBuffer, 
++            _currentContentCharactersBufferFragment = new FragmentedArray(_contentCharactersBuffer,
+                     _currentContentCharactersBufferFragment);
+         }
+     }
+-    
++
+     protected final void storeContentCharactersCopy(char[] ch, int start, int length) {
+         char[] copyOfCh = new char[length];
+         System.arraycopy(ch, start, copyOfCh, 0, length);
+@@ -167,7 +167,7 @@
+     protected final Object peekAtContentObject() {
+         return _contentObjects[_contentObjectsPtr];
+     }
+-    
++
+     protected final void storeContentObject(Object s) {
+         _contentObjects[_contentObjectsPtr++] = s;
+         if (_contentObjectsPtr == _contentObjects.length) {
+@@ -174,7 +174,7 @@
+             resizeContentObjects();
+         }
+     }
+-    
++
+     protected final void resizeContentObjects() {
+         _contentObjectsPtr = 0;
+         if (_currentContentObjectFragment.getNext() != null) {
+@@ -184,5 +184,5 @@
+             _contentObjects = new Object[_contentObjects.length];
+             _currentContentObjectFragment = new FragmentedArray(_contentObjects, _currentContentObjectFragment);
+         }
+-    }    
++    }
+ }
+--- old/src/share/classes/com/sun/xml/internal/stream/buffer/AbstractCreatorProcessor.java	Thu Jul 30 18:18:26 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/AbstractCreatorProcessor.java	Thu Jul 30 18:18:26 2009
+@@ -37,7 +37,7 @@
+     protected static final int FLAG_PREFIX                 = 1 << 0;
+     protected static final int FLAG_URI                    = 1 << 1;
+     protected static final int FLAG_QUALIFIED_NAME         = 1 << 2;
+-    
++
+     /*
+      * Types of content for T_TEXT and T_COMMENT
+      * <p>
+@@ -57,7 +57,7 @@
+     protected static final int CHAR_ARRAY_LENGTH_MEDIUM       = 1;
+     protected static final int CHAR_ARRAY_LENGTH_SMALL_SIZE   = 1 << 8;
+     protected static final int CHAR_ARRAY_LENGTH_MEDIUM_SIZE  = 1 << 16;
+-    
++
+     /*
+      * Types of value for T_ATTRIBUTE
+      * <p>
+@@ -88,16 +88,16 @@
+      * One octet is used.
+      */
+     protected static final int T_DOCUMENT_FRAGMENT           = T_DOCUMENT | FLAG_DOCUMENT_FRAGMENT;
+-    
++
+     protected static final int T_ELEMENT_U_LN_QN             = T_ELEMENT | FLAG_URI | FLAG_QUALIFIED_NAME;
+     protected static final int T_ELEMENT_P_U_LN              = T_ELEMENT | FLAG_PREFIX | FLAG_URI;
+     protected static final int T_ELEMENT_U_LN                = T_ELEMENT | FLAG_URI;
+     protected static final int T_ELEMENT_LN                  = T_ELEMENT;
+-    
++
+     protected static final int T_NAMESPACE_ATTRIBUTE_P       = T_NAMESPACE_ATTRIBUTE | FLAG_PREFIX;
+     protected static final int T_NAMESPACE_ATTRIBUTE_P_U     = T_NAMESPACE_ATTRIBUTE | FLAG_PREFIX | FLAG_URI;
+     protected static final int T_NAMESPACE_ATTRIBUTE_U       = T_NAMESPACE_ATTRIBUTE | FLAG_URI;
+-    
++
+     protected static final int T_ATTRIBUTE_U_LN_QN           = T_ATTRIBUTE | FLAG_URI | FLAG_QUALIFIED_NAME;
+     protected static final int T_ATTRIBUTE_P_U_LN            = T_ATTRIBUTE | FLAG_PREFIX | FLAG_URI;
+     protected static final int T_ATTRIBUTE_U_LN              = T_ATTRIBUTE | FLAG_URI;
+@@ -106,7 +106,7 @@
+     protected static final int T_ATTRIBUTE_P_U_LN_OBJECT     = T_ATTRIBUTE_P_U_LN | VALUE_TYPE_OBJECT;
+     protected static final int T_ATTRIBUTE_U_LN_OBJECT       = T_ATTRIBUTE_U_LN | VALUE_TYPE_OBJECT;
+     protected static final int T_ATTRIBUTE_LN_OBJECT         = T_ATTRIBUTE_LN | VALUE_TYPE_OBJECT;
+-    
++
+     protected static final int T_TEXT_AS_CHAR_ARRAY          = T_TEXT;
+     protected static final int T_TEXT_AS_CHAR_ARRAY_SMALL    = T_TEXT | CHAR_ARRAY_LENGTH_SMALL;
+     protected static final int T_TEXT_AS_CHAR_ARRAY_MEDIUM   = T_TEXT | CHAR_ARRAY_LENGTH_MEDIUM;
+@@ -113,28 +113,28 @@
+     protected static final int T_TEXT_AS_CHAR_ARRAY_COPY     = T_TEXT | CONTENT_TYPE_CHAR_ARRAY_COPY;
+     protected static final int T_TEXT_AS_STRING              = T_TEXT | CONTENT_TYPE_STRING;
+     protected static final int T_TEXT_AS_OBJECT              = T_TEXT | CONTENT_TYPE_OBJECT;
+-    
++
+     protected static final int T_COMMENT_AS_CHAR_ARRAY        = T_COMMENT;
+     protected static final int T_COMMENT_AS_CHAR_ARRAY_SMALL  = T_COMMENT | CHAR_ARRAY_LENGTH_SMALL;
+     protected static final int T_COMMENT_AS_CHAR_ARRAY_MEDIUM = T_COMMENT | CHAR_ARRAY_LENGTH_MEDIUM;
+     protected static final int T_COMMENT_AS_CHAR_ARRAY_COPY   = T_COMMENT | CONTENT_TYPE_CHAR_ARRAY_COPY;
+     protected static final int T_COMMENT_AS_STRING            = T_COMMENT | CONTENT_TYPE_STRING;
+-    
++
+     protected static final int T_END_OF_BUFFER               = -1;
+-    
++
+     protected FragmentedArray<byte[]> _currentStructureFragment;
+     protected byte[] _structure;
+     protected int _structurePtr;
+-    
++
+     protected FragmentedArray<String[]> _currentStructureStringFragment;
+     protected String[] _structureStrings;
+     protected int _structureStringsPtr;
+-    
++
+     protected FragmentedArray<char[]> _currentContentCharactersBufferFragment;
+     protected char[] _contentCharactersBuffer;
+-    protected int _contentCharactersBufferPtr;        
+-    
++    protected int _contentCharactersBufferPtr;
++
+     protected FragmentedArray<Object[]> _currentContentObjectFragment;
+     protected Object[] _contentObjects;
+-    protected int _contentObjectsPtr;        
++    protected int _contentObjectsPtr;
+ }
+--- old/src/share/classes/com/sun/xml/internal/stream/buffer/AbstractProcessor.java	Thu Jul 30 18:18:30 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/AbstractProcessor.java	Thu Jul 30 18:18:29 2009
+@@ -30,7 +30,7 @@
+  */
+ public abstract class AbstractProcessor extends AbstractCreatorProcessor {
+     protected  static final int STATE_ILLEGAL                       = 0;
+-    
++
+     protected  static final int STATE_DOCUMENT                      = 1;
+     protected  static final int STATE_DOCUMENT_FRAGMENT             = 2;
+     protected  static final int STATE_ELEMENT_U_LN_QN               = 3;
+@@ -48,14 +48,14 @@
+     protected  static final int STATE_COMMENT_AS_STRING             = 15;
+     protected  static final int STATE_PROCESSING_INSTRUCTION        = 16;
+     protected  static final int STATE_END                           = 17;
+-    protected  static final int[] _eiiStateTable = new int[256];
+-    
++    private  static final int[] _eiiStateTable = new int[256];
++
+     protected  static final int STATE_NAMESPACE_ATTRIBUTE           = 1;
+     protected  static final int STATE_NAMESPACE_ATTRIBUTE_P         = 2;
+     protected  static final int STATE_NAMESPACE_ATTRIBUTE_P_U       = 3;
+     protected  static final int STATE_NAMESPACE_ATTRIBUTE_U         = 4;
+-    protected  static final int[] _niiStateTable = new int[256];
+-    
++    private  static final int[] _niiStateTable = new int[256];
++
+     protected  static final int STATE_ATTRIBUTE_U_LN_QN             = 1;
+     protected  static final int STATE_ATTRIBUTE_P_U_LN              = 2;
+     protected  static final int STATE_ATTRIBUTE_U_LN                = 3;
+@@ -64,8 +64,8 @@
+     protected  static final int STATE_ATTRIBUTE_P_U_LN_OBJECT       = 6;
+     protected  static final int STATE_ATTRIBUTE_U_LN_OBJECT         = 7;
+     protected  static final int STATE_ATTRIBUTE_LN_OBJECT           = 8;
+-    protected  static final int[] _aiiStateTable = new int[256];
+-    
++    private  static final int[] _aiiStateTable = new int[256];
++
+     static {
+         /*
+          * Create a state table from information items and options.
+@@ -90,12 +90,12 @@
+         _eiiStateTable[T_COMMENT_AS_STRING] = STATE_COMMENT_AS_STRING;
+         _eiiStateTable[T_PROCESSING_INSTRUCTION] = STATE_PROCESSING_INSTRUCTION;
+         _eiiStateTable[T_END] = STATE_END;
+-        
++
+         _niiStateTable[T_NAMESPACE_ATTRIBUTE] = STATE_NAMESPACE_ATTRIBUTE;
+         _niiStateTable[T_NAMESPACE_ATTRIBUTE_P] = STATE_NAMESPACE_ATTRIBUTE_P;
+         _niiStateTable[T_NAMESPACE_ATTRIBUTE_P_U] = STATE_NAMESPACE_ATTRIBUTE_P_U;
+         _niiStateTable[T_NAMESPACE_ATTRIBUTE_U] = STATE_NAMESPACE_ATTRIBUTE_U;
+-        
++
+         _aiiStateTable[T_ATTRIBUTE_U_LN_QN] = STATE_ATTRIBUTE_U_LN_QN;
+         _aiiStateTable[T_ATTRIBUTE_P_U_LN] = STATE_ATTRIBUTE_P_U_LN;
+         _aiiStateTable[T_ATTRIBUTE_U_LN] = STATE_ATTRIBUTE_U_LN;
+@@ -105,7 +105,7 @@
+         _aiiStateTable[T_ATTRIBUTE_U_LN_OBJECT] = STATE_ATTRIBUTE_U_LN_OBJECT;
+         _aiiStateTable[T_ATTRIBUTE_LN_OBJECT] = STATE_ATTRIBUTE_LN_OBJECT;
+     }
+-    
++
+     protected XMLStreamBuffer _buffer;
+ 
+     /**
+@@ -112,7 +112,7 @@
+      * True if this processor should create a fragment of XML, without the start/end document markers.
+      */
+     protected boolean _fragmentMode;
+-        
++
+     protected boolean _stringInterningFeature = false;
+ 
+     /**
+@@ -131,7 +131,7 @@
+     protected final void setBuffer(XMLStreamBuffer buffer, boolean fragmentMode) {
+         _buffer = buffer;
+         _fragmentMode = fragmentMode;
+-        
++
+         _currentStructureFragment = _buffer.getStructure();
+         _structure = _currentStructureFragment.getArray();
+         _structurePtr = _buffer.getStructurePtr();
+@@ -139,27 +139,27 @@
+         _currentStructureStringFragment = _buffer.getStructureStrings();
+         _structureStrings = _currentStructureStringFragment.getArray();
+         _structureStringsPtr = _buffer.getStructureStringsPtr();
+-        
++
+         _currentContentCharactersBufferFragment = _buffer.getContentCharactersBuffer();
+         _contentCharactersBuffer = _currentContentCharactersBufferFragment.getArray();
+         _contentCharactersBufferPtr = _buffer.getContentCharactersBufferPtr();
+-        
++
+         _currentContentObjectFragment = _buffer.getContentObjects();
+         _contentObjects = _currentContentObjectFragment.getArray();
+         _contentObjectsPtr = _buffer.getContentObjectsPtr();
+-        
++
+         _stringInterningFeature = _buffer.hasInternedStrings();
+         _treeCount = _buffer.treeCount;
+     }
+-    
++
+     protected final int peekStructure() {
+         if (_structurePtr < _structure.length) {
+             return _structure[_structurePtr] & 255;
+         }
+-        
++
+         return readFromNextStructure(0);
+     }
+-    
++
+     protected final int readStructure() {
+         if (_structurePtr < _structure.length) {
+             return _structure[_structurePtr++] & 255;
+@@ -172,10 +172,22 @@
+         return _eiiStateTable[readStructure()];
+     }
+ 
++    protected static int getEIIState(int item) {
++        return _eiiStateTable[item];
++    }
++
++    protected static int getNIIState(int item) {
++        return _niiStateTable[item];
++    }
++
++    protected static int getAIIState(int item) {
++        return _aiiStateTable[item];
++    }
++
+     protected final int readStructure16() {
+         return (readStructure() << 8) | readStructure();
+     }
+-    
++
+     private int readFromNextStructure(int v) {
+         _structurePtr = v;
+         _currentStructureFragment = _currentStructureFragment.getNext();
+@@ -182,26 +194,26 @@
+         _structure = _currentStructureFragment.getArray();
+         return _structure[0] & 255;
+     }
+-    
++
+     protected final String readStructureString() {
+         if (_structureStringsPtr < _structureStrings.length) {
+             return _structureStrings[_structureStringsPtr++];
+         }
+-        
++
+         _structureStringsPtr = 1;
+         _currentStructureStringFragment = _currentStructureStringFragment.getNext();
+         _structureStrings = _currentStructureStringFragment.getArray();
+         return _structureStrings[0];
+     }
+-    
++
+     protected final String readContentString() {
+         return (String)readContentObject();
+     }
+-    
++
+     protected final char[] readContentCharactersCopy() {
+         return (char[])readContentObject();
+     }
+-    
++
+     protected final int readContentCharactersBuffer(int length) {
+         if (_contentCharactersBufferPtr + length < _contentCharactersBuffer.length) {
+             final int start = _contentCharactersBufferPtr;
+@@ -214,27 +226,27 @@
+         _contentCharactersBuffer = _currentContentCharactersBufferFragment.getArray();
+         return 0;
+     }
+-    
++
+     protected final Object readContentObject() {
+         if (_contentObjectsPtr < _contentObjects.length) {
+             return _contentObjects[_contentObjectsPtr++];
+         }
+-        
++
+         _contentObjectsPtr = 1;
+         _currentContentObjectFragment = _currentContentObjectFragment.getNext();
+         _contentObjects = _currentContentObjectFragment.getArray();
+         return _contentObjects[0];
+     }
+-    
++
+     protected final StringBuilder _qNameBuffer = new StringBuilder();
+-    
++
+     protected final String getQName(String prefix, String localName) {
+         _qNameBuffer.append(prefix).append(':').append(localName);
+         final String qName = _qNameBuffer.toString();
+         _qNameBuffer.setLength(0);
+         return (_stringInterningFeature) ? qName.intern() : qName;
+-    }        
+-   
++    }
++
+     protected final String getPrefixFromQName(String qName) {
+         int pIndex = qName.indexOf(':');
+         if (_stringInterningFeature) {
+--- old/src/share/classes/com/sun/xml/internal/stream/buffer/AttributesHolder.java	Thu Jul 30 18:18:34 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/AttributesHolder.java	Thu Jul 30 18:18:33 2009
+@@ -136,7 +136,7 @@
+ 
+ 
+     /**
+-     * Add an attribute using a qualified name that contains the 
++     * Add an attribute using a qualified name that contains the
+      * prefix and local name.
+      *
+      * @param uri
+--- old/src/share/classes/com/sun/xml/internal/stream/buffer/FragmentedArray.java	Thu Jul 30 18:18:37 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/FragmentedArray.java	Thu Jul 30 18:18:36 2009
+@@ -28,11 +28,11 @@
+     protected T _item;
+     protected FragmentedArray<T> _next;
+     protected FragmentedArray<T> _previous;
+-    
++
+     FragmentedArray(T item) {
+         this(item, null);
+     }
+-    
++
+     FragmentedArray(T item, FragmentedArray<T> previous) {
+         setArray(item);
+         if (previous != null) {
+@@ -40,21 +40,21 @@
+             _previous = previous;
+         }
+     }
+-    
++
+     T getArray() {
+         return _item;
+     }
+-    
++
+     void setArray(T item) {
+         assert(item.getClass().isArray());
+-        
++
+         _item = item;
+     }
+-    
++
+     FragmentedArray<T> getNext() {
+         return _next;
+     }
+-    
++
+     void setNext(FragmentedArray<T> next) {
+         _next = next;
+         if (next != null) {
+@@ -61,11 +61,11 @@
+             next._previous = this;
+         }
+     }
+-    
++
+     FragmentedArray<T> getPrevious() {
+         return _previous;
+     }
+-    
++
+     void setPrevious(FragmentedArray<T> previous) {
+         _previous = previous;
+         if (previous != null) {
+--- old/src/share/classes/com/sun/xml/internal/stream/buffer/MutableXMLStreamBuffer.java	Thu Jul 30 18:18:41 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/MutableXMLStreamBuffer.java	Thu Jul 30 18:18:40 2009
+@@ -39,38 +39,38 @@
+ import java.io.InputStream;
+ 
+ /**
+- * 
++ *
+  * A mutable stream-based buffer of an XML infoset.
+- * 
++ *
+  * <p>
+- * A MutableXMLStreamBuffer is created using specific SAX and StAX-based 
+- * creators. Utility methods on MutableXMLStreamBuffer are provided for 
++ * A MutableXMLStreamBuffer is created using specific SAX and StAX-based
++ * creators. Utility methods on MutableXMLStreamBuffer are provided for
+  * such functionality that utilize SAX and StAX-based creators.
+- * 
++ *
+  * <p>
+  * Once instantiated the same instance of a MutableXMLStreamBuffer may be reused for
+  * creation to reduce the amount of Objects instantiated and garbage
+  * collected that are required for internally representing an XML infoset.
+- * 
++ *
+  * <p>
+- * A MutableXMLStreamBuffer is not designed to be created and processed 
++ * A MutableXMLStreamBuffer is not designed to be created and processed
+  * concurrently. If done so unspecified behaviour may occur.
+  */
+ public class MutableXMLStreamBuffer extends XMLStreamBuffer {
+     /**
+-     * The default array size for the arrays used in internal representation 
++     * The default array size for the arrays used in internal representation
+      * of the XML infoset.
+      */
+-    public static int DEFAULT_ARRAY_SIZE = 512;
+-    
++    public static final int DEFAULT_ARRAY_SIZE = 512;
++
+     /**
+-     * Create a new MutableXMLStreamBuffer using the 
++     * Create a new MutableXMLStreamBuffer using the
+      * {@link MutableXMLStreamBuffer#DEFAULT_ARRAY_SIZE}.
+      */
+     public MutableXMLStreamBuffer() {
+         this(DEFAULT_ARRAY_SIZE);
+     }
+-    
++
+     /**
+      * Set the system identifier for this buffer.
+      * @param systemId The system identifier.
+@@ -78,12 +78,12 @@
+     public void setSystemId(String systemId) {
+         this.systemId = systemId;
+     }
+-    
++
+     /**
+      * Create a new MutableXMLStreamBuffer.
+-     * 
++     *
+      * @param size
+-     * The size of the arrays used in the internal representation 
++     * The size of the arrays used in the internal representation
+      * of the XML infoset.
+      * @throws NegativeArraySizeException
+      * If the <code>size</code> argument is less than <code>0</code>.
+@@ -101,14 +101,14 @@
+ 
+     /**
+      * Create contents of a buffer from a XMLStreamReader.
+-     * 
++     *
+      * <p>
+      * The MutableXMLStreamBuffer is reset (see {@link #reset}) before creation.
+-     * 
++     *
+      * <p>
+      * The MutableXMLStreamBuffer is created by consuming the events on the XMLStreamReader using
+      * an instance of {@link StreamReaderBufferCreator}.
+-     * 
++     *
+      * @param reader
+      * A XMLStreamReader to read from to create.
+      */
+@@ -120,10 +120,10 @@
+ 
+     /**
+      * Create contents of a buffer from a XMLStreamWriter.
+-     * 
++     *
+      * <p>
+      * The MutableXMLStreamBuffer is reset (see {@link #reset}) before creation.
+-     * 
++     *
+      * <p>
+      * The MutableXMLStreamBuffer is created by consuming events on a XMLStreamWriter using
+      * an instance of {@link StreamWriterBufferCreator}.
+@@ -135,14 +135,14 @@
+ 
+     /**
+      * Create contents of a buffer from a {@link SAXBufferCreator}.
+-     * 
++     *
+      * <p>
+      * The MutableXMLStreamBuffer is reset (see {@link #reset}) before creation.
+-     * 
++     *
+      * <p>
+      * The MutableXMLStreamBuffer is created by consuming events from a {@link ContentHandler} using
+      * an instance of {@link SAXBufferCreator}.
+-     * 
++     *
+      * @return The {@link SAXBufferCreator} to create from.
+      */
+     public SAXBufferCreator createFromSAXBufferCreator() {
+@@ -154,14 +154,14 @@
+ 
+     /**
+      * Create contents of a buffer from a {@link XMLReader} and {@link InputStream}.
+-     * 
++     *
+      * <p>
+      * The MutableXMLStreamBuffer is reset (see {@link #reset}) before creation.
+-     * 
++     *
+      * <p>
+      * The MutableXMLStreamBuffer is created by using an instance of {@link SAXBufferCreator}
+      * and registering associated handlers on the {@link XMLReader}.
+-     * 
++     *
+      * @param reader
+      * The {@link XMLReader} to use for parsing.
+      * @param in
+@@ -173,14 +173,14 @@
+ 
+     /**
+      * Create contents of a buffer from a {@link XMLReader} and {@link InputStream}.
+-     * 
++     *
+      * <p>
+      * The MutableXMLStreamBuffer is reset (see {@link #reset}) before creation.
+-     * 
++     *
+      * <p>
+      * The MutableXMLStreamBuffer is created by using an instance of {@link SAXBufferCreator}
+      * and registering associated handlers on the {@link XMLReader}.
+-     * 
++     *
+      * @param reader
+      * The {@link XMLReader} to use for parsing.
+      * @param in
+@@ -198,14 +198,14 @@
+ 
+         c.create(reader, in, systemId);
+     }
+-    
++
+     /**
+      * Reset the MutableXMLStreamBuffer.
+-     * 
++     *
+      * <p>
+      * This method will reset the MutableXMLStreamBuffer to a state of being "uncreated"
+      * similar to the state of a newly instantiated MutableXMLStreamBuffer.
+-     * 
++     *
+      * <p>
+      * As many Objects as possible will be retained for reuse in future creation.
+      */
+@@ -213,7 +213,7 @@
+         // Reset the ptrs in arrays to 0
+         _structurePtr =
+                 _structureStringsPtr =
+-                _contentCharactersBufferPtr = 
++                _contentCharactersBufferPtr =
+                 _contentObjectsPtr = 0;
+ 
+         // Set the first element of structure array to indicate an empty buffer
+@@ -232,14 +232,14 @@
+         }
+ 
+         treeCount = 0;
+-        
++
+         /*
+          * TODO consider truncating the size of _structureStrings and
+          * _contentCharactersBuffer to limit the memory used by the buffer
+          */
+     }
+-    
+-    
++
++
+     protected void setHasInternedStrings(boolean hasInternedStrings) {
+         _hasInternedStrings = hasInternedStrings;
+     }
+--- old/src/share/classes/com/sun/xml/internal/stream/buffer/XMLStreamBuffer.java	Thu Jul 30 18:18:44 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/XMLStreamBuffer.java	Thu Jul 30 18:18:44 2009
+@@ -49,28 +49,28 @@
+ 
+ /**
+  * An immutable stream-based buffer of an XML infoset.
+- * 
++ *
+  * <p>
+- * A XMLStreamBuffer is an abstract class. It is immutable with 
++ * A XMLStreamBuffer is an abstract class. It is immutable with
+  * respect to the methods on the class, which are non-modifying in terms
+  * of state.
+- * 
++ *
+  * <p>
+- * A XMLStreamBuffer can be processed using specific SAX and StAX-based 
+- * processors. Utility methods on XMLStreamBuffer are provided for 
++ * A XMLStreamBuffer can be processed using specific SAX and StAX-based
++ * processors. Utility methods on XMLStreamBuffer are provided for
+  * such functionality that utilize SAX and StAX-based processors.
+- * The same instance of a XMLStreamBuffer may be processed 
++ * The same instance of a XMLStreamBuffer may be processed
+  * multiple times and concurrently by more than one processor.
+- * 
++ *
+  * <p>
+  * There are two concrete implementations of XMLStreamBuffer.
+  * The first, {@link MutableXMLStreamBuffer}, can be instantiated for the creation
+- * of a buffer using SAX and StAX-based creators, and from which may be 
++ * of a buffer using SAX and StAX-based creators, and from which may be
+  * processed as an XMLStreamBuffer. The second,
+  * {@link XMLStreamBufferMark}, can be instantiated to mark into an existing
+  * buffer that is being created or processed. This allows a subtree of
+  * {@link XMLStreamBuffer} to be treated as its own {@link XMLStreamBuffer}.
+- * 
++ *
+  * <p>
+  * A XMLStreamBuffer can represent a complete XML infoset or a subtree
+  * of an XML infoset. It is also capable of representing a "forest",
+@@ -133,7 +133,7 @@
+      * The system identifier associated with the buffer
+      */
+     protected String systemId;
+-    
++
+     /**
+      * Is the buffer created by creator.
+      *
+@@ -184,7 +184,7 @@
+     public final String getSystemId() {
+         return systemId;
+     }
+-    
++
+     /**
+      * Get the in-scope namespaces.
+      *
+@@ -252,7 +252,7 @@
+      * @param writeAsFragment
+      *      If true, {@link XMLStreamWriter} will not receive {@link XMLStreamWriter#writeStartDocument()}
+      *      nor {@link XMLStreamWriter#writeEndDocument()}. This is desirable behavior when
+-     *      you are writing the contents of a buffer into a bigger document. 
++     *      you are writing the contents of a buffer into a bigger document.
+      */
+     public final void writeToXMLStreamWriter(XMLStreamWriter writer, boolean writeAsFragment) throws XMLStreamException {
+         StreamWriterBufferProcessor p = new StreamWriterBufferProcessor(this,writeAsFragment);
+@@ -273,7 +273,7 @@
+      * @return
+      * A an instance of a {@link SAXBufferProcessor}.
+      * @deprecated
+-     *      Use {@link #readAsXMLReader(boolean)} 
++     *      Use {@link #readAsXMLReader(boolean)}
+      */
+     public final SAXBufferProcessor readAsXMLReader() {
+         return new SAXBufferProcessor(this,isFragment());
+@@ -366,7 +366,7 @@
+     }
+ 
+     public final void writeTo(ContentHandler handler, ErrorHandler errorHandler) throws SAXException {
+-        writeTo(handler, errorHandler, isFragment());        
++        writeTo(handler, errorHandler, isFragment());
+     }
+ 
+     private static final TransformerFactory trnsformerFactory = TransformerFactory.newInstance();
+@@ -391,7 +391,7 @@
+ 
+     /**
+      * Create a new buffer from a XMLStreamReader.
+-     * 
++     *
+      * @param reader
+      * A XMLStreamReader to read from to create.
+      * @return XMLStreamBuffer the created buffer
+@@ -406,7 +406,7 @@
+ 
+     /**
+      * Create a new buffer from a {@link XMLReader} and {@link InputStream}.
+-     * 
++     *
+      * @param reader
+      * The {@link XMLReader} to use for parsing.
+      * @param in
+--- old/src/share/classes/com/sun/xml/internal/stream/buffer/XMLStreamBufferException.java	Thu Jul 30 18:18:48 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/XMLStreamBufferException.java	Thu Jul 30 18:18:47 2009
+@@ -25,11 +25,11 @@
+ package com.sun.xml.internal.stream.buffer;
+ 
+ public class XMLStreamBufferException extends Exception {
+-    
++
+     public XMLStreamBufferException(String message) {
+         super(message);
+     }
+-    
++
+     public XMLStreamBufferException(String message, Exception e) {
+         super(message, e);
+     }
+--- old/src/share/classes/com/sun/xml/internal/stream/buffer/XMLStreamBufferMark.java	Thu Jul 30 18:18:51 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/XMLStreamBufferMark.java	Thu Jul 30 18:18:51 2009
+@@ -28,25 +28,25 @@
+ 
+ /**
+  * A mark into a buffer.
+- * 
++ *
+  * <p>
+  * A mark can be processed in the same manner as a XMLStreamBuffer.
+- * 
++ *
+  * <p>
+  * A mark will share a sub set of information of the buffer that is
+  * marked. If the buffer is directly or indirectly associated with a
+  * (mutable) {@link XMLStreamBuffer} which is reset and/or re-created
+- * then this will invalidate the mark and processing behvaiour of the mark 
++ * then this will invalidate the mark and processing behvaiour of the mark
+  * is undefined. It is the responsibility of the application to manage the
+  * relationship between the marked XMLStreamBuffer and one or more marks.
+  */
+ public class XMLStreamBufferMark extends XMLStreamBuffer {
+-    
++
+     /**
+      * Create a mark from the buffer that is being created.
+      *
+      * <p>
+-     * A mark will be created from the current position of creation of the 
++     * A mark will be created from the current position of creation of the
+      * {@link XMLStreamBuffer} that is being created by a {@link AbstractCreator}.
+      *
+      * @param inscopeNamespaces
+@@ -59,16 +59,16 @@
+      */
+     public XMLStreamBufferMark(Map<String,String> inscopeNamespaces, AbstractCreatorProcessor src) {
+         _inscopeNamespaces = inscopeNamespaces;
+-        
++
+         _structure = src._currentStructureFragment;
+         _structurePtr = src._structurePtr;
+-        
++
+         _structureStrings = src._currentStructureStringFragment;
+         _structureStringsPtr = src._structureStringsPtr;
+-        
++
+         _contentCharactersBuffer = src._currentContentCharactersBufferFragment;
+         _contentCharactersBufferPtr = src._contentCharactersBufferPtr;
+-        
++
+         _contentObjects = src._currentContentObjectFragment;
+         _contentObjectsPtr = src._contentObjectsPtr;
+         treeCount = 1; // TODO: define a way to create a mark over a forest
+--- old/src/share/classes/com/sun/xml/internal/stream/buffer/XMLStreamBufferResult.java	Thu Jul 30 18:18:55 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/XMLStreamBufferResult.java	Thu Jul 30 18:18:54 2009
+@@ -34,9 +34,9 @@
+  * {@link MutableXMLStreamBuffer} for use by applications that expect a Result.
+  *
+  * <p>
+- * Reuse of a XMLStreamBufferResult more than once will require that the 
++ * Reuse of a XMLStreamBufferResult more than once will require that the
+  * MutableXMLStreamBuffer is reset by called
+- * {@link #.getXMLStreamBuffer()}.reset(), or by calling 
++ * {@link #.getXMLStreamBuffer()}.reset(), or by calling
+  * {@link #.setXMLStreamBuffer()} with a new instance of
+  * {@link MutableXMLStreamBuffer}.
+  *
+@@ -43,7 +43,7 @@
+  * <p>
+  * The derivation of XMLStreamBufferResult from SAXResult is an implementation
+  * detail.
+- *  
++ *
+  * <p>General applications shall not call the following methods:
+  * <ul>
+  * <li>setHandler</li>
+@@ -54,7 +54,7 @@
+ public class XMLStreamBufferResult extends SAXResult {
+     protected MutableXMLStreamBuffer _buffer;
+     protected SAXBufferCreator _bufferCreator;
+-    
++
+     /**
+      * The default XMLStreamBufferResult constructor.
+      *
+@@ -64,7 +64,7 @@
+     public XMLStreamBufferResult() {
+         setXMLStreamBuffer(new MutableXMLStreamBuffer());
+     }
+-    
++
+     /**
+      * XMLStreamBufferResult constructor.
+      *
+@@ -73,7 +73,7 @@
+     public XMLStreamBufferResult(MutableXMLStreamBuffer buffer) {
+         setXMLStreamBuffer(buffer);
+     }
+-    
++
+     /**
+      * Get the {@link MutableXMLStreamBuffer} that is used.
+      *
+@@ -81,8 +81,8 @@
+      */
+     public MutableXMLStreamBuffer getXMLStreamBuffer() {
+         return _buffer;
+-    }    
+-    
++    }
++
+     /**
+      * Set the {@link MutableXMLStreamBuffer} to use.
+      *
+@@ -94,24 +94,24 @@
+         }
+         _buffer = buffer;
+         setSystemId(_buffer.getSystemId());
+-        
++
+         if (_bufferCreator != null) {
+             _bufferCreator.setXMLStreamBuffer(_buffer);
+         }
+-    }    
++    }
+ 
+     public ContentHandler getHandler() {
+         if (_bufferCreator == null) {
+             _bufferCreator = new SAXBufferCreator(_buffer);
+             setHandler(_bufferCreator);
+-        } else if (super.getHandler() == null) {            
++        } else if (super.getHandler() == null) {
+             setHandler(_bufferCreator);
+         }
+-        
+-        return _bufferCreator;        
++
++        return _bufferCreator;
+     }
+-    
++
+     public LexicalHandler getLexicalHandler() {
+         return (LexicalHandler) getHandler();
+-    }    
++    }
+ }
+--- old/src/share/classes/com/sun/xml/internal/stream/buffer/XMLStreamBufferSource.java	Thu Jul 30 18:18:58 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/XMLStreamBufferSource.java	Thu Jul 30 18:18:58 2009
+@@ -44,8 +44,8 @@
+  * <li>The XMLReader object obtained by the getXMLReader method shall
+  *     be used only for parsing the InputSource object returned by
+  *     the getInputSource method.</li>
+- * <li>The InputSource object obtained by the getInputSource method shall 
+- *     be used only for being parsed by the XMLReader object returned by 
++ * <li>The InputSource object obtained by the getInputSource method shall
++ *     be used only for being parsed by the XMLReader object returned by
+  *     the getXMLReader method.</li>
+  * </ul>
+  */
+@@ -52,7 +52,7 @@
+ public class XMLStreamBufferSource extends SAXSource {
+     protected XMLStreamBuffer _buffer;
+     protected SAXBufferProcessor _bufferProcessor;
+-   
++
+     /**
+      * XMLStreamBufferSource constructor.
+      *
+@@ -72,7 +72,7 @@
+     public XMLStreamBuffer getXMLStreamBuffer() {
+         return _buffer;
+     }
+-    
++
+     /**
+      * Set the {@link XMLStreamBuffer} to use.
+      *
+@@ -81,14 +81,14 @@
+     public void setXMLStreamBuffer(XMLStreamBuffer buffer) {
+         if (buffer == null) {
+             throw new NullPointerException("buffer cannot be null");
+-        }        
++        }
+         _buffer = buffer;
+-        
++
+         if (_bufferProcessor != null) {
+             _bufferProcessor.setBuffer(_buffer,false);
+         }
+     }
+-    
++
+     public XMLReader getXMLReader() {
+         if (_bufferProcessor == null) {
+             _bufferProcessor = new SAXBufferProcessor(_buffer,false);
+@@ -98,5 +98,5 @@
+         }
+ 
+         return _bufferProcessor;
+-    }        
++    }
+ }
+--- old/src/share/classes/com/sun/xml/internal/stream/buffer/sax/DefaultWithLexicalHandler.java	Thu Jul 30 18:19:02 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/sax/DefaultWithLexicalHandler.java	Thu Jul 30 18:19:01 2009
+@@ -29,19 +29,19 @@
+ import org.xml.sax.helpers.DefaultHandler;
+ 
+ public class DefaultWithLexicalHandler extends DefaultHandler implements LexicalHandler {
+-    
++
+     public void comment(char[] ch, int start, int length) throws SAXException { }
+-    
++
+     public void startDTD(String name, String publicId, String systemId) throws SAXException { }
+-    
++
+     public void endDTD() throws SAXException { }
+-    
++
+     public void startEntity(String name) throws SAXException { }
+-    
++
+     public void endEntity(String name) throws SAXException { }
+-    
++
+     public void startCDATA() throws SAXException { }
+-    
++
+     public void endCDATA() throws SAXException { }
+-    
++
+ }
+--- old/src/share/classes/com/sun/xml/internal/stream/buffer/sax/Features.java	Thu Jul 30 18:19:05 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/sax/Features.java	Thu Jul 30 18:19:05 2009
+@@ -22,20 +22,20 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+- 
+ 
+ 
++
+ package com.sun.xml.internal.stream.buffer.sax;
+ 
+ public class Features {
+     public static final String NAMESPACES_FEATURE =
+         "http://xml.org/sax/features/namespaces";
+-    public static final String NAMESPACE_PREFIXES_FEATURE = 
++    public static final String NAMESPACE_PREFIXES_FEATURE =
+         "http://xml.org/sax/features/namespace-prefixes";
+-    public static final String EXTERNAL_GENERAL_ENTITIES = 
++    public static final String EXTERNAL_GENERAL_ENTITIES =
+         "http://xml.org/sax/features/external-general-entities";
+-    public static final String EXTERNAL_PARAMETER_ENTITIES = 
++    public static final String EXTERNAL_PARAMETER_ENTITIES =
+         "http://xml.org/sax/features/external-parameter-entities";
+-    public static final String STRING_INTERNING_FEATURE = 
++    public static final String STRING_INTERNING_FEATURE =
+         "http://xml.org/sax/features/string-interning";
+ }
+--- old/src/share/classes/com/sun/xml/internal/stream/buffer/sax/Properties.java	Thu Jul 30 18:19:09 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/sax/Properties.java	Thu Jul 30 18:19:08 2009
+@@ -22,9 +22,9 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+- 
+ 
+ 
++
+ package com.sun.xml.internal.stream.buffer.sax;
+ 
+ public class Properties {
+@@ -31,4 +31,3 @@
+     public static final String LEXICAL_HANDLER_PROPERTY =
+             "http://xml.org/sax/properties/lexical-handler";
+ }
+-
+--- old/src/share/classes/com/sun/xml/internal/stream/buffer/sax/SAXBufferCreator.java	Thu Jul 30 18:19:12 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/sax/SAXBufferCreator.java	Thu Jul 30 18:19:11 2009
+@@ -42,32 +42,32 @@
+ 
+ /**
+  * Writes into {@link MutableXMLStreamBuffer} from SAX.
+- * 
++ *
+  * TODO
+  * Implement the marking the stream on the element when an ID
+  * attribute on the element is defined
+  */
+-public class SAXBufferCreator extends AbstractCreator 
++public class SAXBufferCreator extends AbstractCreator
+         implements EntityResolver, DTDHandler, ContentHandler, ErrorHandler, LexicalHandler {
+     protected String[] _namespaceAttributes;
+-    
++
+     protected int _namespaceAttributesPtr;
+ 
+     private int depth = 0;
+-    
++
+     public SAXBufferCreator() {
+-        _namespaceAttributes = new String[16 * 2];        
++        _namespaceAttributes = new String[16 * 2];
+     }
+-    
++
+     public SAXBufferCreator(MutableXMLStreamBuffer buffer) {
+         this();
+         setBuffer(buffer);
+     }
+-    
++
+     public MutableXMLStreamBuffer create(XMLReader reader, InputStream in) throws IOException, SAXException {
+         return create(reader, in, null);
+     }
+-    
++
+     public MutableXMLStreamBuffer create(XMLReader reader, InputStream in, String systemId) throws IOException, SAXException {
+         if (_buffer == null) {
+             createBuffer();
+@@ -75,13 +75,13 @@
+         _buffer.setSystemId(systemId);
+         reader.setContentHandler(this);
+         reader.setProperty(Properties.LEXICAL_HANDLER_PROPERTY, this);
+-        
++
+         try {
+             setHasInternedStrings(reader.getFeature(Features.STRING_INTERNING_FEATURE));
+         } catch (SAXException e) {
+         }
+-        
+-        
++
++
+         if (systemId != null) {
+             InputSource s = new InputSource(systemId);
+             s.setByteStream(in);
+@@ -92,34 +92,34 @@
+ 
+         return getXMLStreamBuffer();
+     }
+-    
++
+     public void reset() {
+         _buffer = null;
+         _namespaceAttributesPtr = 0;
+         depth=0;
+     }
+-    
++
+     public void startDocument() throws SAXException {
+         storeStructure(T_DOCUMENT);
+     }
+-    
++
+     public void endDocument() throws SAXException {
+         storeStructure(T_END);
+     }
+-        
++
+     public void startPrefixMapping(String prefix, String uri) throws SAXException {
+         cacheNamespaceAttribute(prefix, uri);
+     }
+-    
++
+     public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
+         storeQualifiedName(T_ELEMENT_LN,
+                 uri, localName, qName);
+-        
++
+         // Has namespaces attributes
+         if (_namespaceAttributesPtr > 0) {
+             storeNamespaceAttributes();
+         }
+-        
++
+         // Has attributes
+         if (attributes.getLength() > 0) {
+             storeAttributes(attributes);
+@@ -126,39 +126,39 @@
+         }
+         depth++;
+     }
+-        
++
+     public void endElement(String uri, String localName, String qName) throws SAXException {
+         storeStructure(T_END);
+         if(--depth==0)
+             increaseTreeCount();    // one tree processed
+     }
+-    
++
+     public void characters(char ch[], int start, int length) throws SAXException {
+         storeContentCharacters(T_TEXT_AS_CHAR_ARRAY, ch, start, length);
+     }
+-    
++
+     public void ignorableWhitespace(char ch[], int start, int length) throws SAXException {
+         characters(ch, start, length);
+     }
+-    
++
+     public void processingInstruction(String target, String data) throws SAXException {
+         storeStructure(T_PROCESSING_INSTRUCTION);
+         storeStructureString(target);
+         storeStructureString(data);
+     }
+-            
++
+     public void comment(char[] ch, int start, int length) throws SAXException {
+         storeContentCharacters(T_COMMENT_AS_CHAR_ARRAY, ch, start, length);
+     }
+-    
++
+     //
+-        
++
+     private void cacheNamespaceAttribute(String prefix, String uri) {
+         _namespaceAttributes[_namespaceAttributesPtr++] = prefix;
+         _namespaceAttributes[_namespaceAttributesPtr++] = uri;
+-        
++
+         if (_namespaceAttributesPtr == _namespaceAttributes.length) {
+-            final String[] namespaceAttributes = new String[_namespaceAttributesPtr * 3 / 2 + 1];
++            final String[] namespaceAttributes = new String[_namespaceAttributesPtr * 2];
+             System.arraycopy(_namespaceAttributes, 0, namespaceAttributes, 0, _namespaceAttributesPtr);
+             _namespaceAttributes = namespaceAttributes;
+         }
+@@ -179,19 +179,23 @@
+         }
+         _namespaceAttributesPtr = 0;
+     }
+-    
++
+     private void storeAttributes(Attributes attributes) {
+         for (int i = 0; i < attributes.getLength(); i++) {
++            // Skip NS attributes. Some versions of JDK seem to send wrong local name
++            // Also it is not stored correctly by the following.
++            if (attributes.getQName(i).startsWith("xmlns"))
++                continue;
+             storeQualifiedName(T_ATTRIBUTE_LN,
+                     attributes.getURI(i),
+                     attributes.getLocalName(i),
+                     attributes.getQName(i));
+-            
++
+             storeStructureString(attributes.getType(i));
+             storeContentString(attributes.getValue(i));
+         }
+     }
+-    
++
+     private void storeQualifiedName(int item, String uri, String localName, String qName) {
+         if (uri.length() > 0) {
+             item |= FLAG_URI;
+@@ -206,60 +210,60 @@
+         }
+ 
+         storeStructure(item);
+-    }    
+-    
+-    
++    }
++
++
+     // Empty methods for SAX handlers
+-    
++
+     // Entity resolver handler
+-    
++
+     public InputSource resolveEntity (String publicId, String systemId)
+-	throws IOException, SAXException
++        throws IOException, SAXException
+     {
+-	return null;
++        return null;
+     }
+-        
++
+     // DTD handler
+-    
++
+     public void notationDecl (String name, String publicId, String systemId)
+-	throws SAXException
++        throws SAXException
+     { }
+-    
++
+     public void unparsedEntityDecl (String name, String publicId,
+-				    String systemId, String notationName)
+-	throws SAXException
++                                    String systemId, String notationName)
++        throws SAXException
+     { }
+-        
++
+     // Content handler
+-    
++
+     public void setDocumentLocator (Locator locator) { }
+-        
++
+     public void endPrefixMapping (String prefix) throws SAXException { }
+-    
++
+     public void skippedEntity (String name) throws SAXException { }
+ 
+-    // Lexical handler 
+-    
++    // Lexical handler
++
+     public void startDTD(String name, String publicId, String systemId) throws SAXException { }
+-    
++
+     public void endDTD() throws SAXException { }
+-    
++
+     public void startEntity(String name) throws SAXException { }
+-    
++
+     public void endEntity(String name) throws SAXException { }
+-    
++
+     public void startCDATA() throws SAXException { }
+-    
++
+     public void endCDATA() throws SAXException { }
+-    
++
+     // Error handler
+-    
++
+     public void warning(SAXParseException e) throws SAXException { }
+-    
++
+     public void error(SAXParseException e) throws SAXException { }
+-    
++
+     public void fatalError(SAXParseException e) throws SAXException
+     {
+-	throw e;
+-    }    
++        throw e;
++    }
+ }
+--- old/src/share/classes/com/sun/xml/internal/stream/buffer/sax/SAXBufferProcessor.java	Thu Jul 30 18:19:16 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/sax/SAXBufferProcessor.java	Thu Jul 30 18:19:15 2009
+@@ -52,22 +52,22 @@
+      * Reference to entity resolver.
+      */
+     protected EntityResolver _entityResolver = DEFAULT_LEXICAL_HANDLER;
+-    
++
+     /**
+      * Reference to dtd handler.
+      */
+     protected DTDHandler _dtdHandler = DEFAULT_LEXICAL_HANDLER;
+-    
++
+     /**
+      * Reference to content handler.
+      */
+     protected ContentHandler _contentHandler = DEFAULT_LEXICAL_HANDLER;
+-    
++
+     /**
+      * Reference to error handler.
+      */
+     protected ErrorHandler _errorHandler = DEFAULT_LEXICAL_HANDLER;
+-    
++
+     /**
+      * Reference to lexical handler.
+      */
+@@ -77,12 +77,12 @@
+      * SAX Namespace attributes features
+      */
+     protected boolean _namespacePrefixesFeature = false;
+-    
++
+     protected AttributesHolder _attributes = new AttributesHolder();
+-    
++
+     protected String[] _namespacePrefixes = new String[16];
+     protected int _namespacePrefixesIndex;
+-    
++
+     protected int[] _namespaceAttributesStack = new int[16];
+     protected int _namespaceAttributesStackIndex;
+ 
+@@ -123,7 +123,7 @@
+                     "Feature not supported: " + name);
+         }
+     }
+-    
++
+     public void setFeature(String name, boolean value)
+             throws SAXNotRecognizedException, SAXNotSupportedException {
+         if (name.equals(Features.NAMESPACES_FEATURE)) {
+@@ -143,9 +143,9 @@
+         } else {
+             throw new SAXNotRecognizedException(
+                     "Feature not supported: " + name);
+-        }        
++        }
+     }
+-    
++
+     public Object getProperty(String name)
+             throws SAXNotRecognizedException, SAXNotSupportedException {
+         if (name.equals(Properties.LEXICAL_HANDLER_PROPERTY)) {
+@@ -154,7 +154,7 @@
+             throw new SAXNotRecognizedException("Property not recognized: " + name);
+         }
+     }
+-    
++
+     public void setProperty(String name, Object value)
+             throws SAXNotRecognizedException, SAXNotSupportedException {
+         if (name.equals(Properties.LEXICAL_HANDLER_PROPERTY)) {
+@@ -167,52 +167,52 @@
+             throw new SAXNotRecognizedException("Property not recognized: " + name);
+         }
+     }
+-    
++
+     public void setEntityResolver(EntityResolver resolver) {
+         _entityResolver = resolver;
+     }
+-    
++
+     public EntityResolver getEntityResolver() {
+         return _entityResolver;
+     }
+-    
++
+     public void setDTDHandler(DTDHandler handler) {
+         _dtdHandler = handler;
+     }
+-    
++
+     public DTDHandler getDTDHandler() {
+         return _dtdHandler;
+     }
+-    
++
+     public void setContentHandler(ContentHandler handler) {
+         _contentHandler = handler;
+     }
+-    
++
+     public ContentHandler getContentHandler() {
+         return _contentHandler;
+     }
+-    
++
+     public void setErrorHandler(ErrorHandler handler) {
+         _errorHandler = handler;
+     }
+-    
++
+     public ErrorHandler getErrorHandler() {
+         return _errorHandler;
+     }
+-    
++
+     public void setLexicalHandler(LexicalHandler handler) {
+         _lexicalHandler = handler;
+     }
+-    
++
+     public LexicalHandler getLexicalHandler() {
+         return _lexicalHandler;
+     }
+-    
++
+     public void parse(InputSource input) throws IOException, SAXException {
+         // InputSource is ignored
+         process();
+     }
+-    
++
+     public void parse(String systemId) throws IOException, SAXException {
+         // systemId is ignored
+         process();
+@@ -267,7 +267,7 @@
+     /**
+      * Parse the sub-tree (or a whole document) that {@link XMLStreamBuffer}
+      * points to, and sends events to handlers.
+-     * 
++     *
+      * <p>
+      * TODO:
+      * We probably need two modes for a sub-tree event generation. One for
+@@ -274,8 +274,8 @@
+      * firing a sub-tree as if it's a whole document (in which case start/endDocument
+      * and appropriate additional namespace bindings are necessary), and the other
+      * mode for firing a subtree as a subtree, like it does today.
+-     * A stream buffer SAX feature could be used to specify this. 
+-     * 
++     * A stream buffer SAX feature could be used to specify this.
++     *
+      * @throws SAXException
+      *      Follow the same semantics as {@link XMLReader#parse(InputSource)}.
+      */
+@@ -286,7 +286,7 @@
+             nullLocator.setLineNumber(-1);
+             nullLocator.setColumnNumber(-1);
+             _contentHandler.setDocumentLocator(nullLocator);
+-            
++
+             _contentHandler.startDocument();
+             // TODO: if we are writing a fragment stream buffer as a full XML document,
+             // we need to declare in-scope namespaces as if they are on the root element.
+@@ -428,7 +428,7 @@
+         if ((item & TYPE_MASK) == T_NAMESPACE_ATTRIBUTE) {
+             hasNamespaceAttributes = true;
+             item = processNamespaceAttributes(item);
+-        }        
++        }
+         if ((item & TYPE_MASK) == T_ATTRIBUTE) {
+             hasAttributes = true;
+             processAttributes(item);
+@@ -520,7 +520,7 @@
+                     throw reportFatalError("Illegal state for child of EII: "+item);
+             }
+         } while(item != STATE_END);
+-        
++
+         _contentHandler.endElement(uri, localName, qName);
+ 
+         if (hasNamespaceAttributes) {
+@@ -542,16 +542,16 @@
+     private void processEndPrefixMapping() throws SAXException {
+         final int end = _namespaceAttributesStack[--_namespaceAttributesStackIndex];
+         final int start = (_namespaceAttributesStackIndex > 0) ? _namespaceAttributesStack[_namespaceAttributesStackIndex] : 0;
+-        
++
+         for (int i = end - 1; i >= start; i--) {
+             _contentHandler.endPrefixMapping(_namespacePrefixes[i]);
+         }
+         _namespacePrefixesIndex = start;
+     }
+-    
++
+     private int processNamespaceAttributes(int item) throws SAXException {
+         do {
+-            switch(_niiStateTable[item]) {
++            switch(getNIIState(item)) {
+                 case STATE_NAMESPACE_ATTRIBUTE:
+                     // Undeclaration of default namespace
+                     processNamespaceAttribute("", "");
+@@ -572,19 +572,19 @@
+                     throw reportFatalError("Illegal state: "+item);
+             }
+             readStructure();
+-            
++
+             item = peekStructure();
+         } while((item & TYPE_MASK) == T_NAMESPACE_ATTRIBUTE);
+-        
+-        
++
++
+         cacheNamespacePrefixIndex();
+-        
++
+         return item;
+     }
+-    
++
+     private void processAttributes(int item) throws SAXException {
+         do {
+-            switch(_aiiStateTable[item]) {
++            switch(getAIIState(item)) {
+                 case STATE_ATTRIBUTE_U_LN_QN:
+                     _attributes.addAttributeWithQName(readStructureString(), readStructureString(), readStructureString(), readStructureString(), readContentString());
+                     break;
+@@ -599,12 +599,12 @@
+                 case STATE_ATTRIBUTE_U_LN: {
+                     final String u = readStructureString();
+                     final String ln = readStructureString();
+-                    _attributes.addAttributeWithQName(u, ln, ln, readStructureString(), readContentString()); 
++                    _attributes.addAttributeWithQName(u, ln, ln, readStructureString(), readContentString());
+                     break;
+                 }
+                 case STATE_ATTRIBUTE_LN: {
+                     final String ln = readStructureString();
+-                    _attributes.addAttributeWithQName("", ln, ln, readStructureString(), readContentString()); 
++                    _attributes.addAttributeWithQName("", ln, ln, readStructureString(), readContentString());
+                     break;
+                 }
+                 default:
+@@ -611,7 +611,7 @@
+                     throw reportFatalError("Illegal state: "+item);
+             }
+             readStructure();
+-            
++
+             item = peekStructure();
+         } while((item & TYPE_MASK) == T_ATTRIBUTE);
+     }
+@@ -626,15 +626,15 @@
+                         getQName(XMLConstants.XMLNS_ATTRIBUTE, prefix),
+                         "CDATA", uri);
+             } else {
+-                _attributes.addAttributeWithQName(XMLConstants.XMLNS_ATTRIBUTE_NS_URI, XMLConstants.XMLNS_ATTRIBUTE, 
++                _attributes.addAttributeWithQName(XMLConstants.XMLNS_ATTRIBUTE_NS_URI, XMLConstants.XMLNS_ATTRIBUTE,
+                         XMLConstants.XMLNS_ATTRIBUTE,
+                         "CDATA", uri);
+             }
+         }
+-        
++
+         cacheNamespacePrefix(prefix);
+     }
+-    
++
+     private void cacheNamespacePrefix(String prefix) {
+         if (_namespacePrefixesIndex == _namespacePrefixes.length) {
+             final String[] namespaceAttributes = new String[_namespacePrefixesIndex * 3 / 2 + 1];
+@@ -641,10 +641,10 @@
+             System.arraycopy(_namespacePrefixes, 0, namespaceAttributes, 0, _namespacePrefixesIndex);
+             _namespacePrefixes = namespaceAttributes;
+         }
+-        
++
+         _namespacePrefixes[_namespacePrefixesIndex++] = prefix;
+     }
+-    
++
+     private void cacheNamespacePrefixIndex() {
+         if (_namespaceAttributesStackIndex == _namespaceAttributesStack.length) {
+             final int[] namespaceAttributesStack = new int[_namespaceAttributesStackIndex * 3 /2 + 1];
+@@ -654,11 +654,11 @@
+ 
+         _namespaceAttributesStack[_namespaceAttributesStackIndex++] = _namespacePrefixesIndex;
+     }
+-    
++
+     private void processComment(String s)  throws SAXException {
+         processComment(s.toCharArray(), 0, s.length());
+     }
+-    
++
+     private void processComment(char[] ch, int start, int length) throws SAXException {
+         _lexicalHandler.comment(ch, start, length);
+     }
+--- old/src/share/classes/com/sun/xml/internal/stream/buffer/stax/NamespaceContexHelper.java	Thu Jul 30 18:19:19 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/stax/NamespaceContexHelper.java	Thu Jul 30 18:19:19 2009
+@@ -38,15 +38,15 @@
+  * Namespace contexts are pushed on and popped off the namespace context stack.
+  * <p>
+  * A declared namespace will be in scope iff the context that it was declared on
+- * has not been popped off the stack. 
++ * has not been popped off the stack.
+  * <p>
+  * When instantiated the namespace stack consists of the root namespace context,
+  * which contains, by default, the "xml" and "xmlns" declarations.
+  * Namespaces may be declarations may be declared on the root context.
+- * The root context cannot be popped but can be reset to contain just the 
++ * The root context cannot be popped but can be reset to contain just the
+  * "xml" and "xmlns" declarations.
+  * <p>
+- * Implementation note: determining the prefix from a namespace URI 
++ * Implementation note: determining the prefix from a namespace URI
+  * (or vice versa) is efficient when there are few namespace
+  * declarations i.e. what is considered to be the case for namespace
+  * declarations in 'average' XML documents. The look up of a namespace URI
+@@ -54,7 +54,7 @@
+  * a namespace URI is performed in O(2n) time.
+  * <p>
+  * The implementation does not scale when there are many namespace
+- * declarations. TODO: Use a hash map when there are many namespace 
++ * declarations. TODO: Use a hash map when there are many namespace
+  * declarations.
+  *
+  * @author Paul.Sandoz@Sun.Com
+@@ -61,7 +61,7 @@
+  */
+ final public class NamespaceContexHelper implements NamespaceContextEx {
+     private static int DEFAULT_SIZE = 8;
+-    
++
+     // The prefixes of the namespace declarations
+     private String[] prefixes = new String[DEFAULT_SIZE];
+     // The URIs of the namespace declarations
+@@ -68,15 +68,15 @@
+     private String[] namespaceURIs = new String[DEFAULT_SIZE];
+     // Current position to store the next namespace declaration
+     private int namespacePosition;
+-    
++
+     // The namespace contexts
+     private int[] contexts = new int[DEFAULT_SIZE];
+     // Current position to store the next namespace context
+     private int contextPosition;
+-    
++
+     // The current namespace context
+     private int currentContext;
+-    
++
+     /**
+      * Create a new NamespaceContexHelper.
+      *
+@@ -90,15 +90,15 @@
+ 
+         currentContext = namespacePosition = 2;
+     }
+-    
+ 
++
+     // NamespaceContext interface
+-    
++
+     public String getNamespaceURI(String prefix) {
+         if (prefix == null) throw new IllegalArgumentException();
+-        
++
+         prefix = prefix.intern();
+-        
++
+         for (int i = namespacePosition - 1; i >= 0; i--) {
+             final String declaredPrefix = prefixes[i];
+             if (declaredPrefix == prefix) {
+@@ -111,63 +111,63 @@
+ 
+     public String getPrefix(String namespaceURI) {
+         if (namespaceURI == null) throw new IllegalArgumentException();
+-        
++
+         for (int i = namespacePosition - 1; i >= 0; i--) {
+             final String declaredNamespaceURI = namespaceURIs[i];
+             if (declaredNamespaceURI == namespaceURI || declaredNamespaceURI.equals(namespaceURI)) {
+                 final String declaredPrefix = prefixes[i];
+-                
++
+                 // Check if prefix is out of scope
+                 for (++i; i < namespacePosition; i++)
+                     if (declaredPrefix == prefixes[i])
+                         return null;
+-                
++
+                 return declaredPrefix;
+             }
+         }
+-        
++
+         return null;
+     }
+ 
+     public Iterator getPrefixes(String namespaceURI) {
+         if (namespaceURI == null) throw new IllegalArgumentException();
+-        
++
+         List<String> l = new ArrayList<String>();
+-        
++
+         NAMESPACE_LOOP: for (int i = namespacePosition - 1; i >= 0; i--) {
+             final String declaredNamespaceURI = namespaceURIs[i];
+             if (declaredNamespaceURI == namespaceURI || declaredNamespaceURI.equals(namespaceURI)) {
+                 final String declaredPrefix = prefixes[i];
+-                
++
+                 // Check if prefix is out of scope
+                 for (int j = i + 1; j < namespacePosition; j++)
+                     if (declaredPrefix == prefixes[j])
+                         continue NAMESPACE_LOOP;
+-                
++
+                 l.add(declaredPrefix);
+             }
+         }
+-        
++
+         return l.iterator();
+     }
+-    
++
+     // NamespaceContextEx interface
+-    
++
+     public Iterator<NamespaceContextEx.Binding> iterator() {
+         if (namespacePosition == 2)
+             return Collections.EMPTY_LIST.iterator();
+-        
+-        final List<NamespaceContextEx.Binding> namespaces = 
++
++        final List<NamespaceContextEx.Binding> namespaces =
+                 new ArrayList<NamespaceContextEx.Binding>(namespacePosition);
+-        
++
+         NAMESPACE_LOOP: for (int i = namespacePosition - 1; i >= 2; i--) {
+             final String declaredPrefix = prefixes[i];
+-                        
++
+             // Check if prefix is out of scope
+             for (int j = i + 1; j < namespacePosition; j++) {
+                 if (declaredPrefix == prefixes[j])
+                     continue NAMESPACE_LOOP;
+-                
++
+                 namespaces.add(new NamespaceBindingImpl(i));
+             }
+         }
+@@ -177,11 +177,11 @@
+ 
+     final private class NamespaceBindingImpl implements NamespaceContextEx.Binding {
+         int index;
+-        
++
+         NamespaceBindingImpl(int index) {
+             this.index = index;
+         }
+-        
++
+         public String getPrefix() {
+             return prefixes[index];
+         }
+@@ -199,7 +199,7 @@
+     public void declareDefaultNamespace(String namespaceURI) {
+         declareNamespace("", namespaceURI);
+     }
+-    
++
+     /**
+      * Declare a namespace.
+      * <p>
+@@ -206,12 +206,12 @@
+      * The namespace will be declared on the current namespace context.
+      * <p>
+      * The namespace can be removed by popping the current namespace
+-     * context, or, if the declaration occured in the root context, by 
++     * context, or, if the declaration occured in the root context, by
+      * reseting the namespace context.
+      * <p>
+-     * A default namespace can be declared by passing <code>""</code> as 
+-     * the value of the prefix parameter. 
+-     * A namespace may be undeclared by passing <code>null</code> as the 
++     * A default namespace can be declared by passing <code>""</code> as
++     * the value of the prefix parameter.
++     * A namespace may be undeclared by passing <code>null</code> as the
+      * value of the namespaceURI parameter.
+      * <p>
+      * @param prefix the namespace prefix to declare, may not be null.
+@@ -220,7 +220,7 @@
+      */
+     public void declareNamespace(String prefix, String namespaceURI) {
+         if (prefix == null) throw new IllegalArgumentException();
+-            
++
+         prefix = prefix.intern();
+         // Ignore the "xml" or "xmlns" declarations
+         if (prefix == "xml" || prefix == "xmlns")
+@@ -229,7 +229,7 @@
+         // Check for undeclaration
+         if (namespaceURI != null)
+             namespaceURI = namespaceURI.intern();
+-        
++
+         if (namespacePosition == namespaceURIs.length)
+             resizeNamespaces();
+ 
+@@ -244,7 +244,7 @@
+         String[] newPrefixes = new String[newLength];
+         System.arraycopy(prefixes, 0, newPrefixes, 0, prefixes.length);
+         prefixes = newPrefixes;
+-        
++
+         String[] newNamespaceURIs = new String[newLength];
+         System.arraycopy(namespaceURIs, 0, newNamespaceURIs, 0, namespaceURIs.length);
+         namespaceURIs = newNamespaceURIs;
+@@ -256,16 +256,16 @@
+     public void pushContext() {
+         if (contextPosition == contexts.length)
+             resizeContexts();
+-        
++
+         contexts[contextPosition++] = currentContext = namespacePosition;
+     }
+-    
++
+     private void resizeContexts() {
+         int[] newContexts = new int[contexts.length * 3 / 2 + 1];
+         System.arraycopy(contexts, 0, newContexts, 0, contexts.length);
+         contexts = newContexts;
+     }
+-    
++
+     /**
+      * Pop the namespace context off the stack.
+      * <p>
+@@ -277,7 +277,7 @@
+             namespacePosition = currentContext = contexts[--contextPosition];
+         }
+     }
+-    
++
+     /**
+      * Reset namespace contexts.
+      * <p>
+--- old/src/share/classes/com/sun/xml/internal/stream/buffer/stax/StreamBufferCreator.java	Thu Jul 30 18:19:23 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/stax/StreamBufferCreator.java	Thu Jul 30 18:19:22 2009
+@@ -25,6 +25,8 @@
+ package com.sun.xml.internal.stream.buffer.stax;
+ 
+ import com.sun.xml.internal.stream.buffer.AbstractCreator;
++import java.util.ArrayList;
++import java.util.List;
+ 
+ /**
+  * {@link AbstractCreator} with additional convenience code.
+@@ -34,6 +36,11 @@
+  * @author Kohsuke Kawaguchi
+  */
+ abstract class StreamBufferCreator extends AbstractCreator {
++
++    private boolean checkAttributeValue = false;
++
++    protected List<String> attributeValuePrefixes = new ArrayList<String>();
++
+     protected void storeQualifiedName(int item, String prefix, String uri, String localName) {
+         if (uri != null && uri.length() > 0) {
+             if (prefix != null && prefix.length() > 0) {
+@@ -71,11 +78,33 @@
+ 
+         storeStructureString(type);
+         storeContentString(value);
++        if(checkAttributeValue && value.indexOf("://") == -1){  // the condition after && avoids looking inside URIs
++            int firstIndex = value.indexOf(":");
++            int lastIndex = value.lastIndexOf(":");  // Check last index of : as some SAML namespace have multiple ":"s
++            if(firstIndex != -1 && lastIndex == firstIndex){
++                String valuePrefix = value.substring(0, firstIndex);
++                if(!attributeValuePrefixes.contains(valuePrefix)){
++                    attributeValuePrefixes.add(valuePrefix);
++                }
++            }
++        }
+     }
+ 
++    public final List getAttributeValuePrefixes(){
++        return attributeValuePrefixes;
++    }
++
+     protected final void storeProcessingInstruction(String target, String data) {
+         storeStructure(T_PROCESSING_INSTRUCTION);
+         storeStructureString(target);
+         storeStructureString(data);
+     }
++
++    public final boolean isCheckAttributeValue(){
++        return checkAttributeValue;
++    }
++
++    public final void setCheckAttributeValue(boolean value){
++        this.checkAttributeValue = value;
++    }
+ }
+--- old/src/share/classes/com/sun/xml/internal/stream/buffer/stax/StreamReaderBufferCreator.java	Thu Jul 30 18:19:27 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/stax/StreamReaderBufferCreator.java	Thu Jul 30 18:19:26 2009
+@@ -68,12 +68,12 @@
+      * The stream reader must be positioned at the start of the document
+      * or the start of an element.
+      * <p>
+-     * If the stream is positioned at the start of the document then the 
+-     * whole document is stored and after storing the stream will be positioned 
++     * If the stream is positioned at the start of the document then the
++     * whole document is stored and after storing the stream will be positioned
+      * at the end of the document.
+      * <p>
+-     * If the stream is positioned at the start of an element then the 
+-     * element and all its children will be stored and after storing the stream 
++     * If the stream is positioned at the start of an element then the
++     * element and all its children will be stored and after storing the stream
+      * will be positioned at the next event after the end of the element.
+      * <p>
+      * @return the mutable stream buffer.
+@@ -93,10 +93,10 @@
+      * Creates the buffer from a stream reader that is an element fragment.
+      * <p>
+      * The stream reader will be moved to the position of the next start of
+-     * an element if the stream reader is not already positioned at the start 
++     * an element if the stream reader is not already positioned at the start
+      * of an element.
+      * <p>
+-     * The element and all its children will be stored and after storing the stream 
++     * The element and all its children will be stored and after storing the stream
+      * will be positioned at the next event after the end of the element.
+      * <p>
+      * @param storeInScopeNamespaces true if in-scope namespaces of the element
+@@ -149,7 +149,7 @@
+             default:
+                 throw new XMLStreamException("XMLStreamReader not positioned at a document or element");
+         }
+-        
++
+         increaseTreeCount();
+     }
+ 
+@@ -313,6 +313,28 @@
+         }
+     }
+ 
++    /**
++     * A low level method a create a structure element explicitly. This is useful when xsb is
++     * created from a fragment's XMLStreamReader and inscope namespaces can be passed using
++     * this method. Note that there is no way to enumerate namespaces from XMLStreamReader.
++     *
++     * For e.g: Say the SOAP message is as follows
++     *
++     *  <S:Envelope xmlns:n1=".."><S:Body><ns2:A> ...
++     *
++     * when xsb is to be created using a reader that is at <ns2:A> tag, the inscope
++     * namespace like 'n1' can be passed using this method.
++     *
++     * WARNING: Instead of using this, try other methods(if you don't know what you are
++     * doing).
++     *
++     * @param ns an array of the even length of the form { prefix0, uri0, prefix1, uri1, ... }.
++     */
++    public void storeElement(String nsURI, String localName, String prefix, String[] ns) {
++        storeQualifiedName(T_ELEMENT_LN, prefix, nsURI, localName);
++        storeNamespaceAttributes(ns);
++    }
++
+     private void storeNamespaceAttributes(XMLStreamReader reader) {
+         int count = reader.getNamespaceCount();
+         for (int i = 0; i < count; i++) {
+@@ -319,6 +341,15 @@
+             storeNamespaceAttribute(reader.getNamespacePrefix(i), reader.getNamespaceURI(i));
+         }
+     }
++
++    /**
++     * @param ns an array of the even length of the form { prefix0, uri0, prefix1, uri1, ... }.
++     */
++    private void storeNamespaceAttributes(String[] ns) {
++        for (int i = 0; i < ns.length; i=i+2) {
++            storeNamespaceAttribute(ns[i], ns[i+1]);
++        }
++    }
+ 
+     private void storeAttributes(XMLStreamReader reader) {
+         int count = reader.getAttributeCount();
+--- old/src/share/classes/com/sun/xml/internal/stream/buffer/stax/StreamReaderBufferProcessor.java	Thu Jul 30 18:19:30 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/stax/StreamReaderBufferProcessor.java	Thu Jul 30 18:19:29 2009
+@@ -54,7 +54,7 @@
+  * When {@link XMLStreamBuffer} contains a multiple tree (AKA "forest"),
+  * {@link XMLStreamReader} will behave as if there are multiple root elements
+  * (so you'll see {@link #START_ELEMENT} event where you'd normally expect
+- * {@link #END_DOCUMENT}.) 
++ * {@link #END_DOCUMENT}.)
+  *
+  * @author Paul.Sandoz@Sun.Com
+  * @author K.Venugopal@sun.com
+@@ -208,14 +208,15 @@
+                     // to push
+                     popElementStack(_depth);
+                 } else if (_depth == 1) {
+-                    _depth--;                    
++                    _depth--;
+                 }
+         }
+-        
++
+         _characters = null;
+         _charSequence = null;
+         while(true) {// loop only if we read STATE_DOCUMENT
+-            switch(readEiiState()) {
++            int eiiState = readEiiState();
++            switch(eiiState) {
+                 case STATE_DOCUMENT:
+                     // we'll always produce a full document, and we've already report START_DOCUMENT event.
+                     // so simply skil this
+@@ -311,7 +312,7 @@
+                         return _eventType = END_DOCUMENT;
+                     }
+                 default:
+-                    throw new XMLStreamException("Invalid State");
++                    throw new XMLStreamException("Internal XSB error: Invalid State="+eiiState);
+             }
+             // this should be unreachable
+         }
+@@ -597,9 +598,11 @@
+         }
+ 
+         try {
+-            System.arraycopy(_characters, sourceStart, target,
+-                    targetStart, length);
+-            return length;
++            int remaining = _textLen - sourceStart;
++            int len = remaining > length ? length : remaining;
++            sourceStart += _textOffset;
++            System.arraycopy(_characters, sourceStart, target, targetStart, len);
++            return len;
+         } catch (IndexOutOfBoundsException e) {
+             throw new XMLStreamException(e);
+         }
+@@ -748,7 +751,7 @@
+                 resizeNamespaceAttributes();
+             }
+ 
+-            switch(_niiStateTable[item]){
++            switch(getNIIState(item)){
+                 case STATE_NAMESPACE_ATTRIBUTE:
+                     // Undeclaration of default namespace
+                     _namespaceAIIsPrefix[_namespaceAIIsEnd] =
+@@ -782,7 +785,7 @@
+ 
+     private void processAttributes(int item){
+         do {
+-            switch(_aiiStateTable[item]){
++            switch(getAIIState(item)){
+                 case STATE_ATTRIBUTE_U_LN_QN: {
+                     final String uri = readStructureString();
+                     final String localName = readStructureString();
+@@ -801,6 +804,8 @@
+                     _attributeCache.addAttributeWithPrefix("", "", readStructureString(), readStructureString(), readContentString());
+                     break;
+                 }
++                default :
++                    assert false : "Internal XSB Error: wrong attribute state, Item="+item;
+             }
+             readStructure();
+ 
+@@ -828,7 +833,7 @@
+         // Move back the position of the namespace index
+         _namespaceAIIsEnd = _stack[depth].namespaceAIIsStart;
+     }
+-    
++
+     private final class ElementStackEntry {
+         /**
+          * Prefix.
+@@ -1071,7 +1076,7 @@
+             return _buffer.getSystemId();
+         }
+     }
+-    
++
+     private static String fixEmptyString(String s) {
+         // s must not be null, so no need to check for that. that would be bug.
+         if(s.length()==0)   return null;
+--- old/src/share/classes/com/sun/xml/internal/stream/buffer/stax/StreamWriterBufferCreator.java	Thu Jul 30 18:19:34 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/stax/StreamWriterBufferCreator.java	Thu Jul 30 18:19:33 2009
+@@ -109,7 +109,7 @@
+ 
+     public void writeStartDocument(String encoding, String version) throws XMLStreamException {
+         namespaceContext.resetContexts();
+-        
++
+         storeStructure(T_DOCUMENT);
+     }
+ 
+@@ -120,12 +120,12 @@
+     public void writeStartElement(String localName) throws XMLStreamException {
+         namespaceContext.pushContext();
+         depth++;
+-        
++
+         final String defaultNamespaceURI = namespaceContext.getNamespaceURI("");
+-        
++
+         if (defaultNamespaceURI == null)
+             storeQualifiedName(T_ELEMENT_LN, null, null, localName);
+-        else 
++        else
+             storeQualifiedName(T_ELEMENT_LN, null, defaultNamespaceURI, localName);
+     }
+ 
+@@ -137,7 +137,7 @@
+         if (prefix == null) {
+             throw new XMLStreamException();
+         }
+-        
++
+         namespaceContext.pushContext();
+         storeQualifiedName(T_ELEMENT_LN, prefix, namespaceURI, localName);
+     }
+@@ -166,7 +166,7 @@
+ 
+     public void writeEndElement() throws XMLStreamException {
+         namespaceContext.popContext();
+-        
++
+         storeStructure(T_END);
+         if(--depth==0)
+             increaseTreeCount();
+@@ -193,7 +193,7 @@
+             // TODO
+             throw new XMLStreamException();
+         }
+-        
++
+         writeAttribute(prefix, namespaceURI, localName, value);
+     }
+ 
+@@ -238,7 +238,7 @@
+     }
+ 
+     // XMLStreamWriterEx
+-    
++
+     public void writePCDATA(CharSequence charSequence) throws XMLStreamException {
+         if (charSequence instanceof Base64Data) {
+             storeStructure(T_TEXT_AS_OBJECT);
+@@ -258,8 +258,10 @@
+     }
+ 
+     public void writeBinary(DataHandler dataHandler) throws XMLStreamException {
+-        // TODO
+-        throw new UnsupportedOperationException();
++        Base64Data d = new Base64Data();
++        d.set(dataHandler);
++        storeStructure(T_TEXT_AS_OBJECT);
++        storeContentObject(d);
+     }
+ 
+     public OutputStream writeBinary(String endpointURL) throws XMLStreamException {
+--- old/src/share/classes/com/sun/xml/internal/stream/buffer/stax/StreamWriterBufferProcessor.java	Thu Jul 30 18:19:37 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/stream/buffer/stax/StreamWriterBufferProcessor.java	Thu Jul 30 18:19:37 2009
+@@ -27,6 +27,12 @@
+ 
+ import com.sun.xml.internal.stream.buffer.AbstractProcessor;
+ import com.sun.xml.internal.stream.buffer.XMLStreamBuffer;
++
++import java.util.Collections;
++import java.util.HashSet;
++import java.util.Map;
++import java.util.Set;
++
+ import com.sun.xml.internal.org.jvnet.staxex.XMLStreamWriterEx;
+ 
+ import javax.xml.stream.XMLStreamException;
+@@ -36,13 +42,13 @@
+ /**
+  * A processor of a {@link XMLStreamBuffer} that writes the XML infoset to a
+  * {@link XMLStreamWriter}.
+- * 
++ *
+  * @author Paul.Sandoz@Sun.Com
+  * @author K.Venugopal@sun.com
+  */
+ public class StreamWriterBufferProcessor extends AbstractProcessor {
+-    
+-    
++
++
+     public StreamWriterBufferProcessor() {
+     }
+ 
+@@ -67,7 +73,7 @@
+         setXMLStreamBuffer(buffer,buffer.isFragment());
+         process(writer);
+     }
+-    
++
+     public void process(XMLStreamWriter writer) throws XMLStreamException {
+         if(_fragmentMode){
+             writeFragment(writer);
+@@ -96,6 +102,8 @@
+     /**
+      * Writes a full XML infoset event to the given writer,
+      * including start/end document.
++     * Any inscope namespaces present will be written as namespace
++     * delcarations on each top-level element.
+      */
+     public void write(XMLStreamWriter writer) throws XMLStreamException{
+ 
+@@ -105,13 +113,10 @@
+             writer.writeStartDocument();
+         }
+ 
+-        // TODO: if we are writing a fragment XMLStreamBuffer as a full document,
+-        // we need to put in-scope namespaces as top-level ns decls.
+-
+         while(true) {
+-            int item = _eiiStateTable[peekStructure()];
++            int item = getEIIState(peekStructure());
+             writer.flush();
+-            
++
+             switch(item) {
+                 case STATE_DOCUMENT:
+                     readStructure(); //skip
+@@ -156,13 +161,14 @@
+                     throw new XMLStreamException("Invalid State "+item);
+             }
+         }
+-        
++
+     }
+ 
+     /**
+      * Writes the buffer as a fragment, meaning
+      * the writer will not receive start/endDocument events.
+-     *
++     * Any inscope namespaces present will be written as namespace
++     * delcarations on each top-level element.
+      * <p>
+      * If {@link XMLStreamBuffer} has a forest, this method will write all the forests.
+      */
+@@ -173,18 +179,18 @@
+             writeFragmentNoEx(writer);
+         }
+     }
+-    
++
+     public void writeFragmentEx(XMLStreamWriterEx writer) throws XMLStreamException {
+         int depth = 0;  // used to determine when we are done with a tree.
+ 
+-        int item = _eiiStateTable[peekStructure()];
++        int item = getEIIState(peekStructure());
+         if(item==STATE_DOCUMENT)
+             readStructure();    // skip STATE_DOCUMENT
+ 
+         do {
+-            
++
+             item = readEiiState();
+-            
++
+             switch(item) {
+                 case STATE_DOCUMENT:
+                     throw new AssertionError();
+@@ -194,7 +200,7 @@
+                     final String localName = readStructureString();
+                     final String prefix = getPrefixFromQName(readStructureString());
+                     writer.writeStartElement(prefix,localName,uri);
+-                    writeAttributes(writer);
++                    writeAttributes(writer, isInscope(depth));
+                     break;
+                 }
+                 case STATE_ELEMENT_P_U_LN: {
+@@ -203,7 +209,7 @@
+                     final String uri = readStructureString();
+                     final String localName = readStructureString();
+                     writer.writeStartElement(prefix,localName,uri);
+-                    writeAttributes(writer);
++                    writeAttributes(writer, isInscope(depth));
+                     break;
+                 }
+                 case STATE_ELEMENT_U_LN: {
+@@ -211,7 +217,7 @@
+                     final String uri = readStructureString();
+                     final String localName = readStructureString();
+                     writer.writeStartElement("",localName,uri);
+-                    writeAttributes(writer);
++                    writeAttributes(writer, isInscope(depth));
+                     break;
+                 }
+                 case STATE_ELEMENT_LN: {
+@@ -218,7 +224,7 @@
+                     depth ++;
+                     final String localName = readStructureString();
+                     writer.writeStartElement(localName);
+-                    writeAttributes(writer);
++                    writeAttributes(writer, isInscope(depth));
+                     break;
+                 }
+                 case STATE_TEXT_AS_CHAR_ARRAY_SMALL: {
+@@ -286,7 +292,7 @@
+     public void writeFragmentNoEx(XMLStreamWriter writer) throws XMLStreamException {
+         int depth = 0;
+ 
+-        int item = _eiiStateTable[peekStructure()];
++        int item = getEIIState(peekStructure());
+         if(item==STATE_DOCUMENT)
+             readStructure();    // skip STATE_DOCUMENT
+ 
+@@ -302,7 +308,7 @@
+                     final String localName = readStructureString();
+                     final String prefix = getPrefixFromQName(readStructureString());
+                     writer.writeStartElement(prefix,localName,uri);
+-                    writeAttributes(writer);
++                    writeAttributes(writer, isInscope(depth));
+                     break;
+                 }
+                 case STATE_ELEMENT_P_U_LN: {
+@@ -311,7 +317,7 @@
+                     final String uri = readStructureString();
+                     final String localName = readStructureString();
+                     writer.writeStartElement(prefix,localName,uri);
+-                    writeAttributes(writer);
++                    writeAttributes(writer, isInscope(depth));
+                     break;
+                 }
+                 case STATE_ELEMENT_U_LN: {
+@@ -319,7 +325,7 @@
+                     final String uri = readStructureString();
+                     final String localName = readStructureString();
+                     writer.writeStartElement("",localName,uri);
+-                    writeAttributes(writer);
++                    writeAttributes(writer, isInscope(depth));
+                     break;
+                 }
+                 case STATE_ELEMENT_LN: {
+@@ -326,7 +332,7 @@
+                     depth ++;
+                     final String localName = readStructureString();
+                     writer.writeStartElement(localName);
+-                    writeAttributes(writer);
++                    writeAttributes(writer, isInscope(depth));
+                     break;
+                 }
+                 case STATE_TEXT_AS_CHAR_ARRAY_SMALL: {
+@@ -345,7 +351,7 @@
+                     char[] c = readContentCharactersCopy();
+                     writer.writeCharacters(c,0,c.length);
+                     break;
+-                }                
++                }
+                 case STATE_TEXT_AS_STRING: {
+                     final String s = readContentString();
+                     writer.writeCharacters(s);
+@@ -388,53 +394,97 @@
+                     throw new XMLStreamException("Invalid State "+item);
+             }
+         } while(depth > 0 && _treeCount>0);
+-        
++
+     }
+-    
+-    private void writeAttributes(XMLStreamWriter writer) throws XMLStreamException {
++
++    private boolean isInscope(int depth) {
++        return _buffer.getInscopeNamespaces().size() > 0 && depth ==1;
++    }
++
++    /*
++     * @param inscope: true means write inscope namespaces
++     */
++    private void writeAttributes(XMLStreamWriter writer, boolean inscope) throws XMLStreamException {
++        // prefixSet to collect prefixes that are written before writing inscope namespaces
++        Set<String> prefixSet = inscope ? new HashSet<String>() : Collections.<String>emptySet();
+         int item = peekStructure();
+         if ((item & TYPE_MASK) == T_NAMESPACE_ATTRIBUTE) {
+             // Skip the namespace declarations on the element
+             // they will have been added already
+-            item = writeNamespaceAttributes(item, writer);
++            item = writeNamespaceAttributes(item, writer, inscope, prefixSet);
+         }
++        if (inscope) {
++            writeInscopeNamespaces(writer, prefixSet);
++        }
+         if ((item & TYPE_MASK) == T_ATTRIBUTE) {
+             writeAttributes(item, writer);
+-        }        
++        }
+     }
+-    
+-    private int writeNamespaceAttributes(int item, XMLStreamWriter writer) throws XMLStreamException {
++
++    private static String fixNull(String s) {
++        if (s == null) return "";
++        else return s;
++    }
++
++    /*
++     * @param prefixSet: already written prefixes
++     */
++    private void writeInscopeNamespaces(XMLStreamWriter writer, Set<String> prefixSet) throws XMLStreamException {
++        for (Map.Entry<String, String> e : _buffer.getInscopeNamespaces().entrySet()) {
++            String key = fixNull(e.getKey());
++            // If the prefix is already written, do not write the prefix
++            if (!prefixSet.contains(key)) {
++                writer.writeNamespace(key, e.getValue());
++            }
++        }
++    }
++
++    private int writeNamespaceAttributes(int item, XMLStreamWriter writer, boolean collectPrefixes, Set<String> prefixSet) throws XMLStreamException {
+         do {
+-            switch(_niiStateTable[item]){
++            switch(getNIIState(item)){
+                 case STATE_NAMESPACE_ATTRIBUTE:
+                     // Undeclaration of default namespace
+                     writer.writeDefaultNamespace("");
++                    if (collectPrefixes) {
++                        prefixSet.add("");
++                    }
+                     break;
+                 case STATE_NAMESPACE_ATTRIBUTE_P:
+                     // Undeclaration of namespace
+                     // Declaration with prefix
+-                    writer.writeNamespace(readStructureString(), "");
++                    String prefix = readStructureString();
++                    writer.writeNamespace(prefix, "");
++                    if (collectPrefixes) {
++                        prefixSet.add(prefix);
++                    }
+                     break;
+                 case STATE_NAMESPACE_ATTRIBUTE_P_U:
+                     // Declaration with prefix
+-                    writer.writeNamespace(readStructureString(), readStructureString());
++                    prefix = readStructureString();
++                    writer.writeNamespace(prefix, readStructureString());
++                    if (collectPrefixes) {
++                        prefixSet.add(prefix);
++                    }
+                     break;
+                 case STATE_NAMESPACE_ATTRIBUTE_U:
+                     // Default declaration
+                     writer.writeDefaultNamespace(readStructureString());
+-                    break;                
++                    if (collectPrefixes) {
++                        prefixSet.add("");
++                    }
++                    break;
+             }
+             readStructure();
+-            
++
+             item = peekStructure();
+         } while((item & TYPE_MASK) == T_NAMESPACE_ATTRIBUTE);
+-                
++
+         return item;
+     }
+-    
++
+     private void writeAttributes(int item, XMLStreamWriter writer) throws XMLStreamException {
+         do {
+-            switch(_aiiStateTable[item]) {
++            switch(getAIIState(item)) {
+                 case STATE_ATTRIBUTE_U_LN_QN: {
+                     final String uri = readStructureString();
+                     final String localName = readStructureString();
+@@ -443,7 +493,7 @@
+                     break;
+                 }
+                 case STATE_ATTRIBUTE_P_U_LN:
+-                    writer.writeAttribute(readStructureString(), readStructureString(), 
++                    writer.writeAttribute(readStructureString(), readStructureString(),
+                             readStructureString(), readContentString());
+                     break;
+                 case STATE_ATTRIBUTE_U_LN:
+@@ -455,9 +505,9 @@
+             }
+             // Ignore the attribute type
+             readStructureString();
+-            
++
+             readStructure();
+-            
++
+             item = peekStructure();
+         } while((item & TYPE_MASK) == T_ATTRIBUTE);
+     }
+--- old/src/share/classes/com/sun/xml/internal/txw2/DatatypeWriter.java	Thu Jul 30 18:19:41 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/txw2/DatatypeWriter.java	Thu Jul 30 18:19:40 2009
+@@ -57,7 +57,7 @@
+     void print(DT dt, NamespaceResolver resolver, StringBuilder buf);
+ 
+     static final List<DatatypeWriter<?>> BUILTIN = Collections.unmodifiableList(new AbstractList() {
+-        
++
+         private DatatypeWriter<?>[] BUILTIN_ARRAY = new DatatypeWriter<?>[] {
+             new DatatypeWriter<String>() {
+                 public Class<String> getType() {
+@@ -103,8 +103,8 @@
+                 }
+             }
+         };
+-                
+-        public DatatypeWriter<?> get(int n) { 
++
++        public DatatypeWriter<?> get(int n) {
+           return BUILTIN_ARRAY[n];
+         }
+ 
+--- old/src/share/classes/com/sun/xml/internal/txw2/NamespaceSupport.java	Thu Jul 30 18:19:45 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/txw2/NamespaceSupport.java	Thu Jul 30 18:19:44 2009
+@@ -27,7 +27,6 @@
+ // http://www.saxproject.org
+ // Written by David Megginson
+ // This class is in the Public Domain.  NO WARRANTY!
+-// $Id: NamespaceSupport.java,v 1.1 2005/04/14 21:45:18 kohsuke Exp $
+ 
+ package com.sun.xml.internal.txw2;
+ 
+@@ -97,7 +96,7 @@
+ final class NamespaceSupport
+ {
+ 
+-
++
+     ////////////////////////////////////////////////////////////////////
+     // Constants.
+     ////////////////////////////////////////////////////////////////////
+@@ -112,7 +111,7 @@
+      * to the "xml" prefix.</p>
+      */
+     public final static String XMLNS =
+-	"http://www.w3.org/XML/1998/namespace";
++        "http://www.w3.org/XML/1998/namespace";
+ 
+ 
+     /**
+@@ -132,7 +131,7 @@
+      * @see #isNamespaceDeclUris
+      */
+     public final static String NSDECL =
+-	"http://www.w3.org/xmlns/2000/";
++        "http://www.w3.org/xmlns/2000/";
+ 
+ 
+     /**
+@@ -139,9 +138,9 @@
+      * An empty enumeration.
+      */
+     private final static Enumeration EMPTY_ENUMERATION =
+-	new Vector().elements();
++        new Vector().elements();
+ 
+-
++
+     ////////////////////////////////////////////////////////////////////
+     // Constructor.
+     ////////////////////////////////////////////////////////////////////
+@@ -152,11 +151,11 @@
+      */
+     public NamespaceSupport ()
+     {
+-	reset();
++        reset();
+     }
+ 
+ 
+-
++
+     ////////////////////////////////////////////////////////////////////
+     // Context management.
+     ////////////////////////////////////////////////////////////////////
+@@ -175,11 +174,11 @@
+      */
+     public void reset ()
+     {
+-	contexts = new Context[32];
+-	namespaceDeclUris = false;
+-	contextPos = 0;
+-	contexts[contextPos] = currentContext = new Context();
+-	currentContext.declarePrefix("xml", XMLNS);
++        contexts = new Context[32];
++        namespaceDeclUris = false;
++        contextPos = 0;
++        contexts[contextPos] = currentContext = new Context();
++        currentContext.declarePrefix("xml", XMLNS);
+     }
+ 
+ 
+@@ -221,28 +220,28 @@
+      */
+     public void pushContext ()
+     {
+-	int max = contexts.length;
++        int max = contexts.length;
+ 
+-	contextPos++;
++        contextPos++;
+ 
+-				// Extend the array if necessary
+-	if (contextPos >= max) {
+-	    Context newContexts[] = new Context[max*2];
+-	    System.arraycopy(contexts, 0, newContexts, 0, max);
+-	    max *= 2;
+-	    contexts = newContexts;
+-	}
++                                // Extend the array if necessary
++        if (contextPos >= max) {
++            Context newContexts[] = new Context[max*2];
++            System.arraycopy(contexts, 0, newContexts, 0, max);
++            max *= 2;
++            contexts = newContexts;
++        }
+ 
+-				// Allocate the context if necessary.
+-	currentContext = contexts[contextPos];
+-	if (currentContext == null) {
+-	    contexts[contextPos] = currentContext = new Context();
+-	}
++                                // Allocate the context if necessary.
++        currentContext = contexts[contextPos];
++        if (currentContext == null) {
++            contexts[contextPos] = currentContext = new Context();
++        }
+ 
+-				// Set the parent, if any.
+-	if (contextPos > 0) {
+-	    currentContext.setParent(contexts[contextPos - 1]);
+-	}
++                                // Set the parent, if any.
++        if (contextPos > 0) {
++            currentContext.setParent(contexts[contextPos - 1]);
++        }
+     }
+ 
+ 
+@@ -261,16 +260,16 @@
+      */
+     public void popContext ()
+     {
+-	contexts[contextPos].clear();
+-	contextPos--;
+-	if (contextPos < 0) {
+-	    throw new EmptyStackException();
+-	}
+-	currentContext = contexts[contextPos];
++        contexts[contextPos].clear();
++        contextPos--;
++        if (contextPos < 0) {
++            throw new EmptyStackException();
++        }
++        currentContext = contexts[contextPos];
+     }
+ 
+ 
+-
++
+     ////////////////////////////////////////////////////////////////////
+     // Operations within a context.
+     ////////////////////////////////////////////////////////////////////
+@@ -300,8 +299,8 @@
+      * for attribute names, where the default prefix is not allowed.</p>
+      *
+      * @param prefix The prefix to declare, or the empty string to
+-     *	indicate the default element namespace.  This may never have
+-     *	the value "xml" or "xmlns".
++     *  indicate the default element namespace.  This may never have
++     *  the value "xml" or "xmlns".
+      * @param uri The Namespace URI to associate with the prefix.
+      * @return true if the prefix was legal, false otherwise
+      *
+@@ -311,12 +310,12 @@
+      */
+     public boolean declarePrefix (String prefix, String uri)
+     {
+-	if (prefix.equals("xml") || prefix.equals("xmlns")) {
+-	    return false;
+-	} else {
+-	    currentContext.declarePrefix(prefix, uri);
+-	    return true;
+-	}
++        if (prefix.equals("xml") || prefix.equals("xmlns")) {
++            return false;
++        } else {
++            currentContext.declarePrefix(prefix, uri);
++            return true;
++        }
+     }
+ 
+ 
+@@ -361,17 +360,17 @@
+      * @see #declarePrefix
+      * @see java.lang.String#intern */
+     public String [] processName (String qName, String parts[],
+-				  boolean isAttribute)
++                                  boolean isAttribute)
+     {
+-	String myParts[] = currentContext.processName(qName, isAttribute);
+-	if (myParts == null) {
+-	    return null;
+-	} else {
+-	    parts[0] = myParts[0];
+-	    parts[1] = myParts[1];
+-	    parts[2] = myParts[2];
+-	    return parts;
+-	}
++        String myParts[] = currentContext.processName(qName, isAttribute);
++        if (myParts == null) {
++            return null;
++        } else {
++            parts[0] = myParts[0];
++            parts[1] = myParts[1];
++            parts[2] = myParts[2];
++            return parts;
++        }
+     }
+ 
+ 
+@@ -389,7 +388,7 @@
+      */
+     public String getURI (String prefix)
+     {
+-	return currentContext.getURI(prefix);
++        return currentContext.getURI(prefix);
+     }
+ 
+ 
+@@ -409,7 +408,7 @@
+      */
+     public Enumeration getPrefixes ()
+     {
+-	return currentContext.getPrefixes();
++        return currentContext.getPrefixes();
+     }
+ 
+ 
+@@ -434,7 +433,7 @@
+      */
+     public String getPrefix (String uri)
+     {
+-	return currentContext.getPrefix(uri);
++        return currentContext.getPrefix(uri);
+     }
+ 
+ 
+@@ -463,15 +462,15 @@
+      */
+     public Enumeration getPrefixes (String uri)
+     {
+-	Vector prefixes = new Vector();
+-	Enumeration allPrefixes = getPrefixes();
+-	while (allPrefixes.hasMoreElements()) {
+-	    String prefix = (String)allPrefixes.nextElement();
+-	    if (uri.equals(getURI(prefix))) {
+-		prefixes.addElement(prefix);
+-	    }
+-	}
+-	return prefixes.elements();
++        Vector prefixes = new Vector();
++        Enumeration allPrefixes = getPrefixes();
++        while (allPrefixes.hasMoreElements()) {
++            String prefix = (String)allPrefixes.nextElement();
++            if (uri.equals(getURI(prefix))) {
++                prefixes.addElement(prefix);
++            }
++        }
++        return prefixes.elements();
+     }
+ 
+ 
+@@ -489,7 +488,7 @@
+      */
+     public Enumeration getDeclaredPrefixes ()
+     {
+-	return currentContext.getDeclaredPrefixes();
++        return currentContext.getDeclaredPrefixes();
+     }
+ 
+     /**
+@@ -501,21 +500,21 @@
+      * @since SAX 2.1alpha
+      *
+      * @exception IllegalStateException when attempting to set this
+-     *	after any context has been pushed.
++     *  after any context has been pushed.
+      */
+     public void setNamespaceDeclUris (boolean value)
+     {
+-	if (contextPos != 0)
+-	    throw new IllegalStateException ();
+-	if (value == namespaceDeclUris)
+-	    return;
+-	namespaceDeclUris = value;
+-	if (value)
+-	    currentContext.declarePrefix ("xmlns", NSDECL);
+-	else {
+-	    contexts[contextPos] = currentContext = new Context();
+-	    currentContext.declarePrefix("xml", XMLNS);
+-	}
++        if (contextPos != 0)
++            throw new IllegalStateException ();
++        if (value == namespaceDeclUris)
++            return;
++        namespaceDeclUris = value;
++        if (value)
++            currentContext.declarePrefix ("xmlns", NSDECL);
++        else {
++            contexts[contextPos] = currentContext = new Context();
++            currentContext.declarePrefix("xml", XMLNS);
++        }
+     }
+ 
+     /**
+@@ -525,10 +524,10 @@
+      * @since SAX 2.1alpha
+      */
+     public boolean isNamespaceDeclUris ()
+-	{ return namespaceDeclUris; }
++        { return namespaceDeclUris; }
+ 
+ 
+-
++
+     ////////////////////////////////////////////////////////////////////
+     // Internal state.
+     ////////////////////////////////////////////////////////////////////
+@@ -538,7 +537,7 @@
+     private int contextPos;
+     private boolean namespaceDeclUris;
+ 
+-
++
+     ////////////////////////////////////////////////////////////////////
+     // Internal classes.
+     ////////////////////////////////////////////////////////////////////
+@@ -557,286 +556,286 @@
+      */
+     final class Context {
+ 
+-	/**
+-	 * Create the root-level Namespace context.
+-	 */
+-	Context ()
+-	{
+-	    copyTables();
+-	}
++        /**
++         * Create the root-level Namespace context.
++         */
++        Context ()
++        {
++            copyTables();
++        }
+ 
+ 
+-	/**
+-	 * (Re)set the parent of this Namespace context.
+-	 * The context must either have been freshly constructed,
+-	 * or must have been cleared.
+-	 *
+-	 * @param context The parent Namespace context object.
+-	 */
+-	void setParent (Context parent)
+-	{
+-	    this.parent = parent;
+-	    declarations = null;
+-	    prefixTable = parent.prefixTable;
+-	    uriTable = parent.uriTable;
+-	    elementNameTable = parent.elementNameTable;
+-	    attributeNameTable = parent.attributeNameTable;
+-	    defaultNS = parent.defaultNS;
+-	    declSeen = false;
+-	}
++        /**
++         * (Re)set the parent of this Namespace context.
++         * The context must either have been freshly constructed,
++         * or must have been cleared.
++         *
++         * @param context The parent Namespace context object.
++         */
++        void setParent (Context parent)
++        {
++            this.parent = parent;
++            declarations = null;
++            prefixTable = parent.prefixTable;
++            uriTable = parent.uriTable;
++            elementNameTable = parent.elementNameTable;
++            attributeNameTable = parent.attributeNameTable;
++            defaultNS = parent.defaultNS;
++            declSeen = false;
++        }
+ 
+-	/**
+-	 * Makes associated state become collectible,
+-	 * invalidating this context.
+-	 * {@link #setParent} must be called before
+-	 * this context may be used again.
+-	 */
+-	void clear ()
+-	{
+-	    parent = null;
+-	    prefixTable = null;
+-	    uriTable = null;
+-	    elementNameTable = null;
+-	    attributeNameTable = null;
+-	    defaultNS = "";
+-	}
++        /**
++         * Makes associated state become collectible,
++         * invalidating this context.
++         * {@link #setParent} must be called before
++         * this context may be used again.
++         */
++        void clear ()
++        {
++            parent = null;
++            prefixTable = null;
++            uriTable = null;
++            elementNameTable = null;
++            attributeNameTable = null;
++            defaultNS = "";
++        }
+ 
+ 
+-	/**
+-	 * Declare a Namespace prefix for this context.
+-	 *
+-	 * @param prefix The prefix to declare.
+-	 * @param uri The associated Namespace URI.
+-	 * @see org.xml.sax.helpers.NamespaceSupport#declarePrefix
+-	 */
+-	void declarePrefix (String prefix, String uri)
+-	{
+-				// Lazy processing...
+-//	    if (!declsOK)
+-//		throw new IllegalStateException (
+-//		    "can't declare any more prefixes in this context");
+-	    if (!declSeen) {
+-		copyTables();
+-	    }
+-	    if (declarations == null) {
+-		declarations = new Vector();
+-	    }
++        /**
++         * Declare a Namespace prefix for this context.
++         *
++         * @param prefix The prefix to declare.
++         * @param uri The associated Namespace URI.
++         * @see org.xml.sax.helpers.NamespaceSupport#declarePrefix
++         */
++        void declarePrefix (String prefix, String uri)
++        {
++                                // Lazy processing...
++//          if (!declsOK)
++//              throw new IllegalStateException (
++//                  "can't declare any more prefixes in this context");
++            if (!declSeen) {
++                copyTables();
++            }
++            if (declarations == null) {
++                declarations = new Vector();
++            }
+ 
+-	    prefix = prefix.intern();
+-	    uri = uri.intern();
+-	    if ("".equals(prefix)) {
+-		    defaultNS = uri;
+-	    } else {
+-		prefixTable.put(prefix, uri);
+-		uriTable.put(uri, prefix); // may wipe out another prefix
+-	    }
+-	    declarations.addElement(prefix);
+-	}
++            prefix = prefix.intern();
++            uri = uri.intern();
++            if ("".equals(prefix)) {
++                    defaultNS = uri;
++            } else {
++                prefixTable.put(prefix, uri);
++                uriTable.put(uri, prefix); // may wipe out another prefix
++            }
++            declarations.addElement(prefix);
++        }
+ 
+ 
+-	/**
+-	 * Process an XML qualified name in this context.
+-	 *
+-	 * @param qName The XML qualified name.
+-	 * @param isAttribute true if this is an attribute name.
+-	 * @return An array of three strings containing the
+-	 *         URI part (or empty string), the local part,
+-	 *         and the raw name, all internalized, or null
+-	 *         if there is an undeclared prefix.
+-	 * @see org.xml.sax.helpers.NamespaceSupport#processName
+-	 */
+-	String [] processName (String qName, boolean isAttribute)
+-	{
+-	    String name[];
+-	    Hashtable table;
++        /**
++         * Process an XML qualified name in this context.
++         *
++         * @param qName The XML qualified name.
++         * @param isAttribute true if this is an attribute name.
++         * @return An array of three strings containing the
++         *         URI part (or empty string), the local part,
++         *         and the raw name, all internalized, or null
++         *         if there is an undeclared prefix.
++         * @see org.xml.sax.helpers.NamespaceSupport#processName
++         */
++        String [] processName (String qName, boolean isAttribute)
++        {
++            String name[];
++            Hashtable table;
+ 
+-				// Select the appropriate table.
+-	    if (isAttribute) {
+-		table = attributeNameTable;
+-	    } else {
+-		table = elementNameTable;
+-	    }
++                                // Select the appropriate table.
++            if (isAttribute) {
++                table = attributeNameTable;
++            } else {
++                table = elementNameTable;
++            }
+ 
+-				// Start by looking in the cache, and
+-				// return immediately if the name
+-				// is already known in this content
+-	    name = (String[])table.get(qName);
+-	    if (name != null) {
+-		return name;
+-	    }
++                                // Start by looking in the cache, and
++                                // return immediately if the name
++                                // is already known in this content
++            name = (String[])table.get(qName);
++            if (name != null) {
++                return name;
++            }
+ 
+-				// We haven't seen this name in this
+-				// context before.  Maybe in the parent
+-				// context, but we can't assume prefix
+-				// bindings are the same.
+-	    name = new String[3];
+-	    name[2] = qName.intern();
+-	    int index = qName.indexOf(':');
++                                // We haven't seen this name in this
++                                // context before.  Maybe in the parent
++                                // context, but we can't assume prefix
++                                // bindings are the same.
++            name = new String[3];
++            name[2] = qName.intern();
++            int index = qName.indexOf(':');
+ 
+ 
+-				// No prefix.
+-	    if (index == -1) {
+-		if (isAttribute) {
+-		    if (qName == "xmlns" && namespaceDeclUris)
+-			name[0] = NSDECL;
+-		    else
+-			name[0] = "";
+-		} else {
+-		    name[0] = defaultNS;
+-		}
+-		name[1] = name[2];
+-	    }
++                                // No prefix.
++            if (index == -1) {
++                if (isAttribute) {
++                    if (qName == "xmlns" && namespaceDeclUris)
++                        name[0] = NSDECL;
++                    else
++                        name[0] = "";
++                } else {
++                    name[0] = defaultNS;
++                }
++                name[1] = name[2];
++            }
+ 
+-				// Prefix
+-	    else {
+-		String prefix = qName.substring(0, index);
+-		String local = qName.substring(index+1);
+-		String uri;
+-		if ("".equals(prefix)) {
+-		    uri = defaultNS;
+-		} else {
+-		    uri = (String)prefixTable.get(prefix);
+-		}
+-		if (uri == null
+-			|| (!isAttribute && "xmlns".equals (prefix))) {
+-		    return null;
+-		}
+-		name[0] = uri;
+-		name[1] = local.intern();
+-	    }
++                                // Prefix
++            else {
++                String prefix = qName.substring(0, index);
++                String local = qName.substring(index+1);
++                String uri;
++                if ("".equals(prefix)) {
++                    uri = defaultNS;
++                } else {
++                    uri = (String)prefixTable.get(prefix);
++                }
++                if (uri == null
++                        || (!isAttribute && "xmlns".equals (prefix))) {
++                    return null;
++                }
++                name[0] = uri;
++                name[1] = local.intern();
++            }
+ 
+-				// Save in the cache for future use.
+-				// (Could be shared with parent context...)
+-	    table.put(name[2], name);
+-	    return name;
+-	}
++                                // Save in the cache for future use.
++                                // (Could be shared with parent context...)
++            table.put(name[2], name);
++            return name;
++        }
+ 
+ 
+-	/**
+-	 * Look up the URI associated with a prefix in this context.
+-	 *
+-	 * @param prefix The prefix to look up.
+-	 * @return The associated Namespace URI, or null if none is
+-	 *         declared.
+-	 * @see org.xml.sax.helpers.NamespaceSupport#getURI
+-	 */
+-	String getURI (String prefix)
+-	{
+-	    if ("".equals(prefix)) {
+-		return defaultNS;
+-	    } else if (prefixTable == null) {
+-		return null;
+-	    } else {
+-		return (String)prefixTable.get(prefix);
+-	    }
+-	}
++        /**
++         * Look up the URI associated with a prefix in this context.
++         *
++         * @param prefix The prefix to look up.
++         * @return The associated Namespace URI, or null if none is
++         *         declared.
++         * @see org.xml.sax.helpers.NamespaceSupport#getURI
++         */
++        String getURI (String prefix)
++        {
++            if ("".equals(prefix)) {
++                return defaultNS;
++            } else if (prefixTable == null) {
++                return null;
++            } else {
++                return (String)prefixTable.get(prefix);
++            }
++        }
+ 
+ 
+-	/**
+-	 * Look up one of the prefixes associated with a URI in this context.
+-	 *
+-	 * <p>Since many prefixes may be mapped to the same URI,
+-	 * the return value may be unreliable.</p>
+-	 *
+-	 * @param uri The URI to look up.
+-	 * @return The associated prefix, or null if none is declared.
+-	 * @see org.xml.sax.helpers.NamespaceSupport#getPrefix
+-	 */
+-	String getPrefix (String uri)
+-	{
+-	    if (uriTable == null) {
+-		return null;
+-	    } else {
+-		return (String)uriTable.get(uri);
+-	    }
+-	}
++        /**
++         * Look up one of the prefixes associated with a URI in this context.
++         *
++         * <p>Since many prefixes may be mapped to the same URI,
++         * the return value may be unreliable.</p>
++         *
++         * @param uri The URI to look up.
++         * @return The associated prefix, or null if none is declared.
++         * @see org.xml.sax.helpers.NamespaceSupport#getPrefix
++         */
++        String getPrefix (String uri)
++        {
++            if (uriTable == null) {
++                return null;
++            } else {
++                return (String)uriTable.get(uri);
++            }
++        }
+ 
+ 
+-	/**
+-	 * Return an enumeration of prefixes declared in this context.
+-	 *
+-	 * @return An enumeration of prefixes (possibly empty).
+-	 * @see org.xml.sax.helpers.NamespaceSupport#getDeclaredPrefixes
+-	 */
+-	Enumeration getDeclaredPrefixes ()
+-	{
+-	    if (declarations == null) {
+-		return EMPTY_ENUMERATION;
+-	    } else {
+-		return declarations.elements();
+-	    }
+-	}
++        /**
++         * Return an enumeration of prefixes declared in this context.
++         *
++         * @return An enumeration of prefixes (possibly empty).
++         * @see org.xml.sax.helpers.NamespaceSupport#getDeclaredPrefixes
++         */
++        Enumeration getDeclaredPrefixes ()
++        {
++            if (declarations == null) {
++                return EMPTY_ENUMERATION;
++            } else {
++                return declarations.elements();
++            }
++        }
+ 
+ 
+-	/**
+-	 * Return an enumeration of all prefixes currently in force.
+-	 *
+-	 * <p>The default prefix, if in force, is <em>not</em>
+-	 * returned, and will have to be checked for separately.</p>
+-	 *
+-	 * @return An enumeration of prefixes (never empty).
+-	 * @see org.xml.sax.helpers.NamespaceSupport#getPrefixes
+-	 */
+-	Enumeration getPrefixes ()
+-	{
+-	    if (prefixTable == null) {
+-		return EMPTY_ENUMERATION;
+-	    } else {
+-		return prefixTable.keys();
+-	    }
+-	}
++        /**
++         * Return an enumeration of all prefixes currently in force.
++         *
++         * <p>The default prefix, if in force, is <em>not</em>
++         * returned, and will have to be checked for separately.</p>
++         *
++         * @return An enumeration of prefixes (never empty).
++         * @see org.xml.sax.helpers.NamespaceSupport#getPrefixes
++         */
++        Enumeration getPrefixes ()
++        {
++            if (prefixTable == null) {
++                return EMPTY_ENUMERATION;
++            } else {
++                return prefixTable.keys();
++            }
++        }
+ 
+ 
+-
+-	////////////////////////////////////////////////////////////////
+-	// Internal methods.
+-	////////////////////////////////////////////////////////////////
+ 
++        ////////////////////////////////////////////////////////////////
++        // Internal methods.
++        ////////////////////////////////////////////////////////////////
+ 
+-	/**
+-	 * Copy on write for the internal tables in this context.
+-	 *
+-	 * <p>This class is optimized for the normal case where most
+-	 * elements do not contain Namespace declarations.</p>
+-	 */
+-	private void copyTables ()
+-	{
+-	    if (prefixTable != null) {
+-		prefixTable = (Hashtable)prefixTable.clone();
+-	    } else {
+-		prefixTable = new Hashtable();
+-	    }
+-	    if (uriTable != null) {
+-		uriTable = (Hashtable)uriTable.clone();
+-	    } else {
+-		uriTable = new Hashtable();
+-	    }
+-	    elementNameTable = new Hashtable();
+-	    attributeNameTable = new Hashtable();
+-	    declSeen = true;
+-	}
+ 
++        /**
++         * Copy on write for the internal tables in this context.
++         *
++         * <p>This class is optimized for the normal case where most
++         * elements do not contain Namespace declarations.</p>
++         */
++        private void copyTables ()
++        {
++            if (prefixTable != null) {
++                prefixTable = (Hashtable)prefixTable.clone();
++            } else {
++                prefixTable = new Hashtable();
++            }
++            if (uriTable != null) {
++                uriTable = (Hashtable)uriTable.clone();
++            } else {
++                uriTable = new Hashtable();
++            }
++            elementNameTable = new Hashtable();
++            attributeNameTable = new Hashtable();
++            declSeen = true;
++        }
+ 
+-
+-	////////////////////////////////////////////////////////////////
+-	// Protected state.
+-	////////////////////////////////////////////////////////////////
+ 
+-	Hashtable prefixTable;
+-	Hashtable uriTable;
+-	Hashtable elementNameTable;
+-	Hashtable attributeNameTable;
+-	String defaultNS = "";
+ 
++        ////////////////////////////////////////////////////////////////
++        // Protected state.
++        ////////////////////////////////////////////////////////////////
+ 
+-
+-	////////////////////////////////////////////////////////////////
+-	// Internal state.
+-	////////////////////////////////////////////////////////////////
++        Hashtable prefixTable;
++        Hashtable uriTable;
++        Hashtable elementNameTable;
++        Hashtable attributeNameTable;
++        String defaultNS = "";
+ 
+-	private Vector declarations = null;
+-	private boolean declSeen = false;
+-	private Context parent = null;
++
++
++        ////////////////////////////////////////////////////////////////
++        // Internal state.
++        ////////////////////////////////////////////////////////////////
++
++        private Vector declarations = null;
++        private boolean declSeen = false;
++        private Context parent = null;
+     }
+ }
+ 
+--- old/src/share/classes/com/sun/xml/internal/txw2/TXW.java	Thu Jul 30 18:19:48 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/txw2/TXW.java	Thu Jul 30 18:19:48 2009
+@@ -26,6 +26,7 @@
+ package com.sun.xml.internal.txw2;
+ 
+ import com.sun.xml.internal.txw2.output.XmlSerializer;
++import com.sun.xml.internal.txw2.output.TXWSerializer;
+ import com.sun.xml.internal.txw2.annotation.XmlElement;
+ import com.sun.xml.internal.txw2.annotation.XmlNamespace;
+ 
+@@ -84,6 +85,11 @@
+      *      The target of the writing.
+      */
+     public static <T extends TypedXmlWriter> T create( Class<T> rootElement, XmlSerializer out ) {
++        if (out instanceof TXWSerializer) {
++            TXWSerializer txws = (TXWSerializer) out;
++            return txws.txw._element(rootElement);
++        }
++
+         Document doc = new Document(out);
+         QName n = getTagName(rootElement);
+         return new ContainerElement(doc,null,n.getNamespaceURI(),n.getLocalPart())._cast(rootElement);
+@@ -102,6 +108,10 @@
+      * @see #create(Class,XmlSerializer)
+      */
+     public static <T extends TypedXmlWriter> T create( QName tagName, Class<T> rootElement, XmlSerializer out ) {
++        if (out instanceof TXWSerializer) {
++            TXWSerializer txws = (TXWSerializer) out;
++            return txws.txw._element(tagName,rootElement);
++        }
+         return new ContainerElement(new Document(out),null,tagName.getNamespaceURI(),tagName.getLocalPart())._cast(rootElement);
+     }
+ }
+--- old/src/share/classes/com/sun/xml/internal/txw2/annotation/XmlValue.java	Thu Jul 30 18:19:52 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/txw2/annotation/XmlValue.java	Thu Jul 30 18:19:51 2009
+@@ -26,11 +26,7 @@
+ package com.sun.xml.internal.txw2.annotation;
+ 
+ import static java.lang.annotation.RetentionPolicy.RUNTIME;
+-
+ import static java.lang.annotation.ElementType.METHOD;
+-
+-import com.sun.xml.internal.txw2.DatatypeWriter;
+-
+ import java.lang.annotation.Retention;
+ import java.lang.annotation.Target;
+ 
+--- old/src/share/classes/com/sun/xml/internal/txw2/output/CharacterEscapeHandler.java	Thu Jul 30 18:19:55 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/txw2/output/CharacterEscapeHandler.java	Thu Jul 30 18:19:55 2009
+@@ -32,13 +32,13 @@
+ /**
+  * Performs character escaping and write the result
+  * to the output.
+- * 
++ *
+  * @since 1.0.1
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+ public interface CharacterEscapeHandler {
+-    
++
+     /**
+      * @param ch The array of characters.
+      * @param start The starting position.
+@@ -45,6 +45,6 @@
+      * @param length The number of characters to use.
+      * @param isAttVal true if this is an attribute value literal.
+      */
+-    void escape( char ch[], int start, int length, boolean isAttVal, Writer out ) throws IOException; 
++    void escape( char ch[], int start, int length, boolean isAttVal, Writer out ) throws IOException;
+ 
+ }
+--- old/src/share/classes/com/sun/xml/internal/txw2/output/DataWriter.java	Thu Jul 30 18:19:59 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/txw2/output/DataWriter.java	Thu Jul 30 18:19:58 2009
+@@ -99,7 +99,7 @@
+ {
+ 
+ 
+-
++
+     ////////////////////////////////////////////////////////////////////
+     // Constructors.
+     ////////////////////////////////////////////////////////////////////
+@@ -110,7 +110,7 @@
+      *
+      * @param writer The character stream where the XML document
+      *        will be written.
+-     * @param encoding 
++     * @param encoding
+      *      If non-null string is specified, it is written as a part
+      *      of the XML declaration.
+      */
+@@ -121,7 +121,7 @@
+ 
+ 
+     public DataWriter (Writer writer, String encoding ) {
+-        this( writer, encoding, DumbEscapeHandler.theInstance ); 
++        this( writer, encoding, DumbEscapeHandler.theInstance );
+     }
+ 
+     public DataWriter (Writer writer) {
+@@ -129,7 +129,7 @@
+     }
+ 
+ 
+-
++
+     ////////////////////////////////////////////////////////////////////
+     // Accessors and setters.
+     ////////////////////////////////////////////////////////////////////
+@@ -145,7 +145,7 @@
+      * @return The number of spaces in each indentation step,
+      *         or 0 or less for no indentation.
+      * @see #setIndentStep(int)
+-     * 
++     *
+      * @deprecated
+      *      Only return the length of the indent string.
+      */
+@@ -161,7 +161,7 @@
+      * @param indentStep The new indent step (0 or less for no
+      *        indentation).
+      * @see #getIndentStep()
+-     * 
++     *
+      * @deprecated
+      *      Should use the version that takes string.
+      */
+@@ -171,13 +171,13 @@
+         for( ; indentStep>0; indentStep-- )   s.append(' ');
+         setIndentStep(s.toString());
+     }
+-    
++
+     public void setIndentStep(String s) {
+         this.indentStep = s;
+     }
+ 
+ 
+-
++
+     ////////////////////////////////////////////////////////////////////
+     // Override methods from XMLWriter.
+     ////////////////////////////////////////////////////////////////////
+@@ -324,7 +324,7 @@
+     }
+ 
+ 
+-
++
+     ////////////////////////////////////////////////////////////////////
+     // Internal methods.
+     ////////////////////////////////////////////////////////////////////
+@@ -348,7 +348,7 @@
+     }
+ 
+ 
+-
++
+     ////////////////////////////////////////////////////////////////////
+     // Constants.
+     ////////////////////////////////////////////////////////////////////
+@@ -358,7 +358,7 @@
+     private final static Object SEEN_DATA = new Object();
+ 
+ 
+-
++
+     ////////////////////////////////////////////////////////////////////
+     // Internal state.
+     ////////////////////////////////////////////////////////////////////
+--- old/src/share/classes/com/sun/xml/internal/txw2/output/DumbEscapeHandler.java	Thu Jul 30 18:20:02 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/txw2/output/DumbEscapeHandler.java	Thu Jul 30 18:20:02 2009
+@@ -32,19 +32,19 @@
+ /**
+  * Escape everything above the US-ASCII code range.
+  * A fallback position.
+- * 
++ *
+  * Works with any JDK, any encoding.
+- * 
++ *
+  * @since 1.0.1
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+ public class DumbEscapeHandler implements CharacterEscapeHandler {
+-    
++
+     private DumbEscapeHandler() {}  // no instanciation please
+-    
++
+     public static final CharacterEscapeHandler theInstance = new DumbEscapeHandler();
+-    
++
+     public void escape(char[] ch, int start, int length, boolean isAttVal, Writer out) throws IOException {
+         int limit = start+length;
+         for (int i = start; i < limit; i++) {
+--- old/src/share/classes/com/sun/xml/internal/txw2/output/IndentingXMLFilter.java	Thu Jul 30 18:20:06 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/txw2/output/IndentingXMLFilter.java	Thu Jul 30 18:20:05 2009
+@@ -103,7 +103,7 @@
+     }
+ 
+ 
+-
++
+     ////////////////////////////////////////////////////////////////////
+     // Override methods from XMLWriter.
+     ////////////////////////////////////////////////////////////////////
+--- old/src/share/classes/com/sun/xml/internal/txw2/output/ResultFactory.java	Thu Jul 30 18:20:09 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/txw2/output/ResultFactory.java	Thu Jul 30 18:20:09 2009
+@@ -48,7 +48,7 @@
+      * This method supports {@link javax.xml.transform.sax.SAXResult},
+      * {@link javax.xml.transform.stream.StreamResult}, and {@link javax.xml.transform.dom.DOMResult}.
+      *
+-     * @param result the Result that will receive output from the XmlSerializer 
++     * @param result the Result that will receive output from the XmlSerializer
+      * @return an implementation of XmlSerializer that will produce output on the supplied Result
+      */
+     public static XmlSerializer createSerializer(Result result) {
+@@ -58,6 +58,8 @@
+             return new DomSerializer((DOMResult) result);
+         if (result instanceof StreamResult)
+             return new StreamSerializer((StreamResult) result);
++        if (result instanceof TXWResult)
++            return new TXWSerializer(((TXWResult)result).getWriter());
+ 
+         throw new UnsupportedOperationException("Unsupported Result type: " + result.getClass().getName());
+     }
+--- old/src/share/classes/com/sun/xml/internal/txw2/output/XMLWriter.java	Thu Jul 30 18:20:13 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/txw2/output/XMLWriter.java	Thu Jul 30 18:20:12 2009
+@@ -29,7 +29,7 @@
+ // Written by David Megginson, david@megginson.com
+ // NO WARRANTY!  This class is in the public domain.
+ 
+-// Id: XMLWriter.java,v 1.5 2000/09/17 01:08:16 david Exp 
++// Id: XMLWriter.java,v 1.5 2000/09/17 01:08:16 david Exp
+ 
+ package com.sun.xml.internal.txw2.output;
+ 
+@@ -59,7 +59,7 @@
+  * state at any point in a filter chain), and it can be
+  * used directly as a ContentHandler for a SAX2 XMLReader.</p>
+  *
+- * <p>The client creates a document by invoking the methods for 
++ * <p>The client creates a document by invoking the methods for
+  * standard SAX2 events, always beginning with the
+  * {@link #startDocument startDocument} method and ending with
+  * the {@link #endDocument endDocument} method.  There are convenience
+@@ -78,7 +78,7 @@
+  * </pre>
+  *
+  * <p>Except that it is more efficient because it does not allocate
+- * a new empty attribute list each time.  The following code will send 
++ * a new empty attribute list each time.  The following code will send
+  * a simple XML document to standard output:</p>
+  *
+  * <pre>
+@@ -135,8 +135,8 @@
+  * explicitly to add newlines or indentation.  Alternatively, you
+  * can use {@link DataWriter}, which
+  * is derived from this class -- it is optimized for writing
+- * purely data-oriented (or field-oriented) XML, and does automatic 
+- * linebreaks and indentation (but does not support mixed content 
++ * purely data-oriented (or field-oriented) XML, and does automatic
++ * linebreaks and indentation (but does not support mixed content
+  * properly).</p>
+  *
+  *
+@@ -144,8 +144,8 @@
+  *
+  * <p>The writer contains extensive support for XML Namespaces, so that
+  * a client application does not have to keep track of prefixes and
+- * supply <var>xmlns</var> attributes.  By default, the XML writer will 
+- * generate Namespace declarations in the form _NS1, _NS2, etc., wherever 
++ * supply <var>xmlns</var> attributes.  By default, the XML writer will
++ * generate Namespace declarations in the form _NS1, _NS2, etc., wherever
+  * they are needed, as in the following example:</p>
+  *
+  * <pre>
+@@ -257,7 +257,7 @@
+  * </pre>
+  *
+  * <p>This approach is also useful for declaring Namespace prefixes
+- * that be used by qualified names appearing in attribute values or 
++ * that be used by qualified names appearing in attribute values or
+  * character data.</p>
+  *
+  * @author David Megginson, david@megginson.com
+@@ -273,8 +273,8 @@
+     ////////////////////////////////////////////////////////////////////
+ 
+ 
+-    
+ 
++
+     /**
+      * Create a new XML writer.
+      *
+@@ -282,11 +282,11 @@
+      *
+      * @param writer
+      *      The output destination, or null to use standard output.
+-     * @param encoding 
++     * @param encoding
+      *      If non-null string is specified, it is written as a part
+      *      of the XML declaration.
+      */
+-    public XMLWriter (Writer writer, String encoding, CharacterEscapeHandler _escapeHandler ) 
++    public XMLWriter (Writer writer, String encoding, CharacterEscapeHandler _escapeHandler )
+     {
+         init(writer,encoding);
+         this.escapeHandler = _escapeHandler;
+@@ -295,9 +295,9 @@
+     public XMLWriter (Writer writer, String encoding ) {
+         this( writer, encoding, DumbEscapeHandler.theInstance );
+     }
+-    
+ 
+ 
++
+     /**
+      * Internal initialization method.
+      *
+@@ -312,7 +312,7 @@
+     }
+ 
+ 
+-
++
+     ////////////////////////////////////////////////////////////////////
+     // Public methods.
+     ////////////////////////////////////////////////////////////////////
+@@ -342,8 +342,8 @@
+         elementLevel = 0;
+         startTagIsClosed = true;
+     }
+-    
+ 
++
+     /**
+      * Flush the output.
+      *
+@@ -359,12 +359,12 @@
+      * @see #reset()
+      */
+     public void flush ()
+-        throws IOException 
++        throws IOException
+     {
+         output.flush();
+     }
+-    
+ 
++
+     /**
+      * Set a new output destination for the document.
+      *
+@@ -390,33 +390,33 @@
+      * Set whether the writer should print out the XML declaration
+      * (&lt;?xml version='1.0' ... ?>).
+      * <p>
+-     * This option is set to true by default. 
++     * This option is set to true by default.
+      */
+     public void setXmlDecl( boolean _writeXmlDecl ) {
+         this.writeXmlDecl = _writeXmlDecl;
+     }
+-    
++
+     /**
+      * Sets the header string.
+-     * 
++     *
+      * This string will be written right after the xml declaration
+      * without any escaping. Useful for generating a boiler-plate
+      * DOCTYPE decl, PIs, and comments.
+-     * 
++     *
+      * @param _header
+-     *      passing null will work as if the empty string is passed.   
++     *      passing null will work as if the empty string is passed.
+      */
+     public void setHeader( String _header ) {
+         this.header = _header;
+     }
+-    
+ 
++
+     private final HashMap locallyDeclaredPrefix = new HashMap();
+     public void startPrefixMapping( String prefix, String uri ) throws SAXException {
+         locallyDeclaredPrefix.put(prefix,uri);
+     }
+-    
+ 
++
+     ////////////////////////////////////////////////////////////////////
+     // Methods from org.xml.sax.ContentHandler.
+     ////////////////////////////////////////////////////////////////////
+@@ -436,18 +436,18 @@
+     {
+         try {
+             reset();
+-            
++
+             if(writeXmlDecl) {
+                 String e="";
+                 if(encoding!=null)
+                     e = " encoding=\""+encoding+"\"";
+-            
++
+                 write("<?xml version=\"1.0\""+e+" standalone=\"yes\"?>\n");
+             }
+-            
++
+             if(header!=null)
+                 write(header);
+-            
++
+             super.startDocument();
+         } catch( IOException e ) {
+             throw new SAXException(e);
+@@ -484,8 +484,8 @@
+             throw new SAXException(e);
+         }
+     }
+-    
+ 
++
+     /**
+      * Write a start tag.
+      *
+@@ -519,7 +519,7 @@
+             write('<');
+             writeName(uri, localName, qName, true);
+             writeAttributes(atts);
+-            
++
+             // declare namespaces specified by the startPrefixMapping methods
+             if(!locallyDeclaredPrefix.isEmpty()) {
+                 Iterator itr = locallyDeclaredPrefix.entrySet().iterator();
+@@ -597,8 +597,8 @@
+             throw new SAXException(e);
+         }
+     }
+-    
+ 
++
+     /**
+      * Write character data.
+      *
+@@ -629,8 +629,8 @@
+             throw new SAXException(e);
+         }
+     }
+-    
+ 
++
+     /**
+      * Write ignorable whitespace.
+      *
+@@ -654,9 +654,9 @@
+             throw new SAXException(e);
+         }
+     }
+-    
+ 
+ 
++
+     /**
+      * Write a processing instruction.
+      *
+@@ -690,21 +690,21 @@
+             throw new SAXException(e);
+         }
+     }
+-    
+ 
+-
++
++
+     ////////////////////////////////////////////////////////////////////
+     // Convenience methods.
+     ////////////////////////////////////////////////////////////////////
+-    
+ 
+ 
++
+     /**
+      * Start a new element without a qname or attributes.
+      *
+      * <p>This method will provide a default empty attribute
+-     * list and an empty string for the qualified name.  
+-     * It invokes {@link 
++     * list and an empty string for the qualified name.
++     * It invokes {@link
+      * #startElement(String, String, String, Attributes)}
+      * directly.</p>
+      *
+@@ -956,14 +956,14 @@
+     }
+ 
+ 
+-
++
+     ////////////////////////////////////////////////////////////////////
+     // Internal methods.
+     ////////////////////////////////////////////////////////////////////
+-    
+ 
+-    
+ 
++
++
+     /**
+      * Write a raw character.
+      *
+@@ -972,8 +972,8 @@
+     private void write (char c) throws IOException {
+         output.write(c);
+     }
+-    
+ 
++
+     /**
+      * Write a raw string.
+      */
+@@ -1016,7 +1016,7 @@
+      * @exception SAXException If there is an error writing
+      *            the characters, this method will throw an
+      *            IOException wrapped in a SAXException.
+-     */    
++     */
+     private void writeEsc (char ch[], int start,
+                              int length, boolean isAttVal)
+         throws SAXException, IOException
+@@ -1023,8 +1023,8 @@
+     {
+         escapeHandler.escape(ch, start, length, isAttVal, output);
+     }
+-    
+ 
++
+     /**
+      * Write an element or attribute name.
+      *
+@@ -1042,7 +1042,7 @@
+     }
+ 
+ 
+-
++
+     ////////////////////////////////////////////////////////////////////
+     // Constants.
+     ////////////////////////////////////////////////////////////////////
+@@ -1050,7 +1050,7 @@
+     private final Attributes EMPTY_ATTS = new AttributesImpl();
+ 
+ 
+-
++
+     ////////////////////////////////////////////////////////////////////
+     // Internal state.
+     ////////////////////////////////////////////////////////////////////
+@@ -1066,7 +1066,7 @@
+      * , PIs, and comments.
+      */
+     private String header=null;
+-    
++
+     private final CharacterEscapeHandler escapeHandler;
+ 
+     private boolean startTagIsClosed = true;
+--- old/src/share/classes/com/sun/xml/internal/ws/addressing/EndpointReferenceUtil.java	Thu Jul 30 18:20:16 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/addressing/EndpointReferenceUtil.java	Thu Jul 30 18:20:16 2009
+@@ -23,7 +23,6 @@
+  * have any questions.
+  */
+ 
+-
+ package com.sun.xml.internal.ws.addressing;
+ 
+ import com.sun.istack.internal.NotNull;
+@@ -238,7 +237,7 @@
+                                 msEpr.referenceParameters = new MemberSubmissionEndpointReference.Elements();
+                                 msEpr.referenceParameters.elements = new ArrayList<Element>();
+                             }
+-                            msEpr.referenceParameters.elements.add((Element) refParams.item(i));
++                            msEpr.referenceParameters.elements.add((Element) refParams.item(j));
+                         }
+                     }
+                 } else if (child.getNamespaceURI().equals(AddressingVersion.W3C.nsUri) &&
+--- old/src/share/classes/com/sun/xml/internal/ws/addressing/WsaClientTube.java	Thu Jul 30 18:20:20 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/addressing/WsaClientTube.java	Thu Jul 30 18:20:19 2009
+@@ -27,9 +27,7 @@
+ 
+ import com.sun.istack.internal.NotNull;
+ import com.sun.xml.internal.ws.addressing.model.ActionNotSupportedException;
+-import com.sun.xml.internal.ws.addressing.model.MapRequiredException;
+ import com.sun.xml.internal.ws.api.WSBinding;
+-import com.sun.xml.internal.ws.api.message.HeaderList;
+ 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;
+@@ -44,10 +42,13 @@
+  * WsaClientTube appears in the Tubeline only if addressing is enabled.
+  * This tube checks the validity of addressing headers in the incoming messages
+  * based on the WSDL model.
+- *
++ * @author Rama Pulavarthi
+  * @author Arun Gupta
+  */
+-public final class WsaClientTube extends WsaTube {
++public class WsaClientTube extends WsaTube {
++    // capture if the request expects a reply so that it can be used to
++    // determine if its oneway for response validation.
++    protected boolean expectReply = true;
+     public WsaClientTube(WSDLPort wsdlPort, WSBinding binding, Tube next) {
+         super(wsdlPort, binding, next);
+     }
+@@ -61,13 +62,16 @@
+     }
+ 
+     public @NotNull NextAction processRequest(Packet request) {
++        expectReply = request.expectReply;
+         return doInvoke(next,request);
+    }
+ 
+     public @NotNull NextAction processResponse(Packet response) {
+         // if one-way then, no validation
+-        if (response.getMessage() != null)
++        if (response.getMessage() != null) {
+             response = validateInboundHeaders(response);
++            response.addSatellite(new WsaPropertyBag(addressingVersion,soapVersion,response));
++        }
+ 
+         return doReturnWith(response);
+     }
+@@ -74,7 +78,7 @@
+ 
+ 
+     @Override
+-    public void validateAction(Packet packet) {
++    protected void validateAction(Packet packet) {
+         //There may not be a WSDL operation.  There may not even be a WSDL.
+         //For instance this may be a RM CreateSequence message.
+         WSDLBoundOperation wbo = getWSDLBoundOperation(packet);
+@@ -91,14 +95,4 @@
+             throw new ActionNotSupportedException(gotA);
+     }
+ 
+-    @Override
+-    protected void checkMandatoryHeaders(Packet packet, boolean foundAction, boolean foundTo, boolean foundMessageID, boolean foundRelatesTo) {
+-        super.checkMandatoryHeaders(packet, foundAction, foundTo, foundMessageID, foundRelatesTo);
+-        
+-//        if(!foundRelatesTo)
+-//            // RelatesTo required as per
+-//            // Table 5-3 of http://www.w3.org/TR/2006/WD-ws-addr-wsdl-20060216/#wsdl11requestresponse
+-//            throw new MapRequiredException(addressingVersion.relatesToTag);
+-
+-    }
+ }
+--- old/src/share/classes/com/sun/xml/internal/ws/addressing/WsaServerTube.java	Thu Jul 30 18:20:24 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/addressing/WsaServerTube.java	Thu Jul 30 18:20:23 2009
+@@ -29,8 +29,8 @@
+ import static com.sun.xml.internal.ws.addressing.W3CAddressingConstants.ONLY_ANONYMOUS_ADDRESS_SUPPORTED;
+ import static com.sun.xml.internal.ws.addressing.W3CAddressingConstants.ONLY_NON_ANONYMOUS_ADDRESS_SUPPORTED;
+ import com.sun.xml.internal.ws.addressing.model.ActionNotSupportedException;
+-import com.sun.xml.internal.ws.addressing.model.InvalidMapException;
+-import com.sun.xml.internal.ws.addressing.model.MapRequiredException;
++import com.sun.xml.internal.ws.addressing.model.InvalidAddressingHeaderException;
++import com.sun.xml.internal.ws.addressing.model.MissingAddressingHeaderException;
+ import com.sun.xml.internal.ws.api.EndpointAddress;
+ import com.sun.xml.internal.ws.api.SOAPVersion;
+ import com.sun.xml.internal.ws.api.WSBinding;
+@@ -42,12 +42,9 @@
+ 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.pipe.ClientTubeAssemblerContext;
+-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.TransportTubeFactory;
+-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.*;
++import com.sun.xml.internal.ws.api.server.WSEndpoint;
++import com.sun.xml.internal.ws.developer.JAXWSProperties;
+ import com.sun.xml.internal.ws.message.FaultDetailHeader;
+ import com.sun.xml.internal.ws.resources.AddressingMessages;
+ 
+@@ -54,16 +51,18 @@
+ import javax.xml.soap.SOAPFault;
+ import javax.xml.ws.WebServiceException;
+ import java.net.URI;
++import java.util.logging.Level;
+ import java.util.logging.Logger;
+ 
+ /**
+  * Handles WS-Addressing for the server.
+  *
++ * @author Rama Pulavarthi
+  * @author Kohsuke Kawaguchi
+  * @author Arun Gupta
+  */
+-public final class WsaServerTube extends WsaTube {
+-
++public class WsaServerTube extends WsaTube {
++    private WSEndpoint endpoint;
+     // store the replyTo/faultTo of the message currently being processed.
+     // both will be set to non-null in processRequest
+     private WSEndpointReference replyTo;
+@@ -71,15 +70,18 @@
+     private boolean isAnonymousRequired = false;
+     /**
+      * WSDLBoundOperation calculated on the Request payload.
+-     * Used for determining ReplyTo or Fault Action for non-anonymous responses     * 
++     * Used for determining ReplyTo or Fault Action for non-anonymous responses     *
+      */
+     private WSDLBoundOperation wbo;
+-    public WsaServerTube(@NotNull WSDLPort wsdlPort, WSBinding binding, Tube next) {
++    public WsaServerTube(WSEndpoint endpoint, @NotNull WSDLPort wsdlPort, WSBinding binding, Tube next) {
+         super(wsdlPort, binding, next);
++        this.endpoint = endpoint;
++
+     }
+ 
+     public WsaServerTube(WsaServerTube that, TubeCloner cloner) {
+         super(that, cloner);
++        endpoint = that.endpoint;
+     }
+ 
+     public WsaServerTube copy(TubeCloner cloner) {
+@@ -90,6 +92,8 @@
+         Message msg = request.getMessage();
+         if(msg==null)   return doInvoke(next,request); // hmm?
+ 
++        // expose bunch of addressing related properties for advanced applications
++        request.addSatellite(new WsaPropertyBag(addressingVersion,soapVersion,request));
+ 
+         // Store request ReplyTo and FaultTo in requestPacket.invocationProperties
+         // so that they can be used after responsePacket is received.
+@@ -97,19 +101,21 @@
+ 
+         HeaderList hl = request.getMessage().getHeaders();
+         try {
+-        replyTo = hl.getReplyTo(addressingVersion, soapVersion);
+-        faultTo = hl.getFaultTo(addressingVersion, soapVersion);
+-        } catch (InvalidMapException e) {
+-            SOAPFault soapFault = helper.newInvalidMapFault(e, addressingVersion);
++            replyTo = hl.getReplyTo(addressingVersion, soapVersion);
++            faultTo = hl.getFaultTo(addressingVersion, soapVersion);
++        } catch (InvalidAddressingHeaderException e) {
++            LOGGER.log(Level.WARNING,
++                    addressingVersion.getInvalidMapText()+", Problem header:" + e.getProblemHeader()+ ", Reason: "+ e.getSubsubcode(),e);
++            SOAPFault soapFault = helper.createInvalidAddressingHeaderFault(e, addressingVersion);
+             // WS-A fault processing for one-way methods
+-            if (request.getMessage().isOneWay(wsdlPort)) {
+-                request.createServerResponse(null, wsdlPort, null, binding);
+-                return doInvoke(next, request);
++            if ((wsdlPort!=null) && request.getMessage().isOneWay(wsdlPort)) {
++                Packet response = request.createServerResponse(null, wsdlPort, null, binding);
++                return doReturnWith(response);
+             }
+ 
+             Message m = Messages.create(soapFault);
+             if (soapVersion == SOAPVersion.SOAP_11) {
+-                FaultDetailHeader s11FaultDetailHeader = new FaultDetailHeader(addressingVersion, addressingVersion.problemHeaderQNameTag.getLocalPart(), e.getMapQName());
++                FaultDetailHeader s11FaultDetailHeader = new FaultDetailHeader(addressingVersion, addressingVersion.problemHeaderQNameTag.getLocalPart(), e.getProblemHeader());
+                 m.getHeaders().add(s11FaultDetailHeader);
+             }
+ 
+@@ -116,15 +122,7 @@
+             Packet response = request.createServerResponse(m, wsdlPort, null, binding);
+             return doReturnWith(response);
+         }
+-        String messageId = hl.getMessageID(addressingVersion, soapVersion);
+ 
+-        // TODO: This is probably not a very good idea.
+-        // if someone wants to get this data, let them get from HeaderList.
+-        // we can even provide a convenience method
+-        //  -- KK.
+-        request.invocationProperties.put(REQUEST_MESSAGE_ID, messageId);
+-
+-
+         // defaulting
+         if (replyTo == null)    replyTo = addressingVersion.anonymousEpr;
+         if (faultTo == null)    faultTo = replyTo;
+@@ -136,7 +134,7 @@
+         // if one-way message and WS-A header processing fault has occurred,
+         // then do no further processing
+         if (p.getMessage() == null)
+-            // TODO: record the problem that we are dropping this problem on the floor.
++            // request message is invalid, exception is logged by now  and response is sent back  with null message
+             return doReturnWith(p);
+ 
+         // if we find an error in addressing header, just turn around the direction here
+@@ -201,7 +199,7 @@
+         if (packet.transportBackChannel != null)
+             packet.transportBackChannel.close();
+ 
+-        if (packet.getMessage().isOneWay(wsdlPort)) {
++        if ((wsdlPort!=null) && packet.getMessage().isOneWay(wsdlPort)) {
+             // one way message but with replyTo. I believe this is a hack for WS-TX - KK.
+             LOGGER.fine(AddressingMessages.NON_ANONYMOUS_RESPONSE_ONEWAY());
+             return;
+@@ -219,7 +217,7 @@
+         // we need to assemble a pipeline to talk to this endpoint.
+         // TODO: what to pass as WSService?
+         Tube transport = TransportTubeFactory.create(Thread.currentThread().getContextClassLoader(),
+-            new ClientTubeAssemblerContext(adrs, wsdlPort, null, binding));
++            new ClientTubeAssemblerContext(adrs, wsdlPort, null, binding,endpoint.getContainer()));
+ 
+         packet.endpointAddress = adrs;
+         String action = packet.getMessage().isFault() ?
+@@ -227,11 +225,12 @@
+                 helper.getOutputAction(wbo);
+         //set the SOAPAction, as its got to be same as wsa:Action
+         packet.soapAction = action;
++        packet.expectReply = false;
+         Fiber.current().runSync(transport, packet);
+     }
+ 
+     @Override
+-    public void validateAction(Packet packet) {
++    protected void validateAction(Packet packet) {
+         //There may not be a WSDL operation.  There may not even be a WSDL.
+         //For instance this may be a RM CreateSequence message.
+         WSDLBoundOperation wbo = getWSDLBoundOperation(packet);
+@@ -254,9 +253,8 @@
+         }
+     }
+ 
+-    @Override
+-    public void checkCardinality(Packet packet) {
+-        super.checkCardinality(packet);
++    protected void checkMessageAddressingProperties(Packet packet) {
++        super.checkMessageAddressingProperties(packet);
+ 
+         // wsaw:Anonymous validation
+         WSDLBoundOperation wbo = getWSDLBoundOperation(packet);
+@@ -270,8 +268,8 @@
+             try {
+                 new EndpointAddress(URI.create(replyTo.getAddress()));
+             } catch (Exception e) {
+-                throw new InvalidMapException(addressingVersion.replyToTag, addressingVersion.invalidAddressTag);
+-            } 
++                throw new InvalidAddressingHeaderException(addressingVersion.replyToTag, addressingVersion.invalidAddressTag);
++            }
+         }
+         //for now only validate ReplyTo
+         /*
+@@ -279,7 +277,7 @@
+             try {
+                 new EndpointAddress(URI.create(faultTo.getAddress()));
+             } catch (IllegalArgumentException e) {
+-                throw new InvalidMapException(addressingVersion.faultToTag, addressingVersion.invalidAddressTag);
++                throw new InvalidAddressingHeaderException(addressingVersion.faultToTag, addressingVersion.invalidAddressTag);
+             }
+         }
+         */
+@@ -286,24 +284,6 @@
+ 
+     }
+ 
+-    protected void checkMandatoryHeaders(
+-        Packet packet, boolean foundAction, boolean foundTo, boolean foundMessageId, boolean foundRelatesTo) {
+-        super.checkMandatoryHeaders(packet, foundAction, foundTo, foundMessageId, foundRelatesTo);
+-        WSDLBoundOperation wbo = getWSDLBoundOperation(packet);
+-        // no need to check for for non-application messages
+-        if (wbo == null)
+-            return;
+-
+-        // if no wsa:To header is found
+-        if (!foundTo)
+-            throw new MapRequiredException(addressingVersion.toTag);
+-
+-        // if two-way and no wsa:MessageID is found
+-        if (!wbo.getOperation().isOneWay() && !foundMessageId)
+-            throw new MapRequiredException(addressingVersion.messageIDTag);
+-    }
+-
+-
+     final void checkAnonymousSemantics(WSDLBoundOperation wbo, WSEndpointReference replyTo, WSEndpointReference faultTo) {
+         // no check if Addressing is not enabled or is Member Submission
+         if (addressingVersion == null || addressingVersion == AddressingVersion.MEMBER)
+@@ -329,17 +309,17 @@
+             break;
+         case prohibited:
+             if (replyToValue != null && replyToValue.equals(addressingVersion.anonymousUri))
+-                throw new InvalidMapException(addressingVersion.replyToTag, ONLY_NON_ANONYMOUS_ADDRESS_SUPPORTED);
++                throw new InvalidAddressingHeaderException(addressingVersion.replyToTag, ONLY_NON_ANONYMOUS_ADDRESS_SUPPORTED);
+ 
+             if (faultToValue != null && faultToValue.equals(addressingVersion.anonymousUri))
+-                throw new InvalidMapException(addressingVersion.faultToTag, ONLY_NON_ANONYMOUS_ADDRESS_SUPPORTED);
++                throw new InvalidAddressingHeaderException(addressingVersion.faultToTag, ONLY_NON_ANONYMOUS_ADDRESS_SUPPORTED);
+             break;
+         case required:
+             if (replyToValue != null && !replyToValue.equals(addressingVersion.anonymousUri))
+-                throw new InvalidMapException(addressingVersion.replyToTag, ONLY_ANONYMOUS_ADDRESS_SUPPORTED);
++                throw new InvalidAddressingHeaderException(addressingVersion.replyToTag, ONLY_ANONYMOUS_ADDRESS_SUPPORTED);
+ 
+             if (faultToValue != null && !faultToValue.equals(addressingVersion.anonymousUri))
+-                throw new InvalidMapException(addressingVersion.faultToTag, ONLY_ANONYMOUS_ADDRESS_SUPPORTED);
++                throw new InvalidAddressingHeaderException(addressingVersion.faultToTag, ONLY_ANONYMOUS_ADDRESS_SUPPORTED);
+             break;
+         default:
+             // cannot reach here
+@@ -347,6 +327,10 @@
+         }
+     }
+ 
++    /**
++     * @deprecated
++     *      Use {@link JAXWSProperties#ADDRESSING_MESSAGEID}.
++     */
+     public static final String REQUEST_MESSAGE_ID = "com.sun.xml.internal.ws.addressing.request.messageID";
+ 
+     private static final Logger LOGGER = Logger.getLogger(WsaServerTube.class.getName());
+--- old/src/share/classes/com/sun/xml/internal/ws/addressing/WsaTube.java	Thu Jul 30 18:20:27 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/addressing/WsaTube.java	Thu Jul 30 18:20:27 2009
+@@ -26,8 +26,8 @@
+ package com.sun.xml.internal.ws.addressing;
+ 
+ import com.sun.istack.internal.NotNull;
+-import com.sun.xml.internal.ws.addressing.model.InvalidMapException;
+-import com.sun.xml.internal.ws.addressing.model.MapRequiredException;
++import com.sun.xml.internal.ws.addressing.model.InvalidAddressingHeaderException;
++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.addressing.AddressingVersion;
+@@ -50,7 +50,10 @@
+ import javax.xml.stream.XMLStreamException;
+ import javax.xml.ws.WebServiceException;
+ import javax.xml.ws.soap.AddressingFeature;
++import javax.xml.ws.soap.SOAPBinding;
+ import java.util.Iterator;
++import java.util.logging.Logger;
++import java.util.logging.Level;
+ 
+ /**
+  * WS-Addressing processing code shared between client and server.
+@@ -58,6 +61,7 @@
+  * <p>
+  * This tube is used only when WS-Addressing is enabled.
+  *
++ * @author Rama Pulavarthi
+  * @author Arun Gupta
+  */
+ abstract class WsaTube extends AbstractFilterTubeImpl {
+@@ -119,25 +123,27 @@
+      * a fault message and returns that. Otherwise
+      * it will pass through the parameter 'packet' object to the return value.
+      */
+-    protected final Packet validateInboundHeaders(Packet packet) {
++    protected Packet validateInboundHeaders(Packet packet) {
+         SOAPFault soapFault;
+         FaultDetailHeader s11FaultDetailHeader;
+ 
+         try {
+-            checkCardinality(packet);
+-
++            checkMessageAddressingProperties(packet);
+             return packet;
+-        } catch (InvalidMapException e) {
+-            soapFault = helper.newInvalidMapFault(e, addressingVersion);
+-            s11FaultDetailHeader = new FaultDetailHeader(addressingVersion, addressingVersion.problemHeaderQNameTag.getLocalPart(), e.getMapQName());
+-        } catch (MapRequiredException e) {
+-            soapFault = helper.newMapRequiredFault(e, addressingVersion);
+-            s11FaultDetailHeader = new FaultDetailHeader(addressingVersion, addressingVersion.problemHeaderQNameTag.getLocalPart(), e.getMapQName());
++        } catch (InvalidAddressingHeaderException e) {
++            LOGGER.log(Level.WARNING,
++                    addressingVersion.getInvalidMapText()+", Problem header:" + e.getProblemHeader()+ ", Reason: "+ e.getSubsubcode(),e);
++            soapFault = helper.createInvalidAddressingHeaderFault(e, addressingVersion);
++            s11FaultDetailHeader = new FaultDetailHeader(addressingVersion, addressingVersion.problemHeaderQNameTag.getLocalPart(), e.getProblemHeader());
++        } catch (MissingAddressingHeaderException e) {
++            LOGGER.log(Level.WARNING,addressingVersion.getMapRequiredText()+", Problem header:"+ e.getMissingHeaderQName(),e);
++            soapFault = helper.newMapRequiredFault(e);
++            s11FaultDetailHeader = new FaultDetailHeader(addressingVersion, addressingVersion.problemHeaderQNameTag.getLocalPart(), e.getMissingHeaderQName());
+         }
+ 
+         if (soapFault != null) {
+             // WS-A fault processing for one-way methods
+-            if (packet.getMessage().isOneWay(wsdlPort)) {
++            if ((wsdlPort !=null)  && packet.getMessage().isOneWay(wsdlPort)) {
+                 return packet.createServerResponse(null, wsdlPort, null, binding);
+             }
+ 
+@@ -146,13 +152,28 @@
+                 m.getHeaders().add(s11FaultDetailHeader);
+             }
+ 
+-            Packet response = packet.createServerResponse(m, wsdlPort, null,  binding);
+-            return response;
++            return packet.createServerResponse(m, wsdlPort, null,  binding);
+         }
+ 
+         return packet;
+     }
+ 
++    /**
++     * This method checks all the WS-Addressing headers are valid and as per the spec definded rules.
++     * Mainly it checks the cardinality of the WSA headers and checks that mandatory headers exist.
++     * It also checks if the SOAPAction is equal to wsa:Action value when non-empty.
++     *
++     * Override this method if you need to additional checking of headers other than just existence of the headers.
++     * For ex: On server-side, check Anonymous and Non-Anonymous semantics in addition to checking cardinality.
++     *
++     * Override checkMandatoryHeaders(Packet p) to have different validation rules for different versions
++     *
++     * @param packet
++     */
++    protected void checkMessageAddressingProperties(Packet packet) {
++        checkCardinality(packet);
++    }
++
+     final boolean isAddressingEngagedOrRequired(Packet packet, WSBinding binding) {
+         if (AddressingVersion.isRequired(binding))
+             return true;
+@@ -187,7 +208,7 @@
+      * <li>an uknown WS-Addressing header is present</li>
+      * </ul>
+      */
+-    public void checkCardinality(Packet packet) {
++    protected void checkCardinality(Packet packet) {
+         Message message = packet.getMessage();
+         if (message == null) {
+             if (addressingRequired)
+@@ -202,7 +223,7 @@
+             // no WS-A headers are found
+             if (addressingRequired)
+                 // if WS-A is required, then throw an exception looking for wsa:Action header
+-                throw new MapRequiredException(addressingVersion.actionTag);
++                throw new MissingAddressingHeaderException(addressingVersion.actionTag,packet);
+             else
+                 // else no need to process
+                 return;
+@@ -284,7 +305,7 @@
+ 
+         // check for invalid cardinality first before checking for mandatory headers
+         if (duplicateHeader != null) {
+-            throw new InvalidMapException(duplicateHeader, addressingVersion.invalidCardinalityTag);
++            throw new InvalidAddressingHeaderException(duplicateHeader, addressingVersion.invalidCardinalityTag);
+         }
+ 
+         // WS-A is engaged if wsa:Action header is found
+@@ -296,7 +317,16 @@
+         // Both wsa:Action and wsa:To MUST be present on request (for oneway MEP) and
+         // response messages (for oneway and request/response MEP only)
+         if (engaged || addressingRequired) {
+-            checkMandatoryHeaders(packet, foundAction, foundTo, foundMessageId, foundRelatesTo);
++            // Check for mandatory headers always (even for Protocol messages).
++            // If it breaks any interop scenarios, Remove the comments.
++            /*
++            WSDLBoundOperation wbo = getWSDLBoundOperation(packet);
++            // no need to check for for non-application messages
++            if (wbo == null)
++                return;
++            */
++            checkMandatoryHeaders(packet, foundAction, foundTo, foundReplyTo,
++                    foundFaultTo, foundMessageId, foundRelatesTo);
+         }
+     }
+ 
+@@ -306,18 +336,14 @@
+         // TODO: always in current role, this may not to be fixed.
+         if (binding == null)
+             return true;
++        return ((SOAPBinding)binding).getRoles().contains(header.getRole(soapVersion));
+ 
+-
+-        if (soapVersion == SOAPVersion.SOAP_11) {
+-            // Rama: Why not checking for SOAP 1.1?
+-            return true;
+-        } else {
+-            String role = header.getRole(soapVersion);
+-            return (role.equals(SOAPVersion.SOAP_12.implicitRole));
+-        }
+     }
+ 
+     protected final WSDLBoundOperation getWSDLBoundOperation(Packet packet) {
++        //we can find Req/Response or Oneway only with WSDLModel
++        if(wsdlPort == null)
++            return null;
+         return packet.getMessage().getOperation(wsdlPort);
+     }
+ 
+@@ -326,21 +352,34 @@
+         if (gotA == null)
+             throw new WebServiceException(AddressingMessages.VALIDATION_SERVER_NULL_ACTION());
+         if(packet.soapAction != null && !packet.soapAction.equals("\"\"") && !packet.soapAction.equals("\""+gotA+"\"")) {
+-            throw new InvalidMapException(addressingVersion.actionTag, addressingVersion.actionMismatchTag);
++            throw new InvalidAddressingHeaderException(addressingVersion.actionTag, addressingVersion.actionMismatchTag);
+         }
+     }
+ 
+     protected abstract void validateAction(Packet packet);
+-    protected void checkMandatoryHeaders(
+-        Packet packet, boolean foundAction, boolean foundTo, boolean foundMessageId, boolean foundRelatesTo) {
+-        WSDLBoundOperation wbo = getWSDLBoundOperation(packet);
+-        // no need to check for for non-application messages
+-        if (wbo == null)
+-            return;
+ 
++    /**
++     * This should be called only when Addressing is engaged.
++     *
++     * Checks only for presence of wsa:Action and validates that wsa:Action
++     * equals SOAPAction header when non-empty
++     * Should be overridden if other wsa headers need to be checked based on version.
++     *
++     * @param packet
++     * @param foundAction
++     * @param foundTo
++     * @param foundReplyTo
++     * @param foundFaultTo
++     * @param foundMessageId
++     * @param foundRelatesTo
++     */
++    protected void checkMandatoryHeaders(
++        Packet packet, boolean foundAction, boolean foundTo, boolean foundReplyTo,
++            boolean foundFaultTo, boolean foundMessageId, boolean foundRelatesTo) {
+         // if no wsa:Action header is found
+         if (!foundAction)
+-            throw new MapRequiredException(addressingVersion.actionTag);
++            throw new MissingAddressingHeaderException(addressingVersion.actionTag,packet);
+         validateSOAPAction(packet);
+     }
++    private static final Logger LOGGER = Logger.getLogger(WsaTube.class.getName());
+ }
+--- old/src/share/classes/com/sun/xml/internal/ws/addressing/WsaTubeHelper.java	Thu Jul 30 18:20:31 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/addressing/WsaTubeHelper.java	Thu Jul 30 18:20:30 2009
+@@ -25,8 +25,8 @@
+ 
+ package com.sun.xml.internal.ws.addressing;
+ 
+-import com.sun.xml.internal.ws.addressing.model.InvalidMapException;
+-import com.sun.xml.internal.ws.addressing.model.MapRequiredException;
++import com.sun.xml.internal.ws.addressing.model.InvalidAddressingHeaderException;
++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.addressing.AddressingVersion;
+@@ -41,11 +41,8 @@
+ import com.sun.xml.internal.ws.model.JavaMethodImpl;
+ import com.sun.xml.internal.ws.model.CheckedExceptionImpl;
+ import com.sun.istack.internal.Nullable;
+-import com.sun.istack.internal.NotNull;
+ import org.w3c.dom.Element;
+ 
+-import javax.xml.bind.Marshaller;
+-import javax.xml.bind.Unmarshaller;
+ import javax.xml.namespace.QName;
+ import javax.xml.soap.Detail;
+ import javax.xml.soap.SOAPConstants;
+@@ -218,10 +215,10 @@
+     public String getSOAPAction(Packet packet) {
+         String action = "";
+ 
+-        if (packet == null)
++        if (packet == null || packet.getMessage() == null)
+             return action;
+ 
+-        if (packet.getMessage() == null)
++        if (wsdlPort == null)
+             return action;
+ 
+         WSDLBoundOperation op = packet.getMessage().getOperation(wsdlPort);
+@@ -234,10 +231,11 @@
+     }
+ 
+     public String getOutputAction(Packet packet) {
+-        String action = AddressingVersion.UNSET_OUTPUT_ACTION;
++        //String action = AddressingVersion.UNSET_OUTPUT_ACTION;
++        String action = null;
+         if(seiModel!= null) {
+             JavaMethodImpl jm = (JavaMethodImpl) packet.getMessage().getMethod(seiModel);
+-            if(jm.getOutputAction() != null && !jm.getOutputAction().equals("")) {
++            if(jm != null && jm.getOutputAction() != null && !jm.getOutputAction().equals("")) {
+                 return jm.getOutputAction();
+             }
+         }
+@@ -257,8 +255,8 @@
+         }
+         return action;
+     }
+-    public SOAPFault newInvalidMapFault(InvalidMapException e, AddressingVersion av) {
+-        QName name = e.getMapQName();
++    public SOAPFault createInvalidAddressingHeaderFault(InvalidAddressingHeaderException e, AddressingVersion av) {
++        QName name = e.getProblemHeader();
+         QName subsubcode = e.getSubsubcode();
+         QName subcode = av.invalidMapTag;
+         String faultstring = String.format(av.getInvalidMapText(), name, subsubcode);
+@@ -287,10 +285,10 @@
+         }
+     }
+ 
+-    public SOAPFault newMapRequiredFault(MapRequiredException e, AddressingVersion av) {
+-        QName subcode = av.mapRequiredTag;
+-        QName subsubcode = av.mapRequiredTag;
+-        String faultstring = av.getMapRequiredText();
++    public SOAPFault newMapRequiredFault(MissingAddressingHeaderException e) {
++        QName subcode = addVer.mapRequiredTag;
++        QName subsubcode = addVer.mapRequiredTag;
++        String faultstring = addVer.getMapRequiredText();
+ 
+         try {
+             SOAPFactory factory;
+@@ -301,7 +299,7 @@
+                 fault.setFaultCode(SOAPConstants.SOAP_SENDER_FAULT);
+                 fault.appendFaultSubcode(subcode);
+                 fault.appendFaultSubcode(subsubcode);
+-                getMapRequiredDetail(e.getMapQName(), fault.addDetail());
++                getMapRequiredDetail(e.getMissingHeaderQName(), fault.addDetail());
+             } else {
+                 factory = SOAPVersion.SOAP_11.saajSoapFactory;
+                 fault = factory.createFault();
+@@ -320,8 +318,6 @@
+     public abstract void getInvalidMapDetail(QName name, Element element);
+     public abstract void getMapRequiredDetail(QName name, Element element);
+ 
+-    protected Unmarshaller unmarshaller;
+-    protected Marshaller marshaller;
+     protected SEIModel seiModel;
+     protected WSDLPort wsdlPort;
+     protected WSBinding binding;
+--- old/src/share/classes/com/sun/xml/internal/ws/addressing/WsaTubeHelperImpl.java	Thu Jul 30 18:20:34 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/addressing/WsaTubeHelperImpl.java	Thu Jul 30 18:20:34 2009
+@@ -53,20 +53,19 @@
+ 
+     public WsaTubeHelperImpl(WSDLPort wsdlPort, SEIModel seiModel, WSBinding binding) {
+         super(binding,seiModel,wsdlPort);
+-        try {
+-            unmarshaller = jc.createUnmarshaller();
+-            marshaller = jc.createMarshaller();
+-            marshaller.setProperty(Marshaller.JAXB_FRAGMENT, Boolean.TRUE);
+-        } catch (JAXBException e) {
+-            throw new WebServiceException(e);
+-        }
+     }
+ 
++    private Marshaller createMarshaller() throws JAXBException {
++        Marshaller marshaller = jc.createMarshaller();
++        marshaller.setProperty(Marshaller.JAXB_FRAGMENT, Boolean.TRUE);
++        return marshaller;
++    }
++
+     @Override
+     public final void getProblemActionDetail(String action, Element element) {
+         ProblemAction pa = new ProblemAction(action);
+         try {
+-            marshaller.marshal(pa, element);
++            createMarshaller().marshal(pa, element);
+         } catch (JAXBException e) {
+             throw new WebServiceException(e);
+         }
+@@ -76,7 +75,7 @@
+     public final void getInvalidMapDetail(QName name, Element element) {
+         ProblemHeaderQName phq = new ProblemHeaderQName(name);
+         try {
+-            marshaller.marshal(phq, element);
++            createMarshaller().marshal(phq, element);
+         } catch (JAXBException e) {
+             throw new WebServiceException(e);
+         }
+--- old/src/share/classes/com/sun/xml/internal/ws/addressing/model/ActionNotSupportedException.java	Thu Jul 30 18:20:38 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/addressing/model/ActionNotSupportedException.java	Thu Jul 30 18:20:37 2009
+@@ -25,6 +25,8 @@
+ 
+ package com.sun.xml.internal.ws.addressing.model;
+ 
++import com.sun.xml.internal.ws.resources.AddressingMessages;
++
+ import javax.xml.ws.WebServiceException;
+ 
+ /**
+@@ -31,13 +33,10 @@
+  * @author Arun Gupta
+  */
+ public class ActionNotSupportedException extends WebServiceException {
+-    String action;
++    private String action;
+ 
+-    protected ActionNotSupportedException() {
+-        super();
+-    }
+-
+     public ActionNotSupportedException(String action) {
++        super(AddressingMessages.ACTION_NOT_SUPPORTED_EXCEPTION(action));
+         this.action = action;
+     }
+ 
+--- old/src/share/classes/com/sun/xml/internal/ws/addressing/v200408/WsaTubeHelperImpl.java	Thu Jul 30 18:20:41 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/addressing/v200408/WsaTubeHelperImpl.java	Thu Jul 30 18:20:41 2009
+@@ -54,20 +54,19 @@
+ 
+     public WsaTubeHelperImpl(WSDLPort wsdlPort, SEIModel seiModel, WSBinding binding) {
+         super(binding,seiModel,wsdlPort);
+-        try {
+-            unmarshaller = jc.createUnmarshaller();
+-            marshaller = jc.createMarshaller();
+-            marshaller.setProperty(Marshaller.JAXB_FRAGMENT, Boolean.TRUE);
+-        } catch (JAXBException e) {
+-            throw new WebServiceException(e);
+-        }
+     }
+ 
++    private Marshaller createMarshaller() throws JAXBException {
++        Marshaller marshaller = jc.createMarshaller();
++        marshaller.setProperty(Marshaller.JAXB_FRAGMENT, Boolean.TRUE);
++        return marshaller;
++    }
++
+     @Override
+     public final void getProblemActionDetail(String action, Element element) {
+         ProblemAction pa = new ProblemAction(action);
+         try {
+-            marshaller.marshal(pa, element);
++            createMarshaller().marshal(pa, element);
+         } catch (JAXBException e) {
+             throw new WebServiceException(e);
+         }
+@@ -77,7 +76,7 @@
+     public final void getInvalidMapDetail(QName name, Element element) {
+         ProblemHeaderQName phq = new ProblemHeaderQName(name);
+         try {
+-            marshaller.marshal(phq, element);
++            createMarshaller().marshal(phq, element);
+         } catch (JAXBException e) {
+             throw new WebServiceException(e);
+         }
+--- old/src/share/classes/com/sun/xml/internal/ws/api/BindingID.java	Thu Jul 30 18:20:45 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/api/BindingID.java	Thu Jul 30 18:20:44 2009
+@@ -34,7 +34,10 @@
+ import com.sun.xml.internal.ws.binding.WebServiceFeatureList;
+ 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 javax.xml.ws.BindingType;
+ import javax.xml.ws.WebServiceException;
+@@ -96,6 +99,18 @@
+         return BindingImpl.create(this);
+     }
+ 
++    /**
++     * Returns wsdl:binding@transport attribute. Sub classes
++     * are expected to override this method to provide their transport
++     * attribute.
++     *
++     * @return wsdl:binding@transport attribute
++     * @since JAX-WS RI 2.1.6
++     */
++    public @NotNull String getTransport() {
++        return SOAPNamespaceConstants.TRANSPORT_HTTP;
++    }
++
+     public final @NotNull WSBinding createBinding(WebServiceFeature... features) {
+         return BindingImpl.create(this, features);
+     }
+@@ -228,6 +243,8 @@
+     public static @NotNull BindingID parse(String lexical) {
+         if(lexical.equals(XML_HTTP.toString()))
+             return XML_HTTP;
++        if(lexical.equals(REST_HTTP.toString()))
++            return REST_HTTP;
+         if(belongsTo(lexical,SOAP11_HTTP.toString()))
+             return customize(lexical,SOAP11_HTTP);
+         if(belongsTo(lexical,SOAP12_HTTP.toString()))
+@@ -306,7 +323,7 @@
+      */
+     public static final SOAPHTTPImpl X_SOAP12_HTTP = new SOAPHTTPImpl(
+         SOAPVersion.SOAP_12, SOAPBindingImpl.X_SOAP12HTTP_BINDING, true);
+-    
++
+     /**
+      * Constant that represents SOAP1.2/HTTP.
+      */
+@@ -328,17 +345,26 @@
+      */
+     public static final SOAPHTTPImpl SOAP11_HTTP_MTOM = new SOAPHTTPImpl(
+         SOAPVersion.SOAP_11, SOAPBinding.SOAP11HTTP_MTOM_BINDING, true, true);
+-    
+-    
++
++
+     /**
+      * Constant that represents REST.
+      */
+     public static final BindingID XML_HTTP = new Impl(SOAPVersion.SOAP_11, HTTPBinding.HTTP_BINDING,false) {
+         public Codec createEncoder(WSBinding binding) {
+-            return new XMLHTTPBindingCodec();
++            return new XMLHTTPBindingCodec(binding);
+         }
+     };
+ 
++    /**
++     * Constant that represents REST.
++     */
++    private static final BindingID REST_HTTP = new Impl(SOAPVersion.SOAP_11, JAXWSProperties.REST_BINDING,true) {
++        public Codec createEncoder(WSBinding binding) {
++            return new XMLHTTPBindingCodec(binding);
++        }
++    };
++
+     private static abstract class Impl extends BindingID {
+         final SOAPVersion version;
+         private final String lexical;
+@@ -377,7 +403,7 @@
+             super(version, lexical, canGenerateWSDL);
+         }
+ 
+-        public SOAPHTTPImpl(SOAPVersion version, String lexical, boolean canGenerateWSDL, 
++        public SOAPHTTPImpl(SOAPVersion version, String lexical, boolean canGenerateWSDL,
+                            boolean mtomEnabled) {
+             this(version, lexical, canGenerateWSDL);
+             String mtomStr = mtomEnabled ? "true" : "false";
+--- old/src/share/classes/com/sun/xml/internal/ws/api/BindingIDFactory.java	Thu Jul 30 18:20:48 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/api/BindingIDFactory.java	Thu Jul 30 18:20:48 2009
+@@ -40,7 +40,7 @@
+  *
+  * @since JAX-WS 2.0.next
+  * @author Kohsuke Kawaguchi
+- * @see BindingID#parse(String) 
++ * @see BindingID#parse(String)
+  */
+ public abstract class BindingIDFactory {
+     /**
+--- old/src/share/classes/com/sun/xml/internal/ws/api/EndpointAddress.java	Thu Jul 30 18:20:52 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/api/EndpointAddress.java	Thu Jul 30 18:20:51 2009
+@@ -193,6 +193,9 @@
+      */
+     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");
++        }
+         if(proxy!=null)
+             return url.openConnection(proxy);
+         else
+--- old/src/share/classes/com/sun/xml/internal/ws/api/SOAPVersion.java	Thu Jul 30 18:20:55 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/api/SOAPVersion.java	Thu Jul 30 18:20:55 2009
+@@ -25,6 +25,7 @@
+ 
+ package com.sun.xml.internal.ws.api;
+ 
++import com.sun.xml.internal.bind.util.Which;
+ import com.sun.xml.internal.ws.encoding.soap.SOAP12Constants;
+ 
+ import javax.xml.namespace.QName;
+@@ -167,6 +168,11 @@
+             saajSoapFactory = SOAPFactory.newInstance(saajFactoryString);
+         } catch (SOAPException e) {
+             throw new Error(e);
++        } catch (NoSuchMethodError e) {
++            // SAAJ 1.3 is not in the classpath
++            LinkageError x = new LinkageError("You are loading old SAAJ from "+ Which.which(MessageFactory.class));
++            x.initCause(e);
++            throw x;
+         }
+         this.faultCodeMustUnderstand = faultCodeMustUnderstand;
+         this.requiredRoles = requiredRoles;
+--- old/src/share/classes/com/sun/xml/internal/ws/api/WSService.java	Thu Jul 30 18:20:59 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/api/WSService.java	Thu Jul 30 18:20:58 2009
+@@ -25,7 +25,11 @@
+ 
+ package com.sun.xml.internal.ws.api;
+ 
++import com.sun.istack.internal.NotNull;
+ import com.sun.xml.internal.ws.api.addressing.WSEndpointReference;
++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.WSEndpoint;
+ import com.sun.xml.internal.ws.client.WSServiceDelegate;
+ 
+ import javax.xml.bind.JAXBContext;
+@@ -67,7 +71,7 @@
+ 
+     /**
+      * Works like {@link #getPort(EndpointReference, Class, WebServiceFeature...)}
+-     * but takes {@link WSEndpointReference}. 
++     * but takes {@link WSEndpointReference}.
+      */
+     public abstract <T> T getPort(WSEndpointReference epr, Class<T> portInterface, WebServiceFeature... features);
+ 
+@@ -84,6 +88,19 @@
+     public abstract Dispatch<Object> createDispatch(QName portName, WSEndpointReference wsepr, JAXBContext jaxbContext, Service.Mode mode, WebServiceFeature... features);
+ 
+     /**
++     * Gets the {@link Container} object.
++     *
++     * <p>
++     * The components inside {@link WSEndpoint} uses this reference
++     * to communicate with the hosting environment.
++     *
++     * @return
++     *      always same object. If no "real" {@link Container} instance
++     *      is given, {@link Container#NONE} will be returned.
++     */
++    public abstract @NotNull Container getContainer();
++
++    /**
+      * Create a <code>Service</code> instance.
+      *
+      * The specified WSDL document location and service qualified name MUST
+@@ -117,6 +134,69 @@
+         return create(null,new QName(WSService.class.getName(),"dummy"));
+     }
+ 
++    /**
++     * Typed parameter bag used by {@link WSService#create(URL, QName, InitParams)}
++     *
++     * @since 2.1.3
++     */
++    public static final class InitParams {
++        private Container container;
++        /**
++         * Sets the {@link Container} object used by the created service.
++         * This allows the client to use a specific {@link Container} instance
++         * as opposed to the one obtained by {@link ContainerResolver}.
++         */
++        public void setContainer(Container c) {
++            this.container = c;
++        }
++        public Container getContainer() {
++            return container;
++        }
++    }
++
++    /**
++     * To create a {@link Service}, we need to go through the API that doesn't let us
++     * pass parameters, so as a hack we use thread local.
++     */
++    protected static final ThreadLocal<InitParams> INIT_PARAMS = new ThreadLocal<InitParams>();
++
++    /**
++     * Used as a immutable constant so that we can avoid null check.
++     */
++    protected static final InitParams EMPTY_PARAMS = new InitParams();
++
++    /**
++     * Creates a {@link Service} instance.
++     *
++     * <p>
++     * This method works really like {@link Service#create(URL, QName)}
++     * except it takes one more RI specific parameter.
++     *
++     * @param wsdlDocumentLocation
++     *          {@code URL} for the WSDL document location for the service.
++     *          Can be null, in which case WSDL is not loaded.
++     * @param serviceName
++     *          {@code QName} for the service.
++     * @param properties
++     *          Additional RI specific initialization parameters. Can be null.
++     * @throws WebServiceException
++     *          If any error in creation of the specified service.
++     **/
++    public static Service create( URL wsdlDocumentLocation, QName serviceName, InitParams properties) {
++        if(INIT_PARAMS.get()!=null)
++            throw new IllegalStateException("someone left non-null InitParams");
++        INIT_PARAMS.set(properties);
++        try {
++            Service svc = Service.create(wsdlDocumentLocation, serviceName);
++            if(INIT_PARAMS.get()!=null)
++                throw new IllegalStateException("Service "+svc+" didn't recognize InitParams");
++            return svc;
++        } finally {
++            // even in case of an exception still reset INIT_PARAMS
++            INIT_PARAMS.set(null);
++        }
++    }
++
+     /**
+      * Obtains the {@link WSService} that's encapsulated inside a {@link Service}.
+      *
+--- old/src/share/classes/com/sun/xml/internal/ws/api/addressing/AddressingVersion.java	Thu Jul 30 18:21:02 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/api/addressing/AddressingVersion.java	Thu Jul 30 18:21:02 2009
+@@ -522,6 +522,10 @@
+      * {@link WSBinding} and for the {@link WSDLPort} port.
+      *
+      * @return WS-A version specific helper
++     *
++     * @deprecated
++     *     TODO  why are we exposing implementation specificc class through api?
++     *     TODO  Remove it if no one elase uses it.
+      */
+     public abstract WsaTubeHelper getWsaHelper(WSDLPort wsdlPort, SEIModel seiModel, WSBinding binding);
+ 
+--- old/src/share/classes/com/sun/xml/internal/ws/api/addressing/OneWayFeature.java	Thu Jul 30 18:21:06 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/api/addressing/OneWayFeature.java	Thu Jul 30 18:21:05 2009
+@@ -43,7 +43,7 @@
+  * this annotation. All operations are assumed to be one-way, and
+  * this feature should be used for one-way
+  * operations only.
+- * 
++ *
+  * If a non-null ReplyTo is specified, then MessageID property is also added.
+  *
+  * @author Arun Gupta
+--- old/src/share/classes/com/sun/xml/internal/ws/api/addressing/OutboundReferenceParameterHeader.java	Thu Jul 30 18:21:10 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/api/addressing/OutboundReferenceParameterHeader.java	Thu Jul 30 18:21:09 2009
+@@ -110,17 +110,18 @@
+             reader.nextTag();   // move to the first element, which is the header element
+ 
+             attributes = new FinalArrayList<Attribute>();
+-
++            boolean refParamAttrWritten = false;
+             for (int i = 0; i < reader.getAttributeCount(); i++) {
+                 final String localName = 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"))
++                    refParamAttrWritten = true;
+                 attributes.add(new Attribute(namespaceURI,localName,value));
+             }
+-
+-            // we are adding one more attribute "wsa:IsReferenceParameter"
+-            attributes.add(new Attribute(AddressingVersion.W3C.nsUri,IS_REFERENCE_PARAMETER,TRUE_VALUE));
++            // we are adding one more attribute "wsa:IsReferenceParameter", if its not alrady there
++            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);
+         }
+@@ -209,7 +210,7 @@
+     public void writeTo(XMLStreamWriter w) throws XMLStreamException {
+         infoset.writeToXMLStreamWriter(new XMLStreamWriterFilter(w) {
+             private boolean root=true;
+-
++            private boolean onRootEl = true;
+             public void writeStartElement(String localName) throws XMLStreamException {
+                 super.writeStartElement(localName);
+                 writeAddedAttribute();
+@@ -216,7 +217,10 @@
+             }
+ 
+             private void writeAddedAttribute() throws XMLStreamException {
+-                if(!root)   return;
++                if(!root) {
++                    onRootEl = false;
++                    return;
++                }
+                 root=false;
+                 writeNamespace("wsa",AddressingVersion.W3C.nsUri);
+                 super.writeAttribute("wsa",AddressingVersion.W3C.nsUri,IS_REFERENCE_PARAMETER,TRUE_VALUE);
+@@ -245,6 +249,19 @@
+                     super.writeNamespace(prefix,namespaceURI);
+             }
+ 
++            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))
++                    return;
++
++                writer.writeAttribute(prefix, namespaceURI, localName, value);
++            }
++            public void writeAttribute(String namespaceURI, String localName, String value) throws XMLStreamException {
++
++
++                writer.writeAttribute(namespaceURI, localName, value);
++            }
+             private boolean isPrefixDeclared(String prefix, String namespaceURI ) {
+                 return namespaceURI.equals(getNamespaceContext().getNamespaceURI(prefix));
+             }
+@@ -271,14 +288,18 @@
+                 if(depth++==0) {
+                     // add one more attribute
+                     super.startPrefixMapping("wsa",AddressingVersion.W3C.nsUri);
+-                    AttributesImpl atts2 = new AttributesImpl(atts);
+-                    atts2.addAttribute(
+-                        AddressingVersion.W3C.nsUri,
+-                        IS_REFERENCE_PARAMETER,
+-                        "wsa:IsReferenceParameter",
+-                        "CDATA",
+-                        TRUE_VALUE);
+-                    atts = atts2;
++
++                    //Add the attirbute wsa:IsReferenceParameter if not present already
++                    if(atts.getIndex(AddressingVersion.W3C.nsUri,IS_REFERENCE_PARAMETER) == -1) {
++                        AttributesImpl atts2 = new AttributesImpl(atts);
++                        atts2.addAttribute(
++                                AddressingVersion.W3C.nsUri,
++                                IS_REFERENCE_PARAMETER,
++                                "wsa:IsReferenceParameter",
++                                "CDATA",
++                                TRUE_VALUE);
++                        atts = atts2;
++                    }
+                 }
+ 
+                 super.startElement(uri, localName, qName, atts);
+--- old/src/share/classes/com/sun/xml/internal/ws/api/addressing/WSEndpointReference.java	Thu Jul 30 18:21:13 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/api/addressing/WSEndpointReference.java	Thu Jul 30 18:21:13 2009
+@@ -36,7 +36,7 @@
+ import com.sun.xml.internal.stream.buffer.stax.StreamWriterBufferCreator;
+ import com.sun.xml.internal.ws.addressing.EndpointReferenceUtil;
+ import com.sun.xml.internal.ws.addressing.W3CAddressingConstants;
+-import com.sun.xml.internal.ws.addressing.model.InvalidMapException;
++import com.sun.xml.internal.ws.addressing.model.InvalidAddressingHeaderException;
+ import com.sun.xml.internal.ws.addressing.v200408.MemberSubmissionAddressingConstants;
+ import com.sun.xml.internal.ws.api.message.Header;
+ import com.sun.xml.internal.ws.api.message.HeaderList;
+@@ -625,8 +625,8 @@
+             } else
+             if(localName.equals("Address")) {
+                 if(address!=null) // double <Address>. That's an error.
+-                    throw new InvalidMapException(new QName(version.nsUri,rootLocalName),AddressingVersion.fault_duplicateAddressInEpr);
+-                address = xsr.getElementText();
++                    throw new InvalidAddressingHeaderException(new QName(version.nsUri,rootLocalName),AddressingVersion.fault_duplicateAddressInEpr);
++                address = xsr.getElementText().trim();
+             } else {
+                 XMLStreamReaderUtil.skipElement(xsr);
+             }
+@@ -641,7 +641,7 @@
+         }
+ 
+         if(address==null)
+-            throw new InvalidMapException(new QName(version.nsUri,rootLocalName),version.fault_missingAddressInEpr);
++            throw new InvalidAddressingHeaderException(new QName(version.nsUri,rootLocalName),version.fault_missingAddressInEpr);
+     }
+ 
+ 
+@@ -656,8 +656,8 @@
+     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)
+-                        _localName = localName;
++                if (_depth == 0)
++                    _localName = localName;
+                 super.processElement(prefix, uri, _localName);
+             }
+         };
+@@ -834,6 +834,8 @@
+         private @Nullable QName portName;
+         private @Nullable QName portTypeName; //interfaceName
+         private @Nullable Source wsdlSource;
++        private @Nullable String wsdliLocation;
++
+         public @Nullable QName getServiceName(){
+             return serviceName;
+         }
+@@ -846,6 +848,9 @@
+         public @Nullable Source getWsdlSource(){
+             return wsdlSource;
+         }
++        public @Nullable String getWsdliLocation(){
++            return wsdliLocation;
++        }
+ 
+         private Metadata() {
+             try {
+@@ -875,6 +880,9 @@
+                 do {
+                     //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)
++                            wsdliLocation = wsdlLoc.trim();
+                         XMLStreamBuffer mark;
+                         while ((mark = xsr.nextTagAndMark()) != null) {
+                             localName = xsr.getLocalName();
+@@ -881,10 +889,14 @@
+                             ns = xsr.getNamespaceURI();
+                             if (localName.equals(version.eprType.serviceName)) {
+                                 String portStr = xsr.getAttributeValue(null, version.eprType.portName);
++                                if(serviceName != null)
++                                    throw new RuntimeException("More than one "+ version.eprType.serviceName +" element in EPR Metadata");
+                                 serviceName = getElementTextAsQName(xsr);
+-                                if (serviceName != null)
++                                if (serviceName != null && portStr != null)
+                                     portName = new QName(serviceName.getNamespaceURI(), portStr);
+                             } else if (localName.equals(version.eprType.portTypeName)) {
++                                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())) {
+@@ -922,7 +934,7 @@
+                     } else if (localName.equals(version.eprType.serviceName)) {
+                         String portStr = xsr.getAttributeValue(null, version.eprType.portName);
+                         serviceName = getElementTextAsQName(xsr);
+-                        if (serviceName != null)
++                        if (serviceName != null && portStr != null)
+                             portName = new QName(serviceName.getNamespaceURI(), portStr);
+                     } else if (localName.equals(version.eprType.portTypeName)) {
+                         portTypeName = getElementTextAsQName(xsr);
+@@ -936,7 +948,7 @@
+         }
+ 
+         private QName getElementTextAsQName(StreamReaderBufferProcessor xsr) throws XMLStreamException {
+-            String text = xsr.getElementText();
++            String text = xsr.getElementText().trim();
+             String prefix = XmlUtil.getPrefix(text);
+             String name = XmlUtil.getLocalPart(text);
+             if (name != null) {
+--- old/src/share/classes/com/sun/xml/internal/ws/api/client/SelectOptimalEncodingFeature.java	Thu Jul 30 18:21:17 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/api/client/SelectOptimalEncodingFeature.java	Thu Jul 30 18:21:16 2009
+@@ -30,7 +30,7 @@
+ import javax.xml.ws.WebServiceFeature;
+ 
+ /**
+- * Client side feature to enable or disable the selection of the optimal 
++ * Client side feature to enable or disable the selection of the optimal
+  * encoding by the client when sending outbound messages.
+  * <p>
+  * The following describes the affects of this feature with respect
+@@ -47,10 +47,10 @@
+  * <p>
+  * If this feature is enabled by the client and the Service supports the
+  * Fast Infoset encoding, as specified by the {@link FastInfosetFeature},
+- * and Fast Infoset is determined to be the most optimal encoding, then the 
++ * and Fast Infoset is determined to be the most optimal encoding, then the
+  * Fast Infoset encoding will be automatically selected by the client.
+  * <p>
+- * TODO: Still not sure if a feature is a server side only thing or can 
++ * TODO: Still not sure if a feature is a server side only thing or can
+  * also be a client side thing. If the former then this class should be
+  * removed.
+  * @author Paul.Sandoz@Sun.Com
+@@ -62,7 +62,7 @@
+     public static final String ID = "http://java.sun.com/xml/ns/jaxws/client/selectOptimalEncoding";
+ 
+     /**
+-     * Create a {@link SelectOptimalEncodingFeature}. 
++     * Create a {@link SelectOptimalEncodingFeature}.
+      * The instance created will be enabled.
+      */
+     public SelectOptimalEncodingFeature() {
+--- old/src/share/classes/com/sun/xml/internal/ws/api/client/WSPortInfo.java	Thu Jul 30 18:21:21 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/api/client/WSPortInfo.java	Thu Jul 30 18:21:20 2009
+@@ -36,7 +36,7 @@
+ 
+ /**
+  * JAX-WS RI's extension to {@link PortInfo}.
+- * 
++ *
+  * @author Kohsuke Kawaguchi
+  */
+ public interface WSPortInfo extends PortInfo {
+--- old/src/share/classes/com/sun/xml/internal/ws/api/fastinfoset/FastInfosetFeature.java	Thu Jul 30 18:21:24 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/api/fastinfoset/FastInfosetFeature.java	Thu Jul 30 18:21:23 2009
+@@ -36,7 +36,7 @@
+  * to being enabled or disabled:
+  * <ul>
+  *  <li> ENABLED: In this Mode, Fast Infoset will be enabled.
+- *  <li> DISABLED: In this Mode, Fast Infoset will be disabled and the 
++ *  <li> DISABLED: In this Mode, Fast Infoset will be disabled and the
+  *       Web service will not process incoming messages or produce outgoing
+  *       messages encoded using Fast Infoset.
+  * </ul>
+--- old/src/share/classes/com/sun/xml/internal/ws/api/message/HeaderList.java	Thu Jul 30 18:21:28 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/api/message/HeaderList.java	Thu Jul 30 18:21:27 2009
+@@ -732,7 +732,7 @@
+      * is inserted.
+      *
+      * @return
+-     *      always true. Don't use the return value.      
++     *      always true. Don't use the return value.
+      */
+     public boolean add(Header header) {
+         return super.add(header);
+--- old/src/share/classes/com/sun/xml/internal/ws/api/message/Headers.java	Thu Jul 30 18:21:31 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/api/message/Headers.java	Thu Jul 30 18:21:31 2009
+@@ -155,5 +155,5 @@
+      */
+     public static Header create(QName name, String value) {
+         return new StringHeader(name, value);
+-    }    
++    }
+ }
+--- old/src/share/classes/com/sun/xml/internal/ws/api/message/Message.java	Thu Jul 30 18:21:35 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/api/message/Message.java	Thu Jul 30 18:21:34 2009
+@@ -42,6 +42,7 @@
+ import com.sun.xml.internal.ws.client.dispatch.DispatchImpl;
+ import com.sun.xml.internal.ws.message.AttachmentSetImpl;
+ import com.sun.xml.internal.ws.message.jaxb.JAXBMessage;
++import com.sun.xml.internal.ws.fault.SOAPFaultBuilder;
+ import com.sun.xml.internal.org.jvnet.staxex.XMLStreamReaderEx;
+ import com.sun.xml.internal.org.jvnet.staxex.XMLStreamWriterEx;
+ import org.xml.sax.ContentHandler;
+@@ -54,11 +55,13 @@
+ import javax.xml.namespace.QName;
+ import javax.xml.soap.SOAPException;
+ import javax.xml.soap.SOAPMessage;
++import javax.xml.soap.Detail;
+ import javax.xml.stream.XMLStreamException;
+ import javax.xml.stream.XMLStreamReader;
+ import javax.xml.stream.XMLStreamWriter;
+ import javax.xml.transform.Source;
+ import javax.xml.ws.Dispatch;
++import javax.xml.ws.WebServiceException;
+ import java.io.InputStream;
+ import java.lang.reflect.Method;
+ import java.lang.reflect.Proxy;
+@@ -428,6 +431,27 @@
+     }
+ 
+     /**
++     * It gives S:Envelope/S:Body/S:Fault/detail 's first child's name. Should
++     * be called for messages that have SOAP Fault.
++     *
++     * <p> This implementation is expensive so concrete implementations are
++     * expected to override this one.
++     *
++     * @return first detail entry's name, if there is one
++     *         else null
++     */
++    public @Nullable QName getFirstDetailEntryName() {
++        assert isFault();
++        Message msg = copy();
++        try {
++            SOAPFaultBuilder fault = SOAPFaultBuilder.create(msg);
++            return fault.getFirstDetailEntryName();
++        } catch (JAXBException e) {
++            throw new WebServiceException(e);
++        }
++    }
++
++    /**
+      * Consumes this message including the envelope.
+      * returns it as a {@link Source} object.
+      */
+@@ -484,6 +508,8 @@
+      *
+      * This consumes the message.
+      *
++     * @return null
++     *      if there's no payload.
+      * @throws JAXBException
+      *      If JAXB reports an error during the processing.
+      */
+--- old/src/share/classes/com/sun/xml/internal/ws/api/message/Messages.java	Thu Jul 30 18:21:38 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/api/message/Messages.java	Thu Jul 30 18:21:38 2009
+@@ -31,10 +31,10 @@
+ import com.sun.xml.internal.bind.v2.runtime.MarshallerImpl;
+ import com.sun.xml.internal.stream.buffer.XMLStreamBuffer;
+ 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.pipe.Tube;
+ import com.sun.xml.internal.ws.api.pipe.Codecs;
+-import com.sun.xml.internal.ws.encoding.StreamSOAPCodec;
+ import com.sun.xml.internal.ws.fault.SOAPFaultBuilder;
+ import com.sun.xml.internal.ws.message.AttachmentSetImpl;
+ import com.sun.xml.internal.ws.message.DOMMessage;
+@@ -48,6 +48,9 @@
+ import com.sun.xml.internal.ws.streaming.XMLStreamReaderException;
+ import com.sun.xml.internal.ws.streaming.XMLStreamReaderUtil;
+ import com.sun.xml.internal.ws.util.DOMUtil;
++import com.sun.xml.internal.ws.addressing.WsaTubeHelper;
++import com.sun.xml.internal.ws.addressing.model.MissingAddressingHeaderException;
++import com.sun.xml.internal.ws.resources.AddressingMessages;
+ import org.w3c.dom.Element;
+ import org.w3c.dom.Node;
+ 
+@@ -303,7 +306,36 @@
+     }
+ 
+     /**
++     * @deprecated
++     *      Use {@link #createAddressingFaultMessage(WSBinding, Packet, QName)}
++     */
++    public static Message createAddressingFaultMessage(WSBinding binding, QName missingHeader) {
++        return createAddressingFaultMessage(binding,null,missingHeader);
++    }
++
++    /**
+      * Creates a fault {@link Message} that captures the code/subcode/subsubcode
++     * defined by WS-Addressing if one of the expected WS-Addressing headers is
++     * missing in the message
++     *
++     * @param binding WSBinding
++     * @param p
++     *      {@link Packet} that was missing a WS-Addressing header.
++     * @param missingHeader The missing WS-Addressing Header
++     * @return
++     *      A message representing SOAPFault that contains the WS-Addressing code/subcode/subsubcode.
++     */
++    public static Message createAddressingFaultMessage(WSBinding binding, Packet p, QName missingHeader) {
++        AddressingVersion av = binding.getAddressingVersion();
++        if(av == null) {
++            // Addressing is not enabled.
++            throw new WebServiceException(AddressingMessages.ADDRESSING_SHOULD_BE_ENABLED());
++        }
++        WsaTubeHelper helper = av.getWsaHelper(null,null,binding);
++        return create(helper.newMapRequiredFault(new MissingAddressingHeaderException(missingHeader,p)));
++    }
++    /**
++     * Creates a fault {@link Message} that captures the code/subcode/subsubcode
+      * defined by WS-Addressing if wsa:Action is not supported.
+      *
+      * @param unsupportedAction The unsupported Action. Must not be null.
+--- old/src/share/classes/com/sun/xml/internal/ws/api/message/Packet.java	Thu Jul 30 18:21:42 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/api/message/Packet.java	Thu Jul 30 18:21:41 2009
+@@ -28,7 +28,7 @@
+ import com.sun.istack.internal.Nullable;
+ import com.sun.xml.internal.bind.marshaller.SAX2DOMEx;
+ import com.sun.xml.internal.ws.addressing.WsaTubeHelper;
+-import com.sun.xml.internal.ws.addressing.model.InvalidMapException;
++import com.sun.xml.internal.ws.addressing.model.InvalidAddressingHeaderException;
+ import com.sun.xml.internal.ws.api.DistributedPropertySet;
+ import com.sun.xml.internal.ws.api.EndpointAddress;
+ import com.sun.xml.internal.ws.api.PropertySet;
+@@ -36,9 +36,9 @@
+ 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.model.SEIModel;
+ 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.model.SEIModel;
+ import com.sun.xml.internal.ws.api.pipe.Tube;
+ import com.sun.xml.internal.ws.api.server.TransportBackChannel;
+ import com.sun.xml.internal.ws.api.server.WSEndpoint;
+@@ -52,7 +52,6 @@
+ import com.sun.xml.internal.ws.message.StringHeader;
+ import com.sun.xml.internal.ws.util.DOMUtil;
+ import com.sun.xml.internal.ws.util.xml.XmlUtil;
+-import com.sun.xml.internal.ws.model.JavaMethodImpl;
+ import org.w3c.dom.Document;
+ import org.w3c.dom.Element;
+ import org.xml.sax.SAXException;
+@@ -174,9 +173,29 @@
+         this.handlerScopePropertyNames = that.handlerScopePropertyNames;
+         this.contentNegotiation = that.contentNegotiation;
+         this.wasTransportSecure = that.wasTransportSecure;
++        this.endpointAddress = that.endpointAddress;
+         // copy other properties that need to be copied. is there any?
+     }
+ 
++    /**
++     * Creates a copy of this {@link Packet}.
++     *
++     * @param copyMessage determines whether the {@link Message} from the original {@link Packet} should be copied as
++     *        well, or not. If the value is {@code false}, the {@link Message} in the copy of the {@link Packet} is {@code null}.
++     * @return copy of the original packet
++     */
++    public Packet copy(boolean copyMessage) {
++        // the copy constructor is originally designed for creating a response packet,
++        // but so far the implementation is usable for this purpose as well, so calling the copy constructor
++        // to avoid code dupliation.
++        Packet copy = new Packet(this);
++        if (copyMessage) {
++            copy.message = this.message.copy();
++        }
++
++        return copy;
++    }
++
+     private Message message;
+ 
+     /**
+@@ -225,7 +244,7 @@
+      * <p>
+      * Transports may choose to ignore certain headers that interfere with
+      * its correct operation, such as
+-     * <tt>Content-Type</tt> and <tt>Content-Length</tt>. 
++     * <tt>Content-Type</tt> and <tt>Content-Length</tt>.
+      */
+     public static final String OUTBOUND_TRANSPORT_HEADERS = "com.sun.xml.internal.ws.api.message.packet.outbound.transport.headers";
+ 
+@@ -391,7 +410,7 @@
+      * <p>
+      * This field can be null. While a message is being processed,
+      * this field can be set explicitly to null, to prevent
+-     * future pipes from closing a transport.
++     * future pipes from closing a transport (see {@link #keepTransportBackChannelOpen()})
+      *
+      * <p>
+      * This property is set from the parameter
+@@ -400,11 +419,24 @@
+     public @Nullable TransportBackChannel transportBackChannel;
+ 
+     /**
++     * Keeps the transport back channel open (by seeting {@link #transportBackChannel} to null.)
++     *
++     * @return
++     *      The previous value of {@link #transportBackChannel}.
++     */
++    public TransportBackChannel keepTransportBackChannelOpen() {
++        TransportBackChannel r = transportBackChannel;
++        transportBackChannel = null;
++        return r;
++    }
++
++    /**
+      * The governing {@link WSEndpoint} in which this message is floating.
+      *
+      * <p>
+      * This property is set if and only if this is on the server side.
+      */
++    @Property(JAXWSProperties.WSENDPOINT)
+     public WSEndpoint endpoint;
+ 
+     /**
+@@ -641,12 +673,12 @@
+             return r;
+         }
+         // if one-way, then dont populate any WS-A headers
+-        if (message == null || (wsdlPort != null && message.isOneWay(wsdlPort)))
++        if (responseMessage == null || (wsdlPort != null && message.isOneWay(wsdlPort)))
+             return r;
+ 
+         // otherwise populate WS-Addressing headers
+-        return populateAddressingHeaders(binding, r, wsdlPort,seiModel);
+-
++        populateAddressingHeaders(binding, r, wsdlPort,seiModel);
++        return r;
+     }
+ 
+     /**
+@@ -677,20 +709,32 @@
+             return responsePacket;
+         }
+ 
+-        return populateAddressingHeaders(responsePacket,
+-                addressingVersion,
+-                soapVersion,
+-                action);
++        populateAddressingHeaders(responsePacket, addressingVersion, soapVersion, action);
++        return responsePacket;
+     }
+ 
+-    private Packet populateAddressingHeaders(Packet responsePacket, AddressingVersion av, SOAPVersion sv, String action) {
++    /**
++     * Overwrites the {@link Message} of the response packet ({@code this}) by the given {@link Message}.
++     * Unlike {@link #setMessage(Message)}, fill in the addressing headers correctly, and this process
++     * requires the access to the request packet.
++     *
++     * <p>
++     * This method is useful when the caller needs to swap a response message completely to a new one.
++     *
++     * @see #createServerResponse(Message, AddressingVersion, SOAPVersion, String)
++     */
++    public void setResponseMessage(@NotNull Packet request, @Nullable Message responseMessage, @NotNull AddressingVersion addressingVersion, @NotNull SOAPVersion soapVersion, @NotNull String action) {
++       Packet temp = request.createServerResponse(responseMessage, addressingVersion, soapVersion, action);
++       setMessage(temp.getMessage());
++    }
++
++    private void populateAddressingHeaders(Packet responsePacket, AddressingVersion av, SOAPVersion sv, String action) {
+         // populate WS-A headers only if WS-A is enabled
+-        if (av == null)
+-            return responsePacket;
++        if (av == null) return;
+ 
+         // if one-way, then dont populate any WS-A headers
+         if (responsePacket.getMessage() == null)
+-            return responsePacket;
++            return;
+ 
+         HeaderList hl = responsePacket.getMessage().getHeaders();
+ 
+@@ -700,19 +744,23 @@
+         replyTo = message.getHeaders().getReplyTo(av, sv);
+         if (replyTo != null)
+             hl.add(new StringHeader(av.toTag, replyTo.getAddress()));
+-        } catch (InvalidMapException e) {
++        } catch (InvalidAddressingHeaderException e) {
+             replyTo = null;
+         }
+ 
+-        // wsa:Action
+-        hl.add(new StringHeader(av.actionTag, action));
++        // 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) {
++            //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));
++        }
+ 
+         // wsa:MessageID
+         hl.add(new StringHeader(av.messageIDTag, responsePacket.getMessage().getID(av, sv)));
+ 
+         // wsa:RelatesTo
+-        // TODO: this property is defined in WsaServerTube.REQUEST_MESSAGE_ID
+-        String mid = (String)responsePacket.invocationProperties.get("com.sun.xml.internal.ws.addressing.request.messageID");
++        String mid = getMessage().getHeaders().getMessageID(av,sv);
+         if (mid != null)
+             hl.add(new RelatesToHeader(av.relatesToTag, mid));
+ 
+@@ -732,15 +780,12 @@
+         if (refpEPR != null) {
+             refpEPR.addReferenceParameters(hl);
+         }
+-
+-        return responsePacket;
+     }
+ 
+-    private Packet populateAddressingHeaders(WSBinding binding, Packet responsePacket, WSDLPort wsdlPort, SEIModel seiModel) {
++    private void populateAddressingHeaders(WSBinding binding, Packet responsePacket, WSDLPort wsdlPort, SEIModel seiModel) {
+         AddressingVersion addressingVersion = binding.getAddressingVersion();
+ 
+-        if (addressingVersion == null)
+-            return responsePacket;
++        if (addressingVersion == null)  return;
+ 
+         WsaTubeHelper wsaHelper = addressingVersion.getWsaHelper(wsdlPort,seiModel, binding);
+         String action = responsePacket.message.isFault() ?
+@@ -747,7 +792,7 @@
+                 wsaHelper.getFaultAction(this, responsePacket) :
+                 wsaHelper.getOutputAction(this);
+ 
+-        return populateAddressingHeaders(responsePacket, addressingVersion, binding.getSOAPVersion(), action);
++        populateAddressingHeaders(responsePacket, addressingVersion, binding.getSOAPVersion(), action);
+     }
+ 
+     // completes TypedMap
+--- old/src/share/classes/com/sun/xml/internal/ws/api/message/stream/InputStreamMessage.java	Thu Jul 30 18:21:46 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/api/message/stream/InputStreamMessage.java	Thu Jul 30 18:21:45 2009
+@@ -35,14 +35,14 @@
+ public class InputStreamMessage extends StreamBasedMessage {
+     /**
+      * The MIME content-type of the encoding.
+-     */    
++     */
+     public final String contentType;
+-    
++
+     /**
+      * The message represented as an {@link InputStream}.
+      */
+     public final InputStream msg;
+-    
++
+     /**
+      * Create a new message.
+      *
+@@ -58,11 +58,11 @@
+      */
+     public InputStreamMessage(Packet properties, String contentType, InputStream msg) {
+         super(properties);
+-        
++
+         this.contentType = contentType;
+         this.msg = msg;
+     }
+-    
++
+     /**
+      * Create a new message.
+      *
+@@ -82,7 +82,7 @@
+     public InputStreamMessage(Packet properties, AttachmentSet attachments,
+             String contentType, InputStream msg) {
+         super(properties, attachments);
+-        
++
+         this.contentType = contentType;
+         this.msg = msg;
+     }
+--- old/src/share/classes/com/sun/xml/internal/ws/api/message/stream/StreamBasedMessage.java	Thu Jul 30 18:21:49 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/api/message/stream/StreamBasedMessage.java	Thu Jul 30 18:21:49 2009
+@@ -35,15 +35,15 @@
+ abstract class StreamBasedMessage {
+     /**
+      * The properties of the message.
+-     */    
++     */
+     public final Packet properties;
+-    
++
+     /**
+      * The attachments of this message
+      * (attachments live outside a message.)
+      */
+     public final AttachmentSet attachments;
+-    
++
+     /**
+      * Create a new message.
+      *
+@@ -53,9 +53,9 @@
+      */
+     protected StreamBasedMessage(Packet properties) {
+         this.properties = properties;
+-        this.attachments = new AttachmentSetImpl();        
++        this.attachments = new AttachmentSetImpl();
+     }
+-    
++
+     /**
+      * Create a new message.
+      *
+--- old/src/share/classes/com/sun/xml/internal/ws/api/message/stream/XMLStreamReaderMessage.java	Thu Jul 30 18:21:53 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/api/message/stream/XMLStreamReaderMessage.java	Thu Jul 30 18:21:52 2009
+@@ -32,13 +32,13 @@
+  * Low level representation of an XML or SOAP message as an {@link XMLStreamReader}.
+  *
+  */
+-public class XMLStreamReaderMessage extends StreamBasedMessage {  
++public class XMLStreamReaderMessage extends StreamBasedMessage {
+     /**
+      * The message represented as an {@link XMLStreamReader}.
+      */
+     public final XMLStreamReader msg;
+-    
+-    /** 
++
++    /**
+      * Create a new message.
+      *
+      * @param properties
+@@ -51,9 +51,9 @@
+     public XMLStreamReaderMessage(Packet properties, XMLStreamReader msg) {
+         super(properties);
+         this.msg = msg;
+-    }    
+-    
+-    /** 
++    }
++
++    /**
+      * Create a new message.
+      *
+      * @param properties
+@@ -69,5 +69,5 @@
+     public XMLStreamReaderMessage(Packet properties, AttachmentSet attachments, XMLStreamReader msg) {
+         super(properties, attachments);
+         this.msg = msg;
+-    }    
++    }
+ }
+--- old/src/share/classes/com/sun/xml/internal/ws/api/model/CheckedException.java	Thu Jul 30 18:21:56 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/CheckedException.java	Thu Jul 30 18:21:56 2009
+@@ -88,7 +88,7 @@
+      *
+      * and accessor method
+      *
+-     * <code>public FaultBean getFaultInfo();</code>     
++     * <code>public FaultBean getFaultInfo();</code>
+      */
+     ExceptionType getExceptionType();
+ 
+--- old/src/share/classes/com/sun/xml/internal/ws/api/model/ExceptionType.java	Thu Jul 30 18:22:00 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/ExceptionType.java	Thu Jul 30 18:21:59 2009
+@@ -35,7 +35,7 @@
+  * and accessor method
+  *
+  * <code>public FaultBean getFaultInfo();</code>
+- * 
++ *
+  * @author Vivek Pandey
+  */
+ public enum ExceptionType {
+--- old/src/share/classes/com/sun/xml/internal/ws/api/model/JavaMethod.java	Thu Jul 30 18:22:03 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/JavaMethod.java	Thu Jul 30 18:22:03 2009
+@@ -29,6 +29,7 @@
+ import com.sun.istack.internal.Nullable;
+ import com.sun.xml.internal.ws.api.model.soap.SOAPBinding;
+ 
++import javax.xml.namespace.QName;
+ import java.lang.reflect.Method;
+ 
+ /**
+@@ -50,7 +51,7 @@
+      * {@link @WebService}(endpointInterface="I")
+      * class A { }
+      *
+-     * In this case, it retuns A's method 
++     * In this case, it retuns A's method
+      *
+      * <p>
+      * {@link @WebService}(endpointInterface="I")
+@@ -61,11 +62,12 @@
+      * {@link @WebService}
+      * class A { }
+      * In this case, it returns A's method
+-     *  
++     *
+      * @return Returns the java {@link Method}
+      */
+     @NotNull Method getMethod();
+-    
++
++
+     /**
+      * This should be used if you want to access annotations on WebMethod
+      * Returns the SEI method if there is one.
+@@ -119,4 +121,20 @@
+      */
+     @Nullable String getResponseMessageName();
+ 
++    /**
++     * Gives soap:Body's first child's name for request message.
++     *
++     * @return
++     *      null if this operation doesn't have any request parameter bound to the body.
++     */
++    @Nullable QName getRequestPayloadName();
++
++    /**
++     * Gives soap:Body's first child's name for response message.
++     *
++     * @return
++     *      null if this operation doesn't have any response parameter bound to the body.
++     */
++    @Nullable QName getResponsePayloadName();
++
+ }
+--- old/src/share/classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLBoundOperation.java	Thu Jul 30 18:22:07 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLBoundOperation.java	Thu Jul 30 18:22:06 2009
+@@ -28,8 +28,9 @@
+ import com.sun.istack.internal.NotNull;
+ import com.sun.istack.internal.Nullable;
+ 
++import javax.jws.WebParam.Mode;
+ import javax.xml.namespace.QName;
+-import java.util.List;
++import java.util.Map;
+ 
+ /**
+  * Abstracts wsdl:binding/wsdl:operation. It can be used to determine the parts and their binding.
+@@ -57,11 +58,48 @@
+     @NotNull WSDLOperation getOperation();
+ 
+     /**
++     * Gives the owner {@link WSDLBoundPortType}
++     */
++    @NotNull WSDLBoundPortType getBoundPortType();
++
++    /**
+      * Gets the soapbinding:binding/operation/wsaw:Anonymous. A default value of OPTIONAL is returned.
+      *
+      * @return Anonymous value of the operation
+      */
+-    public ANONYMOUS getAnonymous();
+-    
++    ANONYMOUS getAnonymous();
++
+     enum ANONYMOUS { optional, required, prohibited }
++
++    /**
++     * Gets {@link WSDLPart} for the given wsdl:input or wsdl:output part
++     *
++     * @return null if no part is found
++     */
++    @Nullable WSDLPart getPart(@NotNull String partName, @NotNull Mode mode);
++
++    /**
++     * Gets all inbound {@link WSDLPart} by its {@link WSDLPart#getName() name}.
++     */
++    @NotNull Map<String,WSDLPart> getInParts();
++
++    /**
++     * Gets all outbound {@link WSDLPart} by its {@link WSDLPart#getName() name}.
++     */
++    @NotNull Map<String,WSDLPart> getOutParts();
++
++    /**
++     * Gets all the {@link WSDLFault} bound to this operation.
++     */
++    @NotNull Iterable<? extends WSDLBoundFault> getFaults();
++
++    /**
++     * Gets the payload QName of the request message.
++     *
++     * <p>
++     * It's possible for an operation to define no body part, in which case
++     * this method returns null.
++     */
++    @Nullable QName getReqPayloadName();
++
+ }
+--- old/src/share/classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLBoundPortType.java	Thu Jul 30 18:22:10 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLBoundPortType.java	Thu Jul 30 18:22:10 2009
+@@ -30,6 +30,7 @@
+ import com.sun.xml.internal.ws.api.BindingID;
+ import com.sun.xml.internal.ws.api.message.Message;
+ 
++import javax.jws.soap.SOAPBinding;
+ import javax.xml.namespace.QName;
+ 
+ /**
+@@ -73,6 +74,14 @@
+     Iterable<? extends WSDLBoundOperation> getBindingOperations();
+ 
+     /**
++     * Is this a document style or RPC style?
++     *
++     * Since we only support literal and not encoding, this means
++     * either doc/lit or rpc/lit.
++     */
++    @NotNull SOAPBinding.Style getStyle();
++
++    /**
+      * Returns the binding ID.
+      * This would typically determined by the binding extension elements in wsdl:binding.
+      */
+--- old/src/share/classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLExtensible.java	Thu Jul 30 18:22:14 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLExtensible.java	Thu Jul 30 18:22:13 2009
+@@ -53,7 +53,7 @@
+      *      The type of the extension to obtain. Must not be null.
+      *
+      * @return
+-     *      Can be an empty collection but never null.
++     *      Can be an empty fromjava.collection but never null.
+      */
+     <T extends WSDLExtension> Iterable<T> getExtensions(Class<T> type);
+ 
+--- old/src/share/classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLFault.java	Thu Jul 30 18:22:17 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLFault.java	Thu Jul 30 18:22:17 2009
+@@ -25,6 +25,10 @@
+ 
+ package com.sun.xml.internal.ws.api.model.wsdl;
+ 
++import com.sun.istack.internal.NotNull;
++
++import javax.xml.namespace.QName;
++
+ /**
+  * Abstracts wsdl:portType/wsdl:operation/wsdl:fault
+  *
+@@ -45,4 +49,19 @@
+      * @return Always returns null when called from inside WSDL extensions.
+      */
+     WSDLMessage getMessage();
++
++    /**
++     * Gives the owning {@link WSDLOperation}
++     */
++    @NotNull
++    WSDLOperation getOperation();
++
++    /**
++     * Gives qualified name of the wsdl:fault 'name' attribute value.
++     * <p/>
++     *
++     * The namespace uri is determined from the enclosing wsdl:operation.
++     */
++    @NotNull
++    QName getQName();
+ }
+--- old/src/share/classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLInput.java	Thu Jul 30 18:22:21 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLInput.java	Thu Jul 30 18:22:20 2009
+@@ -25,6 +25,11 @@
+ 
+ package com.sun.xml.internal.ws.api.model.wsdl;
+ 
++import com.sun.istack.internal.NotNull;
++import com.sun.istack.internal.Nullable;
++
++import javax.xml.namespace.QName;
++
+ /**
+  * Abstraction of wsdl:portType/wsdl:operation/wsdl:input
+  *
+@@ -58,4 +63,27 @@
+      * @return Action
+      */
+     String getAction();
++
++    /**
++     * Gives the owning {@link WSDLOperation}
++     */
++    @NotNull
++    WSDLOperation getOperation();
++
++    /**
++     * Gives qualified name of the wsdl:input 'name' attribute value. If there is no name, then it computes the name from:
++     *
++     * If the wsdl:operation is oneway:
++     *
++     * wsdl:operation@name value, which is local name of {@link WSDLOperation#getName()}
++     * <p/>
++     * otherwise
++     *
++     * wsdl:operation@name+"Request", which is local name of {@link WSDLOperation#getName()} + "Request"
++     * <p/>
++     *
++     * The namespace uri is determined from the enclosing wsdl:operation.
++     */
++    @NotNull
++    QName getQName();
+ }
+--- old/src/share/classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLMessage.java	Thu Jul 30 18:22:24 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLMessage.java	Thu Jul 30 18:22:24 2009
+@@ -37,4 +37,9 @@
+      * Gives wsdl:message@name value.
+      */
+     QName getName();
++
++    /**
++     * Gets all the parts.
++     */
++    Iterable<? extends WSDLPart> parts();
+ }
+--- old/src/share/classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLModel.java	Thu Jul 30 18:22:28 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLModel.java	Thu Jul 30 18:22:27 2009
+@@ -27,6 +27,7 @@
+ 
+ 
+ import com.sun.istack.internal.NotNull;
++import com.sun.xml.internal.ws.api.server.Container;
+ 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.wsdl.parser.RuntimeWSDLParser;
+@@ -118,7 +119,24 @@
+          * @throws org.xml.sax.SAXException
+          */
+         public static @NotNull WSDLModel parse(XMLEntityResolver.Parser wsdlEntityParser, XMLEntityResolver resolver, boolean isClientSide, WSDLParserExtension... extensions) throws IOException, XMLStreamException, SAXException {
+-            return RuntimeWSDLParser.parse(wsdlEntityParser, resolver, isClientSide, extensions);
++            return RuntimeWSDLParser.parse(wsdlEntityParser, resolver, isClientSide, Container.NONE, extensions);
+         }
++
++        /**
++         * Parses WSDL from the given wsdlLoc and gives a {@link WSDLModel} built from it.
++         *
++         * @param wsdlEntityParser  Works like an entityResolver to resolve WSDLs
++         * @param resolver  {@link XMLEntityResolver}, works at XML infoset level
++         * @param isClientSide  true - its invoked on the client, false means its invoked on the server
++         * @param container - container in which the parser is run
++         * @param extensions var args of {@link com.sun.xml.internal.ws.api.wsdl.parser.WSDLParserExtension}s
++         * @return A {@link WSDLModel} built from the given wsdlLocation}
++         * @throws java.io.IOException
++         * @throws javax.xml.stream.XMLStreamException
++         * @throws org.xml.sax.SAXException
++         */
++        public static @NotNull WSDLModel parse(XMLEntityResolver.Parser wsdlEntityParser, XMLEntityResolver resolver, boolean isClientSide, @NotNull Container container, WSDLParserExtension... extensions) throws IOException, XMLStreamException, SAXException {
++            return RuntimeWSDLParser.parse(wsdlEntityParser, resolver, isClientSide, container, extensions);
++        }
+     }
+ }
+--- old/src/share/classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLOperation.java	Thu Jul 30 18:22:31 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLOperation.java	Thu Jul 30 18:22:31 2009
+@@ -64,7 +64,7 @@
+     boolean isOneWay();
+ 
+     /**
+-     * Gets the {link WSDLFault} corresponding to wsdl:fault of this operation.
++     * Gets the {@link WSDLFault} corresponding to wsdl:fault of this operation.
+      */
+     Iterable<? extends WSDLFault> getFaults();
+ 
+--- old/src/share/classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLOutput.java	Thu Jul 30 18:22:37 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLOutput.java	Thu Jul 30 18:22:36 2009
+@@ -25,6 +25,10 @@
+ 
+ package com.sun.xml.internal.ws.api.model.wsdl;
+ 
++import com.sun.istack.internal.NotNull;
++
++import javax.xml.namespace.QName;
++
+ /**
+  * Abstraction of wsdl:portType/wsdl:operation/wsdl:output
+  *
+@@ -53,9 +57,26 @@
+      * <p/>
+      * This method provides the correct value irrespective of
+      * whether the Action is explicitly specified in the WSDL or
+-     * implicitly derived using the rules defined in WS-Addressing. 
++     * implicitly derived using the rules defined in WS-Addressing.
+      *
+      * @return Action
+      */
+     String getAction();
++
++    /**
++     * Gives the owning {@link WSDLOperation}
++     */
++    @NotNull
++    WSDLOperation getOperation();
++
++    /**
++     * Gives qualified name of the wsdl:output 'name' attribute value. If there is no name, then it computes the name from:
++     *
++     * wsdl:operation@name+"Response", which is local name of {@link WSDLOperation#getName()} + "Response"
++     * <p/>
++     *
++     * The namespace uri is determined from the enclosing wsdl:operation.
++     */
++    @NotNull
++    QName getQName();
+ }
+--- old/src/share/classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLPortType.java	Thu Jul 30 18:22:41 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLPortType.java	Thu Jul 30 18:22:40 2009
+@@ -52,7 +52,7 @@
+ 
+ 
+     /**
+-     * Gets {@link Iterable}<{$link WSDLOperation}>
++     * Gets {@link Iterable}<{@link WSDLOperation}>
+      */
+     public Iterable<? extends WSDLOperation> getOperations();
+ }
+--- old/src/share/classes/com/sun/xml/internal/ws/api/pipe/ClientPipeAssemblerContext.java	Thu Jul 30 18:22:45 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/ClientPipeAssemblerContext.java	Thu Jul 30 18:22:44 2009
+@@ -79,6 +79,13 @@
+     }
+ 
+     /**
++     * creates a {@link Pipe} that validates messages against schema
++     */
++    public Pipe createValidationPipe(Pipe next) {
++        return PipeAdapter.adapt(super.createValidationTube(PipeAdapter.adapt(next)));
++    }
++
++    /**
+      * Creates a {@link Pipe} that invokes protocol and logical handlers.
+      */
+     public Pipe createHandlerPipe(Pipe next) {
+--- old/src/share/classes/com/sun/xml/internal/ws/api/pipe/ClientTubeAssemblerContext.java	Thu Jul 30 18:22:48 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/ClientTubeAssemblerContext.java	Thu Jul 30 18:22:48 2009
+@@ -28,16 +28,24 @@
+ import com.sun.istack.internal.NotNull;
+ import com.sun.istack.internal.Nullable;
+ import com.sun.xml.internal.ws.addressing.WsaClientTube;
++import com.sun.xml.internal.ws.addressing.W3CWsaServerTube;
++import com.sun.xml.internal.ws.addressing.W3CWsaClientTube;
++import com.sun.xml.internal.ws.addressing.v200408.MemberSubmissionWsaServerTube;
++import com.sun.xml.internal.ws.addressing.v200408.MemberSubmissionWsaClientTube;
+ 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.client.ClientPipelineHook;
++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.helper.PipeAdapter;
+ import com.sun.xml.internal.ws.api.server.Container;
+ import com.sun.xml.internal.ws.binding.BindingImpl;
++import com.sun.xml.internal.ws.client.ClientSchemaValidationTube;
++import com.sun.xml.internal.ws.developer.SchemaValidationFeature;
+ import com.sun.xml.internal.ws.handler.ClientLogicalHandlerTube;
++import com.sun.xml.internal.ws.handler.ClientMessageHandlerTube;
+ import com.sun.xml.internal.ws.handler.ClientSOAPHandlerTube;
+ import com.sun.xml.internal.ws.handler.HandlerTube;
+ import com.sun.xml.internal.ws.protocol.soap.ClientMUTube;
+@@ -57,19 +65,33 @@
+ public class ClientTubeAssemblerContext {
+ 
+     private final @NotNull EndpointAddress address;
+-    private final @NotNull WSDLPort wsdlModel;
++    private final @Nullable WSDLPort wsdlModel;
++    private final @Nullable SEIModel seiModel;
+     private final @NotNull WSService rootOwner;
+     private final @NotNull WSBinding binding;
+     private final @NotNull Container container;
+     private @NotNull Codec codec;
+ 
+-    public ClientTubeAssemblerContext(@NotNull EndpointAddress address, @NotNull WSDLPort wsdlModel, @NotNull WSService rootOwner, @NotNull WSBinding binding) {
++    public ClientTubeAssemblerContext(@NotNull EndpointAddress address, @Nullable WSDLPort wsdlModel, @NotNull WSService rootOwner, @NotNull WSBinding binding) {
+         this(address, wsdlModel, rootOwner, binding, Container.NONE);
+     }
+ 
+-    public ClientTubeAssemblerContext(@NotNull EndpointAddress address, @NotNull WSDLPort wsdlModel,
++    public ClientTubeAssemblerContext(@NotNull EndpointAddress address, @Nullable WSDLPort wsdlModel,
+                                       @NotNull WSService rootOwner, @NotNull WSBinding binding,
++                                      @NotNull Container container) {
++        // WSBinding is actually BindingImpl
++        this(address, wsdlModel, rootOwner, binding, container, ((BindingImpl)binding).createCodec() );
++    }
++
++    public ClientTubeAssemblerContext(@NotNull EndpointAddress address, @Nullable WSDLPort wsdlModel,
++                                      @NotNull WSService rootOwner, @NotNull WSBinding binding,
+                                       @NotNull Container container, Codec codec) {
++        this(address, wsdlModel, rootOwner, binding, container, codec, null);
++    }
++
++    public ClientTubeAssemblerContext(@NotNull EndpointAddress address, @Nullable WSDLPort wsdlModel,
++                                      @NotNull WSService rootOwner, @NotNull WSBinding binding,
++                                      @NotNull Container container, Codec codec, SEIModel seiModel) {
+         this.address = address;
+         this.wsdlModel = wsdlModel;
+         this.rootOwner = rootOwner;
+@@ -76,14 +98,9 @@
+         this.binding = binding;
+         this.container = container;
+         this.codec = codec;
++        this.seiModel = seiModel;
+     }
+ 
+-    public ClientTubeAssemblerContext(@NotNull EndpointAddress address, @NotNull WSDLPort wsdlModel,
+-                                      @NotNull WSService rootOwner, @NotNull WSBinding binding,
+-                                      @NotNull Container container) {
+-        // WSBinding is actually BindingImpl
+-        this(address, wsdlModel, rootOwner, binding, container, ((BindingImpl)binding).createCodec() );
+-    }
+ 
+     /**
+      * The endpoint address. Always non-null. This parameter is taken separately
+@@ -120,6 +137,16 @@
+     }
+ 
+     /**
++     * The created pipeline will use seiModel to get java concepts for the endpoint
++     *
++     * @return Null if the service doesn't have SEI model e.g. Dispatch,
++     *         and otherwise non-null.
++     */
++    public @Nullable SEIModel getSEIModel() {
++        return seiModel;
++    }
++
++    /**
+      * Returns the Container in which the client is running
+      *
+      * @return Container in which client is running
+@@ -153,7 +180,11 @@
+      */
+     public Tube createWsaTube(Tube next) {
+         if (binding instanceof SOAPBinding && AddressingVersion.isEnabled(binding) && wsdlModel!=null)
+-            return new WsaClientTube(wsdlModel, binding, next);
++            if(AddressingVersion.fromBinding(binding) == AddressingVersion.MEMBER) {
++                return new MemberSubmissionWsaClientTube(wsdlModel, binding, next);
++            } else {
++                return new W3CWsaClientTube(wsdlModel, binding, next);
++            }
+         else
+             return next;
+     }
+@@ -162,13 +193,18 @@
+      * Creates a {@link Tube} that invokes protocol and logical handlers.
+      */
+     public Tube createHandlerTube(Tube next) {
+-        HandlerTube soapHandlerTube = null;
++        HandlerTube cousinHandlerTube = null;
+         //XML/HTTP Binding can have only LogicalHandlerPipe
+         if (binding instanceof SOAPBinding) {
+-            soapHandlerTube = new ClientSOAPHandlerTube(binding, wsdlModel, next);
+-            next = soapHandlerTube;
++            //Add MessageHandlerTube
++            HandlerTube messageHandlerTube = new ClientMessageHandlerTube(seiModel, binding, wsdlModel, next);
++            next = cousinHandlerTube = messageHandlerTube;
++
++            //Add SOAPHandlerTuber
++            HandlerTube soapHandlerTube = new ClientSOAPHandlerTube(binding, next, cousinHandlerTube);
++            next = cousinHandlerTube = soapHandlerTube;
+         }
+-        return new ClientLogicalHandlerTube(binding, next, soapHandlerTube);
++        return new ClientLogicalHandlerTube(binding, next, cousinHandlerTube);
+     }
+ 
+     /**
+@@ -183,24 +219,26 @@
+     }
+ 
+     /**
++     * creates a {@link Tube} that validates messages against schema
++     */
++    public Tube createValidationTube(Tube next) {
++        if (binding instanceof SOAPBinding && binding.isFeatureEnabled(SchemaValidationFeature.class) && wsdlModel!=null)
++            return new ClientSchemaValidationTube(binding, wsdlModel, next);
++        else
++            return next;
++    }
++
++    /**
+      * Creates a transport pipe (for client), which becomes the terminal pipe.
+      */
+     public Tube createTransportTube() {
+         ClassLoader cl = Thread.currentThread().getContextClassLoader();
+ 
+-        // wsgen generates a WSDL with the address attribute that says "REPLACE_WITH_ACTUAL_URL".
+-        // while it's technically correct to reject such address (since there's no transport registered
+-        // with it), it's desirable to allow the user a benefit of doubt, and wait until the runtime
+-        // to see if the user configures the endpoint address through request context.
++        // The application may configure the endpoint address through request context
++        // using {@link BindingProvider#ENDPOINT_ADDRESS_PROPERTY}. Let us
++        // defer the creation of actual transport until the service invocation,
+         // DeferredTransportPipe is used for this purpose.
+-        //
+-        // Ideally, we shouldn't have @address at all for such cases, but due to the backward
+-        // compatibility and the fact that this attribute is mandatory, we have no option but
+-        // to check for REPLACE_WITH_ACTUAL_URL.
+-        if(address.toString().equals("") || address.toString().equals("REPLACE_WITH_ACTUAL_URL"))
+-            return new DeferredTransportPipe(cl,this);
+-
+-        return TransportTubeFactory.create(cl, this);
++        return new DeferredTransportPipe(cl,this);
+     }
+ 
+     /**
+--- old/src/share/classes/com/sun/xml/internal/ws/api/pipe/Codec.java	Thu Jul 30 18:22:52 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/Codec.java	Thu Jul 30 18:22:51 2009
+@@ -71,9 +71,9 @@
+     /**
+      * Get the MIME type associated with this Codec.
+      * <p>
+-     * If available the MIME type will represent the media that the codec 
++     * If available the MIME type will represent the media that the codec
+      * encodes and decodes.
+-     * 
++     *
+      * The MIME type returned will be the most general representation independent
+      * of an instance of this MIME type utilized as a MIME content-type.
+      *
+@@ -82,7 +82,7 @@
+      *      implementation. Otherwise the MIME type is returned.
+      */
+     public String getMimeType();
+-    
++
+     /**
+      * If the MIME content-type of the encoding is known statically
+      * then this method returns it.
+--- old/src/share/classes/com/sun/xml/internal/ws/api/pipe/Codecs.java	Thu Jul 30 18:22:55 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/Codecs.java	Thu Jul 30 18:22:55 2009
+@@ -58,7 +58,7 @@
+      *
+      * @see ServerTubeAssemblerContext#setCodec(Codec)
+      * @see ClientTubeAssemblerContext#setCodec(Codec)
+-     * 
++     *
+      * @param binding binding of the webservice
+      * @param xmlEnvelopeCodec SOAP envelope codec
+      * @return non null codec to parse entire SOAP message(including MIME parts)
+--- old/src/share/classes/com/sun/xml/internal/ws/api/pipe/Engine.java	Thu Jul 30 18:22:59 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/Engine.java	Thu Jul 30 18:22:58 2009
+@@ -59,7 +59,7 @@
+     void addRunnable(Fiber fiber) {
+         if(threadPool==null) {
+             synchronized(this) {
+-                threadPool = Executors.newFixedThreadPool(5, new DaemonThreadFactory());
++                threadPool = Executors.newCachedThreadPool(new DaemonThreadFactory());
+             }
+         }
+         threadPool.execute(fiber);
+@@ -79,12 +79,29 @@
+     }
+ 
+     private static class DaemonThreadFactory implements ThreadFactory {
+-        private final AtomicInteger threadNumber = new AtomicInteger(1);
++        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-";
++        }
++
+         public Thread newThread(Runnable r) {
+-            Thread daemonThread = new Thread(r, "JAXWS-Engine-"+threadNumber.getAndIncrement());
+-            daemonThread.setDaemon(Boolean.TRUE);
+-            return daemonThread;
++            Thread t = new Thread(group, r,
++                                  namePrefix + threadNumber.getAndIncrement(),
++                                  0);
++            if (!t.isDaemon())
++                t.setDaemon(true);
++            if (t.getPriority() != Thread.NORM_PRIORITY)
++                t.setPriority(Thread.NORM_PRIORITY);
++            return t;
+         }
+     }
+ }
+--- old/src/share/classes/com/sun/xml/internal/ws/api/pipe/Fiber.java	Thu Jul 30 18:23:02 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/Fiber.java	Thu Jul 30 18:23:02 2009
+@@ -249,26 +249,29 @@
+      * Wakes up a suspended fiber.
+      *
+      * <p>
+-     * If a fiber was suspended from the {@link Tube#processRequest(Packet)} method,
+-     * then the execution will be resumed from the corresponding
+-     * {@link Tube#processResponse(Packet)} method with the specified response packet
+-     * as the parameter.
++     * If a fiber was suspended without specifying the next {@link Tube},
++     * then the execution will be resumed in the response processing direction,
++     * by calling the {@link Tube#processResponse(Packet)} method on the next/first
++     * {@link Tube} in the {@link Fiber}'s processing stack with the specified resume
++     * packet as the parameter.
+      *
+      * <p>
+-     * If a fiber was suspended from the {@link Tube#processResponse(Packet)} method,
+-     * then the execution will be resumed from the next tube's
+-     * {@link Tube#processResponse(Packet)} method with the specified response packet
+-     * as the parameter.
++     * If a fiber was suspended with specifying the next {@link Tube},
++     * then the execution will be resumed in the request processing direction,
++     * by calling the next tube's {@link Tube#processRequest(Packet)} method with the
++     * specified resume packet as the parameter.
+      *
+      * <p>
+      * 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. 
++     * need not worry about synchronizing {@link NextAction#suspend()} and this method.
++     *
++     * @param resumePacket packet used in the resumed processing
+      */
+-    public synchronized void resume(@NotNull Packet response) {
++    public synchronized void resume(@NotNull Packet resumePacket) {
+         if(isTraceEnabled())
+             LOGGER.fine(getName()+" resumed");
+-        packet = response;
++        packet = resumePacket;
+         if( --suspendedCount == 0 ) {
+             if(synchronous) {
+                 notifyAll();
+@@ -599,7 +602,7 @@
+                         LOGGER.finer(getName()+' '+last+" returned with "+na);
+ 
+                     // If resume is called before suspend, then make sure
+-					// resume(Packet) is not lost
++                                        // resume(Packet) is not lost
+                     if (na.kind != NextAction.SUSPEND) {
+                         packet = na.packet;
+                         throwable = na.throwable;
+@@ -618,7 +621,7 @@
+                         break;
+                     case NextAction.SUSPEND:
+                         pushCont(last);
+-                        next = null;
++                        next = na.next;
+                         suspend();
+                         break;
+                     default:
+@@ -686,6 +689,7 @@
+         return "engine-"+owner.id+"fiber-"+id;
+     }
+ 
++    @Override
+     public String toString() {
+         return getName();
+     }
+@@ -760,7 +764,7 @@
+ 
+     private static final Logger LOGGER = Logger.getLogger(Fiber.class.getName());
+ 
+-    
++
+     private static final ReentrantLock serializedExecutionLock = new ReentrantLock();
+ 
+     /**
+--- old/src/share/classes/com/sun/xml/internal/ws/api/pipe/FiberContextSwitchInterceptor.java	Thu Jul 30 18:23:06 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/FiberContextSwitchInterceptor.java	Thu Jul 30 18:23:05 2009
+@@ -44,7 +44,7 @@
+  * <p>
+  * The design also encapsulates the entire fiber execution in a single
+  * opaque method invocation {@link Work#execute}, allowing the use of
+- * <tt>finally</tt> block. 
++ * <tt>finally</tt> block.
+  *
+  *
+  * @author Kohsuke Kawaguchi
+--- old/src/share/classes/com/sun/xml/internal/ws/api/pipe/NextAction.java	Thu Jul 30 18:23:10 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/NextAction.java	Thu Jul 30 18:23:09 2009
+@@ -111,6 +111,15 @@
+     }
+ 
+     /**
++     * 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.
++     */
++    public void suspend(Tube next) {
++        set(SUSPEND, next, null, null);
++    }
++
++    /**
+      * Dumps the contents to assist debugging.
+      */
+     public String toString() {
+--- old/src/share/classes/com/sun/xml/internal/ws/api/pipe/Pipe.java	Thu Jul 30 18:23:13 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/Pipe.java	Thu Jul 30 18:23:12 2009
+@@ -81,7 +81,7 @@
+  * A {@link Pipe}line is not reentrant; one pipeline is used to process one request/response
+  * at at time. The same pipeline instance may serve request/response for different threads,
+  * if one comes after another and they don't overlap.
+- * <p> 
++ * <p>
+  * Where a need arises to process multiple requests concurrently, a pipeline
+  * gets cloned through {@link PipeCloner}. Note that this need may happen on
+  * both server (because it quite often serves multiple requests concurrently)
+@@ -315,7 +315,7 @@
+      * {@link PipeCloner#add(Pipe,Pipe)} to register the copied pipe
+      * with the original. This is required before you start copying
+      * the other {@link Pipe} references you have, or else there's a
+-     * risk of infinite recursion. 
++     * risk of infinite recursion.
+      * <p>
+      * For most {@link Pipe} implementations that delegate to another
+      * {@link Pipe}, this method requires that you also copy the {@link Pipe}
+--- old/src/share/classes/com/sun/xml/internal/ws/api/pipe/ServerPipeAssemblerContext.java	Thu Jul 30 18:23:17 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/ServerPipeAssemblerContext.java	Thu Jul 30 18:23:16 2009
+@@ -79,6 +79,13 @@
+     }
+ 
+     /**
++     * creates a {@link Pipe} that validates messages against schema
++     */
++    public @NotNull Pipe createValidationPipe(@NotNull Pipe next) {
++       return PipeAdapter.adapt(super.createValidationTube(PipeAdapter.adapt(next)));
++    }
++
++    /**
+      * Creates a {@link Pipe} that invokes protocol and logical handlers.
+      */
+     public @NotNull Pipe createHandlerPipe(@NotNull Pipe next) {
+--- old/src/share/classes/com/sun/xml/internal/ws/api/pipe/ServerTubeAssemblerContext.java	Thu Jul 30 18:23:20 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/ServerTubeAssemblerContext.java	Thu Jul 30 18:23:19 2009
+@@ -28,6 +28,8 @@
+ import com.sun.istack.internal.NotNull;
+ import com.sun.istack.internal.Nullable;
+ import com.sun.xml.internal.ws.addressing.WsaServerTube;
++import com.sun.xml.internal.ws.addressing.W3CWsaServerTube;
++import com.sun.xml.internal.ws.addressing.v200408.MemberSubmissionWsaServerTube;
+ import com.sun.xml.internal.ws.api.addressing.AddressingVersion;
+ import com.sun.xml.internal.ws.api.model.SEIModel;
+ import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort;
+@@ -35,10 +37,13 @@
+ import com.sun.xml.internal.ws.api.server.ServerPipelineHook;
+ import com.sun.xml.internal.ws.api.server.WSEndpoint;
+ import com.sun.xml.internal.ws.binding.BindingImpl;
++import com.sun.xml.internal.ws.developer.SchemaValidationFeature;
+ import com.sun.xml.internal.ws.handler.HandlerTube;
+ import com.sun.xml.internal.ws.handler.ServerLogicalHandlerTube;
++import com.sun.xml.internal.ws.handler.ServerMessageHandlerTube;
+ import com.sun.xml.internal.ws.handler.ServerSOAPHandlerTube;
+ import com.sun.xml.internal.ws.protocol.soap.ServerMUTube;
++import com.sun.xml.internal.ws.server.ServerSchemaValidationTube;
+ import com.sun.xml.internal.ws.util.pipe.DumpTube;
+ 
+ import javax.xml.ws.soap.SOAPBinding;
+@@ -148,7 +153,11 @@
+             HandlerTube cousin = new ServerLogicalHandlerTube(binding, wsdlModel, next);
+             next = cousin;
+             if (binding instanceof SOAPBinding) {
+-                return new ServerSOAPHandlerTube(binding, next, cousin);
++                //Add SOAPHandlerTube
++                next = cousin = new ServerSOAPHandlerTube(binding, next, cousin);
++
++                //Add MessageHandlerTube
++                next = new ServerMessageHandlerTube(seiModel, binding, next, cousin);
+             }
+         }
+         return next;
+@@ -187,12 +196,26 @@
+     }
+ 
+     /**
++     * creates a {@link Tube} that validates messages against schema
++     */
++    public Tube createValidationTube(Tube next) {
++        if (binding instanceof SOAPBinding && binding.isFeatureEnabled(SchemaValidationFeature.class) && wsdlModel!=null)
++            return new ServerSchemaValidationTube(endpoint, binding, next);
++        else
++            return next;
++    }
++
++    /**
+      * Creates WS-Addressing pipe
+      */
+     public Tube createWsaTube(Tube next) {
+-        if (binding instanceof SOAPBinding && AddressingVersion.isEnabled(binding) && wsdlModel!=null)
+-            return new WsaServerTube(wsdlModel, binding, next);
+-        else
++        if (binding instanceof SOAPBinding && AddressingVersion.isEnabled(binding)) {
++            if(AddressingVersion.fromBinding(binding) == AddressingVersion.MEMBER) {
++                return new MemberSubmissionWsaServerTube(endpoint, wsdlModel, binding, next);
++            } else {
++                return new W3CWsaServerTube(endpoint, wsdlModel, binding, next);
++            }
++        } else
+             return next;
+     }
+ 
+--- old/src/share/classes/com/sun/xml/internal/ws/api/pipe/StreamSOAPCodec.java	Thu Jul 30 18:23:23 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/StreamSOAPCodec.java	Thu Jul 30 18:23:23 2009
+@@ -27,6 +27,7 @@
+ 
+ import com.sun.istack.internal.NotNull;
+ import com.sun.xml.internal.ws.api.message.Message;
++import com.sun.xml.internal.ws.api.message.AttachmentSet;
+ 
+ import javax.xml.stream.XMLStreamReader;
+ 
+@@ -49,4 +50,14 @@
+      * @return a {@link Message} for SOAP envelope
+      */
+     public @NotNull Message decode(@NotNull XMLStreamReader reader);
++
++    /**
++     * Reads events from {@link XMLStreamReader} and constructs a
++     * {@link Message} for SOAP envelope.
++     *
++     * @param reader that represents SOAP envelope infoset
++     * @param att attachments for the message
++     * @return a {@link Message} for SOAP envelope
++     */
++    public @NotNull Message decode(@NotNull XMLStreamReader reader, @NotNull AttachmentSet att);
+ }
+--- old/src/share/classes/com/sun/xml/internal/ws/api/pipe/Stubs.java	Thu Jul 30 18:23:27 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/Stubs.java	Thu Jul 30 18:23:26 2009
+@@ -90,7 +90,7 @@
+  * <p>
+  * If you want the created {@link Dispatch} to talk to the given EPR, specify the parameter.
+  * Otherwise leave it <tt>null</tt>. Note that the addressing needs to be enabled separately
+- * for this to take effect. 
++ * for this to take effect.
+  *
+  * @author Kohsuke Kawaguchi
+  * @author Kathy Walsh
+--- old/src/share/classes/com/sun/xml/internal/ws/api/pipe/TransportTubeFactory.java	Thu Jul 30 18:23:30 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/TransportTubeFactory.java	Thu Jul 30 18:23:30 2009
+@@ -127,7 +127,7 @@
+         String scheme = context.getAddress().getURI().getScheme();
+         if (scheme != null) {
+             if(scheme.equalsIgnoreCase("http") || scheme.equalsIgnoreCase("https"))
+-                return new HttpTransportPipe(context.getCodec());
++                return new HttpTransportPipe(context.getCodec(), context.getBinding());
+         }
+ 
+         throw new WebServiceException("Unsupported endpoint address: "+context.getAddress());    // TODO: i18n
+--- old/src/share/classes/com/sun/xml/internal/ws/api/pipe/helper/AbstractFilterTubeImpl.java	Thu Jul 30 18:23:34 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/helper/AbstractFilterTubeImpl.java	Thu Jul 30 18:23:33 2009
+@@ -38,7 +38,7 @@
+  * In this prototype, this is not that convenient, but in the real production
+  * code where we have {@code preDestroy()} and {@code clone()}, this
+  * is fairly handy.
+- * 
++ *
+  * @author Kohsuke Kawaguchi
+  */
+ public abstract class AbstractFilterTubeImpl extends AbstractTubeImpl {
+@@ -50,7 +50,11 @@
+ 
+     protected AbstractFilterTubeImpl(AbstractFilterTubeImpl that, TubeCloner cloner) {
+         super(that, cloner);
+-        this.next = cloner.copy(that.next);
++        if (that.next != null) {
++            this.next = cloner.copy(that.next);
++        } else {
++            this.next = null;
++        }
+     }
+ 
+     /**
+--- old/src/share/classes/com/sun/xml/internal/ws/api/pipe/helper/AbstractTubeImpl.java	Thu Jul 30 18:23:37 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/api/pipe/helper/AbstractTubeImpl.java	Thu Jul 30 18:23:37 2009
+@@ -81,6 +81,12 @@
+         return na;
+     }
+ 
++    protected final NextAction doSuspend(Tube next) {
++        NextAction na = new NextAction();
++        na.suspend(next);
++        return na;
++    }
++
+     protected final NextAction doThrow(Throwable t) {
+         NextAction na = new NextAction();
+         na.throwException(t);
+--- old/src/share/classes/com/sun/xml/internal/ws/api/server/AbstractServerAsyncTransport.java	Thu Jul 30 18:23:41 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/AbstractServerAsyncTransport.java	Thu Jul 30 18:23:40 2009
+@@ -43,7 +43,7 @@
+  * @author Jitendra Kotamraju
+  */
+ public abstract class AbstractServerAsyncTransport<T> {
+-    
++
+     private final WSEndpoint endpoint;
+     private final CodecPool codecPool;
+ 
+--- old/src/share/classes/com/sun/xml/internal/ws/api/server/AsyncProvider.java	Thu Jul 30 18:23:44 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/AsyncProvider.java	Thu Jul 30 18:23:44 2009
+@@ -39,7 +39,7 @@
+  * {@link Provider} to implement asynchronous web services (AWS.) AWS enables
+  * applications to perform operations with long latency without blocking a thread,
+  * and thus particularly suitable for highly scalable service implementation,
+- * at the expesnce of implementation complexity. 
++ * at the expesnce of implementation complexity.
+  *
+  * <h2>Programming Model</h2>
+  * <p>
+--- old/src/share/classes/com/sun/xml/internal/ws/api/server/BoundEndpoint.java	Thu Jul 30 18:23:48 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/BoundEndpoint.java	Thu Jul 30 18:23:47 2009
+@@ -32,7 +32,7 @@
+ /**
+  * Represents the {@link WSEndpoint} bound to a particular transport.
+  *
+- * @see Module#getBoundEndpoints() 
++ * @see Module#getBoundEndpoints()
+  * @author Kohsuke Kawaguchi
+  */
+ public interface BoundEndpoint {
+@@ -42,6 +42,8 @@
+      * <p>
+      * Multiple {@link BoundEndpoint}s may point to the same {@link WSEndpoint},
+      * if it's bound to multiple transports.
++     *
++     * @return the endpoint
+      */
+     @NotNull WSEndpoint getEndpoint();
+ 
+@@ -52,6 +54,24 @@
+      * For example, if this endpoint is bound to a servlet endpoint
+      * "http://foobar/myapp/myservice", then this method should
+      * return that address.
++     *
++     * @return address of the endpoint
+      */
+     @NotNull URI getAddress();
++
++    /**
++     * The address of the bound endpoint using the base address. Often
++     * times, baseAddress is only avaialble during the request.
++     *
++     * <p>
++     * If the endpoint is bound to a servlet endpoint, the base address
++     * won't include the url-pattern, so the base address would be
++     * "http://host:port/context". This method would include url-pattern
++     * for the endpoint and return that address
++     * for e.g. "http://host:port/context/url-pattern"
++     *
++     * @param baseAddress that is used in computing the full address
++     * @return address of the endpoint
++     */
++    @NotNull URI getAddress(String baseAddress);
+ }
+--- old/src/share/classes/com/sun/xml/internal/ws/api/server/Container.java	Thu Jul 30 18:23:51 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/Container.java	Thu Jul 30 18:23:51 2009
+@@ -87,7 +87,7 @@
+ 
+     /**
+      * Constant that represents a "no {@link Container}",
+-     * which always returns null from {@link #getSPI(Class)}. 
++     * which always returns null from {@link #getSPI(Class)}.
+      */
+     public static final Container NONE = new Container() {
+         public <T> T getSPI(Class<T> spiType) {
+--- old/src/share/classes/com/sun/xml/internal/ws/api/server/InstanceResolver.java	Thu Jul 30 18:23:55 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/InstanceResolver.java	Thu Jul 30 18:23:54 2009
+@@ -82,9 +82,29 @@
+      *      Always non-null. Represents the request message to be served.
+      *      The caller may not consume the {@link Message}.
+      */
+-    public abstract @NotNull T resolve(Packet request);
++    public abstract @NotNull T resolve(@NotNull Packet request);
+ 
+     /**
++     * Called by the default {@link Invoker} after the method call is done.
++     * This gives {@link InstanceResolver} a chance to do clean up.
++     *
++     * <p>
++     * Alternatively, one could override {@link #createInvoker()} to
++     * create a custom invoker to do this in more flexible way.
++     *
++     * <p>
++     * The default implementation is a no-op.
++     *
++     * @param request
++     *      The same request packet given to {@link #resolve(Packet)} method.
++     * @param servant
++     *      The object returned from the {@link #resolve(Packet)} method.
++     * @since 2.1.2
++     */
++    public void postInvoke(@NotNull Packet request, @NotNull T servant) {
++    }
++
++    /**
+      * Called by {@link WSEndpoint} when it's set up.
+      *
+      * <p>
+@@ -210,12 +230,22 @@
+ 
+             @Override
+             public Object invoke(Packet p, Method m, Object... args) throws InvocationTargetException, IllegalAccessException {
+-                return m.invoke( resolve(p), args );
++                T t = resolve(p);
++                try {
++                    return m.invoke(t, args );
++                } finally {
++                    postInvoke(p,t);
++                }
+             }
+ 
+             @Override
+-            public <T> T invokeProvider(@NotNull Packet p, T arg) {
+-                return ((Provider<T>)resolve(p)).invoke(arg);
++            public <U> U invokeProvider(@NotNull Packet p, U arg) {
++                T t = resolve(p);
++                try {
++                    return ((Provider<U>) t).invoke(arg);
++                } finally {
++                    postInvoke(p,t);
++                }
+             }
+ 
+             public String toString() {
+--- old/src/share/classes/com/sun/xml/internal/ws/api/server/InstanceResolverAnnotation.java	Thu Jul 30 18:23:58 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/InstanceResolverAnnotation.java	Thu Jul 30 18:23:58 2009
+@@ -47,7 +47,7 @@
+  *
+  * <p>
+  * See {@link Stateful} for a real example. This annotation is only for
+- * advanced users of the JAX-WS RI. 
++ * advanced users of the JAX-WS RI.
+  *
+  * @since JAX-WS 2.1
+  * @see Stateful
+--- old/src/share/classes/com/sun/xml/internal/ws/api/server/Module.java	Thu Jul 30 18:24:02 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/Module.java	Thu Jul 30 18:24:01 2009
+@@ -50,9 +50,9 @@
+  *
+  * <p>
+  * There's a considerable overlap between this and {@link HttpAdapterList}.
+- * The SPI really needs to be reconsidered 
+- * 
++ * The SPI really needs to be reconsidered
+  *
++ *
+  * @see Container
+  * @author Kohsuke Kawaguchi
+  * @since 2.1 EA3
+@@ -64,7 +64,7 @@
+      * <p>
+      * From the point of view of the {@link Module} implementation,
+      * it really only needs to provide a {@link List} object as a data store.
+-     * JAX-WS will update this list accordingly. 
++     * JAX-WS will update this list accordingly.
+      *
+      * @return
+      *      always return the same non-null instance.
+--- old/src/share/classes/com/sun/xml/internal/ws/api/server/PortAddressResolver.java	Thu Jul 30 18:24:05 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/PortAddressResolver.java	Thu Jul 30 18:24:04 2009
+@@ -59,4 +59,22 @@
+      *      is written as it is (without any patching).
+      */
+     public abstract @Nullable String getAddressFor(@NotNull QName serviceName, @NotNull String portName);
++
++    /**
++     * Gets the endpoint address for a WSDL port
++     *
++     * @param serviceName
++     *       WSDL service name(wsd:service in WSDL) for which address is needed. Always non-null.
++     * @param portName
++     *       WSDL port name(wsdl:port in WSDL) for which address is needed. Always non-null.
++     * @param currentAddress
++     *       Whatever current address specified for the port in the WSDL
++     * @return
++     *      The address needs to be put in WSDL for port element's location
++     *      attribute. Can be null. If it is null, existing port address
++     *      is written as it is (without any patching).
++     */
++    public @Nullable String getAddressFor(@NotNull QName serviceName, @NotNull String portName, String currentAddress) {
++        return getAddressFor(serviceName, portName);
++    }
+ }
+--- old/src/share/classes/com/sun/xml/internal/ws/api/server/SDDocument.java	Thu Jul 30 18:24:08 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/SDDocument.java	Thu Jul 30 18:24:08 2009
+@@ -32,6 +32,7 @@
+ import java.io.OutputStream;
+ import java.io.IOException;
+ import java.net.URL;
++import java.util.Set;
+ 
+ /**
+  * Represents an individual document that forms a {@link ServiceDefinition}.
+@@ -69,6 +70,11 @@
+     boolean isSchema();
+ 
+     /**
++     * returns the referenced documents
++     */
++    Set<String> getImports();
++
++    /**
+      * Gets the system ID of the document where it's taken from. Generated documents
+      * use a fake URL that can be used to resolve relative URLs. So donot use this URL
+      * for reading or writing.
+@@ -150,5 +156,11 @@
+          * TODO: does this info need to be exposed?
+          */
+         boolean hasService();
++
++        /**
++         * All &lt;service> names that were in this WSDL, or empty set if there was none.
++         * Used for error diagnostics.
++         */
++        Set<QName> getAllServices();
+     }
+ }
+--- old/src/share/classes/com/sun/xml/internal/ws/api/server/SDDocumentFilter.java	Thu Jul 30 18:24:12 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/SDDocumentFilter.java	Thu Jul 30 18:24:11 2009
+@@ -33,7 +33,7 @@
+  * Provides a way to filter {@link SDDocument} infoset while writing it. These
+  * filter objects can be added to {@link ServiceDefinition} using
+  * {@link ServiceDefinition#addFilter(SDDocumentFilter)}
+- * 
++ *
+  * @author Kohsuke Kawaguchi
+  * @author Jitendra Kotamraju
+  */
+--- old/src/share/classes/com/sun/xml/internal/ws/api/server/SDDocumentSource.java	Thu Jul 30 18:24:15 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/SDDocumentSource.java	Thu Jul 30 18:24:15 2009
+@@ -41,7 +41,7 @@
+  *
+  * <p>
+  * This abstract class could be implemented by appliations, or one of the
+- * {@link #create} methods can be used. 
++ * {@link #create} methods can be used.
+  *
+  * @author Kohsuke Kawaguchi
+  */
+--- old/src/share/classes/com/sun/xml/internal/ws/api/server/ServerPipelineHook.java	Thu Jul 30 18:24:19 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/ServerPipelineHook.java	Thu Jul 30 18:24:18 2009
+@@ -70,7 +70,7 @@
+     public @NotNull Pipe createMonitoringPipe(ServerPipeAssemblerContext ctxt, @NotNull Pipe tail) {
+         return tail;
+     }
+-    
++
+     /**
+      * Called during the pipeline construction process once to allow a container
+      * to register a pipe for security.
+--- old/src/share/classes/com/sun/xml/internal/ws/api/server/WSEndpoint.java	Thu Jul 30 18:24:22 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/WSEndpoint.java	Thu Jul 30 18:24:22 2009
+@@ -31,6 +31,7 @@
+ 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.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;
+@@ -47,6 +48,7 @@
+ import javax.xml.ws.WebServiceException;
+ import java.net.URL;
+ import java.util.Collection;
++import java.util.Set;
+ import java.util.concurrent.Executor;
+ 
+ /**
+@@ -207,7 +209,7 @@
+      *
+      * @see {@link Packet#transportBackChannel}
+      * @see {@link Packet#webServiceContextDelegate}
+-     * 
++     *
+      * @param request web service request
+      * @param callback callback to get response packet
+      */
+@@ -342,8 +344,39 @@
+      */
+     public abstract @Nullable ServiceDefinition getServiceDefinition();
+ 
++    /**
++     * Gets the list of {@link EndpointComponent} that are associated
++     * with this endpoint.
++     *
++     * <p>
++     * Components (such as codec, tube, handler, etc) who wish to provide
++     * some service to other components in the endpoint can iterate the
++     * registry and call its {@link EndpointComponent#getSPI(Class)} to
++     * establish a private contract between components.
++     * <p>
++     * Components who wish to subscribe to such a service can add itself
++     * to this set.
++     *
++     * @return
++     *      always return the same set.
++     */
++    public abstract @NotNull Set<EndpointComponent> getComponentRegistry();
+ 
++    /**
++     * Gets the {@link com.sun.xml.internal.ws.api.model.SEIModel} that represents the relationship
++     * between WSDL and Java SEI.
++     *
++     * <p>
++     * This method returns a non-null value if and only if this
++     * endpoint is ultimately serving an application through an SEI.
++     *
++     * @return
++     *      maybe null. See above for more discussion.
++     *      Always the same value.
++     */
++    public abstract @Nullable SEIModel getSEIModel();
+ 
++
+     /**
+      * Creates an endpoint from deployment or programmatic configuration
+      *
+--- old/src/share/classes/com/sun/xml/internal/ws/api/server/WebModule.java	Thu Jul 30 18:24:26 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/WebModule.java	Thu Jul 30 18:24:25 2009
+@@ -50,7 +50,7 @@
+      *
+      * <p>
+      * Notice that this method involves in determining the machine name
+-     * without relying on HTTP "Host" header. 
++     * without relying on HTTP "Host" header.
+      */
+     public abstract @NotNull String getContextPath();
+ }
+--- old/src/share/classes/com/sun/xml/internal/ws/api/server/WebServiceContextDelegate.java	Thu Jul 30 18:24:29 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/WebServiceContextDelegate.java	Thu Jul 30 18:24:29 2009
+@@ -42,7 +42,7 @@
+  * When the user application calls a method on {@link WebServiceContext},
+  * the JAX-WS RI goes to the {@link Packet} that represents the request,
+  * then check {@link Packet#webServiceContextDelegate}, and forwards
+- * the method calls to {@link WebServiceContextDelegate}. 
++ * the method calls to {@link WebServiceContextDelegate}.
+  *
+  * <p>
+  * All the methods defined on this interface takes {@link Packet}
+@@ -125,7 +125,7 @@
+      * other transports that support WSDL publishing (such as SOAP/TCP used
+      * with Servlet transport), then such transport may
+      * choose to find the corresponding servlet endpoint by {@link Module#getBoundEndpoints()}
+-     * and try to obtain the address from there. 
++     * and try to obtain the address from there.
+      *
+      * <p>
+      * This information is used to put a metadata reference inside an EPR,
+--- old/src/share/classes/com/sun/xml/internal/ws/api/streaming/XMLStreamReaderFactory.java	Thu Jul 30 18:24:33 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/api/streaming/XMLStreamReaderFactory.java	Thu Jul 30 18:24:32 2009
+@@ -35,11 +35,15 @@
+ 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.lang.reflect.InvocationTargetException;
+ import java.lang.reflect.Method;
+ import java.net.URL;
++import java.util.logging.Logger;
++import java.security.AccessController;
+ 
+ /**
+  * Factory for {@link XMLStreamReader}.
+@@ -47,11 +51,13 @@
+  * <p>
+  * This wraps {@link XMLInputFactory} and allows us to reuse {@link XMLStreamReader} instances
+  * when appropriate.
+- * 
++ *
+  * @author Kohsuke Kawaguchi
+  */
+ public abstract class XMLStreamReaderFactory {
+ 
++    private static final Logger LOGGER = Logger.getLogger(XMLStreamReaderFactory.class.getName());
++
+     /**
+      * Singleton instance.
+      */
+@@ -58,15 +64,12 @@
+     private static volatile @NotNull XMLStreamReaderFactory theInstance;
+ 
+     static {
+-        XMLInputFactory xif = XMLInputFactory.newInstance();
+-        xif.setProperty(XMLInputFactory.IS_NAMESPACE_AWARE, true);
+-        xif.setProperty(XMLInputFactory.SUPPORT_DTD, false);
+-
++        XMLInputFactory xif = getXMLInputFactory();
+         XMLStreamReaderFactory f=null;
+ 
+         // this system property can be used to disable the pooling altogether,
+         // in case someone hits an issue with pooling in the production system.
+-        if(!Boolean.getBoolean(XMLStreamReaderFactory.class.getName()+".noPool"))
++        if(!getProperty(XMLStreamReaderFactory.class.getName()+".noPool"))
+             f = Zephyr.newInstance(xif);
+ 
+         if(f==null) {
+@@ -76,11 +79,30 @@
+         }
+ 
+         if(f==null)
+-            f = new Default(xif);
++            f = new Default();
+ 
+         theInstance = f;
++        LOGGER.fine("XMLStreamReaderFactory instance is = "+theInstance);
+     }
+ 
++    private static XMLInputFactory getXMLInputFactory() {
++        XMLInputFactory xif = null;
++        if (getProperty(XMLStreamReaderFactory.class.getName()+".woodstox")) {
++            try {
++                xif = (XMLInputFactory)Class.forName("com.ctc.wstx.stax.WstxInputFactory").newInstance();
++            } catch (Exception e) {
++                // Ignore and fallback to default XMLInputFactory
++            }
++        }
++        if (xif == null) {
++            xif = XMLInputFactory.newInstance();
++        }
++        xif.setProperty(XMLInputFactory.IS_NAMESPACE_AWARE, true);
++        xif.setProperty(XMLInputFactory.SUPPORT_DTD, false);
++        return xif;
++    }
++
++
+     /**
+      * Overrides the singleton {@link XMLStreamReaderFactory} instance that
+      * the JAX-WS RI uses.
+@@ -117,6 +139,12 @@
+         return get().doCreate(systemId,in,rejectDTDs);
+     }
+ 
++    public static XMLStreamReader create(@Nullable String systemId, InputStream in, @Nullable String encoding, boolean rejectDTDs) {
++        return (encoding == null)
++                ? create(systemId, in, rejectDTDs)
++                : get().doCreate(systemId,in,encoding,rejectDTDs);
++    }
++
+     public static XMLStreamReader create(@Nullable String systemId, Reader reader, boolean rejectDTDs) {
+         return get().doCreate(systemId,reader,rejectDTDs);
+     }
+@@ -151,7 +179,17 @@
+     // implementations
+ 
+     public abstract XMLStreamReader doCreate(String systemId, InputStream in, boolean rejectDTDs);
+-    
++
++    private XMLStreamReader doCreate(String systemId, InputStream in, @NotNull String encoding, boolean rejectDTDs) {
++        Reader reader;
++        try {
++            reader = new InputStreamReader(in, encoding);
++        } catch(UnsupportedEncodingException ue) {
++            throw new XMLReaderException("stax.cantCreate", ue);
++        }
++        return doCreate(systemId, reader, rejectDTDs);
++    }
++
+     public abstract XMLStreamReader doCreate(String systemId, Reader reader, boolean rejectDTDs);
+ 
+     public abstract void doRecycle(XMLStreamReader r);
+@@ -200,10 +238,10 @@
+             // check if this is from Zephyr
+             try {
+                 Class<?> clazz = xif.createXMLStreamReader(new StringReader("<foo/>")).getClass();
+-
+-                if(!clazz.getName().startsWith("com.sun.xml.internal.stream."))
++                // JDK has different XMLStreamReader impl class. Even if we check for that,
++                // it doesn't have setInputSource(InputSource). Let it use Default
++                if(!(clazz.getName().startsWith("com.sun.xml.internal.stream.")) )
+                     return null;    // nope
+-
+                 return new Zephyr(xif,clazz);
+             } catch (NoSuchMethodException e) {
+                 return null;    // this factory is not for zephyr
+@@ -278,7 +316,11 @@
+             } catch (IllegalAccessException e) {
+                 throw new XMLReaderException("stax.cantCreate",e);
+             } catch (InvocationTargetException e) {
+-                throw new XMLReaderException("stax.cantCreate",e);
++                Throwable cause = e.getCause();
++                if (cause == null) {
++                    cause = e;
++                }
++                throw new XMLReaderException("stax.cantCreate", cause);
+             } catch (XMLStreamException e) {
+                 throw new XMLReaderException("stax.cantCreate",e);
+             }
+@@ -295,21 +337,40 @@
+      * that can work with any {@link XMLInputFactory}.
+      *
+      * <p>
+-     * {@link XMLInputFactory} is not required to be thread-safe, so the
+-     * create method on this implementation is synchronized.
++     * {@link XMLInputFactory} is not required to be thread-safe, but
++     * if the create method on this implementation is synchronized,
++     * it may run into (see <a href="https://jax-ws.dev.java.net/issues/show_bug.cgi?id=555">
++     * race condition</a>). Hence, using a XMLInputFactory per theread.
+      */
+-    public static final class Default extends NoLock {
+-        public Default(XMLInputFactory xif) {
+-            super(xif);
++    public static final class Default extends XMLStreamReaderFactory {
++
++        private final ThreadLocal<XMLInputFactory> xif = new ThreadLocal<XMLInputFactory>() {
++            @Override
++            public XMLInputFactory initialValue() {
++                return getXMLInputFactory();
++            }
++        };
++
++        public XMLStreamReader doCreate(String systemId, InputStream in, boolean rejectDTDs) {
++            try {
++                return xif.get().createXMLStreamReader(systemId,in);
++            } catch (XMLStreamException e) {
++                throw new XMLReaderException("stax.cantCreate",e);
++            }
+         }
+ 
+-        public synchronized XMLStreamReader doCreate(String systemId, InputStream in, boolean rejectDTDs) {
+-            return super.doCreate(systemId, in, rejectDTDs);
++        public XMLStreamReader doCreate(String systemId, Reader in, boolean rejectDTDs) {
++            try {
++                return xif.get().createXMLStreamReader(systemId,in);
++            } catch (XMLStreamException e) {
++                throw new XMLReaderException("stax.cantCreate",e);
++            }
+         }
+ 
+-        public synchronized XMLStreamReader doCreate(String systemId, Reader in, boolean rejectDTDs) {
+-            return super.doCreate(systemId, in, rejectDTDs);
++        public void doRecycle(XMLStreamReader r) {
++            // there's no way to recycle with the default StAX API.
+         }
++
+     }
+ 
+     /**
+@@ -364,4 +425,16 @@
+             return super.doCreate(systemId, in, rejectDTDs);
+         }
+     }
++
++    private static Boolean getProperty(final String prop) {
++        Boolean b = AccessController.doPrivileged(
++            new java.security.PrivilegedAction<Boolean>() {
++                public Boolean run() {
++                    String value = System.getProperty(prop);
++                    return value != null ? Boolean.valueOf(value) : Boolean.FALSE;
++                }
++            }
++        );
++        return Boolean.FALSE;
++    }
+ }
+--- old/src/share/classes/com/sun/xml/internal/ws/api/streaming/XMLStreamWriterFactory.java	Thu Jul 30 18:24:37 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/api/streaming/XMLStreamWriterFactory.java	Thu Jul 30 18:24:36 2009
+@@ -39,6 +39,7 @@
+ import java.io.StringWriter;
+ import java.lang.reflect.InvocationTargetException;
+ import java.lang.reflect.Method;
++import java.util.logging.Logger;
+ 
+ /**
+  * Factory for {@link XMLStreamWriter}.
+@@ -51,6 +52,8 @@
+  */
+ public abstract class XMLStreamWriterFactory {
+ 
++    private static final Logger LOGGER = Logger.getLogger(XMLStreamWriterFactory.class.getName());
++
+     /**
+      * Singleton instance.
+      */
+@@ -58,7 +61,17 @@
+ 
+ 
+     static {
+-        XMLOutputFactory xof = XMLOutputFactory.newInstance();
++        XMLOutputFactory  xof = null;
++        if (Boolean.getBoolean(XMLStreamWriterFactory.class.getName()+".woodstox")) {
++            try {
++                xof = (XMLOutputFactory)Class.forName("com.ctc.wstx.stax.WstxOutputFactory").newInstance();
++            } catch (Exception e) {
++                // Ignore and fallback to default XMLOutputFactory
++            }
++        }
++        if (xof == null) {
++            xof = XMLOutputFactory.newInstance();
++        }
+ 
+         XMLStreamWriterFactory f=null;
+ 
+@@ -66,10 +79,16 @@
+         // in case someone hits an issue with pooling in the production system.
+         if(!Boolean.getBoolean(XMLStreamWriterFactory.class.getName()+".noPool"))
+             f = Zephyr.newInstance(xof);
+-        if(f==null)
++        if(f==null) {
++            // is this Woodstox?
++            if(xof.getClass().getName().equals("com.ctc.wstx.stax.WstxOutputFactory"))
++                f = new NoLock(xof);
++        }
++        if (f == null)
+             f = new Default(xof);
+ 
+         theInstance = f;
++        LOGGER.fine("XMLStreamWriterFactory instance is = "+theInstance);
+     }
+ 
+     /**
+@@ -290,7 +309,7 @@
+ 
+         public void doRecycle(XMLStreamWriter r) {
+             if(zephyrClass.isInstance(r)) {
+-                // this flushes the underlying stream, so it might cause chunking issue 
++                // this flushes the underlying stream, so it might cause chunking issue
+                 try {
+                     r.close();
+                 } catch (XMLStreamException e) {
+@@ -302,4 +321,33 @@
+                 ((RecycleAware)r).onRecycled();
+         }
+     }
++
++    /**
++     *
++     * For {@link javax.xml.stream.XMLOutputFactory} is thread safe.
++     */
++    public static final class NoLock extends XMLStreamWriterFactory {
++        private final XMLOutputFactory xof;
++
++        public NoLock(XMLOutputFactory xof) {
++            this.xof = xof;
++        }
++
++        public XMLStreamWriter doCreate(OutputStream out) {
++            return doCreate(out,"UTF-8");
++        }
++
++        public XMLStreamWriter doCreate(OutputStream out, String encoding) {
++            try {
++                return xof.createXMLStreamWriter(out,encoding);
++            } catch (XMLStreamException e) {
++                throw new XMLReaderException("stax.cantCreate",e);
++            }
++        }
++
++        public void doRecycle(XMLStreamWriter r) {
++            // no recycling
++        }
++
++    }
+ }
+--- old/src/share/classes/com/sun/xml/internal/ws/api/wsdl/parser/ServiceDescriptor.java	Thu Jul 30 18:24:40 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/api/wsdl/parser/ServiceDescriptor.java	Thu Jul 30 18:24:39 2009
+@@ -46,7 +46,7 @@
+     /**
+      * Gives list of schemas.
+      * @return List of XML schema documents as {@link Source}. {@link javax.xml.transform.Source#getSystemId()} must be Non-null.
+-     * 
++     *
+      */
+     public abstract @NotNull List<? extends Source> getSchemas();
+ }
+--- old/src/share/classes/com/sun/xml/internal/ws/api/wsdl/parser/WSDLParserExtension.java	Thu Jul 30 18:24:44 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/api/wsdl/parser/WSDLParserExtension.java	Thu Jul 30 18:24:43 2009
+@@ -26,19 +26,7 @@
+ package com.sun.xml.internal.ws.api.wsdl.parser;
+ 
+ import com.sun.xml.internal.ws.api.WSService;
+-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.WSDLExtensible;
+-import com.sun.xml.internal.ws.api.model.wsdl.WSDLExtension;
+-import com.sun.xml.internal.ws.api.model.wsdl.WSDLFault;
+-import com.sun.xml.internal.ws.api.model.wsdl.WSDLInput;
+-import com.sun.xml.internal.ws.api.model.wsdl.WSDLMessage;
+-import com.sun.xml.internal.ws.api.model.wsdl.WSDLModel;
+-import com.sun.xml.internal.ws.api.model.wsdl.WSDLOperation;
+-import com.sun.xml.internal.ws.api.model.wsdl.WSDLOutput;
+-import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort;
+-import com.sun.xml.internal.ws.api.model.wsdl.WSDLPortType;
+-import com.sun.xml.internal.ws.api.model.wsdl.WSDLService;
++import com.sun.xml.internal.ws.api.model.wsdl.*;
+ import com.sun.xml.internal.ws.api.pipe.Tube;
+ import com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser;
+ 
+@@ -180,22 +168,22 @@
+     public boolean portTypeOperationFault(WSDLOperation op, XMLStreamReader reader) {
+         return false;
+     }
+-    
++
+     public boolean definitionsElements(XMLStreamReader reader) {
+         return false;
+     }
+-    
++
+     public boolean bindingElements(WSDLBoundPortType binding, XMLStreamReader reader) {
+         return false;
+     }
+-    
++
+     public void bindingAttributes(WSDLBoundPortType binding, XMLStreamReader reader) {
+     }
+-    
++
+     public boolean portTypeElements(WSDLPortType portType, XMLStreamReader reader) {
+         return false;
+     }
+-    
++
+     public void portTypeAttributes(WSDLPortType portType, XMLStreamReader reader) {
+     }
+ 
+@@ -255,11 +243,11 @@
+     public void bindingOperationOutputAttributes(WSDLBoundOperation operation, XMLStreamReader reader) {
+     }
+ 
+-    public boolean bindingOperationFaultElements(WSDLBoundOperation operation, XMLStreamReader reader) {
++    public boolean bindingOperationFaultElements(WSDLBoundFault fault, XMLStreamReader reader) {
+         return false;
+     }
+ 
+-    public void bindingOperationFaultAttributes(WSDLBoundOperation operation, XMLStreamReader reader) {
++    public void bindingOperationFaultAttributes(WSDLBoundFault fault, XMLStreamReader reader) {
+     }
+ 
+     // TODO: complete the rest of the callback
+--- old/src/share/classes/com/sun/xml/internal/ws/api/wsdl/parser/WSDLParserExtensionContext.java	Thu Jul 30 18:24:47 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/api/wsdl/parser/WSDLParserExtensionContext.java	Thu Jul 30 18:24:46 2009
+@@ -24,12 +24,15 @@
+  */
+ package com.sun.xml.internal.ws.api.wsdl.parser;
+ 
++import com.sun.istack.internal.NotNull;
+ import com.sun.xml.internal.ws.api.model.wsdl.WSDLModel;
++import com.sun.xml.internal.ws.api.server.Container;
+ 
+ /**
+  * Provides contextual information for {@link WSDLParserExtension}s.
+- * 
++ *
+  * @author Vivek Pandey
++ * @author Fabian Ritzmann
+  */
+ public interface WSDLParserExtensionContext {
+     /**
+@@ -43,4 +46,12 @@
+      * {@link WSDLParserExtension#finished(WSDLParserExtensionContext)} is called.
+      */
+     WSDLModel getWSDLModel();
++
++    /**
++     * Provides the {@link Container} in which this service or client is running.
++     * May return null.
++     *
++     * @return The container in which this service or client is running.
++     */
++    @NotNull Container getContainer();
+ }
+--- old/src/share/classes/com/sun/xml/internal/ws/binding/BindingImpl.java	Thu Jul 30 18:24:51 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/binding/BindingImpl.java	Thu Jul 30 18:24:50 2009
+@@ -34,6 +34,7 @@
+ import com.sun.xml.internal.ws.api.pipe.Codec;
+ import com.sun.xml.internal.ws.client.HandlerConfiguration;
+ import com.sun.xml.internal.ws.developer.MemberSubmissionAddressingFeature;
++import com.sun.xml.internal.ws.developer.BindingTypeFeature;
+ 
+ import javax.xml.ws.WebServiceFeature;
+ import javax.xml.ws.soap.AddressingFeature;
+@@ -134,6 +135,13 @@
+     }
+ 
+     public static BindingImpl create(@NotNull BindingID bindingId, WebServiceFeature[] features) {
++        // Override the BindingID from the features
++        for(WebServiceFeature feature : features) {
++            if (feature instanceof BindingTypeFeature) {
++                BindingTypeFeature f = (BindingTypeFeature)feature;
++                bindingId = BindingID.parse(f.getBindingId());
++            }
++        }
+         if (bindingId.equals(BindingID.XML_HTTP))
+             return new HTTPBindingImpl();
+         else
+--- old/src/share/classes/com/sun/xml/internal/ws/binding/HTTPBindingImpl.java	Thu Jul 30 18:24:54 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/binding/HTTPBindingImpl.java	Thu Jul 30 18:24:53 2009
+@@ -68,6 +68,6 @@
+         return new HandlerConfiguration(
+                 Collections.<String>emptySet(),
+                 Collections.<QName>emptySet(),
+-                handlerChain,logicalHandlers,null,null);
++                handlerChain,logicalHandlers,null,null,null);
+     }
+ }
+--- old/src/share/classes/com/sun/xml/internal/ws/binding/SOAPBindingImpl.java	Thu Jul 30 18:24:58 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/binding/SOAPBindingImpl.java	Thu Jul 30 18:24:57 2009
+@@ -28,6 +28,7 @@
+ 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.handler.MessageHandler;
+ import com.sun.xml.internal.ws.client.HandlerConfiguration;
+ import com.sun.xml.internal.ws.encoding.soap.streaming.SOAP12NamespaceConstants;
+ import com.sun.xml.internal.ws.handler.HandlerException;
+@@ -43,11 +44,7 @@
+ import javax.xml.ws.handler.soap.SOAPHandler;
+ import javax.xml.ws.soap.MTOMFeature;
+ import javax.xml.ws.soap.SOAPBinding;
+-import java.util.ArrayList;
+-import java.util.Collections;
+-import java.util.HashSet;
+-import java.util.List;
+-import java.util.Set;
++import java.util.*;
+ 
+ 
+ /**
+@@ -78,7 +75,7 @@
+      * @param features
+      *      These features have a precedence over
+      *      {@link BindingID#createBuiltinFeatureList() the implicit features}
+-     *      associated with the {@link BindingID}. 
++     *      associated with the {@link BindingID}.
+      */
+     SOAPBindingImpl(BindingID bindingId, WebServiceFeature... features) {
+         super(bindingId);
+@@ -106,7 +103,7 @@
+     }
+ 
+     /**
+-     * This method separates the logical and protocol handlers. 
++     * This method separates the logical and protocol handlers.
+      * Also parses Headers understood by SOAPHandlers and
+      * sets the HandlerConfiguration.
+      */
+@@ -113,6 +110,7 @@
+     protected HandlerConfiguration createHandlerConfig(List<Handler> handlerChain) {
+         List<LogicalHandler> logicalHandlers = new ArrayList<LogicalHandler>();
+         List<SOAPHandler> soapHandlers = new ArrayList<SOAPHandler>();
++        List<MessageHandler> messageHandlers = new ArrayList<MessageHandler>();
+         Set<QName> handlerKnownHeaders = new HashSet<QName>();
+ 
+         for (Handler handler : handlerChain) {
+@@ -124,13 +122,19 @@
+                 if (headers != null) {
+                     handlerKnownHeaders.addAll(headers);
+                 }
+-            } else {
++            } else if (handler instanceof MessageHandler) {
++                messageHandlers.add((MessageHandler) handler);
++                Set<QName> headers = ((MessageHandler<?>) handler).getHeaders();
++                if (headers != null) {
++                    handlerKnownHeaders.addAll(headers);
++                }
++            }else {
+                 throw new HandlerException("handler.not.valid.type",
+                     handler.getClass());
+             }
+         }
+         return new HandlerConfiguration(roles,portKnownHeaders,handlerChain,
+-                logicalHandlers,soapHandlers,handlerKnownHeaders);
++                logicalHandlers,soapHandlers,messageHandlers,handlerKnownHeaders);
+     }
+ 
+     protected void addRequiredRoles() {
+@@ -157,7 +161,7 @@
+         addRequiredRoles();
+         HandlerConfiguration oldConfig = getHandlerConfig();
+         setHandlerConfig(new HandlerConfiguration(this.roles, portKnownHeaders, oldConfig.getHandlerChain(),
+-                oldConfig.getLogicalHandlers(),oldConfig.getSoapHandlers(),
++                oldConfig.getLogicalHandlers(),oldConfig.getSoapHandlers(), oldConfig.getMessageHandlers(),
+                 oldConfig.getHandlerKnownHeaders()));
+     }
+ 
+--- old/src/share/classes/com/sun/xml/internal/ws/binding/WebServiceFeatureList.java	Thu Jul 30 18:25:01 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/binding/WebServiceFeatureList.java	Thu Jul 30 18:25:00 2009
+@@ -23,7 +23,6 @@
+  * have any questions.
+  */
+ 
+-
+ package com.sun.xml.internal.ws.binding;
+ 
+ import com.sun.istack.internal.NotNull;
+@@ -264,6 +263,14 @@
+         this.parent = parent;
+     }
+ 
++    public static @Nullable <F extends WebServiceFeature> F getFeature(@NotNull WebServiceFeature[] features, @NotNull Class<F> featureType) {
++        for(WebServiceFeature f : features) {
++            if (f.getClass() == featureType)
++                return (F)f;
++        }
++        return null;
++    }
++
+     /**
+      * A Union of this WebServiceFeatureList and the parent.
+      */
+--- old/src/share/classes/com/sun/xml/internal/ws/client/AsyncInvoker.java	Thu Jul 30 18:25:05 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/client/AsyncInvoker.java	Thu Jul 30 18:25:04 2009
+@@ -29,6 +29,8 @@
+ import com.sun.xml.internal.ws.api.pipe.Fiber.CompletionCallback;
+ import com.sun.xml.internal.ws.api.pipe.Tube;
+ 
++import javax.xml.ws.WebServiceException;
++
+ /**
+  * 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
+@@ -47,4 +49,17 @@
+         this.responseImpl = responseImpl;
+     }
+ 
++    public void run () {
++        try {
++            do_run();
++        }catch(WebServiceException e) {
++            throw e;
++        }catch(Throwable t) {
++            //Wrap it in WebServiceException
++            throw new WebServiceException(t);
++        }
++    }
++
++    public abstract void do_run();
++
+ }
+--- old/src/share/classes/com/sun/xml/internal/ws/client/AsyncResponseImpl.java	Thu Jul 30 18:25:08 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/client/AsyncResponseImpl.java	Thu Jul 30 18:25:07 2009
+@@ -39,10 +39,6 @@
+  * request to Fiber and returns. When the Fiber finishes the execution, it sets
+  * response in the {@link FutureTask}
+  *
+- * <p>
+- * {@link ResponseImpl} executes things synchronously and waits for the return
+- * parameter.
+- *
+  * @author Jitendra Kotamraju
+  */
+ public final class AsyncResponseImpl<T> extends FutureTask<T> implements Response<T>, ResponseContextReceiver {
+--- old/src/share/classes/com/sun/xml/internal/ws/client/BindingProviderProperties.java	Thu Jul 30 18:25:11 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/client/BindingProviderProperties.java	Thu Jul 30 18:25:11 2009
+@@ -41,10 +41,6 @@
+     public static final String ONE_WAY_OPERATION =
+         "com.sun.xml.internal.ws.server.OneWayOperation";
+ 
+-    
+-    // Proprietary
+-    public static final String REQUEST_TIMEOUT = 
+-        "com.sun.xml.internal.ws.request.timeout";
+ 
+     //JAXWS 2.0
+     public static final String JAXWS_HANDLER_CONFIG =
+--- old/src/share/classes/com/sun/xml/internal/ws/client/ClientTransportException.java	Thu Jul 30 18:25:15 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/client/ClientTransportException.java	Thu Jul 30 18:25:14 2009
+@@ -48,4 +48,3 @@
+         return "com.sun.xml.internal.ws.resources.client";
+     }
+ }
+-
+--- old/src/share/classes/com/sun/xml/internal/ws/client/ContentNegotiation.java	Thu Jul 30 18:25:18 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/client/ContentNegotiation.java	Thu Jul 30 18:25:18 2009
+@@ -27,7 +27,7 @@
+ /**
+  * Content negotiation enum.
+  * <p>
+- * A value of {@link #none} means no content negotation at level of the 
++ * A value of {@link #none} means no content negotation at level of the
+  * client transport will be performed to negotiate the encoding of XML infoset.
+  * The default encoding will always be used.
+  * <p>
+@@ -48,12 +48,12 @@
+     none,
+     pessimistic,
+     optimistic;
+-  
++
+     /**
+      * Property name for content negotiation on {@link RequestContext}.
+      */
+     public static final String PROPERTY = "com.sun.xml.internal.ws.client.ContentNegotiation";
+-    
++
+     /**
+      * Obtain the content negotiation value from a system property.
+      * <p>
+@@ -64,9 +64,9 @@
+     public static ContentNegotiation obtainFromSystemProperty() {
+         try {
+             String value = System.getProperty(PROPERTY);
+-            
++
+             if (value == null) return none;
+-            
++
+             return valueOf(value);
+         } catch (Exception e) {
+             // Default to none for any unrecognized value or any other
+--- old/src/share/classes/com/sun/xml/internal/ws/client/HandlerConfiguration.java	Thu Jul 30 18:25:22 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/client/HandlerConfiguration.java	Thu Jul 30 18:25:21 2009
+@@ -24,15 +24,13 @@
+  */
+ package com.sun.xml.internal.ws.client;
+ 
++import com.sun.xml.internal.ws.api.handler.MessageHandler;
++
+ import javax.xml.namespace.QName;
+ import javax.xml.ws.handler.Handler;
+ import javax.xml.ws.handler.LogicalHandler;
+ import javax.xml.ws.handler.soap.SOAPHandler;
+-import java.util.ArrayList;
+-import java.util.Collections;
+-import java.util.HashSet;
+-import java.util.List;
+-import java.util.Set;
++import java.util.*;
+ 
+ /**
+  * This class holds the handler information on the BindingProvider.
+@@ -43,7 +41,7 @@
+  * Packet.handlerConfig
+  * The information in the HandlerConfiguration is used by MUPipe and HandlerTube
+  * implementations.
+- * 
++ *
+  * @author Rama Pulavarthi
+  */
+ public class HandlerConfiguration {
+@@ -54,6 +52,7 @@
+     private final List<Handler> handlerChain;
+     private final List<LogicalHandler> logicalHandlers;
+     private final List<SOAPHandler> soapHandlers;
++    private final List<MessageHandler> messageHandlers;
+     private Set<QName> knownHeaders;
+     private Set<QName> handlerKnownHeaders;
+     /**
+@@ -68,11 +67,13 @@
+     public HandlerConfiguration(Set<String> roles, Set<QName> portKnownHeaders,
+                                 List<Handler> handlerChain,
+                                 List<LogicalHandler> logicalHandlers, List<SOAPHandler> soapHandlers,
++                                List<MessageHandler> messageHandlers,
+                                 Set<QName> handlerKnownHeaders) {
+         this.roles = roles;
+         this.handlerChain = handlerChain;
+         this.logicalHandlers = logicalHandlers;
+         this.soapHandlers = soapHandlers;
++        this.messageHandlers = messageHandlers;
+         this.handlerKnownHeaders = handlerKnownHeaders;
+         this.knownHeaders = new HashSet<QName>();
+         if(portKnownHeaders != null)
+@@ -104,6 +105,10 @@
+         return soapHandlers;
+     }
+ 
++    public List<MessageHandler> getMessageHandlers() {
++        return messageHandlers;
++    }
++
+     public Set<QName> getKnownHeaders() {
+         return knownHeaders;
+     }
+--- old/src/share/classes/com/sun/xml/internal/ws/client/PortInfo.java	Thu Jul 30 18:25:25 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/client/PortInfo.java	Thu Jul 30 18:25:25 2009
+@@ -111,7 +111,7 @@
+             Iterable<WSDLPortImpl> ports = owner.getWsdlService().getPorts();
+             for (WSDLPortImpl port : ports){
+                 if (port.getName().equals(portName))
+-                    return port;                
++                    return port;
+             }
+         }
+         return null;
+@@ -168,4 +168,3 @@
+         return bindingId.toString();
+     }
+ }
+-
+--- old/src/share/classes/com/sun/xml/internal/ws/client/RequestContext.java	Thu Jul 30 18:25:29 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/client/RequestContext.java	Thu Jul 30 18:25:28 2009
+@@ -152,7 +152,7 @@
+     }
+ 
+     /**
+-     * The value of {@link ContentNegotiation#PROPERTY} 
++     * The value of {@link ContentNegotiation#PROPERTY}
+      * property.
+      */
+     public ContentNegotiation contentNegotiation = defaultContentNegotiation;
+@@ -297,7 +297,7 @@
+                     handlerScopePropertyNames.add(key);
+                 }
+             }
+-            
++
+             if(!handlerScopePropertyNames.isEmpty())
+                 packet.getHandlerScopePropertyNames(false).addAll(handlerScopePropertyNames);
+         }
+--- old/src/share/classes/com/sun/xml/internal/ws/client/Stub.java	Thu Jul 30 18:25:32 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/client/Stub.java	Thu Jul 30 18:25:32 2009
+@@ -27,7 +27,6 @@
+ 
+ import com.sun.istack.internal.NotNull;
+ import com.sun.istack.internal.Nullable;
+-import com.sun.xml.internal.ws.Closeable;
+ import com.sun.xml.internal.ws.model.wsdl.WSDLProperties;
+ import com.sun.xml.internal.ws.api.EndpointAddress;
+ import com.sun.xml.internal.ws.api.WSBinding;
+@@ -70,7 +69,7 @@
+  *
+  * @author Kohsuke Kawaguchi
+  */
+-public abstract class Stub implements WSBindingProvider, ResponseContextReceiver, Closeable {
++public abstract class Stub implements WSBindingProvider, ResponseContextReceiver  {
+ 
+     /**
+      * Reuse pipelines as it's expensive to create.
+@@ -180,7 +179,7 @@
+     public final Executor getExecutor() {
+         return owner.getExecutor();
+     }
+-    
++
+     /**
+      * Passes a message to a pipe for processing.
+      * <p>
+@@ -199,33 +198,7 @@
+      *                       So we take a setter that abstracts that away.
+      */
+     protected final Packet process(Packet packet, RequestContext requestContext, ResponseContextReceiver receiver) {
+-        {// fill in Packet
+-            packet.proxy = this;
+-            packet.handlerConfig = binding.getHandlerConfig();
+-            requestContext.fill(packet);
+-            if (wsdlProperties != null) {
+-                packet.addSatellite(wsdlProperties);
+-            }
+-            if (addrVersion != null) {
+-                // populate request WS-Addressing headers
+-                HeaderList headerList = packet.getMessage().getHeaders();
+-                headerList.fillRequestAddressingHeaders(wsdlPort, binding, packet);
+-
+-
+-                // Spec is not clear on if ReferenceParameters are to be added when addressing is not enabled,
+-                // but the EPR has ReferenceParameters.
+-                // Current approach: Add ReferenceParameters only if addressing enabled.
+-                if (endpointReference != null)
+-                    endpointReference.addReferenceParameters(packet.getMessage().getHeaders());
+-            }
+-
+-            // 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);
+-        }
+-
+-
++        configureRequestPacket(packet, requestContext);
+         Pool<Tube> pool = tubes;
+         if (pool == null)
+             throw new WebServiceException("close method has already been invoked"); // TODO: i18n
+@@ -250,6 +223,33 @@
+         }
+     }
+ 
++    private void configureRequestPacket(Packet packet, RequestContext requestContext) {
++        // fill in Packet
++        packet.proxy = this;
++        packet.handlerConfig = binding.getHandlerConfig();
++        requestContext.fill(packet);
++        if (wsdlProperties != null) {
++            packet.addSatellite(wsdlProperties);
++        }
++        if (addrVersion != null) {
++            // populate request WS-Addressing headers
++            HeaderList headerList = packet.getMessage().getHeaders();
++            headerList.fillRequestAddressingHeaders(wsdlPort, binding, packet);
++
++
++            // Spec is not clear on if ReferenceParameters are to be added when addressing is not enabled,
++            // but the EPR has ReferenceParameters.
++            // Current approach: Add ReferenceParameters only if addressing enabled.
++            if (endpointReference != null)
++                endpointReference.addReferenceParameters(packet.getMessage().getHeaders());
++        }
++
++        // 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);
++    }
++
+     /**
+      * Passes a message through a {@link Tube}line for processing. The processing happens
+      * asynchronously and when the response is available, Fiber.CompletionCallback is
+@@ -269,16 +269,7 @@
+      */
+     protected final void processAsync(Packet request, RequestContext requestContext, final Fiber.CompletionCallback completionCallback) {
+         // fill in Packet
+-        request.proxy = this;
+-        request.handlerConfig = binding.getHandlerConfig();
+-        requestContext.fill(request);
+-        if (wsdlProperties != null) {
+-            request.addSatellite(wsdlProperties);
+-        }
+-        if (AddressingVersion.isEnabled(binding)) {
+-            if(endpointReference!=null)
+-                endpointReference.addReferenceParameters(request.getMessage().getHeaders());
+-        }
++        configureRequestPacket(request, requestContext);
+ 
+         final Pool<Tube> pool = tubes;
+         if (pool == null)
+@@ -403,4 +394,8 @@
+         return Collections.unmodifiableList((HeaderList)
+             responseContext.get(JAXWSProperties.INBOUND_HEADER_LIST_PROPERTY));
+     }
++
++    public final void setAddress(String address) {
++        requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, address);
++    }
+ }
+--- old/src/share/classes/com/sun/xml/internal/ws/client/WSServiceDelegate.java	Thu Jul 30 18:25:36 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/client/WSServiceDelegate.java	Thu Jul 30 18:25:35 2009
+@@ -35,7 +35,7 @@
+ 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.model.wsdl.WSDLModel;
++import com.sun.xml.internal.ws.api.model.SEIModel;
+ import com.sun.xml.internal.ws.api.pipe.*;
+ import com.sun.xml.internal.ws.api.server.Container;
+ import com.sun.xml.internal.ws.api.server.ContainerResolver;
+@@ -46,6 +46,7 @@
+ 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.WSBindingProvider;
++import com.sun.xml.internal.ws.developer.UsesJAXBContextFeature;
+ import com.sun.xml.internal.ws.model.AbstractSEIModelImpl;
+ import com.sun.xml.internal.ws.model.RuntimeModeler;
+ import com.sun.xml.internal.ws.model.SOAPSEIModel;
+@@ -55,6 +56,7 @@
+ import com.sun.xml.internal.ws.resources.ClientMessages;
+ import com.sun.xml.internal.ws.resources.DispatchMessages;
+ import com.sun.xml.internal.ws.resources.ProviderApiMessages;
++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;
+@@ -62,6 +64,7 @@
+ import org.xml.sax.SAXException;
+ 
+ import javax.jws.HandlerChain;
++import javax.jws.WebService;
+ import javax.xml.bind.JAXBContext;
+ import javax.xml.namespace.QName;
+ import javax.xml.stream.XMLStreamException;
+@@ -172,9 +175,18 @@
+         //we cant create a Service without serviceName
+         if (serviceName == null)
+             throw new WebServiceException(ClientMessages.INVALID_SERVICE_NAME_NULL(serviceName));
++
++        InitParams initParams = INIT_PARAMS.get();
++        INIT_PARAMS.set(null);  // mark it as consumed
++        if(initParams==null)    initParams = EMPTY_PARAMS;
++
+         this.serviceName = serviceName;
+         this.serviceClass = serviceClass;
+-        this.container = ContainerResolver.getInstance().getContainer();
++        Container tContainer = initParams.getContainer()!=null ? initParams.getContainer() : ContainerResolver.getInstance().getContainer();
++        if (tContainer == Container.NONE) {
++            tContainer = new ClientContainer();
++        }
++        this.container = tContainer;
+ 
+         // load interceptor
+         ServiceInterceptor interceptor = ServiceInterceptorFactory.load(this, Thread.currentThread().getContextClassLoader());
+@@ -185,6 +197,19 @@
+         this.serviceInterceptor = interceptor;
+ 
+ 
++        //if wsdl is null, try and get it from the WebServiceClient.wsdlLocation
++        if(wsdl == null){
++            if(serviceClass != Service.class){
++                WebServiceClient wsClient = AccessController.doPrivileged(new PrivilegedAction<WebServiceClient>() {
++                        public WebServiceClient run() {
++                            return serviceClass.getAnnotation(WebServiceClient.class);
++                        }
++                    });
++                String wsdlLocation = wsClient.wsdlLocation();
++                wsdlLocation = JAXWSUtils.absolutize(JAXWSUtils.getFileOrURLName(wsdlLocation));
++                wsdl = new StreamSource(wsdlLocation);
++            }
++        }
+         WSDLServiceImpl service=null;
+         if (wsdl != null) {
+             try {
+@@ -219,7 +244,7 @@
+     }
+ 
+     /**
+-     * Parses the WSDL and builds {@link WSDLModel}.
++     * Parses the WSDL and builds {@link com.sun.xml.internal.ws.api.model.wsdl.WSDLModel}.
+      * @param wsdlDocumentLocation
+      *      Either this or <tt>wsdl</tt> parameter must be given.
+      *      Null location means the system won't be able to resolve relative references in the WSDL,
+@@ -227,7 +252,7 @@
+     private WSDLModelImpl parseWSDL(URL wsdlDocumentLocation, Source wsdlSource) {
+         try {
+             return RuntimeWSDLParser.parse(wsdlDocumentLocation, wsdlSource, createDefaultCatalogResolver(),
+-                true, ServiceFinder.find(WSDLParserExtension.class).toArray());
++                true, getContainer(), ServiceFinder.find(WSDLParserExtension.class).toArray());
+         } catch (IOException e) {
+             throw new WebServiceException(e);
+         } catch (XMLStreamException e) {
+@@ -273,8 +298,19 @@
+     public <T> T getPort(QName portName, Class<T> portInterface, WebServiceFeature... features) {
+         if (portName == null || portInterface == null)
+             throw new IllegalArgumentException();
+-        WSDLPortImpl portModel = getPortModel(portName);
+-        return getPort(portModel.getEPR(),portName,portInterface,features);
++        WSDLServiceImpl tWsdlService = this.wsdlService;
++        if (tWsdlService == 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
++            tWsdlService = getWSDLModelfromSEI(portInterface);
++            //still null? throw error need wsdl metadata to create a proxy
++            if (tWsdlService == null) {
++                throw new WebServiceException(ProviderApiMessages.NO_WSDL_NO_PORT(portInterface.getName()));
++            }
++
++        }
++        WSDLPortImpl portModel = getPortModel(tWsdlService, portName);
++        return getPort(portModel.getEPR(), portName, portInterface, features);
+     }
+ 
+     public <T> T getPort(EndpointReference epr, Class<T> portInterface, WebServiceFeature... features) {
+@@ -291,12 +327,22 @@
+ 
+     private <T> T getPort(WSEndpointReference wsepr, QName portName, Class<T> portInterface,
+                           WebServiceFeature... features) {
+-        addSEI(portName, portInterface);
+-        return createEndpointIFBaseProxy(wsepr,portName,portInterface,features);
++        SEIPortInfo spi = addSEI(portName, portInterface, features);
++        return createEndpointIFBaseProxy(wsepr,portName,portInterface,features, spi);
+     }
+     public <T> T getPort(Class<T> portInterface, WebServiceFeature... features) {
+         //get the portType from SEI
+         QName portTypeName = RuntimeModeler.getPortTypeName(portInterface);
++        WSDLServiceImpl wsdlService = this.wsdlService;
++        if(wsdlService == 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);
++            //still null? throw error need wsdl metadata to create a proxy
++            if(wsdlService == 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)
+@@ -376,7 +422,10 @@
+     private Tube createPipeline(PortInfo portInfo, WSBinding binding) {
+         //Check all required WSDL extensions are understood
+         checkAllWSDLExtensionsUnderstood(portInfo,binding);
+-
++        SEIModel seiModel = null;
++        if(portInfo instanceof SEIPortInfo) {
++            seiModel = ((SEIPortInfo)portInfo).model;
++        }
+         BindingID bindingId = portInfo.bindingId;
+ 
+         TubelineAssembler assembler = TubelineAssemblerFactory.create(
+@@ -387,7 +436,7 @@
+                 new ClientTubeAssemblerContext(
+                         portInfo.targetEndpoint,
+                         portInfo.portModel,
+-                        this, binding, container));
++                        this, binding, container,((BindingImpl)binding).createCodec(),seiModel));
+     }
+ 
+     /**
+@@ -422,6 +471,11 @@
+          return dispatch;
+     }
+ 
++    @Override
++    public @NotNull Container getContainer() {
++        return container;
++    }
++
+     public Dispatch<Object> createDispatch(QName portName, JAXBContext jaxbContext, Service.Mode mode, WebServiceFeature... webServiceFeatures) {
+         WebServiceFeatureList featureList =  new WebServiceFeatureList(webServiceFeatures);
+         WSEndpointReference wsepr = null;
+@@ -445,7 +499,7 @@
+         // TODO: what if it has different epr address?
+         {
+             PortInfo portInfo = new PortInfo(this, (wsepr.getAddress() == null) ? null : EndpointAddress.create(wsepr.getAddress()), eprPortName,
+-                    getPortModel(eprPortName).getBinding().getBindingId());
++                    getPortModel(wsdlService, eprPortName).getBinding().getBindingId());
+             if (!ports.containsKey(eprPortName)) {
+                 ports.put(eprPortName, portInfo);
+             }
+@@ -506,6 +560,34 @@
+         return portName;
+ 
+     }
++
++    private WSDLServiceImpl getWSDLModelfromSEI(final Class sei) {
++        WebService ws = AccessController.doPrivileged(new PrivilegedAction<WebService>() {
++            public WebService run() {
++                return (WebService) sei.getAnnotation(WebService.class);
++            }
++        });
++        if (ws == null || ws.wsdlLocation().equals(""))
++            return null;
++        String wsdlLocation = ws.wsdlLocation();
++        wsdlLocation = JAXWSUtils.absolutize(JAXWSUtils.getFileOrURLName(wsdlLocation));
++        Source wsdl = new StreamSource(wsdlLocation);
++        WSDLServiceImpl service = null;
++
++        try {
++            URL url = wsdl.getSystemId() == null ? null : new URL(wsdl.getSystemId());
++            WSDLModelImpl model = parseWSDL(url, wsdl);
++            service = model.getService(this.serviceName);
++            if (service == null)
++                throw new WebServiceException(
++                        ClientMessages.INVALID_SERVICE_NAME(this.serviceName,
++                                buildNameList(model.getServices().keySet())));
++        } catch (MalformedURLException e) {
++            throw new WebServiceException(ClientMessages.INVALID_WSDL_URL(wsdl.getSystemId()));
++        }
++        return service;
++    }
++
+     public QName getServiceName() {
+         return serviceName;
+     }
+@@ -531,7 +613,8 @@
+         }
+     }
+ 
+-    private <T> T createEndpointIFBaseProxy(@Nullable WSEndpointReference epr,QName portName, Class<T> portInterface, WebServiceFeature[] webServiceFeatures) {
++    private <T> T createEndpointIFBaseProxy(@Nullable WSEndpointReference epr,QName portName, Class<T> portInterface,
++                                            WebServiceFeature[] webServiceFeatures, SEIPortInfo eif) {
+         //fail if service doesnt have WSDL
+         if (wsdlService == null)
+             throw new WebServiceException(ClientMessages.INVALID_SERVICE_NO_WSDL(serviceName));
+@@ -541,8 +624,6 @@
+                 ClientMessages.INVALID_PORT_NAME(portName,buildWsdlPortNames()));
+         }
+ 
+-        SEIPortInfo eif = seiContext.get(portName);
+-
+         BindingImpl binding = eif.createBinding(webServiceFeatures,portInterface);
+         SEIStub pis = new SEIStub(this, binding, eif.model, createPipeline(eif, binding), epr);
+ 
+@@ -569,11 +650,11 @@
+      *
+      * @return guaranteed to be non-null.
+      */
+-    public @NotNull WSDLPortImpl getPortModel(QName portName) {
++    private @NotNull WSDLPortImpl getPortModel(WSDLServiceImpl wsdlService, QName portName) {
+         WSDLPortImpl port = wsdlService.get(portName);
+         if (port == null)
+             throw new WebServiceException(
+-                ClientMessages.INVALID_PORT_NAME(portName,buildWsdlPortNames()));
++                    ClientMessages.INVALID_PORT_NAME(portName, buildWsdlPortNames()));
+         return port;
+     }
+ 
+@@ -582,19 +663,33 @@
+      * {@link SEIPortInfo} about a given SEI (linked from the {@link Service}-derived class.)
+      */
+     //todo: valid port in wsdl
+-    private void addSEI(QName portName, Class portInterface) throws WebServiceException {
++    private SEIPortInfo addSEI(QName portName, Class portInterface, WebServiceFeature... features) throws WebServiceException {
++        boolean ownModel = useOwnSEIModel(features);
++        if (ownModel) {
++            // Create a new model and do not cache it
++            return createSEIPortInfo(portName, portInterface, features);
++        }
++
+         SEIPortInfo spi = seiContext.get(portName);
+-        if (spi != null) return;
+-        WSDLPortImpl wsdlPort = getPortModel(portName);
+-        RuntimeModeler modeler = new RuntimeModeler(portInterface, serviceName, wsdlPort);
++        if (spi == null) {
++            spi = createSEIPortInfo(portName, portInterface, features);
++            seiContext.put(spi.portName, spi);
++            ports.put(spi.portName, spi);
++        }
++        return spi;
++    }
++
++    private SEIPortInfo createSEIPortInfo(QName portName, Class portInterface, WebServiceFeature... features) {
++        WSDLPortImpl wsdlPort = getPortModel(wsdlService, portName);
++        RuntimeModeler modeler = new RuntimeModeler(portInterface, serviceName, wsdlPort, features);
++        modeler.setClassLoader(portInterface.getClassLoader());
+         modeler.setPortName(portName);
+         AbstractSEIModelImpl model = modeler.buildRuntimeModel();
++        return new SEIPortInfo(this, portInterface, (SOAPSEIModel) model, wsdlPort);
++    }
+ 
+-        spi = new SEIPortInfo(this, portInterface, (SOAPSEIModel) model, wsdlPort);
+-        seiContext.put(spi.portName, spi);
+-        //seiContext.put(spi.sei, spi);
+-        ports.put(spi.portName, spi);
+-
++    private boolean useOwnSEIModel(WebServiceFeature... features) {
++        return WebServiceFeatureList.getFeature(features, UsesJAXBContextFeature.class) != null;
+     }
+ 
+     public WSDLServiceImpl getWsdlService() {
+@@ -611,5 +706,3 @@
+ 
+     private static final WebServiceFeature[] EMPTY_FEATURES = new WebServiceFeature[0];
+ }
+-
+-
+--- old/src/share/classes/com/sun/xml/internal/ws/client/dispatch/DataSourceDispatch.java	Thu Jul 30 18:25:40 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/client/dispatch/DataSourceDispatch.java	Thu Jul 30 18:25:39 2009
+@@ -57,7 +57,7 @@
+             case PAYLOAD:
+                 throw new IllegalArgumentException("DataSource use is not allowed in Service.Mode.PAYLOAD\n");
+             case MESSAGE:
+-                return new Packet(XMLMessage.create(arg));
++                return new Packet(XMLMessage.create(arg, binding));
+             default:
+                 throw new WebServiceException("Unrecognized message mode");
+         }
+@@ -72,7 +72,7 @@
+             // TODO Need to call hasUnconsumedDataSource()
+             return hasDS.getDataSource();
+         } else if (message instanceof PayloadSourceMessage) {
+-            return XMLMessage.getDataSource(message);
++            return XMLMessage.getDataSource(message, binding);
+         }
+         return null;
+     }
+--- old/src/share/classes/com/sun/xml/internal/ws/client/dispatch/DispatchImpl.java	Thu Jul 30 18:25:43 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/client/dispatch/DispatchImpl.java	Thu Jul 30 18:25:42 2009
+@@ -66,11 +66,10 @@
+ import javax.xml.ws.http.HTTPBinding;
+ import javax.xml.ws.soap.SOAPBinding;
+ import javax.xml.ws.soap.SOAPFaultException;
+-import java.io.UnsupportedEncodingException;
+ import java.net.MalformedURLException;
+ import java.net.URI;
+ import java.net.URISyntaxException;
+-import java.net.URLDecoder;
++import java.net.URL;
+ import java.util.ArrayList;
+ import java.util.HashMap;
+ import java.util.List;
+@@ -179,12 +178,12 @@
+         } catch (JAXBException e) {
+             //TODO: i18nify
+             throw new DeserializationException(DispatchMessages.INVALID_RESPONSE_DESERIALIZATION(),e);
+-        } catch(RuntimeException e){
+-            //it could be a WebServiceException or a ProtocolException or any RuntimeException
+-            // resulting due to some internal bug.
++        } catch(WebServiceException e){
++            //it could be a WebServiceException or a ProtocolException
+             throw e;
+         } catch(Throwable e){
+-            //its some other exception resulting from user error, wrap it in
++            // 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);
+         }
+@@ -197,12 +196,21 @@
+     }
+ 
+     public final void invokeOneWay(T in) {
+-        
+-        checkNullAllowed(in, requestContext, binding, mode);
++        try {
++            checkNullAllowed(in, requestContext, binding, mode);
+ 
+-        Packet request = createPacket(in);
+-        setProperties(request,false);
+-        Packet response = process(request,requestContext,this);
++            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);
++        }
+     }
+ 
+     void setProperties(Packet packet, boolean expectReply) {
+@@ -310,11 +318,27 @@
+ 
+         final String path = (pathInfo != null) ? pathInfo : endpointURI.getPath();
+         try {
+-            final URI temp = new URI(null, null, path, query, fragment);
+-            return endpointURI.resolve(temp).toURL().toExternalForm();
+-        } catch (URISyntaxException e) {
+-            throw new WebServiceException(DispatchMessages.INVALID_URI_PATH_QUERY(path ,query));
+-        } catch (MalformedURLException e) {
++            //final URI temp = new URI(null, null, path, query, fragment);
++            //return endpointURI.resolve(temp).toURL().toExternalForm();
++            // Using the following HACK instead of the above to avoid double encoding of
++            // the query. Application's QUERY_STRING is encoded using URLEncoder.encode().
++            // If we use that query in URI's constructor, it is encoded again.
++            // URLEncoder's encoding is not the same as URI's encoding of the query.
++            // See {@link URL}
++            StringBuilder spec = new StringBuilder();
++            if (path != null) {
++                spec.append(path);
++            }
++            if (query != null) {
++                spec.append("?");
++                spec.append(query);
++            }
++            if (fragment != null) {
++                spec.append("#");
++                spec.append(fragment);
++            }
++            return new URL(endpointURI.toURL(), spec.toString()).toExternalForm();
++       } catch (MalformedURLException e) {
+             throw new WebServiceException(DispatchMessages.INVALID_URI_RESOLUTION(path));
+         }
+     }
+@@ -390,7 +414,7 @@
+     }
+ 
+     /**
+-     * 
++     *
+      */
+     private class DispatchAsyncInvoker extends AsyncInvoker {
+         private final T param;
+@@ -402,7 +426,7 @@
+             this.param = param;
+         }
+ 
+-        public void run () {
++        public void do_run () {
+             checkNullAllowed(param, rc, binding, mode);
+             Packet message = createPacket(param);
+             resolveEndpointAddress(message, rc);
+@@ -422,18 +446,25 @@
+                     } catch (JAXBException e) {
+                         //TODO: i18nify
+                         responseImpl.set(null, new DeserializationException(DispatchMessages.INVALID_RESPONSE_DESERIALIZATION(),e));
+-                    } catch(RuntimeException e){
+-                        //it could be a WebServiceException or a ProtocolException or any RuntimeException
+-                        // resulting due to some internal bug.
++                    } catch(WebServiceException e){
++                        //it could be a WebServiceException or a ProtocolException
+                         responseImpl.set(null, e);
+                     } catch(Throwable e){
+-                        //its some other exception resulting from user error, wrap it in
++                        // It could be any RuntimeException resulting due to some internal bug.
++                        // or its some other exception resulting from user error, wrap it in
+                         // WebServiceException
+                         responseImpl.set(null, new WebServiceException(e));
+                     }
+                 }
+                 public void onCompletion(@NotNull Throwable error) {
+-                    responseImpl.set(null, error);
++                    if (error instanceof WebServiceException) {
++                        responseImpl.set(null, error);
++
++                    } else {
++                        //its RuntimeException or some other exception resulting from user error, wrap it in
++                        // WebServiceException
++                        responseImpl.set(null, new WebServiceException(error));
++                    }
+                 }
+             };
+             processAsync(message,rc, callback);
+--- old/src/share/classes/com/sun/xml/internal/ws/client/dispatch/MessageDispatch.java	Thu Jul 30 18:25:47 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/client/dispatch/MessageDispatch.java	Thu Jul 30 18:25:46 2009
+@@ -38,7 +38,7 @@
+ 
+ /**
+  * {@link Dispatch} implementation for {@link Message}.
+- * 
++ *
+  * @author Kohsuke Kawaguchi
+  * @since 2.1.1
+  */
+--- old/src/share/classes/com/sun/xml/internal/ws/client/dispatch/RESTSourceDispatch.java	Thu Jul 30 18:25:50 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/client/dispatch/RESTSourceDispatch.java	Thu Jul 30 18:25:50 2009
+@@ -60,7 +60,7 @@
+     Source toReturnValue(Packet response) {
+         Message msg = response.getMessage();
+         try {
+-            return new StreamSource(XMLMessage.getDataSource(msg).getInputStream());
++            return new StreamSource(XMLMessage.getDataSource(msg, binding).getInputStream());
+         } catch (IOException e) {
+             throw new RuntimeException(e);
+         }
+--- old/src/share/classes/com/sun/xml/internal/ws/client/dispatch/SOAPMessageDispatch.java	Thu Jul 30 18:25:54 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/client/dispatch/SOAPMessageDispatch.java	Thu Jul 30 18:25:53 2009
+@@ -32,20 +32,17 @@
+ import com.sun.xml.internal.ws.client.WSServiceDelegate;
+ import com.sun.xml.internal.ws.message.saaj.SAAJMessage;
+ import com.sun.xml.internal.ws.resources.DispatchMessages;
++import com.sun.xml.internal.ws.transport.Headers;
+ 
+ import javax.xml.namespace.QName;
+ import javax.xml.soap.MimeHeader;
+-import javax.xml.soap.MimeHeaders;
+ import javax.xml.soap.SOAPException;
+ import javax.xml.soap.SOAPMessage;
+ import javax.xml.ws.Service;
+ import javax.xml.ws.WebServiceException;
+ import javax.xml.ws.handler.MessageContext;
+-import java.util.ArrayList;
+-import java.util.HashMap;
++
+ import java.util.Iterator;
+-import java.util.List;
+-import java.util.Map;
+ 
+ /**
+  * The <code>SOAPMessageDispatch</code> class provides support
+@@ -63,26 +60,14 @@
+     }
+ 
+     Packet createPacket(SOAPMessage arg) {
+-
+-        if (arg == null && !isXMLHttp(binding))
+-           throw new WebServiceException(DispatchMessages.INVALID_NULLARG_SOAP_MSGMODE(mode.name(), Service.Mode.PAYLOAD.toString()));
+-
+-        MimeHeaders mhs = arg.getMimeHeaders();
+-        // TODO: these two lines seem dangerous. It should be left up to the transport and codec
+-        // to decide how they are sent. remove after 2.1 FCS - KK.
+-        mhs.addHeader("Content-Type", "text/xml");
+-        mhs.addHeader("Content-Transfer-Encoding", "binary");
+-        Map<String, List<String>> ch = new HashMap<String, List<String>>();
+-        for (Iterator iter = arg.getMimeHeaders().getAllHeaders(); iter.hasNext();)
+-        {
++        Iterator iter = arg.getMimeHeaders().getAllHeaders();
++        Headers ch = new Headers();
++        while(iter.hasNext()) {
+             MimeHeader mh = (MimeHeader) iter.next();
+-            List<String> h = new ArrayList<String>();
+-            h.add(mh.getValue());
+-            ch.put(mh.getName(), h);
++            ch.add(mh.getName(), mh.getValue());
+         }
+-
+         Packet packet = new Packet(new SAAJMessage(arg));
+-        packet.invocationProperties.put(MessageContext.HTTP_REQUEST_HEADERS,ch);
++        packet.invocationProperties.put(MessageContext.HTTP_REQUEST_HEADERS, ch);
+         return packet;
+     }
+ 
+@@ -93,7 +78,7 @@
+             if ( response ==null || response.getMessage() == null )
+                      throw new WebServiceException(DispatchMessages.INVALID_RESPONSE());
+             else
+-                return response.getMessage().readAsSOAPMessage();            
++                return response.getMessage().readAsSOAPMessage();
+         } catch (SOAPException e) {
+             throw new WebServiceException(e);
+         }
+--- old/src/share/classes/com/sun/xml/internal/ws/client/package-info.java	Thu Jul 30 18:25:57 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/client/package-info.java	Thu Jul 30 18:25:57 2009
+@@ -25,8 +25,8 @@
+ 
+ /**
+  *  <h1>JAX-WS 2.0.1 Client Runtime</h1>
+- * <P>This document describes the architecture of client side 
+- * JAX-WS 2.0.1 runtime. 
++ * <P>This document describes the architecture of client side
++ * JAX-WS 2.0.1 runtime.
+  *
+  * <h3>JAX-WS 2.0.1 Client Sequence Diagram</h3>
+  * <img src='../../../../../jaxws/basic-client.seq.png'>
+@@ -38,94 +38,94 @@
+  * <H3>Message Flow</H3>
+  * {@link com.sun.xml.internal.ws.client.WebService} provides client view of a Web service.
+  * WebService.getPort returns an instance of {@link com.sun.xml.internal.ws.client.EndpointIFInvocationHandler}
+- * with {@link com.sun.pept.ept.ContactInfoList} and {@link com.sun.pept.Delegate} 
++ * with {@link com.sun.pept.ept.ContactInfoList} and {@link com.sun.pept.Delegate}
+  * initialized. A method invocation on the port, obtained from WebService, invokes
+- * {@link com.sun.xml.internal.ws.client.EndpointIFInvocationHandler#invoke}. This method 
+- * then creates a {@link com.sun.pept.ept.MessageInfo} and populates the data 
+- * (parameters specified by the user) and metadata such as RuntimeContext, RequestContext, 
+- * Message Exchange Pattern into this MessageInfo. This method then invokes 
++ * {@link com.sun.xml.internal.ws.client.EndpointIFInvocationHandler#invoke}. This method
++ * then creates a {@link com.sun.pept.ept.MessageInfo} and populates the data
++ * (parameters specified by the user) and metadata such as RuntimeContext, RequestContext,
++ * Message Exchange Pattern into this MessageInfo. This method then invokes
+  * {@link com.sun.pept.Delegate#send} and returns the response.
+  * <P></P>
+- * The Delegate.send method iterates through the ContactInfoList and picks up the 
+- * correct {@link com.sun.pept.ept.ContactInfo} based upon the binding id of 
+- * {@link javax.xml.ws.BindingProvider} and sets it on the MessageInfo. After the 
+- * Delegate obtains a specific ContactInfo it uses that ContactInfo to obtain a 
+- * protocol-specific {@link com.sun.pept.protocol.MessageDispatcher}. There will be 
+- * two types of client-side MessageDispatchers for JAX-WS 2.0.1, 
+- * {@link com.sun.xml.internal.ws.protocol.soap.client.SOAPMessageDispatcher} and 
+- * {@link com.sun.xml.internal.ws.protocol.xml.client.XMLMessageDispatcher}. The Delegate 
+- * then invokes {@link com.sun.pept.protocol.MessageDispatcher#send}. The 
+- * MessageDispatcher.send method makes a decision about the synchronous and 
++ * The Delegate.send method iterates through the ContactInfoList and picks up the
++ * correct {@link com.sun.pept.ept.ContactInfo} based upon the binding id of
++ * {@link javax.xml.ws.BindingProvider} and sets it on the MessageInfo. After the
++ * Delegate obtains a specific ContactInfo it uses that ContactInfo to obtain a
++ * protocol-specific {@link com.sun.pept.protocol.MessageDispatcher}. There will be
++ * two types of client-side MessageDispatchers for JAX-WS 2.0.1,
++ * {@link com.sun.xml.internal.ws.protocol.soap.client.SOAPMessageDispatcher} and
++ * {@link com.sun.xml.internal.ws.protocol.xml.client.XMLMessageDispatcher}. The Delegate
++ * then invokes {@link com.sun.pept.protocol.MessageDispatcher#send}. The
++ * MessageDispatcher.send method makes a decision about the synchronous and
+  * asynchronous nature of the message exchange pattern and invokes separate methods
+  * accordingly.
+  * <p></P>
+  * The MessageDispatcher uses ContactInfo to obtain
+- * a {@link com.sun.xml.internal.ws.encoding.soap.client.SOAPXMLEncoder} which converts 
+- * the MessageInfo to {@link com.sun.xml.internal.ws.encoding.soap.internal.InternalMessage}. 
+- * There will be two types of client-side SOAPXMLEncoder for JAX-WS 2.0.1, 
++ * a {@link com.sun.xml.internal.ws.encoding.soap.client.SOAPXMLEncoder} which converts
++ * the MessageInfo to {@link com.sun.xml.internal.ws.encoding.soap.internal.InternalMessage}.
++ * There will be two types of client-side SOAPXMLEncoder for JAX-WS 2.0.1,
+  * SOAPXMEncoder for SOAP 1.1 and {@link com.sun.xml.internal.ws.encoding.soap.client.SOAP12XMLEncoder}
+- * for SOAP 1.2. The MessageDispatcher invokes configured handlers and use the 
++ * for SOAP 1.2. The MessageDispatcher invokes configured handlers and use the
+  * codec to convert the InternalMessage to a {@link javax.xml.soap.SOAPMessage}.
+- * The metadata from the MessageInfo is classified into {@link javax.xml.soap.MimeHeaders} 
++ * The metadata from the MessageInfo is classified into {@link javax.xml.soap.MimeHeaders}
+  * of this SOAPMessage and context information for {@link com.sun.xml.internal.ws.api.server.WSConnection}.
+  * The SOAPMessge is then written to the output stream of the WSConnection
+  * obtained from MessageInfo.
+  *<P></P>
+- * The MessageDispatcher.receive method handles the response. The 
+- * SOAPMessageDispatcher extracts the SOAPMessage from the input stream of 
+- * WSConnection and performs the mustUnderstand processing followed by invocation 
+- * of any handlers. The MessageDispatcher uses ContactInfo to obtain a 
+- * {@link com.sun.xml.internal.ws.encoding.soap.client.SOAPXMLDecoder} which converts the SOAPMessage 
+- * to InternalMessage and then InternalMessage to MessageInfo. There will be two types of 
+- * client-side SOAPXMLDecoder for JAX-WS 2.0.1, SOAPXMLDencoder for SOAP 1.1 and 
+- * {@link com.sun.xml.internal.ws.encoding.soap.client.SOAP12XMLDecoder} for SOAP 1.2. The 
++ * The MessageDispatcher.receive method handles the response. The
++ * SOAPMessageDispatcher extracts the SOAPMessage from the input stream of
++ * WSConnection and performs the mustUnderstand processing followed by invocation
++ * of any handlers. The MessageDispatcher uses ContactInfo to obtain a
++ * {@link com.sun.xml.internal.ws.encoding.soap.client.SOAPXMLDecoder} which converts the SOAPMessage
++ * to InternalMessage and then InternalMessage to MessageInfo. There will be two types of
++ * client-side SOAPXMLDecoder for JAX-WS 2.0.1, SOAPXMLDencoder for SOAP 1.1 and
++ * {@link com.sun.xml.internal.ws.encoding.soap.client.SOAP12XMLDecoder} for SOAP 1.2. The
+  * response is returned back to the client code via Delegate.
+  *
+  * <H3>External Interactions</H3>
+  * <H4>SAAJ API</H4>
+  * <UL>
+- * 	<LI><P>JAX-WS creates SAAJ SOAPMessage from the HttpServletRequest.
+- * 	At present, JAX-WS reads all the bytes from the request stream and
+- * 	then creates SOAPMessage along with the HTTP headers.</P>
++ *      <LI><P>JAX-WS creates SAAJ SOAPMessage from the HttpServletRequest.
++ *      At present, JAX-WS reads all the bytes from the request stream and
++ *      then creates SOAPMessage along with the HTTP headers.</P>
+  * </UL>
+  * <P>MessageFactory(binding).createMessage(MimeHeaders, InputStream)</P>
+  * <UL>
+- * 	<LI><P>SOAPMessage parses the content from the stream including MIME
+- * 	data</P>
+- * 	<LI><P>com.sun.xml.internal.ws.server.SOAPMessageDispatcher::checkHeadersPeekBody()</P>
+- * 	<P>SOAPMessage.getSOAPHeader() is used for mustUnderstand processing
+- * 	of headers. It further uses
+- * 	SOAPHeader.examineMustUnderstandHeaderElements(role)</P>
+- * 	<P>SOAPMessage.getSOAPBody().getFistChild() is used for guessing the
+- * 	MEP of the request</P>
+- * 	<LI><P>com.sun.xml.internal.ws.handler.HandlerChainCaller:insertFaultMessage()</P>
+- * 	<P>SOAPMessage.getSOAPPart().getEnvelope() and some other SAAJ calls
+- * 	are made to create a fault in the SOAPMessage</P>
+- * 	<LI><P>com.sun.xml.internal.ws.handler.LogicalMessageImpl::getPayload()
+- * 	interacts with SAAJ to get body from SOAPMessage</P>
+- * 	<LI><P>com.sun.xml.internal.ws.encoding.soap.SOAPEncoder.toSOAPMessage(com.sun.xml.internal.ws.encoding.soap.internal.InternalMessage,
+- * 	SOAPMessage). There is a scenario where there is SOAPMessage and a
+- * 	logical handler sets payload as Source. To write to the stream,
+- * 	SOAPMessage.writeTo() is used but before that the body needs to be
+- * 	updated with logical handler' Source. Need to verify if this
+- * 	scenario is still happening since Handler.close() is changed to take
+- * 	MessageContext.</P>
+- * 	<LI><P>com.sun.xml.internal.ws.handlerSOAPMessageContextImpl.getHeaders()
+- * 	uses SAAJ API to get headers.</P>
+- * 	<LI><P>SOAPMessage.writeTo() is used to write response. At present,
+- * 	it writes into byte[] and this byte[] is written to
+- * 	HttpServletResponse.</P>
++ *      <LI><P>SOAPMessage parses the content from the stream including MIME
++ *      data</P>
++ *      <LI><P>com.sun.xml.internal.ws.server.SOAPMessageDispatcher::checkHeadersPeekBody()</P>
++ *      <P>SOAPMessage.getSOAPHeader() is used for mustUnderstand processing
++ *      of headers. It further uses
++ *      SOAPHeader.examineMustUnderstandHeaderElements(role)</P>
++ *      <P>SOAPMessage.getSOAPBody().getFistChild() is used for guessing the
++ *      MEP of the request</P>
++ *      <LI><P>com.sun.xml.internal.ws.handler.HandlerChainCaller:insertFaultMessage()</P>
++ *      <P>SOAPMessage.getSOAPPart().getEnvelope() and some other SAAJ calls
++ *      are made to create a fault in the SOAPMessage</P>
++ *      <LI><P>com.sun.xml.internal.ws.handler.LogicalMessageImpl::getPayload()
++ *      interacts with SAAJ to get body from SOAPMessage</P>
++ *      <LI><P>com.sun.xml.internal.ws.encoding.soap.SOAPEncoder.toSOAPMessage(com.sun.xml.internal.ws.encoding.soap.internal.InternalMessage,
++ *      SOAPMessage). There is a scenario where there is SOAPMessage and a
++ *      logical handler sets payload as Source. To write to the stream,
++ *      SOAPMessage.writeTo() is used but before that the body needs to be
++ *      updated with logical handler' Source. Need to verify if this
++ *      scenario is still happening since Handler.close() is changed to take
++ *      MessageContext.</P>
++ *      <LI><P>com.sun.xml.internal.ws.handlerSOAPMessageContextImpl.getHeaders()
++ *      uses SAAJ API to get headers.</P>
++ *      <LI><P>SOAPMessage.writeTo() is used to write response. At present,
++ *      it writes into byte[] and this byte[] is written to
++ *      HttpServletResponse.</P>
+  * </UL>
+  * <H4>JAXB API</H4>
+  * <P>JAX-WS RI uses the JAXB API to marshall/unmarshall user created
+- * JAXB objects with user created {@link javax.xml.bind.JAXBContext JAXBContext}. 
++ * JAXB objects with user created {@link javax.xml.bind.JAXBContext JAXBContext}.
+  * Handler, Dispatch in JAX-WS API provide ways for the user to specify his/her own
+  * JAXBContext. {@link com.sun.xml.internal.ws.encoding.jaxb.JAXBTypeSerializer JAXBTypeSerializer} class uses all these methods.</P>
+  * <UL>
+- * 	<LI><p>{@link javax.xml.bind.Marshaller#marshal(Object,XMLStreamWriter) Marshaller.marshal(Object,XMLStreamWriter)}</p>
+- * 	<LI><P>{@link javax.xml.bind.Marshaller#marshal(Object,Result) Marshaller.marshal(Object, DomResult)}</P>
+- * 	<LI><P>{@link javax.xml.bind.Unmarshaller#unmarshal(XMLStreamReader) Object Unmarshaller.unmarshal(XMLStreamReader)}</P>
+- * 	<LI><P>{@link javax.xml.bind.Unmarshaller#unmarshal(Source) Object Unmarshaller.unmarshal(Source)}</P>
++ *      <LI><p>{@link javax.xml.bind.Marshaller#marshal(Object,XMLStreamWriter) Marshaller.marshal(Object,XMLStreamWriter)}</p>
++ *      <LI><P>{@link javax.xml.bind.Marshaller#marshal(Object,Result) Marshaller.marshal(Object, DomResult)}</P>
++ *      <LI><P>{@link javax.xml.bind.Unmarshaller#unmarshal(XMLStreamReader) Object Unmarshaller.unmarshal(XMLStreamReader)}</P>
++ *      <LI><P>{@link javax.xml.bind.Unmarshaller#unmarshal(Source) Object Unmarshaller.unmarshal(Source)}</P>
+  * </UL>
+  * The following two JAXB classes are implemented by JAX-WS to enable/implement MTOM and XOP
+  * <UL>
+@@ -138,11 +138,11 @@
+  * parameters at the time of JAXBTypeSerializer class uses all
+  * these methods.</P>
+  * <UL>
+- * 	<LI><P>{@link com.sun.xml.internal.bind.api.Bridge#marshal(BridgeContext, Object, XMLStreamWriter) Bridge.marshal(BridgeContext, Object, XMLStreamWriter)}</P>
+- * 	<LI><P>{@link com.sun.xml.internal.bind.api.Bridge#marshal(BridgeContext, Object, Node) Bridge.marshal(BridgeContext, Object, Node)}</P>
+- * 	<LI><P>{@link com.sun.xml.internal.bind.api.Bridge#unmarshal(BridgeContext, XMLStreamReader) Object Bridge.unmarshal(BridgeContext, XMLStreamReader)}</P>
++ *      <LI><P>{@link com.sun.xml.internal.bind.api.Bridge#marshal(BridgeContext, Object, XMLStreamWriter) Bridge.marshal(BridgeContext, Object, XMLStreamWriter)}</P>
++ *      <LI><P>{@link com.sun.xml.internal.bind.api.Bridge#marshal(BridgeContext, Object, Node) Bridge.marshal(BridgeContext, Object, Node)}</P>
++ *      <LI><P>{@link com.sun.xml.internal.bind.api.Bridge#unmarshal(BridgeContext, XMLStreamReader) Object Bridge.unmarshal(BridgeContext, XMLStreamReader)}</P>
+  * </UL>
+- * 
++ *
+  * @ArchitectureDocument
+  **/
+ package com.sun.xml.internal.ws.client;
+--- old/src/share/classes/com/sun/xml/internal/ws/client/sei/AsyncMethodHandler.java	Thu Jul 30 18:26:01 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/client/sei/AsyncMethodHandler.java	Thu Jul 30 18:26:00 2009
+@@ -27,9 +27,16 @@
+ 
+ //import com.sun.tools.internal.ws.wsdl.document.soap.SOAPBinding;
+ 
++import com.sun.istack.internal.NotNull;
++import com.sun.istack.internal.Nullable;
++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.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.ResponseContextReceiver;
+-import com.sun.xml.internal.ws.client.ResponseImpl;
++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;
+@@ -36,13 +43,9 @@
+ 
+ import javax.jws.soap.SOAPBinding.Style;
+ import javax.xml.ws.AsyncHandler;
+-import javax.xml.ws.Holder;
+ import javax.xml.ws.Response;
+ import javax.xml.ws.WebServiceException;
+-import java.lang.reflect.Method;
+-import java.util.ArrayList;
+ import java.util.List;
+-import java.util.concurrent.Callable;
+ 
+ /**
+  * Common part between {@link CallbackMethodHandler} and {@link PollingMethodHandler}.
+@@ -50,61 +53,26 @@
+  * @author Kohsuke Kawaguchi
+  * @author Jitendra Kotamraju
+  */
+-abstract class AsyncMethodHandler extends MethodHandler {
++abstract class AsyncMethodHandler extends SEIMethodHandler {
+ 
+-    private final JavaMethodImpl jm;
+-    private final AsyncBuilder asyncBuilder;
+-    private final SyncMethodHandler core;
++    private final ResponseBuilder responseBuilder;
+     /**
+-     * Async Wrapper bean.
++     * Async bean class that has setters for all out parameters
+      */
+-    //private final Class wrapper;
++    private final @Nullable Class asyncBeanClass;
+ 
+-    protected AsyncMethodHandler(SEIStub owner, JavaMethodImpl jm, SyncMethodHandler core) {
+-        super(owner);
+-        this.jm = jm;
+-        this.core = core;
+-        
+-        List<ParameterImpl> rp = jm.getResponseParameters();
+-        
+-        
+-        
+-        Class tempWrap = null;
+-        for(ParameterImpl param : rp) {
+-            if (param.isWrapperStyle()) {
+-                WrapperParameter wrapParam = (WrapperParameter)param;
+-                if (core.getJavaMethod().getBinding().getStyle() == Style.DOCUMENT) {
+-                    // doc/wrapper style
+-                    tempWrap = (Class)wrapParam.getTypeReference().type;
+-                    break;
+-                }
+-                for(ParameterImpl p : wrapParam.getWrapperChildren()) {
+-                    if (p.getIndex() == -1) {
+-                        tempWrap = (Class)p.getTypeReference().type;
+-                        break;
+-                    }
+-                }
+-                if (tempWrap != null) {
+-                    break;
+-                }
+-            } else {
+-                if (param.getIndex() == -1) {
+-                    tempWrap = (Class)param.getTypeReference().type;
+-                    break;
+-                }
+-            }
+-        }
+-        Class wrapper = tempWrap;      
+-        
+-        rp = core.getJavaMethod().getResponseParameters();
++    AsyncMethodHandler(SEIStub owner, JavaMethodImpl jm, JavaMethodImpl sync) {
++        super(owner, sync);
++
++        List<ParameterImpl> rp = sync.getResponseParameters();
+         int size = 0;
+         for( ParameterImpl param : rp ) {
+             if (param.isWrapperStyle()) {
+                 WrapperParameter wrapParam = (WrapperParameter)param;
+                 size += wrapParam.getWrapperChildren().size();
+-                if (core.getJavaMethod().getBinding().getStyle() == Style.DOCUMENT) {
+-                    // doc/wrapper - wrapper bean is in async signature
+-                    // Add 2 so that it is considered as async bean case
++                if (sync.getBinding().getStyle() == Style.DOCUMENT) {
++                    // doc/asyncBeanClass - asyncBeanClass bean is in async signature
++                    // Add 2 or more so that it is considered as async bean case
+                     size += 2;
+                 }
+             } else {
+@@ -111,133 +79,129 @@
+                 ++size;
+             }
+         }
+-        
+-        List<AsyncBuilder> builders = new ArrayList<AsyncBuilder>();
+-        if (size == 0) {
+-            // no mapping
+-        } else if (size == 1) {
+-            ParameterImpl single = null;
+-            for( ParameterImpl param : rp ) {
++
++        Class tempWrap = null;
++        if (size > 1) {
++            rp = jm.getResponseParameters();
++            for(ParameterImpl param : rp) {
+                 if (param.isWrapperStyle()) {
+                     WrapperParameter wrapParam = (WrapperParameter)param;
+-                    for(ParameterImpl p : wrapParam.getWrapperChildren()) {
+-                        single = p;
++                    if (sync.getBinding().getStyle() == Style.DOCUMENT) {
++                        // doc/asyncBeanClass style
++                        tempWrap = (Class)wrapParam.getTypeReference().type;
+                         break;
+                     }
+-                    if (single != null)
++                    for(ParameterImpl p : wrapParam.getWrapperChildren()) {
++                        if (p.getIndex() == -1) {
++                            tempWrap = (Class)p.getTypeReference().type;
++                            break;
++                        }
++                    }
++                    if (tempWrap != null) {
+                         break;
++                    }
+                 } else {
+-                    single = param;
+-                    break;
+-                }
+-            }
+-            assert single != null;
+-            builders.add(new AsyncBuilder.Filler(single));
+-        } else {
+-            for( ParameterImpl param : rp ) {
+-                switch(param.getOutBinding().kind) {
+-                case BODY:
+-                    if(param.isWrapperStyle()) {
+-                        if(param.getParent().getBinding().isRpcLit())
+-                            builders.add(new AsyncBuilder.DocLit(wrapper, (WrapperParameter)param));
+-                        else
+-                            builders.add(new AsyncBuilder.DocLit(wrapper, (WrapperParameter)param));
+-                    } else {
+-                        builders.add(new AsyncBuilder.Bare(wrapper, param));
++                    if (param.getIndex() == -1) {
++                        tempWrap = (Class)param.getTypeReference().type;
++                        break;
+                     }
+-                    break;
+-                case HEADER:
+-                    builders.add(new AsyncBuilder.Bare(wrapper, param));
+-                    break;
+-                case ATTACHMENT:
+-                    builders.add(new AsyncBuilder.Bare(wrapper, param));
+-                    break;
+-                case UNBOUND:
+-                    /*
+-                    builders.add(new AsyncBuilder.NullSetter(setter,
+-                        ResponseBuilder.getVMUninitializedValue(param.getTypeReference().type)));
+-                     */
+-                    break;
+-                default:
+-                    throw new AssertionError();
+                 }
+             }
++        }
++        asyncBeanClass = tempWrap;
+ 
++        switch(size) {
++            case 0 :
++                responseBuilder = buildResponseBuilder(sync, ValueSetterFactory.NONE);
++                break;
++            case 1 :
++                responseBuilder = buildResponseBuilder(sync, ValueSetterFactory.SINGLE);
++                break;
++            default :
++                responseBuilder = buildResponseBuilder(sync, new ValueSetterFactory.AsyncBeanValueSetterFactory(asyncBeanClass));
+         }
+-        switch(size) {      // Use size, since Composite is creating async bean
+-        case 0:
+-            asyncBuilder = AsyncBuilder.NONE;
+-            break;
+-        case 1:
+-            asyncBuilder = builders.get(0);
+-            break;
+-        default:
+-            asyncBuilder = new AsyncBuilder.Composite(builders, wrapper);
+-        }
+-       
++
+     }
+ 
+     protected final Response<Object> doInvoke(Object proxy, Object[] args, AsyncHandler handler) {
+-        
+-        AsyncMethodHandler.Invoker invoker = new Invoker(proxy, args);
+-        ResponseImpl<Object> ft = new ResponseImpl<Object>(invoker,handler);
+-        invoker.setReceiver(ft);
+ 
++        AsyncInvoker invoker = new SEIAsyncInvoker(proxy, args);
++        AsyncResponseImpl<Object> ft = new AsyncResponseImpl<Object>(invoker,handler);
++        invoker.setReceiver(ft);
++        // TODO: Do we set this executor on Engine and run the AsyncInvoker in this thread ?
+         owner.getExecutor().execute(ft);
+         return ft;
+     }
+ 
+-    private class Invoker implements Callable<Object> {
+-        private final Object proxy;
++    private class SEIAsyncInvoker extends AsyncInvoker {
++        // snapshot the context now. this is necessary to avoid concurrency issue,
++        // and is required by the spec
++        private final RequestContext rc = owner.requestContext.copy();
+         private final Object[] args;
+-        // need to take a copy. required by the spec
+-        private final RequestContext snapshot = owner.requestContext.copy();
+-        /**
+-         * Because of the object instantiation order,
+-         * we can't take this as a constructor parameter.
+-         */
+-        private ResponseContextReceiver receiver;
+ 
+-        public Invoker(Object proxy, Object[] args) {
+-            this.proxy = proxy;
++        SEIAsyncInvoker(Object proxy, Object[] args) {
+             this.args = args;
+         }
+ 
+-        public Object call() throws Exception {
+-            assert receiver!=null;
+-            try {
+-                // TODO: Calling the sync method has this overhead
+-                Object[] newArgs;
+-                Method method = core.getJavaMethod().getMethod();
+-                int noOfArgs = method.getParameterTypes().length;
+-                newArgs = new Object[noOfArgs];
+-                for(int i=0; i < noOfArgs; i++) {
+-                    if (method.getParameterTypes()[i].isAssignableFrom(Holder.class)) {
+-                        Holder holder = new Holder();
+-                        if (i < args.length) {
+-                            holder.value = args[i];
++        public void do_run () {
++            Packet req = new Packet(createRequestMessage(args));
++            req.soapAction = soapAction;
++            req.expectReply = !isOneWay;
++            req.getMessage().assertOneWay(isOneWay);
++
++            Fiber.CompletionCallback callback = new Fiber.CompletionCallback() {
++
++                public void onCompletion(@NotNull Packet response) {
++                    responseImpl.setResponseContext(new ResponseContext(response));
++                    Message msg = response.getMessage();
++                    if (msg == null) {
++                        return;
++                    }
++                    try {
++                        if(msg.isFault()) {
++                            SOAPFaultBuilder faultBuilder = SOAPFaultBuilder.create(msg);
++                            throw faultBuilder.createException(checkedExceptions);
++                        } else {
++                            Object[] rargs = new Object[1];
++                            if (asyncBeanClass != null) {
++                                rargs[0] = asyncBeanClass.newInstance();
++                            }
++                            responseBuilder.readResponse(msg, rargs);
++                            responseImpl.set(rargs[0], null);
+                         }
+-                        newArgs[i] = holder;
+-                    } else {
+-                        newArgs[i] = args[i];
++                   } catch (Throwable t) {
++                        if (t instanceof RuntimeException) {
++                            if (t instanceof WebServiceException) {
++                                responseImpl.set(null, t);
++                                return;
++                            }
++                        }  else if (t instanceof Exception) {
++                            responseImpl.set(null, t);
++                            return;
++                        }
++                        //its RuntimeException or some other exception resulting from user error, wrap it in
++                        // WebServiceException
++                        responseImpl.set(null, new WebServiceException(t));
+                     }
+                 }
+-                Object returnValue = core.invoke(proxy,newArgs,snapshot,receiver);
+-                return asyncBuilder.fillAsyncBean(newArgs, returnValue, null);
+-            } catch (Throwable t) {
+-                if (t instanceof RuntimeException) {
+-                    if (t instanceof WebServiceException) {
+-                        throw (WebServiceException)t;
++
++
++                public void onCompletion(@NotNull Throwable error) {
++                    if (error instanceof WebServiceException) {
++                        responseImpl.set(null, error);
++                    } else {
++                        //its RuntimeException or some other exception resulting from user error, wrap it in
++                        // WebServiceException
++                        responseImpl.set(null, new WebServiceException(error));
+                     }
+-                }  else if (t instanceof Exception) {
+-                    throw (Exception)t;
+                 }
+-                throw new WebServiceException(t);
+-            }
++            };
++            owner.doProcessAsync(req, rc, callback);
+         }
++    }
+ 
+-        void setReceiver(ResponseContextReceiver receiver) {
+-            this.receiver = receiver;
+-        }
++    ValueGetterFactory getValueGetterFactory() {
++        return ValueGetterFactory.ASYNC;
+     }
++
+ }
+--- old/src/share/classes/com/sun/xml/internal/ws/client/sei/BodyBuilder.java	Thu Jul 30 18:26:04 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/client/sei/BodyBuilder.java	Thu Jul 30 18:26:04 2009
+@@ -109,10 +109,10 @@
+         /**
+          * Creates a {@link BodyBuilder} from a bare parameter.
+          */
+-        Bare(ParameterImpl p, SOAPVersion soapVersion) {
++        Bare(ParameterImpl p, SOAPVersion soapVersion, ValueGetter getter) {
+             super(p.getBridge(), soapVersion);
+             this.methodPos = p.getIndex();
+-            this.getter = ValueGetter.get(p);
++            this.getter = getter;
+         }
+ 
+         /**
+@@ -140,7 +140,7 @@
+          */
+         protected final ValueGetter[] getters;
+ 
+-        protected Wrapped(WrapperParameter wp, SOAPVersion soapVersion) {
++        protected Wrapped(WrapperParameter wp, SOAPVersion soapVersion, ValueGetterFactory getter) {
+             super(wp.getBridge(), soapVersion);
+ 
+             List<ParameterImpl> children = wp.getWrapperChildren();
+@@ -150,7 +150,7 @@
+             for( int i=0; i<indices.length; i++ ) {
+                 ParameterImpl p = children.get(i);
+                 indices[i] = p.getIndex();
+-                getters[i] = ValueGetter.get(p);
++                getters[i] = getter.get(p);
+             }
+         }
+     }
+@@ -173,8 +173,8 @@
+         /**
+          * Creates a {@link BodyBuilder} from a {@link WrapperParameter}.
+          */
+-        DocLit(WrapperParameter wp, SOAPVersion soapVersion) {
+-            super(wp, soapVersion);
++        DocLit(WrapperParameter wp, SOAPVersion soapVersion, ValueGetterFactory getter) {
++            super(wp, soapVersion, getter);
+ 
+             wrapper = (Class)wp.getBridge().getTypeReference().type;
+ 
+@@ -249,8 +249,8 @@
+         /**
+          * Creates a {@link BodyBuilder} from a {@link WrapperParameter}.
+          */
+-        RpcLit(WrapperParameter wp, SOAPVersion soapVersion) {
+-            super(wp, soapVersion);
++        RpcLit(WrapperParameter wp, SOAPVersion soapVersion, ValueGetterFactory getter) {
++            super(wp, soapVersion, getter);
+             // we'll use CompositeStructure to pack requests
+             assert wp.getTypeReference().type==CompositeStructure.class;
+ 
+--- old/src/share/classes/com/sun/xml/internal/ws/client/sei/CallbackMethodHandler.java	Thu Jul 30 18:26:08 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/client/sei/CallbackMethodHandler.java	Thu Jul 30 18:26:07 2009
+@@ -42,12 +42,12 @@
+      */
+     private final int handlerPos;
+ 
+-    public CallbackMethodHandler(SEIStub owner, JavaMethodImpl jm, SyncMethodHandler core, int handlerPos) {
++    CallbackMethodHandler(SEIStub owner, JavaMethodImpl jm, JavaMethodImpl core, int handlerPos) {
+         super(owner,jm,core);
+         this.handlerPos = handlerPos;
+     }
+ 
+-    public Future<?> invoke(Object proxy, Object[] args) throws WebServiceException {
++    Future<?> invoke(Object proxy, Object[] args) throws WebServiceException {
+         // the spec requires the last argument
+         final AsyncHandler handler = (AsyncHandler)args[handlerPos];
+ 
+--- old/src/share/classes/com/sun/xml/internal/ws/client/sei/MessageFiller.java	Thu Jul 30 18:26:11 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/client/sei/MessageFiller.java	Thu Jul 30 18:26:11 2009
+@@ -66,7 +66,7 @@
+      * Moves an argument of a method invocation into a {@link Message}.
+      */
+     abstract void fillIn(Object[] methodArgs, Message msg);
+-    
++
+     /**
+      * Adds a parameter as an MIME attachment to {@link Message}.
+      */
+@@ -75,7 +75,7 @@
+         protected final ValueGetter getter;
+         protected final String mimeType;
+         private final String contentIdPart;
+-        
++
+         protected AttachmentFiller(ParameterImpl param, ValueGetter getter) {
+             super(param.getIndex());
+             this.param = param;
+@@ -87,7 +87,7 @@
+                 throw new WebServiceException(e);
+             }
+         }
+-        
++
+         /**
+          * Creates an MessageFiller based on the parameter type
+          *
+@@ -109,12 +109,12 @@
+                 return new DataHandlerFiller(param, getter);
+             }
+         }
+-        
++
+         String getContentId() {
+             return contentIdPart+UUID.randomUUID()+"@jaxws.sun.com";
+         }
+     }
+-    
++
+     private static class ByteArrayFiller extends AttachmentFiller {
+         protected ByteArrayFiller(ParameterImpl param, ValueGetter getter) {
+             super(param, getter);
+@@ -126,7 +126,7 @@
+             msg.getAttachments().add(att);
+         }
+     }
+-    
++
+     private static class DataHandlerFiller extends AttachmentFiller {
+         protected DataHandlerFiller(ParameterImpl param, ValueGetter getter) {
+             super(param, getter);
+@@ -139,7 +139,7 @@
+             msg.getAttachments().add(att);
+         }
+     }
+-    
++
+     private static class JAXBFiller extends AttachmentFiller {
+         protected JAXBFiller(ParameterImpl param, ValueGetter getter) {
+             super(param, getter);
+@@ -170,9 +170,9 @@
+             msg.getHeaders().add(Headers.create(bridge,value));
+         }
+     }
+-    
++
+     private static boolean isXMLMimeType(String mimeType){
+-        return (mimeType.equals("text/xml") || mimeType.equals("application/xml")) ? true : false;
++        return (mimeType.equals("text/xml") || mimeType.equals("application/xml"));
+     }
+ 
+ }
+--- old/src/share/classes/com/sun/xml/internal/ws/client/sei/MethodHandler.java	Thu Jul 30 18:26:15 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/client/sei/MethodHandler.java	Thu Jul 30 18:26:14 2009
+@@ -63,5 +63,5 @@
+      * @throws Throwable
+      *      some faults are reported in terms of checked exceptions.
+      */
+-    public abstract Object invoke(Object proxy, Object[] args) throws WebServiceException, Throwable;
++    abstract Object invoke(Object proxy, Object[] args) throws WebServiceException, Throwable;
+ }
+--- old/src/share/classes/com/sun/xml/internal/ws/client/sei/PollingMethodHandler.java	Thu Jul 30 18:26:18 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/client/sei/PollingMethodHandler.java	Thu Jul 30 18:26:18 2009
+@@ -35,11 +35,11 @@
+  */
+ final class PollingMethodHandler extends AsyncMethodHandler {
+ 
+-    public PollingMethodHandler(SEIStub owner, JavaMethodImpl jm, SyncMethodHandler core) {
++    PollingMethodHandler(SEIStub owner, JavaMethodImpl jm, JavaMethodImpl core) {
+         super(owner, jm, core);
+     }
+ 
+-    public Response<?> invoke(Object proxy, Object[] args) throws WebServiceException {
++    Response<?> invoke(Object proxy, Object[] args) throws WebServiceException {
+         return doInvoke(proxy,args,null);
+     }
+ }
+--- old/src/share/classes/com/sun/xml/internal/ws/client/sei/ResponseBuilder.java	Thu Jul 30 18:26:22 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/client/sei/ResponseBuilder.java	Thu Jul 30 18:26:21 2009
+@@ -49,6 +49,7 @@
+ 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;
+@@ -95,7 +96,7 @@
+     static final class None extends ResponseBuilder {
+         private None(){
+         }
+-        public Object readResponse(Message msg, Object[] args) {           
++        public Object readResponse(Message msg, Object[] args) {
+             msg.consume();
+             return null;
+         }
+@@ -188,7 +189,7 @@
+             return retVal;
+         }
+     }
+-    
++
+     /**
+      * Reads an Attachment into a Java parameter.
+      */
+@@ -197,7 +198,7 @@
+         protected final ParameterImpl param;
+         private final String pname;
+         private final String pname1;
+-            
++
+         AttachmentBuilder(ParameterImpl param, ValueSetter setter) {
+             this.setter = setter;
+             this.param = param;
+@@ -229,10 +230,10 @@
+             } else if(isXMLMimeType(param.getBinding().getMimeType())) {
+                 return new JAXBBuilder(param, setter);
+             } else {
+-                throw new UnsupportedOperationException("Attachment is not mapped");
++                throw new UnsupportedOperationException("Unexpected Attachment type ="+type);
+             }
+         }
+-        
++
+         public Object readResponse(Message msg, Object[] args) throws JAXBException, XMLStreamException {
+             // TODO not to loop
+             for (Attachment att : msg.getAttachments()) {
+@@ -246,77 +247,87 @@
+             }
+             return null;
+         }
+-        
++
+         abstract Object mapAttachment(Attachment att, Object[] args) throws JAXBException;
+     }
+-        
++
+     private static final class DataHandlerBuilder extends AttachmentBuilder {
+         DataHandlerBuilder(ParameterImpl param, ValueSetter setter) {
+             super(param, setter);
+         }
+-        
++
+         Object mapAttachment(Attachment att, Object[] args) {
+             return setter.put(att.asDataHandler(), args);
+         }
+     }
+-        
++
+     private static final class ByteArrayBuilder extends AttachmentBuilder {
+         ByteArrayBuilder(ParameterImpl param, ValueSetter setter) {
+             super(param, setter);
+         }
+-        
++
+         Object mapAttachment(Attachment att, Object[] args) {
+             return setter.put(att.asByteArray(), args);
+         }
+     }
+-        
++
+     private static final class SourceBuilder extends AttachmentBuilder {
+         SourceBuilder(ParameterImpl param, ValueSetter setter) {
+             super(param, setter);
+         }
+-        
++
+         Object mapAttachment(Attachment att, Object[] args) {
+             return setter.put(att.asSource(), args);
+         }
+     }
+-        
++
+     private static final class ImageBuilder extends AttachmentBuilder {
+         ImageBuilder(ParameterImpl param, ValueSetter setter) {
+             super(param, setter);
+         }
+-        
++
+         Object mapAttachment(Attachment att, Object[] args) {
+             Image image;
++            InputStream is = null;
+             try {
+-                image = ImageIO.read(att.asInputStream());
++                is = att.asInputStream();
++                image = ImageIO.read(is);
+             } catch(IOException ioe) {
+                 throw new WebServiceException(ioe);
++            } finally {
++                if (is != null) {
++                    try {
++                        is.close();
++                    } catch(IOException ioe) {
++                        throw new WebServiceException(ioe);
++                    }
++                }
+             }
+             return setter.put(image, args);
+         }
+     }
+-        
++
+     private static final class InputStreamBuilder extends AttachmentBuilder {
+         InputStreamBuilder(ParameterImpl param, ValueSetter setter) {
+             super(param, setter);
+         }
+-        
++
+         Object mapAttachment(Attachment att, Object[] args) {
+             return setter.put(att.asInputStream(), args);
+         }
+     }
+-        
++
+     private static final class JAXBBuilder extends AttachmentBuilder {
+         JAXBBuilder(ParameterImpl param, ValueSetter setter) {
+             super(param, setter);
+         }
+-        
++
+         Object mapAttachment(Attachment att, Object[] args) throws JAXBException {
+             Object obj = param.getBridge().unmarshal(att.asInputStream());
+             return setter.put(obj, args);
+         }
+     }
+-    
++
+     /**
+      * Gets the WSDL part name of this attachment.
+      *
+@@ -462,7 +473,7 @@
+ 
+         private final QName wrapperName;
+ 
+-        public DocLit(WrapperParameter wp) {
++        public DocLit(WrapperParameter wp, ValueSetterFactory setterFactory) {
+             wrapperName = wp.getName();
+             wrapper = wp.getBridge();
+             Class wrapperType = (Class) wrapper.getTypeReference().type;
+@@ -480,7 +491,7 @@
+                             wrapperType,
+                             name.getNamespaceURI(),
+                             p.getName().getLocalPart()),
+-                        ValueSetter.get(p)
++                        setterFactory.get(p)
+                     ));
+                     // wrapper parameter itself always bind to body, and
+                     // so do all its children
+@@ -497,7 +508,7 @@
+         public Object readResponse(Message msg, Object[] args) throws JAXBException, XMLStreamException {
+             Object retVal = null;
+ 
+-            if(parts.length>0) {
++            if (parts.length>0) {
+                 XMLStreamReader reader = msg.readPayload();
+                 XMLStreamReaderUtil.verifyTag(reader,wrapperName);
+                 Object wrapperBean = wrapper.unmarshal(reader, (msg.getAttachments() != null) ?
+@@ -521,6 +532,8 @@
+                 // we are done with the body
+                 reader.close();
+                 XMLStreamReaderFactory.recycle(reader);
++            } else {
++                msg.consume();
+             }
+ 
+             return retVal;
+@@ -567,7 +580,7 @@
+ 
+         private QName wrapperName;
+ 
+-        public RpcLit(WrapperParameter wp) {
++        public RpcLit(WrapperParameter wp, ValueSetterFactory setterFactory) {
+             assert wp.getTypeReference().type== CompositeStructure.class;
+ 
+             wrapperName = wp.getName();
+@@ -574,7 +587,7 @@
+             List<ParameterImpl> children = wp.getWrapperChildren();
+             for (ParameterImpl p : children) {
+                 parts.put( p.getName(), new PartBuilder(
+-                    p.getBridge(), ValueSetter.get(p)
++                    p.getBridge(), setterFactory.get(p)
+                 ));
+                 // wrapper parameter itself always bind to body, and
+                 // so do all its children
+@@ -606,6 +619,11 @@
+                         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
+@@ -642,8 +660,8 @@
+ 
+         }
+     }
+-    
++
+     private static boolean isXMLMimeType(String mimeType){
+-        return (mimeType.equals("text/xml") || mimeType.equals("application/xml")) ? true : false;
++        return mimeType.equals("text/xml") || mimeType.equals("application/xml");
+     }
+ }
+--- old/src/share/classes/com/sun/xml/internal/ws/client/sei/SEIStub.java	Thu Jul 30 18:26:25 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/client/sei/SEIStub.java	Thu Jul 30 18:26:25 2009
+@@ -34,6 +34,7 @@
+ import com.sun.xml.internal.ws.api.model.MEP;
+ 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.binding.BindingImpl;
+ import com.sun.xml.internal.ws.client.RequestContext;
+ import com.sun.xml.internal.ws.client.ResponseContextReceiver;
+@@ -61,7 +62,7 @@
+         this.seiModel = seiModel;
+         this.soapVersion = binding.getSOAPVersion();
+ 
+-        Map<WSDLBoundOperation, SyncMethodHandler> syncs = new HashMap<WSDLBoundOperation, SyncMethodHandler>();
++        Map<WSDLBoundOperation, JavaMethodImpl> syncs = new HashMap<WSDLBoundOperation, JavaMethodImpl>();
+ 
+         // fill in methodHandlers.
+         // first fill in sychronized versions
+@@ -68,13 +69,13 @@
+         for (JavaMethodImpl m : seiModel.getJavaMethods()) {
+             if (!m.getMEP().isAsync) {
+                 SyncMethodHandler handler = new SyncMethodHandler(this, m);
+-                syncs.put(m.getOperation(), handler);
++                syncs.put(m.getOperation(), m);
+                 methodHandlers.put(m.getMethod(), handler);
+             }
+         }
+ 
+         for (JavaMethodImpl jm : seiModel.getJavaMethods()) {
+-            SyncMethodHandler sync = syncs.get(jm.getOperation());
++            JavaMethodImpl sync = syncs.get(jm.getOperation());
+             if (jm.getMEP() == MEP.ASYNC_CALLBACK) {
+                 Method m = jm.getMethod();
+                 CallbackMethodHandler handler = new CallbackMethodHandler(
+@@ -123,6 +124,10 @@
+         return super.process(request, rc, receiver);
+     }
+ 
++    public final void doProcessAsync(Packet request, RequestContext rc, Fiber.CompletionCallback callback) {
++        super.processAsync(request, rc, callback);
++    }
++
+     protected final @NotNull QName getPortName() {
+         return wsdlPort.getName();
+     }
+--- old/src/share/classes/com/sun/xml/internal/ws/client/sei/SyncMethodHandler.java	Thu Jul 30 18:26:29 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/client/sei/SyncMethodHandler.java	Thu Jul 30 18:26:28 2009
+@@ -66,150 +66,15 @@
+  *
+  * @author Kohsuke Kawaguchi
+  */
+-final class SyncMethodHandler extends MethodHandler {
+-
+-    // these objects together create a message from method parameters
+-    private final BodyBuilder bodyBuilder;
+-    private final MessageFiller[] inFillers;
+-
+-    private final String soapAction;
+-
+-    private final boolean isOneWay;
+-    
+-    private final JavaMethodImpl javaMethod;
+-
+-    /**
+-     * Used to get a value from method invocation parameter.
+-     *
+-     * valueGetters[i] is for methodArgs[i], and so on.
+-     */
+-    /*package*/ final ValueGetter[] valueGetters;
+-
++final class SyncMethodHandler extends SEIMethodHandler {
+     private final ResponseBuilder responseBuilder;
+-    private final Map<QName, CheckedExceptionImpl> checkedExceptions;
+ 
+-    public SyncMethodHandler(SEIStub owner, JavaMethodImpl method) {
+-        super(owner);
+-        
+-        //keep all the CheckedException model for the detail qname
+-        this.checkedExceptions = new HashMap<QName, CheckedExceptionImpl>();
+-        for(CheckedExceptionImpl ce : method.getCheckedExceptions()){
+-            checkedExceptions.put(ce.getBridge().getTypeReference().tagName, ce);
+-        }
+-        //If a non-"" soapAction is specified, wsa:action the SOAPAction
+-        if(method.getInputAction() != null && !method.getBinding().getSOAPAction().equals("") ) {
+-            this.soapAction = method.getInputAction();
+-        } else {
+-            this.soapAction = method.getBinding().getSOAPAction();
+-        }
+-        this.javaMethod = method;
+-
+-        {// prepare objects for creating messages
+-            List<ParameterImpl> rp = method.getRequestParameters();
+-
+-            BodyBuilder bodyBuilder = null;
+-            List<MessageFiller> fillers = new ArrayList<MessageFiller>();
+-            valueGetters = new ValueGetter[rp.size()];
+-
+-            for (ParameterImpl param : rp) {
+-                ValueGetter getter = ValueGetter.get(param);
+-
+-                switch(param.getInBinding().kind) {
+-                case BODY:
+-                    if(param.isWrapperStyle()) {
+-                        if(param.getParent().getBinding().isRpcLit())
+-                            bodyBuilder = new BodyBuilder.RpcLit((WrapperParameter)param, owner.soapVersion);
+-                        else
+-                            bodyBuilder = new BodyBuilder.DocLit((WrapperParameter)param, owner.soapVersion);
+-                    } else {
+-                        bodyBuilder = new BodyBuilder.Bare(param, owner.soapVersion);
+-                    }
+-                    break;
+-                case HEADER:
+-                    fillers.add(new MessageFiller.Header(
+-                        param.getIndex(),
+-                        param.getBridge(),
+-                        getter ));
+-                    break;
+-                case ATTACHMENT:
+-                    fillers.add(MessageFiller.AttachmentFiller.createAttachmentFiller(param, getter));
+-                    break;
+-                case UNBOUND:
+-                    break;
+-                default:
+-                    throw new AssertionError(); // impossible
+-                }
+-            }
+-
+-            if(bodyBuilder==null) {
+-                // no parameter binds to body. we create an empty message
+-                switch(owner.soapVersion) {
+-                case SOAP_11:
+-                    bodyBuilder = BodyBuilder.EMPTY_SOAP11;
+-                    break;
+-                case SOAP_12:
+-                    bodyBuilder = BodyBuilder.EMPTY_SOAP12;
+-                    break;
+-                default:
+-                    throw new AssertionError();
+-                }
+-            }
+-
+-            this.bodyBuilder = bodyBuilder;
+-            this.inFillers = fillers.toArray(new MessageFiller[fillers.size()]);
+-        }
+-
+-        {// prepare objects for processing response
+-            List<ParameterImpl> rp = method.getResponseParameters();
+-            List<ResponseBuilder> builders = new ArrayList<ResponseBuilder>();
+-
+-            for( ParameterImpl param : rp ) {
+-                ValueSetter setter = ValueSetter.get(param);
+-                switch(param.getOutBinding().kind) {
+-                case BODY:
+-                    if(param.isWrapperStyle()) {
+-                        if(param.getParent().getBinding().isRpcLit())
+-                            builders.add(new ResponseBuilder.RpcLit((WrapperParameter)param));
+-                        else
+-                            builders.add(new ResponseBuilder.DocLit((WrapperParameter)param));
+-                    } else {
+-                        builders.add(new ResponseBuilder.Body(param.getBridge(),setter));
+-                    }
+-                    break;
+-                case HEADER:
+-                    builders.add(new ResponseBuilder.Header(owner.soapVersion, param, setter));
+-                    break;
+-                case ATTACHMENT:
+-                    builders.add(ResponseBuilder.AttachmentBuilder.createAttachmentBuilder(param, setter));
+-                    break;
+-                case UNBOUND:
+-                    builders.add(new ResponseBuilder.NullSetter(setter,
+-                        ResponseBuilder.getVMUninitializedValue(param.getTypeReference().type)));
+-                    break;
+-                default:
+-                    throw new AssertionError();
+-                }
+-            }
+-
+-            switch(builders.size()) {
+-            case 0:
+-                responseBuilder = ResponseBuilder.NONE;
+-                break;
+-            case 1:
+-                responseBuilder = builders.get(0);
+-                break;
+-            default:
+-                responseBuilder = new ResponseBuilder.Composite(builders);
+-            }
+-        }
+-        this.isOneWay = method.getMEP().isOneWay();
++    SyncMethodHandler(SEIStub owner, JavaMethodImpl method) {
++        super(owner, method);
++        responseBuilder = buildResponseBuilder(method, ValueSetterFactory.SYNC);
+     }
+-    
+-    public JavaMethodImpl getJavaMethod() {
+-        return javaMethod;
+-    }
+ 
+-    public Object invoke(Object proxy, Object[] args) throws Throwable {
++    Object invoke(Object proxy, Object[] args) throws Throwable {
+         return invoke(proxy,args,owner.requestContext,owner);
+     }
+ 
+@@ -222,7 +87,7 @@
+      *      We take this as a separate parameter because of the async invocation
+      *      handling, which requires a separate copy.
+      */
+-    public Object invoke(Object proxy, Object[] args, RequestContext rc, ResponseContextReceiver receiver) throws Throwable {
++    Object invoke(Object proxy, Object[] args, RequestContext rc, ResponseContextReceiver receiver) throws Throwable {
+         Packet req = new Packet(createRequestMessage(args));
+ 
+         req.soapAction = soapAction;
+@@ -251,16 +116,8 @@
+         }
+     }
+ 
+-    /**
+-     * Creates a request {@link JAXBMessage} from method arguments.
+-     *
+-     */
+-    private Message createRequestMessage(Object[] args) {
+-        Message msg = bodyBuilder.createMessage(args);
+-
+-        for (MessageFiller filler : inFillers)
+-            filler.fillIn(args,msg);
+-
+-        return msg;
++    ValueGetterFactory getValueGetterFactory() {
++        return ValueGetterFactory.SYNC;
+     }
++
+ }
+--- old/src/share/classes/com/sun/xml/internal/ws/client/sei/ValueGetter.java	Thu Jul 30 18:26:33 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/client/sei/ValueGetter.java	Thu Jul 30 18:26:32 2009
+@@ -25,8 +25,6 @@
+ 
+ package com.sun.xml.internal.ws.client.sei;
+ 
+-import com.sun.xml.internal.ws.model.ParameterImpl;
+-
+ import javax.jws.WebParam.Mode;
+ import javax.xml.ws.Holder;
+ 
+@@ -74,17 +72,9 @@
+ 
+     /**
+      * Gets the value to be sent, from a parameter given as a method argument.
++     * @param parameter that is passed by proxy
++     * @return if it holder then its value, otherise parameter itself
+      */
+     abstract Object get(Object parameter);
+ 
+-    /**
+-     * Returns a {@link ValueGetter} suitable for the given {@link Parameter}.
+-     */
+-    static ValueGetter get(ParameterImpl p) {
+-        // return value is always PLAIN
+-        if(p.getMode()== Mode.IN || p.getIndex() == -1)
+-            return PLAIN;
+-        else
+-            return HOLDER;
+-    }
+ }
+--- old/src/share/classes/com/sun/xml/internal/ws/client/sei/ValueSetter.java	Thu Jul 30 18:26:37 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/client/sei/ValueSetter.java	Thu Jul 30 18:26:36 2009
+@@ -27,8 +27,12 @@
+ 
+ import com.sun.xml.internal.ws.api.model.Parameter;
+ import com.sun.xml.internal.ws.model.ParameterImpl;
++import com.sun.xml.internal.bind.api.RawAccessor;
+ 
+ import javax.xml.ws.Holder;
++import javax.xml.ws.WebServiceException;
++import javax.xml.namespace.QName;
++import javax.xml.bind.JAXBException;
+ 
+ /**
+  * Moves a Java value unmarshalled from a response message
+@@ -82,7 +86,7 @@
+     /**
+      * Returns a {@link ValueSetter} suitable for the given {@link Parameter}.
+      */
+-    public static ValueSetter get(ParameterImpl p) {
++    static ValueSetter getSync(ParameterImpl p) {
+         int idx = p.getIndex();
+ 
+         if(idx==-1)
+@@ -93,6 +97,7 @@
+             return new Param(idx);
+     }
+ 
++
+     private static final class ReturnValue extends ValueSetter {
+         Object put(Object obj, Object[] args) {
+             return obj;
+@@ -125,4 +130,64 @@
+             return null;
+         }
+     }
++
++    /**
++     * Singleton instance.
++     */
++    static final ValueSetter SINGLE_VALUE = new SingleValue();
++
++    /**
++     * Used in case of async invocation, where there is only one OUT parameter
++     */
++    private static final class SingleValue extends ValueSetter {
++        /**
++         * Set args[0] as the value
++         */
++        Object put(Object obj, Object[] args) {
++            args[0] = obj;
++            return null;
++        }
++    }
++
++    /**
++     * OUT parameters are set in async bean
++     */
++    static final class AsyncBeanValueSetter extends ValueSetter {
++
++        private final RawAccessor accessor;
++
++        AsyncBeanValueSetter(ParameterImpl p, Class wrapper) {
++            QName name = p.getName();
++            try {
++                accessor = p.getOwner().getJAXBContext().getElementPropertyAccessor(
++                            wrapper, name.getNamespaceURI(), name.getLocalPart() );
++            } catch (JAXBException e) {
++                    throw new WebServiceException(  // TODO: i18n
++                        wrapper+" do not have a property of the name "+name,e);
++            }
++        }
++
++        /**
++         * Sets the property in async bean instance
++         *
++         * @param obj property in async bean
++         * @param args args[0] contains async bean instance
++         * @return null always
++         */
++        Object put(Object obj, Object[] args) {
++            assert args != null;
++            assert args.length == 1;
++            assert args[0] != null;
++
++            Object bean = args[0];
++            try {
++                accessor.set(bean, obj);
++            } catch (Exception e) {
++                throw new WebServiceException(e);    // TODO:i18n
++            }
++            return null;
++        }
++
++    }
++
+ }
+--- old/src/share/classes/com/sun/xml/internal/ws/developer/JAXWSProperties.java	Thu Jul 30 18:26:40 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/developer/JAXWSProperties.java	Thu Jul 30 18:26:40 2009
+@@ -25,12 +25,16 @@
+ package com.sun.xml.internal.ws.developer;
+ 
+ import com.sun.xml.internal.ws.api.message.HeaderList;
++import com.sun.xml.internal.ws.api.server.WSEndpoint;
++import com.sun.xml.internal.ws.api.addressing.WSEndpointReference;
+ 
+-import javax.xml.ws.BindingProvider;
+-import javax.xml.ws.WebServiceContext;
++import javax.net.ssl.HostnameVerifier;
+ import javax.net.ssl.HttpsURLConnection;
+ import javax.net.ssl.SSLSocketFactory;
+-import javax.net.ssl.HostnameVerifier;
++import javax.xml.ws.BindingProvider;
++import javax.xml.ws.WebServiceContext;
++import javax.xml.ws.BindingType;
++import javax.xml.ws.http.HTTPBinding;
+ import java.net.HttpURLConnection;
+ 
+ public interface JAXWSProperties {
+@@ -44,11 +48,35 @@
+ 
+     /**
+      * Set this property on the {@link BindingProvider#getRequestContext()} to
++     * enable {@link HttpURLConnection#setConnectTimeout(int)}
++     *
++     *<p>
++     * int timeout = ...;
++     * Map<String, Object> ctxt = ((BindingProvider)proxy).getRequestContext();
++     * ctxt.put(CONNECT_TIMEOUT, timeout);
++     */
++    public static final String CONNECT_TIMEOUT =
++        "com.sun.xml.internal.ws.connect.timeout";
++
++    /**
++     * Set this property on the {@link BindingProvider#getRequestContext()} to
++     * enable {@link HttpURLConnection#httpConnection.setReadTimeout(int)}
++     *
++     *<p>
++     * int timeout = ...;
++     * Map<String, Object> ctxt = ((BindingProvider)proxy).getRequestContext();
++     * ctxt.put(REQUEST_TIMEOUT, timeout);
++     */
++     public static final String REQUEST_TIMEOUT =
++        "com.sun.xml.internal.ws.request.timeout";
++
++    /**
++     * Set this property on the {@link BindingProvider#getRequestContext()} to
+      * enable {@link HttpURLConnection#setChunkedStreamingMode(int)}
+      *
+      *<p>
+      * int chunkSize = ...;
+-     * Map<String, Object> ctxt = (BindingProvider)proxy).getRequestContext();
++     * Map<String, Object> ctxt = ((BindingProvider)proxy).getRequestContext();
+      * ctxt.put(HTTP_CLIENT_STREAMING_CHUNK_SIZE, chunkSize);
+      */
+     public static final String HTTP_CLIENT_STREAMING_CHUNK_SIZE = "com.sun.xml.internal.ws.transport.http.client.streaming.chunk.size";
+@@ -61,7 +89,7 @@
+      *
+      * <p>
+      * HostNameVerifier hostNameVerifier = ...;
+-     * Map<String, Object> ctxt = (BindingProvider)proxy).getRequestContext();
++     * Map<String, Object> ctxt = ((BindingProvider)proxy).getRequestContext();
+      * ctxt.put(HOSTNAME_VERIFIER, hostNameVerifier);
+      *
+      * <p>
+@@ -76,7 +104,7 @@
+      *
+      * <p>
+      * SSLSocketFactory sslFactory = ...;
+-     * Map<String, Object> ctxt = (BindingProvider)proxy).getRequestContext();
++     * Map<String, Object> ctxt = ((BindingProvider)proxy).getRequestContext();
+      * ctxt.put(SSL_SOCKET_FACTORY, sslFactory);
+      *
+      * <p>
+@@ -101,4 +129,105 @@
+      * <b>THIS PROPERTY IS EXPERIMENTAL AND IS SUBJECT TO CHANGE WITHOUT NOTICE IN FUTURE.</b>
+      */
+     public static final String INBOUND_HEADER_LIST_PROPERTY = "com.sun.xml.internal.ws.api.message.HeaderList";
++
++    /**
++     * Access the {@link WSEndpoint} object that delivered the request.
++     *
++     * <p>
++     * {@link WSEndpoint} is the root of the objects that are together
++     * responsible for delivering requests to the application SEI object.
++     * One can look up this {@link WSEndpoint} from {@link WebServiceContext},
++     * and from there access many parts of the JAX-WS RI runtime.
++     *
++     * <p>
++     * <b>THIS PROPERTY IS EXPERIMENTAL AND IS SUBJECT TO CHANGE WITHOUT NOTICE IN FUTURE.</b>
++     *
++     * @since 2.1.2
++     */
++    public static final String WSENDPOINT = "com.sun.xml.internal.ws.api.server.WSEndpoint";
++
++    /**
++     * Gets the <tt>wsa:To</tt> header.
++     *
++     * The propery value is available on incoming SOAP message. The type of the value
++     * is {@link WSEndpointReference}.
++     *
++     * Null if the incoming SOAP message didn't have the header.
++     *
++     * @since 2.1.3
++     */
++    public static final String ADDRESSING_TO = "com.sun.xml.internal.ws.api.addressing.to";
++
++    /**
++     * Gets the <tt>wsa:From</tt> header.
++     *
++     * The propery value is available on incoming SOAP message. The type of the value
++     * is {@link WSEndpointReference}.
++     *
++     * Null if the incoming SOAP message didn't have the header.
++     *
++     * @since 2.1.3
++     */
++    public static final String ADDRESSING_FROM = "com.sun.xml.internal.ws.api.addressing.from";
++
++    /**
++     * Gets the <tt>wsa:Action</tt> header value.
++     *
++     * The propery value is available on incoming SOAP message. The type of the value
++     * is {@link String}.
++     *
++     * Null if the incoming SOAP message didn't have the header.
++     *
++     * @since 2.1.3
++     */
++    public static final String ADDRESSING_ACTION = "com.sun.xml.internal.ws.api.addressing.action";
++
++    /**
++     * Gets the <tt>wsa:MessageID</tt> header value.
++     *
++     * The propery value is available on incoming SOAP message. The type of the value
++     * is {@link String}.
++     *
++     * Null if the incoming SOAP message didn't have the header.
++     *
++     * @since 2.1.3
++     */
++    public static final String ADDRESSING_MESSAGEID = "com.sun.xml.internal.ws.api.addressing.messageId";
++
++    /**
++     * Reconstructs the URL the client used to make the request. The returned URL
++     * contains a protocol, server name, port number, and server path, but it does
++     * not include query string parameters.
++     * <p>
++     * The property value is available on incoming SOAP message on servlet transport.
++     *
++     * @since 2.1.3
++     */
++    public static final String HTTP_REQUEST_URL = "com.sun.xml.internal.ws.transport.http.servlet.requestURL";
++
++    /**
++     * Binding to represent RESTful services. {@link HTTPBinding#HTTP_BINDING} works
++     * only for Dispatch/Provider services, but this binding works with even SEI based
++     * services. It would be XML, NOT SOAP on the wire. Hence, the SEI parameters
++     * shouldn't be mapped to headers.
++     *
++     * <p>
++     * Note that, this only solves limited RESTful usecases.
++     *
++     * <p>To enable restful binding on the service, specify the binding id via
++     * {@link BindingType} or DD
++     * <pre>
++     * &#64;WebService
++     * &#64;BindingType(JAXWSProperties.REST_BINDING)
++     * </pre>
++     *
++     * <p>To enable restful binding on the client side, specify the binding id via
++     * {@link BindingTypeFeature}
++     * <pre>
++     * proxy = echoImplService.getEchoImplPort(new BindingTypeFeature(JAXWSProperties.REST_BINDING));
++     * </pre>
++     *
++     * @since 2.1.4
++     */
++    public static final String REST_BINDING = "http://jax-ws.dev.java.net/rest";
+ }
+--- old/src/share/classes/com/sun/xml/internal/ws/developer/MemberSubmissionAddressing.java	Thu Jul 30 18:26:44 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/developer/MemberSubmissionAddressing.java	Thu Jul 30 18:26:43 2009
+@@ -23,7 +23,6 @@
+  * have any questions.
+  */
+ 
+-
+ package com.sun.xml.internal.ws.developer;
+ 
+ import java.lang.annotation.Documented;
+@@ -90,4 +89,15 @@
+      * <code>wsaw:UsingAddressing</code> element in the WSDL.
+      */
+     boolean required() default false;
++
++    /**
++     * Property to determine if the incoming messsages should be checked for conformance
++     * with MemberSubmission version of WS-Addressing.
++     *
++     * If Validation.LAX, then some WS-Adressing headers are not strictly checked.
++     */
++    public enum Validation { LAX, STRICT };
++
++    Validation validation() default Validation.LAX;
++
+ }
+--- old/src/share/classes/com/sun/xml/internal/ws/developer/MemberSubmissionAddressingFeature.java	Thu Jul 30 18:26:47 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/developer/MemberSubmissionAddressingFeature.java	Thu Jul 30 18:26:47 2009
+@@ -23,12 +23,10 @@
+  * have any questions.
+  */
+ 
+-
+ package com.sun.xml.internal.ws.developer;
+ 
+ import com.sun.xml.internal.ws.api.FeatureConstructor;
+ 
+-import javax.xml.ws.soap.AddressingFeature;
+ import javax.xml.ws.WebServiceFeature;
+ 
+ /**
+@@ -47,7 +45,7 @@
+      * Constant ID for the <code>required</code> feature parameter
+      */
+     public static final String IS_REQUIRED = "ADDRESSING_IS_REQUIRED";
+-    
++
+     private boolean required;
+ 
+     /**
+@@ -77,12 +75,31 @@
+      * for the <code>required</code> attribute on the
+      * <code>wsaw:UsingAddressing</code> element.
+      */
+-    @FeatureConstructor({"enabled","required"})
+     public MemberSubmissionAddressingFeature(boolean enabled, boolean required) {
+         this.enabled = enabled;
+         this.required = required;
+     }
+ 
++    /**
++     * Create an <code>MemberSubmissionAddressingFeature</code>
++     *
++     * @param enabled specifies whether this feature should
++     * be enabled or not.
++     * @param required specifies the value that will be used
++     * for the <code>required</code> attribute on the
++     * <code>wsaw:UsingAddressing</code> element.
++     * @param validation specifies the value that will be used
++     * for validation for the incoming messages. If LAX, messages are not strictly checked for conformance with  the spec.
++     */
++    @FeatureConstructor({"enabled","required","validation"})
++    public MemberSubmissionAddressingFeature(boolean enabled, boolean required, MemberSubmissionAddressing.Validation validation) {
++        this.enabled = enabled;
++        this.required = required;
++        this.validation = validation;
++    }
++
++
++
+     public String getID() {
+         return ID;
+     }
+@@ -94,4 +111,14 @@
+     public void setRequired(boolean required) {
+         this.required = required;
+     }
++
++    private MemberSubmissionAddressing.Validation validation = MemberSubmissionAddressing.Validation.LAX;
++    public void setValidation(MemberSubmissionAddressing.Validation validation) {
++        this.validation = validation;
++
++    }
++
++    public MemberSubmissionAddressing.Validation getValidation() {
++        return validation;
++    }
+ }
+--- old/src/share/classes/com/sun/xml/internal/ws/developer/MemberSubmissionEndpointReference.java	Thu Jul 30 18:26:51 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/developer/MemberSubmissionEndpointReference.java	Thu Jul 30 18:26:50 2009
+@@ -62,7 +62,7 @@
+ 
+ @XmlRootElement(name = "EndpointReference", namespace = MemberSubmissionEndpointReference.MSNS)
+ @XmlType(name = "EndpointReferenceType", namespace = MemberSubmissionEndpointReference.MSNS)
+-public class MemberSubmissionEndpointReference extends EndpointReference implements MemberSubmissionAddressingConstants {
++public final class MemberSubmissionEndpointReference extends EndpointReference implements MemberSubmissionAddressingConstants {
+ 
+     private final static JAXBContext msjc = MemberSubmissionEndpointReference.getMSJaxbContext();
+ 
+@@ -105,7 +105,7 @@
+     public void writeTo(Result result) {
+         try {
+             Marshaller marshaller = MemberSubmissionEndpointReference.msjc.createMarshaller();
+-            marshaller.setProperty(Marshaller.JAXB_FRAGMENT, true);
++            //marshaller.setProperty(Marshaller.JAXB_FRAGMENT, true);
+             marshaller.marshal(this, result);
+         } catch (JAXBException e) {
+             throw new WebServiceException("Error marshalling W3CEndpointReference. ", e);
+@@ -117,7 +117,7 @@
+      *
+      * @return Source A source object containing the wsdl in the MemeberSubmissionEndpointReference, if present.
+      */
+-    public Source toWSDLSource() {        
++    public Source toWSDLSource() {
+         Element wsdlElement = null;
+ 
+         for (Element elem : elements) {
+--- old/src/share/classes/com/sun/xml/internal/ws/developer/Stateful.java	Thu Jul 30 18:26:54 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/developer/Stateful.java	Thu Jul 30 18:26:54 2009
+@@ -51,5 +51,5 @@
+ @Documented
+ @WebServiceFeatureAnnotation(id = StatefulFeature.ID, bean = StatefulFeature.class)
+ @InstanceResolverAnnotation(StatefulInstanceResolver.class)
+-public @interface Stateful {    
++public @interface Stateful {
+ }
+--- old/src/share/classes/com/sun/xml/internal/ws/developer/StatefulFeature.java	Thu Jul 30 18:26:58 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/developer/StatefulFeature.java	Thu Jul 30 18:26:57 2009
+@@ -23,7 +23,6 @@
+  * have any questions.
+  */
+ 
+-
+ package com.sun.xml.internal.ws.developer;
+ 
+ import com.sun.xml.internal.ws.api.FeatureConstructor;
+--- old/src/share/classes/com/sun/xml/internal/ws/developer/StatefulWebServiceManager.java	Thu Jul 30 18:27:01 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/developer/StatefulWebServiceManager.java	Thu Jul 30 18:27:01 2009
+@@ -230,7 +230,7 @@
+      *      See {@link #export(Class, Object, EPRRecipe)}.
+      */
+     @NotNull <EPR extends EndpointReference> EPR export(Class<EPR> eprType, @NotNull Packet currentRequest, T o, EPRRecipe recipe);
+-    
++
+     /**
+      * Exports an object.
+      *
+@@ -333,7 +333,7 @@
+      *
+      * <p>
+      * When you call this method multiple times, its effect on existing
+-     * instances are unspecified, although deterministic. 
++     * instances are unspecified, although deterministic.
+      *
+      * @param milliseconds
+      *      The time out interval. Specify 0 to cancel the timeout timer.
+--- old/src/share/classes/com/sun/xml/internal/ws/developer/WSBindingProvider.java	Thu Jul 30 18:27:05 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/developer/WSBindingProvider.java	Thu Jul 30 18:27:04 2009
+@@ -35,6 +35,7 @@
+ import javax.xml.ws.Service;
+ import javax.xml.ws.Service.Mode;
+ import java.util.List;
++import java.io.Closeable;
+ 
+ /**
+  * {@link BindingProvider} with JAX-WS RI's extension methods.
+@@ -43,7 +44,7 @@
+  * @author Jitendra Kotamraju
+  * @since 2.1EA3
+  */
+-public interface WSBindingProvider extends BindingProvider {
++public interface WSBindingProvider extends BindingProvider, Closeable {
+     /**
+      * Sets the out-bound headers to be added to messages sent from
+      * this {@link BindingProvider}.
+@@ -99,4 +100,21 @@
+     void setOutboundHeaders(Object... headers);
+ 
+     List<Header> getInboundHeaders();
++
++    /**
++     * Sets the endpoint address for all the invocations that happen
++     * from {@link BindingProvider}. Instead of doing the following
++     *
++     * <p>
++     * ((BindingProvider)proxy).getRequestContext().put(
++     *      BindingProvider.ENDPOINT_ADDRESS_PROPERTY, "...")
++     * <p>
++     * you could do this:
++     *
++     * <p>
++     * ((WSBindingProvider)proxy).setAddress("...");
++     *
++     * @param address Address of the service
++     */
++    void setAddress(String address);
+ }
+--- old/src/share/classes/com/sun/xml/internal/ws/encoding/ContentTypeImpl.java	Thu Jul 30 18:27:08 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/ContentTypeImpl.java	Thu Jul 30 18:27:08 2009
+@@ -25,34 +25,48 @@
+ 
+ package com.sun.xml.internal.ws.encoding;
+ 
+-import com.sun.xml.internal.ws.api.pipe.ContentType;
++import com.sun.istack.internal.Nullable;
++import com.sun.istack.internal.NotNull;
+ 
+ /**
+  * @author Vivek Pandey
+  */
+-public final class ContentTypeImpl implements ContentType {
+-    private final String contentType;
+-    private final String soapAction;
+-    private final String accept;
++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 final @Nullable String charset;
+ 
+     public ContentTypeImpl(String contentType) {
+-        this.contentType = contentType;
+-        this.soapAction = null;
+-        this.accept = null;
++        this(contentType, null, null);
+     }
+-    
+-    public ContentTypeImpl(String contentType, String soapAction) {
+-        this.contentType = contentType;
+-        this.soapAction = getQuotedSOAPAction(soapAction);
+-        this.accept = null;
++
++    public ContentTypeImpl(String contentType, @Nullable String soapAction) {
++        this(contentType, soapAction, null);
+     }
+-    
+-    public ContentTypeImpl(String contentType, String soapAction, String accept) {
++
++    public ContentTypeImpl(String contentType, @Nullable String soapAction, @Nullable String accept) {
+         this.contentType = contentType;
+         this.accept = accept;
+         this.soapAction = getQuotedSOAPAction(soapAction);
++        String tmpCharset = null;
++        try {
++            tmpCharset = new ContentType(contentType).getParameter("charset");
++        } catch(Exception e) {
++            //Ignore the parsing exception.
++        }
++        charset = tmpCharset;
+     }
+ 
++    /**
++     * Returns the character set encoding.
++     *
++     * @return returns the character set encoding.
++     */
++    public @Nullable String getCharSet() {
++        return charset;
++    }
++
+     /** BP 1.1 R1109 requires SOAPAction too be a quoted value **/
+     private String getQuotedSOAPAction(String soapAction){
+         if(soapAction == null || soapAction.length() == 0){
+--- old/src/share/classes/com/sun/xml/internal/ws/encoding/MimeCodec.java	Thu Jul 30 18:27:12 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/MimeCodec.java	Thu Jul 30 18:27:11 2009
+@@ -25,14 +25,17 @@
+ 
+ package com.sun.xml.internal.ws.encoding;
+ 
+-import com.sun.xml.internal.messaging.saaj.packaging.mime.util.OutputUtil;
+ import com.sun.xml.internal.ws.api.SOAPVersion;
++import com.sun.xml.internal.ws.api.WSBinding;
+ import com.sun.xml.internal.ws.api.message.Attachment;
+ 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.ContentType;
++import com.sun.xml.internal.ws.developer.StreamingAttachmentFeature;
+ 
++import javax.activation.CommandMap;
++import javax.activation.MailcapCommandMap;
+ import java.io.IOException;
+ import java.io.InputStream;
+ import java.io.OutputStream;
+@@ -57,18 +60,42 @@
+  * @author Kohsuke Kawaguchi
+  */
+ abstract class MimeCodec implements Codec {
++
++    static {
++        // DataHandler.writeTo() may search for DCH. So adding some default ones.
++        try {
++            CommandMap map = CommandMap.getDefaultCommandMap();
++            if (map instanceof MailcapCommandMap) {
++                MailcapCommandMap mailMap = (MailcapCommandMap) map;
++                String hndlrStr = ";;x-java-content-handler=";
++                mailMap.addMailcap(
++                    "text/xml" + hndlrStr + XmlDataContentHandler.class.getName());
++                mailMap.addMailcap(
++                    "application/xml" + hndlrStr + XmlDataContentHandler.class.getName());
++                mailMap.addMailcap(
++                    "image/*" + hndlrStr + ImageDataContentHandler.class.getName());
++                mailMap.addMailcap(
++                    "text/plain" + hndlrStr + StringDataContentHandler.class.getName());
++            }
++        } catch (Throwable t) {
++            // ignore the exception.
++        }
++    }
++
+     public static final String MULTIPART_RELATED_MIME_TYPE = "multipart/related";
+-    
++
+     private String boundary;
+     private String messageContentType;
+     private boolean hasAttachments;
+     protected Codec rootCodec;
+     protected final SOAPVersion version;
++    protected final WSBinding binding;
+ 
+-    protected MimeCodec(SOAPVersion version) {
++    protected MimeCodec(SOAPVersion version, WSBinding binding) {
+         this.version = version;
++        this.binding = binding;
+     }
+-    
++
+     public String getMimeType() {
+         return MULTIPART_RELATED_MIME_TYPE;
+     }
+@@ -82,36 +109,36 @@
+         }
+ 
+         if (hasAttachments) {
+-            OutputUtil.writeln("--"+boundary, out);
+-            OutputUtil.writeln("Content-Type: " + rootCodec.getMimeType(), out);
+-            OutputUtil.writeln(out);
++            writeln("--"+boundary, out);
++            writeln("Content-Type: " + rootCodec.getMimeType(), out);
++            writeln(out);
+         }
+         ContentType primaryCt = rootCodec.encode(packet, out);
+ 
+         if (hasAttachments) {
+-            OutputUtil.writeln(out);
++            writeln(out);
+             // Encode all the attchments
+             for (Attachment att : msg.getAttachments()) {
+-                OutputUtil.writeln("--"+boundary, out);
++                writeln("--"+boundary, out);
+                 //SAAJ's AttachmentPart.getContentId() returns content id already enclosed with
+                 //angle brackets. For now put angle bracket only if its not there
+                 String cid = att.getContentId();
+                 if(cid != null && cid.length() >0 && cid.charAt(0) != '<')
+                     cid = '<' + cid + '>';
+-                OutputUtil.writeln("Content-Id:" + cid, out);
+-                OutputUtil.writeln("Content-Type: " + att.getContentType(), out);
+-                OutputUtil.writeln("Content-Transfer-Encoding: binary", out);
+-                OutputUtil.writeln(out);                    // write \r\n
++                writeln("Content-Id:" + cid, out);
++                writeln("Content-Type: " + att.getContentType(), out);
++                writeln("Content-Transfer-Encoding: binary", out);
++                writeln(out);                    // write \r\n
+                 att.writeTo(out);
+-                OutputUtil.writeln(out);                    // write \r\n
++                writeln(out);                    // write \r\n
+             }
+-            OutputUtil.writeAsAscii("--"+boundary, out);
+-            OutputUtil.writeAsAscii("--", out);
++            writeAsAscii("--"+boundary, out);
++            writeAsAscii("--", out);
+         }
+         // TODO not returing correct multipart/related type(no boundary)
+         return hasAttachments ? new ContentTypeImpl(messageContentType, packet.soapAction, null) : primaryCt;
+     }
+-    
++
+     public ContentType getStaticContentType(Packet packet) {
+         Message msg = packet.getMessage();
+         hasAttachments = !msg.getAttachments().isEmpty();
+@@ -120,7 +147,7 @@
+             boundary = "uuid:" + UUID.randomUUID().toString();
+             String boundaryParameter = "boundary=\"" + boundary + "\"";
+             // TODO use primaryEncoder to get type
+-            messageContentType =  MULTIPART_RELATED_MIME_TYPE + 
++            messageContentType =  MULTIPART_RELATED_MIME_TYPE +
+                     "; type=\"" + rootCodec.getMimeType() + "\"; " +
+                     boundaryParameter;
+             return new ContentTypeImpl(messageContentType, packet.soapAction, null);
+@@ -134,10 +161,11 @@
+      */
+     protected MimeCodec(MimeCodec that) {
+         this.version = that.version;
++        this.binding = that.binding;
+     }
+ 
+     public void decode(InputStream in, String contentType, Packet packet) throws IOException {
+-        MimeMultipartParser parser = new MimeMultipartParser(in, contentType);
++        MimeMultipartParser parser = new MimeMultipartParser(in, contentType, binding.getFeature(StreamingAttachmentFeature.class));
+         decode(parser,packet);
+     }
+ 
+@@ -151,4 +179,24 @@
+     protected abstract void decode(MimeMultipartParser mpp, Packet packet) throws IOException;
+ 
+     public abstract MimeCodec copy();
++
++
++    public static void writeln(String s,OutputStream out) throws IOException {
++        writeAsAscii(s,out);
++        writeln(out);
++    }
++
++    /**
++     * Writes a string as ASCII string.
++     */
++    public static void writeAsAscii(String s,OutputStream out) throws IOException {
++        int len = s.length();
++        for( int i=0; i<len; i++ )
++            out.write((byte)s.charAt(i));
++    }
++
++    public static void writeln(OutputStream out) throws IOException {
++        out.write('\r');
++        out.write('\n');
++    }
+ }
+--- old/src/share/classes/com/sun/xml/internal/ws/encoding/MimeMultipartParser.java	Thu Jul 30 18:27:15 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/MimeMultipartParser.java	Thu Jul 30 18:27:15 2009
+@@ -28,20 +28,26 @@
+ 
+ import com.sun.istack.internal.NotNull;
+ import com.sun.istack.internal.Nullable;
+-import com.sun.xml.internal.messaging.saaj.packaging.mime.MessagingException;
+-import com.sun.xml.internal.messaging.saaj.packaging.mime.internet.ContentType;
+-import com.sun.xml.internal.messaging.saaj.packaging.mime.internet.InternetHeaders;
+-import com.sun.xml.internal.messaging.saaj.packaging.mime.internet.ParseException;
+-import com.sun.xml.internal.ws.message.stream.StreamAttachment;
+-import com.sun.xml.internal.ws.util.ASCIIUtility;
++import com.sun.xml.internal.ws.api.message.Attachment;
++import com.sun.xml.internal.ws.developer.StreamingAttachmentFeature;
++import com.sun.xml.internal.ws.developer.StreamingDataHandler;
+ import com.sun.xml.internal.ws.util.ByteArrayBuffer;
++import com.sun.xml.internal.ws.util.ByteArrayDataSource;
++import com.sun.xml.internal.org.jvnet.mimepull.MIMEMessage;
++import com.sun.xml.internal.org.jvnet.mimepull.MIMEPart;
+ 
++import javax.activation.DataHandler;
++import javax.xml.soap.SOAPException;
++import javax.xml.soap.SOAPMessage;
++import javax.xml.transform.Source;
++import javax.xml.transform.stream.StreamSource;
+ import javax.xml.ws.WebServiceException;
+-import java.io.BufferedInputStream;
++import java.io.ByteArrayInputStream;
+ import java.io.IOException;
+ import java.io.InputStream;
+-import java.util.BitSet;
++import java.io.OutputStream;
+ import java.util.HashMap;
++import java.util.List;
+ import java.util.Map;
+ 
+ /**
+@@ -48,53 +54,35 @@
+  * Parses Mime multipart message into primary part and attachment parts. It
+  * parses the stream lazily as and when required.
+  *
+- * TODO need a list to keep all the attachments so that even if Content-Id is
+- * not there it is accounted
+- *
+  * @author Vivek Pandey
+  * @author Jitendra Kotamraju
+  */
+ public final class MimeMultipartParser {
+ 
+-    private final InputStream in;
+     private final String start;
+-    private final byte[] boundaryBytes;
++    private final MIMEMessage message;
++    private Attachment root;
+ 
+-    private final BitSet lastPartFound = new BitSet(1);
+-    // current stream position, set to -1 on EOF
+-    private int b = 0;
+-    private final int[] bcs = new int[256];
+-    private int[] gss;
+-    private static final int BUFFER_SIZE = 4096;
+-    private byte[] buffer = new byte[BUFFER_SIZE];
+-    private byte[] prevBuffer = new byte[BUFFER_SIZE];
+-    private boolean firstPart = true;
++    // Attachments without root part
++    private final Map<String, Attachment> attachments = new HashMap<String, Attachment>();
+ 
+-    private final Map<String, StreamAttachment> attachments = new HashMap<String, StreamAttachment>();
+-    private StreamAttachment root;
+-    
+-    private int cidCounter = 0;
++    private boolean gotAll;
+ 
+-    public MimeMultipartParser(InputStream in, String contentType) {
+-        try {
+-            ContentType ct = new ContentType(contentType);
+-            String boundary = ct.getParameter("boundary");
+-            if (boundary == null || boundary.equals("")) {
+-                throw new WebServiceException("MIME boundary parameter not found" + contentType);
+-            }
+-            String bnd = "--" + boundary;
+-            boundaryBytes = ASCIIUtility.getBytes(bnd);
+-            start = ct.getParameter("start");
+-        } catch (ParseException e) {
+-            throw new WebServiceException(e);
++    public MimeMultipartParser(InputStream in, String contentType, StreamingAttachmentFeature feature) {
++        ContentType ct = new ContentType(contentType);
++        String boundary = ct.getParameter("boundary");
++        if (boundary == null || boundary.equals("")) {
++            throw new WebServiceException("MIME boundary parameter not found" + contentType);
+         }
+-
+-        //InputStream MUST support mark()
+-        if (!in.markSupported()) {
+-            this.in = new BufferedInputStream(in);
+-        } else {
+-            this.in = in;
++        message = (feature != null)
++                ? new MIMEMessage(in, boundary, feature.getConfig())
++                : new MIMEMessage(in, boundary);
++        // Strip <...> from root part's Content-ID
++        String st = ct.getParameter("start");
++        if (st != null && st.length() > 2 && st.charAt(0) == '<' && st.charAt(st.length()-1) == '>') {
++            st = st.substring(1, st.length()-1);
+         }
++        start = st;
+     }
+ 
+     /**
+@@ -106,13 +94,10 @@
+      *         null if root part cannot be found
+      *
+      */
+-    public @Nullable StreamAttachment getRootPart() {
+-        if (root != null) {
+-            return root;
++    public @Nullable Attachment getRootPart() {
++        if (root == null) {
++            root = new PartAttachment((start != null) ? message.getPart(start) : message.getPart(0));
+         }
+-        while(!lastBodyPartFound() && (b != -1) && root == null) {
+-            getNextPart();
+-        }
+         return root;
+     }
+ 
+@@ -121,9 +106,17 @@
+      *
+      * @return Map<String, StreamAttachment> for all attachment parts
+      */
+-    public @NotNull Map<String, StreamAttachment> getAttachmentParts() {
+-        while(!lastBodyPartFound() && (b != -1)) {
+-            getNextPart();
++    public @NotNull Map<String, Attachment> getAttachmentParts() {
++        if (!gotAll) {
++            MIMEPart rootPart = (start != null) ? message.getPart(start) : message.getPart(0);
++            List<MIMEPart> parts = message.getAttachments();
++            for(MIMEPart part : parts) {
++                if (part != rootPart) {
++                    PartAttachment attach = new PartAttachment(part);
++                    attachments.put(attach.getContentId(), attach);
++                }
++            }
++            gotAll = true;
+         }
+         return attachments;
+     }
+@@ -135,346 +128,81 @@
+      * @return StreamAttachment attachment for contentId
+      *         null if there is no attachment for contentId
+      */
+-    public @Nullable StreamAttachment getAttachmentPart(String contentId) throws IOException {
++    public @Nullable Attachment getAttachmentPart(String contentId) throws IOException {
+         //first see if this attachment is already parsed, if so return it
+-        StreamAttachment streamAttach = attachments.get(contentId);
+-        if (streamAttach != null) {
+-            return streamAttach;
++        Attachment attach = attachments.get(contentId);
++        if (attach == null) {
++            MIMEPart part = message.getPart(contentId);
++            attach = new PartAttachment(part);
++            attachments.put(contentId, attach);
+         }
+-        //else parse the MIME parts till we get what we want
+-        while (!lastBodyPartFound() && (b != -1)) {
+-            streamAttach = getNextPart();
+-            String newContentId = streamAttach.getContentId();
+-            if (newContentId != null && newContentId.equals(contentId)){
+-                return streamAttach;
+-            }
+-        }
+-        return null;            // Attachment is not found
++        return attach;
+     }
+ 
+-    /**
+-     * Parses the stream and returns next available MIME part. This shouldn't
+-     * be called if there are no MIME parts in the stream. Attachment
+-     * part(not root part) is cached in the {@link Map}<{@link String},{@link StreamAttachment}>
+-     * before returning the MIME part. It also finds the root part of the MIME
+-     * package and assigns root variable.
+-     *
+-     * @return StreamAttachment next available MIME part
+-     *
+-     */
+-    private StreamAttachment getNextPart() {
+-        assert !lastBodyPartFound();
++    static class PartAttachment implements Attachment {
+ 
+-        try {
+-            if (firstPart) {
+-                compileBoundaryPattern();
+-                // skip the first boundary of the MIME package
+-                if (!skipPreamble()) {
+-                    throw new WebServiceException("Missing Start Boundary, or boundary does not start on a new line");
+-                }
+-            }
+-            InternetHeaders ih = new InternetHeaders(in);
+-            String[] contentTypes = ih.getHeader("content-type");
+-            String contentType = (contentTypes != null) ? contentTypes[0] : "application/octet-stream";
+-            String [] contentIds = ih.getHeader("content-id");
+-            String mimeContentId = (contentIds != null) ? contentIds[0] : null;
+-            String contentId = mimeContentId;
+-            if(mimeContentId!=null && mimeContentId.length()>2) {
+-                if(contentId.charAt(0)=='<')   contentId=mimeContentId.substring(1,mimeContentId.length()-1);
+-            }
++        final MIMEPart part;
++        byte[] buf;
+ 
+-            ByteArrayBuffer bos = new ByteArrayBuffer();
+-            b = readBody(bos);
+-            StreamAttachment as = new StreamAttachment(bos, contentId, contentType);
+-            if (start == null && firstPart) {
+-                root = as;      // Taking first part as root part
+-            } else if (mimeContentId != null && start != null && start.equals(mimeContentId)) {
+-                root = as;      // root part as identified by start parameter
+-            } else if (contentId != null) {
+-                attachments.put(contentId, as);     // Attachment part
+-            } else {
+-                ++cidCounter;
+-                attachments.put(""+cidCounter, as);
+-            }
+-            firstPart = false;
+-            return as;
+-        } catch(IOException ioe) {
+-            throw new WebServiceException(ioe);
+-        } catch(MessagingException me) {
+-            throw new WebServiceException(me);
++        PartAttachment(MIMEPart part) {
++            this.part = part;
+         }
+-    }
+ 
+-    private int readBody(ByteArrayBuffer baos) throws IOException {
+-        if (!findMimeBody(baos)) {
+-            //TODO: i18n
+-            throw new WebServiceException("Missing boundary delimitier ");
++        public @NotNull String getContentId() {
++            return part.getContentId();
+         }
+-        return b;
+-    }
+ 
+-    private boolean findMimeBody(ByteArrayBuffer out) throws IOException {
+-        int i;
+-        int l = boundaryBytes.length;
+-        int lx = l - 1;
+-        int bufferLength;
+-        int s = 0;
+-        byte[] tmp;
+-
+-        boolean first = true;
+-        BitSet eof = new BitSet(1);
+-
+-        while (true) {
+-            in.mark(l);
+-            if (!first) {
+-                tmp = prevBuffer;
+-                prevBuffer = buffer;
+-                buffer = tmp;
+-            }
+-            bufferLength = readNext(in, l, eof);
+-
+-            if (bufferLength == -1) {
+-                b = -1;
+-                if ((s == l)) {
+-                    out.write(prevBuffer, 0, s);
+-                }
+-                return true;
+-            }
+-
+-            if (bufferLength < l) {
+-                out.write(buffer, 0, bufferLength);
+-                b = -1;
+-                return true;
+-            }
+-
+-            for (i = lx; i >= 0; i--) {
+-                if (buffer[i] != boundaryBytes[i]) {
+-                    break;
+-                }
+-            }
+-
+-            if (i < 0) {
+-                if (s > 0) {
+-                    // so if s == 1 : it must be an LF
+-                    // if s == 2 : it must be a CR LF
+-                    if (s <= 2) {
+-                        String crlf = new String(prevBuffer, 0, s);
+-                        if (!"\n".equals(crlf) && !"\r\n".equals(crlf)) {
+-                            throw new WebServiceException(
+-                                    "Boundary characters encountered in part Body " +
+-                                            "without a preceeding CRLF");
+-                        }
+-                    } else if (s > 2) {
+-                        if ((prevBuffer[s - 2] == '\r') && (prevBuffer[s - 1] == '\n')) {
+-                            out.write(prevBuffer, 0, s - 2);
+-                        } else if (prevBuffer[s - 1] == '\n') {
+-                            out.write(prevBuffer, 0, s - 1);
+-                        } else {
+-                            throw new WebServiceException(
+-                                    "Boundary characters encountered in part Body " +
+-                                            "without a preceeding CRLF");
+-                        }
+-                    }
+-                }
+-                // found the boundary, skip *LWSP-char and CRLF
+-                if (!skipLWSPAndCRLF(in)) {
+-                    //throw new Exception(
+-                    //   "Boundary does not terminate with CRLF");
+-                }
+-                return true;
+-            }
+-
+-            if ((s > 0)) {
+-                if (prevBuffer[s - 1] == (byte) 13) {
+-                    // if buffer[0] == (byte)10
+-                    if (buffer[0] == (byte) 10) {
+-                        int j;
+-                        for (j = lx - 1; j > 0; j--) {
+-                            if (buffer[j + 1] != boundaryBytes[j]) {
+-                                break;
+-                            }
+-                        }
+-                        if (j == 0) {
+-                            // matched the boundaryBytes excluding the last char of the boundaryBytes
+-                            // so dont write the CR into stream
+-                            out.write(prevBuffer, 0, s - 1);
+-                        } else {
+-                            out.write(prevBuffer, 0, s);
+-                        }
+-                    } else {
+-                        out.write(prevBuffer, 0, s);
+-                    }
+-                } else {
+-                    out.write(prevBuffer, 0, s);
+-                }
+-            }
+-
+-            s = Math.max(i + 1 - bcs[buffer[i] & 0x7f], gss[i]);
+-            in.reset();
+-            in.skip(s);
+-            if (first) {
+-                first = false;
+-            }
++        public @NotNull String getContentType() {
++            return part.getContentType();
+         }
+-    }
+ 
+-
+-    private boolean lastBodyPartFound() {
+-        return lastPartFound.get(0);
+-    }
+-
+-    private void compileBoundaryPattern() {
+-        int l = boundaryBytes.length;
+-
+-        int i;
+-        int j;
+-
+-        // Copied from J2SE 1.4 regex code
+-        // java.util.regex.Pattern.java
+-
+-        // Initialise Bad Character Shift table
+-        for (i = 0; i < l; i++) {
+-            bcs[boundaryBytes[i]] = i + 1;
+-        }
+-
+-        // Initialise Good Suffix Shift table
+-        gss = new int[l];
+-
+-        NEXT:
+-        for (i = l; i > 0; i--) {
+-            // j is the beginning index of suffix being considered
+-            for (j = l - 1; j >= i; j--) {
+-                // Testing for good suffix
+-                if (boundaryBytes[j] == boundaryBytes[j - i]) {
+-                    // boundaryBytes[j..len] is a good suffix
+-                    gss[j - 1] = i;
+-                } else {
+-                    // No match. The array has already been
+-                    // filled up with correct values before.
+-                    continue NEXT;
++        public byte[] asByteArray() {
++            if (buf == null) {
++                ByteArrayBuffer baf = new ByteArrayBuffer();
++                try {
++                    baf.write(part.readOnce());
++                } catch(IOException ioe) {
++                    throw new WebServiceException(ioe);
+                 }
++                buf = baf.toByteArray();
+             }
+-            while (j > 0) {
+-                gss[--j] = i;
+-            }
++            return buf;
+         }
+-        gss[l - 1] = 1;
+-    }
+ 
+-    private boolean skipPreamble() throws IOException {
+-        if (!findBoundary()) {
+-            return false;
++        public DataHandler asDataHandler() {
++            return (buf != null)
++                ? new DataSourceStreamingDataHandler(new ByteArrayDataSource(buf,getContentType()))
++                : new MIMEPartStreamingDataHandler(part);
+         }
+-        if (lastPartFound.get(0)) {
+-            throw new WebServiceException("Found closing boundary delimiter while trying to skip preamble");
+-        }
+-        return true;
+-    }
+ 
+-    private boolean findBoundary() throws IOException {
+-        int i;
+-        int l = boundaryBytes.length;
+-        int lx = l - 1;
+-        BitSet eof = new BitSet(1);
+-
+-        while (true) {
+-            in.mark(l);
+-            readNext(in, l, eof);
+-            if (eof.get(0)) {
+-                // End of stream
+-                return false;
+-            }
+-
+-            for (i = lx; i >= 0; i--) {
+-                if (buffer[i] != boundaryBytes[i]) {
+-                    break;
+-                }
+-            }
+-
+-            if (i < 0) {
+-                // found the boundary, skip *LWSP-char and CRLF
+-                if (!skipLWSPAndCRLF(in)) {
+-                    throw new WebServiceException("Boundary does not terminate with CRLF");
+-                }
+-                return true;
+-            }
+-
+-            int s = Math.max(i + 1 - bcs[buffer[i] & 0x7f], gss[i]);
+-            in.reset();
+-            in.skip(s);
++        public Source asSource() {
++            return (buf != null)
++                ? new StreamSource(new ByteArrayInputStream(buf))
++                : new StreamSource(part.read());
+         }
+-    }
+ 
+-    private boolean skipLWSPAndCRLF(InputStream is) throws IOException {
+-
+-        b = is.read();
+-        //looks like old impl allowed just a \n as well
+-        if (b == '\n') {
+-            return true;
++        public InputStream asInputStream() {
++            return (buf != null)
++                ? new ByteArrayInputStream(buf) : part.read();
+         }
+ 
+-        if (b == '\r') {
+-            b = is.read();
+-            if (b == '\n') {
+-                return true;
++        public void writeTo(OutputStream os) throws IOException {
++            if (buf != null) {
++                os.write(buf);
+             } else {
+-                throw new WebServiceException(
+-                        "transport padding after a Mime Boundary  should end in a CRLF, found CR only");
+-            }
+-        }
+-
+-        if (b == '-') {
+-            b = is.read();
+-            if (b != '-') {
+-                throw new WebServiceException(
+-                        "Unexpected singular '-' character after Mime Boundary");
+-            } else {
+-                lastPartFound.flip(0);
+-                // read the next char
+-                b = is.read();
+-            }
+-        }
+-
+-        while ((b != -1) && ((b == ' ') || (b == '\t'))) {
+-            b = is.read();
+-            if (b == '\r') {
+-                b = is.read();
+-                if (b == '\n') {
+-                    return true;
++                InputStream in = part.read();
++                byte[] temp = new byte[8192];
++                int len;
++                while((len=in.read(temp)) != -1) {
++                    os.write(temp, 0, len);
+                 }
++                in.close();
+             }
+         }
+ 
+-        if (b == -1) {
+-            // the last boundary need not have CRLF
+-            if (!lastPartFound.get(0)) {
+-                throw new WebServiceException(
+-                        "End of Multipart Stream before encountering  closing boundary delimiter");
+-            }
+-            return true;
++        public void writeTo(SOAPMessage saaj) throws SOAPException {
++            saaj.createAttachmentPart().setDataHandler(asDataHandler());
+         }
+-        return false;
+     }
+ 
+-
+-    private int readNext(InputStream is, int patternLength, BitSet eof) throws IOException {
+-        int bufferLength = is.read(buffer, 0, patternLength);
+-        if (bufferLength == -1) {
+-            eof.flip(0);
+-        } else if (bufferLength < patternLength) {
+-            //repeatedly read patternLength - bufferLength
+-            int temp ;
+-            int i = bufferLength;
+-            for (; i < patternLength; i++) {
+-                temp = is.read();
+-                if (temp == -1) {
+-                    eof.flip(0);
+-                    break;
+-                }
+-                buffer[i] = (byte) temp;
+-            }
+-            bufferLength = i;
+-        }
+-        return bufferLength;
+-    }
+ }
+--- old/src/share/classes/com/sun/xml/internal/ws/encoding/MtomCodec.java	Thu Jul 30 18:27:19 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/MtomCodec.java	Thu Jul 30 18:27:19 2009
+@@ -28,8 +28,8 @@
+ import com.sun.istack.internal.NotNull;
+ import com.sun.xml.internal.bind.DatatypeConverterImpl;
+ import com.sun.xml.internal.bind.v2.runtime.output.Encoded;
+-import com.sun.xml.internal.messaging.saaj.packaging.mime.util.OutputUtil;
+ import com.sun.xml.internal.ws.api.SOAPVersion;
++import com.sun.xml.internal.ws.api.WSBinding;
+ 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;
+@@ -38,10 +38,11 @@
+ import com.sun.xml.internal.ws.api.streaming.XMLStreamReaderFactory;
+ import com.sun.xml.internal.ws.api.streaming.XMLStreamWriterFactory;
+ import com.sun.xml.internal.ws.message.MimeAttachmentSet;
+-import com.sun.xml.internal.ws.message.stream.StreamAttachment;
+ import com.sun.xml.internal.ws.util.ByteArrayDataSource;
+ import com.sun.xml.internal.ws.util.xml.XMLStreamReaderFilter;
+ import com.sun.xml.internal.ws.util.xml.XMLStreamWriterFilter;
++import com.sun.xml.internal.ws.streaming.MtomStreamWriter;
++import com.sun.xml.internal.ws.streaming.XMLStreamReaderUtil;
+ 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;
+@@ -56,15 +57,16 @@
+ 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;
+ import java.io.OutputStream;
+ import java.io.UnsupportedEncodingException;
+ import java.net.URLDecoder;
+ import java.nio.channels.WritableByteChannel;
+-import java.nio.charset.Charset;
+ import java.util.ArrayList;
+ import java.util.Iterator;
+ import java.util.List;
++import java.util.Map;
+ import java.util.UUID;
+ 
+ /**
+@@ -71,23 +73,22 @@
+  * Mtom messge Codec. It can be used even for non-soap message's mtom encoding.
+  *
+  * @author Vivek Pandey
++ * @author Jitendra Kotamraju
+  */
+ public class MtomCodec extends MimeCodec {
+     public static final String XOP_XML_MIME_TYPE = "application/xop+xml";
+-    
++
+     private final StreamSOAPCodec codec;
+ 
+     // encoding related parameters
+     private String boundary;
++    private String rootId;
+     private final String soapXopContentType;
+     private String messageContentType;
+     private final MTOMFeature mtomFeature;
+ 
+-    //This is the mtom attachment stream, we should write it just after the root part for decoder
+-    private final List<ByteArrayBuffer> mtomAttachmentStream = new ArrayList<ByteArrayBuffer>();
+-
+-    MtomCodec(SOAPVersion version, StreamSOAPCodec codec, WebServiceFeature mtomFeature){
+-        super(version);
++    MtomCodec(SOAPVersion version, StreamSOAPCodec codec, WSBinding binding, WebServiceFeature mtomFeature){
++        super(version, binding);
+         this.codec = codec;
+         createConteTypeHeader();
+         this.soapXopContentType = XOP_XML_MIME_TYPE +";charset=utf-8;type=\""+version.contentType+"\"";
+@@ -98,14 +99,17 @@
+     }
+ 
+     private void createConteTypeHeader(){
+-        boundary = "uuid:" + UUID.randomUUID().toString();
++        String uuid = UUID.randomUUID().toString();
++        boundary = "uuid:" + uuid;
++        rootId = "<rootpart*"+uuid+"@example.jaxws.sun.com>";
+         String boundaryParameter = "boundary=\"" + boundary +"\"";
+-        messageContentType = MULTIPART_RELATED_MIME_TYPE + 
+-                ";type=\"" + XOP_XML_MIME_TYPE + "\";" + 
+-                boundaryParameter + 
++        messageContentType = MULTIPART_RELATED_MIME_TYPE +
++                ";start=\""+rootId +"\"" +
++                ";type=\"" + XOP_XML_MIME_TYPE + "\";" +
++                boundaryParameter +
+                 ";start-info=\"" + version.contentType + "\"";
+     }
+-    
++
+     /**
+      * Return the soap 1.1 and soap 1.2 specific XOP packaged ContentType
+      *
+@@ -131,21 +135,24 @@
+ 
+     public ContentType encode(Packet packet, OutputStream out) throws IOException {
+         //get the current boundary thaat will be reaturned from this method
+-        mtomAttachmentStream.clear();
+         ContentType contentType = getContentType(packet);
+ 
+         if(packet.getMessage() != null){
+             try {
+-                OutputUtil.writeln("--"+boundary, out);
+-                OutputUtil.writeln("Content-Type: "+ soapXopContentType,  out);
+-                OutputUtil.writeln("Content-Transfer-Encoding: binary", out);
+-                OutputUtil.writeln(out);
+-                MtomStreamWriter writer = new MtomStreamWriter(XMLStreamWriterFactory.create(out),out);
++                writeln("--"+boundary, out);
++                writeln("Content-Id: " + rootId, out);
++                writeln("Content-Type: "+ soapXopContentType,  out);
++                writeln("Content-Transfer-Encoding: binary", out);
++                writeln(out);
++
++                //mtom attachments that need to be written after the root part
++                List<ByteArrayBuffer> mtomAttachments = new ArrayList<ByteArrayBuffer>();
++                MtomStreamWriterImpl writer = new MtomStreamWriterImpl(XMLStreamWriterFactory.create(out),out, mtomAttachments);
+                 packet.getMessage().writeTo(writer);
+                 XMLStreamWriterFactory.recycle(writer);
+-                OutputUtil.writeln(out);
++                writeln(out);
+ 
+-                for(ByteArrayBuffer bos : mtomAttachmentStream){
++                for(ByteArrayBuffer bos : mtomAttachments){
+                     bos.write(out);
+                 }
+ 
+@@ -153,8 +160,8 @@
+                 writeAttachments(packet.getMessage().getAttachments(),out);
+ 
+                 //write out the end boundary
+-                OutputUtil.writeAsAscii("--"+boundary, out);
+-                OutputUtil.writeAsAscii("--", out);
++                writeAsAscii("--"+boundary, out);
++                writeAsAscii("--", out);
+ 
+             } catch (XMLStreamException e) {
+                 throw new WebServiceException(e);
+@@ -177,30 +184,30 @@
+ 
+         void write(OutputStream os) throws IOException {
+             //build attachment frame
+-            OutputUtil.writeln("--"+boundary, os);
++            writeln("--"+boundary, os);
+             writeMimeHeaders(dh.getContentType(), contentId, os);
+             dh.writeTo(os);
+-            OutputUtil.writeln(os);
++            writeln(os);
+         }
+     }
+ 
+     private void writeMimeHeaders(String contentType, String contentId, OutputStream out) throws IOException {
+-        OutputUtil.writeln("Content-Type: " + contentType, out);
+         String cid = contentId;
+         if(cid != null && cid.length() >0 && cid.charAt(0) != '<')
+             cid = '<' + cid + '>';
+-        OutputUtil.writeln("Content-Id: " + cid, out);
+-        OutputUtil.writeln("Content-Transfer-Encoding: binary", out);
+-        OutputUtil.writeln(out);
++        writeln("Content-Id: " + cid, out);
++        writeln("Content-Type: " + contentType, out);
++        writeln("Content-Transfer-Encoding: binary", out);
++        writeln(out);
+     }
+ 
+     private void writeAttachments(AttachmentSet attachments, OutputStream out) throws IOException {
+         for(Attachment att : attachments){
+             //build attachment frame
+-            OutputUtil.writeln("--"+boundary, out);
++            writeln("--"+boundary, out);
+             writeMimeHeaders(att.getContentType(), att.getContentId(), out);
+             att.writeTo(out);
+-            OutputUtil.writeln(out);                    // write \r\n
++            writeln(out);                    // write \r\n
+         }
+     }
+ 
+@@ -209,7 +216,7 @@
+     }
+ 
+     public MtomCodec copy() {
+-        return new MtomCodec(version, (StreamSOAPCodec)codec.copy(), mtomFeature);
++        return new MtomCodec(version, (StreamSOAPCodec)codec.copy(), binding, mtomFeature);
+     }
+ 
+     private String encodeCid(){
+@@ -227,22 +234,20 @@
+             XMLStreamReaderFactory.create(null, mpp.getRootPart().asInputStream(), true)
+         );
+ 
+-        //TODO: remove this code after {@link StreamSOAPCodec#decode} is modified to
+-        //take AttachmentSet.
+-        if(codec instanceof com.sun.xml.internal.ws.encoding.StreamSOAPCodec){
+-            packet.setMessage(((com.sun.xml.internal.ws.encoding.StreamSOAPCodec)codec).decode(mtomReader, new MimeAttachmentSet(mpp)));
+-        }else{
+-            packet.setMessage(codec.decode(mtomReader));
+-        }
++        packet.setMessage(codec.decode(mtomReader, new MimeAttachmentSet(mpp)));
++
+     }
+ 
+-    private class MtomStreamWriter extends XMLStreamWriterFilter implements XMLStreamWriterEx {
++    private class MtomStreamWriterImpl extends XMLStreamWriterFilter implements XMLStreamWriterEx,
++            MtomStreamWriter {
+         private final OutputStream out;
+         private final Encoded encoded = new Encoded();
++        private final List<ByteArrayBuffer> mtomAttachments;
+ 
+-        public MtomStreamWriter(XMLStreamWriter w, OutputStream out) {
++        public MtomStreamWriterImpl(XMLStreamWriter w, OutputStream out, List<ByteArrayBuffer> mtomAttachments) {
+             super(w);
+             this.out = out;
++            this.mtomAttachments = mtomAttachments;
+         }
+ 
+         public void writeBinary(byte[] data, int start, int len, String contentType) throws XMLStreamException {
+@@ -256,9 +261,8 @@
+         }
+ 
+         public void writeBinary(DataHandler dataHandler) throws XMLStreamException {
+-            Base64Data data  = new Base64Data();
+-            data.set(dataHandler);
+-            writeBinary(new ByteArrayBuffer(data.getDataHandler()));
++            // TODO how do we check threshold and if less inline the data
++            writeBinary(new ByteArrayBuffer(dataHandler));
+         }
+ 
+         public OutputStream writeBinary(String contentType) throws XMLStreamException {
+@@ -278,7 +282,7 @@
+ 
+         private void writeBinary(ByteArrayBuffer bab) {
+             try {
+-                mtomAttachmentStream.add(bab);
++                mtomAttachments.add(bab);
+ 
+                 writer.writeCharacters("");   // Force completion of open elems
+                 writer.flush();
+@@ -285,10 +289,8 @@
+                 //flush the underlying writer to write-out any cached data to the underlying
+                 // stream before writing directly to it
+                 //write out the xop reference
+-                out.write(XOP_PREF);
+-                encoded.set(bab.contentId);
++                encoded.set(XOP_PREF+bab.contentId+XOP_SUFF);
+                 out.write(encoded.buf,0,encoded.len);
+-                out.write(XOP_SUFF);
+             } catch (IOException e) {
+                 throw new WebServiceException(e);
+             } catch (XMLStreamException e) {
+@@ -296,6 +298,57 @@
+             }
+         }
+ 
++        @Override
++        public Object getProperty(String name) throws IllegalArgumentException {
++            // Hack for JDK6's SJSXP
++            if (name.equals("sjsxp-outputstream") && writer instanceof Map) {
++                Object obj = ((Map) writer).get("sjsxp-outputstream");
++                if (obj != null) {
++                    return obj;
++                }
++            }
++            return super.getProperty(name);
++        }
++
++        /**
++         * JAXBMessage writes envelope directly to the OutputStream(for SJSXP, woodstox).
++         * While writing, it calls the AttachmentMarshaller methods for adding attachments.
++         * JAXB writes xop:Include in this case.
++         */
++        public AttachmentMarshaller getAttachmentMarshaller() {
++            return new AttachmentMarshaller() {
++
++                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);
++                    mtomAttachments.add(bab);
++                    return "cid:"+bab.contentId;
++                }
++
++                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) {
++                        return null;                // JAXB inlines the attachment data
++                    }
++                    ByteArrayBuffer bab = new ByteArrayBuffer(new DataHandler(new ByteArrayDataSource(data, offset, length, mimeType)));
++                    mtomAttachments.add(bab);
++                    return "cid:"+bab.contentId;
++                }
++
++                public String addSwaRefAttachment(DataHandler data) {
++                    ByteArrayBuffer bab = new ByteArrayBuffer(data);
++                    mtomAttachments.add(bab);
++                    return "cid:"+bab.contentId;
++                }
++
++                @Override
++                public boolean isXOPPackage() {
++                    return true;
++                }
++            };
++        }
++
+         private class MtomNamespaceContextEx implements NamespaceContextEx {
+             private NamespaceContext nsContext;
+ 
+@@ -320,6 +373,7 @@
+             }
+         }
+ 
++        @Override
+         public NamespaceContextEx getNamespaceContext() {
+             NamespaceContext nsContext = writer.getNamespaceContext();
+             return new MtomNamespaceContextEx(nsContext);
+@@ -335,10 +389,6 @@
+         private boolean xopReferencePresent = false;
+         private Base64Data base64AttData;
+ 
+-        //values that will set to whether mtom or not as caller can call getPcData or getTextCharacters
+-        private int textLength;
+-        private int textStart;
+-
+         //To be used with #getTextCharacters
+         private char[] base64EncodedText;
+ 
+@@ -357,8 +407,6 @@
+         public NamespaceContextEx getNamespaceContext() {
+             NamespaceContext nsContext = reader.getNamespaceContext();
+             return new MtomNamespaceContextEx(nsContext);
+-
+-
+         }
+ 
+         public String getElementTextTrim() throws XMLStreamException {
+@@ -365,7 +413,7 @@
+             throw new UnsupportedOperationException();
+         }
+ 
+-        private class MtomNamespaceContextEx implements NamespaceContextEx {
++        private static class MtomNamespaceContextEx implements NamespaceContextEx {
+             private NamespaceContext nsContext;
+ 
+             public MtomNamespaceContextEx(NamespaceContext nsContext) {
+@@ -391,15 +439,16 @@
+         }
+ 
+         public int getTextLength() {
+-            if (xopReferencePresent)
+-                return textLength;
++            if (xopReferencePresent) {
++                return base64AttData.length();
++            }
+             return reader.getTextLength();
+         }
+ 
+         public int getTextStart() {
+-            //TODO: check if this is correct
+-            if (xopReferencePresent)
++            if (xopReferencePresent) {
+                 return 0;
++            }
+             return reader.getTextStart();
+         }
+ 
+@@ -411,33 +460,25 @@
+ 
+         public int next() throws XMLStreamException {
+             int event = reader.next();
+-            if ((event == XMLStreamConstants.START_ELEMENT) && reader.getLocalName().equals(XOP_LOCALNAME) && reader.getNamespaceURI().equals(XOP_NAMESPACEURI))
+-            {
++            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 {
+-                    StreamAttachment att = getAttachment(href);
++                    Attachment att = getAttachment(href);
+                     if(att != null){
+-                        base64AttData = att.asBase64Data();
+-                        textLength = base64AttData.getDataLen();
++                        base64AttData = new Base64Data();
++                        base64AttData.set(att.asDataHandler());
+                     }
+-                    textStart = 0;
+                     xopReferencePresent = true;
+                 } catch (IOException e) {
+                     throw new WebServiceException(e);
+                 }
+                 //move to the </xop:Include>
+-                try {
+-                    reader.next();
+-                } catch (XMLStreamException e) {
+-                    throw new WebServiceException(e);
+-                }
++                XMLStreamReaderUtil.nextElementContent(reader);
+                 return XMLStreamConstants.CHARACTERS;
+             }
+             if(xopReferencePresent){
+                 xopReferencePresent = false;
+-                textStart = 0;
+-                textLength = 0;
+                 base64EncodedText = null;
+             }
+             return event;
+@@ -448,36 +489,18 @@
+                 cid = URLDecoder.decode(cid, "utf-8");
+             } catch (UnsupportedEncodingException e) {
+                 //on recceiving side lets not fail now, try to look for it
+-                return cid;
+             }
+             return cid;
+         }
+ 
+-        private boolean needToDecode(String cid){
+-            int numChars = cid.length();
+-            int i=0;
+-            char c;
+-            while (i < numChars) {
+-                c = cid.charAt(i++);
+-                switch (c) {
+-                    case '%':
+-                        return true;
+-                }
+-            }
+-            return false;
+-        }
+-
+-
+-        private StreamAttachment getAttachment(String cid) throws IOException {
++        private Attachment getAttachment(String cid) throws IOException {
+             if (cid.startsWith("cid:"))
+                 cid = cid.substring(4, cid.length());
+-            StreamAttachment att = mimeMP.getAttachmentPart(cid);
+-            if(att == null && needToDecode(cid)){
+-                //try not be url decoding it - this is required for Indigo interop, they write content-id without escaping
++            if (cid.indexOf('%') != -1) {
+                 cid = decodeCid(cid);
+                 return mimeMP.getAttachmentPart(cid);
+             }
+-            return att;
++            return mimeMP.getAttachmentPart(cid);
+         }
+ 
+         public char[] getTextCharacters() {
+@@ -484,7 +507,6 @@
+             if (xopReferencePresent) {
+                 char[] chars = new char[base64AttData.length()];
+                 base64AttData.writeTo(chars, 0);
+-                textLength = chars.length;
+                 return chars;
+             }
+             return reader.getTextCharacters();
+@@ -492,12 +514,6 @@
+ 
+         public int getTextCharacters(int sourceStart, char[] target, int targetStart, int length) throws XMLStreamException {
+             if(xopReferencePresent){
+-                int event = reader.getEventType();
+-                if(event != XMLStreamConstants.CHARACTERS){
+-                    //its invalid state - delegate it to underlying reader to throw the corrrect exception so that user
+-                    // always sees the uniform exception from the XMLStreamReader
+-                    throw new XMLStreamException("Invalid state: Expected CHARACTERS found :");
+-                }
+                 if(target == null){
+                     throw new NullPointerException("target char array can't be null") ;
+                 }
+@@ -507,26 +523,17 @@
+                     throw new IndexOutOfBoundsException();
+                 }
+ 
+-                if(base64EncodedText != null){
++                int textLength = base64AttData.length();
++                if(sourceStart > textLength)
++                    throw new IndexOutOfBoundsException();
++
++                if(base64EncodedText == null){
+                     base64EncodedText = new char[base64AttData.length()];
+                     base64AttData.writeTo(base64EncodedText, 0);
+-                    textLength = base64EncodedText.length;
+-                    textStart = 0;
+                 }
+ 
+-                if((textStart + sourceStart) > textLength)
+-                    throw new IndexOutOfBoundsException();
+-
+-                int available = textLength - sourceStart;
+-                if(available < 0){
+-                    throw new IndexOutOfBoundsException("sourceStart is greater than" +
+-                            "number of characters associated with this event");
+-                }
+-
+-                int copiedLength = Math.min(available,length);
+-
+-                System.arraycopy(base64EncodedText, getTextStart() + sourceStart , target, targetStart, copiedLength);
+-                textStart = sourceStart;
++                int copiedLength = Math.min(textLength - sourceStart, length);
++                System.arraycopy(base64EncodedText, sourceStart , target, targetStart, copiedLength);
+                 return copiedLength;
+             }
+             return reader.getTextCharacters(sourceStart, target, targetStart, length);
+@@ -534,27 +541,15 @@
+ 
+         public String getText() {
+             if (xopReferencePresent) {
+-                String text =  base64AttData.toString();
+-                textLength = text.length();
++                return base64AttData.toString();
+             }
+             return reader.getText();
+         }
+     }
+ 
+-    private static final byte[] XOP_PREF = encode("<Include xmlns=\"http://www.w3.org/2004/08/xop/include\" href=\"cid:");
+-
+-    private static byte[] encode(String str) {
+-        try {
+-            return str.getBytes("UTF-8");
+-        } catch (UnsupportedEncodingException e) {
+-            throw new Error(e);
+-        }
+-    }
+-
+-    private static final byte[] XOP_SUFF = encode("\"/>");
++    private static final String XOP_PREF = "<Include xmlns=\"http://www.w3.org/2004/08/xop/include\" href=\"cid:";
++    private static final String XOP_SUFF = "\"/>";
+     private static final String XOP_LOCALNAME = "Include";
+     private static final String XOP_NAMESPACEURI = "http://www.w3.org/2004/08/xop/include";
+ 
+-
+-    private static final Charset UTF8 = Charset.forName("UTF-8");
+ }
+--- old/src/share/classes/com/sun/xml/internal/ws/encoding/SOAPBindingCodec.java	Thu Jul 30 18:27:23 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/SOAPBindingCodec.java	Thu Jul 30 18:27:22 2009
+@@ -25,41 +25,34 @@
+ 
+ package com.sun.xml.internal.ws.encoding;
+ 
+-import java.io.IOException;
+-import java.io.InputStream;
+-import java.io.OutputStream;
+-import java.lang.reflect.Method;
+-import java.nio.channels.ReadableByteChannel;
+-import java.nio.channels.WritableByteChannel;
+-import java.util.StringTokenizer;
+-
+-import javax.xml.namespace.QName;
+-import javax.xml.soap.SOAPException;
+-import javax.xml.soap.SOAPFault;
+-import javax.xml.ws.WebServiceFeature;
+-import javax.xml.ws.soap.MTOMFeature;
+-
+ import com.sun.xml.internal.ws.api.SOAPVersion;
+ import com.sun.xml.internal.ws.api.WSBinding;
+ import com.sun.xml.internal.ws.api.client.SelectOptimalEncodingFeature;
+ import com.sun.xml.internal.ws.api.fastinfoset.FastInfosetFeature;
+-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.Messages;
+ import com.sun.xml.internal.ws.api.message.Packet;
++import com.sun.xml.internal.ws.api.message.ExceptionHasMessage;
+ import com.sun.xml.internal.ws.api.pipe.Codec;
++import com.sun.xml.internal.ws.api.pipe.Codecs;
+ import com.sun.xml.internal.ws.api.pipe.ContentType;
+ import com.sun.xml.internal.ws.api.pipe.StreamSOAPCodec;
+-import com.sun.xml.internal.ws.api.pipe.Codecs;
+ import com.sun.xml.internal.ws.binding.SOAPBindingImpl;
+ import com.sun.xml.internal.ws.client.ContentNegotiation;
+-import com.sun.xml.internal.ws.resources.ServerMessages;
++import com.sun.xml.internal.ws.protocol.soap.MessageCreationException;
+ import com.sun.xml.internal.ws.resources.StreamingMessages;
+-import com.sun.xml.internal.ws.server.ServerRtException;
+ import com.sun.xml.internal.ws.server.UnsupportedMediaException;
+-import com.sun.xml.internal.ws.transport.http.WSHTTPConnection;
+ 
++import javax.xml.ws.WebServiceException;
++import javax.xml.ws.WebServiceFeature;
++import javax.xml.ws.soap.MTOMFeature;
++import java.io.IOException;
++import java.io.InputStream;
++import java.io.OutputStream;
++import java.lang.reflect.Method;
++import java.nio.channels.ReadableByteChannel;
++import java.nio.channels.WritableByteChannel;
++import java.util.StringTokenizer;
++
+ /**
+  * SOAP binding {@link Codec} that can handle MTOM, SwA, and SOAP messages
+  * encoded using XML or Fast Infoset.
+@@ -82,7 +75,7 @@
+      */
+     private static final String BASE_ACCEPT_VALUE =
+             "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2";
+-    
++
+     /**
+      * True if Fast Infoset functionality has been
+      * configured to be disabled, or the Fast Infoset
+@@ -89,12 +82,12 @@
+      * runtime is not available.
+      */
+     private boolean isFastInfosetDisabled;
+-    
++
+     /**
+      * True if the Fast Infoset codec should be used for encoding.
+      */
+     private boolean useFastInfosetForEncoding;
+-    
++
+     /**
+      * True if the content negotiation property should
+      * be ignored by the client. This will be used in
+@@ -102,52 +95,52 @@
+      * disabled or automatically selected.
+      */
+     private boolean ignoreContentNegotiationProperty;
+-    
++
+     // The XML SOAP codec
+     private final StreamSOAPCodec xmlSoapCodec;
+-    
++
+     // The Fast Infoset SOAP codec
+     private final Codec fiSoapCodec;
+-    
++
+     // The XML MTOM codec
+     private final MimeCodec xmlMtomCodec;
+-    
++
+     // The XML SWA codec
+     private final MimeCodec xmlSwaCodec;
+-    
++
+     // The Fast Infoset SWA codec
+     private final MimeCodec fiSwaCodec;
+-    
++
+     private final SOAPBindingImpl binding;
+-    
++
+     /**
+      * The XML SOAP MIME type
+      */
+     private final String xmlMimeType;
+-    
++
+     /**
+      * The Fast Infoset SOAP MIME type
+      */
+     private final String fiMimeType;
+-    
++
+     /**
+      * The Accept header for XML encodings
+      */
+     private final String xmlAccept;
+-    
++
+     /**
+      * The Accept header for Fast Infoset and XML encodings
+      */
+     private final String connegXmlAccept;
+-    
++
+     public StreamSOAPCodec getXMLCodec() {
+         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;
+@@ -157,40 +150,40 @@
+             _c = c;
+             return this;
+         }
+-        
++
+         public String getContentType() {
+             return _c.getContentType();
+         }
+-        
++
+         public String getSOAPActionHeader() {
+             return _c.getSOAPActionHeader();
+         }
+-        
++
+         public String getAcceptHeader() {
+             return _accept;
+         }
+     }
+-    
++
+     private AcceptContentType _adaptingContentType = new AcceptContentType();
+-    
++
+     public SOAPBindingCodec(WSBinding binding) {
+         this(binding, Codecs.createSOAPEnvelopeXmlCodec(binding.getSOAPVersion()));
+     }
+-    
++
+     public SOAPBindingCodec(WSBinding binding, StreamSOAPCodec xmlSoapCodec) {
+-        super(binding.getSOAPVersion());
+-        
++        super(binding.getSOAPVersion(), binding);
++
+         this.xmlSoapCodec = xmlSoapCodec;
+         xmlMimeType = xmlSoapCodec.getMimeType();
+-        
+-        xmlMtomCodec = new MtomCodec(version, xmlSoapCodec, binding.getFeature(MTOMFeature.class));
+-        
+-        xmlSwaCodec = new SwACodec(version, xmlSoapCodec);
+-        
++
++        xmlMtomCodec = new MtomCodec(version, xmlSoapCodec, binding, binding.getFeature(MTOMFeature.class));
++
++        xmlSwaCodec = new SwACodec(version, binding, xmlSoapCodec);
++
+         String clientAcceptedContentTypes = xmlSoapCodec.getMimeType() + ", " +
+                 xmlMtomCodec.getMimeType() + ", " +
+                 BASE_ACCEPT_VALUE;
+-        
++
+         WebServiceFeature fi = binding.getFeature(FastInfosetFeature.class);
+         isFastInfosetDisabled = (fi != null && !fi.isEnabled());
+         if (!isFastInfosetDisabled) {
+@@ -197,9 +190,9 @@
+             fiSoapCodec = getFICodec(xmlSoapCodec, version);
+             if (fiSoapCodec != null) {
+                 fiMimeType = fiSoapCodec.getMimeType();
+-                fiSwaCodec = new SwACodec(version, fiSoapCodec);
++                fiSwaCodec = new SwACodec(version, binding, fiSoapCodec);
+                 connegXmlAccept = fiMimeType + ", " + clientAcceptedContentTypes;
+-                
++
+                 /**
+                  * This feature will only be present on the client side.
+                  *
+@@ -214,7 +207,7 @@
+                         if (fi != null) {  // if server's FI feature also enabled
+                             useFastInfosetForEncoding = true;
+                         }
+-                        
++
+                         clientAcceptedContentTypes = connegXmlAccept;
+                     } else {  // If client FI feature is disabled
+                         isFastInfosetDisabled = true;
+@@ -235,34 +228,36 @@
+             connegXmlAccept = clientAcceptedContentTypes;
+             ignoreContentNegotiationProperty = true;
+         }
+-        
++
+         xmlAccept = clientAcceptedContentTypes;
+-        
++
++        if(!(binding instanceof SOAPBindingImpl))
++            throw new WebServiceException("Expecting a SOAP binding but found "+binding);
+         this.binding = (SOAPBindingImpl)binding;
+     }
+-    
++
+     public String getMimeType() {
+         return null;
+     }
+-    
++
+     public ContentType getStaticContentType(Packet packet) {
+         ContentType toAdapt = getEncoder(packet).getStaticContentType(packet);
+         return (toAdapt != null) ? _adaptingContentType.set(packet, toAdapt) : null;
+     }
+-    
++
+     public ContentType encode(Packet packet, OutputStream out) throws IOException {
+         return _adaptingContentType.set(packet, getEncoder(packet).encode(packet, out));
+     }
+-    
++
+     public ContentType encode(Packet packet, WritableByteChannel buffer) {
+         return _adaptingContentType.set(packet, getEncoder(packet).encode(packet, buffer));
+     }
+-    
++
+     public void decode(InputStream in, String contentType, Packet packet) throws IOException {
+         if (contentType == null) {
+             throw new UnsupportedMediaException();
+         }
+-        
++
+         /**
+          * Reset the encoding state when on the server side for each
+          * decode/encode step.
+@@ -269,24 +264,30 @@
+          */
+         if (packet.contentNegotiation == null)
+             useFastInfosetForEncoding = false;
+-        
+-        if(isMultipartRelated(contentType))
+-            // parse the multipart portion and then decide whether it's MTOM or SwA
+-            super.decode(in, contentType, packet);
+-        else if(isFastInfoset(contentType)) {
+-            if (!ignoreContentNegotiationProperty && packet.contentNegotiation == ContentNegotiation.none)
+-                throw noFastInfosetForDecoding();
+-            
+-            useFastInfosetForEncoding = true;
+-            fiSoapCodec.decode(in, contentType, packet);
+-        } else
+-            xmlSoapCodec.decode(in, contentType, packet);
+-        
++        try {
++            if(isMultipartRelated(contentType))
++                // parse the multipart portion and then decide whether it's MTOM or SwA
++                super.decode(in, contentType, packet);
++            else if(isFastInfoset(contentType)) {
++                if (!ignoreContentNegotiationProperty && packet.contentNegotiation == ContentNegotiation.none)
++                    throw noFastInfosetForDecoding();
++
++                useFastInfosetForEncoding = true;
++                fiSoapCodec.decode(in, contentType, packet);
++            } else
++                xmlSoapCodec.decode(in, contentType, packet);
++        } catch(RuntimeException we) {
++            if (we instanceof ExceptionHasMessage || we instanceof UnsupportedMediaException) {
++                throw we;
++            } else {
++                throw new MessageCreationException(binding.getSOAPVersion(), we);
++            }
++        }
+         if (!useFastInfosetForEncoding) {
+             useFastInfosetForEncoding = isFastInfosetAcceptable(packet.acceptableMimeTypes);
+         }
+     }
+-    
++
+     public void decode(ReadableByteChannel in, String contentType, Packet packet) {
+         if (contentType == null) {
+             throw new UnsupportedMediaException();
+@@ -297,39 +298,44 @@
+          */
+         if (packet.contentNegotiation == null)
+             useFastInfosetForEncoding = false;
+-        
+-        if(isMultipartRelated(contentType))
+-            super.decode(in, contentType, packet);
+-        else if(isFastInfoset(contentType)) {
+-            if (packet.contentNegotiation == ContentNegotiation.none)
+-                throw noFastInfosetForDecoding();
+-            
+-            useFastInfosetForEncoding = true;
+-            fiSoapCodec.decode(in, contentType, packet);
+-        } else
+-            xmlSoapCodec.decode(in, contentType, packet);
+-        
+-//        checkDuplicateKnownHeaders(packet);
++        try {
++            if(isMultipartRelated(contentType))
++                super.decode(in, contentType, packet);
++            else if(isFastInfoset(contentType)) {
++                if (packet.contentNegotiation == ContentNegotiation.none)
++                    throw noFastInfosetForDecoding();
++
++                useFastInfosetForEncoding = true;
++                fiSoapCodec.decode(in, contentType, packet);
++            } else
++                xmlSoapCodec.decode(in, contentType, packet);
++        } catch(RuntimeException we) {
++            if (we instanceof ExceptionHasMessage || we instanceof UnsupportedMediaException) {
++                throw we;
++            } else {
++                throw new MessageCreationException(binding.getSOAPVersion(), we);
++            }
++        }
+         if (!useFastInfosetForEncoding) {
+             useFastInfosetForEncoding = isFastInfosetAcceptable(packet.acceptableMimeTypes);
+         }
+     }
+-    
++
+     public SOAPBindingCodec copy() {
+         return new SOAPBindingCodec(binding, (StreamSOAPCodec)xmlSoapCodec.copy());
+     }
+-    
++
+     @Override
+     protected void decode(MimeMultipartParser mpp, Packet packet) throws IOException {
+         // is this SwA or XOP?
+         final String rootContentType = mpp.getRootPart().getContentType();
+-        
++
+         if(isApplicationXopXml(rootContentType))
+             xmlMtomCodec.decode(mpp,packet);
+         else if (isFastInfoset(rootContentType)) {
+             if (packet.contentNegotiation == ContentNegotiation.none)
+                 throw noFastInfosetForDecoding();
+-            
++
+             useFastInfosetForEncoding = true;
+             fiSwaCodec.decode(mpp,packet);
+         } else if (isXml(rootContentType))
+@@ -340,25 +346,25 @@
+         }
+ //        checkDuplicateKnownHeaders(packet);
+     }
+-    
++
+     private boolean isMultipartRelated(String contentType) {
+         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, xmlMimeType);
+     }
+-    
++
+     private boolean isFastInfoset(String contentType) {
+         if (isFastInfosetDisabled) return false;
+-        
++
+         return compareStrings(contentType, fiMimeType);
+     }
+-    
++
+     private boolean compareStrings(String a, String b) {
+         return a.length() >= b.length() &&
+                 b.equalsIgnoreCase(
+@@ -365,10 +371,10 @@
+                 a.substring(0,
+                 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();
+@@ -378,7 +384,7 @@
+         }
+         return false;
+     }
+-    
++
+     /**
+      * Determines the encoding codec.
+      */
+@@ -398,7 +404,7 @@
+                 useFastInfosetForEncoding = true;
+             }
+         }
+-        
++
+         // Override the MTOM binding for now
+         // Note: Using FI with MTOM does not make sense
+         if (useFastInfosetForEncoding) {
+@@ -408,10 +414,10 @@
+             else
+                 return fiSwaCodec;
+         }
+-        
++
+         if(binding.isFeatureEnabled(MTOMFeature.class))
+             return xmlMtomCodec;
+-        
++
+         Message m = p.getMessage();
+         if(m==null || m.getAttachments().isEmpty())
+             return xmlSoapCodec;
+@@ -418,11 +424,11 @@
+         else
+             return xmlSwaCodec;
+     }
+-    
++
+     private RuntimeException noFastInfosetForDecoding() {
+         return new RuntimeException(StreamingMessages.FASTINFOSET_DECODING_NOT_ACCEPTED());
+     }
+-    
++
+     /**
+      * Obtain an FI SOAP codec instance using reflection.
+      */
+--- old/src/share/classes/com/sun/xml/internal/ws/encoding/StreamSOAP11Codec.java	Thu Jul 30 18:27:27 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/StreamSOAP11Codec.java	Thu Jul 30 18:27:26 2009
+@@ -42,7 +42,7 @@
+  */
+ final class StreamSOAP11Codec extends StreamSOAPCodec {
+     public static final String SOAP11_MIME_TYPE = "text/xml";
+-    public static final String SOAP11_CONTENT_TYPE = SOAP11_MIME_TYPE+"; charset=utf-8";
++    public static final String SOAP11_CONTENT_TYPE = SOAP11_MIME_TYPE+";charset=\"utf-8\"";
+ 
+     private static final List<String> expectedContentTypes = Collections.singletonList(SOAP11_MIME_TYPE);
+ 
+@@ -53,7 +53,7 @@
+     public String getMimeType() {
+         return SOAP11_MIME_TYPE;
+     }
+-    
++
+     @Override
+     protected final StreamHeader createHeader(XMLStreamReader reader, XMLStreamBuffer mark) {
+         return new StreamHeader11(reader, mark);
+--- old/src/share/classes/com/sun/xml/internal/ws/encoding/StreamSOAP12Codec.java	Thu Jul 30 18:27:30 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/StreamSOAP12Codec.java	Thu Jul 30 18:27:29 2009
+@@ -42,7 +42,7 @@
+  */
+ final class StreamSOAP12Codec extends StreamSOAPCodec {
+     public static final String SOAP12_MIME_TYPE = "application/soap+xml";
+-    public static final String SOAP12_CONTENT_TYPE = SOAP12_MIME_TYPE+"; charset=utf-8";
++    public static final String SOAP12_CONTENT_TYPE = SOAP12_MIME_TYPE+";charset=\"utf-8\"";
+ 
+     private static final List<String> expectedContentTypes = Collections.singletonList(SOAP12_MIME_TYPE);
+ 
+@@ -53,7 +53,7 @@
+     public String getMimeType() {
+         return SOAP12_MIME_TYPE;
+     }
+-    
++
+     @Override
+     protected final StreamHeader createHeader(XMLStreamReader reader, XMLStreamBuffer mark) {
+         return new StreamHeader12(reader, mark);
+--- old/src/share/classes/com/sun/xml/internal/ws/encoding/StreamSOAPCodec.java	Thu Jul 30 18:27:34 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/StreamSOAPCodec.java	Thu Jul 30 18:27:33 2009
+@@ -56,6 +56,7 @@
+ import java.io.OutputStream;
+ import java.nio.channels.ReadableByteChannel;
+ import java.nio.channels.WritableByteChannel;
++import java.nio.charset.Charset;
+ import java.util.HashMap;
+ import java.util.List;
+ import java.util.Map;
+@@ -66,7 +67,7 @@
+  * @author Paul Sandoz
+  */
+ @SuppressWarnings({"StringEquality"})
+-public abstract class StreamSOAPCodec implements com.sun.xml.internal.ws.api.pipe.StreamSOAPCodec {
++public abstract class StreamSOAPCodec implements com.sun.xml.internal.ws.api.pipe.StreamSOAPCodec, RootOnlyCodec {
+ 
+     private static final String SOAP_ENVELOPE = "Envelope";
+     private static final String SOAP_HEADER = "Header";
+@@ -114,14 +115,7 @@
+     protected abstract List<String> getExpectedContentTypes();
+ 
+     public void decode(InputStream in, String contentType, Packet packet) throws IOException {
+-        List<String> expectedContentTypes = getExpectedContentTypes();
+-        if (contentType != null && !isContentTypeSupported(contentType,expectedContentTypes)) {
+-            throw new UnsupportedMediaException(contentType, expectedContentTypes);
+-        }
+-        // TODO: we should definitely let Decode owns one XMLStreamReader instance
+-        // instead of going to this generic factory
+-        XMLStreamReader reader = new TidyXMLStreamReader(XMLStreamReaderFactory.create(null, in, true), in);
+-        packet.setMessage(decode(reader));
++        decode(in, contentType, packet, new AttachmentSetImpl());
+     }
+ 
+     /*
+@@ -178,6 +172,9 @@
+ 
+         // Collect namespaces on soap:Envelope
+         Map<String,String> namespaces = new HashMap<String,String>();
++        for(int i=0; i< reader.getNamespaceCount();i++){
++                namespaces.put(reader.getNamespacePrefix(i), reader.getNamespaceURI(i));
++        }
+ 
+         // Move to next element
+         XMLStreamReaderUtil.nextElementContent(reader);
+@@ -281,8 +278,25 @@
+         return new MutableXMLStreamBuffer();
+     }
+ 
++    public void decode(InputStream in, String contentType, Packet packet, AttachmentSet att ) throws IOException {
++        List<String> expectedContentTypes = getExpectedContentTypes();
++        if (contentType != null && !isContentTypeSupported(contentType,expectedContentTypes)) {
++            throw new UnsupportedMediaException(contentType, expectedContentTypes);
++        }
++        String charset = new ContentTypeImpl(contentType).getCharSet();
++        if (charset != null && !Charset.isSupported(charset)) {
++            throw new UnsupportedMediaException(charset);
++        }
++        XMLStreamReader reader = XMLStreamReaderFactory.create(null, in, charset, true);
++        reader =  new TidyXMLStreamReader(reader, in);
++        packet.setMessage(decode(reader, att));
++    }
+ 
++    public void decode(ReadableByteChannel in, String contentType, Packet response, AttachmentSet att ) {
++        throw new UnsupportedOperationException();
++    }
+ 
++
+ 
+     /**
+      * Creates a new {@link StreamSOAPCodec} instance.
+--- old/src/share/classes/com/sun/xml/internal/ws/encoding/SwACodec.java	Thu Jul 30 18:27:37 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/SwACodec.java	Thu Jul 30 18:27:36 2009
+@@ -26,10 +26,13 @@
+ package com.sun.xml.internal.ws.encoding;
+ 
+ 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.message.Attachment;
+ import com.sun.xml.internal.ws.api.pipe.Codec;
+ import com.sun.xml.internal.ws.api.pipe.ContentType;
+ import com.sun.xml.internal.ws.message.stream.StreamAttachment;
++import com.sun.xml.internal.ws.message.MimeAttachmentSet;
+ 
+ import java.io.IOException;
+ import java.nio.channels.WritableByteChannel;
+@@ -42,8 +45,8 @@
+  */
+ public final class SwACodec extends MimeCodec {
+ 
+-    public SwACodec(SOAPVersion version, Codec rootCodec) {
+-        super(version);
++    public SwACodec(SOAPVersion version, WSBinding binding, Codec rootCodec) {
++        super(version, binding);
+         this.rootCodec = rootCodec;
+     }
+ 
+@@ -55,11 +58,15 @@
+     @Override
+     protected void decode(MimeMultipartParser mpp, Packet packet) throws IOException {
+         // TODO: handle attachments correctly
+-        StreamAttachment root = mpp.getRootPart();
+-        rootCodec.decode(root.asInputStream(),root.getContentType(),packet);
+-        Map<String, StreamAttachment> atts = mpp.getAttachmentParts();
+-        for(Map.Entry<String, StreamAttachment> att : atts.entrySet()) {
+-            packet.getMessage().getAttachments().add(att.getValue());
++        Attachment root = mpp.getRootPart();
++        if (rootCodec instanceof RootOnlyCodec) {
++            ((RootOnlyCodec)rootCodec).decode(root.asInputStream(),root.getContentType(),packet, new MimeAttachmentSet(mpp));
++        } else {
++            rootCodec.decode(root.asInputStream(),root.getContentType(),packet);
++            Map<String, Attachment> atts = mpp.getAttachmentParts();
++            for(Map.Entry<String, Attachment> att : atts.entrySet()) {
++                packet.getMessage().getAttachments().add(att.getValue());
++            }
+         }
+     }
+ 
+--- old/src/share/classes/com/sun/xml/internal/ws/encoding/TagInfoset.java	Thu Jul 30 18:27:41 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/TagInfoset.java	Thu Jul 30 18:27:40 2009
+@@ -59,6 +59,8 @@
+     /**
+      * Namespace declarations on this tag. Read-only.
+      *
++     * This is an array of the even length of the form { prefix0, uri0, prefix1, uri1, ... }.
++     *
+      * URIs/prefixes can be null (StAX-style)
+      */
+     public final @NotNull String[] ns;
+@@ -169,12 +171,15 @@
+      * Writes the start element event.
+      */
+     public void writeStart(XMLStreamWriter w) throws XMLStreamException {
+-        // write start tag. Arrrgggghhh!!
++        // write start tag.
+         if(prefix==null) {
+             if(nsUri==null)
+                 w.writeStartElement(localName);
+-            else
+-                w.writeStartElement(nsUri,localName);
++            else {
++                //fix Null prefix. otherwise throws XMLStreamException,
++                // if the namespace URI has not been bound to a prefix
++                w.writeStartElement("",localName,nsUri);
++            }
+         } else {
+             w.writeStartElement(prefix,localName,nsUri);
+         }
+--- old/src/share/classes/com/sun/xml/internal/ws/encoding/XMLHTTPBindingCodec.java	Thu Jul 30 18:27:44 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/XMLHTTPBindingCodec.java	Thu Jul 30 18:27:43 2009
+@@ -25,13 +25,13 @@
+ 
+ package com.sun.xml.internal.ws.encoding;
+ 
+-import com.sun.xml.internal.messaging.saaj.util.ByteOutputStream;
+ 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.message.Messages;
+ import com.sun.xml.internal.ws.api.pipe.Codec;
+ import com.sun.xml.internal.ws.api.pipe.ContentType;
+ import com.sun.xml.internal.ws.client.ContentNegotiation;
++import com.sun.xml.internal.ws.developer.StreamingAttachmentFeature;
+ import com.sun.xml.internal.ws.encoding.xml.XMLCodec;
+ import com.sun.xml.internal.ws.encoding.xml.XMLMessage;
+ import com.sun.xml.internal.ws.encoding.xml.XMLMessage.MessageDataSource;
+@@ -38,6 +38,7 @@
+ import com.sun.xml.internal.ws.encoding.xml.XMLMessage.UnknownContent;
+ import com.sun.xml.internal.ws.encoding.xml.XMLMessage.XMLMultiPart;
+ import com.sun.xml.internal.ws.resources.StreamingMessages;
++import com.sun.xml.internal.ws.util.ByteArrayBuffer;
+ 
+ import javax.activation.DataSource;
+ import javax.xml.ws.WebServiceException;
+@@ -68,7 +69,7 @@
+      */
+     private static final String APPLICATION_FAST_INFOSET_MIME_TYPE =
+         "application/fastinfoset";
+-    
++
+     /**
+      * True if the Fast Infoset codec should be used
+      */
+@@ -78,29 +79,29 @@
+      * The XML codec
+      */
+     private final Codec xmlCodec;
+-    
++
+     /**
+      * The FI codec
+      */
+     private final Codec fiCodec;
+-    
++
+     /**
+      * The Accept header for XML encodings
+      */
+     private final String xmlAccept;
+-    
++
+     /**
+      * The Accept header for Fast Infoset and XML encodings
+      */
+     private final String fiXmlAccept;
+-    
++
+     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 
++            if (p.contentNegotiation == ContentNegotiation.optimistic
+                     || p.contentNegotiation == ContentNegotiation.pessimistic) {
+                 _accept = fiXmlAccept;
+             } else {
+@@ -109,43 +110,43 @@
+             _c = c;
+             return this;
+         }
+-        
++
+         public String getContentType() {
+             return _c.getContentType();
+         }
+-        
++
+         public String getSOAPActionHeader() {
+             return _c.getSOAPActionHeader();
+         }
+-        
++
+         public String getAcceptHeader() {
+             return _accept;
+         }
+     }
+-    
++
+     private AcceptContentType _adaptingContentType = new AcceptContentType();
+-    
+-    public XMLHTTPBindingCodec() {
+-        super(SOAPVersion.SOAP_11);
+-        
+-        xmlCodec = new XMLCodec();
+-        
++
++    public XMLHTTPBindingCodec(WSBinding binding) {
++        super(SOAPVersion.SOAP_11, binding);
++
++        xmlCodec = new XMLCodec(binding);
++
+         fiCodec = getFICodec();
+-        
++
+         xmlAccept = null;
+-        
++
+         fiXmlAccept = APPLICATION_FAST_INFOSET_MIME_TYPE + ", " +
+                 BASE_ACCEPT_VALUE;
+     }
+-    
++
+     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();
+@@ -152,27 +153,27 @@
+             if (mds.hasUnconsumedDataSource()) {
+                 ct = getStaticContentType(mds);
+                 return (ct != null)
+-                    ? _adaptingContentType.set(packet, ct) 
++                    ? _adaptingContentType.set(packet, ct)
+                     : null;
+             }
+         }
+-        
+-        ct = super.getStaticContentType(packet);            
++
++        ct = super.getStaticContentType(packet);
+         return (ct != null)
+-            ? _adaptingContentType.set(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 (mds.hasUnconsumedDataSource())
+                 return _adaptingContentType.set(packet, encode(mds, out));
+         }
+-        
++
+         return _adaptingContentType.set(packet, super.encode(packet, out));
+     }
+ 
+@@ -188,16 +189,16 @@
+          */
+         if (packet.contentNegotiation == null)
+             useFastInfosetForEncoding = false;
+-        
++
+         if (contentType == null) {
+             xmlCodec.decode(in, contentType, packet);
+         } else if (isMultipartRelated(contentType)) {
+-            packet.setMessage(new XMLMultiPart(contentType, in));
++            packet.setMessage(new XMLMultiPart(contentType, in, binding.getFeature(StreamingAttachmentFeature.class)));
+         } else if(isFastInfoset(contentType)) {
+             if (fiCodec == null) {
+                 throw new RuntimeException(StreamingMessages.FASTINFOSET_NO_IMPLEMENTATION());
+             }
+-            
++
+             useFastInfosetForEncoding = true;
+             fiCodec.decode(in, contentType, packet);
+         } else if (isXml(contentType)) {
+@@ -205,24 +206,24 @@
+         } else {
+             packet.setMessage(new UnknownContent(contentType, in));
+         }
+-        
++
+         if (!useFastInfosetForEncoding) {
+             useFastInfosetForEncoding = isFastInfosetAcceptable(packet.acceptableMimeTypes);
+         }
+     }
+-    
++
+     protected void decode(MimeMultipartParser mpp, Packet packet) throws IOException {
+         // This method will never be invoked
+     }
+-    
++
+     public MimeCodec copy() {
+-        return new XMLHTTPBindingCodec();
++        return new XMLHTTPBindingCodec(binding);
+     }
+-    
++
+     private boolean isMultipartRelated(String contentType) {
+         return compareStrings(contentType, MimeCodec.MULTIPART_RELATED_MIME_TYPE);
+     }
+-    
++
+     private boolean isApplicationXopXml(String contentType) {
+         return compareStrings(contentType, MtomCodec.XOP_XML_MIME_TYPE);
+     }
+@@ -232,13 +233,13 @@
+                 || compareStrings(contentType, XMLCodec.XML_TEXT_MIME_TYPE)
+                 || (compareStrings(contentType, "application/")&&(contentType.toLowerCase().indexOf("+xml") != -1));
+     }
+-    
++
+     private boolean isFastInfoset(String contentType) {
+         return compareStrings(contentType, APPLICATION_FAST_INFOSET_MIME_TYPE);
+     }
+-    
++
+     private boolean compareStrings(String a, String b) {
+-        return a.length() >= b.length() && 
++        return a.length() >= b.length() &&
+                 b.equalsIgnoreCase(
+                     a.substring(0,
+                         b.length()));
+@@ -246,7 +247,7 @@
+ 
+     private boolean isFastInfosetAcceptable(String accept) {
+         if (accept == null) return false;
+-        
++
+         StringTokenizer st = new StringTokenizer(accept, ",");
+         while (st.hasMoreTokens()) {
+             final String token = st.nextToken().trim();
+@@ -253,15 +254,15 @@
+             if (token.equalsIgnoreCase(APPLICATION_FAST_INFOSET_MIME_TYPE)) {
+                 return true;
+             }
+-        }        
++        }
+         return false;
+     }
+-    
++
+     private ContentType getStaticContentType(MessageDataSource mds) {
+         final String contentType = mds.getDataSource().getContentType();
+         final boolean isFastInfoset = XMLMessage.isFastInfoset(contentType);
+-        
+-        if (!requiresTransformationOfDataSource(isFastInfoset, 
++
++        if (!requiresTransformationOfDataSource(isFastInfoset,
+                 useFastInfosetForEncoding)) {
+             return new ContentTypeImpl(contentType);
+         } else {
+@@ -268,14 +269,14 @@
+             return null;
+         }
+     }
+-        
++
+     private ContentType encode(MessageDataSource mds, OutputStream out) {
+         try {
+             final boolean isFastInfoset = XMLMessage.isFastInfoset(
+                     mds.getDataSource().getContentType());
+-            DataSource ds = transformDataSource(mds.getDataSource(), 
+-                    isFastInfoset, useFastInfosetForEncoding);
+-            
++            DataSource ds = transformDataSource(mds.getDataSource(),
++                    isFastInfoset, useFastInfosetForEncoding, binding);
++
+             InputStream is = ds.getInputStream();
+             byte[] buf = new byte[1024];
+             int count;
+@@ -286,8 +287,8 @@
+         } catch(IOException ioe) {
+             throw new WebServiceException(ioe);
+         }
+-    }    
+-    
++    }
++
+     private void setRootCodec(Packet p) {
+         /**
+          * The following logic is only for outbound packets
+@@ -308,46 +309,46 @@
+     }
+ 
+     public static boolean requiresTransformationOfDataSource(
+-            boolean isFastInfoset, boolean useFastInfoset) {    
++            boolean isFastInfoset, boolean useFastInfoset) {
+         return (isFastInfoset && !useFastInfoset) || (!isFastInfoset && useFastInfoset);
+     }
+-        
+-    public static DataSource transformDataSource(DataSource in, 
+-            boolean isFastInfoset, boolean useFastInfoset) {
++
++    public static DataSource transformDataSource(DataSource in,
++            boolean isFastInfoset, boolean useFastInfoset, WSBinding binding) {
+         try {
+             if (isFastInfoset && !useFastInfoset) {
+                 // Convert from Fast Infoset to XML
+-                Codec codec = new XMLHTTPBindingCodec();
++                Codec codec = new XMLHTTPBindingCodec(binding);
+                 Packet p = new Packet();
+                 codec.decode(in.getInputStream(), in.getContentType(), p);
+-                
++
+                 p.getMessage().getAttachments();
+                 codec.getStaticContentType(p);
+-                
+-                ByteOutputStream bos = new ByteOutputStream();
++
++                ByteArrayBuffer bos = new ByteArrayBuffer();
+                 ContentType ct = codec.encode(p, bos);
+                 return XMLMessage.createDataSource(ct.getContentType(), bos.newInputStream());
+             } else if (!isFastInfoset && useFastInfoset) {
+                 // Convert from XML to Fast Infoset
+-                Codec codec = new XMLHTTPBindingCodec();
++                Codec codec = new XMLHTTPBindingCodec(binding);
+                 Packet p = new Packet();
+                 codec.decode(in.getInputStream(), in.getContentType(), p);
+-                
++
+                 p.contentNegotiation = ContentNegotiation.optimistic;
+                 p.getMessage().getAttachments();
+                 codec.getStaticContentType(p);
+-                
+-                ByteOutputStream bos = new ByteOutputStream();
++
++                ByteArrayBuffer bos = new ByteArrayBuffer();
+                 com.sun.xml.internal.ws.api.pipe.ContentType ct = codec.encode(p, bos);
+-                return XMLMessage.createDataSource(ct.getContentType(), bos.newInputStream());                
++                return XMLMessage.createDataSource(ct.getContentType(), bos.newInputStream());
+             }
+         } catch(Exception ex) {
+             throw new WebServiceException(ex);
+         }
+-        
++
+         return in;
+     }
+-    
++
+     /**
+      * Obtain an FI SOAP codec instance using reflection.
+      */
+@@ -359,5 +360,5 @@
+         } catch (Exception e) {
+             return null;
+         }
+-    }    
++    }
+ }
+--- old/src/share/classes/com/sun/xml/internal/ws/encoding/fastinfoset/FastInfosetCodec.java	Thu Jul 30 18:27:48 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/fastinfoset/FastInfosetCodec.java	Thu Jul 30 18:27:47 2009
+@@ -47,7 +47,6 @@
+ import java.nio.channels.WritableByteChannel;
+ import java.nio.channels.ReadableByteChannel;
+ import com.sun.xml.internal.org.jvnet.fastinfoset.FastInfosetSource;
+-import com.sun.xml.internal.org.jvnet.fastinfoset.stax.FastInfosetStreamReader;
+ 
+ /**
+  * A codec for encoding/decoding XML infosets to/from fast
+@@ -58,33 +57,33 @@
+ public class FastInfosetCodec implements Codec {
+     private static final int DEFAULT_INDEXED_STRING_SIZE_LIMIT = 32;
+     private static final int DEFAULT_INDEXED_STRING_MEMORY_LIMIT = 4 * 1024 * 1024; //4M limit
+-    
++
+     private StAXDocumentParser _parser;
+-    
++
+     private StAXDocumentSerializer _serializer;
+-    
++
+     private final boolean _retainState;
+-    
++
+     private final ContentType _contentType;
+-    
++
+     /* package */ FastInfosetCodec(boolean retainState) {
+         _retainState = retainState;
+         _contentType = (retainState) ? new ContentTypeImpl(FastInfosetMIMETypes.STATEFUL_INFOSET) :
+             new ContentTypeImpl(FastInfosetMIMETypes.INFOSET);
+     }
+-    
++
+     public String getMimeType() {
+         return _contentType.getContentType();
+     }
+-    
++
+     public Codec copy() {
+         return new FastInfosetCodec(_retainState);
+     }
+-    
++
+     public ContentType getStaticContentType(Packet packet) {
+         return _contentType;
+     }
+-    
++
+     public ContentType encode(Packet packet, OutputStream out) {
+         Message message = packet.getMessage();
+         if (message != null && message.hasPayload()) {
+@@ -98,15 +97,15 @@
+                 throw new WebServiceException(e);
+             }
+         }
+-        
++
+         return _contentType;
+     }
+-    
++
+     public ContentType encode(Packet packet, WritableByteChannel buffer) {
+         //TODO: not yet implemented
+         throw new UnsupportedOperationException();
+     }
+-    
++
+     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*/
+@@ -118,14 +117,14 @@
+         } else {
+             message = Messages.createEmpty(SOAPVersion.SOAP_11);
+         }
+-        
++
+         packet.setMessage(message);
+     }
+-    
++
+     public void decode(ReadableByteChannel in, String contentType, Packet response) {
+         throw new UnsupportedOperationException();
+     }
+-    
++
+     private XMLStreamWriter getXMLStreamWriter(OutputStream out) {
+         if (_serializer != null) {
+             _serializer.setOutputStream(out);
+@@ -134,7 +133,7 @@
+             return _serializer = createNewStreamWriter(out, _retainState);
+         }
+     }
+-    
++
+     private XMLStreamReader getXMLStreamReader(InputStream in) {
+         if (_parser != null) {
+             _parser.setInputStream(in);
+@@ -143,7 +142,7 @@
+             return _parser = createNewStreamReader(in, _retainState);
+         }
+     }
+-    
++
+     /**
+      * Creates a new {@link FastInfosetCodec} instance.
+      *
+@@ -152,7 +151,7 @@
+     public static FastInfosetCodec create() {
+         return create(false);
+     }
+-    
++
+     /**
+      * Creates a new {@link FastInfosetCodec} instance.
+      *
+@@ -163,7 +162,7 @@
+     public static FastInfosetCodec create(boolean retainState) {
+         return new FastInfosetCodec(retainState);
+     }
+-    
++
+     /**
+      * Create a new (@link StAXDocumentSerializer} instance.
+      *
+@@ -175,7 +174,7 @@
+     /* package */ static StAXDocumentSerializer createNewStreamWriter(OutputStream out, boolean retainState) {
+         return createNewStreamWriter(out, retainState, DEFAULT_INDEXED_STRING_SIZE_LIMIT, DEFAULT_INDEXED_STRING_MEMORY_LIMIT);
+     }
+-    
++
+     /**
+      * Create a new (@link StAXDocumentSerializer} instance.
+      *
+@@ -196,14 +195,16 @@
+              */
+             SerializerVocabulary vocabulary = new SerializerVocabulary();
+             serializer.setVocabulary(vocabulary);
+-            serializer.setAttributeValueSizeLimit(indexedStringSizeLimit);
+-            serializer.setCharacterContentChunkSizeLimit(indexedStringSizeLimit);
++            serializer.setMinAttributeValueSize(0);
++            serializer.setMaxAttributeValueSize(indexedStringSizeLimit);
++            serializer.setMinCharacterContentChunkSize(0);
++            serializer.setMaxCharacterContentChunkSize(indexedStringSizeLimit);
+             serializer.setAttributeValueMapMemoryLimit(stringsMemoryLimit);
+             serializer.setCharacterContentChunkMapMemoryLimit(stringsMemoryLimit);
+         }
+         return serializer;
+     }
+-    
++
+     /**
+      * Create a new (@link StAXDocumentParser} instance.
+      *
+@@ -227,7 +228,7 @@
+         }
+         return parser;
+     }
+-    
++
+     /**
+      * Create a new (@link StAXDocumentParser} recyclable instance.
+      *
+--- old/src/share/classes/com/sun/xml/internal/ws/encoding/fastinfoset/FastInfosetMIMETypes.java	Thu Jul 30 18:27:51 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/fastinfoset/FastInfosetMIMETypes.java	Thu Jul 30 18:27:51 2009
+@@ -41,8 +41,8 @@
+     /**
+      * MIME type for a SOAP 1.2 Infoset encoded as a fast infoset document.
+      */
+-    static public final String SOAP_12 = "application/soap+fastinfoset";    
+-    
++    static public final String SOAP_12 = "application/soap+fastinfoset";
++
+     /**
+      * MIME type for a generic Infoset encoded as a stateful fast infoset document.
+      */
+@@ -54,5 +54,5 @@
+     /**
+      * MIME type for a SOAP 1.2 Infoset encoded as a stateful fast infoset document.
+      */
+-    static public final String STATEFUL_SOAP_12 = "application/vnd.sun.stateful.soap+fastinfoset";    
++    static public final String STATEFUL_SOAP_12 = "application/vnd.sun.stateful.soap+fastinfoset";
+ }
+--- old/src/share/classes/com/sun/xml/internal/ws/encoding/fastinfoset/FastInfosetStreamReaderFactory.java	Thu Jul 30 18:27:55 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/fastinfoset/FastInfosetStreamReaderFactory.java	Thu Jul 30 18:27:54 2009
+@@ -36,33 +36,33 @@
+  */
+ public final class FastInfosetStreamReaderFactory extends XMLStreamReaderFactory {
+     private static final FastInfosetStreamReaderFactory factory = new FastInfosetStreamReaderFactory();
+-    
++
+     private ThreadLocal<StAXDocumentParser> pool = new ThreadLocal<StAXDocumentParser>();
+-    
++
+     public static FastInfosetStreamReaderFactory getInstance() {
+         return factory;
+     }
+-    
++
+     public XMLStreamReader doCreate(String systemId, InputStream in, boolean rejectDTDs) {
+         StAXDocumentParser parser = fetch();
+         if (parser == null) {
+             return FastInfosetCodec.createNewStreamReaderRecyclable(in, false);
+         }
+-        
++
+         parser.setInputStream(in);
+         return parser;
+     }
+-    
++
+     public XMLStreamReader doCreate(String systemId, Reader reader, boolean rejectDTDs) {
+         throw new UnsupportedOperationException();
+     }
+-    
++
+     private StAXDocumentParser fetch() {
+         StAXDocumentParser parser = pool.get();
+         pool.set(null);
+         return parser;
+     }
+-    
++
+     public void doRecycle(XMLStreamReader r) {
+         if (r instanceof StAXDocumentParser) {
+             pool.set((StAXDocumentParser) r);
+--- old/src/share/classes/com/sun/xml/internal/ws/encoding/fastinfoset/FastInfosetStreamReaderRecyclable.java	Thu Jul 30 18:27:58 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/fastinfoset/FastInfosetStreamReaderRecyclable.java	Thu Jul 30 18:27:58 2009
+@@ -38,11 +38,11 @@
+     public FastInfosetStreamReaderRecyclable() {
+         super();
+     }
+-    
++
+     public FastInfosetStreamReaderRecyclable(InputStream in) {
+         super(in);
+     }
+-    
++
+     public void onRecycled() {
+         READER_FACTORY.doRecycle(this);
+     }
+--- old/src/share/classes/com/sun/xml/internal/ws/encoding/fastinfoset/FastInfosetStreamSOAP11Codec.java	Thu Jul 30 18:28:02 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/fastinfoset/FastInfosetStreamSOAP11Codec.java	Thu Jul 30 18:28:01 2009
+@@ -58,7 +58,7 @@
+     protected final StreamHeader createHeader(XMLStreamReader reader, XMLStreamBuffer mark) {
+         return new StreamHeader11(reader, mark);
+     }
+-    
++
+     protected ContentType getContentType(String soapAction) {
+         if (soapAction == null || soapAction.length() == 0) {
+             return _defaultContentType;
+--- old/src/share/classes/com/sun/xml/internal/ws/encoding/fastinfoset/FastInfosetStreamSOAP12Codec.java	Thu Jul 30 18:28:05 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/fastinfoset/FastInfosetStreamSOAP12Codec.java	Thu Jul 30 18:28:05 2009
+@@ -43,7 +43,7 @@
+  */
+ final class FastInfosetStreamSOAP12Codec extends FastInfosetStreamSOAPCodec {
+     /*package*/ FastInfosetStreamSOAP12Codec(StreamSOAPCodec soapCodec, boolean retainState) {
+-        super(soapCodec, SOAPVersion.SOAP_12, retainState, 
++        super(soapCodec, SOAPVersion.SOAP_12, retainState,
+                 (retainState) ? FastInfosetMIMETypes.STATEFUL_SOAP_12 : FastInfosetMIMETypes.SOAP_12);
+     }
+ 
+@@ -50,7 +50,7 @@
+     private FastInfosetStreamSOAP12Codec(FastInfosetStreamSOAPCodec that) {
+         super(that);
+     }
+-    
++
+     public Codec copy() {
+         return new FastInfosetStreamSOAP12Codec(this);
+     }
+@@ -58,7 +58,7 @@
+     protected final StreamHeader createHeader(XMLStreamReader reader, XMLStreamBuffer mark) {
+         return new StreamHeader12(reader, mark);
+     }
+-    
++
+     protected ContentType getContentType(String soapAction) {
+         if (soapAction == null) {
+             return _defaultContentType;
+--- old/src/share/classes/com/sun/xml/internal/ws/encoding/fastinfoset/FastInfosetStreamSOAPCodec.java	Thu Jul 30 18:28:09 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/fastinfoset/FastInfosetStreamSOAPCodec.java	Thu Jul 30 18:28:08 2009
+@@ -60,13 +60,13 @@
+ 
+     private StAXDocumentParser _statefulParser;
+     private StAXDocumentSerializer _serializer;
+-    
++
+     private final StreamSOAPCodec _soapCodec;
+-    
++
+     private final boolean _retainState;
+-    
++
+     protected final ContentType _defaultContentType;
+-    
++
+     /* package */ FastInfosetStreamSOAPCodec(StreamSOAPCodec soapCodec, SOAPVersion soapVersion, boolean retainState, String mimeType) {
+ //        _soapCodec = StreamSOAPCodec.create(soapVersion);
+         _soapCodec = soapCodec;
+@@ -73,21 +73,21 @@
+         _retainState = retainState;
+         _defaultContentType = new ContentTypeImpl(mimeType);
+     }
+-    
++
+     /* package */ FastInfosetStreamSOAPCodec(FastInfosetStreamSOAPCodec that) {
+         this._soapCodec = (StreamSOAPCodec) that._soapCodec.copy();
+         this._retainState = that._retainState;
+         this._defaultContentType = that._defaultContentType;
+     }
+-    
++
+     public String getMimeType() {
+         return _defaultContentType.getContentType();
+     }
+-    
++
+     public ContentType getStaticContentType(Packet packet) {
+         return getContentType(packet.soapAction);
+     }
+-    
++
+     public ContentType encode(Packet packet, OutputStream out) {
+         if (packet.getMessage() != null) {
+             final XMLStreamWriter writer = getXMLStreamWriter(out);
+@@ -100,25 +100,25 @@
+         }
+         return getContentType(packet.soapAction);
+     }
+-    
++
+     public ContentType encode(Packet packet, WritableByteChannel buffer) {
+         //TODO: not yet implemented
+         throw new UnsupportedOperationException();
+     }
+-    
++
+     public void decode(InputStream in, String contentType, Packet response) throws IOException {
+         response.setMessage(
+                 _soapCodec.decode(getXMLStreamReader(in)));
+     }
+-    
++
+     public void decode(ReadableByteChannel in, String contentType, Packet response) {
+         throw new UnsupportedOperationException();
+     }
+-    
++
+     protected abstract StreamHeader createHeader(XMLStreamReader reader, XMLStreamBuffer mark);
+-    
++
+     protected abstract ContentType getContentType(String soapAction);
+-    
++
+     private XMLStreamWriter getXMLStreamWriter(OutputStream out) {
+         if (_serializer != null) {
+             _serializer.setOutputStream(out);
+@@ -127,7 +127,7 @@
+             return _serializer = FastInfosetCodec.createNewStreamWriter(out, _retainState);
+         }
+     }
+-    
++
+     private XMLStreamReader getXMLStreamReader(InputStream in) {
+         // If the _retainState is true (FI stateful) then pick up Codec assiciated XMLStreamReader
+         if (_retainState) {
+@@ -138,11 +138,11 @@
+                 return _statefulParser = FastInfosetCodec.createNewStreamReader(in, _retainState);
+             }
+         }
+-        
++
+         // Otherwise thread assiciated XMLStreamReader
+         return READER_FACTORY.doCreate(null, in, false);
+     }
+-    
++
+     /**
+      * Creates a new {@link FastInfosetStreamSOAPCodec} instance.
+      *
+@@ -152,7 +152,7 @@
+     public static FastInfosetStreamSOAPCodec create(StreamSOAPCodec soapCodec, SOAPVersion version) {
+         return create(soapCodec, version, false);
+     }
+-    
++
+     /**
+      * Creates a new {@link FastInfosetStreamSOAPCodec} instance.
+      *
+--- old/src/share/classes/com/sun/xml/internal/ws/encoding/soap/DeserializationException.java	Thu Jul 30 18:28:12 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/DeserializationException.java	Thu Jul 30 18:28:12 2009
+@@ -31,9 +31,9 @@
+ /**
+  * DeserializationException represents an exception that occurred while
+  * deserializing a Java value from XML.
+- * 
++ *
+  * @see JAXWSExceptionBase
+- * 
++ *
+  * @author WS Development Team
+  */
+ public class DeserializationException extends JAXWSExceptionBase {
+--- old/src/share/classes/com/sun/xml/internal/ws/encoding/soap/SOAP12Constants.java	Thu Jul 30 18:28:16 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/SOAP12Constants.java	Thu Jul 30 18:28:15 2009
+@@ -39,10 +39,10 @@
+     public static final String URI_HTTP = SOAP12NamespaceConstants.TRANSPORT_HTTP;
+     public static final String URI_SOAP_RPC = SOAP12NamespaceConstants.SOAP_RPC;
+ 
+-    
++
+     public static final QName QNAME_SOAP_RPC = new QName(URI_SOAP_RPC, "rpc");
+     public static final QName QNAME_SOAP_RESULT = new QName(URI_SOAP_RPC, "result");
+-    
++
+     public static final QName QNAME_SOAP_ENVELOPE    = new QName(URI_ENVELOPE, "Envelope");
+     public static final QName QNAME_SOAP_BODY    = new QName(URI_ENVELOPE, "Body");
+     public static final QName QNAME_SOAP_HEADER    = new QName(URI_ENVELOPE, "Header");
+@@ -52,7 +52,7 @@
+     public static final QName QNAME_ROLE                   = new QName(URI_ENVELOPE, "role");
+ 
+     public static final QName QNAME_NOT_UNDERSTOOD         = new QName(URI_ENVELOPE, "NotUnderstood");
+-    
++
+     //fault
+     public static final QName QNAME_FAULT_CODE             = new QName(URI_ENVELOPE, "Code");
+     public static final QName QNAME_FAULT_SUBCODE          = new QName(URI_ENVELOPE, "Subcode");
+@@ -64,8 +64,8 @@
+     public static final QName QNAME_FAULT_REASON_TEXT             = new QName(URI_ENVELOPE, "Text");
+     public final static QName QNAME_UPGRADE                = new QName(URI_ENVELOPE, "Upgrade");
+     public final static QName QNAME_UPGRADE_SUPPORTED_ENVELOPE           = new QName(URI_ENVELOPE, "SupportedEnvelope");
+-    
+-    
++
++
+     //fault codes
+     public final static QName FAULT_CODE_MUST_UNDERSTAND   = new QName(URI_ENVELOPE, "MustUnderstand");
+     public final static QName FAULT_CODE_MISUNDERSTOOD   = new QName(URI_ENVELOPE, "Misunderstood");
+--- old/src/share/classes/com/sun/xml/internal/ws/encoding/soap/SerializationException.java	Thu Jul 30 18:28:19 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/SerializationException.java	Thu Jul 30 18:28:19 2009
+@@ -30,9 +30,9 @@
+ /**
+  * SerializationException represents an exception that occurred while
+  * serializing a Java value as XML.
+- * 
++ *
+  * @see JAXWSExceptionBase
+- * 
++ *
+  * @author WS Development Team
+  */
+ public class SerializationException extends JAXWSExceptionBase {
+--- old/src/share/classes/com/sun/xml/internal/ws/encoding/soap/streaming/SOAP12NamespaceConstants.java	Thu Jul 30 18:28:23 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/streaming/SOAP12NamespaceConstants.java	Thu Jul 30 18:28:22 2009
+@@ -40,14 +40,14 @@
+         "http://www.w3.org/2001/XMLSchema-instance";
+     public static final String TRANSPORT_HTTP =
+         "http://www.w3.org/2003/05/soap/bindings/HTTP/";
+-    
++
+     public static final String ACTOR_NEXT = "http://www.w3.org/2003/05/soap-envelope/role/next";
+-        
++
+     public static final String ROLE_NEXT =
+         "http://www.w3.org/2003/05/soap-envelope/role/next";
+     public static final String ROLE_NONE = "http://www.w3.org/2003/05/soap-envelope/role/none";
+-    public static final String ROLE_ULTIMATE_RECEIVER = "http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver"; 
+-    
++    public static final String ROLE_ULTIMATE_RECEIVER = "http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver";
++
+     public static final String SOAP_UPGRADE =
+         "http://www.w3.org/2002/06/soap-upgrade";
+ 
+@@ -60,6 +60,6 @@
+     public static final String ATTR_ACTOR = "role";
+     public static final String ATTR_MUST_UNDERSTAND = "mustUnderstand";
+     public static final String ATTR_MISUNDERSTOOD = "missUnderstood";
+-    public static final String ATTR_ENCODING_STYLE = "encodingStyle";   
++    public static final String ATTR_ENCODING_STYLE = "encodingStyle";
+     public static final String ATTR_NOT_UNDERSTOOD_QNAME = "qname";
+ }
+--- old/src/share/classes/com/sun/xml/internal/ws/encoding/soap/streaming/SOAPNamespaceConstants.java	Thu Jul 30 18:28:26 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/soap/streaming/SOAPNamespaceConstants.java	Thu Jul 30 18:28:26 2009
+@@ -38,7 +38,7 @@
+         "http://www.w3.org/2001/XMLSchema-instance";
+     public static final String XMLNS = "http://www.w3.org/XML/1998/namespace";
+     public static final String TRANSPORT_HTTP =
+-        "http://schemas.xmlsoap.org/soap/http"; 
++        "http://schemas.xmlsoap.org/soap/http";
+     public static final String ACTOR_NEXT =
+         "http://schemas.xmlsoap.org/soap/actor/next";
+ 
+--- old/src/share/classes/com/sun/xml/internal/ws/encoding/xml/XMLCodec.java	Thu Jul 30 18:28:30 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/xml/XMLCodec.java	Thu Jul 30 18:28:29 2009
+@@ -30,6 +30,7 @@
+ import com.sun.xml.internal.ws.api.pipe.Codec;
+ import com.sun.xml.internal.ws.api.pipe.ContentType;
+ import com.sun.xml.internal.ws.api.streaming.XMLStreamWriterFactory;
++import com.sun.xml.internal.ws.api.WSBinding;
+ import com.sun.xml.internal.ws.encoding.ContentTypeImpl;
+ 
+ import javax.xml.stream.XMLStreamException;
+@@ -48,6 +49,12 @@
+ 
+     private static final ContentType contentType = new ContentTypeImpl(XML_TEXT_MIME_TYPE);
+ 
++    private final WSBinding binding;
++
++    public XMLCodec(WSBinding binding) {
++        this.binding = binding;
++    }
++
+     public String getMimeType() {
+         return XML_APPLICATION_MIME_TYPE;
+     }
+@@ -79,7 +86,7 @@
+     }
+ 
+     public void decode(InputStream in, String contentType, Packet packet) throws IOException {
+-        Message message = XMLMessage.create(contentType, in);
++        Message message = XMLMessage.create(contentType, in, binding);
+         packet.setMessage(message);
+     }
+ 
+@@ -86,5 +93,5 @@
+     public void decode(ReadableByteChannel in, String contentType, Packet packet) {
+         // TODO
+         throw new UnsupportedOperationException();
+-    }    
++    }
+ }
+--- old/src/share/classes/com/sun/xml/internal/ws/encoding/xml/XMLMessage.java	Thu Jul 30 18:28:34 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/xml/XMLMessage.java	Thu Jul 30 18:28:33 2009
+@@ -26,25 +26,24 @@
+ package com.sun.xml.internal.ws.encoding.xml;
+ 
+ import com.sun.istack.internal.NotNull;
+-import com.sun.xml.internal.messaging.saaj.packaging.mime.internet.ContentType;
+-import com.sun.xml.internal.messaging.saaj.packaging.mime.internet.MimeMultipart;
+-import com.sun.xml.internal.messaging.saaj.util.ByteOutputStream;
+ import com.sun.xml.internal.ws.api.SOAPVersion;
+-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.HeaderList;
+-import com.sun.xml.internal.ws.api.message.Message;
+-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.WSBinding;
++import com.sun.xml.internal.ws.api.message.*;
+ 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.streaming.XMLStreamReaderFactory;
+ import com.sun.xml.internal.ws.api.streaming.XMLStreamWriterFactory;
++import com.sun.xml.internal.ws.developer.StreamingAttachmentFeature;
+ import com.sun.xml.internal.ws.encoding.MimeMultipartParser;
+ import com.sun.xml.internal.ws.encoding.XMLHTTPBindingCodec;
++import com.sun.xml.internal.ws.encoding.ContentType;
+ import com.sun.xml.internal.ws.message.AbstractMessageImpl;
+ import com.sun.xml.internal.ws.message.EmptyMessageImpl;
++import com.sun.xml.internal.ws.message.MimeAttachmentSet;
++import com.sun.xml.internal.ws.message.source.PayloadSourceMessage;
+ import com.sun.xml.internal.ws.util.xml.XMLStreamReaderToXMLStreamWriter;
++import com.sun.xml.internal.ws.util.ByteArrayBuffer;
++import com.sun.xml.internal.bind.api.Bridge;
+ import org.xml.sax.ContentHandler;
+ import org.xml.sax.ErrorHandler;
+ import org.xml.sax.SAXException;
+@@ -56,13 +55,11 @@
+ import javax.xml.transform.Source;
+ import javax.xml.transform.stream.StreamSource;
+ import javax.xml.ws.WebServiceException;
+-import java.io.BufferedInputStream;
+-import java.io.IOException;
+-import java.io.InputStream;
+-import java.io.OutputStream;
+-import java.util.HashMap;
+-import java.util.Iterator;
+-import java.util.Map;
++import javax.xml.soap.SOAPMessage;
++import javax.xml.soap.SOAPException;
++import javax.xml.bind.Unmarshaller;
++import javax.xml.bind.JAXBException;
++import java.io.*;
+ 
+ /**
+  *
+@@ -70,11 +67,6 @@
+  */
+ public final class XMLMessage {
+ 
+-    // So that SAAJ registers DCHs for MIME types
+-    static {
+-        new com.sun.xml.internal.messaging.saaj.soap.AttachmentPartImpl();
+-    }
+-
+     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
+@@ -107,13 +99,12 @@
+     /**
+      * Construct a message given a content type and an input stream.
+      */
+-    public static Message create(final String ct, InputStream in) {
++    public static Message create(final String ct, InputStream in, WSBinding binding) {
+         Message data;
+         try {
+             in = hasSomeData(in);
+             if (in == null) {
+-                data = Messages.createEmpty(SOAPVersion.SOAP_11);
+-                return data;
++                return Messages.createEmpty(SOAPVersion.SOAP_11);
+             }
+ 
+             if (ct != null) {
+@@ -120,10 +111,9 @@
+                 final ContentType contentType = new ContentType(ct);
+                 final int contentTypeId = identifyContentType(contentType);
+                 if ((contentTypeId & MIME_MULTIPART_FLAG) != 0) {
+-                    data = new XMLMultiPart(ct, in);
++                    data = new XMLMultiPart(ct, in, binding.getFeature(StreamingAttachmentFeature.class));
+                 } else if ((contentTypeId & PLAIN_XML_FLAG) != 0) {
+-                    data = Messages.createUsingPayload(new StreamSource(in),
+-                            SOAPVersion.SOAP_11);
++                    data = new XmlContent(ct, in);
+                 } else {
+                     data = new UnknownContent(ct, in);
+                 }
+@@ -138,16 +128,16 @@
+ 
+ 
+     public static Message create(Source source) {
+-        return (source == null) ? 
+-            Messages.createEmpty(SOAPVersion.SOAP_11) : 
++        return (source == null) ?
++            Messages.createEmpty(SOAPVersion.SOAP_11) :
+             Messages.createUsingPayload(source, SOAPVersion.SOAP_11);
+     }
+ 
+-    public static Message create(DataSource ds) {
++    public static Message create(DataSource ds, WSBinding binding) {
+         try {
+-            return (ds == null) ? 
+-                Messages.createEmpty(SOAPVersion.SOAP_11) : 
+-                create(ds.getContentType(), ds.getInputStream());
++            return (ds == null) ?
++                Messages.createEmpty(SOAPVersion.SOAP_11) :
++                create(ds.getContentType(), ds.getInputStream(), binding);
+         } catch(IOException ioe) {
+             throw new WebServiceException(ioe);
+         }
+@@ -160,7 +150,7 @@
+     /**
+      * Get the content type ID from the content type.
+      */
+-    private static int getContentId(String ct) {    
++    private static int getContentId(String ct) {
+         try {
+             final ContentType contentType = new ContentType(ct);
+             return identifyContentType(contentType);
+@@ -168,14 +158,14 @@
+             throw new WebServiceException(ex);
+         }
+     }
+-    
++
+     /**
+      * Return true if the content uses fast infoset.
+      */
+-    public static boolean isFastInfoset(String ct) {    
++    public static boolean isFastInfoset(String ct) {
+         return (getContentId(ct) & FI_ENCODED_FLAG) != 0;
+     }
+-    
++
+     /**
+      * Verify a contentType.
+      *
+@@ -228,12 +218,12 @@
+     protected static boolean isFastInfosetType(String type) {
+         return type.toLowerCase().startsWith("application/fastinfoset");
+     }
+-    
+-    
++
++
+     /**
+      * Access a {@link Message} as a {@link DataSource}.
+      * <p>
+-     * A {@link Message} implementation will implement this if the 
++     * A {@link Message} implementation will implement this if the
+      * messages is to be access as data source.
+      * <p>
+      * TODO: consider putting as part of the API.
+@@ -244,7 +234,7 @@
+          * @return true of the data source has been consumed, otherwise false.
+          */
+         boolean hasUnconsumedDataSource();
+-        
++
+         /**
+          * Get the data source.
+          * @return the data source.
+@@ -252,26 +242,145 @@
+         DataSource getDataSource();
+     }
+ 
++    /**
++     * It's conent-type is some XML type
++     *
++     */
++    private static class XmlContent extends AbstractMessageImpl implements MessageDataSource {
++        private final DataSource dataSource;
++        private boolean consumed;
++        private Message delegate;
++        private final HeaderList headerList;
+ 
++        public XmlContent(String ct, InputStream in) {
++            super(SOAPVersion.SOAP_11);
++            dataSource = createDataSource(ct, in);
++            this.headerList = new HeaderList();
++        }
++
++        private Message getMessage() {
++            if (delegate == null) {
++                assert !consumed;
++                InputStream in = null;
++                try {
++                    in = dataSource.getInputStream();
++                } catch(IOException ioe) {
++                    // shouldn't happen;
++                }
++                assert in != null;
++                delegate = Messages.createUsingPayload(new StreamSource(in), SOAPVersion.SOAP_11);
++                consumed = true;
++            }
++            return delegate;
++        }
++
++        public boolean hasUnconsumedDataSource() {
++            return !consumed;
++        }
++
++        public DataSource getDataSource() {
++            consumed = true;
++            return dataSource;
++        }
++
++        public boolean hasHeaders() {
++            return false;
++        }
++
++        public @NotNull HeaderList getHeaders() {
++            return headerList;
++        }
++
++        public String getPayloadLocalPart() {
++            return getMessage().getPayloadLocalPart();
++        }
++
++        public String getPayloadNamespaceURI() {
++            return getMessage().getPayloadNamespaceURI();
++        }
++
++        public boolean hasPayload() {
++            return true;
++        }
++
++        public boolean isFault() {
++            return false;
++        }
++
++        public Source readEnvelopeAsSource() {
++            return getMessage().readEnvelopeAsSource();
++        }
++
++        public Source readPayloadAsSource() {
++            return getMessage().readPayloadAsSource();
++        }
++
++        public SOAPMessage readAsSOAPMessage() throws SOAPException {
++            return getMessage().readAsSOAPMessage();
++        }
++
++        public SOAPMessage readAsSOAPMessage(Packet packet, boolean inbound) throws SOAPException {
++            return getMessage().readAsSOAPMessage(packet, inbound);
++        }
++
++        public <T> T readPayloadAsJAXB(Unmarshaller unmarshaller) throws JAXBException {
++            return (T)getMessage().readPayloadAsJAXB(unmarshaller);
++        }
++
++        public <T> T readPayloadAsJAXB(Bridge<T> bridge) throws JAXBException {
++            return getMessage().readPayloadAsJAXB(bridge);
++        }
++
++        public XMLStreamReader readPayload() throws XMLStreamException {
++            return getMessage().readPayload();
++        }
++
++
++        public void writePayloadTo(XMLStreamWriter sw) throws XMLStreamException {
++            getMessage().writePayloadTo(sw);
++        }
++
++        public void writeTo(XMLStreamWriter sw) throws XMLStreamException {
++            getMessage().writeTo(sw);
++        }
++
++        public void writeTo(ContentHandler contentHandler, ErrorHandler errorHandler) throws SAXException {
++            getMessage().writeTo(contentHandler, errorHandler);
++        }
++
++        public Message copy() {
++            throw new UnsupportedOperationException();
++        }
++
++        protected void writePayloadTo(ContentHandler contentHandler, ErrorHandler errorHandler, boolean fragment) throws SAXException {
++            throw new UnsupportedOperationException();
++        }
++
++    }
++
++
++
+     /**
+-     * Data represented as a multi-part MIME message. 
++     * Data represented as a multi-part MIME message.
+      * <p>
+-     * The root part may be an XML or an FI document.
+-     *
+-     * This class parses {@link MimeMultipart} lazily.
++     * The root part may be an XML or an FI document. This class
++     * parses MIME message lazily.
+      */
+     public static final class XMLMultiPart extends AbstractMessageImpl implements MessageDataSource {
+         private final DataSource dataSource;
+         private MimeMultipartParser mpp;
++        private final StreamingAttachmentFeature feature;
+ 
+-        public XMLMultiPart(final String contentType, final InputStream is) {
++        public XMLMultiPart(final String contentType, final InputStream is, StreamingAttachmentFeature feature) {
+             super(SOAPVersion.SOAP_11);
+             dataSource = createDataSource(contentType, is);
++            this.feature = feature;
+         }
+-        
+-        public XMLMultiPart(DataSource dataSource) {
++
++        public XMLMultiPart(DataSource dataSource, StreamingAttachmentFeature feature) {
+             super(SOAPVersion.SOAP_11);
+             this.dataSource = dataSource;
++            this.feature = feature;
+         }
+ 
+         public DataSource getDataSource() {
+@@ -278,19 +387,19 @@
+             assert dataSource != null;
+             return dataSource;
+         }
+-        
++
+         private void convertDataSourceToMessage() {
+             if (mpp == null) {
+                 try {
+                     mpp = new MimeMultipartParser(
+                             dataSource.getInputStream(),
+-                            dataSource.getContentType());
++                            dataSource.getContentType(), feature);
+                 } catch(IOException ioe) {
+                     throw new WebServiceException(ioe);
+                 }
+             }
+         }
+-        
++
+         @Override
+         public boolean isOneWay(@NotNull WSDLPort port) {
+             return false;
+@@ -307,11 +416,11 @@
+         public HeaderList getHeaders() {
+             return new HeaderList();
+         }
+-        
++
+         @Override
+         public AttachmentSet getAttachments() {
+             convertDataSourceToMessage();
+-            return new XMLAttachmentSet(mpp);
++            return new MimeAttachmentSet(mpp);
+         }
+ 
+         public String getPayloadLocalPart() {
+@@ -348,11 +457,11 @@
+             }
+         }
+ 
+-        protected void writePayloadTo(ContentHandler contentHandler, 
++        protected void writePayloadTo(ContentHandler contentHandler,
+                 ErrorHandler errorHandler, boolean fragment){
+             throw new UnsupportedOperationException();
+         }
+-        
++
+         public Message copy() {
+             throw new UnsupportedOperationException();
+         }
+@@ -362,46 +471,7 @@
+         }
+ 
+     }
+-    
+-    private static final class XMLAttachmentSet implements AttachmentSet {
+ 
+-        private final Map<String, Attachment> attMap;
+-
+-        public XMLAttachmentSet(MimeMultipartParser mpp) {
+-            // TODO 
+-            attMap = new HashMap<String, Attachment>();
+-            attMap.putAll(mpp.getAttachmentParts());
+-        }
+-
+-        /**
+-         * Gets the attachment by the content ID.
+-         *
+-         * @return null
+-         *         if no such attachment exist.
+-         */
+-        public Attachment get(String contentId) {
+-            return attMap.get(contentId);
+-        }
+-
+-        public boolean isEmpty() {
+-            return attMap.isEmpty();
+-        }
+-
+-        /**
+-         * Returns an iterator over a set of elements of type T.
+-         *
+-         * @return an Iterator.
+-         */
+-        public Iterator<Attachment> iterator() {
+-            return attMap.values().iterator();
+-        }
+-
+-        public void add(Attachment att) {
+-            attMap.put(att.getContentId(), att);
+-        }
+-
+-    }
+-
+     private static class FaultMessage extends EmptyMessageImpl {
+ 
+         public FaultMessage(SOAPVersion version) {
+@@ -414,7 +484,7 @@
+         }
+     }
+ 
+-    
++
+     /**
+      * Don't know about this content. It's conent-type is NOT the XML types
+      * we recognize(text/xml, application/xml, multipart/related;text/xml etc).
+@@ -424,11 +494,11 @@
+     public static class UnknownContent extends AbstractMessageImpl implements MessageDataSource {
+         private final DataSource ds;
+         private final HeaderList headerList;
+-        
++
+         public UnknownContent(final String ct, final InputStream in) {
+             this(createDataSource(ct,in));
+         }
+-        
++
+         public UnknownContent(DataSource ds) {
+             super(SOAPVersion.SOAP_11);
+             this.ds = ds;
+@@ -453,7 +523,7 @@
+             return ds;
+         }
+ 
+-        protected void writePayloadTo(ContentHandler contentHandler, 
++        protected void writePayloadTo(ContentHandler contentHandler,
+                 ErrorHandler errorHandler, boolean fragment) throws SAXException {
+             throw new UnsupportedOperationException();
+         }
+@@ -461,7 +531,7 @@
+         public boolean hasHeaders() {
+             return false;
+         }
+-        
++
+         public boolean isFault() {
+             return false;
+         }
+@@ -500,15 +570,15 @@
+ 
+     }
+ 
+-    public static DataSource getDataSource(Message msg) {
++    public static DataSource getDataSource(Message msg, WSBinding binding) {
+         if (msg instanceof MessageDataSource) {
+             return ((MessageDataSource)msg).getDataSource();
+         } else {
+             AttachmentSet atts = msg.getAttachments();
+             if (atts != null && !atts.isEmpty()) {
+-                final ByteOutputStream bos = new ByteOutputStream();
++                final ByteArrayBuffer bos = new ByteArrayBuffer();
+                 try {
+-                    Codec codec = new XMLHTTPBindingCodec();
++                    Codec codec = new XMLHTTPBindingCodec(binding);
+                     com.sun.xml.internal.ws.api.pipe.ContentType ct = codec.getStaticContentType(new Packet(msg));
+                     codec.encode(new Packet(msg), bos);
+                     return createDataSource(ct.getContentType(), bos.newInputStream());
+@@ -515,9 +585,9 @@
+                 } catch(IOException ioe) {
+                     throw new WebServiceException(ioe);
+                 }
+-                
++
+             } else {
+-                final ByteOutputStream bos = new ByteOutputStream();
++                final ByteArrayBuffer bos = new ByteArrayBuffer();
+                 XMLStreamWriter writer = XMLStreamWriterFactory.create(bos);
+                 try {
+                     msg.writePayloadTo(writer);
+@@ -526,10 +596,10 @@
+                     throw new WebServiceException(e);
+                 }
+                 return XMLMessage.createDataSource("text/xml", bos.newInputStream());
+-            }       
++            }
+         }
+     }
+-    
++
+     public static DataSource createDataSource(final String contentType, final InputStream is) {
+         return new DataSource() {
+             public InputStream getInputStream() {
+@@ -548,5 +618,5 @@
+                 return "";
+             }
+         };
+-    }    
++    }
+ }
+--- old/src/share/classes/com/sun/xml/internal/ws/fault/SOAP11Fault.java	Thu Jul 30 18:28:37 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/fault/SOAP11Fault.java	Thu Jul 30 18:28:37 2009
+@@ -30,11 +30,7 @@
+ import org.w3c.dom.Element;
+ import org.w3c.dom.Node;
+ 
+-import javax.xml.bind.annotation.XmlAccessType;
+-import javax.xml.bind.annotation.XmlAccessorType;
+-import javax.xml.bind.annotation.XmlElement;
+-import javax.xml.bind.annotation.XmlRootElement;
+-import javax.xml.bind.annotation.XmlType;
++import javax.xml.bind.annotation.*;
+ import javax.xml.namespace.QName;
+ import javax.xml.soap.Detail;
+ import javax.xml.soap.SOAPException;
+@@ -41,6 +37,7 @@
+ import javax.xml.soap.SOAPFault;
+ import javax.xml.ws.WebServiceException;
+ import javax.xml.ws.soap.SOAPFaultException;
++import java.util.Iterator;
+ 
+ /**
+  * This class represents SOAP1.1 Fault. This class will be used to marshall/unmarshall a soap fault using JAXB.
+@@ -121,7 +118,12 @@
+         this.faultstring = fault.getFaultString();
+         this.faultactor = fault.getFaultActor();
+         if (fault.getDetail() != null) {
+-            detail = new DetailType(fault.getDetail());
++            detail = new DetailType();
++            Iterator iter = fault.getDetail().getDetailEntries();
++            while(iter.hasNext()){
++                Element fd = (Element)iter.next();
++                detail.getDetails().add(fd);
++            }
+         }
+     }
+ 
+@@ -165,10 +167,12 @@
+     protected Throwable getProtocolException() {
+         try {
+             SOAPFault fault = SOAPVersion.SOAP_11.saajSoapFactory.createFault(faultstring, faultcode);
+-            if(detail != null && detail.getDetail(0) != null) {
+-                Node n = fault.getOwnerDocument().importNode(detail.getDetail(0), true);
++            if(detail != null){
+                 Detail d = fault.addDetail();
+-                d.appendChild(n);
++                for(Element det : detail.getDetails()){
++                    Node n = fault.getOwnerDocument().importNode(det, true);
++                    d.appendChild(n);
++                }
+             }
+             fault.setFaultActor(faultactor);
+             return new SOAPFaultException(fault);
+--- old/src/share/classes/com/sun/xml/internal/ws/fault/SOAP12Fault.java	Thu Jul 30 18:28:41 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/fault/SOAP12Fault.java	Thu Jul 30 18:28:40 2009
+@@ -27,6 +27,7 @@
+ 
+ 
+ import com.sun.xml.internal.ws.api.SOAPVersion;
++import com.sun.xml.internal.ws.util.DOMUtil;
+ import org.w3c.dom.Element;
+ import org.w3c.dom.Node;
+ 
+@@ -111,6 +112,23 @@
+         this.detail = detail;
+     }
+ 
++    SOAP12Fault(CodeType code, ReasonType reason, String node, String role, Element detailObject) {
++        this.code = code;
++        this.reason = reason;
++        this.node = node;
++        this.role = role;
++        if (detailObject != null) {
++            if(detailObject.getNamespaceURI().equals(ns) && detailObject.getLocalName().equals("Detail")){
++                detail = new DetailType();
++                for(Element detailEntry : DOMUtil.getChildElements(detailObject)){
++                    detail.getDetails().add(detailEntry);
++                }
++            }else{
++                detail = new DetailType(detailObject);
++            }
++        }
++    }
++
+     SOAP12Fault(SOAPFault fault) {
+         code = new CodeType(fault.getFaultCodeAsQName());
+         try {
+@@ -121,14 +139,19 @@
+ 
+         reason = new ReasonType(fault.getFaultString());
+         role = fault.getFaultRole();
+-        detail = new DetailType(fault.getDetail());
++        node = fault.getFaultNode();
++        if (fault.getDetail() != null) {
++            detail = new DetailType();
++            Iterator iter = fault.getDetail().getDetailEntries();
++            while(iter.hasNext()){
++                Element fd = (Element)iter.next();
++                detail.getDetails().add(fd);
++            }
++        }
+     }
+ 
+     SOAP12Fault(QName code, String reason, Element detailObject) {
+-        this.code = new CodeType(code);
+-        this.reason = new ReasonType(reason);
+-        if(detailObject != null)
+-            detail = new DetailType(detailObject);
++        this(new CodeType(code), new ReasonType(reason), null, null, detailObject);
+     }
+ 
+     CodeType getCode() {
+@@ -164,7 +187,18 @@
+ 
+      protected Throwable getProtocolException() {
+         try {
+-            SOAPFault fault = SOAPVersion.SOAP_12.saajSoapFactory.createFault(reason.texts().get(0).getText(), (code != null)? code.getValue():null);
++            SOAPFault fault = SOAPVersion.SOAP_12.saajSoapFactory.createFault();;
++            if(reason != null){
++                for(TextType tt : reason.texts()){
++                    fault.setFaultString(tt.getText());
++                }
++            }
++
++            if(code != null){
++                fault.setFaultCode(code.getValue());
++                fillFaultSubCodes(fault, code.getSubcode());
++            }
++
+             if(detail != null && detail.getDetail(0) != null){
+                 javax.xml.soap.Detail detail = fault.addDetail();
+                 for(Node obj: this.detail.getDetails()){
+@@ -172,8 +206,6 @@
+                     detail.appendChild(n);
+                 }
+             }
+-            if(code != null)
+-                fillFaultSubCodes(fault, code.getSubcode());
+ 
+             return new SOAPFaultException(fault);
+         } catch (SOAPException e) {
+@@ -211,4 +243,3 @@
+     }
+ 
+ }
+-
+--- old/src/share/classes/com/sun/xml/internal/ws/fault/SOAPFaultBuilder.java	Thu Jul 30 18:28:44 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/fault/SOAPFaultBuilder.java	Thu Jul 30 18:28:44 2009
+@@ -37,6 +37,7 @@
+ import com.sun.xml.internal.ws.encoding.soap.SOAPConstants;
+ import com.sun.xml.internal.ws.encoding.soap.SerializationException;
+ import com.sun.xml.internal.ws.message.jaxb.JAXBMessage;
++import com.sun.xml.internal.ws.message.FaultMessage;
+ import com.sun.xml.internal.ws.model.CheckedExceptionImpl;
+ import com.sun.xml.internal.ws.model.JavaMethodImpl;
+ import com.sun.xml.internal.ws.util.DOMUtil;
+@@ -49,6 +50,8 @@
+ import javax.xml.bind.JAXBException;
+ import javax.xml.namespace.QName;
+ import javax.xml.soap.SOAPFault;
++import javax.xml.soap.Detail;
++import javax.xml.soap.DetailEntry;
+ import javax.xml.transform.dom.DOMResult;
+ import javax.xml.ws.ProtocolException;
+ import javax.xml.ws.WebServiceException;
+@@ -77,6 +80,17 @@
+ 
+     abstract void setDetail(DetailType detailType);
+ 
++    public @Nullable QName getFirstDetailEntryName() {
++        DetailType dt = getDetail();
++        if (dt != null) {
++            Node entry = dt.getDetail(0);
++            if (entry != null) {
++                return new QName(entry.getNamespaceURI(), entry.getLocalName());
++            }
++        }
++        return null;
++    }
++
+     /**
+      * gives the fault string that can be used to create an {@link Exception}
+      */
+@@ -125,7 +139,7 @@
+      *
+      * @param soapVersion {@link SOAPVersion#SOAP_11} or {@link SOAPVersion#SOAP_12}
+      * @param ex a ProtocolException
+-     * @param faultcode soap faultcode. Its ignored if the {@link ProtocolException} instance is {@link SOAPFaultException} and it has a 
++     * @param faultcode soap faultcode. Its ignored if the {@link ProtocolException} instance is {@link SOAPFaultException} and it has a
+      * faultcode present in the underlying {@link SOAPFault}.
+      * @return {@link Message} representing SOAP fault
+      */
+@@ -267,17 +281,18 @@
+ 
+     private Exception createUserDefinedException(CheckedExceptionImpl ce) {
+         Class exceptionClass = ce.getExceptionClass();
+-        try {
+-            Constructor constructor = exceptionClass.getConstructor(String.class);
+-            Object exception = constructor.newInstance(getFaultString());
+-            Node detail = getDetail().getDetails().get(0);
+-            Object jaxbDetail = getJAXBObject(detail, ce);
+-            Field[] fields = jaxbDetail.getClass().getFields();
+-            for (Field f : fields) {
+-                Method m = exceptionClass.getMethod(getWriteMethod(f));
+-                m.invoke(exception, f.get(jaxbDetail));
++        Class detailBean = ce.getDetailBean();
++        try{
++            Node detailNode = getDetail().getDetails().get(0);
++            Object jaxbDetail = getJAXBObject(detailNode, ce);
++            Constructor exConstructor;
++            try{
++                exConstructor = exceptionClass.getConstructor(String.class, detailBean);
++                return (Exception) exConstructor.newInstance(getFaultString(), jaxbDetail);
++            }catch(NoSuchMethodException e){
++                exConstructor = exceptionClass.getConstructor(String.class);
++                return (Exception) exConstructor.newInstance(getFaultString());
+             }
+-            throw (Exception) exception;
+         } catch (Exception e) {
+             throw new WebServiceException(e);
+         }
+@@ -308,8 +323,14 @@
+             Object detail = detailBean.newInstance();
+             for (Field f : fields) {
+                 Method em = exception.getClass().getMethod(getReadMethod(f));
+-                Method sm = detailBean.getMethod(getWriteMethod(f), em.getReturnType());
+-                sm.invoke(detail, em.invoke(exception));
++                try {
++                    Method sm = detailBean.getMethod(getWriteMethod(f), em.getReturnType());
++                    sm.invoke(detail, em.invoke(exception));
++                } catch(NoSuchMethodException ne) {
++                    // Try to use exception bean's public field to populate the value.
++                    Field sf = detailBean.getField(f.getName());
++                    sf.set(detail, em.invoke(exception));
++                }
+             }
+             return detail;
+         } catch (Exception e) {
+@@ -353,13 +374,16 @@
+             }
+         }
+         Element detailNode = null;
++        QName firstEntry = null;
+         if (detail == null && soapFaultException != null) {
+             detailNode = soapFaultException.getFault().getDetail();
++            firstEntry = getFirstDetailEntryName((Detail)detailNode);
+         } else if(ce != null){
+             try {
+                 DOMResult dr = new DOMResult();
+                 ce.getBridge().marshal(detail,dr);
+                 detailNode = (Element)dr.getNode().getFirstChild();
++                firstEntry = getFirstDetailEntryName(detailNode);
+             } catch (JAXBException e1) {
+                 //Should we throw Internal Server Error???
+                 faultString = e.getMessage();
+@@ -369,9 +393,25 @@
+         SOAP11Fault soap11Fault = new SOAP11Fault(faultCode, faultString, faultActor, detailNode);
+         soap11Fault.captureStackTrace(e);
+ 
+-        return JAXBMessage.create(JAXB_CONTEXT, soap11Fault, soapVersion);
++        Message msg = JAXBMessage.create(JAXB_CONTEXT, soap11Fault, soapVersion);
++        return new FaultMessage(msg, firstEntry);
+     }
+ 
++    private static @Nullable QName getFirstDetailEntryName(@Nullable Detail detail) {
++        if (detail != null) {
++            Iterator<DetailEntry> it = detail.getDetailEntries();
++            if (it.hasNext()) {
++                DetailEntry entry = it.next();
++                return getFirstDetailEntryName(entry);
++            }
++        }
++        return null;
++    }
++
++    private static @NotNull QName getFirstDetailEntryName(@NotNull Element entry) {
++        return new QName(entry.getNamespaceURI(), entry.getLocalName());
++    }
++
+     private static Message createSOAP12Fault(SOAPVersion soapVersion, Throwable e, Object detail, CheckedExceptionImpl ce, QName faultCode) {
+         SOAPFaultException soapFaultException = null;
+         CodeType code = null;
+@@ -412,7 +452,7 @@
+             faultCode = getDefaultFaultCode(soapVersion);
+             code = new CodeType(faultCode);
+         }else if(code == null){
+-            code = new CodeType(faultCode);            
++            code = new CodeType(faultCode);
+         }
+ 
+         if (faultString == null) {
+@@ -424,13 +464,16 @@
+ 
+         ReasonType reason = new ReasonType(faultString);
+         Element detailNode = null;
++        QName firstEntry = null;
+         if (detail == null && soapFaultException != null) {
+             detailNode = soapFaultException.getFault().getDetail();
++            firstEntry = getFirstDetailEntryName((Detail)detailNode);
+         } else if(detail != null){
+             try {
+                 DOMResult dr = new DOMResult();
+                 ce.getBridge().marshal(detail, dr);
+                 detailNode = (Element)dr.getNode().getFirstChild();
++                firstEntry = getFirstDetailEntryName(detailNode);
+             } catch (JAXBException e1) {
+                 //Should we throw Internal Server Error???
+                 faultString = e.getMessage();
+@@ -437,13 +480,12 @@
+                 faultCode = getDefaultFaultCode(soapVersion);
+             }
+         }
+-        DetailType detailType = null;
+-        if(detailNode != null)
+-            detailType = new DetailType(detailNode);
+-        SOAP12Fault soap12Fault = new SOAP12Fault(code, reason, null, faultRole, detailType);
++
++        SOAP12Fault soap12Fault = new SOAP12Fault(code, reason, null, faultRole, detailNode);
+         soap12Fault.captureStackTrace(e);
+ 
+-        return JAXBMessage.create(JAXB_CONTEXT, soap12Fault, soapVersion);
++        Message msg = JAXBMessage.create(JAXB_CONTEXT, soap12Fault, soapVersion);
++        return new FaultMessage(msg, firstEntry);
+     }
+ 
+     private static SubcodeType fillSubcodes(SubcodeType parent, QName value){
+--- old/src/share/classes/com/sun/xml/internal/ws/handler/ClientLogicalHandlerTube.java	Thu Jul 30 18:28:48 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/ClientLogicalHandlerTube.java	Thu Jul 30 18:28:48 2009
+@@ -23,7 +23,6 @@
+  * have any questions.
+  */
+ 
+-
+ package com.sun.xml.internal.ws.handler;
+ 
+ import com.sun.xml.internal.ws.api.WSBinding;
+@@ -36,6 +35,7 @@
+ 
+ import javax.xml.ws.handler.LogicalHandler;
+ import javax.xml.ws.handler.MessageContext;
++import javax.xml.ws.handler.Handler;
+ import javax.xml.ws.WebServiceException;
+ import java.util.List;
+ import java.util.ArrayList;
+@@ -47,7 +47,6 @@
+ public class ClientLogicalHandlerTube extends HandlerTube {
+ 
+     private WSBinding binding;
+-    private List<LogicalHandler> logicalHandlers;
+ 
+     /**
+      * Creates a new instance of LogicalHandlerTube
+@@ -78,57 +77,13 @@
+         this.binding = that.binding;
+     }
+ 
+-    boolean isHandlerChainEmpty() {
+-        return logicalHandlers.isEmpty();
++    //should be overridden by DriverHandlerTubes
++    @Override
++    protected void initiateClosing(MessageContext mc) {
++      close(mc);
++      super.initiateClosing(mc);
+     }
+ 
+-    /**
+-     * Close SOAPHandlers first and then LogicalHandlers on Client
+-     * Close LogicalHandlers first and then SOAPHandlers on Server
+-     */
+-    public void close(MessageContext msgContext) {
+-        //assuming cousinTube is called if requestProcessingSucessful is true
+-        if (requestProcessingSucessful) {
+-            //cousinTube is null in XML/HTTP Binding
+-            if (cousinTube != null) {
+-                // Close SOAPHandlerTube
+-                cousinTube.closeCall(msgContext);
+-            }
+-        }
+-        if (processor != null)
+-            closeLogicalHandlers(msgContext);
+-
+-    }
+-
+-    /**
+-     * This is called from cousinTube.
+-     * Close this Tubes's handlers.
+-     */
+-    public void closeCall(MessageContext msgContext) {
+-        closeLogicalHandlers(msgContext);
+-    }
+-
+-    //TODO:
+-    private void closeLogicalHandlers(MessageContext msgContext) {
+-        if (processor == null)
+-            return;
+-        if (remedyActionTaken) {
+-            //Close only invoked handlers in the chain
+-
+-            //CLIENT-SIDE
+-            processor.closeHandlers(msgContext, processor.getIndex(), 0);
+-            processor.setIndex(-1);
+-            //reset remedyActionTaken
+-            remedyActionTaken = false;
+-        } else {
+-            //Close all handlers in the chain
+-
+-            //CLIENT-SIDE
+-            processor.closeHandlers(msgContext, logicalHandlers.size() - 1, 0);
+-
+-        }
+-    }
+-
+     public AbstractFilterTubeImpl copy(TubeCloner cloner) {
+         return new ClientLogicalHandlerTube(this, cloner);
+     }
+@@ -136,16 +91,16 @@
+     void setUpProcessor() {
+         // Take a snapshot, User may change chain after invocation, Same chain
+         // should be used for the entire MEP
+-        logicalHandlers = new ArrayList<LogicalHandler>();
++        handlers = new ArrayList<Handler>();
+         List<LogicalHandler> logicalSnapShot= ((BindingImpl) binding).getHandlerConfig().getLogicalHandlers();
+         if (!logicalSnapShot.isEmpty()) {
+-            logicalHandlers.addAll(logicalSnapShot);
++            handlers.addAll(logicalSnapShot);
+             if (binding.getSOAPVersion() == null) {
+                 processor = new XMLHandlerProcessor(this, binding,
+-                        logicalHandlers);
++                        handlers);
+             } else {
+                 processor = new SOAPHandlerProcessor(true, this, binding,
+-                        logicalHandlers);
++                        handlers);
+             }
+         }
+     }
+@@ -193,4 +148,8 @@
+ 
+         }
+     }
++    void closeHandlers(MessageContext mc) {
++        closeClientsideHandlers(mc);
++
++    }
+ }
+--- old/src/share/classes/com/sun/xml/internal/ws/handler/ClientSOAPHandlerTube.java	Thu Jul 30 18:28:52 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/ClientSOAPHandlerTube.java	Thu Jul 30 18:28:51 2009
+@@ -23,7 +23,6 @@
+  * have any questions.
+  */
+ 
+-
+ package com.sun.xml.internal.ws.handler;
+ 
+ import com.sun.xml.internal.ws.api.WSBinding;
+@@ -40,6 +39,7 @@
+ 
+ import javax.xml.ws.handler.soap.SOAPHandler;
+ import javax.xml.ws.handler.MessageContext;
++import javax.xml.ws.handler.Handler;
+ import javax.xml.ws.WebServiceException;
+ import javax.activation.DataHandler;
+ import java.util.*;
+@@ -51,7 +51,6 @@
+ public class ClientSOAPHandlerTube extends HandlerTube {
+ 
+     private WSBinding binding;
+-    private List<SOAPHandler> soapHandlers;
+     private Set<String> roles;
+ 
+     /**
+@@ -87,47 +86,7 @@
+         this.binding = that.binding;
+     }
+ 
+-    boolean isHandlerChainEmpty() {
+-        return soapHandlers.isEmpty();
+-    }
+-
+-    /**
+-     * Close SOAPHandlers first and then LogicalHandlers on Client
+-     * Close LogicalHandlers first and then SOAPHandlers on Server
+-     */
+-    public void close(MessageContext msgContext) {
+-
+-    }
+-
+-    /**
+-     * This is called from cousinTube.
+-     * Close this Tube's handlers.
+-     */
+-    public void closeCall(MessageContext msgContext) {
+-        closeSOAPHandlers(msgContext);
+-    }
+-
+-    //TODO:
+-    private void closeSOAPHandlers(MessageContext msgContext) {
+-        if (processor == null)
+-            return;
+-        if (remedyActionTaken) {
+-            //Close only invoked handlers in the chain
+-
+-            //CLIENT-SIDE
+-            processor.closeHandlers(msgContext, processor.getIndex(), 0);
+-            processor.setIndex(-1);
+-            //reset remedyActionTaken
+-            remedyActionTaken = false;
+-        } else {
+-            //Close all handlers in the chain
+-
+-            //CLIENT-SIDE
+-            processor.closeHandlers(msgContext, soapHandlers.size() - 1, 0);
+-        }
+-    }
+-
+-    public AbstractFilterTubeImpl copy(TubeCloner cloner) {
++   public AbstractFilterTubeImpl copy(TubeCloner cloner) {
+         return new ClientSOAPHandlerTube(this, cloner);
+     }
+ 
+@@ -134,20 +93,19 @@
+     void setUpProcessor() {
+         // Take a snapshot, User may change chain after invocation, Same chain
+         // should be used for the entire MEP
+-        soapHandlers = new ArrayList<SOAPHandler>();
++        handlers = new ArrayList<Handler>();
+         HandlerConfiguration handlerConfig = ((BindingImpl) binding).getHandlerConfig();
+         List<SOAPHandler> soapSnapShot= handlerConfig.getSoapHandlers();
+         if (!soapSnapShot.isEmpty()) {
+-            soapHandlers.addAll(soapSnapShot);
++            handlers.addAll(soapSnapShot);
+             roles = new HashSet<String>();
+             roles.addAll(handlerConfig.getRoles());
+-            processor = new SOAPHandlerProcessor(true, this, binding, soapHandlers);
++            processor = new SOAPHandlerProcessor(true, this, binding, handlers);
+         }
+     }
+ 
+     MessageUpdatableContext getContext(Packet packet) {
+-        SOAPMessageContextImpl context = new SOAPMessageContextImpl(binding, packet);
+-        context.setRoles(roles);
++        SOAPMessageContextImpl context = new SOAPMessageContextImpl(binding, packet,roles);
+         return context;
+     }
+ 
+@@ -158,8 +116,10 @@
+         Map<String, DataHandler> atts = (Map<String, DataHandler>) context.get(MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS);
+         AttachmentSet attSet = packet.getMessage().getAttachments();
+         for(String cid : atts.keySet()){
+-            Attachment att = new DataHandlerAttachment(cid, atts.get(cid));
+-            attSet.add(att);
++            if (attSet.get(cid) == null) {  // Otherwise we would be adding attachments twice
++                Attachment att = new DataHandlerAttachment(cid, atts.get(cid));
++                attSet.add(att);
++            }
+         }
+ 
+         try {
+@@ -194,4 +154,9 @@
+             throw new WebServiceException(re);
+         }
+     }
++
++    void closeHandlers(MessageContext mc) {
++        closeClientsideHandlers(mc);
++
++    }
+ }
+--- old/src/share/classes/com/sun/xml/internal/ws/handler/HandlerChainsModel.java	Thu Jul 30 18:28:55 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/HandlerChainsModel.java	Thu Jul 30 18:28:55 2009
+@@ -51,7 +51,7 @@
+ public class HandlerChainsModel {
+     private static final Logger logger = Logger.getLogger(
+             com.sun.xml.internal.ws.util.Constants.LoggingDomain + ".util");
+-    
++
+     private Class annotatedClass;
+     private List<HandlerChainType> handlerChains;
+     private String id;
+@@ -59,7 +59,7 @@
+     private HandlerChainsModel(Class annotatedClass) {
+         this.annotatedClass = annotatedClass;
+     }
+-    
++
+     private List<HandlerChainType> getHandlerChain() {
+         if (handlerChains == null) {
+             handlerChains = new ArrayList<HandlerChainType>();
+@@ -66,11 +66,11 @@
+         }
+         return handlerChains;
+     }
+-    
++
+     public String getId() {
+         return id;
+     }
+-    
++
+     public void setId(String value) {
+         this.id = value;
+     }
+--- old/src/share/classes/com/sun/xml/internal/ws/handler/HandlerProcessor.java	Thu Jul 30 18:28:59 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/HandlerProcessor.java	Thu Jul 30 18:28:58 2009
+@@ -132,7 +132,7 @@
+                 reverseDirection(direction, context);
+                 //Set handleFault so that cousinTube is aware of fault
+                 setHandleFaultProperty();
+-                // call handle fault                
++                // call handle fault
+                 if (direction == Direction.OUTBOUND) {
+                     callHandleFault(context, getIndex() - 1, 0);
+                 } else {
+@@ -177,7 +177,7 @@
+      * throw RuntimeException, this happens when a RuntimeException occurs during
+      * normal Response processing or remedy action 2) taken
+      * during callHandlersRequest().
+-     * CurrentPipe should close all the handlers in the chain.     * 
++     * CurrentPipe should close all the handlers in the chain.     *
+      */
+     public void callHandlersResponse(Direction direction,
+                                      C context, boolean isFault) {
+@@ -191,7 +191,7 @@
+                     callHandleFault(context, handlers.size() - 1, 0);
+                 }
+             } else {
+-                // call handleMessage on handlers                
++                // call handleMessage on handlers
+                 if (direction == Direction.OUTBOUND) {
+                     callHandleMessageReverse(context, 0, handlers.size() - 1);
+                 } else {
+--- old/src/share/classes/com/sun/xml/internal/ws/handler/HandlerTube.java	Thu Jul 30 18:29:02 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/HandlerTube.java	Thu Jul 30 18:29:02 2009
+@@ -32,6 +32,8 @@
+ import com.sun.xml.internal.ws.api.pipe.helper.AbstractFilterTubeImpl;
+ 
+ import javax.xml.ws.handler.MessageContext;
++import javax.xml.ws.handler.Handler;
++import java.util.List;
+ 
+ /**
+  * @author WS Development team
+@@ -38,14 +40,14 @@
+  */
+ 
+ public abstract class HandlerTube extends AbstractFilterTubeImpl {
+-    
+     /**
+      * handle hold reference to other Tube for inter-tube communication
+      */
+     HandlerTube cousinTube;
++    protected List<Handler> handlers;
+     HandlerProcessor processor;
+     boolean remedyActionTaken = false;
+-    private final @Nullable WSDLPort port;
++    protected final @Nullable WSDLPort port;
+     // flag used to decide whether to call close on cousinTube
+     boolean requestProcessingSucessful = false;
+ 
+@@ -76,7 +78,7 @@
+         if(that.cousinTube != null) {
+             this.cousinTube = cloner.copy(that.cousinTube);
+         }
+-        this.port = that.port;        
++        this.port = that.port;
+     }
+ 
+     @Override
+@@ -109,7 +111,7 @@
+                 }
+             }
+             requestProcessingSucessful = true;
+-            // Call next Tube 
++            // Call next Tube
+             return doInvoke(super.next, packet);
+         } catch (RuntimeException re) {
+             if(isOneWay) {
+@@ -123,7 +125,7 @@
+                 throw re;
+         } finally {
+             if(!requestProcessingSucessful) {
+-                cleanUpState(context.getMessageContext());
++                initiateClosing(context.getMessageContext());
+             }
+         }
+ 
+@@ -147,7 +149,7 @@
+                 callHandlersOnResponse(context, isFault);
+             }
+         } finally {
+-            cleanUpState(context.getMessageContext());
++            initiateClosing(context.getMessageContext());
+         }
+         //Update Packet with user modifications
+         context.updatePacket();
+@@ -162,7 +164,7 @@
+             return doThrow(t);
+         } finally {
+             MessageUpdatableContext context = getContext(packet);
+-            cleanUpState(context.getMessageContext());
++            initiateClosing(context.getMessageContext());
+             /* TODO revisit: commented this out as the modified packet is no longer used
+                     In future if the message is propagated even when an exception
+                     occurs, then uncomment context.updatePacket();
+@@ -175,18 +177,100 @@
+     }
+ 
+     /**
++     * Must be overridden by HandlerTube that drives other handler tubes for processing a message.
++     * On Client-side: ClientLogicalHandlerTube drives the Handler Processing.
++     * On Server-side: In case SOAP Binding, ServerMessageHandlerTube drives the Handler Processing.
++     *                 In case XML/HTTP Binding, ServerLogicalHandlerTube drives the Handler Processing.
++     *
++     *
++     * If its a top HandlerTube, should override by calling #close(MessaggeContext);
++     *
++     */
++
++    protected void initiateClosing(MessageContext mc) {
++        // Do nothing
++
++    }
++
++    /**
+      * Calls close on previously invoked handlers.
+      * Also, Cleans up any state left over in the Tube instance from the current
+      * invocation, as Tube instances can be reused after the completion of MEP.
+      *
++     * On Client, SOAPHandlers are closed first and then LogicalHandlers
++     * On Server, LogicalHandlers are closed first and then SOAPHandlers
+      */
+-    private void cleanUpState(MessageContext mc) {
+-        close(mc);
++    final public void close(MessageContext msgContext) {
++        //assuming cousinTube is called if requestProcessingSucessful is true
++        if (requestProcessingSucessful) {
++            if (cousinTube != null) {
++                cousinTube.close(msgContext);
++            }
++
++        }
++        if (processor != null)
++            closeHandlers(msgContext);
++
+         // Clean up the exchange for next invocation.
+         exchange = null;
+         requestProcessingSucessful = false;
++
+     }
+ 
++    /**
++     * On Client, Override by calling #closeClientHandlers(MessageContext mc)
++     * On Server, Override by calling #closeServerHandlers(MessageContext mc)
++     *      The difference is the order in which they are closed.
++     * @param mc
++     */
++    abstract void closeHandlers(MessageContext mc);
++
++    /**
++     * Called by close(MessageContext mc) in a Client Handlertube
++     */
++    protected void closeClientsideHandlers(MessageContext msgContext) {
++         if (processor == null)
++            return;
++        if (remedyActionTaken) {
++            //Close only invoked handlers in the chain
++
++            //CLIENT-SIDE
++            processor.closeHandlers(msgContext, processor.getIndex(), 0);
++            processor.setIndex(-1);
++            //reset remedyActionTaken
++            remedyActionTaken = false;
++        } else {
++            //Close all handlers in the chain
++
++            //CLIENT-SIDE
++            processor.closeHandlers(msgContext, handlers.size() - 1, 0);
++
++        }
++    }
++
++    /**
++     * Called by close(MessageContext mc) in a Server Handlertube
++     */
++    protected void closeServersideHandlers(MessageContext msgContext) {
++        if (processor == null)
++            return;
++        if (remedyActionTaken) {
++            //Close only invoked handlers in the chain
++
++            //SERVER-SIDE
++            processor.closeHandlers(msgContext, processor.getIndex(), handlers.size() - 1);
++            processor.setIndex(-1);
++            //reset remedyActionTaken
++            remedyActionTaken = false;
++        } else {
++            //Close all handlers in the chain
++
++            //SERVER-SIDE
++            processor.closeHandlers(msgContext, 0, handlers.size() - 1);
++
++        }
++    }
++
+     abstract void callHandlersOnResponse(MessageUpdatableContext context, boolean handleFault);
+ 
+     abstract boolean callHandlersOnRequest(MessageUpdatableContext context, boolean oneWay);
+@@ -200,25 +284,15 @@
+               otherwise use this value as an approximation, since this carries
+               the appliation's intention --- whether it was invokeOneway vs invoke,etc.
+              */
+-            return (packet.expectReply != null && packet.expectReply);
++            return !(packet.expectReply != null && packet.expectReply);
+         }
+     }
+ 
+     abstract void setUpProcessor();
+-    abstract boolean isHandlerChainEmpty();
++    final public boolean isHandlerChainEmpty() {
++        return handlers.isEmpty();
++    }
+     abstract MessageUpdatableContext getContext(Packet p);
+-    
+-    /**
+-     * Close SOAPHandlers first and then LogicalHandlers on Client
+-     * Close LogicalHandlers first and then SOAPHandlers on Server
+-     */
+-    protected abstract void close(MessageContext msgContext);
+-    
+-    /**
+-     * This is called from cousinTube.
+-     * Close this Tube's handlers.
+-     */
+-    protected abstract void closeCall(MessageContext msgContext);
+ 
+     private boolean isHandleFault(Packet packet) {
+         if (cousinTube != null) {
+@@ -248,7 +322,12 @@
+             if(cousinTube != null) {
+                 cousinTube.exchange = exchange;
+             }
+-        }        
++        } else {
++            if(cousinTube != null) {
++                cousinTube.exchange = exchange;
++            }
++
++        }
+     }
+     private HandlerTubeExchange exchange;
+ 
+@@ -276,5 +355,5 @@
+             this.handleFalse = true;
+         }
+     }
+-    
++
+ }
+--- old/src/share/classes/com/sun/xml/internal/ws/handler/LogicalMessageImpl.java	Thu Jul 30 18:29:06 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/LogicalMessageImpl.java	Thu Jul 30 18:29:05 2009
+@@ -64,13 +64,13 @@
+     private Source payloadSrc = null;
+     // Flag to check if the PayloadSrc is accessed/modified
+     private boolean payloadModifed = false;
+-        
++
+     /** Creates a new instance of LogicalMessageImplRearch */
+     public LogicalMessageImpl(Packet packet) {
+         // don't create extract payload until Users wants it.
+         this.packet = packet;
+     }
+-    
++
+     boolean isPayloadModifed(){
+         return payloadModifed;
+     }
+@@ -78,9 +78,9 @@
+         if(!payloadModifed)
+             throw new RuntimeException("Payload not modified.");
+         return payloadSrc;
+-        
++
+     }
+-    public Source getPayload() {                
++    public Source getPayload() {
+         if(!payloadModifed) {
+             payloadSrc = packet.getMessage().readPayloadAsSource();
+             payloadModifed = true;
+@@ -110,13 +110,13 @@
+         return copySrc;
+          */
+     }
+-    
++
+     public void setPayload(Source payload) {
+         payloadModifed = true;
+         payloadSrc = payload;
+     }
+     /*
+-     * Converts to DOMSource and then it unmarshalls this  DOMSource 
++     * Converts to DOMSource and then it unmarshalls this  DOMSource
+      * to a jaxb object. Any changes done in jaxb object are lost if
+      * the object isn't set again.
+      */
+@@ -124,7 +124,7 @@
+         try {
+             Source payloadSrc = getPayload();
+             if(payloadSrc == null)
+-                return null; 
++                return null;
+             Unmarshaller unmarshaller = context.createUnmarshaller();
+             return unmarshaller.unmarshal(payloadSrc);
+         } catch (JAXBException e){
+@@ -131,7 +131,7 @@
+             throw new WebServiceException(e);
+         }
+     }
+-    
++
+     public void setPayload(Object payload, JAXBContext context) {
+         payloadModifed = true;
+         try {
+@@ -142,7 +142,7 @@
+             payloadSrc = new DOMSource(domResult.getNode());
+         } catch(JAXBException e) {
+             throw new WebServiceException(e);
+-        }        
++        }
+     }
+     /*
+     private Source copy(Source src) {
+--- old/src/share/classes/com/sun/xml/internal/ws/handler/MessageUpdatableContext.java	Thu Jul 30 18:29:09 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/MessageUpdatableContext.java	Thu Jul 30 18:29:09 2009
+@@ -45,7 +45,7 @@
+         ctxt = new MessageContextImpl(packet);
+         this.packet = packet;
+     }
+-    
++
+     /**
+      * Fill a {@link Packet} with values of this {@link MessageContext}.
+      */
+@@ -55,8 +55,8 @@
+     /**
+      * Updates Message in the packet with user modifications
+      */
+-    abstract void updateMessage(); 
+-    
++    abstract void updateMessage();
++
+     /**
+      * Updates Message in the packet with user modifications
+      * returns the new packet's message
+@@ -65,15 +65,15 @@
+         updateMessage();
+         return packet.getMessage();
+     }
+-    
++
+     /**
+      * Sets Message in the packet
+-     * Any user modifications done on previous Message are lost. 
++     * Any user modifications done on previous Message are lost.
+      */
+     abstract void setPacketMessage(Message newMessage);
+-    
++
+     /**
+-     * Updates the complete packet with user modfications to the message and 
++     * Updates the complete packet with user modfications to the message and
+      * properties cahnges in MessageContext
+      */
+     final void updatePacket() {
+@@ -80,11 +80,11 @@
+         updateMessage();
+         fill(packet);
+     }
+-    
++
+     MessageContextImpl getMessageContext() {
+         return ctxt;
+     }
+-    
++
+     public void setScope(String name, Scope scope) {
+         ctxt.setScope(name, scope);
+     }
+@@ -142,5 +142,5 @@
+     public Collection<Object> values() {
+         return ctxt.values();
+     }
+-    
++
+ }
+--- old/src/share/classes/com/sun/xml/internal/ws/handler/PortInfoImpl.java	Thu Jul 30 18:29:13 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/PortInfoImpl.java	Thu Jul 30 18:29:12 2009
+@@ -118,5 +118,5 @@
+     public int hashCode() {
+         return bindingId.hashCode();
+     }
+-    
++
+ }
+--- old/src/share/classes/com/sun/xml/internal/ws/handler/SOAPHandlerProcessor.java	Thu Jul 30 18:29:16 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/SOAPHandlerProcessor.java	Thu Jul 30 18:29:16 2009
+@@ -58,7 +58,7 @@
+         super(owner, binding, chain);
+         this.isClient = isClient;
+     }
+-    
++
+     /**
+      * Replace the message in the given message context with a
+      * fault message. If the context already contains a fault
+@@ -88,7 +88,7 @@
+             throw new RuntimeException(e);
+         }
+     }
+-    
++
+     /**
+      * <p>Figure out if the fault code local part is client,
+      * server, sender, receiver, etc. This is called by
+--- old/src/share/classes/com/sun/xml/internal/ws/handler/SOAPMessageContextImpl.java	Thu Jul 30 18:29:20 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/SOAPMessageContextImpl.java	Thu Jul 30 18:29:19 2009
+@@ -56,9 +56,10 @@
+     private SOAPMessage soapMsg = null;
+     private WSBinding binding;
+ 
+-    public SOAPMessageContextImpl(WSBinding binding, Packet packet) {
++    public SOAPMessageContextImpl(WSBinding binding, Packet packet,Set<String> roles) {
+         super(packet);
+-        this.binding = binding;        
++        this.binding = binding;
++        this.roles = roles;
+     }
+ 
+     public SOAPMessage getMessage() {
+@@ -79,7 +80,7 @@
+             throw new WebServiceException(e);
+         }
+     }
+-    
++
+     void setPacketMessage(Message newMessage){
+         if(newMessage != null) {
+             packet.setMessage(newMessage);
+@@ -86,7 +87,7 @@
+             soapMsg = null;
+         }
+     }
+-    
++
+     protected void updateMessage() {
+         //Check if SOAPMessage has changed, if so construct new one,
+         // Packet are handled through MessageContext
+@@ -125,8 +126,4 @@
+     public Set<String> getRoles() {
+         return roles;
+     }
+-
+-    void setRoles(Set<String> roles) {
+-        this.roles = roles;
+-    }    
+ }
+--- old/src/share/classes/com/sun/xml/internal/ws/handler/ServerLogicalHandlerTube.java	Thu Jul 30 18:29:24 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/ServerLogicalHandlerTube.java	Thu Jul 30 18:29:23 2009
+@@ -23,7 +23,6 @@
+  * have any questions.
+  */
+ 
+-
+ package com.sun.xml.internal.ws.handler;
+ 
+ import com.sun.xml.internal.ws.api.WSBinding;
+@@ -39,6 +38,7 @@
+ 
+ import javax.xml.ws.handler.LogicalHandler;
+ import javax.xml.ws.handler.MessageContext;
++import javax.xml.ws.handler.Handler;
+ import javax.xml.ws.WebServiceException;
+ import javax.activation.DataHandler;
+ import java.util.List;
+@@ -52,7 +52,6 @@
+ public class ServerLogicalHandlerTube extends HandlerTube {
+ 
+     private WSBinding binding;
+-    private List<LogicalHandler> logicalHandlers;
+ 
+     /**
+      * Creates a new instance of LogicalHandlerTube
+@@ -60,7 +59,7 @@
+     public ServerLogicalHandlerTube(WSBinding binding, WSDLPort port, Tube next) {
+         super(next, port);
+         this.binding = binding;
+-        setUpProcessorOnce();
++        setUpHandlersOnce();
+     }
+ 
+     /**
+@@ -73,7 +72,7 @@
+     public ServerLogicalHandlerTube(WSBinding binding, Tube next, HandlerTube cousinTube) {
+         super(next, cousinTube);
+         this.binding = binding;
+-        setUpProcessorOnce();
++        setUpHandlersOnce();
+     }
+ 
+     /**
+@@ -83,78 +82,43 @@
+     private ServerLogicalHandlerTube(ServerLogicalHandlerTube that, TubeCloner cloner) {
+         super(that, cloner);
+         this.binding = that.binding;
+-        setUpProcessorOnce();
++        this.handlers = that.handlers;
+     }
+ 
+-    boolean isHandlerChainEmpty() {
+-        return logicalHandlers.isEmpty();
+-    }
+-
+-    /**
+-     * Close SOAPHandlers first and then LogicalHandlers on Client
+-     * Close LogicalHandlers first and then SOAPHandlers on Server
+-     */
+-    public void close(MessageContext msgContext) {
+-
+-        if (binding.getSOAPVersion() != null) {
+-            //SOAPHandlerTube will drive the closing of LogicalHandlerTube
++    //should be overridden by DriverHandlerTubes
++    @Override
++    protected void initiateClosing(MessageContext mc) {
++         if (binding.getSOAPVersion() != null) {
++            super.initiateClosing(mc);
+         } else {
+-            if (processor != null)
+-                closeLogicalHandlers(msgContext);
++            close(mc);
++            super.initiateClosing(mc);
+         }
+-
+     }
+ 
+-    /**
+-     * This is called from cousinTube.
+-     * Close this Tube's handlers.
+-     */
+-    public void closeCall(MessageContext msgContext) {
+-        closeLogicalHandlers(msgContext);
+-    }
+-
+-    //TODO:
+-    private void closeLogicalHandlers(MessageContext msgContext) {
+-        if (processor == null)
+-            return;
+-        if (remedyActionTaken) {
+-            //Close only invoked handlers in the chain
+-            //SERVER-SIDE
+-            processor.closeHandlers(msgContext, processor.getIndex(), logicalHandlers.size() - 1);
+-            processor.setIndex(-1);
+-            //reset remedyActionTaken
+-            remedyActionTaken = false;
+-        } else {
+-            //Close all handlers in the chain
+-            //SERVER-SIDE
+-            processor.closeHandlers(msgContext, 0, logicalHandlers.size() - 1);
+-
+-        }
+-    }
+-
+-    public AbstractFilterTubeImpl copy(TubeCloner cloner) {
++   public AbstractFilterTubeImpl copy(TubeCloner cloner) {
+         return new ServerLogicalHandlerTube(this, cloner);
+     }
+ 
+-    private void setUpProcessorOnce() {
+-        logicalHandlers = new ArrayList<LogicalHandler>();
++    private void setUpHandlersOnce() {
++        handlers = new ArrayList<Handler>();
+         List<LogicalHandler> logicalSnapShot= ((BindingImpl) binding).getHandlerConfig().getLogicalHandlers();
+         if (!logicalSnapShot.isEmpty()) {
+-            logicalHandlers.addAll(logicalSnapShot);
++            handlers.addAll(logicalSnapShot);
++        }
++    }
++
++    void setUpProcessor() {
++        if (!handlers.isEmpty()) {
+             if (binding.getSOAPVersion() == null) {
+                 processor = new XMLHandlerProcessor(this, binding,
+-                        logicalHandlers);
++                        handlers);
+             } else {
+-                processor = new SOAPHandlerProcessor(false, this, binding,
+-                        logicalHandlers);
++                processor = new SOAPHandlerProcessor(false, this, binding, handlers);
+             }
+         }
+     }
+ 
+-    void setUpProcessor() {
+-     // Do nothing, Processor is setup in the constructor.
+-    }
+-
+     MessageUpdatableContext getContext(Packet packet) {
+         return new LogicalMessageContextImpl(binding, packet);
+     }
+@@ -196,4 +160,9 @@
+             throw re;
+         }
+     }
++
++    void closeHandlers(MessageContext mc) {
++        closeServersideHandlers(mc);
++
++    }
+ }
+--- old/src/share/classes/com/sun/xml/internal/ws/handler/ServerSOAPHandlerTube.java	Thu Jul 30 18:29:27 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/ServerSOAPHandlerTube.java	Thu Jul 30 18:29:26 2009
+@@ -23,7 +23,6 @@
+  * have any questions.
+  */
+ 
+-
+ package com.sun.xml.internal.ws.handler;
+ 
+ import com.sun.xml.internal.ws.api.WSBinding;
+@@ -40,6 +39,7 @@
+ 
+ import javax.xml.ws.handler.soap.SOAPHandler;
+ import javax.xml.ws.handler.MessageContext;
++import javax.xml.ws.handler.Handler;
+ import javax.xml.ws.WebServiceException;
+ import javax.activation.DataHandler;
+ import java.util.*;
+@@ -51,7 +51,6 @@
+ public class ServerSOAPHandlerTube extends HandlerTube {
+ 
+     private WSBinding binding;
+-    private List<SOAPHandler> soapHandlers;
+     private Set<String> roles;
+ 
+     /**
+@@ -64,7 +63,7 @@
+             // TODO: throw Exception
+         }
+         this.binding = binding;
+-        setUpProcessorOnce();
++        setUpHandlersOnce();
+     }
+ 
+     // Handle to LogicalHandlerTube means its used on SERVER-SIDE
+@@ -78,7 +77,7 @@
+     public ServerSOAPHandlerTube(WSBinding binding, Tube next, HandlerTube cousinTube) {
+         super(next, cousinTube);
+         this.binding = binding;
+-        setUpProcessorOnce();
++        setUpHandlersOnce();
+     }
+ 
+     /**
+@@ -87,79 +86,32 @@
+     private ServerSOAPHandlerTube(ServerSOAPHandlerTube that, TubeCloner cloner) {
+         super(that, cloner);
+         this.binding = that.binding;
+-        setUpProcessorOnce();
++        this.handlers = that.handlers;
++        this.roles = that.roles;
+     }
+ 
+-    boolean isHandlerChainEmpty() {
+-        return soapHandlers.isEmpty();
+-    }
+ 
+-    /**
+-     * Close SOAPHandlers first and then LogicalHandlers on Client
+-     * Close LogicalHandlers first and then SOAPHandlers on Server
+-     */
+-    public void close(MessageContext msgContext) {
+-        //assuming cousinTube is called if requestProcessingSucessful is true
+-        if (requestProcessingSucessful) {
+-            if (cousinTube != null) {
+-                // Close LogicalHandlerTube
+-                cousinTube.closeCall(msgContext);
+-            }
+-        }
+-        if (processor != null)
+-            closeSOAPHandlers(msgContext);
+-
+-    }
+-
+-    /**
+-     * This is called from cousinTube.
+-     * Close this Tube's handlers.
+-     */
+-    public void closeCall(MessageContext msgContext) {
+-        closeSOAPHandlers(msgContext);
+-    }
+-
+-    //TODO:
+-    private void closeSOAPHandlers(MessageContext msgContext) {
+-        if (processor == null)
+-            return;
+-        if (remedyActionTaken) {
+-            //Close only invoked handlers in the chain
+-            //SERVER-SIDE
+-            processor.closeHandlers(msgContext, processor.getIndex(), soapHandlers.size() - 1);
+-            processor.setIndex(-1);
+-            //reset remedyActionTaken
+-            remedyActionTaken = false;
+-        } else {
+-            //Close all handlers in the chain
+-            //SERVER-SIDE
+-            processor.closeHandlers(msgContext, 0, soapHandlers.size() - 1);
+-
+-        }
+-    }
+-
+     public AbstractFilterTubeImpl copy(TubeCloner cloner) {
+         return new ServerSOAPHandlerTube(this, cloner);
+     }
+ 
+-    private void setUpProcessorOnce() {
+-        soapHandlers = new ArrayList<SOAPHandler>();
++    private void setUpHandlersOnce() {
++        handlers = new ArrayList<Handler>();
+         HandlerConfiguration handlerConfig = ((BindingImpl) binding).getHandlerConfig();
+         List<SOAPHandler> soapSnapShot= handlerConfig.getSoapHandlers();
+         if (!soapSnapShot.isEmpty()) {
+-            soapHandlers.addAll(soapSnapShot);
++            handlers.addAll(soapSnapShot);
+             roles = new HashSet<String>();
+             roles.addAll(handlerConfig.getRoles());
+-            processor = new SOAPHandlerProcessor(false, this, binding, soapHandlers);
+         }
+     }
+ 
+     void setUpProcessor() {
+-        // Do nothing, Processor is setup in the constructor.
++        if(!handlers.isEmpty())
++            processor = new SOAPHandlerProcessor(false, this, binding, handlers);
+     }
+     MessageUpdatableContext getContext(Packet packet) {
+-        SOAPMessageContextImpl context = new SOAPMessageContextImpl(binding, packet);
+-        context.setRoles(roles);
++        SOAPMessageContextImpl context = new SOAPMessageContextImpl(binding, packet,roles);
+         return context;
+     }
+ 
+@@ -187,8 +139,10 @@
+         Map<String, DataHandler> atts = (Map<String, DataHandler>) context.get(MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS);
+         AttachmentSet attSet = packet.getMessage().getAttachments();
+         for(String cid : atts.keySet()){
+-            Attachment att = new DataHandlerAttachment(cid, atts.get(cid));
+-            attSet.add(att);
++            if (attSet.get(cid) == null) { // Otherwise we would be adding attachments twice
++                Attachment att = new DataHandlerAttachment(cid, atts.get(cid));
++                attSet.add(att);
++            }
+         }
+ 
+         try {
+@@ -203,4 +157,9 @@
+ 
+         }
+     }
++
++    void closeHandlers(MessageContext mc) {
++        closeServersideHandlers(mc);
++
++    }
+ }
+--- old/src/share/classes/com/sun/xml/internal/ws/handler/XMLHandlerProcessor.java	Thu Jul 30 18:29:31 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/XMLHandlerProcessor.java	Thu Jul 30 18:29:30 2009
+@@ -27,7 +27,7 @@
+  * LogicalHandlerProcessor.java
+  *
+  * Created on February 8, 2006, 5:40 PM
+- * 
++ *
+  */
+ 
+ package com.sun.xml.internal.ws.handler;
+@@ -45,7 +45,7 @@
+  * @author WS Development Team
+  */
+ final class XMLHandlerProcessor<C extends MessageUpdatableContext> extends HandlerProcessor<C> {
+-    
++
+     /**
+      * Creates a new instance of LogicalHandlerProcessor
+      */
+@@ -52,7 +52,7 @@
+     public XMLHandlerProcessor(HandlerTube owner, WSBinding binding, List<? extends Handler> chain) {
+         super(owner, binding, chain);
+     }
+-    
++
+     /*
+      * TODO: This is valid only for XML/HTTP binding
+      * Empty the XML message
+@@ -64,7 +64,7 @@
+         }
+         if (context != null) {
+             // non-soap case
+-            context.setPacketMessage(Messages.createEmpty(binding.getSOAPVersion()));            
+-        }        
++            context.setPacketMessage(Messages.createEmpty(binding.getSOAPVersion()));
++        }
+     }
+ }
+--- old/src/share/classes/com/sun/xml/internal/ws/message/AttachmentSetImpl.java	Thu Jul 30 18:29:34 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/message/AttachmentSetImpl.java	Thu Jul 30 18:29:33 2009
+@@ -42,7 +42,7 @@
+ public final class AttachmentSetImpl implements AttachmentSet {
+ 
+     private final ArrayList<Attachment> attList = new ArrayList<Attachment>();
+-    
++
+     /**
+      * Creates an empty {@link AttachmentSet}.
+      */
+--- old/src/share/classes/com/sun/xml/internal/ws/message/AttachmentUnmarshallerImpl.java	Thu Jul 30 18:29:38 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/message/AttachmentUnmarshallerImpl.java	Thu Jul 30 18:29:37 2009
+@@ -74,9 +74,4 @@
+         return cid;
+     }
+ 
+-    // TODO fix the hack
+-    // So that SAAJ registers DCHs for MIME types
+-    static {
+-        new com.sun.xml.internal.messaging.saaj.soap.AttachmentPartImpl();
+-    }
+ }
+--- old/src/share/classes/com/sun/xml/internal/ws/message/ByteArrayAttachment.java	Thu Jul 30 18:29:41 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/message/ByteArrayAttachment.java	Thu Jul 30 18:29:40 2009
+@@ -28,6 +28,8 @@
+ import com.sun.istack.internal.NotNull;
+ import com.sun.xml.internal.ws.api.message.Attachment;
+ import com.sun.xml.internal.ws.util.ByteArrayDataSource;
++import com.sun.xml.internal.ws.encoding.DataSourceStreamingDataHandler;
++
+ import java.io.ByteArrayInputStream;
+ 
+ import javax.activation.DataHandler;
+@@ -36,8 +38,6 @@
+ import javax.xml.soap.SOAPMessage;
+ import javax.xml.transform.Source;
+ import javax.xml.transform.stream.StreamSource;
+-import javax.xml.ws.WebServiceException;
+-import java.io.ByteArrayOutputStream;
+ import java.io.IOException;
+ import java.io.InputStream;
+ import java.io.OutputStream;
+@@ -60,7 +60,7 @@
+         this.len = len;
+         this.mimeType = mimeType;
+     }
+-    
++
+     public ByteArrayAttachment(@NotNull String contentId, byte[] data, String mimeType) {
+         this(contentId, data, 0, data.length, mimeType);
+     }
+@@ -85,7 +85,7 @@
+     }
+ 
+     public DataHandler asDataHandler() {
+-        return new DataHandler(new ByteArrayDataSource(data,start,len,getContentType()));
++        return new DataSourceStreamingDataHandler(new ByteArrayDataSource(data,start,len,getContentType()));
+     }
+ 
+     public Source asSource() {
+--- old/src/share/classes/com/sun/xml/internal/ws/message/DOMHeader.java	Thu Jul 30 18:29:45 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/message/DOMHeader.java	Thu Jul 30 18:29:44 2009
+@@ -26,9 +26,7 @@
+ package com.sun.xml.internal.ws.message;
+ 
+ import com.sun.xml.internal.bind.api.Bridge;
+-import com.sun.xml.internal.bind.api.BridgeContext;
+ import com.sun.xml.internal.bind.unmarshaller.DOMScanner;
+-import com.sun.xml.internal.messaging.saaj.packaging.mime.Header;
+ import com.sun.xml.internal.ws.streaming.DOMStreamReader;
+ import com.sun.xml.internal.ws.util.DOMUtil;
+ import org.w3c.dom.Element;
+@@ -47,7 +45,7 @@
+ import javax.xml.stream.XMLStreamWriter;
+ 
+ /**
+- * {@link Header} implementation for a DOM.
++ * {@link com.sun.xml.internal.ws.api.message.Header} implementation for a DOM.
+  *
+  * @author Kohsuke Kawaguchi
+  */
+--- old/src/share/classes/com/sun/xml/internal/ws/message/DataHandlerAttachment.java	Thu Jul 30 18:29:48 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/message/DataHandlerAttachment.java	Thu Jul 30 18:29:48 2009
+@@ -45,11 +45,6 @@
+  * @author Jitendra Kotamraju
+  */
+ public final class DataHandlerAttachment implements Attachment {
+-    // TODO fix the hack
+-    // So that SAAJ registers DCHs for MIME types
+-    static {
+-        new com.sun.xml.internal.messaging.saaj.soap.AttachmentPartImpl();
+-    }
+ 
+     private final DataHandler dh;
+     private final String contentId;
+@@ -101,7 +96,7 @@
+     }
+ 
+     public void writeTo(OutputStream os) throws IOException {
+-        os.write(asByteArray());
++        dh.writeTo(os);
+     }
+ 
+     public void writeTo(SOAPMessage saaj) throws SOAPException {
+--- old/src/share/classes/com/sun/xml/internal/ws/message/EmptyMessageImpl.java	Thu Jul 30 18:29:52 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/message/EmptyMessageImpl.java	Thu Jul 30 18:29:51 2009
+@@ -44,7 +44,7 @@
+ 
+ /**
+  * {@link Message} that has no body.
+- * 
++ *
+  * @author Kohsuke Kawaguchi
+  */
+ public class EmptyMessageImpl extends AbstractMessageImpl {
+@@ -82,7 +82,7 @@
+     public boolean hasHeaders() {
+         return !headers.isEmpty();
+     }
+-    
++
+     @Override
+     public @NotNull AttachmentSet getAttachments() {
+         return attachmentSet;
+--- old/src/share/classes/com/sun/xml/internal/ws/message/JAXBAttachment.java	Thu Jul 30 18:29:56 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/message/JAXBAttachment.java	Thu Jul 30 18:29:55 2009
+@@ -27,11 +27,10 @@
+ 
+ import com.sun.istack.internal.NotNull;
+ import com.sun.xml.internal.bind.api.Bridge;
+-import com.sun.xml.internal.messaging.saaj.util.ByteOutputStream;
+ import com.sun.xml.internal.ws.api.message.Attachment;
+ import com.sun.xml.internal.ws.util.ASCIIUtility;
+-import com.sun.xml.internal.ws.util.ByteArrayDataSource;
+-import java.io.ByteArrayInputStream;
++import com.sun.xml.internal.ws.util.ByteArrayBuffer;
++import com.sun.xml.internal.ws.encoding.DataSourceStreamingDataHandler;
+ 
+ import javax.activation.DataHandler;
+ import javax.activation.DataSource;
+@@ -41,10 +40,10 @@
+ import javax.xml.soap.SOAPMessage;
+ import javax.xml.transform.Source;
+ import javax.xml.transform.stream.StreamSource;
++import javax.xml.ws.WebServiceException;
+ import java.io.IOException;
+ import java.io.InputStream;
+ import java.io.OutputStream;
+-import javax.xml.ws.WebServiceException;
+ 
+ /**
+  * @author Jitendra Kotamraju
+@@ -80,7 +79,7 @@
+     }
+ 
+     public DataHandler asDataHandler() {
+-        return new DataHandler(this);
++        return new DataSourceStreamingDataHandler(this);
+     }
+ 
+     public Source asSource() {
+@@ -88,13 +87,13 @@
+     }
+ 
+     public InputStream asInputStream() {
+-        ByteOutputStream bos = new ByteOutputStream();
++        ByteArrayBuffer bab = new ByteArrayBuffer();
+         try {
+-            writeTo(bos);
++            writeTo(bab);
+         } catch (IOException e) {
+             throw new WebServiceException(e);
+         }
+-        return bos.newInputStream();
++        return bab.newInputStream();
+     }
+ 
+     public void writeTo(OutputStream os) throws IOException {
+--- old/src/share/classes/com/sun/xml/internal/ws/message/MimeAttachmentSet.java	Thu Jul 30 18:29:59 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/message/MimeAttachmentSet.java	Thu Jul 30 18:29:59 2009
+@@ -24,13 +24,11 @@
+  */
+ 
+ 
+-
+ package com.sun.xml.internal.ws.message;
+ 
+ import com.sun.xml.internal.ws.api.message.AttachmentSet;
+ import com.sun.xml.internal.ws.api.message.Attachment;
+ import com.sun.xml.internal.ws.encoding.MimeMultipartParser;
+-import com.sun.xml.internal.ws.message.stream.StreamAttachment;
+ import com.sun.xml.internal.ws.resources.EncodingMessages;
+ import com.sun.istack.internal.Nullable;
+ 
+@@ -99,8 +97,8 @@
+          * Browse thru all the attachments in the mpp, add them to #atts,
+          * then return whether its empty.
+          */
+-        Map<String, StreamAttachment> attachments = mpp.getAttachmentParts();
+-        for(Map.Entry<String, StreamAttachment> att : attachments.entrySet()) {
++        Map<String, Attachment> attachments = mpp.getAttachmentParts();
++        for(Map.Entry<String, Attachment> att : attachments.entrySet()) {
+             if(atts.get(att.getKey()) == null){
+                 atts.put(att.getKey(), att.getValue());
+             }
+--- old/src/share/classes/com/sun/xml/internal/ws/message/RootElementSniffer.java	Thu Jul 30 18:30:03 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/message/RootElementSniffer.java	Thu Jul 30 18:30:02 2009
+@@ -52,7 +52,7 @@
+     public void startElement(String uri, String localName, String qName, Attributes a) throws SAXException {
+         this.nsUri = uri;
+         this.localName = localName;
+-        
++
+         if(parseAttributes) {
+             if(a.getLength()==0)    // often there's no attribute
+                 this.atts = EMPTY_ATTRIBUTES;
+--- old/src/share/classes/com/sun/xml/internal/ws/message/jaxb/JAXBHeader.java	Thu Jul 30 18:30:06 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/message/jaxb/JAXBHeader.java	Thu Jul 30 18:30:06 2009
+@@ -51,7 +51,6 @@
+ import javax.xml.stream.XMLStreamReader;
+ import javax.xml.stream.XMLStreamWriter;
+ import java.io.OutputStream;
+-import java.util.Map;
+ 
+ /**
+  * {@link Header} whose physical data representation is a JAXB bean.
+@@ -151,9 +150,16 @@
+     }
+ 
+     public <T> T readAsJAXB(Unmarshaller unmarshaller) throws JAXBException {
+-        JAXBResult r = new JAXBResult(unmarshaller);
+-        bridge.marshal(jaxbObject,r);
+-        return (T)r.getResult();
++        try {
++            JAXBResult r = new JAXBResult(unmarshaller);
++            // bridge marshals a fragment, so we need to add start/endDocument by ourselves
++            r.getHandler().startDocument();
++            bridge.marshal(jaxbObject,r);
++            r.getHandler().endDocument();
++            return (T)r.getResult();
++        } catch (SAXException e) {
++            throw new JAXBException(e);
++        }
+     }
+ 
+     public <T> T readAsJAXB(Bridge<T> bridge) throws JAXBException {
+--- old/src/share/classes/com/sun/xml/internal/ws/message/jaxb/JAXBMessage.java	Thu Jul 30 18:30:10 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/message/jaxb/JAXBMessage.java	Thu Jul 30 18:30:09 2009
+@@ -40,6 +40,8 @@
+ import com.sun.xml.internal.ws.message.RootElementSniffer;
+ import com.sun.xml.internal.ws.message.stream.StreamMessage;
+ import com.sun.xml.internal.ws.streaming.XMLStreamWriterUtil;
++import com.sun.xml.internal.ws.streaming.XMLStreamReaderUtil;
++import com.sun.xml.internal.ws.streaming.MtomStreamWriter;
+ import org.xml.sax.ContentHandler;
+ import org.xml.sax.ErrorHandler;
+ import org.xml.sax.SAXException;
+@@ -48,6 +50,7 @@
+ import javax.xml.bind.JAXBException;
+ import javax.xml.bind.Marshaller;
+ import javax.xml.bind.Unmarshaller;
++import javax.xml.bind.attachment.AttachmentMarshaller;
+ import javax.xml.bind.annotation.XmlRootElement;
+ import javax.xml.bind.util.JAXBResult;
+ import javax.xml.namespace.QName;
+@@ -54,6 +57,7 @@
+ import javax.xml.stream.XMLStreamException;
+ import javax.xml.stream.XMLStreamReader;
+ import javax.xml.stream.XMLStreamWriter;
++import static javax.xml.stream.XMLStreamConstants.START_DOCUMENT;
+ import javax.xml.transform.Source;
+ import javax.xml.ws.WebServiceException;
+ import java.io.OutputStream;
+@@ -71,7 +75,7 @@
+      * The JAXB object that represents the header.
+      */
+     private final Object jaxbObject;
+-    
++
+     private final AttachmentSetImpl attachmentSet;
+ 
+     private final Bridge bridge;
+@@ -190,7 +194,7 @@
+         this.jaxbObject = that.jaxbObject;
+         this.bridge = that.bridge;
+     }
+-    
++
+     @Override
+     public @NotNull AttachmentSet getAttachments() {
+         return attachmentSet;
+@@ -265,7 +269,10 @@
+                 bridge.marshal(jaxbObject,sbr);
+                 infoset = sbr.getXMLStreamBuffer();
+             }
+-            return infoset.readAsXMLStreamReader();
++            XMLStreamReader reader = infoset.readAsXMLStreamReader();
++            if(reader.getEventType()== START_DOCUMENT)
++                XMLStreamReaderUtil.nextElementContent(reader);
++            return reader;
+         } catch (JAXBException e) {
+            // bug 6449684, spec 4.3.4
+            throw new WebServiceException(e);
+@@ -292,15 +299,20 @@
+ 
+     public void writePayloadTo(XMLStreamWriter sw) throws XMLStreamException {
+         try {
+-            AttachmentMarshallerImpl am = new AttachmentMarshallerImpl(attachmentSet);
++            // MtomCodec sets its own AttachmentMarshaller
++            AttachmentMarshaller am = (sw instanceof MtomStreamWriter)
++                    ? ((MtomStreamWriter)sw).getAttachmentMarshaller()
++                    : new AttachmentMarshallerImpl(attachmentSet);
++
+             // Get output stream and use JAXB UTF-8 writer
+             OutputStream os = XMLStreamWriterUtil.getOutputStream(sw);
+             if (os != null) {
+                 bridge.marshal(jaxbObject, os, sw.getNamespaceContext(),am);
+             } else {
+-                bridge.marshal(jaxbObject,sw,am);   
++                bridge.marshal(jaxbObject,sw,am);
+             }
+-            am.cleanup();
++            //cleanup() is not needed since JAXB doesn't keep ref to AttachmentMarshaller
++            //am.cleanup();
+         } catch (JAXBException e) {
+             // bug 6449684, spec 4.3.4
+             throw new WebServiceException(e);
+--- old/src/share/classes/com/sun/xml/internal/ws/message/jaxb/MarshallerBridge.java	Thu Jul 30 18:30:14 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/message/jaxb/MarshallerBridge.java	Thu Jul 30 18:30:13 2009
+@@ -26,8 +26,8 @@
+ package com.sun.xml.internal.ws.message.jaxb;
+ 
+ import com.sun.xml.internal.bind.api.Bridge;
+-import com.sun.xml.internal.bind.api.TypeReference;
+ import com.sun.xml.internal.bind.api.JAXBRIContext;
++import com.sun.xml.internal.bind.api.TypeReference;
+ import com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl;
+ import com.sun.xml.internal.bind.v2.runtime.MarshallerImpl;
+ import org.w3c.dom.Node;
+@@ -66,7 +66,7 @@
+     public void marshal(Marshaller m, Object object, OutputStream output, NamespaceContext nsContext) throws JAXBException {
+         m.setProperty(Marshaller.JAXB_FRAGMENT,true);
+         try {
+-            m.marshal(object,output);
++            ((MarshallerImpl)m).marshal(object,output,nsContext);
+         } finally {
+             m.setProperty(Marshaller.JAXB_FRAGMENT,false);
+         }
+--- old/src/share/classes/com/sun/xml/internal/ws/message/saaj/SAAJMessage.java	Thu Jul 30 18:30:17 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/message/saaj/SAAJMessage.java	Thu Jul 30 18:30:17 2009
+@@ -26,15 +26,15 @@
+ 
+ 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.xml.internal.bind.api.Bridge;
+ import com.sun.xml.internal.bind.unmarshaller.DOMScanner;
+ import com.sun.xml.internal.ws.api.SOAPVersion;
+-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.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.message.*;
+ import com.sun.xml.internal.ws.message.AttachmentUnmarshallerImpl;
++import com.sun.xml.internal.ws.message.AbstractMessageImpl;
++import com.sun.xml.internal.ws.message.AttachmentSetImpl;
+ import com.sun.xml.internal.ws.streaming.DOMStreamReader;
+ import com.sun.xml.internal.ws.util.DOMUtil;
+ import org.w3c.dom.Element;
+@@ -42,6 +42,8 @@
+ import org.xml.sax.ContentHandler;
+ import org.xml.sax.ErrorHandler;
+ import org.xml.sax.SAXException;
++import org.xml.sax.helpers.AttributesImpl;
++import org.xml.sax.helpers.LocatorImpl;
+ 
+ import javax.activation.DataHandler;
+ import javax.xml.bind.JAXBException;
+@@ -60,6 +62,7 @@
+ import javax.xml.transform.dom.DOMSource;
+ import javax.xml.transform.stream.StreamSource;
+ import javax.xml.ws.WebServiceException;
++import javax.xml.ws.soap.SOAPFaultException;
+ import java.io.IOException;
+ import java.io.InputStream;
+ import java.io.OutputStream;
+@@ -72,207 +75,218 @@
+  * {@link Message} implementation backed by {@link SOAPMessage}.
+  *
+  * @author Vivek Pandey
++ * @author Rama Pulavarthi
+  */
+ public class SAAJMessage extends Message {
++    // flag to switch between representations
++    private boolean parsedMessage;
++    // flag to check if Message API is exercised;
++    private boolean accessedMessage;
+     private final SOAPMessage sm;
++
+     private HeaderList headers;
+-    private String payloadLocalName;
+-    private String payloadNamspace;
+     private List<Element> bodyParts;
+     private Element payload;
+ 
+-    private boolean parsedHeader;
++    private String payloadLocalName;
++    private String payloadNamespace;
++    private SOAPVersion soapVersion;
+ 
+     public SAAJMessage(SOAPMessage sm) {
+         this.sm = sm;
+-
+-        try {
+-            Node body = sm.getSOAPBody();
+-            //cature all the body elements
+-            bodyParts = DOMUtil.getChildElements(body);
+-
+-            //we treat payload as the first body part
+-            payload = bodyParts.size() > 0? bodyParts.get(0):null;
+-            // hope this is correct. Caching the localname and namespace of the payload should be fine
+-            // but what about if a Handler replaces the payload with something else? Weel, may be it
+-            // will be error condition anyway
+-            if (payload != null) {
+-                payloadLocalName = payload.getLocalName();
+-                payloadNamspace = payload.getNamespaceURI();
+-            }
+-        } catch (SOAPException e) {
+-            throw new WebServiceException(e);
+-        }
+     }
+ 
+     /**
+      * This constructor is a convenience and called by the {@link #copy}
++     *
+      * @param headers
+      * @param sm
+      */
+     private SAAJMessage(HeaderList headers, AttachmentSet as, SOAPMessage sm) {
+-        this(sm);
++        this.sm = sm;
++        this.parse();
++        if(headers == null)
++            headers = new HeaderList();
+         this.headers = headers;
+         this.attachmentSet = as;
+     }
+ 
+-    public boolean hasHeaders() {
+-        return getHeaders().size() > 0;
++    private void parse() {
++        if (!parsedMessage) {
++            try {
++                access();
++                if (headers == null)
++                    headers = new HeaderList();
++                SOAPHeader header = sm.getSOAPHeader();
++                if (header != null) {
++                    Iterator iter = header.examineAllHeaderElements();
++                    while (iter.hasNext()) {
++                        headers.add(new SAAJHeader((SOAPHeaderElement) iter.next()));
++                    }
++                }
++                attachmentSet = new SAAJAttachmentSet(sm);
++
++                parsedMessage = true;
++            } catch (SOAPException e) {
++                throw new WebServiceException(e);
++            }
++        }
+     }
+ 
+-    /**
+-     * Gets all the headers of this message.
+-     *
+-     * @return always return the same non-null object.
+-     */
+-    public HeaderList getHeaders() {
+-        if (parsedHeader)
+-            return headers;
+-
+-        if (headers == null)
+-            headers = new HeaderList();
+-
+-        try {
+-            SOAPHeader header = sm.getSOAPHeader();
+-            if(header!=null) {
+-                Iterator iter = header.examineAllHeaderElements();
+-                while (iter.hasNext()) {
+-                    headers.add(new SAAJHeader((SOAPHeaderElement) iter.next()));
++    private void access() {
++        if (!accessedMessage) {
++            try {
++                Node body = sm.getSOAPBody();
++                soapVersion = SOAPVersion.fromNsUri(body.getNamespaceURI());
++                //cature all the body elements
++                bodyParts = DOMUtil.getChildElements(body);
++                //we treat payload as the first body part
++                payload = bodyParts.size() > 0 ? bodyParts.get(0) : null;
++                // hope this is correct. Caching the localname and namespace of the payload should be fine
++                // but what about if a Handler replaces the payload with something else? Weel, may be it
++                // will be error condition anyway
++                if (payload != null) {
++                    payloadLocalName = payload.getLocalName();
++                    payloadNamespace = payload.getNamespaceURI();
+                 }
++                accessedMessage = true;
++            } catch (SOAPException e) {
++                throw new WebServiceException(e);
+             }
+-            parsedHeader = true;
+-        } catch (SOAPException e) {
+-            e.printStackTrace();
+         }
+-        return headers;
+     }
+ 
++    public boolean hasHeaders() {
++        parse();
++        return headers.size() > 0;
++    }
++
++    public @NotNull HeaderList getHeaders() {
++        parse();
++        return headers;
++    }
+     /**
+      * Gets the attachments of this message
+      * (attachments live outside a message.)
+      */
+     @Override
+-    @NotNull
+-    public AttachmentSet getAttachments() {
+-        if (attachmentSet == null)
+-            attachmentSet = new SAAJAttachmentSet(sm);
++    public @NotNull AttachmentSet getAttachments() {
++        parse();
+         return attachmentSet;
+     }
+ 
++    /**
++     * Optimization hint for the derived class to check
++     * if we may have some attachments.
++     */
++    @Override
+     protected boolean hasAttachments() {
+-        return !getAttachments().isEmpty();
++        parse();
++        return attachmentSet!=null;
+     }
+ 
+-    /**
+-     * Gets the local name of the payload element.
+-     */
+-    public String getPayloadLocalPart() {
++    public @Nullable String getPayloadLocalPart() {
++        access();
+         return payloadLocalName;
+     }
+ 
+-    /**
+-     * Gets the namespace URI of the payload element.
+-     */
+     public String getPayloadNamespaceURI() {
+-        return payloadNamspace;
++        access();
++        return payloadNamespace;
+     }
+ 
+     public boolean hasPayload() {
+-        return payloadNamspace!=null;
++        access();
++        return payloadNamespace != null;
+     }
+ 
+-    /**
+-     * Consumes this message including the envelope.
+-     * returns it as a {@link javax.xml.transform.Source} object.
+-     */
+     public Source readEnvelopeAsSource() {
+         try {
+-            SOAPEnvelope se = sm .getSOAPPart().getEnvelope();
+-            return new DOMSource(se);
++            if (!parsedMessage) {
++                SOAPEnvelope se = sm.getSOAPPart().getEnvelope();
++                return new DOMSource(se);
++
++            } else {
++                SOAPMessage msg = soapVersion.saajMessageFactory.createMessage();
++                SOAPBody newBody = msg.getSOAPPart().getEnvelope().getBody();
++                for (Element part : bodyParts) {
++                    Node n = newBody.getOwnerDocument().importNode(part, true);
++                    newBody.appendChild(n);
++                }
++                for (Header header : headers) {
++                    header.writeTo(msg);
++                }
++                SOAPEnvelope se = msg.getSOAPPart().getEnvelope();
++                return new DOMSource(se);
++            }
+         } catch (SOAPException e) {
+             throw new WebServiceException(e);
+         }
+     }
+ 
+-    /**
+-     * Returns the payload as a {@link javax.xml.transform.Source} object.
+-     *
+-     * Can't really give all the body parts inside soapenv:Body as Source
+-     * cant take only one part.
+-     *
+-     * <p/>
+-     * This consumes the message.
+-     */
++    public SOAPMessage readAsSOAPMessage() throws SOAPException {
++        if (!parsedMessage) {
++            return sm;
++        } else {
++            SOAPMessage msg = soapVersion.saajMessageFactory.createMessage();
++            SOAPBody newBody = msg.getSOAPPart().getEnvelope().getBody();
++            for (Element part : bodyParts) {
++                Node n = newBody.getOwnerDocument().importNode(part, true);
++                newBody.appendChild(n);
++            }
++            for (Header header : headers) {
++                header.writeTo(msg);
++            }
++            for (Attachment att : getAttachments()) {
++                AttachmentPart part = msg.createAttachmentPart();
++                part.setDataHandler(att.asDataHandler());
++                part.setContentId('<' + att.getContentId() + '>');
++                msg.addAttachmentPart(part);
++            }
++            msg.saveChanges();
++            return msg;
++        }
++    }
++
+     public Source readPayloadAsSource() {
++        access();
+         return (payload != null) ? new DOMSource(payload) : null;
+     }
+ 
+-    /**
+-     * Creates the equivalent {@link javax.xml.soap.SOAPMessage} from this message.
+-     * <p/>
+-     * This consumes the message.
+-     */
+-    public SOAPMessage readAsSOAPMessage() {
+-        return sm;
+-    }
+-
+-    public SOAPMessage readAsSOAPMessage(Packet packet, boolean inbound) throws SOAPException {
+-        return sm;
+-    }
+-
+-    /**
+-     * Reads the payload as a JAXB object by using the given unmarshaller.
+-     * <p/>
+-     * This consumes the message.
+-     */
+     public <T> T readPayloadAsJAXB(Unmarshaller unmarshaller) throws JAXBException {
+-        try {
+-            Node pn = sm.getSOAPBody().getFirstChild();
+-            if (pn != null)
+-                return (T) unmarshaller.unmarshal(pn);
+-            return null;
+-        } catch (SOAPException e) {
+-            throw new WebServiceException(e);
++        access();
++        if (payload != null) {
++            if(hasAttachments())
++                unmarshaller.setAttachmentUnmarshaller(new AttachmentUnmarshallerImpl(getAttachments()));
++            return (T) unmarshaller.unmarshal(payload);
++
+         }
++        return null;
+     }
+ 
+     public <T> T readPayloadAsJAXB(Bridge<T> bridge) throws JAXBException {
+-        try {
+-            Node pn = sm.getSOAPBody().getFirstChild();
+-            if (pn != null)
+-                return bridge.unmarshal(pn,
+-                    new AttachmentUnmarshallerImpl(getAttachments()));
+-            return null;
+-        } catch (SOAPException e) {
+-            throw new WebServiceException(e);
+-        }
++        access();
++        if (payload != null)
++            return bridge.unmarshal(payload,hasAttachments()? new AttachmentUnmarshallerImpl(getAttachments()) : null);
++        return null;
+     }
+ 
+-    /**
+-     * Reads the payload as a {@link javax.xml.stream.XMLStreamReader}
+-     * <p/>
+-     * This consumes the message.
+-     */
+     public XMLStreamReader readPayload() throws XMLStreamException {
+-        if(payload==null)
+-            return null;
+-
+-        DOMStreamReader dss = new DOMStreamReader();
+-        dss.setCurrentNode(payload);
+-        dss.nextTag();
+-        assert dss.getEventType()==XMLStreamReader.START_ELEMENT;
+-        return dss;
++        access();
++        if (payload != null) {
++            DOMStreamReader dss = new DOMStreamReader();
++            dss.setCurrentNode(payload);
++            dss.nextTag();
++            assert dss.getEventType() == XMLStreamReader.START_ELEMENT;
++            return dss;
++        }
++        return null;
+     }
+ 
+-    /**
+-     * Writes the payload to StAX.
+-     * <p/>
+-     * This method writes just the payload of the message to the writer.
+-     * This consumes the message.
+-     */
+-    public void writePayloadTo(XMLStreamWriter sw) {
++    public void writePayloadTo(XMLStreamWriter sw) throws XMLStreamException {
++        access();
+         try {
+-            for(Element part: bodyParts)
++            for (Element part : bodyParts)
+                 DOMUtil.serializeNode(part, sw);
+         } catch (XMLStreamException e) {
+             throw new WebServiceException(e);
+@@ -279,10 +293,69 @@
+         }
+     }
+ 
++    public void writeTo(XMLStreamWriter writer) throws XMLStreamException {
++        try {
++            writer.writeStartDocument();
++            if (!parsedMessage) {
++                DOMUtil.serializeNode(sm.getSOAPPart().getEnvelope(), writer);
++            } else {
++                SOAPEnvelope env = sm.getSOAPPart().getEnvelope();
++                DOMUtil.writeTagWithAttributes(env, writer);
++                if (hasHeaders()) {
++                    writer.writeStartElement(env.getPrefix(), "Header", env.getNamespaceURI());
++                    int len = headers.size();
++                    for (int i = 0; i < len; i++) {
++                        headers.get(i).writeTo(writer);
++                    }
++                    writer.writeEndElement();
++                }
++
++                DOMUtil.serializeNode(sm.getSOAPBody(), writer);
++                writer.writeEndElement();
++            }
++            writer.writeEndDocument();
++            writer.flush();
++        } catch (SOAPException ex) {
++            throw new XMLStreamException2(ex);
++            //for now. ask jaxws team what to do.
++        }
++    }
++
+     public void writeTo(ContentHandler contentHandler, ErrorHandler errorHandler) throws SAXException {
++        String soapNsUri = soapVersion.nsUri;
++        if (!parsedMessage) {
++            DOMScanner ds = new DOMScanner();
++            ds.setContentHandler(contentHandler);
++            ds.scan(sm.getSOAPPart());
++        } else {
++            contentHandler.setDocumentLocator(NULL_LOCATOR);
++            contentHandler.startDocument();
++            contentHandler.startPrefixMapping("S", soapNsUri);
++            contentHandler.startElement(soapNsUri, "Envelope", "S:Envelope", EMPTY_ATTS);
++            if (hasHeaders()) {
++                contentHandler.startElement(soapNsUri, "Header", "S:Header", EMPTY_ATTS);
++                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);
++                }
++                contentHandler.endElement(soapNsUri, "Header", "S:Header");
++            }
++            // write the body
++            contentHandler.startElement(soapNsUri, "Body", "S:Body", EMPTY_ATTS);
++            writePayloadTo(contentHandler, errorHandler, true);
++            contentHandler.endElement(soapNsUri, "Body", "S:Body");
++            contentHandler.endElement(soapNsUri, "Envelope", "S:Envelope");
++        }
++    }
++
++    private void writePayloadTo(ContentHandler contentHandler, ErrorHandler errorHandler, boolean fragment) throws SAXException {
++        if(fragment)
++            contentHandler = new FragmentContentHandler(contentHandler);
+         DOMScanner ds = new DOMScanner();
+         ds.setContentHandler(contentHandler);
+-        ds.scan(sm.getSOAPPart());
++        ds.scan(payload);
+     }
+ 
+     /**
+@@ -308,23 +381,27 @@
+      */
+     public Message copy() {
+         try {
+-            SOAPBody sb = sm.getSOAPPart().getEnvelope().getBody();
+-            SOAPMessage msg = SOAPVersion.fromNsUri(sb.getNamespaceURI()).saajMessageFactory.createMessage();
+-            SOAPBody newBody = msg.getSOAPPart().getEnvelope().getBody();
+-            for(Element part: bodyParts){
+-                Node n = newBody.getOwnerDocument().importNode(part, true);
+-                newBody.appendChild(n);
++            if (!parsedMessage) {
++                return new SAAJMessage(readAsSOAPMessage());
++            } else {
++                SOAPMessage msg = soapVersion.saajMessageFactory.createMessage();
++                SOAPBody newBody = msg.getSOAPPart().getEnvelope().getBody();
++                for (Element part : bodyParts) {
++                    Node n = newBody.getOwnerDocument().importNode(part, true);
++                    newBody.appendChild(n);
++                }
++                return new SAAJMessage(getHeaders(), getAttachments(), msg);
+             }
+-            return new SAAJMessage(getHeaders(), getAttachments(), msg);
+         } catch (SOAPException e) {
+             throw new WebServiceException(e);
+         }
+     }
++    private static final AttributesImpl EMPTY_ATTS = new AttributesImpl();
++    private static final LocatorImpl NULL_LOCATOR = new LocatorImpl();
+ 
+-
+     private class SAAJAttachment implements Attachment {
+ 
+-        AttachmentPart ap;
++        final AttachmentPart ap;
+ 
+         public SAAJAttachment(AttachmentPart part) {
+             this.ap = part;
+@@ -475,30 +552,4 @@
+         }
+     }
+ 
+-
+-    public void writeTo( XMLStreamWriter writer ) throws XMLStreamException {
+-        try {
+-            writer.writeStartDocument();
+-            SOAPEnvelope env = sm.getSOAPPart().getEnvelope();
+-            DOMUtil.writeTagWithAttributes(env, writer);
+-            if(hasHeaders()) {
+-                writer.writeStartElement(env.getPrefix(),"Header",env.getNamespaceURI());
+-                int len = headers.size();
+-                for( int i=0; i<len; i++ ) {
+-                    headers.get(i).writeTo(writer);
+-                }
+-                writer.writeEndElement();
+-            }
+-
+-            DOMUtil.serializeNode(sm.getSOAPBody(),writer);
+-            writer.writeEndElement();
+-            writer.writeEndDocument();
+-            writer.flush();
+-        } catch (SOAPException ex) {
+-            throw new XMLStreamException2(ex);
+-            //for now. ask jaxws team what to do.
+-        }
+-
+-    }
+-
+ }
+--- old/src/share/classes/com/sun/xml/internal/ws/message/source/PayloadSourceMessage.java	Thu Jul 30 18:30:21 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/message/source/PayloadSourceMessage.java	Thu Jul 30 18:30:21 2009
+@@ -47,7 +47,7 @@
+     public PayloadSourceMessage(@Nullable HeaderList headers,
+         @NotNull Source payload, @NotNull AttachmentSet attSet,
+         @NotNull SOAPVersion soapVersion) {
+-        
++
+         super(headers, SourceReaderFactory.createSourceReader(payload, true),
+                 attSet, soapVersion);
+     }
+--- old/src/share/classes/com/sun/xml/internal/ws/message/source/SourceUtils.java	Thu Jul 30 18:30:25 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/message/source/SourceUtils.java	Thu Jul 30 18:30:24 2009
+@@ -99,7 +99,7 @@
+             Node n = domSource.getNode();
+             if(n.getNodeType()== Node.DOCUMENT_NODE) {
+                 n = ((Document)n).getDocumentElement();
+-            }            
++            }
+             localName = n.getLocalName();
+             namespaceUri = n.getNamespaceURI();
+         }else if(isSaxSource()){
+--- old/src/share/classes/com/sun/xml/internal/ws/message/stream/PayloadStreamReaderMessage.java	Thu Jul 30 18:30:28 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/message/stream/PayloadStreamReaderMessage.java	Thu Jul 30 18:30:28 2009
+@@ -61,7 +61,7 @@
+         super(soapVersion);
+         message = new StreamMessage(headers, attSet, reader, soapVersion);
+     }
+-    
++
+     public boolean hasHeaders() {
+         return message.hasHeaders();
+     }
+--- old/src/share/classes/com/sun/xml/internal/ws/message/stream/StreamAttachment.java	Thu Jul 30 18:30:32 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/message/stream/StreamAttachment.java	Thu Jul 30 18:30:31 2009
+@@ -28,6 +28,7 @@
+ import com.sun.xml.internal.ws.api.message.Attachment;
+ import com.sun.xml.internal.ws.util.ByteArrayDataSource;
+ import com.sun.xml.internal.ws.util.ByteArrayBuffer;
++import com.sun.xml.internal.ws.encoding.DataSourceStreamingDataHandler;
+ 
+ import javax.activation.DataHandler;
+ import javax.xml.transform.Source;
+@@ -77,7 +78,7 @@
+     }
+ 
+     public DataHandler asDataHandler() {
+-        return new DataHandler(new ByteArrayDataSource(data,0,len,getContentType()));
++        return new DataSourceStreamingDataHandler(new ByteArrayDataSource(data,0,len,getContentType()));
+     }
+ 
+     public Source asSource() {
+--- old/src/share/classes/com/sun/xml/internal/ws/message/stream/StreamHeader.java	Thu Jul 30 18:30:35 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/message/stream/StreamHeader.java	Thu Jul 30 18:30:35 2009
+@@ -181,8 +181,10 @@
+     }
+ 
+     public void writeTo(XMLStreamWriter w) throws XMLStreamException {
+-        // TODO what about in-scope namespaces
+-        _mark.writeToXMLStreamWriter(w);
++        if(_mark.getInscopeNamespaces().size() > 0)
++            _mark.writeToXMLStreamWriter(w,true);
++        else
++            _mark.writeToXMLStreamWriter(w);
+     }
+ 
+     public void writeTo(SOAPMessage saaj) throws SOAPException {
+--- old/src/share/classes/com/sun/xml/internal/ws/message/stream/StreamHeader11.java	Thu Jul 30 18:30:39 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/message/stream/StreamHeader11.java	Thu Jul 30 18:30:38 2009
+@@ -42,7 +42,7 @@
+     protected static final String SOAP_1_1_MUST_UNDERSTAND = "mustUnderstand";
+ 
+     protected static final String SOAP_1_1_ROLE = "actor";
+-    
++
+     public StreamHeader11(XMLStreamReader reader, XMLStreamBuffer mark) {
+         super(reader, mark);
+     }
+@@ -61,10 +61,10 @@
+             final String namespaceURI = reader.getAttributeNamespace(i);
+             final String value = reader.getAttributeValue(i);
+ 
+-            if (namespaceURI == SOAPConstants.URI_NS_SOAP_1_1_ENVELOPE) {
+-                if (localName == SOAP_1_1_MUST_UNDERSTAND) {
++            if (SOAPConstants.URI_NS_SOAP_1_1_ENVELOPE.equals(namespaceURI)) {
++                if (SOAP_1_1_MUST_UNDERSTAND.equals(localName)) {
+                     _isMustUnderstand = Util.parseBool(value);
+-                } else if (localName == SOAP_1_1_ROLE) {
++                } else if (SOAP_1_1_ROLE.equals(localName)) {
+                     if (value != null && value.length() > 0) {
+                         _role = value;
+                     }
+--- old/src/share/classes/com/sun/xml/internal/ws/message/stream/StreamHeader12.java	Thu Jul 30 18:30:42 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/message/stream/StreamHeader12.java	Thu Jul 30 18:30:42 2009
+@@ -63,14 +63,14 @@
+             final String namespaceURI = reader.getAttributeNamespace(i);
+             final String value = reader.getAttributeValue(i);
+ 
+-            if (namespaceURI == SOAPConstants.URI_NS_SOAP_1_2_ENVELOPE) {
+-                if (localName == SOAP_1_2_MUST_UNDERSTAND) {
++            if (SOAPConstants.URI_NS_SOAP_1_2_ENVELOPE.equals(namespaceURI)) {
++                if (SOAP_1_2_MUST_UNDERSTAND.equals(localName)) {
+                     _isMustUnderstand = Util.parseBool(value);
+-                } else if (localName == SOAP_1_2_ROLE) {
++                } else if (SOAP_1_2_ROLE.equals(localName)) {
+                     if (value != null && value.length() > 0) {
+                         _role = value;
+                     }
+-                } else if (localName == SOAP_1_2_RELAY) {
++                } else if (SOAP_1_2_RELAY.equals(localName)) {
+                     _isRelay = Util.parseBool(value);
+                 }
+             }
+--- old/src/share/classes/com/sun/xml/internal/ws/message/stream/StreamMessage.java	Thu Jul 30 18:30:46 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/message/stream/StreamMessage.java	Thu Jul 30 18:30:45 2009
+@@ -47,18 +47,19 @@
+ import org.xml.sax.ErrorHandler;
+ import org.xml.sax.SAXException;
+ import org.xml.sax.SAXParseException;
++import org.xml.sax.helpers.NamespaceSupport;
+ 
+ import javax.xml.bind.JAXBException;
+ import javax.xml.bind.Unmarshaller;
+-import javax.xml.stream.Location;
+-import javax.xml.stream.XMLStreamConstants;
++import javax.xml.stream.*;
+ import static javax.xml.stream.XMLStreamConstants.START_DOCUMENT;
+ import static javax.xml.stream.XMLStreamConstants.START_ELEMENT;
+-import javax.xml.stream.XMLStreamException;
+-import javax.xml.stream.XMLStreamReader;
+-import javax.xml.stream.XMLStreamWriter;
+ import javax.xml.transform.Source;
+ import javax.xml.ws.WebServiceException;
++import java.util.ArrayList;
++import java.util.Arrays;
++import java.util.Enumeration;
++import java.util.List;
+ 
+ /**
+  * {@link Message} implementation backed by {@link XMLStreamReader}.
+@@ -74,7 +75,7 @@
+     private @NotNull XMLStreamReader reader;
+ 
+     // lazily created
+-    private @Nullable HeaderList headers;    
++    private @Nullable HeaderList headers;
+ 
+     private final String payloadLocalName;
+ 
+@@ -154,7 +155,7 @@
+         this(headers,attachmentSet,reader,soapVersion);
+         assert envelopeTag!=null && bodyTag!=null;
+         this.envelopeTag = envelopeTag;
+-        this.headerTag = headerTag!=null ? headerTag : 
++        this.headerTag = headerTag!=null ? headerTag :
+             new TagInfoset(envelopeTag.nsUri,"Header",envelopeTag.prefix,EMPTY_ATTS);
+         this.bodyTag = bodyTag;
+     }
+@@ -169,7 +170,7 @@
+         }
+         return headers;
+     }
+-    
++
+     @Override
+     public @NotNull AttachmentSet getAttachments() {
+         return attachmentSet;
+@@ -190,11 +191,40 @@
+     public Source readPayloadAsSource() {
+         if(hasPayload()) {
+             assert unconsumed();
+-            return new StAXSource(reader, true);
++            return new StAXSource(reader, true, getInscopeNamespaces());
+         } else
+             return null;
+     }
+ 
++    /**
++     * There is no way to enumerate inscope namespaces for XMLStreamReader. That means
++     * namespaces declared in envelope, and body tags need to be computed using their
++     * {@link TagInfoset}s.
++     *
++     * @return array of the even length of the form { prefix0, uri0, prefix1, uri1, ... }
++     */
++    private String[] getInscopeNamespaces() {
++        NamespaceSupport nss = new NamespaceSupport();
++
++        nss.pushContext();
++        for(int i=0; i < envelopeTag.ns.length; i+=2) {
++            nss.declarePrefix(envelopeTag.ns[i], envelopeTag.ns[i+1]);
++        }
++
++        nss.pushContext();
++        for(int i=0; i < bodyTag.ns.length; i+=2) {
++            nss.declarePrefix(bodyTag.ns[i], bodyTag.ns[i+1]);
++        }
++
++        List<String> inscope = new ArrayList<String>();
++        for( Enumeration en = nss.getPrefixes(); en.hasMoreElements(); ) {
++            String prefix = (String)en.nextElement();
++            inscope.add(prefix);
++            inscope.add(nss.getURI(prefix));
++        }
++        return inscope.toArray(new String[inscope.size()]);
++    }
++
+     public Object readPayloadAsJAXB(Unmarshaller unmarshaller) throws JAXBException {
+         if(!hasPayload())
+             return null;
+@@ -206,6 +236,7 @@
+             return unmarshaller.unmarshal(reader);
+         } finally{
+             unmarshaller.setAttachmentUnmarshaller(null);
++            XMLStreamReaderUtil.readRest(reader);
+             XMLStreamReaderUtil.close(reader);
+             XMLStreamReaderFactory.recycle(reader);
+         }
+@@ -217,6 +248,7 @@
+         assert unconsumed();
+         T r = bridge.unmarshal(reader,
+             hasAttachments() ? new AttachmentUnmarshallerImpl(getAttachments()) : null);
++        XMLStreamReaderUtil.readRest(reader);
+         XMLStreamReaderUtil.close(reader);
+         XMLStreamReaderFactory.recycle(reader);
+         return r;
+@@ -225,6 +257,8 @@
+     @Override
+     public void consume() {
+         assert unconsumed();
++        XMLStreamReaderUtil.readRest(reader);
++        XMLStreamReaderUtil.close(reader);
+         XMLStreamReaderFactory.recycle(reader);
+     }
+ 
+@@ -259,7 +293,8 @@
+                 break;
+             conv.bridge(reader,writer);
+         }
+-        reader.close();
++        XMLStreamReaderUtil.readRest(reader);
++        XMLStreamReaderUtil.close(reader);
+         XMLStreamReaderFactory.recycle(reader);
+     }
+ 
+@@ -322,7 +357,8 @@
+ 
+                 conv.bridge();
+             }
+-            reader.close();
++            XMLStreamReaderUtil.readRest(reader);
++            XMLStreamReaderUtil.close(reader);
+             XMLStreamReaderFactory.recycle(reader);
+         } catch (XMLStreamException e) {
+             Location loc = e.getLocation();
+@@ -332,7 +368,7 @@
+                 e.getMessage(),loc.getPublicId(),loc.getSystemId(),loc.getLineNumber(),loc.getColumnNumber(),e);
+             errorHandler.error(x);
+         }
+-    }        
++    }
+ 
+     public Message copy() {
+         try {
+@@ -346,17 +382,31 @@
+                 //the boolean value tells the first body part is written.
+                 //based on this we do the right thing
+                 StreamReaderBufferCreator c = new StreamReaderBufferCreator(xsb);
++
++                // preserving inscope namespaces from envelope, and body. Other option
++                // would be to create a filtering XMLStreamReader from reader+envelopeTag+bodyTag
++                c.storeElement(envelopeTag.nsUri, envelopeTag.localName, envelopeTag.prefix, envelopeTag.ns);
++                c.storeElement(bodyTag.nsUri, bodyTag.localName, bodyTag.prefix, bodyTag.ns);
++
++                // Loop all the way for multi payload case
+                 while(reader.getEventType() != XMLStreamConstants.END_DOCUMENT){
+                     String name = reader.getLocalName();
+                     String nsUri = reader.getNamespaceURI();
+                     if(name.equals("Body") && nsUri.equals(soapVersion.nsUri) || (reader.getEventType() == XMLStreamConstants.END_DOCUMENT))
+                         break;
+-                    c.create(reader);                    
++                    c.create(reader);
++                    // Skip whitespaces in between payload and </Body> or between elements
++                    if (reader.isWhiteSpace()) {
++                        XMLStreamReaderUtil.nextElementContent(reader);
++                    }
+                 }
++                XMLStreamReaderUtil.readRest(reader);
++                XMLStreamReaderUtil.close(reader);
+                 XMLStreamReaderFactory.recycle(reader);
+ 
+                 reader = xsb.readAsXMLStreamReader();
+                 clone = xsb.readAsXMLStreamReader();
++
+                 // advance to the start tag of the first element
+                 proceedToRootElement(reader);
+                 proceedToRootElement(clone);
+@@ -375,6 +425,8 @@
+     private void proceedToRootElement(XMLStreamReader xsr) throws XMLStreamException {
+         assert xsr.getEventType()==START_DOCUMENT;
+         xsr.nextTag();
++        xsr.nextTag();
++        xsr.nextTag();
+         assert xsr.getEventType()==START_ELEMENT;
+     }
+ 
+--- old/src/share/classes/com/sun/xml/internal/ws/model/AbstractSEIModelImpl.java	Thu Jul 30 18:30:50 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/model/AbstractSEIModelImpl.java	Thu Jul 30 18:30:49 2009
+@@ -28,6 +28,7 @@
+ import com.sun.xml.internal.bind.api.Bridge;
+ import com.sun.xml.internal.bind.api.JAXBRIContext;
+ import com.sun.xml.internal.bind.api.TypeReference;
++import com.sun.xml.internal.ws.api.model.JavaMethod;
+ import com.sun.xml.internal.ws.api.model.ParameterBinding;
+ import com.sun.xml.internal.ws.api.model.SEIModel;
+ import com.sun.xml.internal.ws.api.model.wsdl.WSDLModel;
+@@ -40,24 +41,40 @@
+ import com.sun.xml.internal.ws.model.wsdl.WSDLPortImpl;
+ import com.sun.xml.internal.ws.resources.ModelerMessages;
+ import com.sun.xml.internal.ws.util.Pool;
++import com.sun.xml.internal.ws.developer.UsesJAXBContextFeature;
++import com.sun.xml.internal.ws.developer.JAXBContextFactory;
++import com.sun.xml.internal.ws.binding.WebServiceFeatureList;
+ 
+ import javax.jws.WebParam.Mode;
++import javax.xml.bind.annotation.XmlSeeAlso;
+ import javax.xml.namespace.QName;
+ import javax.xml.ws.WebServiceException;
++import javax.xml.ws.WebServiceFeature;
+ import java.lang.reflect.Method;
+ import java.security.AccessController;
+ import java.security.PrivilegedActionException;
+ import java.security.PrivilegedExceptionAction;
+-import java.util.*;
++import java.util.ArrayList;
++import java.util.Collection;
++import java.util.Collections;
++import java.util.HashMap;
++import java.util.List;
++import java.util.Map;
++import java.util.logging.Level;
++import java.util.logging.Logger;
+ 
+ /**
+  * model of the web service.  Used by the runtime marshall/unmarshall
+  * web service invocations
+  *
+- * $author: JAXWS Development Team
++ * @author JAXWS Development Team
+  */
+ public abstract class AbstractSEIModelImpl implements SEIModel {
+ 
++    protected AbstractSEIModelImpl(WebServiceFeature[] features) {
++        this.features = features;
++    }
++
+     void postProcess() {
+         // should be called only once.
+         if (jaxbContext != null)
+@@ -111,15 +128,11 @@
+ 
+     private JAXBRIContext createJAXBContext() {
+         final List<TypeReference> types = getAllTypeReferences();
+-        final Class[] cls = new Class[types.size() + additionalClasses.size()];
+-        int i = 0;
+-        for(Class additionalClass:additionalClasses){
+-            cls[i++] = additionalClass;
+-        }
++        final List<Class> cls = new ArrayList<Class>(types.size() + additionalClasses.size());
+ 
+-        for (TypeReference type : types) {
+-            cls[i++] = (Class) type.type;
+-        }
++        cls.addAll(additionalClasses);
++        for (TypeReference type : types)
++            cls.add((Class) type.type);
+ 
+         try {
+             //jaxbContext = JAXBRIContext.newInstance(cls, types, targetNamespace, false);
+@@ -126,7 +139,13 @@
+             // Need to avoid doPriv block once JAXB is fixed. Afterwards, use the above
+             jaxbContext = AccessController.doPrivileged(new PrivilegedExceptionAction<JAXBRIContext>() {
+                 public JAXBRIContext run() throws Exception {
+-                    return JAXBRIContext.newInstance(cls, types, null, targetNamespace, false, null);
++                    if(LOGGER.isLoggable(Level.FINE)) {
++                        LOGGER.log(Level.FINE,"Creating JAXBContext with classes="+cls+" and types="+types);
++                    }
++                    UsesJAXBContextFeature f = WebServiceFeatureList.getFeature(features, UsesJAXBContextFeature.class);
++                    JAXBContextFactory factory = f!=null ? f.getFactory() : null;
++                    if(factory==null)   factory=JAXBContextFactory.DEFAULT;
++                    return factory.createJAXBContext(AbstractSEIModelImpl.this,cls,types);
+                 }
+             });
+             createBridgeMap(types);
+@@ -222,7 +241,10 @@
+ 
+     /**
+      * @return the <code>QName</code> associated with the
+-     * JavaMethod jm
++     * JavaMethod jm.
++     *
++     * @deprecated
++     *      Use {@link JavaMethod#getOperationName()}.
+      */
+     public QName getQNameForJM(JavaMethodImpl jm) {
+         for (QName key : nameToJM.keySet()) {
+@@ -462,13 +484,12 @@
+     }
+ 
+     /**
+-     * Sets additional classes obtained from {@link javax.xml.bind.annotation.XmlSeeAlso} annotation. In starting
++     * Adds additional classes obtained from {@link XmlSeeAlso} annotation. In starting
+      * from wsdl case these classes would most likely be JAXB ObjectFactory that references other classes.
+      */
+-    public void setAdditionalClasses(Class[] additionalClasses) {
+-        for(Class cls:additionalClasses){
++    public void addAdditionalClasses(Class... additionalClasses) {
++        for(Class cls : additionalClasses)
+             this.additionalClasses.add(cls);
+-        }
+     }
+ 
+     private List<Class> additionalClasses = new ArrayList<Class>();
+@@ -480,6 +501,9 @@
+     private QName portName;
+     private QName portTypeName;
+     private Map<Method,JavaMethodImpl> methodToJM = new HashMap<Method, JavaMethodImpl>();
++    /**
++     * Payload QName to the method that handles it.
++     */
+     private Map<QName,JavaMethodImpl> nameToJM = new HashMap<QName, JavaMethodImpl>();
+     private List<JavaMethodImpl> javaMethods = new ArrayList<JavaMethodImpl>();
+     private final Map<TypeReference, Bridge> bridgeMap = new HashMap<TypeReference, Bridge>();
+@@ -487,4 +511,7 @@
+     private String targetNamespace = "";
+     private List<String> knownNamespaceURIs = null;
+     private WSDLPortImpl port;
++    private final WebServiceFeature[] features;
++
++    private static final Logger LOGGER = Logger.getLogger(AbstractSEIModelImpl.class.getName());
+ }
+--- old/src/share/classes/com/sun/xml/internal/ws/model/CheckedExceptionImpl.java	Thu Jul 30 18:30:53 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/model/CheckedExceptionImpl.java	Thu Jul 30 18:30:53 2009
+@@ -35,11 +35,11 @@
+ /**
+  * CheckedException class. Holds the exception class - class that has public
+  * constructor
+- * 
++ *
+  * <code>public WrapperException()String message, FaultBean){}</code>
+- * 
++ *
+  * and method
+- * 
++ *
+  * <code>public FaultBean getFaultInfo();</code>
+  *
+  * @author Vivek Pandey
+@@ -79,7 +79,7 @@
+ 
+     /**
+      * @return the <code>Class</clode> for this object
+-     * 
++     *
+      */
+     public Class getExceptionClass() {
+         return exceptionClass;
+@@ -100,11 +100,11 @@
+     public ExceptionType getExceptionType() {
+         return exceptionType;
+     }
+-    
++
+     public String getMessageName() {
+         return messageName;
+     }
+-    
++
+     public void setMessageName(String messageName) {
+         this.messageName = messageName;
+     }
+--- old/src/share/classes/com/sun/xml/internal/ws/model/JavaMethodImpl.java	Thu Jul 30 18:30:57 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/model/JavaMethodImpl.java	Thu Jul 30 18:30:56 2009
+@@ -24,6 +24,7 @@
+  */
+ package com.sun.xml.internal.ws.model;
+ 
++import com.sun.istack.internal.NotNull;
+ import com.sun.xml.internal.bind.api.TypeReference;
+ import com.sun.xml.internal.ws.api.model.JavaMethod;
+ import com.sun.xml.internal.ws.api.model.MEP;
+@@ -32,7 +33,7 @@
+ import com.sun.xml.internal.ws.model.soap.SOAPBindingImpl;
+ import com.sun.xml.internal.ws.model.wsdl.WSDLBoundOperationImpl;
+ import com.sun.xml.internal.ws.model.wsdl.WSDLPortImpl;
+-import com.sun.istack.internal.NotNull;
++import com.sun.istack.internal.Nullable;
+ 
+ import javax.xml.namespace.QName;
+ import javax.xml.ws.Action;
+@@ -47,6 +48,7 @@
+  * @author Vivek Pandey
+  */
+ public final class JavaMethodImpl implements JavaMethod {
++
+     private String inputAction;
+     private String outputAction;
+     private final List<CheckedExceptionImpl> exceptions = new ArrayList<CheckedExceptionImpl>();
+@@ -86,12 +88,12 @@
+     /**
+      * @see {@link JavaMethod}
+      *
+-     * @return Returns the method. 
++     * @return Returns the method.
+      */
+     public Method getMethod() {
+         return method;
+     }
+-    
++
+     /**
+      * @see {@link JavaMethod}
+      *
+@@ -162,6 +164,20 @@
+     }
+ 
+     /**
++     * @return soap:Body's first child name for request message.
++     */
++    public @Nullable QName getRequestPayloadName() {
++        return wsdlOperation.getReqPayloadName();
++    }
++
++    /**
++     * @return soap:Body's first child name for response message.
++     */
++    public @Nullable QName getResponsePayloadName() {
++        return (mep == MEP.ONE_WAY) ? null : wsdlOperation.getResPayloadName();
++    }
++
++    /**
+      * @return returns unmodifiable list of request parameters
+      */
+     public List<ParameterImpl> getRequestParameters() {
+@@ -252,15 +268,7 @@
+         return null;
+     }
+ 
+-    public QName getPayloadName(){
+-        if(payloadName != null)
+-            return payloadName;
+-        payloadName = wsdlOperation.getPayloadName();
+-        return payloadName;
+-    }
+ 
+-    private QName payloadName;
+-
+     /**
+      * @return a list of checked Exceptions thrown by this method
+      */
+@@ -295,7 +303,7 @@
+ 
+     /**
+      * Returns if the java method  is async
+-     * @return if this is an Asynch 
++     * @return if this is an Asynch
+      */
+     public boolean isAsync(){
+         return mep.isAsync;
+@@ -324,4 +332,3 @@
+     }
+ 
+ }
+-
+--- old/src/share/classes/com/sun/xml/internal/ws/model/ParameterImpl.java	Thu Jul 30 18:31:00 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/model/ParameterImpl.java	Thu Jul 30 18:31:00 2009
+@@ -198,11 +198,11 @@
+     /**
+      * Creates a holder if applicable else gives the object as it is. To be
+      * called on the inbound message.
+-     * 
++     *
+      * @param value
+      * @return the non-holder value if its Response or IN otherwise creates a
+      *         holder with the passed value and returns it back.
+-     * 
++     *
+      */
+     public Object createHolderValue(Object value) {
+         if (isResponse() || isIN()) {
+@@ -214,7 +214,7 @@
+     /**
+      * Gets the holder value if applicable. To be called for inbound client side
+      * message.
+-     * 
++     *
+      * @param obj
+      * @return the holder value if applicable.
+      */
+--- old/src/share/classes/com/sun/xml/internal/ws/model/RuntimeModeler.java	Thu Jul 30 18:31:04 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/model/RuntimeModeler.java	Thu Jul 30 18:31:03 2009
+@@ -35,10 +35,12 @@
+ import com.sun.xml.internal.ws.api.model.Parameter;
+ import com.sun.xml.internal.ws.api.model.ParameterBinding;
+ import com.sun.xml.internal.ws.api.model.wsdl.WSDLPart;
++import com.sun.xml.internal.ws.model.soap.SOAPBindingImpl;
+ import com.sun.xml.internal.ws.model.wsdl.WSDLBoundOperationImpl;
+-import com.sun.xml.internal.ws.model.wsdl.WSDLPortImpl;
+ import com.sun.xml.internal.ws.model.wsdl.WSDLInputImpl;
++import com.sun.xml.internal.ws.model.wsdl.WSDLPortImpl;
+ import com.sun.xml.internal.ws.resources.ModelerMessages;
++import com.sun.xml.internal.ws.resources.ServerMessages;
+ import com.sun.xml.internal.ws.util.localization.Localizable;
+ 
+ import javax.jws.Oneway;
+@@ -48,17 +50,11 @@
+ import javax.jws.WebResult;
+ import javax.jws.WebService;
+ import javax.jws.soap.SOAPBinding;
++import static javax.jws.soap.SOAPBinding.ParameterStyle.WRAPPED;
+ import javax.jws.soap.SOAPBinding.Style;
+ import javax.xml.bind.annotation.XmlSeeAlso;
+ import javax.xml.namespace.QName;
+-import javax.xml.ws.Action;
+-import javax.xml.ws.AsyncHandler;
+-import javax.xml.ws.FaultAction;
+-import javax.xml.ws.Holder;
+-import javax.xml.ws.RequestWrapper;
+-import javax.xml.ws.Response;
+-import javax.xml.ws.ResponseWrapper;
+-import javax.xml.ws.WebFault;
++import javax.xml.ws.*;
+ import java.lang.annotation.Annotation;
+ import java.lang.reflect.Method;
+ import java.lang.reflect.Modifier;
+@@ -72,6 +68,7 @@
+ import java.util.StringTokenizer;
+ import java.util.TreeMap;
+ import java.util.concurrent.Future;
++import java.util.logging.Logger;
+ 
+ /**
+  * Creates a runtime model of a SEI (portClass).
+@@ -79,10 +76,11 @@
+  * @author WS Developement Team
+  */
+ public class RuntimeModeler {
++    private final WebServiceFeature[] features;
+     private BindingID bindingId;
+     private Class portClass;
+     private AbstractSEIModelImpl model;
+-    private com.sun.xml.internal.ws.model.soap.SOAPBindingImpl defaultBinding;
++    private SOAPBindingImpl defaultBinding;
+     // can be empty but never null
+     private String packageName;
+     private String targetNamespace;
+@@ -118,10 +116,15 @@
+      * @param bindingId The binding identifier to be used when modeling the <code>portClass</code>.
+      */
+     public RuntimeModeler(@NotNull Class portClass, @NotNull QName serviceName, @NotNull BindingID bindingId) {
++        this(portClass, serviceName, bindingId, new WebServiceFeature[0]);
++    }
++
++    public RuntimeModeler(@NotNull Class portClass, @NotNull QName serviceName, @NotNull BindingID bindingId, @NotNull WebServiceFeature... features) {
+         this.portClass = portClass;
+         this.serviceName = serviceName;
+         this.binding = null;
+         this.bindingId = bindingId;
++        this.features = features;
+     }
+ 
+     /**
+@@ -131,18 +134,12 @@
+      * @param serviceName The ServiceName to use instead of one calculated from the implementation class
+      * @param wsdlPort {@link com.sun.xml.internal.ws.api.model.wsdl.WSDLPort}
+      */
+-    public RuntimeModeler(@NotNull Class sei, @NotNull QName serviceName, @NotNull WSDLPortImpl wsdlPort){
++    public RuntimeModeler(@NotNull Class sei, @NotNull QName serviceName, @NotNull WSDLPortImpl wsdlPort, @NotNull WebServiceFeature... features){
+         this.portClass = sei;
+         this.serviceName = serviceName;
+         this.bindingId = wsdlPort.getBinding().getBindingId();
+-
+-        //If the bindingId is null lets default to SOAP 1.1 binding id. As it looks like this bindingId
+-        //is used latter on from model to generate binding on the WSDL. So defaulting to SOAP 1.1 maybe
+-        // safe to do.
+-        if(this.bindingId == null)
+-            this.bindingId = BindingID.SOAP11_HTTP;
+-
+         this.binding = wsdlPort;
++        this.features = features;
+     }
+ 
+     /**
+@@ -186,6 +183,10 @@
+         });
+     }
+ 
++    private static final Logger logger =
++        Logger.getLogger(
++            com.sun.xml.internal.ws.util.Constants.LoggingDomain + ".server");
++
+     //currently has many local vars which will be eliminated after debugging issues
+     //first draft
+     /**
+@@ -193,7 +194,7 @@
+      * @return the runtime model for the <code>portClass</code>.
+      */
+     public AbstractSEIModelImpl buildRuntimeModel() {
+-        model = new SOAPSEIModel();
++        model = new SOAPSEIModel(features);
+         Class clazz = portClass;
+         WebService webService = getPrivClassAnnotation(portClass, WebService.class);
+         if (webService == null) {
+@@ -207,6 +208,15 @@
+                 throw new RuntimeModelerException("runtime.modeler.endpoint.interface.no.webservice",
+                     webService.endpointInterface());
+             }
++
++            //check if @SOAPBinding is defined on the impl class
++            SOAPBinding sbPortClass = getPrivClassAnnotation(portClass, SOAPBinding.class);
++            SOAPBinding sbSei = getPrivClassAnnotation(clazz, SOAPBinding.class);
++            if(sbPortClass != null){
++                if(sbSei == null || sbSei.style() != sbPortClass.style()|| sbSei.use() != sbPortClass.use()){
++                    logger.warning(ServerMessages.RUNTIMEMODELER_INVALIDANNOTATION_ON_IMPL("@SOAPBinding", portClass.getName(), clazz.getName()));
++                }
++            }
+         }
+         if (serviceName == null)
+             serviceName = getServiceName(portClass);
+@@ -260,6 +270,46 @@
+         }
+     }
+ 
++    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 (generateWrapperBeans) {
++                logger.info("Dynamically creating request wrapper Class " + className);
++                return WrapperBeanGenerator.createRequestWrapperBean(className, method, reqElemName, loader);
++            }
++            throw new RuntimeModelerException(e);
++        }
++    }
++
++    private Class getResponseWrapperClass(String className, Method method, QName resElemName) {
++        ClassLoader loader =  (classLoader == null) ? Thread.currentThread().getContextClassLoader() : classLoader;
++        try {
++            return loader.loadClass(className);
++        } catch (ClassNotFoundException e) {
++            if (generateWrapperBeans) {
++                logger.info("Dynamically creating response wrapper bean Class " + className);
++                return WrapperBeanGenerator.createResponseWrapperBean(className, method, resElemName, loader);
++            }
++            throw new RuntimeModelerException(e);
++        }
++    }
++
++
++    private Class getExceptionBeanClass(String className, Class exception, String name, String namespace) {
++        ClassLoader loader =  (classLoader == null) ? Thread.currentThread().getContextClassLoader() : classLoader;
++        try {
++            return loader.loadClass(className);
++        } catch (ClassNotFoundException e) {
++            if (generateWrapperBeans) {
++                logger.info("Dynamically creating exception bean Class " + className);
++                return WrapperBeanGenerator.createExceptionBean(className, exception, targetNamespace, name, namespace, loader);
++            }
++            throw new RuntimeModelerException(e);
++        }
++    }
++
+     protected void setUsesWebMethod(Class clazz, Boolean usesWebMethod) {
+ //        System.out.println("class: "+clazz.getName()+" uses WebMethod: "+usesWebMethod);
+         classUsesWebMethod.put(clazz, usesWebMethod);
+@@ -309,10 +359,9 @@
+         model.setPortTypeName(portTypeName);
+         model.setWSDLLocation(webService.wsdlLocation());
+ 
+-        javax.jws.soap.SOAPBinding soapBinding = getPrivClassAnnotation(clazz, javax.jws.soap.SOAPBinding.class);
++        SOAPBinding soapBinding = getPrivClassAnnotation(clazz, SOAPBinding.class);
+         if (soapBinding != null) {
+-            isWrapped = soapBinding.parameterStyle().equals(
+-                javax.jws.soap.SOAPBinding.ParameterStyle.WRAPPED);
++            isWrapped = soapBinding.parameterStyle()== WRAPPED;
+         }
+         defaultBinding = createBinding(soapBinding);
+         /*
+@@ -335,9 +384,17 @@
+         }*/
+ 
+         for (Method method : clazz.getMethods()) {
+-            if (method.getDeclaringClass()==Object.class ||
+-                !isWebMethod(method, clazz)) {
+-                continue;
++            if (!clazz.isInterface()) {     // if clazz is SEI, then all methods are web methods
++                if (!legacyWebMethod) {
++                    if (!isWebMethodBySpec(method, clazz)) {
++                        continue;
++                    }
++                } else {
++                    if (method.getDeclaringClass()==Object.class ||
++                        !isWebMethod(method, clazz)) {
++                        continue;
++                    }
++                }
+             }
+             // TODO: binding can be null. We need to figure out how to post-process
+             // RuntimeModel to link to WSDLModel
+@@ -346,14 +403,53 @@
+         //Add additional jaxb classes referenced by {@link XmlSeeAlso}
+         XmlSeeAlso xmlSeeAlso = getPrivClassAnnotation(clazz, XmlSeeAlso.class);
+         if(xmlSeeAlso != null)
+-            model.setAdditionalClasses(xmlSeeAlso.value());
++            model.addAdditionalClasses(xmlSeeAlso.value());
+     }
+ 
++    /*
++     * Section 3.3 of spec
++     * Otherwise, the class implicitly defines a service endpoint interface (SEI) which
++     * comprises all of the public methods that satisfy one of the following conditions:
++     *  1. They are annotated with the javax.jws.WebMethod annotation with the exclude element set to
++     *     false or missing (since false is the default for this annotation element).
++     *  2. They are not annotated with the javax.jws.WebMethod annotation but their declaring class has a
++     *     javax.jws.WebService annotation.
++     *
++     * also the method should non-static or non-final
++     */
++    private boolean isWebMethodBySpec(Method method, Class clazz) {
++
++        int modifiers = method.getModifiers();
++        boolean staticFinal = Modifier.isStatic(modifiers) || Modifier.isFinal(modifiers);
++
++        assert Modifier.isPublic(modifiers);
++        assert !clazz.isInterface();
++
++        WebMethod webMethod = getPrivMethodAnnotation(method, WebMethod.class);
++        if (webMethod != null) {
++            if (webMethod.exclude()) {
++                return false;       // @WebMethod(exclude="true")
++            }
++            if (staticFinal) {
++                throw new RuntimeModelerException(ModelerMessages.localizableRUNTIME_MODELER_WEBMETHOD_MUST_BE_NONSTATICFINAL(method));
++            }
++            return true;            // @WebMethod
++        }
++
++        if (staticFinal) {
++            return false;
++        }
++
++        Class declClass = method.getDeclaringClass();
++        return getPrivClassAnnotation(declClass, WebService.class) != null;
++    }
++
++
+     protected boolean isWebMethod(Method method, Class clazz) {
+         if (clazz.isInterface()) {
+             return true;
+         }
+-        Class declClass = method.getDeclaringClass();        
++        Class declClass = method.getDeclaringClass();
+         boolean declHasWebService = getPrivClassAnnotation(declClass, WebService.class) != null;
+         WebMethod webMethod = getPrivMethodAnnotation(method, WebMethod.class);
+         if (webMethod != null && !webMethod.exclude() &&
+@@ -369,9 +465,8 @@
+      * @param soapBinding the <code>javax.jws.soap.SOAPBinding</code> to model
+      * @return returns the runtime model SOAPBinding corresponding to <code>soapBinding</code>
+      */
+-    protected com.sun.xml.internal.ws.model.soap.SOAPBindingImpl createBinding(javax.jws.soap.SOAPBinding soapBinding) {
+-        com.sun.xml.internal.ws.model.soap.SOAPBindingImpl rtSOAPBinding =
+-            new com.sun.xml.internal.ws.model.soap.SOAPBindingImpl();
++    protected SOAPBindingImpl createBinding(SOAPBinding soapBinding) {
++        SOAPBindingImpl rtSOAPBinding = new SOAPBindingImpl();
+         Style style = soapBinding!=null ? soapBinding.style() : Style.DOCUMENT;
+         rtSOAPBinding.setStyle(style);
+         assert bindingId != null;
+@@ -500,7 +595,7 @@
+             if (action != null)
+                 mySOAPBinding.setSOAPAction(action);
+             methodIsWrapped = methodBinding.parameterStyle().equals(
+-                javax.jws.soap.SOAPBinding.ParameterStyle.WRAPPED);
++                WRAPPED);
+             javaMethod.setBinding(mySOAPBinding);
+         } else {
+             com.sun.xml.internal.ws.model.soap.SOAPBindingImpl sb = new com.sun.xml.internal.ws.model.soap.SOAPBindingImpl(defaultBinding);
+@@ -567,8 +662,6 @@
+             responseClassName = beanPackage + capitalize(method.getName()) + RESPONSE;
+         }
+ 
+-        Class requestClass = getClass(requestClassName, ModelerMessages.localizableRUNTIME_MODELER_WRAPPER_NOT_FOUND(requestClassName));
+-
+         String reqName = operationName;
+         String reqNamespace = targetNamespace;
+         if (reqWrapper != null) {
+@@ -578,12 +671,13 @@
+                 reqName = reqWrapper.localName();
+         }
+         QName reqElementName = new QName(reqNamespace, reqName);
++        Class requestClass = getRequestWrapperClass(requestClassName, method, reqElementName);
+ 
+         Class responseClass = null;
+         String resName = operationName+"Response";
+         String resNamespace = targetNamespace;
++        QName resElementName = null;
+         if (!isOneway) {
+-            responseClass = getClass(responseClassName, ModelerMessages.localizableRUNTIME_MODELER_WRAPPER_NOT_FOUND(responseClassName));
+             if (resWrapper != null) {
+                 if (resWrapper.targetNamespace().length() > 0)
+                     resNamespace = resWrapper.targetNamespace();
+@@ -590,8 +684,9 @@
+                 if (resWrapper.localName().length() > 0)
+                     resName = resWrapper.localName();
+             }
++            resElementName = new QName(resNamespace, resName);
++            responseClass = getResponseWrapperClass(responseClassName, method, resElementName);
+         }
+-        QName resElementName = new QName(resNamespace, resName);
+ 
+         TypeReference typeRef =
+                 new TypeReference(reqElementName, requestClass);
+@@ -977,7 +1072,7 @@
+                     namespace = webFault.targetNamespace();
+             }
+             if (faultInfoMethod == null)  {
+-                exceptionBean = getClass(className, ModelerMessages.localizableRUNTIME_MODELER_WRAPPER_NOT_FOUND(className));
++                exceptionBean = getExceptionBeanClass(className, exception, name, namespace);
+                 exceptionType = ExceptionType.UserDefined;
+                 anns = exceptionBean.getAnnotations();
+             } else {
+@@ -994,7 +1089,7 @@
+                     checkedException.setFaultAction(fa.value());
+                     break;
+                 }
+-            }            
++            }
+             javaMethod.addException(checkedException);
+         }
+     }
+@@ -1096,6 +1191,9 @@
+             for (Annotation annotation : pannotations[pos]) {
+                 if (annotation.annotationType() == javax.jws.WebParam.class) {
+                     javax.jws.WebParam webParam = (javax.jws.WebParam) annotation;
++                    isHeader = webParam.header();
++                    if(isHeader)
++                        paramName = "arg"+pos;
+                     if (webParam.name().length() > 0)
+                         paramName = webParam.name();
+                     partName = webParam.partName();
+@@ -1102,7 +1200,6 @@
+                     if (!webParam.targetNamespace().equals("")) {
+                         requestNamespace = webParam.targetNamespace();
+                     }
+-                    isHeader = webParam.header();
+                     paramMode = webParam.mode();
+                     if (isHolder && paramMode == Mode.IN)
+                         paramMode = Mode.INOUT;
+@@ -1136,7 +1233,7 @@
+             }
+             javaMethod.addParameter(param);
+         }
+-        validateDocBare(javaMethod);        
++        validateDocBare(javaMethod);
+         processExceptions(javaMethod, method);
+     }
+ 
+@@ -1327,4 +1424,40 @@
+         }
+         return null;
+     }
++
++    private static Boolean getProperty(final String prop) {
++        Boolean b = AccessController.doPrivileged(
++            new java.security.PrivilegedAction<Boolean>() {
++                public Boolean run() {
++                    String value = System.getProperty(prop);
++                    return value != null ? Boolean.valueOf(value) : Boolean.FALSE;
++                }
++            }
++        );
++        return Boolean.FALSE;
++    }
++
++    /**
++     * Support for legacy WebMethod computation.
++     */
++    public static final boolean legacyWebMethod = getProperty(RuntimeModeler.class.getName()+".legacyWebMethod");
++
++
++    /**
++     * Controls whether wrapper beans should be generated dynamically.
++     *
++     * By default in JDK, they are not generated.
++     */
++    public static final boolean generateWrapperBeans;
++    static {
++        boolean wrapperGeneratorExists = false;
++        try {
++            Class.forName("com.sun.xml.internal." + "ws.model.WrapperBeanGenerator");
++            wrapperGeneratorExists = true;
++        } catch (ClassNotFoundException cnfe) {
++            wrapperGeneratorExists = getProperty(RuntimeModeler.class.getName()+".generateWrappers");
++        }
++        generateWrapperBeans = wrapperGeneratorExists;
++    }
++
+ }
+--- old/src/share/classes/com/sun/xml/internal/ws/model/RuntimeModelerException.java	Thu Jul 30 18:31:08 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/model/RuntimeModelerException.java	Thu Jul 30 18:31:07 2009
+@@ -30,9 +30,9 @@
+ /**
+  * RuntimeModelerException represents an exception that occurred while
+  * serializing a Java value as XML.
+- * 
++ *
+  * @see JAXWSExceptionBase
+- * 
++ *
+  * @author WS Development Team
+  */
+ public class RuntimeModelerException extends JAXWSExceptionBase {
+--- old/src/share/classes/com/sun/xml/internal/ws/model/SOAPSEIModel.java	Thu Jul 30 18:31:11 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/model/SOAPSEIModel.java	Thu Jul 30 18:31:11 2009
+@@ -28,6 +28,7 @@
+ 
+ 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;
+@@ -39,6 +40,10 @@
+  */
+ public class SOAPSEIModel extends AbstractSEIModelImpl {
+ 
++    public SOAPSEIModel(WebServiceFeature[] features) {
++        super(features);
++    }
++
+     @Override
+     protected void populateMaps() {
+         int emptyBodyCount = 0;
+@@ -51,7 +56,7 @@
+                     put(p.getName(), jm);
+                     bodyFound = true;
+                 }
+-            }            
++            }
+             if(!bodyFound){
+                 put(emptyBodyName, jm);
+ //                System.out.println("added empty body for: "+jm.getMethod().getName());
+--- old/src/share/classes/com/sun/xml/internal/ws/model/WrapperParameter.java	Thu Jul 30 18:31:15 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/model/WrapperParameter.java	Thu Jul 30 18:31:14 2009
+@@ -47,7 +47,7 @@
+  * This parameter is only used for the {@link ParameterBinding#BODY} binding.
+  * Other parameters that bind to other parts (such as headers or unbound)
+  * will show up directly under {@link JavaMethod}.
+- * 
++ *
+  * @author Vivek Pandey
+  */
+ public class WrapperParameter extends ParameterImpl {
+@@ -77,7 +77,7 @@
+ 
+     /**
+      * Adds a new child parameter.
+-     * 
++     *
+      * @param wrapperChild
+      */
+     public void addWrapperChild(ParameterImpl wrapperChild) {
+--- old/src/share/classes/com/sun/xml/internal/ws/model/wsdl/AbstractExtensibleImpl.java	Thu Jul 30 18:31:18 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/model/wsdl/AbstractExtensibleImpl.java	Thu Jul 30 18:31:17 2009
+@@ -135,5 +135,5 @@
+             throw new WebServiceException(buf.toString());
+         }
+         return true;
+-    }    
++    }
+ }
+--- old/src/share/classes/com/sun/xml/internal/ws/model/wsdl/WSDLBoundOperationImpl.java	Thu Jul 30 18:31:22 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/model/wsdl/WSDLBoundOperationImpl.java	Thu Jul 30 18:31:21 2009
+@@ -25,16 +25,15 @@
+ package com.sun.xml.internal.ws.model.wsdl;
+ 
+ import com.sun.istack.internal.Nullable;
++import com.sun.istack.internal.NotNull;
+ import com.sun.xml.internal.ws.api.model.ParameterBinding;
+-import com.sun.xml.internal.ws.api.model.wsdl.WSDLBoundOperation;
+-import com.sun.xml.internal.ws.api.model.wsdl.WSDLOperation;
++import com.sun.xml.internal.ws.api.model.wsdl.*;
+ 
+ import javax.jws.WebParam.Mode;
+ import javax.jws.soap.SOAPBinding.Style;
+ import javax.xml.namespace.QName;
+ import javax.xml.stream.XMLStreamReader;
+-import java.util.HashMap;
+-import java.util.Map;
++import java.util.*;
+ 
+ /**
+  * Implementation of {@link WSDLBoundOperation}
+@@ -63,6 +62,7 @@
+     private final Map<String, WSDLPartImpl> inParts;
+     private final Map<String, WSDLPartImpl> outParts;
+     private final Map<String, WSDLPartImpl> fltParts;
++    private final List<WSDLBoundFaultImpl> wsdlBoundFaults;
+     private WSDLOperationImpl operation;
+     private String soapAction;
+     private ANONYMOUS anonymous;
+@@ -85,6 +85,7 @@
+         inParts = new HashMap<String, WSDLPartImpl>();
+         outParts = new HashMap<String, WSDLPartImpl>();
+         fltParts = new HashMap<String, WSDLPartImpl>();
++        wsdlBoundFaults = new ArrayList<WSDLBoundFaultImpl>();
+         this.owner = owner;
+     }
+ 
+@@ -100,14 +101,7 @@
+         this.soapAction = soapAction!=null?soapAction:"";
+     }
+ 
+-    /**
+-     * Gets {@link com.sun.xml.internal.ws.api.model.wsdl.WSDLPart} for the given wsdl:input or wsdl:output part
+-     *
+-     * @param partName must be non-null
+-     * @param mode     must be non-null
+-     * @return null if no part is found
+-     */
+-    public WSDLPartImpl getPart(String partName, Mode mode){
++    public WSDLPartImpl getPart(String partName, Mode mode) {
+         if(mode==Mode.IN){
+             return inParts.get(partName);
+         }else if(mode==Mode.OUT){
+@@ -150,6 +144,25 @@
+         return faultParts;
+     }
+ 
++    // TODO: what's the difference between this and inputParts/outputParts?
++    public Map<String,WSDLPart> getInParts() {
++        return Collections.<String,WSDLPart>unmodifiableMap(inParts);
++    }
++
++    public Map<String,WSDLPart> getOutParts() {
++        return Collections.<String,WSDLPart>unmodifiableMap(outParts);
++    }
++
++    @NotNull
++    public List<WSDLBoundFaultImpl> getFaults() {
++        return wsdlBoundFaults;
++    }
++
++    public void addFault(@NotNull WSDLBoundFaultImpl fault){
++        wsdlBoundFaults.add(fault);
++    }
++
++
+     /**
+      * Map of mime:content@part and the mime type from mime:content@type for wsdl:output
+      *
+@@ -280,6 +293,11 @@
+         return operation;
+     }
+ 
++
++    public WSDLBoundPortType getBoundPortType() {
++        return owner;
++    }
++
+     public void setInputExplicitBodyParts(boolean b) {
+         explicitInputSOAPBodyParts = b;
+     }
+@@ -297,33 +315,65 @@
+         this.style = style;
+     }
+ 
+-    public @Nullable QName getPayloadName() {
++    public @Nullable QName getReqPayloadName() {
++        if (emptyRequestPayload)
++            return null;
++
++        if (requestPayloadName != null)
++            return requestPayloadName;
++
+         if(style.equals(Style.RPC)){
+-            return name;
++            String ns = getRequestNamespace() != null ? getRequestNamespace() : name.getNamespaceURI();
++            requestPayloadName = new QName(ns, name.getLocalPart());
++            return requestPayloadName;
+         }else{
+-            if(emptyPayload)
+-                return null;
+-            
+-            if(payloadName != null)
+-                return payloadName;
+-
+             QName inMsgName = operation.getInput().getMessage().getName();
+             WSDLMessageImpl message = messages.get(inMsgName);
+             for(WSDLPartImpl part:message.parts()){
+                 ParameterBinding binding = getInputBinding(part.getName());
+                 if(binding.isBody()){
+-                    payloadName = part.getDescriptor().name();
+-                    return payloadName;
++                    requestPayloadName = part.getDescriptor().name();
++                    return requestPayloadName;
+                 }
+             }
+ 
+             //Its empty payload
+-            emptyPayload = true;
++            emptyRequestPayload = true;
+         }
+         //empty body
+         return null;
+     }
+ 
++    public @Nullable QName getResPayloadName() {
++        if (emptyResponsePayload)
++            return null;
++
++        if (responsePayloadName != null)
++            return responsePayloadName;
++
++        if(style.equals(Style.RPC)){
++            String ns = getResponseNamespace() != null ? getResponseNamespace() : name.getNamespaceURI();
++            responsePayloadName = new QName(ns, name.getLocalPart()+"Response");
++            return responsePayloadName;
++        }else{
++            QName outMsgName = operation.getOutput().getMessage().getName();
++            WSDLMessageImpl message = messages.get(outMsgName);
++            for(WSDLPartImpl part:message.parts()){
++                ParameterBinding binding = getOutputBinding(part.getName());
++                if(binding.isBody()){
++                    responsePayloadName = part.getDescriptor().name();
++                    return responsePayloadName;
++                }
++            }
++
++            //Its empty payload
++            emptyResponsePayload = true;
++        }
++        //empty body
++        return null;
++    }
++
++
+     private String reqNamespace;
+     private String respNamespace;
+ 
+@@ -334,7 +384,7 @@
+      * @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)
+      */
+     public String getRequestNamespace(){
+-        return reqNamespace;
++        return (reqNamespace != null)?reqNamespace:name.getNamespaceURI();
+     }
+ 
+     public void setRequestNamespace(String ns){
+@@ -349,7 +399,7 @@
+      *      * @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)
+      */
+     public String getResponseNamespace(){
+-        return respNamespace;
++        return (respNamespace!=null)?respNamespace:name.getNamespaceURI();
+     }
+ 
+     public void setResponseNamespace(String ns){
+@@ -360,13 +410,18 @@
+         return owner;
+     }
+ 
+-    private QName payloadName;
+-    private boolean emptyPayload;
++    private QName requestPayloadName;
++    private QName responsePayloadName;
++    private boolean emptyRequestPayload;
++    private boolean emptyResponsePayload;
+     private Map<QName, WSDLMessageImpl> messages;
+ 
+     void freeze(WSDLModelImpl parent) {
+         messages = parent.getMessages();
+         operation = owner.getPortType().get(name.getLocalPart());
++        for(WSDLBoundFaultImpl bf : wsdlBoundFaults){
++            bf.freeze(this);
++        }
+     }
+ 
+     public void setAnonymous(ANONYMOUS anonymous) {
+--- old/src/share/classes/com/sun/xml/internal/ws/model/wsdl/WSDLBoundPortTypeImpl.java	Thu Jul 30 18:31:25 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/model/wsdl/WSDLBoundPortTypeImpl.java	Thu Jul 30 18:31:25 2009
+@@ -30,9 +30,9 @@
+ import com.sun.xml.internal.ws.api.model.ParameterBinding;
+ 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.resources.ClientMessages;
+ import com.sun.xml.internal.ws.util.QNameMap;
+ import com.sun.xml.internal.ws.util.exception.LocatableWebServiceException;
+-import com.sun.xml.internal.ws.resources.ClientMessages;
+ 
+ import javax.jws.WebParam.Mode;
+ import javax.jws.soap.SOAPBinding;
+@@ -52,7 +52,6 @@
+     private WSDLPortTypeImpl portType;
+     private BindingID bindingId;
+     private final @NotNull WSDLModelImpl owner;
+-    private boolean finalized = false;
+     private final QNameMap<WSDLBoundOperationImpl> bindingOperations = new QNameMap<WSDLBoundOperationImpl>();
+ 
+     /**
+@@ -111,7 +110,7 @@
+ 
+     public BindingID getBindingId() {
+         //Should the default be SOAP1.1/HTTP binding? For now lets keep it for
+-        //JBI bug 6509800 
++        //JBI bug 6509800
+         return (bindingId==null)?BindingID.SOAP11_HTTP:bindingId;
+     }
+ 
+@@ -209,21 +208,20 @@
+         }
+ 
+         freezePayloadMap();
+-        if(style == Style.RPC){
+-            owner.finalizeRpcLitBinding(this);
+-        }
++        owner.finalizeRpcLitBinding(this);
+     }
+ 
+     private void freezePayloadMap() {
+         if(style== Style.RPC) {
+-            // If the style is rpc then the tag name should be
+-            // same as operation name so return the operation that matches the tag name.
+-            payloadMap = bindingOperations;
++            payloadMap = new QNameMap<WSDLBoundOperationImpl>();
++            for(WSDLBoundOperationImpl op : bindingOperations.values()){
++                payloadMap.put(op.getReqPayloadName(), op);
++            }
+         } else {
+             payloadMap = new QNameMap<WSDLBoundOperationImpl>();
+             // For doclit The tag will be the operation that has the same input part descriptor value
+             for(WSDLBoundOperationImpl op : bindingOperations.values()){
+-                QName name = op.getPayloadName();
++                QName name = op.getReqPayloadName();
+                 if(name == null){
+                     //empty payload
+                     emptyPayloadOperation = op;
+--- old/src/share/classes/com/sun/xml/internal/ws/model/wsdl/WSDLFaultImpl.java	Thu Jul 30 18:31:29 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/model/wsdl/WSDLFaultImpl.java	Thu Jul 30 18:31:28 2009
+@@ -26,6 +26,8 @@
+ package com.sun.xml.internal.ws.model.wsdl;
+ 
+ import com.sun.xml.internal.ws.api.model.wsdl.WSDLFault;
++import com.sun.xml.internal.ws.api.model.wsdl.WSDLOperation;
++import com.sun.istack.internal.NotNull;
+ 
+ import javax.xml.namespace.QName;
+ import javax.xml.stream.XMLStreamReader;
+@@ -37,11 +39,13 @@
+     private final String name;
+     private final QName messageName;
+     private WSDLMessageImpl message;
++    private WSDLOperationImpl operation;
+ 
+-    public WSDLFaultImpl(XMLStreamReader xsr,String name, QName messageName) {
++    public WSDLFaultImpl(XMLStreamReader xsr, String name, QName messageName, WSDLOperationImpl operation) {
+         super(xsr);
+         this.name = name;
+         this.messageName = messageName;
++        this.operation = operation;
+     }
+ 
+     public String getName() {
+@@ -52,6 +56,16 @@
+         return message;
+     }
+ 
++    @NotNull
++    public WSDLOperation getOperation() {
++        return operation;
++    }
++
++    @NotNull
++    public QName getQName() {
++        return new QName(operation.getName().getNamespaceURI(), name);
++    }
++
+     void freeze(WSDLModelImpl root){
+         message = root.getMessage(messageName);
+     }
+--- old/src/share/classes/com/sun/xml/internal/ws/model/wsdl/WSDLInputImpl.java	Thu Jul 30 18:31:32 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/model/wsdl/WSDLInputImpl.java	Thu Jul 30 18:31:32 2009
+@@ -27,6 +27,9 @@
+ 
+ import com.sun.xml.internal.ws.api.model.wsdl.WSDLInput;
+ import com.sun.xml.internal.ws.api.model.wsdl.WSDLMessage;
++import com.sun.xml.internal.ws.api.model.wsdl.WSDLOperation;
++import com.sun.istack.internal.NotNull;
++import com.sun.istack.internal.Nullable;
+ 
+ import javax.xml.namespace.QName;
+ import javax.xml.stream.XMLStreamReader;
+@@ -52,7 +55,7 @@
+     public String getName() {
+         if(name != null)
+             return name;
+-        
++
+         return (operation.isOneWay())?operation.getName().getLocalPart():operation.getName().getLocalPart()+"Request";
+     }
+ 
+@@ -64,6 +67,15 @@
+         return action;
+     }
+ 
++    @NotNull
++    public WSDLOperation getOperation() {
++        return operation;
++    }
++
++    public QName getQName() {
++        return new QName(operation.getName().getNamespaceURI(), getName());
++    }
++
+     public void setAction(String action) {
+         this.action = action;
+     }
+@@ -75,7 +87,7 @@
+     public void setDefaultAction(boolean defaultAction) {
+         this.defaultAction = defaultAction;
+     }
+-    
++
+     void freeze(WSDLModelImpl parent) {
+         message = parent.getMessage(messageName);
+     }
+--- old/src/share/classes/com/sun/xml/internal/ws/model/wsdl/WSDLMessageImpl.java	Thu Jul 30 18:31:36 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/model/wsdl/WSDLMessageImpl.java	Thu Jul 30 18:31:35 2009
+@@ -55,7 +55,7 @@
+         parts.add(part);
+     }
+ 
+-    Iterable<WSDLPartImpl> parts(){
++    public Iterable<WSDLPartImpl> parts(){
+         return parts;
+     }
+ }
+--- old/src/share/classes/com/sun/xml/internal/ws/model/wsdl/WSDLModelImpl.java	Thu Jul 30 18:31:39 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/model/wsdl/WSDLModelImpl.java	Thu Jul 30 18:31:39 2009
+@@ -147,7 +147,7 @@
+         WSDLPort port = iter.hasNext()?iter.next():null;
+         return port;
+     }
+-    
++
+     /**
+     * gets the first port in the wsdl which matches the serviceName and portType
+     */
+--- old/src/share/classes/com/sun/xml/internal/ws/model/wsdl/WSDLOutputImpl.java	Thu Jul 30 18:31:43 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/model/wsdl/WSDLOutputImpl.java	Thu Jul 30 18:31:42 2009
+@@ -27,6 +27,8 @@
+ 
+ import com.sun.xml.internal.ws.api.model.wsdl.WSDLMessage;
+ import com.sun.xml.internal.ws.api.model.wsdl.WSDLOutput;
++import com.sun.xml.internal.ws.api.model.wsdl.WSDLOperation;
++import com.sun.istack.internal.NotNull;
+ 
+ import javax.xml.namespace.QName;
+ import javax.xml.stream.XMLStreamReader;
+@@ -60,6 +62,16 @@
+         return action;
+     }
+ 
++    @NotNull
++    public WSDLOperation getOperation() {
++        return operation;
++    }
++
++    @NotNull
++    public QName getQName() {
++        return new QName(operation.getName().getNamespaceURI(), getName());
++    }
++
+     public void setAction(String action) {
+         this.action = action;
+     }
+--- old/src/share/classes/com/sun/xml/internal/ws/package-info.java	Thu Jul 30 18:31:46 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/package-info.java	Thu Jul 30 18:31:46 2009
+@@ -47,7 +47,7 @@
+  *    The client side portion of the JAX-WS runtime.
+  *
+  * </dl>
+- * 
++ *
+  * @ArchitectureDocument
+  **/
+ package com.sun.xml.internal.ws;
+--- old/src/share/classes/com/sun/xml/internal/ws/protocol/soap/MUTube.java	Thu Jul 30 18:31:50 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/protocol/soap/MUTube.java	Thu Jul 30 18:31:49 2009
+@@ -66,7 +66,7 @@
+ 
+     protected final SOAPVersion soapVersion;
+     private final AddressingVersion addressingVersion;
+-    
++
+     protected MUTube(WSBinding binding, Tube next) {
+         super(next);
+         // MUPipe should n't be used for bindings other than SOAP.
+@@ -103,7 +103,7 @@
+                 if (!header.isIgnorable(soapVersion, roles)) {
+                     QName qName = new QName(header.getNamespaceURI(), header.getLocalPart());
+                     if (! knownHeaders.contains(qName)) {
+-                        logger.finest("Element not understood=" + qName);
++                        logger.info("Element not understood=" + qName);
+                         if (notUnderstoodHeaders == null)
+                             notUnderstoodHeaders = new HashSet<QName>();
+                         notUnderstoodHeaders.add(qName);
+--- old/src/share/classes/com/sun/xml/internal/ws/protocol/soap/ServerMUTube.java	Thu Jul 30 18:31:54 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/protocol/soap/ServerMUTube.java	Thu Jul 30 18:31:53 2009
+@@ -37,9 +37,9 @@
+  */
+ 
+ public class ServerMUTube extends MUTube {
+-    
++
+     private HandlerConfiguration handlerConfig;
+-    
++
+     public ServerMUTube(WSBinding binding, Tube next) {
+         super(binding, next);
+         //On Server, HandlerConfiguration does n't change after publish.
+--- old/src/share/classes/com/sun/xml/internal/ws/resources/AddressingMessages.java	Thu Jul 30 18:31:57 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/AddressingMessages.java	Thu Jul 30 18:31:56 2009
+@@ -31,7 +31,7 @@
+ 
+ /**
+  * Defines string formatting method for each constant in the resource file
+- * 
++ *
+  */
+ public final class AddressingMessages {
+ 
+@@ -44,7 +44,7 @@
+ 
+     /**
+      * Ignoring non-anonymous response for one-way message
+-     * 
++     *
+      */
+     public static String NON_ANONYMOUS_RESPONSE_ONEWAY() {
+         return localizer.localize(localizableNON_ANONYMOUS_RESPONSE_ONEWAY());
+@@ -56,7 +56,7 @@
+ 
+     /**
+      * No WS-Addressing headers found processing the server inbound request
+-     * 
++     *
+      */
+     public static String NULL_WSA_HEADERS() {
+         return localizer.localize(localizableNULL_WSA_HEADERS());
+@@ -68,7 +68,7 @@
+ 
+     /**
+      * Unknown WS-Addressing header
+-     * 
++     *
+      */
+     public static String UNKNOWN_WSA_HEADER() {
+         return localizer.localize(localizableUNKNOWN_WSA_HEADER());
+@@ -80,7 +80,7 @@
+ 
+     /**
+      * Populating request Addressing headers and found null Action
+-     * 
++     *
+      */
+     public static String NULL_ACTION() {
+         return localizer.localize(localizableNULL_ACTION());
+@@ -92,7 +92,7 @@
+ 
+     /**
+      * Invalid value obtained from wsaw:Anonymous: "{0}"
+-     * 
++     *
+      */
+     public static String INVALID_WSAW_ANONYMOUS(Object arg0) {
+         return localizer.localize(localizableINVALID_WSAW_ANONYMOUS(arg0));
+@@ -104,7 +104,7 @@
+ 
+     /**
+      * Unexpected null SOAP version
+-     * 
++     *
+      */
+     public static String NULL_SOAP_VERSION() {
+         return localizer.localize(localizableNULL_SOAP_VERSION());
+@@ -116,7 +116,7 @@
+ 
+     /**
+      * Cannot find an operation in wsdl:binding for "{0}"
+-     * 
++     *
+      */
+     public static String WSDL_BOUND_OPERATION_NOT_FOUND(Object arg0) {
+         return localizer.localize(localizableWSDL_BOUND_OPERATION_NOT_FOUND(arg0));
+@@ -128,7 +128,7 @@
+ 
+     /**
+      * Sending 202 and processing non-anonymous response
+-     * 
++     *
+      */
+     public static String NON_ANONYMOUS_RESPONSE() {
+         return localizer.localize(localizableNON_ANONYMOUS_RESPONSE());
+@@ -140,7 +140,7 @@
+ 
+     /**
+      * Validating inbound Addressing headers on server and found null Action
+-     * 
++     *
+      */
+     public static String VALIDATION_SERVER_NULL_ACTION() {
+         return localizer.localize(localizableVALIDATION_SERVER_NULL_ACTION());
+@@ -152,7 +152,7 @@
+ 
+     /**
+      * FaultTo header cannot be parsed
+-     * 
++     *
+      */
+     public static String FAULT_TO_CANNOT_PARSE() {
+         return localizer.localize(localizableFAULT_TO_CANNOT_PARSE());
+@@ -164,7 +164,7 @@
+ 
+     /**
+      * Validating inbound Addressing headers on client and found null Action
+-     * 
++     *
+      */
+     public static String VALIDATION_CLIENT_NULL_ACTION() {
+         return localizer.localize(localizableVALIDATION_CLIENT_NULL_ACTION());
+@@ -176,12 +176,24 @@
+ 
+     /**
+      * Null message found when processing the server inbound request and WS-Addressing is required
+-     * 
++     *
+      */
+     public static String NULL_MESSAGE() {
+         return localizer.localize(localizableNULL_MESSAGE());
+     }
+ 
++    public static Localizable localizableACTION_NOT_SUPPORTED_EXCEPTION(Object arg0) {
++        return messageFactory.getMessage("action.not.supported.exception", arg0);
++    }
++
++    /**
++     * Action: "{0}" not supported
++     *
++     */
++    public static String ACTION_NOT_SUPPORTED_EXCEPTION(Object arg0) {
++        return localizer.localize(localizableACTION_NOT_SUPPORTED_EXCEPTION(arg0));
++    }
++
+     public static Localizable localizableNON_ANONYMOUS_RESPONSE_NULL_HEADERS(Object arg0) {
+         return messageFactory.getMessage("nonAnonymous.response.nullHeaders", arg0);
+     }
+@@ -188,7 +200,7 @@
+ 
+     /**
+      * No response headers found in non-anonymous response from "{0}"
+-     * 
++     *
+      */
+     public static String NON_ANONYMOUS_RESPONSE_NULL_HEADERS(Object arg0) {
+         return localizer.localize(localizableNON_ANONYMOUS_RESPONSE_NULL_HEADERS(arg0));
+@@ -200,7 +212,7 @@
+ 
+     /**
+      * Sending non-anonymous reply to "{0}"
+-     * 
++     *
+      */
+     public static String NON_ANONYMOUS_RESPONSE_SENDING(Object arg0) {
+         return localizer.localize(localizableNON_ANONYMOUS_RESPONSE_SENDING(arg0));
+@@ -212,12 +224,24 @@
+ 
+     /**
+      * ReplyTo header cannot be parsed
+-     * 
++     *
+      */
+     public static String REPLY_TO_CANNOT_PARSE() {
+         return localizer.localize(localizableREPLY_TO_CANNOT_PARSE());
+     }
+ 
++    public static Localizable localizableINVALID_ADDRESSING_HEADER_EXCEPTION(Object arg0, Object arg1) {
++        return messageFactory.getMessage("invalid.addressing.header.exception", arg0, arg1);
++    }
++
++    /**
++     * Invalid WS-Addressing header: "{0}",Reason: "{1}"
++     *
++     */
++    public static String INVALID_ADDRESSING_HEADER_EXCEPTION(Object arg0, Object arg1) {
++        return localizer.localize(localizableINVALID_ADDRESSING_HEADER_EXCEPTION(arg0, arg1));
++    }
++
+     public static Localizable localizableWSAW_ANONYMOUS_PROHIBITED() {
+         return messageFactory.getMessage("wsaw.anonymousProhibited");
+     }
+@@ -224,7 +248,7 @@
+ 
+     /**
+      * Operation has "prohibited" value for wsaw:anonymous in the WSDL, Addressing must be disabled and SOAP message need to be hand-crafted
+-     * 
++     *
+      */
+     public static String WSAW_ANONYMOUS_PROHIBITED() {
+         return localizer.localize(localizableWSAW_ANONYMOUS_PROHIBITED());
+@@ -236,12 +260,24 @@
+ 
+     /**
+      * Populating request Addressing headers and found null WSDLPort
+-     * 
++     *
+      */
+     public static String NULL_WSDL_PORT() {
+         return localizer.localize(localizableNULL_WSDL_PORT());
+     }
+ 
++    public static Localizable localizableADDRESSING_SHOULD_BE_ENABLED() {
++        return messageFactory.getMessage("addressing.should.be.enabled.");
++    }
++
++    /**
++     * Addressing is not enabled
++     *
++     */
++    public static String ADDRESSING_SHOULD_BE_ENABLED() {
++        return localizer.localize(localizableADDRESSING_SHOULD_BE_ENABLED());
++    }
++
+     public static Localizable localizableNULL_ADDRESSING_VERSION() {
+         return messageFactory.getMessage("null.addressing.version");
+     }
+@@ -248,12 +284,24 @@
+ 
+     /**
+      * Unexpected null Addressing version
+-     * 
++     *
+      */
+     public static String NULL_ADDRESSING_VERSION() {
+         return localizer.localize(localizableNULL_ADDRESSING_VERSION());
+     }
+ 
++    public static Localizable localizableMISSING_HEADER_EXCEPTION(Object arg0) {
++        return messageFactory.getMessage("missing.header.exception", arg0);
++    }
++
++    /**
++     * Missing WS-Addressing header: "{0}"
++     *
++     */
++    public static String MISSING_HEADER_EXCEPTION(Object arg0) {
++        return localizer.localize(localizableMISSING_HEADER_EXCEPTION(arg0));
++    }
++
+     public static Localizable localizableNULL_PACKET() {
+         return messageFactory.getMessage("null.packet");
+     }
+@@ -260,7 +308,7 @@
+ 
+     /**
+      * Populating request Addressing headers and found null Packet
+-     * 
++     *
+      */
+     public static String NULL_PACKET() {
+         return localizer.localize(localizableNULL_PACKET());
+@@ -272,7 +320,7 @@
+ 
+     /**
+      * Expected "{0}" version of WS-Addressing but found "{1}"
+-     * 
++     *
+      */
+     public static String WRONG_ADDRESSING_VERSION(Object arg0, Object arg1) {
+         return localizer.localize(localizableWRONG_ADDRESSING_VERSION(arg0, arg1));
+@@ -284,7 +332,7 @@
+ 
+     /**
+      * Addressing is not enabled, {0} should not be included in the pipeline"
+-     * 
++     *
+      */
+     public static String ADDRESSING_NOT_ENABLED(Object arg0) {
+         return localizer.localize(localizableADDRESSING_NOT_ENABLED(arg0));
+@@ -296,7 +344,7 @@
+ 
+     /**
+      * Unknown protocol: "{0}"
+-     * 
++     *
+      */
+     public static String NON_ANONYMOUS_UNKNOWN_PROTOCOL(Object arg0) {
+         return localizer.localize(localizableNON_ANONYMOUS_UNKNOWN_PROTOCOL(arg0));
+@@ -308,7 +356,7 @@
+ 
+     /**
+      * No message for non-anonymous response from "{0}"
+-     * 
++     *
+      */
+     public static String NON_ANONYMOUS_RESPONSE_NULL_MESSAGE(Object arg0) {
+         return localizer.localize(localizableNON_ANONYMOUS_RESPONSE_NULL_MESSAGE(arg0));
+@@ -320,7 +368,7 @@
+ 
+     /**
+      * No headers found when processing the server inbound request and WS-Addressing is required
+-     * 
++     *
+      */
+     public static String NULL_HEADERS() {
+         return localizer.localize(localizableNULL_HEADERS());
+@@ -332,7 +380,7 @@
+ 
+     /**
+      * Populating request Addressing headers and found null Binding
+-     * 
++     *
+      */
+     public static String NULL_BINDING() {
+         return localizer.localize(localizableNULL_BINDING());
+--- old/src/share/classes/com/sun/xml/internal/ws/resources/ClientMessages.java	Thu Jul 30 18:32:01 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/ClientMessages.java	Thu Jul 30 18:32:00 2009
+@@ -31,7 +31,7 @@
+ 
+ /**
+  * Defines string formatting method for each constant in the resource file
+- * 
++ *
+  */
+ public final class ClientMessages {
+ 
+@@ -43,9 +43,9 @@
+     }
+ 
+     /**
+-     * Failed to access the WSDL at: {0}. It failed with: 
+-     * 	{1}.
+-     * 
++     * Failed to access the WSDL at: {0}. It failed with:
++     *  {1}.
++     *
+      */
+     public static String FAILED_TO_PARSE(Object arg0, Object arg1) {
+         return localizer.localize(localizableFAILED_TO_PARSE(arg0, arg1));
+@@ -57,7 +57,7 @@
+ 
+     /**
+      * Invalid binding id: {0}. Must be: {1}
+-     * 
++     *
+      */
+     public static String INVALID_BINDING_ID(Object arg0, Object arg1) {
+         return localizer.localize(localizableINVALID_BINDING_ID(arg0, arg1));
+@@ -69,7 +69,7 @@
+ 
+     /**
+      * EPR is specified without enabling WS-Addressing support.
+-     * 
++     *
+      */
+     public static String EPR_WITHOUT_ADDRESSING_ON() {
+         return localizer.localize(localizableEPR_WITHOUT_ADDRESSING_ON());
+@@ -81,7 +81,7 @@
+ 
+     /**
+      * No wsdl metadata for service: {0}, can't create proxy! Try creating Service by providing a WSDL URL
+-     * 
++     *
+      */
+     public static String INVALID_SERVICE_NO_WSDL(Object arg0) {
+         return localizer.localize(localizableINVALID_SERVICE_NO_WSDL(arg0));
+@@ -93,7 +93,7 @@
+ 
+     /**
+      * Cannot set SOAP 1.2 role "none"
+-     * 
++     *
+      */
+     public static String INVALID_SOAP_ROLE_NONE() {
+         return localizer.localize(localizableINVALID_SOAP_ROLE_NONE());
+@@ -105,7 +105,7 @@
+ 
+     /**
+      * Undefined binding: {0}
+-     * 
++     *
+      */
+     public static String UNDEFINED_BINDING(Object arg0) {
+         return localizer.localize(localizableUNDEFINED_BINDING(arg0));
+@@ -117,7 +117,7 @@
+ 
+     /**
+      * HTTP Status-Code 404: Not Found - {0}
+-     * 
++     *
+      */
+     public static String HTTP_NOT_FOUND(Object arg0) {
+         return localizer.localize(localizableHTTP_NOT_FOUND(arg0));
+@@ -129,7 +129,7 @@
+ 
+     /**
+      * cannot connect to server: {0}
+-     * 
++     *
+      */
+     public static String HTTP_CLIENT_CANNOT_CONNECT(Object arg0) {
+         return localizer.localize(localizableHTTP_CLIENT_CANNOT_CONNECT(arg0));
+@@ -141,7 +141,7 @@
+ 
+     /**
+      * Endpoint Name specified in EPR {0}  is not a WSDL port QName, valid Ports are {1}
+-     * 
++     *
+      */
+     public static String INVALID_EPR_PORT_NAME(Object arg0, Object arg1) {
+         return localizer.localize(localizableINVALID_EPR_PORT_NAME(arg0, arg1));
+@@ -152,11 +152,11 @@
+     }
+ 
+     /**
+-     * Failed to access the WSDL at: {0}. It failed with: 
+-     * 	{1}.
+-     * Retrying with MEX gave: 
+-     * 	{2}
+-     * 
++     * Failed to access the WSDL at: {0}. It failed with:
++     *  {1}.
++     * Retrying with MEX gave:
++     *  {2}
++     *
+      */
+     public static String FAILED_TO_PARSE_WITH_MEX(Object arg0, Object arg1, Object arg2) {
+         return localizer.localize(localizableFAILED_TO_PARSE_WITH_MEX(arg0, arg1, arg2));
+@@ -168,7 +168,7 @@
+ 
+     /**
+      * The server sent HTTP status code {0}: {1}
+-     * 
++     *
+      */
+     public static String HTTP_STATUS_CODE(Object arg0, Object arg1) {
+         return localizer.localize(localizableHTTP_STATUS_CODE(arg0, arg1));
+@@ -180,7 +180,7 @@
+ 
+     /**
+      * Invalid address: {0}
+-     * 
++     *
+      */
+     public static String INVALID_ADDRESS(Object arg0) {
+         return localizer.localize(localizableINVALID_ADDRESS(arg0));
+@@ -192,12 +192,24 @@
+ 
+     /**
+      * Undefined port type: {0}
+-     * 
++     *
+      */
+     public static String UNDEFINED_PORT_TYPE(Object arg0) {
+         return localizer.localize(localizableUNDEFINED_PORT_TYPE(arg0));
+     }
+ 
++    public static Localizable localizableWSDL_CONTAINS_NO_SERVICE(Object arg0) {
++        return messageFactory.getMessage("wsdl.contains.no.service", arg0);
++    }
++
++    /**
++     * WSDL {0} contains no service definition.
++     *
++     */
++    public static String WSDL_CONTAINS_NO_SERVICE(Object arg0) {
++        return localizer.localize(localizableWSDL_CONTAINS_NO_SERVICE(arg0));
++    }
++
+     public static Localizable localizableINVALID_SOAP_ACTION() {
+         return messageFactory.getMessage("invalid.soap.action");
+     }
+@@ -204,7 +216,7 @@
+ 
+     /**
+      * A valid SOAPAction should be set in the RequestContext when Addressing is enabled, Use BindingProvider.SOAPACTION_URI_PROPERTY to set it.
+-     * 
++     *
+      */
+     public static String INVALID_SOAP_ACTION() {
+         return localizer.localize(localizableINVALID_SOAP_ACTION());
+@@ -216,7 +228,7 @@
+ 
+     /**
+      * Cannot set {0} on binding. Handler must be a LogicalHandler.
+-     * 
++     *
+      */
+     public static String NON_LOGICAL_HANDLER_SET(Object arg0) {
+         return localizer.localize(localizableNON_LOGICAL_HANDLER_SET(arg0));
+@@ -228,7 +240,7 @@
+ 
+     /**
+      * local transport error: {0}
+-     * 
++     *
+      */
+     public static String LOCAL_CLIENT_FAILED(Object arg0) {
+         return localizer.localize(localizableLOCAL_CLIENT_FAILED(arg0));
+@@ -240,7 +252,7 @@
+ 
+     /**
+      * Invalid WSDL {0}, expected {1} found {2} at (line{3})
+-     * 
++     *
+      */
+     public static String RUNTIME_WSDLPARSER_INVALID_WSDL(Object arg0, Object arg1, Object arg2, Object arg3) {
+         return localizer.localize(localizableRUNTIME_WSDLPARSER_INVALID_WSDL(arg0, arg1, arg2, arg3));
+@@ -252,7 +264,7 @@
+ 
+     /**
+      * WSDL url {0} is not accessible.
+-     * 
++     *
+      */
+     public static String WSDL_NOT_FOUND(Object arg0) {
+         return localizer.localize(localizableWSDL_NOT_FOUND(arg0));
+@@ -264,7 +276,7 @@
+ 
+     /**
+      * HTTP transport error: {0}
+-     * 
++     *
+      */
+     public static String HTTP_CLIENT_FAILED(Object arg0) {
+         return localizer.localize(localizableHTTP_CLIENT_FAILED(arg0));
+@@ -276,7 +288,7 @@
+ 
+     /**
+      * cannot create message factory
+-     * 
++     *
+      */
+     public static String HTTP_CLIENT_CANNOT_CREATE_MESSAGE_FACTORY() {
+         return localizer.localize(localizableHTTP_CLIENT_CANNOT_CREATE_MESSAGE_FACTORY());
+@@ -288,7 +300,7 @@
+ 
+     /**
+      * {0} is not a valid service
+-     * 
++     *
+      */
+     public static String INVALID_SERVICE_NAME_NULL(Object arg0) {
+         return localizer.localize(localizableINVALID_SERVICE_NAME_NULL(arg0));
+@@ -300,7 +312,7 @@
+ 
+     /**
+      * Invalid WSDL URL: {0}
+-     * 
++     *
+      */
+     public static String INVALID_WSDL_URL(Object arg0) {
+         return localizer.localize(localizableINVALID_WSDL_URL(arg0));
+@@ -312,7 +324,7 @@
+ 
+     /**
+      * request requires HTTP authentication: {0}
+-     * 
++     *
+      */
+     public static String HTTP_CLIENT_UNAUTHORIZED(Object arg0) {
+         return localizer.localize(localizableHTTP_CLIENT_UNAUTHORIZED(arg0));
+@@ -324,7 +336,7 @@
+ 
+     /**
+      * {0} is not a valid port. Valid ports are: {1}
+-     * 
++     *
+      */
+     public static String INVALID_PORT_NAME(Object arg0, Object arg1) {
+         return localizer.localize(localizableINVALID_PORT_NAME(arg0, arg1));
+@@ -336,7 +348,7 @@
+ 
+     /**
+      * {0} is not a valid service. Valid services are: {1}
+-     * 
++     *
+      */
+     public static String INVALID_SERVICE_NAME(Object arg0, Object arg1) {
+         return localizer.localize(localizableINVALID_SERVICE_NAME(arg0, arg1));
+@@ -348,7 +360,7 @@
+ 
+     /**
+      * {0} not supported with {1}. Must be: {2}
+-     * 
++     *
+      */
+     public static String UNSUPPORTED_OPERATION(Object arg0, Object arg1, Object arg2) {
+         return localizer.localize(localizableUNSUPPORTED_OPERATION(arg0, arg1, arg2));
+@@ -360,7 +372,7 @@
+ 
+     /**
+      * Failed to parse EPR: {0}
+-     * 
++     *
+      */
+     public static String FAILED_TO_PARSE_EPR(Object arg0) {
+         return localizer.localize(localizableFAILED_TO_PARSE_EPR(arg0));
+--- old/src/share/classes/com/sun/xml/internal/ws/resources/DispatchMessages.java	Thu Jul 30 18:32:04 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/DispatchMessages.java	Thu Jul 30 18:32:04 2009
+@@ -31,7 +31,7 @@
+ 
+ /**
+  * Defines string formatting method for each constant in the resource file
+- * 
++ *
+  */
+ public final class DispatchMessages {
+ 
+@@ -44,7 +44,7 @@
+ 
+     /**
+      * A XML/HTTP request using MessageContext.HTTP_REQUEST_METHOD equals {0} with a Null invocation Argument is not allowed. Must be: {1}
+-     * 
++     *
+      */
+     public static String INVALID_NULLARG_XMLHTTP_REQUEST_METHOD(Object arg0, Object arg1) {
+         return localizer.localize(localizableINVALID_NULLARG_XMLHTTP_REQUEST_METHOD(arg0, arg1));
+@@ -56,7 +56,7 @@
+ 
+     /**
+      * Can not create Dispatch<SOAPMessage> of {0}. Must be {1}.
+-     * 
++     *
+      */
+     public static String INVALID_SOAPMESSAGE_DISPATCH_MSGMODE(Object arg0, Object arg1) {
+         return localizer.localize(localizableINVALID_SOAPMESSAGE_DISPATCH_MSGMODE(arg0, arg1));
+@@ -68,7 +68,7 @@
+ 
+     /**
+      * Failed to deserialize the response.
+-     * 
++     *
+      */
+     public static String INVALID_RESPONSE_DESERIALIZATION() {
+         return localizer.localize(localizableINVALID_RESPONSE_DESERIALIZATION());
+@@ -80,7 +80,7 @@
+ 
+     /**
+      * Leading '?' of MessageContext.QUERY_STRING: {0} is not valid. Remove '?' and run again.
+-     * 
++     *
+      */
+     public static String INVALID_QUERY_LEADING_CHAR(Object arg0) {
+         return localizer.localize(localizableINVALID_QUERY_LEADING_CHAR(arg0));
+@@ -92,7 +92,7 @@
+ 
+     /**
+      * Unable to resolve endpoint address using the supplied query string: {0}.
+-     * 
++     *
+      */
+     public static String INVALID_QUERY_STRING(Object arg0) {
+         return localizer.localize(localizableINVALID_QUERY_STRING(arg0));
+@@ -104,7 +104,7 @@
+ 
+     /**
+      * WSDLPort {0} already exists. Can not create a port of the same QName.
+-     * 
++     *
+      */
+     public static String DUPLICATE_PORT(Object arg0) {
+         return localizer.localize(localizableDUPLICATE_PORT(arg0));
+@@ -116,7 +116,7 @@
+ 
+     /**
+      * Can not create Dispatch<DataSource> with {0}. Must be: {1}
+-     * 
++     *
+      */
+     public static String INVALID_DATASOURCE_DISPATCH_BINDING(Object arg0, Object arg1) {
+         return localizer.localize(localizableINVALID_DATASOURCE_DISPATCH_BINDING(arg0, arg1));
+@@ -128,7 +128,7 @@
+ 
+     /**
+      * Can not create Dispatch<DataSource> of Service.Mode.PAYLOAD{0}. Must be: {1}
+-     * 
++     *
+      */
+     public static String INVALID_DATASOURCE_DISPATCH_MSGMODE(Object arg0, Object arg1) {
+         return localizer.localize(localizableINVALID_DATASOURCE_DISPATCH_MSGMODE(arg0, arg1));
+@@ -140,7 +140,7 @@
+ 
+     /**
+      * SOAP/HTTP Binding in {0} is not allowed with a null invocation argument. Must be: {1}
+-     * 
++     *
+      */
+     public static String INVALID_NULLARG_SOAP_MSGMODE(Object arg0, Object arg1) {
+         return localizer.localize(localizableINVALID_NULLARG_SOAP_MSGMODE(arg0, arg1));
+@@ -152,7 +152,7 @@
+ 
+     /**
+      * Endpoint String: {0} is and invalid URI.
+-     * 
++     *
+      */
+     public static String INVALID_URI(Object arg0) {
+         return localizer.localize(localizableINVALID_URI(arg0));
+@@ -164,7 +164,7 @@
+ 
+     /**
+      * Can not create Dispatch<SOAPMessage> with {0} Binding. Must be: {1} Binding.
+-     * 
++     *
+      */
+     public static String INVALID_SOAPMESSAGE_DISPATCH_BINDING(Object arg0, Object arg1) {
+         return localizer.localize(localizableINVALID_SOAPMESSAGE_DISPATCH_BINDING(arg0, arg1));
+@@ -176,7 +176,7 @@
+ 
+     /**
+      * Unable to construct a URI with this path info {0} and this query string {1}.
+-     * 
++     *
+      */
+     public static String INVALID_URI_PATH_QUERY(Object arg0, Object arg1) {
+         return localizer.localize(localizableINVALID_URI_PATH_QUERY(arg0, arg1));
+@@ -188,7 +188,7 @@
+ 
+     /**
+      * No response returned.
+-     * 
++     *
+      */
+     public static String INVALID_RESPONSE() {
+         return localizer.localize(localizableINVALID_RESPONSE());
+@@ -200,7 +200,7 @@
+ 
+     /**
+      * Unable to resolve endpoint address using the supplied path: {0}.
+-     * 
++     *
+      */
+     public static String INVALID_URI_RESOLUTION(Object arg0) {
+         return localizer.localize(localizableINVALID_URI_RESOLUTION(arg0));
+@@ -212,7 +212,7 @@
+ 
+     /**
+      * Unable to decode the resolved endpoint using UTF-8 encoding.
+-     * 
++     *
+      */
+     public static String INVALID_URI_DECODE() {
+         return localizer.localize(localizableINVALID_URI_DECODE());
+--- old/src/share/classes/com/sun/xml/internal/ws/resources/EncodingMessages.java	Thu Jul 30 18:32:08 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/EncodingMessages.java	Thu Jul 30 18:32:07 2009
+@@ -31,7 +31,7 @@
+ 
+ /**
+  * Defines string formatting method for each constant in the resource file
+- * 
++ *
+  */
+ public final class EncodingMessages {
+ 
+@@ -44,7 +44,7 @@
+ 
+     /**
+      * Failed to read a response: {0}
+-     * 
++     *
+      */
+     public static String FAILED_TO_READ_RESPONSE(Object arg0) {
+         return localizer.localize(localizableFAILED_TO_READ_RESPONSE(arg0));
+@@ -56,7 +56,7 @@
+ 
+     /**
+      * incorrect type. Expected java.lang.Exception, found {0}
+-     * 
++     *
+      */
+     public static String EXCEPTION_INCORRECT_TYPE(Object arg0) {
+         return localizer.localize(localizableEXCEPTION_INCORRECT_TYPE(arg0));
+@@ -68,7 +68,7 @@
+ 
+     /**
+      * exception class: {0} not found in the model!
+-     * 
++     *
+      */
+     public static String EXCEPTION_NOTFOUND(Object arg0) {
+         return localizer.localize(localizableEXCEPTION_NOTFOUND(arg0));
+@@ -80,7 +80,7 @@
+ 
+     /**
+      * unexpected element name: expected={0}, actual: {1}
+-     * 
++     *
+      */
+     public static String XSD_UNEXPECTED_ELEMENT_NAME(Object arg0, Object arg1) {
+         return localizer.localize(localizableXSD_UNEXPECTED_ELEMENT_NAME(arg0, arg1));
+@@ -92,7 +92,7 @@
+ 
+     /**
+      * deserialization error: {0}
+-     * 
++     *
+      */
+     public static String NESTED_DESERIALIZATION_ERROR(Object arg0) {
+         return localizer.localize(localizableNESTED_DESERIALIZATION_ERROR(arg0));
+@@ -104,7 +104,7 @@
+ 
+     /**
+      * unknown prefix "{0}"
+-     * 
++     *
+      */
+     public static String XSD_UNKNOWN_PREFIX(Object arg0) {
+         return localizer.localize(localizableXSD_UNKNOWN_PREFIX(arg0));
+@@ -116,7 +116,7 @@
+ 
+     /**
+      * encoding error: {0}
+-     * 
++     *
+      */
+     public static String NESTED_ENCODING_ERROR(Object arg0) {
+         return localizer.localize(localizableNESTED_ENCODING_ERROR(arg0));
+@@ -128,7 +128,7 @@
+ 
+     /**
+      * don't know how to write object: {0}
+-     * 
++     *
+      */
+     public static String UNKNOWN_OBJECT() {
+         return localizer.localize(localizableUNKNOWN_OBJECT());
+@@ -140,7 +140,7 @@
+ 
+     /**
+      * can't write object! unexpected type: {0}
+-     * 
++     *
+      */
+     public static String INCORRECT_MESSAGEINFO() {
+         return localizer.localize(localizableINCORRECT_MESSAGEINFO());
+@@ -152,7 +152,7 @@
+ 
+     /**
+      * serialization error: {0}
+-     * 
++     *
+      */
+     public static String NESTED_SERIALIZATION_ERROR(Object arg0) {
+         return localizer.localize(localizableNESTED_SERIALIZATION_ERROR(arg0));
+@@ -164,7 +164,7 @@
+ 
+     /**
+      * There''s no attachment for the content ID "{0}"
+-     * 
++     *
+      */
+     public static String NO_SUCH_CONTENT_ID(Object arg0) {
+         return localizer.localize(localizableNO_SUCH_CONTENT_ID(arg0));
+--- old/src/share/classes/com/sun/xml/internal/ws/resources/HandlerMessages.java	Thu Jul 30 18:32:11 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/HandlerMessages.java	Thu Jul 30 18:32:10 2009
+@@ -31,7 +31,7 @@
+ 
+ /**
+  * Defines string formatting method for each constant in the resource file
+- * 
++ *
+  */
+ public final class HandlerMessages {
+ 
+@@ -44,7 +44,7 @@
+ 
+     /**
+      * "{0}" is not an allowed value for the property "{1}"
+-     * 
++     *
+      */
+     public static String HANDLER_MESSAGE_CONTEXT_INVALID_CLASS(Object arg0, Object arg1) {
+         return localizer.localize(localizableHANDLER_MESSAGE_CONTEXT_INVALID_CLASS(arg0, arg1));
+@@ -56,7 +56,7 @@
+ 
+     /**
+      * Handler {0} must implement LogicalHandler or SOAPHandler.
+-     * 
++     *
+      */
+     public static String CANNOT_EXTEND_HANDLER_DIRECTLY(Object arg0) {
+         return localizer.localize(localizableCANNOT_EXTEND_HANDLER_DIRECTLY(arg0));
+@@ -68,7 +68,7 @@
+ 
+     /**
+      * {0} does not implement one of the handler interfaces.
+-     * 
++     *
+      */
+     public static String HANDLER_NOT_VALID_TYPE(Object arg0) {
+         return localizer.localize(localizableHANDLER_NOT_VALID_TYPE(arg0));
+@@ -80,7 +80,7 @@
+ 
+     /**
+      * Unable to instantiate handler: {0} because: {1}
+-     * 
++     *
+      */
+     public static String CANNOT_INSTANTIATE_HANDLER(Object arg0, Object arg1) {
+         return localizer.localize(localizableCANNOT_INSTANTIATE_HANDLER(arg0, arg1));
+@@ -92,7 +92,7 @@
+ 
+     /**
+      * A HandlerChain can only contain Handler instances: {0}
+-     * 
++     *
+      */
+     public static String HANDLER_CHAIN_CONTAINS_HANDLER_ONLY(Object arg0) {
+         return localizer.localize(localizableHANDLER_CHAIN_CONTAINS_HANDLER_ONLY(arg0));
+@@ -104,7 +104,7 @@
+ 
+     /**
+      * handler error: {0}
+-     * 
++     *
+      */
+     public static String HANDLER_NESTED_ERROR(Object arg0) {
+         return localizer.localize(localizableHANDLER_NESTED_ERROR(arg0));
+@@ -116,7 +116,7 @@
+ 
+     /**
+      * Exception ignored from invoking handler @PreDestroy method: {0}
+-     * 
++     *
+      */
+     public static String HANDLER_PREDESTROY_IGNORE(Object arg0) {
+         return localizer.localize(localizableHANDLER_PREDESTROY_IGNORE(arg0));
+--- old/src/share/classes/com/sun/xml/internal/ws/resources/HttpserverMessages.java	Thu Jul 30 18:32:15 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/HttpserverMessages.java	Thu Jul 30 18:32:14 2009
+@@ -31,7 +31,7 @@
+ 
+ /**
+  * Defines string formatting method for each constant in the resource file
+- * 
++ *
+  */
+ public final class HttpserverMessages {
+ 
+@@ -44,7 +44,7 @@
+ 
+     /**
+      * Cannot handle HTTP method: {0}
+-     * 
++     *
+      */
+     public static String UNEXPECTED_HTTP_METHOD(Object arg0) {
+         return localizer.localize(localizableUNEXPECTED_HTTP_METHOD(arg0));
+--- old/src/share/classes/com/sun/xml/internal/ws/resources/ModelerMessages.java	Thu Jul 30 18:32:18 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/ModelerMessages.java	Thu Jul 30 18:32:17 2009
+@@ -31,7 +31,7 @@
+ 
+ /**
+  * Defines string formatting method for each constant in the resource file
+- * 
++ *
+  */
+ public final class ModelerMessages {
+ 
+@@ -44,7 +44,7 @@
+ 
+     /**
+      * runtime modeler error: {0}
+-     * 
++     *
+      */
+     public static String NESTED_MODELER_ERROR(Object arg0) {
+         return localizer.localize(localizableNESTED_MODELER_ERROR(arg0));
+@@ -56,7 +56,7 @@
+ 
+     /**
+      * Annotation {0} is not recognizable, atleast one constructor of {1} should be marked with @FeatureConstructor
+-     * 
++     *
+      */
+     public static String RUNTIME_MODELER_WSFEATURE_NO_FTRCONSTRUCTOR(Object arg0, Object arg1) {
+         return localizer.localize(localizableRUNTIME_MODELER_WSFEATURE_NO_FTRCONSTRUCTOR(arg0, arg1));
+@@ -68,7 +68,7 @@
+ 
+     /**
+      * @WebMethod is not allowed on a non-public method {0}
+-     * 
++     *
+      */
+     public static String RUNTIME_MODELER_WEBMETHOD_MUST_BE_PUBLIC(Object arg0) {
+         return localizer.localize(localizableRUNTIME_MODELER_WEBMETHOD_MUST_BE_PUBLIC(arg0));
+@@ -80,7 +80,7 @@
+ 
+     /**
+      * Wrapper class {0} is not found. Have you run APT to generate them?
+-     * 
++     *
+      */
+     public static String RUNTIME_MODELER_WRAPPER_NOT_FOUND(Object arg0) {
+         return localizer.localize(localizableRUNTIME_MODELER_WRAPPER_NOT_FOUND(arg0));
+@@ -92,7 +92,7 @@
+ 
+     /**
+      * Error in  @BindingType: MTOM Configuration in binding identifier {0} conflicts with feature @MTOM {1}
+-     * 
++     *
+      */
+     public static String RUNTIME_MODELER_MTOM_CONFLICT(Object arg0, Object arg1) {
+         return localizer.localize(localizableRUNTIME_MODELER_MTOM_CONFLICT(arg0, arg1));
+@@ -103,8 +103,8 @@
+     }
+ 
+     /**
+-     * Feature {0} in implementation conflicts with {1} in WSDL configuration 
+-     * 
++     * Feature {0} in implementation conflicts with {1} in WSDL configuration
++     *
+      */
+     public static String RUNTIME_MODELER_FEATURE_CONFLICT(Object arg0, Object arg1) {
+         return localizer.localize(localizableRUNTIME_MODELER_FEATURE_CONFLICT(arg0, arg1));
+@@ -116,7 +116,7 @@
+ 
+     /**
+      * Annotation {0} is illegal, Only one constructor of {1} can be marked as @FeatureConstructor
+-     * 
++     *
+      */
+     public static String RUNTIME_MODELER_WSFEATURE_MORETHANONE_FTRCONSTRUCTOR(Object arg0, Object arg1) {
+         return localizer.localize(localizableRUNTIME_MODELER_WSFEATURE_MORETHANONE_FTRCONSTRUCTOR(arg0, arg1));
+@@ -128,7 +128,7 @@
+ 
+     /**
+      * SEI {0} has method {1} annotated as BARE but it has more than one parameter bound to body. This is invalid. Please annotate the method with annotation: @SOAPBinding(parameterStyle=SOAPBinding.ParameterStyle.WRAPPED)
+-     * 
++     *
+      */
+     public static String NOT_A_VALID_BARE_METHOD(Object arg0, Object arg1) {
+         return localizer.localize(localizableNOT_A_VALID_BARE_METHOD(arg0, arg1));
+@@ -140,7 +140,7 @@
+ 
+     /**
+      * A @WebService.targetNamespace must be specified on classes with no package.  Class: {0}
+-     * 
++     *
+      */
+     public static String RUNTIME_MODELER_NO_PACKAGE(Object arg0) {
+         return localizer.localize(localizableRUNTIME_MODELER_NO_PACKAGE(arg0));
+@@ -152,7 +152,7 @@
+ 
+     /**
+      * A WebService annotation is not present on class: {0}
+-     * 
++     *
+      */
+     public static String RUNTIME_MODELER_NO_WEBSERVICE_ANNOTATION(Object arg0) {
+         return localizer.localize(localizableRUNTIME_MODELER_NO_WEBSERVICE_ANNOTATION(arg0));
+@@ -164,7 +164,7 @@
+ 
+     /**
+      * oneway operation should not have out parameters class: {0} method: {1}
+-     * 
++     *
+      */
+     public static String RUNTIME_MODELER_ONEWAY_OPERATION_NO_OUT_PARAMETERS(Object arg0, Object arg1) {
+         return localizer.localize(localizableRUNTIME_MODELER_ONEWAY_OPERATION_NO_OUT_PARAMETERS(arg0, arg1));
+@@ -175,8 +175,8 @@
+     }
+ 
+     /**
+-     * Unable to create JAXBContext due to the security restriction
+-     * 
++     * Unable to create JAXBContext
++     *
+      */
+     public static String UNABLE_TO_CREATE_JAXB_CONTEXT() {
+         return localizer.localize(localizableUNABLE_TO_CREATE_JAXB_CONTEXT());
+@@ -188,7 +188,7 @@
+ 
+     /**
+      * The web service defined by the class {0} does not contain any valid WebMethods.
+-     * 
++     *
+      */
+     public static String RUNTIME_MODELER_NO_OPERATIONS(Object arg0) {
+         return localizer.localize(localizableRUNTIME_MODELER_NO_OPERATIONS(arg0));
+@@ -199,8 +199,8 @@
+     }
+ 
+     /**
+-     * @WebMethod is not allowed on a static method {0}  
+-     * 
++     * @WebMethod is not allowed on a static method {0}
++     *
+      */
+     public static String RUNTIME_MODELER_WEBMETHOD_MUST_BE_NONSTATIC(Object arg0) {
+         return localizer.localize(localizableRUNTIME_MODELER_WEBMETHOD_MUST_BE_NONSTATIC(arg0));
+@@ -212,7 +212,7 @@
+ 
+     /**
+      * method: {0} could not be found on class: {1}
+-     * 
++     *
+      */
+     public static String RUNTIME_MODELER_METHOD_NOT_FOUND(Object arg0, Object arg1) {
+         return localizer.localize(localizableRUNTIME_MODELER_METHOD_NOT_FOUND(arg0, arg1));
+@@ -224,7 +224,7 @@
+ 
+     /**
+      * class: {0} could not be found
+-     * 
++     *
+      */
+     public static String RUNTIME_MODELER_CLASS_NOT_FOUND(Object arg0) {
+         return localizer.localize(localizableRUNTIME_MODELER_CLASS_NOT_FOUND(arg0));
+@@ -236,7 +236,7 @@
+ 
+     /**
+      * The serviceName cannot be retrieved from an interface.  class {0}
+-     * 
++     *
+      */
+     public static String RUNTIME_MODELER_CANNOT_GET_SERVICE_NAME_FROM_INTERFACE(Object arg0) {
+         return localizer.localize(localizableRUNTIME_MODELER_CANNOT_GET_SERVICE_NAME_FROM_INTERFACE(arg0));
+@@ -248,7 +248,7 @@
+ 
+     /**
+      * The Endpoint Interface: {0} does not have WebService Annotation
+-     * 
++     *
+      */
+     public static String RUNTIME_MODELER_ENDPOINT_INTERFACE_NO_WEBSERVICE(Object arg0) {
+         return localizer.localize(localizableRUNTIME_MODELER_ENDPOINT_INTERFACE_NO_WEBSERVICE(arg0));
+@@ -260,7 +260,7 @@
+ 
+     /**
+      * The namespace of the serviceName "{0}" and the namespace of the portName "{1}" must match
+-     * 
++     *
+      */
+     public static String RUNTIME_MODELER_PORTNAME_SERVICENAME_NAMESPACE_MISMATCH(Object arg0, Object arg1) {
+         return localizer.localize(localizableRUNTIME_MODELER_PORTNAME_SERVICENAME_NAMESPACE_MISMATCH(arg0, arg1));
+@@ -272,10 +272,22 @@
+ 
+     /**
+      * Annotation {0} is illegal, In {1} @FeatureConstructor value does n't match the constructor parameters
+-     * 
++     *
+      */
+     public static String RUNTIME_MODELER_WSFEATURE_ILLEGAL_FTRCONSTRUCTOR(Object arg0, Object arg1) {
+         return localizer.localize(localizableRUNTIME_MODELER_WSFEATURE_ILLEGAL_FTRCONSTRUCTOR(arg0, arg1));
+     }
+ 
++    public static Localizable localizableRUNTIME_MODELER_WEBMETHOD_MUST_BE_NONSTATICFINAL(Object arg0) {
++        return messageFactory.getMessage("runtime.modeler.webmethod.must.be.nonstaticfinal", arg0);
++    }
++
++    /**
++     * @WebMethod is not allowed on a static or final method {0}
++     *
++     */
++    public static String RUNTIME_MODELER_WEBMETHOD_MUST_BE_NONSTATICFINAL(Object arg0) {
++        return localizer.localize(localizableRUNTIME_MODELER_WEBMETHOD_MUST_BE_NONSTATICFINAL(arg0));
++    }
++
+ }
+--- old/src/share/classes/com/sun/xml/internal/ws/resources/ProviderApiMessages.java	Thu Jul 30 18:32:22 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/ProviderApiMessages.java	Thu Jul 30 18:32:21 2009
+@@ -31,7 +31,7 @@
+ 
+ /**
+  * Defines string formatting method for each constant in the resource file
+- * 
++ *
+  */
+ public final class ProviderApiMessages {
+ 
+@@ -44,12 +44,24 @@
+ 
+     /**
+      * Address in an EPR cannot be null, when serviceName or portName is null
+-     * 
++     *
+      */
+     public static String NULL_ADDRESS_SERVICE_ENDPOINT() {
+         return localizer.localize(localizableNULL_ADDRESS_SERVICE_ENDPOINT());
+     }
+ 
++    public static Localizable localizableNO_WSDL_NO_PORT(Object arg0) {
++        return messageFactory.getMessage("no.wsdl.no.port", arg0);
++    }
++
++    /**
++     * WSDL Metadata not available to create the proxy, either Service instance or ServiceEndpointInterface {0} should have WSDL information
++     *
++     */
++    public static String NO_WSDL_NO_PORT(Object arg0) {
++        return localizer.localize(localizableNO_WSDL_NO_PORT(arg0));
++    }
++
+     public static Localizable localizableNULL_SERVICE() {
+         return messageFactory.getMessage("null.service");
+     }
+@@ -56,7 +68,7 @@
+ 
+     /**
+      * serviceName can't be null when portName is specified
+-     * 
++     *
+      */
+     public static String NULL_SERVICE() {
+         return localizer.localize(localizableNULL_SERVICE());
+@@ -68,7 +80,7 @@
+ 
+     /**
+      * Address in an EPR cannot be null
+-     * 
++     *
+      */
+     public static String NULL_ADDRESS() {
+         return localizer.localize(localizableNULL_ADDRESS());
+@@ -80,7 +92,7 @@
+ 
+     /**
+      * EPR does n't have EndpointName in the Metadata
+-     * 
++     *
+      */
+     public static String NULL_PORTNAME() {
+         return localizer.localize(localizableNULL_PORTNAME());
+@@ -92,7 +104,7 @@
+ 
+     /**
+      * Service: {0} not found in WSDL: {1}
+-     * 
++     *
+      */
+     public static String NOTFOUND_SERVICE_IN_WSDL(Object arg0, Object arg1) {
+         return localizer.localize(localizableNOTFOUND_SERVICE_IN_WSDL(arg0, arg1));
+@@ -104,7 +116,7 @@
+ 
+     /**
+      * EndpointReference is null
+-     * 
++     *
+      */
+     public static String NULL_EPR() {
+         return localizer.localize(localizableNULL_EPR());
+@@ -116,7 +128,7 @@
+ 
+     /**
+      * EPR does n't have WSDL Metadata which is needed for the current operation
+-     * 
++     *
+      */
+     public static String NULL_WSDL() {
+         return localizer.localize(localizableNULL_WSDL());
+@@ -128,7 +140,7 @@
+ 
+     /**
+      * Port: {0} not a valid port in Service: {1} in WSDL: {2}
+-     * 
++     *
+      */
+     public static String NOTFOUND_PORT_IN_WSDL(Object arg0, Object arg1, Object arg2) {
+         return localizer.localize(localizableNOTFOUND_PORT_IN_WSDL(arg0, arg1, arg2));
+@@ -140,7 +152,7 @@
+ 
+     /**
+      * Error in parsing WSDL: {0}
+-     * 
++     *
+      */
+     public static String ERROR_WSDL(Object arg0) {
+         return localizer.localize(localizableERROR_WSDL(arg0));
+--- old/src/share/classes/com/sun/xml/internal/ws/resources/SenderMessages.java	Thu Jul 30 18:32:25 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/SenderMessages.java	Thu Jul 30 18:32:25 2009
+@@ -31,7 +31,7 @@
+ 
+ /**
+  * Defines string formatting method for each constant in the resource file
+- * 
++ *
+  */
+ public final class SenderMessages {
+ 
+@@ -44,7 +44,7 @@
+ 
+     /**
+      * illegal value for content negotiation property "{0}"
+-     * 
++     *
+      */
+     public static String SENDER_REQUEST_ILLEGAL_VALUE_FOR_CONTENT_NEGOTIATION(Object arg0) {
+         return localizer.localize(localizableSENDER_REQUEST_ILLEGAL_VALUE_FOR_CONTENT_NEGOTIATION(arg0));
+@@ -56,7 +56,7 @@
+ 
+     /**
+      * fault detail cannot be decoded
+-     * 
++     *
+      */
+     public static String SENDER_RESPONSE_CANNOT_DECODE_FAULT_DETAIL() {
+         return localizer.localize(localizableSENDER_RESPONSE_CANNOT_DECODE_FAULT_DETAIL());
+@@ -68,7 +68,7 @@
+ 
+     /**
+      * sender error: {0}
+-     * 
++     *
+      */
+     public static String SENDER_NESTED_ERROR(Object arg0) {
+         return localizer.localize(localizableSENDER_NESTED_ERROR(arg0));
+@@ -80,7 +80,7 @@
+ 
+     /**
+      * message not ready to be sent
+-     * 
++     *
+      */
+     public static String SENDER_REQUEST_MESSAGE_NOT_READY() {
+         return localizer.localize(localizableSENDER_REQUEST_MESSAGE_NOT_READY());
+--- old/src/share/classes/com/sun/xml/internal/ws/resources/ServerMessages.java	Thu Jul 30 18:32:29 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/ServerMessages.java	Thu Jul 30 18:32:28 2009
+@@ -31,7 +31,7 @@
+ 
+ /**
+  * Defines string formatting method for each constant in the resource file
+- * 
++ *
+  */
+ public final class ServerMessages {
+ 
+@@ -38,6 +38,27 @@
+     private final static LocalizableMessageFactory messageFactory = new LocalizableMessageFactory("com.sun.xml.internal.ws.resources.server");
+     private final static Localizer localizer = new Localizer();
+ 
++    public static Localizable localizableRUNTIME_PARSER_WSDL_INCORRECTSERVICE(Object arg0, Object arg1) {
++        return messageFactory.getMessage("runtime.parser.wsdl.incorrectservice", arg0, arg1);
++    }
++
++    /**
++     * could not get binding from WSDL! service: {0} not found in the WSDL {1}.
++     * It could be because service name does not match WSDL''s wsdl:service name:
++     *  1. service name is not there in deployment descriptor OR
++     *  2. Either there is a typo in deployment descriptor''s service name OR
++     *  3. The computed names from @WebService do not match wsdl:service name
++     * OR
++     *  1. There is an error while parsing the wsdl and Service with name {0} is not found in the WSDLModel.
++     * Suggest doing the following:
++     *  1. Add/Correct entries for service name in deployment descriptor OR
++     *  2. Specify targetNamespace, serviceName in @WebService on the endpoint class
++     *
++     */
++    public static String RUNTIME_PARSER_WSDL_INCORRECTSERVICE(Object arg0, Object arg1) {
++        return localizer.localize(localizableRUNTIME_PARSER_WSDL_INCORRECTSERVICE(arg0, arg1));
++    }
++
+     public static Localizable localizableRUNTIME_PARSER_MISSING_ATTRIBUTE_NO_LINE() {
+         return messageFactory.getMessage("runtime.parser.missing.attribute.no.line");
+     }
+@@ -44,7 +65,7 @@
+ 
+     /**
+      * missing attribute "{2}" in element "{1}" of runtime descriptor
+-     * 
++     *
+      */
+     public static String RUNTIME_PARSER_MISSING_ATTRIBUTE_NO_LINE() {
+         return localizer.localize(localizableRUNTIME_PARSER_MISSING_ATTRIBUTE_NO_LINE());
+@@ -56,7 +77,7 @@
+ 
+     /**
+      * Invalid/expired {0} header value: {1}
+-     * 
++     *
+      */
+     public static String STATEFUL_COOKIE_HEADER_INCORRECT(Object arg0, Object arg1) {
+         return localizer.localize(localizableSTATEFUL_COOKIE_HEADER_INCORRECT(arg0, arg1));
+@@ -68,7 +89,7 @@
+ 
+     /**
+      * "{0}" doesn't implement Provider
+-     * 
++     *
+      */
+     public static String NOT_IMPLEMENT_PROVIDER(Object arg0) {
+         return localizer.localize(localizableNOT_IMPLEMENT_PROVIDER(arg0));
+@@ -80,7 +101,7 @@
+ 
+     /**
+      * Stateful web service {0} requires the WS-Addressing support to be enabled. Perhaps you are missing @Addressing
+-     * 
++     *
+      */
+     public static String STATEFUL_REQURES_ADDRESSING(Object arg0) {
+         return localizer.localize(localizableSTATEFUL_REQURES_ADDRESSING(arg0));
+@@ -92,7 +113,7 @@
+ 
+     /**
+      * Error in decoding SOAP Message
+-     * 
++     *
+      */
+     public static String SOAPDECODER_ERR() {
+         return localizer.localize(localizableSOAPDECODER_ERR());
+@@ -104,7 +125,7 @@
+ 
+     /**
+      * error parsing runtime descriptor: {0}
+-     * 
++     *
+      */
+     public static String RUNTIME_PARSER_INVALID_READER_STATE(Object arg0) {
+         return localizer.localize(localizableRUNTIME_PARSER_INVALID_READER_STATE(arg0));
+@@ -116,22 +137,22 @@
+ 
+     /**
+      * Generating non-standard WSDL for the specified binding
+-     * 
++     *
+      */
+     public static String GENERATE_NON_STANDARD_WSDL() {
+         return localizer.localize(localizableGENERATE_NON_STANDARD_WSDL());
+     }
+ 
+-    public static Localizable localizableDISPATCH_CANNOT_FIND_METHOD(Object arg0, Object arg1) {
+-        return messageFactory.getMessage("dispatch.cannotFindMethod", arg0, arg1);
++    public static Localizable localizableDISPATCH_CANNOT_FIND_METHOD(Object arg0) {
++        return messageFactory.getMessage("dispatch.cannotFindMethod", arg0);
+     }
+ 
+     /**
+-     * Cannot find dispatch method for {0} using "{1}"
+-     * 
++     * Cannot find dispatch method for {0}
++     *
+      */
+-    public static String DISPATCH_CANNOT_FIND_METHOD(Object arg0, Object arg1) {
+-        return localizer.localize(localizableDISPATCH_CANNOT_FIND_METHOD(arg0, arg1));
++    public static String DISPATCH_CANNOT_FIND_METHOD(Object arg0) {
++        return localizer.localize(localizableDISPATCH_CANNOT_FIND_METHOD(arg0));
+     }
+ 
+     public static Localizable localizableNO_CONTENT_TYPE() {
+@@ -140,7 +161,7 @@
+ 
+     /**
+      * Request doesn't have a Content-Type
+-     * 
++     *
+      */
+     public static String NO_CONTENT_TYPE() {
+         return localizer.localize(localizableNO_CONTENT_TYPE());
+@@ -152,7 +173,7 @@
+ 
+     /**
+      * unsupported runtime descriptor version: {2}
+-     * 
++     *
+      */
+     public static String RUNTIME_PARSER_INVALID_VERSION_NUMBER() {
+         return localizer.localize(localizableRUNTIME_PARSER_INVALID_VERSION_NUMBER());
+@@ -164,7 +185,7 @@
+ 
+     /**
+      * "{0}" implements Provider but its type parameter {1} is incorrect
+-     * 
++     *
+      */
+     public static String PROVIDER_INVALID_PARAMETER_TYPE(Object arg0, Object arg1) {
+         return localizer.localize(localizablePROVIDER_INVALID_PARAMETER_TYPE(arg0, arg1));
+@@ -176,7 +197,7 @@
+ 
+     /**
+      * Incorrect no of arguments for method "{0}"
+-     * 
++     *
+      */
+     public static String WRONG_NO_PARAMETERS(Object arg0) {
+         return localizer.localize(localizableWRONG_NO_PARAMETERS(arg0));
+@@ -188,7 +209,7 @@
+ 
+     /**
+      * Only one method should have the annotation "{0}"
+-     * 
++     *
+      */
+     public static String ANNOTATION_ONLY_ONCE(Object arg0) {
+         return localizer.localize(localizableANNOTATION_ONLY_ONCE(arg0));
+@@ -200,7 +221,7 @@
+ 
+     /**
+      * There is already a HTTPS server at : {0}
+-     * 
++     *
+      */
+     public static String ALREADY_HTTPS_SERVER(Object arg0) {
+         return localizer.localize(localizableALREADY_HTTPS_SERVER(arg0));
+@@ -212,7 +233,7 @@
+ 
+     /**
+      * error parsing runtime descriptor: {0}
+-     * 
++     *
+      */
+     public static String RUNTIME_PARSER_XML_READER(Object arg0) {
+         return localizer.localize(localizableRUNTIME_PARSER_XML_READER(arg0));
+@@ -229,9 +250,9 @@
+      *  2. Either there is a typo in deployment descriptor''s service and port names OR
+      *  3. The computed names from @WebService do not match wsdl:service and wsdl:port names
+      * Suggest doing the following:
+-     *  1. Add/Correct entries for service and port names in deployment descriptor OR 
++     *  1. Add/Correct entries for service and port names in deployment descriptor OR
+      *  2. Specify targetNamespace, serviceName, portName in @WebService on the endpoint class
+-     * 
++     *
+      */
+     public static String RUNTIME_PARSER_WSDL_INCORRECTSERVICEPORT(Object arg0, Object arg1, Object arg2) {
+         return localizer.localize(localizableRUNTIME_PARSER_WSDL_INCORRECTSERVICEPORT(arg0, arg1, arg2));
+@@ -243,7 +264,7 @@
+ 
+     /**
+      * Server Runtime Error: {0}
+-     * 
++     *
+      */
+     public static String SERVER_RT_ERR(Object arg0) {
+         return localizer.localize(localizableSERVER_RT_ERR(arg0));
+@@ -255,7 +276,7 @@
+ 
+     /**
+      * invalid value for attribute "{2}" of element "{1}" in runtime descriptor (line {0})
+-     * 
++     *
+      */
+     public static String RUNTIME_PARSER_INVALID_ATTRIBUTE_VALUE(Object arg0, Object arg1, Object arg2) {
+         return localizer.localize(localizableRUNTIME_PARSER_INVALID_ATTRIBUTE_VALUE(arg0, arg1, arg2));
+@@ -267,7 +288,7 @@
+ 
+     /**
+      * This thread is not currently processing any web service request.
+-     * 
++     *
+      */
+     public static String NO_CURRENT_PACKET() {
+         return localizer.localize(localizableNO_CURRENT_PACKET());
+@@ -279,7 +300,7 @@
+ 
+     /**
+      * unexpected content in runtime descriptor (line {0})
+-     * 
++     *
+      */
+     public static String RUNTIME_PARSER_UNEXPECTED_CONTENT(Object arg0) {
+         return localizer.localize(localizableRUNTIME_PARSER_UNEXPECTED_CONTENT(arg0));
+@@ -291,7 +312,7 @@
+ 
+     /**
+      * This is a stateful web service and {0} header is required.
+-     * 
++     *
+      */
+     public static String STATEFUL_COOKIE_HEADER_REQUIRED(Object arg0) {
+         return localizer.localize(localizableSTATEFUL_COOKIE_HEADER_REQUIRED(arg0));
+@@ -303,7 +324,7 @@
+ 
+     /**
+      * Implementor cannot be null
+-     * 
++     *
+      */
+     public static String NULL_IMPLEMENTOR() {
+         return localizer.localize(localizableNULL_IMPLEMENTOR());
+@@ -315,7 +336,7 @@
+ 
+     /**
+      * exception during WSDL parsing: {0}
+-     * 
++     *
+      */
+     public static String RUNTIME_PARSER_WSDL(Object arg0) {
+         return localizer.localize(localizableRUNTIME_PARSER_WSDL(arg0));
+@@ -327,7 +348,7 @@
+ 
+     /**
+      * Error in encoding SOAP Message
+-     * 
++     *
+      */
+     public static String SOAPENCODER_ERR() {
+         return localizer.localize(localizableSOAPENCODER_ERR());
+@@ -339,7 +360,7 @@
+ 
+     /**
+      * wsdl is required
+-     * 
++     *
+      */
+     public static String WSDL_REQUIRED() {
+         return localizer.localize(localizableWSDL_REQUIRED());
+@@ -351,12 +372,24 @@
+ 
+     /**
+      * Required com.sun.net.httpserver.HttpContext. Got : {0}
+-     * 
++     *
+      */
+     public static String NOT_HTTP_CONTEXT_TYPE(Object arg0) {
+         return localizer.localize(localizableNOT_HTTP_CONTEXT_TYPE(arg0));
+     }
+ 
++    public static Localizable localizableRUNTIME_PARSER_WSDL_NOSERVICE_IN_WSDLMODEL(Object arg0) {
++        return messageFactory.getMessage("runtime.parser.wsdl.noservice.in.wsdlmodel", arg0);
++    }
++
++    /**
++     * There is an error in processing the WSDL {0} and no valid services are found.
++     *
++     */
++    public static String RUNTIME_PARSER_WSDL_NOSERVICE_IN_WSDLMODEL(Object arg0) {
++        return localizer.localize(localizableRUNTIME_PARSER_WSDL_NOSERVICE_IN_WSDLMODEL(arg0));
++    }
++
+     public static Localizable localizablePORT_NAME_REQUIRED() {
+         return messageFactory.getMessage("port.name.required");
+     }
+@@ -363,7 +396,7 @@
+ 
+     /**
+      * Port QName is not found
+-     * 
++     *
+      */
+     public static String PORT_NAME_REQUIRED() {
+         return localizer.localize(localizablePORT_NAME_REQUIRED());
+@@ -375,7 +408,7 @@
+ 
+     /**
+      * Port namespace {0} doesn't match Service namespace {1}
+-     * 
++     *
+      */
+     public static String WRONG_TNS_FOR_PORT(Object arg0) {
+         return localizer.localize(localizableWRONG_TNS_FOR_PORT(arg0));
+@@ -387,19 +420,31 @@
+ 
+     /**
+      * multiple bindings found for binding ID {0} for service {1} in WSDL {2}
+-     * 
++     *
+      */
+     public static String RUNTIME_PARSER_WSDL_MULTIPLEBINDING(Object arg0, Object arg1, Object arg2) {
+         return localizer.localize(localizableRUNTIME_PARSER_WSDL_MULTIPLEBINDING(arg0, arg1, arg2));
+     }
+ 
++    public static Localizable localizableNON_UNIQUE_DISPATCH_QNAME(Object arg0, Object arg1) {
++        return messageFactory.getMessage("non.unique.dispatch.qname", arg0, arg1);
++    }
++
++    /**
++     * Non unique body parts! In a port, as per BP 1.1 R2710 operations must have unique operation signature on the wire for successful dispatch. Methods {0} have the same request body block {1}. Method dispatching may fail, runtime will try to dispatch using SOAPAction.
++     *
++     */
++    public static String NON_UNIQUE_DISPATCH_QNAME(Object arg0, Object arg1) {
++        return localizer.localize(localizableNON_UNIQUE_DISPATCH_QNAME(arg0, arg1));
++    }
++
+     public static Localizable localizableALREADY_HTTP_SERVER(Object arg0) {
+         return messageFactory.getMessage("already.http.server", arg0);
+     }
+ 
+     /**
+-     * There is already a HTTP server at : {0} 
+-     * 
++     * There is already a HTTP server at : {0}
++     *
+      */
+     public static String ALREADY_HTTP_SERVER(Object arg0) {
+         return localizer.localize(localizableALREADY_HTTP_SERVER(arg0));
+@@ -411,7 +456,7 @@
+ 
+     /**
+      * Cannot generate WSDL for binding "{0}"
+-     * 
++     *
+      */
+     public static String CAN_NOT_GENERATE_WSDL(Object arg0) {
+         return localizer.localize(localizableCAN_NOT_GENERATE_WSDL(arg0));
+@@ -423,7 +468,7 @@
+ 
+     /**
+      * invalid attribute value "{1}" in runtime descriptor (line {0})
+-     * 
++     *
+      */
+     public static String RUNTIME_PARSER_INVALID_ATTRIBUTE_VALUE(Object arg0, Object arg1) {
+         return localizer.localize(localizableRUNTIME_PARSER_INVALID_ATTRIBUTE_VALUE(arg0, arg1));
+@@ -435,12 +480,24 @@
+ 
+     /**
+      * found element "{1}", expected "{2}" in runtime descriptor (line {0})
+-     * 
++     *
+      */
+     public static String RUNTIME_PARSER_WRONG_ELEMENT(Object arg0, Object arg1, Object arg2) {
+         return localizer.localize(localizableRUNTIME_PARSER_WRONG_ELEMENT(arg0, arg1, arg2));
+     }
+ 
++    public static Localizable localizableRUNTIMEMODELER_INVALIDANNOTATION_ON_IMPL(Object arg0, Object arg1, Object arg2) {
++        return messageFactory.getMessage("runtimemodeler.invalidannotationOnImpl", arg0, arg1, arg2);
++    }
++
++    /**
++     * Invalid annotation: {0} on endpoint implementation class "{1}" - will be ignored. "{1}" is annotated with @WebService(endpointInterface="{2}"}, it MUST NOT be annotated with {0}, to fix it - put this annotation on the SEI {2}.
++     *
++     */
++    public static String RUNTIMEMODELER_INVALIDANNOTATION_ON_IMPL(Object arg0, Object arg1, Object arg2) {
++        return localizer.localize(localizableRUNTIMEMODELER_INVALIDANNOTATION_ON_IMPL(arg0, arg1, arg2));
++    }
++
+     public static Localizable localizableRUNTIME_PARSER_WSDL_NOSERVICE() {
+         return messageFactory.getMessage("runtime.parser.wsdl.noservice");
+     }
+@@ -447,7 +504,7 @@
+ 
+     /**
+      * can't apply binding! service {0} not found in the WSDL {1}
+-     * 
++     *
+      */
+     public static String RUNTIME_PARSER_WSDL_NOSERVICE() {
+         return localizer.localize(localizableRUNTIME_PARSER_WSDL_NOSERVICE());
+@@ -459,7 +516,7 @@
+ 
+     /**
+      * Service QName is not found
+-     * 
++     *
+      */
+     public static String SERVICE_NAME_REQUIRED() {
+         return localizer.localize(localizableSERVICE_NAME_REQUIRED());
+@@ -471,7 +528,7 @@
+ 
+     /**
+      * "{0}" implements Provider but doesn't specify the type parameter
+-     * 
++     *
+      */
+     public static String PROVIDER_NOT_PARAMETERIZED(Object arg0) {
+         return localizer.localize(localizablePROVIDER_NOT_PARAMETERIZED(arg0));
+@@ -483,7 +540,7 @@
+ 
+     /**
+      * error while patching WSDL related document
+-     * 
++     *
+      */
+     public static String RUNTIME_WSDL_PATCHER() {
+         return localizer.localize(localizableRUNTIME_WSDL_PATCHER());
+@@ -496,7 +553,7 @@
+     /**
+      * {0}
+      * {1}
+-     * 
++     *
+      */
+     public static String RUNTIME_SAXPARSER_EXCEPTION(Object arg0, Object arg1) {
+         return localizer.localize(localizableRUNTIME_SAXPARSER_EXCEPTION(arg0, arg1));
+@@ -508,7 +565,7 @@
+ 
+     /**
+      * {0} is not found in the WAR file. Package it in the WAR file or correct it in sun-jaxws.xml.
+-     * 
++     *
+      */
+     public static String RUNTIME_PARSER_WSDL_NOT_FOUND(Object arg0) {
+         return localizer.localize(localizableRUNTIME_PARSER_WSDL_NOT_FOUND(arg0));
+@@ -520,7 +577,7 @@
+ 
+     /**
+      * Incorrect argument types for method "{0}"
+-     * 
++     *
+      */
+     public static String WRONG_PARAMETER_TYPE(Object arg0) {
+         return localizer.localize(localizableWRONG_PARAMETER_TYPE(arg0));
+@@ -532,12 +589,24 @@
+ 
+     /**
+      * class not found in runtime descriptor: {0}
+-     * 
++     *
+      */
+     public static String RUNTIME_PARSER_CLASS_NOT_FOUND(Object arg0) {
+         return localizer.localize(localizableRUNTIME_PARSER_CLASS_NOT_FOUND(arg0));
+     }
+ 
++    public static Localizable localizableUNSUPPORTED_CHARSET(Object arg0) {
++        return messageFactory.getMessage("unsupported.charset", arg0);
++    }
++
++    /**
++     * Unsupported charset "{0}" in the received message''s Content-Type
++     *
++     */
++    public static String UNSUPPORTED_CHARSET(Object arg0) {
++        return localizer.localize(localizableUNSUPPORTED_CHARSET(arg0));
++    }
++
+     public static Localizable localizableSTATIC_RESOURCE_INJECTION_ONLY(Object arg0, Object arg1) {
+         return messageFactory.getMessage("static.resource.injection.only", arg0, arg1);
+     }
+@@ -544,7 +613,7 @@
+ 
+     /**
+      * Static resource {0} cannot be injected to non-static "{1}"
+-     * 
++     *
+      */
+     public static String STATIC_RESOURCE_INJECTION_ONLY(Object arg0, Object arg1) {
+         return localizer.localize(localizableSTATIC_RESOURCE_INJECTION_ONLY(arg0, arg1));
+@@ -556,7 +625,7 @@
+ 
+     /**
+      * Method "{0}" shouldn''t have any arguments
+-     * 
++     *
+      */
+     public static String NOT_ZERO_PARAMETERS(Object arg0) {
+         return localizer.localize(localizableNOT_ZERO_PARAMETERS(arg0));
+@@ -568,7 +637,7 @@
+ 
+     /**
+      * Metadata has more than one WSDL that has Service definiton for the endpoint. WSDL={0} is one such WSDL.
+-     * 
++     *
+      */
+     public static String DUPLICATE_PRIMARY_WSDL(Object arg0) {
+         return localizer.localize(localizableDUPLICATE_PRIMARY_WSDL(arg0));
+@@ -580,7 +649,7 @@
+ 
+     /**
+      * Metadata has more than one WSDL that has PortType definiton for the endpoint. WSDL={0} is one such WSDL.
+-     * 
++     *
+      */
+     public static String DUPLICATE_ABSTRACT_WSDL(Object arg0) {
+         return localizer.localize(localizableDUPLICATE_ABSTRACT_WSDL(arg0));
+@@ -592,7 +661,7 @@
+ 
+     /**
+      * Not a WebServiceContext from JAX-WS RI: {0}
+-     * 
++     *
+      */
+     public static String STATEFUL_INVALID_WEBSERVICE_CONTEXT(Object arg0) {
+         return localizer.localize(localizableSTATEFUL_INVALID_WEBSERVICE_CONTEXT(arg0));
+@@ -604,7 +673,7 @@
+ 
+     /**
+      * can't apply binding! no binding found for binding ID {0] for service {1} in WSDL {2}
+-     * 
++     *
+      */
+     public static String RUNTIME_PARSER_WSDL_NOBINDING() {
+         return localizer.localize(localizableRUNTIME_PARSER_WSDL_NOBINDING());
+@@ -616,7 +685,7 @@
+ 
+     /**
+      * invalid element "{1}" in runtime descriptor (line {0})
+-     * 
++     *
+      */
+     public static String RUNTIME_PARSER_INVALID_ELEMENT(Object arg0, Object arg1) {
+         return localizer.localize(localizableRUNTIME_PARSER_INVALID_ELEMENT(arg0, arg1));
+@@ -628,7 +697,7 @@
+ 
+     /**
+      * missing attribute "{2}" in element "{1}" of runtime descriptor (line {0})
+-     * 
++     *
+      */
+     public static String RUNTIME_PARSER_MISSING_ATTRIBUTE(Object arg0, Object arg1, Object arg2) {
+         return localizer.localize(localizableRUNTIME_PARSER_MISSING_ATTRIBUTE(arg0, arg1, arg2));
+@@ -640,7 +709,7 @@
+ 
+     /**
+      * Incorrect type for field "{0}"
+-     * 
++     *
+      */
+     public static String WRONG_FIELD_TYPE(Object arg0) {
+         return localizer.localize(localizableWRONG_FIELD_TYPE(arg0));
+@@ -652,7 +721,7 @@
+ 
+     /**
+      * Received SOAP message contains duplicate header: {0} for a bound parameter
+-     * 
++     *
+      */
+     public static String DUPLICATE_PORT_KNOWN_HEADER(Object arg0) {
+         return localizer.localize(localizableDUPLICATE_PORT_KNOWN_HEADER(arg0));
+@@ -664,7 +733,7 @@
+ 
+     /**
+      * Unsupported Content-Type: {0} Supported ones are: {1}
+-     * 
++     *
+      */
+     public static String UNSUPPORTED_CONTENT_TYPE(Object arg0, Object arg1) {
+         return localizer.localize(localizableUNSUPPORTED_CONTENT_TYPE(arg0, arg1));
+@@ -676,7 +745,7 @@
+ 
+     /**
+      * Unable to instantiate {0} (which is specified in {1} on {2})
+-     * 
++     *
+      */
+     public static String FAILED_TO_INSTANTIATE_INSTANCE_RESOLVER(Object arg0, Object arg1, Object arg2) {
+         return localizer.localize(localizableFAILED_TO_INSTANTIATE_INSTANCE_RESOLVER(arg0, arg1, arg2));
+@@ -688,7 +757,7 @@
+ 
+     /**
+      * Error in Deployment Descriptor : MTOM Configuration in binding {0} conflicts with enable-mtom attribute value {1}
+-     * 
++     *
+      */
+     public static String DD_MTOM_CONFLICT(Object arg0, Object arg1) {
+         return localizer.localize(localizableDD_MTOM_CONFLICT(arg0, arg1));
+--- old/src/share/classes/com/sun/xml/internal/ws/resources/SoapMessages.java	Thu Jul 30 18:32:32 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/SoapMessages.java	Thu Jul 30 18:32:32 2009
+@@ -31,7 +31,7 @@
+ 
+ /**
+  * Defines string formatting method for each constant in the resource file
+- * 
++ *
+  */
+ public final class SoapMessages {
+ 
+@@ -44,7 +44,7 @@
+ 
+     /**
+      * Couldn''t create SOAP Fault due to exception: {0}
+-     * 
++     *
+      */
+     public static String SOAP_FAULT_CREATE_ERR(Object arg0) {
+         return localizer.localize(localizableSOAP_FAULT_CREATE_ERR(arg0));
+@@ -56,7 +56,7 @@
+ 
+     /**
+      * Couldn''t create SOAP message factory due to exception: {0}
+-     * 
++     *
+      */
+     public static String SOAP_MSG_FACTORY_CREATE_ERR(Object arg0) {
+         return localizer.localize(localizableSOAP_MSG_FACTORY_CREATE_ERR(arg0));
+@@ -68,7 +68,7 @@
+ 
+     /**
+      * Couldn''t create SOAP message due to exception: {0}
+-     * 
++     *
+      */
+     public static String SOAP_MSG_CREATE_ERR(Object arg0) {
+         return localizer.localize(localizableSOAP_MSG_CREATE_ERR(arg0));
+@@ -80,7 +80,7 @@
+ 
+     /**
+      * Couldn''t create SOAP factory due to exception: {0}
+-     * 
++     *
+      */
+     public static String SOAP_FACTORY_CREATE_ERR(Object arg0) {
+         return localizer.localize(localizableSOAP_FACTORY_CREATE_ERR(arg0));
+@@ -92,7 +92,7 @@
+ 
+     /**
+      * Invalid fault code: {0}
+-     * 
++     *
+      */
+     public static String SOAP_PROTOCOL_INVALID_FAULT_CODE(Object arg0) {
+         return localizer.localize(localizableSOAP_PROTOCOL_INVALID_FAULT_CODE(arg0));
+@@ -103,8 +103,8 @@
+     }
+ 
+     /**
+-     * Couldn''t create SOAP message. Expecting Envelope in namespace {0}, but got {1} 
+-     * 
++     * Couldn''t create SOAP message. Expecting Envelope in namespace {0}, but got {1}
++     *
+      */
+     public static String SOAP_VERSION_MISMATCH_ERR(Object arg0, Object arg1) {
+         return localizer.localize(localizableSOAP_VERSION_MISMATCH_ERR(arg0, arg1));
+--- old/src/share/classes/com/sun/xml/internal/ws/resources/StreamingMessages.java	Thu Jul 30 18:32:36 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/StreamingMessages.java	Thu Jul 30 18:32:35 2009
+@@ -31,7 +31,7 @@
+ 
+ /**
+  * Defines string formatting method for each constant in the resource file
+- * 
++ *
+  */
+ public final class StreamingMessages {
+ 
+@@ -44,7 +44,7 @@
+ 
+     /**
+      * Fast Infoset decoding is not accepted
+-     * 
++     *
+      */
+     public static String FASTINFOSET_DECODING_NOT_ACCEPTED() {
+         return localizer.localize(localizableFASTINFOSET_DECODING_NOT_ACCEPTED());
+@@ -56,7 +56,7 @@
+ 
+     /**
+      * Unable to create StAX reader or writer
+-     * 
++     *
+      */
+     public static String STAX_CANT_CREATE() {
+         return localizer.localize(localizableSTAX_CANT_CREATE());
+@@ -68,7 +68,7 @@
+ 
+     /**
+      * XML parsing error: {0}
+-     * 
++     *
+      */
+     public static String STREAMING_IO_EXCEPTION(Object arg0) {
+         return localizer.localize(localizableSTREAMING_IO_EXCEPTION(arg0));
+@@ -80,7 +80,7 @@
+ 
+     /**
+      * Unable to create reader from source "{0}"
+-     * 
++     *
+      */
+     public static String SOURCEREADER_INVALID_SOURCE(Object arg0) {
+         return localizer.localize(localizableSOURCEREADER_INVALID_SOURCE(arg0));
+@@ -92,7 +92,7 @@
+ 
+     /**
+      * unexpected XML reader state. expected: {0} but found: {1}
+-     * 
++     *
+      */
+     public static String XMLREADER_UNEXPECTED_STATE(Object arg0, Object arg1) {
+         return localizer.localize(localizableXMLREADER_UNEXPECTED_STATE(arg0, arg1));
+@@ -104,7 +104,7 @@
+ 
+     /**
+      * XML reader error: {0}
+-     * 
++     *
+      */
+     public static String XMLREADER_IO_EXCEPTION(Object arg0) {
+         return localizer.localize(localizableXMLREADER_IO_EXCEPTION(arg0));
+@@ -116,7 +116,7 @@
+ 
+     /**
+      * Unable to locate compatible implementation of Fast Infoset in classpath
+-     * 
++     *
+      */
+     public static String FASTINFOSET_NO_IMPLEMENTATION() {
+         return localizer.localize(localizableFASTINFOSET_NO_IMPLEMENTATION());
+@@ -128,7 +128,7 @@
+ 
+     /**
+      * XML writer error: {0}
+-     * 
++     *
+      */
+     public static String XMLWRITER_IO_EXCEPTION(Object arg0) {
+         return localizer.localize(localizableXMLWRITER_IO_EXCEPTION(arg0));
+@@ -140,7 +140,7 @@
+ 
+     /**
+      * XML reader error: unexpected character content: "{0}"
+-     * 
++     *
+      */
+     public static String XMLREADER_UNEXPECTED_CHARACTER_CONTENT(Object arg0) {
+         return localizer.localize(localizableXMLREADER_UNEXPECTED_CHARACTER_CONTENT(arg0));
+@@ -152,7 +152,7 @@
+ 
+     /**
+      * XML parsing error: {0}
+-     * 
++     *
+      */
+     public static String STREAMING_PARSE_EXCEPTION(Object arg0) {
+         return localizer.localize(localizableSTREAMING_PARSE_EXCEPTION(arg0));
+@@ -164,7 +164,7 @@
+ 
+     /**
+      * XML writer error: no prefix for URI: "{0}"
+-     * 
++     *
+      */
+     public static String XMLWRITER_NO_PREFIX_FOR_URI(Object arg0) {
+         return localizer.localize(localizableXMLWRITER_NO_PREFIX_FOR_URI(arg0));
+@@ -176,7 +176,7 @@
+ 
+     /**
+      * XML reader error: {0}
+-     * 
++     *
+      */
+     public static String XMLREADER_NESTED_ERROR(Object arg0) {
+         return localizer.localize(localizableXMLREADER_NESTED_ERROR(arg0));
+@@ -188,7 +188,7 @@
+ 
+     /**
+      * XML stream reader exception: {0}
+-     * 
++     *
+      */
+     public static String STAXREADER_XMLSTREAMEXCEPTION(Object arg0) {
+         return localizer.localize(localizableSTAXREADER_XMLSTREAMEXCEPTION(arg0));
+@@ -200,7 +200,7 @@
+ 
+     /**
+      * XML writer error: {0}
+-     * 
++     *
+      */
+     public static String XMLWRITER_NESTED_ERROR(Object arg0) {
+         return localizer.localize(localizableXMLWRITER_NESTED_ERROR(arg0));
+@@ -212,7 +212,7 @@
+ 
+     /**
+      * XML reader internal error: illegal state ({0})
+-     * 
++     *
+      */
+     public static String XMLREADER_ILLEGAL_STATE_ENCOUNTERED(Object arg0) {
+         return localizer.localize(localizableXMLREADER_ILLEGAL_STATE_ENCOUNTERED(arg0));
+@@ -224,7 +224,7 @@
+ 
+     /**
+      * unexpected XML tag. expected: {0} but found: {1}
+-     * 
++     *
+      */
+     public static String XMLREADER_UNEXPECTED_STATE_TAG(Object arg0, Object arg1) {
+         return localizer.localize(localizableXMLREADER_UNEXPECTED_STATE_TAG(arg0, arg1));
+@@ -236,7 +236,7 @@
+ 
+     /**
+      * unexpected XML reader state. expected: {0} but found: {1}. {2}
+-     * 
++     *
+      */
+     public static String XMLREADER_UNEXPECTED_STATE_MESSAGE(Object arg0, Object arg1, Object arg2) {
+         return localizer.localize(localizableXMLREADER_UNEXPECTED_STATE_MESSAGE(arg0, arg1, arg2));
+@@ -248,7 +248,7 @@
+ 
+     /**
+      * XML parsing error: {0}
+-     * 
++     *
+      */
+     public static String XMLREADER_PARSE_EXCEPTION(Object arg0) {
+         return localizer.localize(localizableXMLREADER_PARSE_EXCEPTION(arg0));
+@@ -260,7 +260,7 @@
+ 
+     /**
+      * no more recorded elements available
+-     * 
++     *
+      */
+     public static String XMLRECORDER_RECORDING_ENDED() {
+         return localizer.localize(localizableXMLRECORDER_RECORDING_ENDED());
+--- old/src/share/classes/com/sun/xml/internal/ws/resources/UtilMessages.java	Thu Jul 30 18:32:39 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/UtilMessages.java	Thu Jul 30 18:32:39 2009
+@@ -31,7 +31,7 @@
+ 
+ /**
+  * Defines string formatting method for each constant in the resource file
+- * 
++ *
+  */
+ public final class UtilMessages {
+ 
+@@ -44,7 +44,7 @@
+ 
+     /**
+      * at line {0} of {1}
+-     * 
++     *
+      */
+     public static String UTIL_LOCATION(Object arg0, Object arg1) {
+         return localizer.localize(localizableUTIL_LOCATION(arg0, arg1));
+@@ -56,7 +56,7 @@
+ 
+     /**
+      * Could not parse handler chain file {1} for class {0}
+-     * 
++     *
+      */
+     public static String UTIL_FAILED_TO_PARSE_HANDLERCHAIN_FILE(Object arg0, Object arg1) {
+         return localizer.localize(localizableUTIL_FAILED_TO_PARSE_HANDLERCHAIN_FILE(arg0, arg1));
+@@ -68,7 +68,7 @@
+ 
+     /**
+      * found element "{1}", expected "{2}" in handler chain configuration (line {0})
+-     * 
++     *
+      */
+     public static String UTIL_PARSER_WRONG_ELEMENT(Object arg0, Object arg1, Object arg2) {
+         return localizer.localize(localizableUTIL_PARSER_WRONG_ELEMENT(arg0, arg1, arg2));
+@@ -80,7 +80,7 @@
+ 
+     /**
+      * "Class: {0} could not be found"
+-     * 
++     *
+      */
+     public static String UTIL_HANDLER_CLASS_NOT_FOUND(Object arg0) {
+         return localizer.localize(localizableUTIL_HANDLER_CLASS_NOT_FOUND(arg0));
+@@ -92,7 +92,7 @@
+ 
+     /**
+      * "The Endpoint Interface: {0} does not have WebService Annotation"
+-     * 
++     *
+      */
+     public static String UTIL_HANDLER_ENDPOINT_INTERFACE_NO_WEBSERVICE(Object arg0) {
+         return localizer.localize(localizableUTIL_HANDLER_ENDPOINT_INTERFACE_NO_WEBSERVICE(arg0));
+@@ -104,7 +104,7 @@
+ 
+     /**
+      * "A WebService annotation is not present on class: {0}"
+-     * 
++     *
+      */
+     public static String UTIL_HANDLER_NO_WEBSERVICE_ANNOTATION(Object arg0) {
+         return localizer.localize(localizableUTIL_HANDLER_NO_WEBSERVICE_ANNOTATION(arg0));
+@@ -116,7 +116,7 @@
+ 
+     /**
+      * Could not find handler chain file {1} for class {0}
+-     * 
++     *
+      */
+     public static String UTIL_FAILED_TO_FIND_HANDLERCHAIN_FILE(Object arg0, Object arg1) {
+         return localizer.localize(localizableUTIL_FAILED_TO_FIND_HANDLERCHAIN_FILE(arg0, arg1));
+@@ -128,7 +128,7 @@
+ 
+     /**
+      * You must use HanlderChain annotation, not SOAPMessageHandlers
+-     * 
++     *
+      */
+     public static String UTIL_HANDLER_CANNOT_COMBINE_SOAPMESSAGEHANDLERS() {
+         return localizer.localize(localizableUTIL_HANDLER_CANNOT_COMBINE_SOAPMESSAGEHANDLERS());
+--- old/src/share/classes/com/sun/xml/internal/ws/resources/WsdlmodelMessages.java	Thu Jul 30 18:32:43 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/WsdlmodelMessages.java	Thu Jul 30 18:32:42 2009
+@@ -31,7 +31,7 @@
+ 
+ /**
+  * Defines string formatting method for each constant in the resource file
+- * 
++ *
+  */
+ public final class WsdlmodelMessages {
+ 
+@@ -44,7 +44,7 @@
+ 
+     /**
+      * For Port: {0}, service location {1} does not match address {2} in the EndpointReference
+-     * 
++     *
+      */
+     public static String WSDL_PORTADDRESS_EPRADDRESS_NOT_MATCH(Object arg0, Object arg1, Object arg2) {
+         return localizer.localize(localizableWSDL_PORTADDRESS_EPRADDRESS_NOT_MATCH(arg0, arg1, arg2));
+@@ -57,7 +57,7 @@
+     /**
+      * Import of {0} is violation of BP 1.1 R2001. Proceeding with a warning.
+      * R2001 A DESCRIPTION MUST only use the WSDL "import" statement to import another WSDL description.
+-     * 
++     *
+      */
+     public static String WSDL_IMPORT_SHOULD_BE_WSDL(Object arg0) {
+         return localizer.localize(localizableWSDL_IMPORT_SHOULD_BE_WSDL(arg0));
+@@ -69,7 +69,7 @@
+ 
+     /**
+      * Mex WSDL metadata can not be parsed, the systemId is of the MEX source is null.
+-     * 
++     *
+      */
+     public static String MEX_METADATA_SYSTEMID_NULL() {
+         return localizer.localize(localizableMEX_METADATA_SYSTEMID_NULL());
+--- old/src/share/classes/com/sun/xml/internal/ws/resources/WsservletMessages.java	Thu Jul 30 18:32:46 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/WsservletMessages.java	Thu Jul 30 18:32:46 2009
+@@ -31,7 +31,7 @@
+ 
+ /**
+  * Defines string formatting method for each constant in the resource file
+- * 
++ *
+  */
+ public final class WsservletMessages {
+ 
+@@ -44,7 +44,7 @@
+ 
+     /**
+      * WSSERVLET46: cannot read configuration
+-     * 
++     *
+      */
+     public static String ERROR_WSDL_PUBLISHER_CANNOT_READ_CONFIGURATION() {
+         return localizer.localize(localizableERROR_WSDL_PUBLISHER_CANNOT_READ_CONFIGURATION());
+@@ -56,7 +56,7 @@
+ 
+     /**
+      * Set endpoint with stub.setTargetEndpoint property
+-     * 
++     *
+      */
+     public static String WSSERVLET_22_DIAG_CHECK_1() {
+         return localizer.localize(localizableWSSERVLET_22_DIAG_CHECK_1());
+@@ -68,7 +68,7 @@
+ 
+     /**
+      * When publishing the service wsdl, the http location is patched with the deployed location/endpoint using XSLT transformation. The transformer could not be created to do the transformation.
+-     * 
++     *
+      */
+     public static String WSSERVLET_33_DIAG_CAUSE_2() {
+         return localizer.localize(localizableWSSERVLET_33_DIAG_CAUSE_2());
+@@ -80,7 +80,7 @@
+ 
+     /**
+      * When publishing the service wsdl, the http location is patched with the deployed location/endpoint using XSLT transformation. The transformer could not be created to do the transformation.
+-     * 
++     *
+      */
+     public static String WSSERVLET_33_DIAG_CAUSE_1() {
+         return localizer.localize(localizableWSSERVLET_33_DIAG_CAUSE_1());
+@@ -92,7 +92,7 @@
+ 
+     /**
+      * WSSERVLET42: duplicate port name: {0}
+-     * 
++     *
+      */
+     public static String ERROR_IMPLEMENTOR_REGISTRY_DUPLICATE_NAME(Object arg0) {
+         return localizer.localize(localizableERROR_IMPLEMENTOR_REGISTRY_DUPLICATE_NAME(arg0));
+@@ -104,7 +104,7 @@
+ 
+     /**
+      * WSSERVLET45: file not found: {0}
+-     * 
++     *
+      */
+     public static String ERROR_IMPLEMENTOR_REGISTRY_FILE_NOT_FOUND(Object arg0) {
+         return localizer.localize(localizableERROR_IMPLEMENTOR_REGISTRY_FILE_NOT_FOUND(arg0));
+@@ -116,7 +116,7 @@
+ 
+     /**
+      * WSSERVLET21: invoking implementor: {0}
+-     * 
++     *
+      */
+     public static String SERVLET_TRACE_INVOKING_IMPLEMENTOR(Object arg0) {
+         return localizer.localize(localizableSERVLET_TRACE_INVOKING_IMPLEMENTOR(arg0));
+@@ -128,7 +128,7 @@
+ 
+     /**
+      * Two or more endpoints with the same name where found in the jaxrpc-ri.xml runtime descriptor
+-     * 
++     *
+      */
+     public static String WSSERVLET_17_DIAG_CAUSE_1() {
+         return localizer.localize(localizableWSSERVLET_17_DIAG_CAUSE_1());
+@@ -140,7 +140,7 @@
+ 
+     /**
+      * <p>Invalid request URI.</p><p>Please check your deployment information.</p>
+-     * 
++     *
+      */
+     public static String HTML_NON_ROOT_PAGE_BODY_2() {
+         return localizer.localize(localizableHTML_NON_ROOT_PAGE_BODY_2());
+@@ -152,7 +152,7 @@
+ 
+     /**
+      * <p>A Web Service is installed at this URL.</p>
+-     * 
++     *
+      */
+     public static String HTML_NON_ROOT_PAGE_BODY_1() {
+         return localizer.localize(localizableHTML_NON_ROOT_PAGE_BODY_1());
+@@ -164,7 +164,7 @@
+ 
+     /**
+      * WSSERVLET31: applying transformation with actual address: {0}
+-     * 
++     *
+      */
+     public static String PUBLISHER_INFO_APPLYING_TRANSFORMATION(Object arg0) {
+         return localizer.localize(localizablePUBLISHER_INFO_APPLYING_TRANSFORMATION(arg0));
+@@ -176,7 +176,7 @@
+ 
+     /**
+      * Is the port valid? Unzip the war file and make sure the tie and serializers are present
+-     * 
++     *
+      */
+     public static String WSSERVLET_29_DIAG_CHECK_1() {
+         return localizer.localize(localizableWSSERVLET_29_DIAG_CHECK_1());
+@@ -188,7 +188,7 @@
+ 
+     /**
+      * WSSERVLET19: got request for endpoint: {0}
+-     * 
++     *
+      */
+     public static String SERVLET_TRACE_GOT_REQUEST_FOR_ENDPOINT(Object arg0) {
+         return localizer.localize(localizableSERVLET_TRACE_GOT_REQUEST_FOR_ENDPOINT(arg0));
+@@ -200,7 +200,7 @@
+ 
+     /**
+      * WSSERVLET47: cannot find configuration parameter: "{0}"
+-     * 
++     *
+      */
+     public static String ERROR_SERVLET_INIT_CONFIG_PARAMETER_MISSING(Object arg0) {
+         return localizer.localize(localizableERROR_SERVLET_INIT_CONFIG_PARAMETER_MISSING(arg0));
+@@ -212,7 +212,7 @@
+ 
+     /**
+      * WSSERVLET44: failed to initialize the service implementor for port "{0}"
+-     * 
++     *
+      */
+     public static String ERROR_IMPLEMENTOR_FACTORY_SERVANT_INIT_FAILED(Object arg0) {
+         return localizer.localize(localizableERROR_IMPLEMENTOR_FACTORY_SERVANT_INIT_FAILED(arg0));
+@@ -224,7 +224,7 @@
+ 
+     /**
+      * Normal web service shutdown
+-     * 
++     *
+      */
+     public static String WSSERVLET_13_DIAG_CHECK_1() {
+         return localizer.localize(localizableWSSERVLET_13_DIAG_CHECK_1());
+@@ -236,7 +236,7 @@
+ 
+     /**
+      * Transformation being applied
+-     * 
++     *
+      */
+     public static String WSSERVLET_31_DIAG_CAUSE_1() {
+         return localizer.localize(localizableWSSERVLET_31_DIAG_CAUSE_1());
+@@ -248,7 +248,7 @@
+ 
+     /**
+      * Check the server.xml file in the domain directory for failures
+-     * 
++     *
+      */
+     public static String WSSERVLET_50_DIAG_CHECK_3() {
+         return localizer.localize(localizableWSSERVLET_50_DIAG_CHECK_3());
+@@ -260,7 +260,7 @@
+ 
+     /**
+      * WSSERVLET37: no configuration specified
+-     * 
++     *
+      */
+     public static String ERROR_IMPLEMENTOR_FACTORY_NO_INPUT_STREAM() {
+         return localizer.localize(localizableERROR_IMPLEMENTOR_FACTORY_NO_INPUT_STREAM());
+@@ -272,7 +272,7 @@
+ 
+     /**
+      * SOAPFault message is being returned to the client.
+-     * 
++     *
+      */
+     public static String WSSERVLET_24_DIAG_CAUSE_1() {
+         return localizer.localize(localizableWSSERVLET_24_DIAG_CAUSE_1());
+@@ -284,7 +284,7 @@
+ 
+     /**
+      * Verify that Application server deployment descriptors are correct in the service war file
+-     * 
++     *
+      */
+     public static String WSSERVLET_50_DIAG_CHECK_2() {
+         return localizer.localize(localizableWSSERVLET_50_DIAG_CHECK_2());
+@@ -296,7 +296,7 @@
+ 
+     /**
+      * Verify that sun-jaxws.xml and web.xml are correct in the service war file
+-     * 
++     *
+      */
+     public static String WSSERVLET_50_DIAG_CHECK_1() {
+         return localizer.localize(localizableWSSERVLET_50_DIAG_CHECK_1());
+@@ -308,7 +308,7 @@
+ 
+     /**
+      * Make sure web service is available and public. Examine exception for more details
+-     * 
++     *
+      */
+     public static String WSSERVLET_43_DIAG_CHECK_1() {
+         return localizer.localize(localizableWSSERVLET_43_DIAG_CHECK_1());
+@@ -320,7 +320,7 @@
+ 
+     /**
+      * Web Services servlet shutdown.
+-     * 
++     *
+      */
+     public static String WSSERVLET_15_DIAG_CAUSE_1() {
+         return localizer.localize(localizableWSSERVLET_15_DIAG_CAUSE_1());
+@@ -332,7 +332,7 @@
+ 
+     /**
+      * Remove the implicit URL
+-     * 
++     *
+      */
+     public static String WSSERVLET_27_DIAG_CHECK_1() {
+         return localizer.localize(localizableWSSERVLET_27_DIAG_CHECK_1());
+@@ -344,7 +344,7 @@
+ 
+     /**
+      * WSSERVLET38: unknown port name: {0}
+-     * 
++     *
+      */
+     public static String ERROR_IMPLEMENTOR_REGISTRY_UNKNOWN_NAME(Object arg0) {
+         return localizer.localize(localizableERROR_IMPLEMENTOR_REGISTRY_UNKNOWN_NAME(arg0));
+@@ -356,7 +356,7 @@
+ 
+     /**
+      * <h1>404 Not Found: {0}</h1>
+-     * 
++     *
+      */
+     public static String SERVLET_HTML_NOT_FOUND(Object arg0) {
+         return localizer.localize(localizableSERVLET_HTML_NOT_FOUND(arg0));
+@@ -368,7 +368,7 @@
+ 
+     /**
+      * Web Service
+-     * 
++     *
+      */
+     public static String HTML_ROOT_PAGE_TITLE() {
+         return localizer.localize(localizableHTML_ROOT_PAGE_TITLE());
+@@ -380,7 +380,7 @@
+ 
+     /**
+      * Unzip the war, are the tie and serializer classes found?
+-     * 
++     *
+      */
+     public static String WSSERVLET_20_DIAG_CHECK_1() {
+         return localizer.localize(localizableWSSERVLET_20_DIAG_CHECK_1());
+@@ -392,7 +392,7 @@
+ 
+     /**
+      * WSRuntimeInfoParser cauld not parse sun-jaxws.xml runtime descriptor
+-     * 
++     *
+      */
+     public static String JAXRPCSERVLET_11_DIAG_CAUSE_1() {
+         return localizer.localize(localizableJAXRPCSERVLET_11_DIAG_CAUSE_1());
+@@ -404,7 +404,7 @@
+ 
+     /**
+      * Please check the jaxrpc-ri.xml file to make sure it is present in the war file
+-     * 
++     *
+      */
+     public static String WSSERVLET_11_DIAG_CHECK_2() {
+         return localizer.localize(localizableWSSERVLET_11_DIAG_CHECK_2());
+@@ -416,7 +416,7 @@
+ 
+     /**
+      * Please check the sun-jaxws.xml file to make sure it is correct
+-     * 
++     *
+      */
+     public static String WSSERVLET_11_DIAG_CHECK_1() {
+         return localizer.localize(localizableWSSERVLET_11_DIAG_CHECK_1());
+@@ -428,7 +428,7 @@
+ 
+     /**
+      * A request was invoked with no endpoint
+-     * 
++     *
+      */
+     public static String WSSERVLET_22_DIAG_CAUSE_1() {
+         return localizer.localize(localizableWSSERVLET_22_DIAG_CAUSE_1());
+@@ -440,7 +440,7 @@
+ 
+     /**
+      * Check the log file(s) for more detailed errors/exceptions.
+-     * 
++     *
+      */
+     public static String WSSERVLET_34_DIAG_CHECK_1() {
+         return localizer.localize(localizableWSSERVLET_34_DIAG_CHECK_1());
+@@ -452,7 +452,7 @@
+ 
+     /**
+      * WSSERVLET52: no implementor registered for port: {0}
+-     * 
++     *
+      */
+     public static String ERROR_SERVLET_NO_IMPLEMENTOR_FOR_PORT(Object arg0) {
+         return localizer.localize(localizableERROR_SERVLET_NO_IMPLEMENTOR_FOR_PORT(arg0));
+@@ -464,7 +464,7 @@
+ 
+     /**
+      * Make sure the client request is using text/xml
+-     * 
++     *
+      */
+     public static String WSSERVLET_64_DIAG_CHECK_1() {
+         return localizer.localize(localizableWSSERVLET_64_DIAG_CHECK_1());
+@@ -476,7 +476,7 @@
+ 
+     /**
+      * This may or may not be intentional. If not examine client program for errors.
+-     * 
++     *
+      */
+     public static String WSSERVLET_18_DIAG_CHECK_1() {
+         return localizer.localize(localizableWSSERVLET_18_DIAG_CHECK_1());
+@@ -488,7 +488,7 @@
+ 
+     /**
+      * A port is specified, but a corresponding service implementation is not found
+-     * 
++     *
+      */
+     public static String WSSERVLET_29_DIAG_CAUSE_1() {
+         return localizer.localize(localizableWSSERVLET_29_DIAG_CAUSE_1());
+@@ -500,7 +500,7 @@
+ 
+     /**
+      * WSSERVLET23: no response message
+-     * 
++     *
+      */
+     public static String SERVLET_ERROR_NO_RESPONSE_MESSAGE() {
+         return localizer.localize(localizableSERVLET_ERROR_NO_RESPONSE_MESSAGE());
+@@ -512,7 +512,7 @@
+ 
+     /**
+      * ERROR
+-     * 
++     *
+      */
+     public static String SERVLET_HTML_STATUS_ERROR() {
+         return localizer.localize(localizableSERVLET_HTML_STATUS_ERROR());
+@@ -524,7 +524,7 @@
+ 
+     /**
+      * WSSERVLET12: JAX-WS context listener initializing
+-     * 
++     *
+      */
+     public static String LISTENER_INFO_INITIALIZE() {
+         return localizer.localize(localizableLISTENER_INFO_INITIALIZE());
+@@ -536,22 +536,22 @@
+ 
+     /**
+      * <p>No JAX-WS context information available.</p>
+-     * 
++     *
+      */
+     public static String SERVLET_HTML_NO_INFO_AVAILABLE() {
+         return localizer.localize(localizableSERVLET_HTML_NO_INFO_AVAILABLE());
+     }
+ 
+-    public static Localizable localizableSERVLET_HTML_INFORMATION_TABLE(Object arg0, Object arg1, Object arg2) {
+-        return messageFactory.getMessage("servlet.html.information.table", arg0, arg1, arg2);
++    public static Localizable localizableSERVLET_HTML_INFORMATION_TABLE(Object arg0, Object arg1) {
++        return messageFactory.getMessage("servlet.html.information.table", arg0, arg1);
+     }
+ 
+     /**
+-     * <table border="0"><tr><td>Address:</td><td>{0}</td></tr><tr><td>WSDL:</td><td><a href="{0}?wsdl">{0}?wsdl</a></td></tr><tr><td>Port QName:</td><td>{1}</td></tr><tr><td>Implementation class:</td><td>{2}</td></tr></table>
+-     * 
++     * <table border="0"><tr><td>Address:</td><td>{0}</td></tr><tr><td>WSDL:</td><td><a href="{0}?wsdl">{0}?wsdl</a></td></tr><tr><td>Implementation class:</td><td>{1}</td></tr></table>
++     *
+      */
+-    public static String SERVLET_HTML_INFORMATION_TABLE(Object arg0, Object arg1, Object arg2) {
+-        return localizer.localize(localizableSERVLET_HTML_INFORMATION_TABLE(arg0, arg1, arg2));
++    public static String SERVLET_HTML_INFORMATION_TABLE(Object arg0, Object arg1) {
++        return localizer.localize(localizableSERVLET_HTML_INFORMATION_TABLE(arg0, arg1));
+     }
+ 
+     public static Localizable localizableSERVLET_TRACE_WRITING_FAULT_RESPONSE() {
+@@ -560,7 +560,7 @@
+ 
+     /**
+      * WSSERVLET24: writing fault response
+-     * 
++     *
+      */
+     public static String SERVLET_TRACE_WRITING_FAULT_RESPONSE() {
+         return localizer.localize(localizableSERVLET_TRACE_WRITING_FAULT_RESPONSE());
+@@ -572,7 +572,7 @@
+ 
+     /**
+      * WSSERVLET20: no implementor for endpoint: {0}
+-     * 
++     *
+      */
+     public static String SERVLET_ERROR_NO_IMPLEMENTOR_FOR_ENDPOINT(Object arg0) {
+         return localizer.localize(localizableSERVLET_ERROR_NO_IMPLEMENTOR_FOR_ENDPOINT(arg0));
+@@ -584,7 +584,7 @@
+ 
+     /**
+      * Context listener shutdown
+-     * 
++     *
+      */
+     public static String WSSERVLET_13_DIAG_CAUSE_1() {
+         return localizer.localize(localizableWSSERVLET_13_DIAG_CAUSE_1());
+@@ -596,7 +596,7 @@
+ 
+     /**
+      * There may some Application Server initialization problems
+-     * 
++     *
+      */
+     public static String WSSERVLET_50_DIAG_CAUSE_3() {
+         return localizer.localize(localizableWSSERVLET_50_DIAG_CAUSE_3());
+@@ -608,7 +608,7 @@
+ 
+     /**
+      * Normal Operation.
+-     * 
++     *
+      */
+     public static String WSSERVLET_32_DIAG_CHECK_1() {
+         return localizer.localize(localizableWSSERVLET_32_DIAG_CHECK_1());
+@@ -620,7 +620,7 @@
+ 
+     /**
+      * Application server deployment descriptors may be incorrect
+-     * 
++     *
+      */
+     public static String WSSERVLET_50_DIAG_CAUSE_2() {
+         return localizer.localize(localizableWSSERVLET_50_DIAG_CAUSE_2());
+@@ -632,7 +632,7 @@
+ 
+     /**
+      * WS runtime sun-jaxws.xml or web.xml may be incorrect
+-     * 
++     *
+      */
+     public static String WSSERVLET_50_DIAG_CAUSE_1() {
+         return localizer.localize(localizableWSSERVLET_50_DIAG_CAUSE_1());
+@@ -644,7 +644,7 @@
+ 
+     /**
+      * ACTIVE
+-     * 
++     *
+      */
+     public static String SERVLET_HTML_STATUS_ACTIVE() {
+         return localizer.localize(localizableSERVLET_HTML_STATUS_ACTIVE());
+@@ -656,7 +656,7 @@
+ 
+     /**
+      * Tracing message, normal response.
+-     * 
++     *
+      */
+     public static String WSSERVLET_25_DIAG_CHECK_1() {
+         return localizer.localize(localizableWSSERVLET_25_DIAG_CHECK_1());
+@@ -668,7 +668,7 @@
+ 
+     /**
+      * Instantiation of the web service failed.
+-     * 
++     *
+      */
+     public static String WSSERVLET_43_DIAG_CAUSE_1() {
+         return localizer.localize(localizableWSSERVLET_43_DIAG_CAUSE_1());
+@@ -680,7 +680,7 @@
+ 
+     /**
+      * Implicit URLS are not supported in this realease
+-     * 
++     *
+      */
+     public static String WSSERVLET_27_DIAG_CAUSE_1() {
+         return localizer.localize(localizableWSSERVLET_27_DIAG_CAUSE_1());
+@@ -692,12 +692,24 @@
+ 
+     /**
+      * WSSERVLET50: caught throwable during servlet initialization: {0}
+-     * 
++     *
+      */
+     public static String ERROR_SERVLET_CAUGHT_THROWABLE_IN_INIT(Object arg0) {
+         return localizer.localize(localizableERROR_SERVLET_CAUGHT_THROWABLE_IN_INIT(arg0));
+     }
+ 
++    public static Localizable localizableSERVLET_HTML_ENDPOINT_TABLE(Object arg0, Object arg1) {
++        return messageFactory.getMessage("servlet.html.endpoint.table", arg0, arg1);
++    }
++
++    /**
++     * <table border="0"><tr><td>Service Name:</td><td>{0}</td></tr><tr><td>Port Name:</td><td>{1}</td></tr></table>
++     *
++     */
++    public static String SERVLET_HTML_ENDPOINT_TABLE(Object arg0, Object arg1) {
++        return localizer.localize(localizableSERVLET_HTML_ENDPOINT_TABLE(arg0, arg1));
++    }
++
+     public static Localizable localizableERROR_SERVLET_CAUGHT_THROWABLE_WHILE_RECOVERING(Object arg0) {
+         return messageFactory.getMessage("error.servlet.caughtThrowableWhileRecovering", arg0);
+     }
+@@ -704,7 +716,7 @@
+ 
+     /**
+      * WSSERVLET51: caught throwable while recovering from a previous exception: {0}
+-     * 
++     *
+      */
+     public static String ERROR_SERVLET_CAUGHT_THROWABLE_WHILE_RECOVERING(Object arg0) {
+         return localizer.localize(localizableERROR_SERVLET_CAUGHT_THROWABLE_WHILE_RECOVERING(arg0));
+@@ -716,7 +728,7 @@
+ 
+     /**
+      * Runtime descriptor "{0}" is mising
+-     * 
++     *
+      */
+     public static String NO_SUNJAXWS_XML(Object arg0) {
+         return localizer.localize(localizableNO_SUNJAXWS_XML(arg0));
+@@ -728,7 +740,7 @@
+ 
+     /**
+      * <h1>Web Services</h1>
+-     * 
++     *
+      */
+     public static String SERVLET_HTML_TITLE_2() {
+         return localizer.localize(localizableSERVLET_HTML_TITLE_2());
+@@ -740,7 +752,7 @@
+ 
+     /**
+      * WSSERVLET13: JAX-WS context listener destroyed
+-     * 
++     *
+      */
+     public static String LISTENER_INFO_DESTROY() {
+         return localizer.localize(localizableLISTENER_INFO_DESTROY());
+@@ -752,7 +764,7 @@
+ 
+     /**
+      * WSSERVLET35: failed to create a template object
+-     * 
++     *
+      */
+     public static String EXCEPTION_TEMPLATE_CREATION_FAILED() {
+         return localizer.localize(localizableEXCEPTION_TEMPLATE_CREATION_FAILED());
+@@ -764,7 +776,7 @@
+ 
+     /**
+      * Implementation for this service can not be found
+-     * 
++     *
+      */
+     public static String WSSERVLET_20_DIAG_CAUSE_1() {
+         return localizer.localize(localizableWSSERVLET_20_DIAG_CAUSE_1());
+@@ -776,7 +788,7 @@
+ 
+     /**
+      * WSSERVLET61: writing fault response
+-     * 
++     *
+      */
+     public static String TRACE_SERVLET_WRITING_FAULT_RESPONSE() {
+         return localizer.localize(localizableTRACE_SERVLET_WRITING_FAULT_RESPONSE());
+@@ -788,7 +800,7 @@
+ 
+     /**
+      * The request may be malformed and be accepted by the service, yet did not generate a response
+-     * 
++     *
+      */
+     public static String WSSERVLET_23_DIAG_CHECK_2() {
+         return localizer.localize(localizableWSSERVLET_23_DIAG_CHECK_2());
+@@ -800,7 +812,7 @@
+ 
+     /**
+      * If a response was expected, check that a request message was actually sent
+-     * 
++     *
+      */
+     public static String WSSERVLET_23_DIAG_CHECK_1() {
+         return localizer.localize(localizableWSSERVLET_23_DIAG_CHECK_1());
+@@ -812,7 +824,7 @@
+ 
+     /**
+      * WSSERVLET16: missing context information
+-     * 
++     *
+      */
+     public static String SERVLET_WARNING_MISSING_CONTEXT_INFORMATION() {
+         return localizer.localize(localizableSERVLET_WARNING_MISSING_CONTEXT_INFORMATION());
+@@ -824,7 +836,7 @@
+ 
+     /**
+      * Unjar the service war file; check to see that the jaxrpc-ri-runtime.xml file is present
+-     * 
++     *
+      */
+     public static String WSSERVLET_16_DIAG_CHECK_1() {
+         return localizer.localize(localizableWSSERVLET_16_DIAG_CHECK_1());
+@@ -836,7 +848,7 @@
+ 
+     /**
+      * The location patching on the wsdl failed when attempting to transform.
+-     * 
++     *
+      */
+     public static String WSSERVLET_34_DIAG_CAUSE_1() {
+         return localizer.localize(localizableWSSERVLET_34_DIAG_CAUSE_1());
+@@ -848,7 +860,7 @@
+ 
+     /**
+      * Web Service
+-     * 
++     *
+      */
+     public static String HTML_NON_ROOT_PAGE_TITLE() {
+         return localizer.localize(localizableHTML_NON_ROOT_PAGE_TITLE());
+@@ -860,7 +872,7 @@
+ 
+     /**
+      * Information
+-     * 
++     *
+      */
+     public static String SERVLET_HTML_COLUMN_HEADER_INFORMATION() {
+         return localizer.localize(localizableSERVLET_HTML_COLUMN_HEADER_INFORMATION());
+@@ -872,7 +884,7 @@
+ 
+     /**
+      * Message sent by client is empty
+-     * 
++     *
+      */
+     public static String WSSERVLET_18_DIAG_CAUSE_1() {
+         return localizer.localize(localizableWSSERVLET_18_DIAG_CAUSE_1());
+@@ -884,7 +896,7 @@
+ 
+     /**
+      * Web service requests must be a content type text/xml: WSI BP 1.0
+-     * 
++     *
+      */
+     public static String WSSERVLET_64_DIAG_CAUSE_1() {
+         return localizer.localize(localizableWSSERVLET_64_DIAG_CAUSE_1());
+@@ -896,7 +908,7 @@
+ 
+     /**
+      * WSSERVLET56: JAX-WS servlet: init
+-     * 
++     *
+      */
+     public static String INFO_SERVLET_INITIALIZING() {
+         return localizer.localize(localizableINFO_SERVLET_INITIALIZING());
+@@ -908,7 +920,7 @@
+ 
+     /**
+      * WSSERVLET18: got empty request message
+-     * 
++     *
+      */
+     public static String SERVLET_INFO_EMPTY_REQUEST_MESSAGE() {
+         return localizer.localize(localizableSERVLET_INFO_EMPTY_REQUEST_MESSAGE());
+@@ -920,7 +932,7 @@
+ 
+     /**
+      * WSSERVLET22: no endpoint specified
+-     * 
++     *
+      */
+     public static String SERVLET_ERROR_NO_ENDPOINT_SPECIFIED() {
+         return localizer.localize(localizableSERVLET_ERROR_NO_ENDPOINT_SPECIFIED());
+@@ -932,7 +944,7 @@
+ 
+     /**
+      * The sun-jaxws.xml runtime deployment descriptor may be missing
+-     * 
++     *
+      */
+     public static String WSSERVLET_11_DIAG_CAUSE_2() {
+         return localizer.localize(localizableWSSERVLET_11_DIAG_CAUSE_2());
+@@ -944,7 +956,7 @@
+ 
+     /**
+      * This could be due to a number of causes. Check the server log file for exceptions.
+-     * 
++     *
+      */
+     public static String WSSERVLET_30_DIAG_CHECK_1() {
+         return localizer.localize(localizableWSSERVLET_30_DIAG_CHECK_1());
+@@ -956,7 +968,7 @@
+ 
+     /**
+      * WSSERVLET33: cannot create transformer
+-     * 
++     *
+      */
+     public static String EXCEPTION_CANNOT_CREATE_TRANSFORMER() {
+         return localizer.localize(localizableEXCEPTION_CANNOT_CREATE_TRANSFORMER());
+@@ -968,7 +980,7 @@
+ 
+     /**
+      * WSSERVLET65: Invalid Header SOAPAction required
+-     * 
++     *
+      */
+     public static String SERVLET_FAULTSTRING_INVALID_SOAP_ACTION() {
+         return localizer.localize(localizableSERVLET_FAULTSTRING_INVALID_SOAP_ACTION());
+@@ -980,7 +992,7 @@
+ 
+     /**
+      * '>here.</a></p>
+-     * 
++     *
+      */
+     public static String HTML_ROOT_PAGE_BODY_3_B() {
+         return localizer.localize(localizableHTML_ROOT_PAGE_BODY_3_B());
+@@ -992,7 +1004,7 @@
+ 
+     /**
+      * <p>A WSDL description of these ports is available <a href='
+-     * 
++     *
+      */
+     public static String HTML_ROOT_PAGE_BODY_3_A() {
+         return localizer.localize(localizableHTML_ROOT_PAGE_BODY_3_A());
+@@ -1004,7 +1016,7 @@
+ 
+     /**
+      * Normal Web Service deployment. Deployment of service complete.
+-     * 
++     *
+      */
+     public static String WSSERVLET_14_DIAG_CHECK_1() {
+         return localizer.localize(localizableWSSERVLET_14_DIAG_CHECK_1());
+@@ -1016,7 +1028,7 @@
+ 
+     /**
+      * WSDL being generated
+-     * 
++     *
+      */
+     public static String WSSERVLET_32_DIAG_CAUSE_1() {
+         return localizer.localize(localizableWSSERVLET_32_DIAG_CAUSE_1());
+@@ -1028,7 +1040,7 @@
+ 
+     /**
+      * SOAPMessage response is being returned to client
+-     * 
++     *
+      */
+     public static String WSSERVLET_25_DIAG_CAUSE_1() {
+         return localizer.localize(localizableWSSERVLET_25_DIAG_CAUSE_1());
+@@ -1040,7 +1052,7 @@
+ 
+     /**
+      * Check the exception for more details. Make sure all the configuration files are correct.
+-     * 
++     *
+      */
+     public static String WSSERVLET_44_DIAG_CHECK_1() {
+         return localizer.localize(localizableWSSERVLET_44_DIAG_CHECK_1());
+@@ -1052,7 +1064,7 @@
+ 
+     /**
+      * Set target endpoint with stub.setTargetEndpoint() property.
+-     * 
++     *
+      */
+     public static String WSSERVLET_28_DIAG_CHECK_1() {
+         return localizer.localize(localizableWSSERVLET_28_DIAG_CHECK_1());
+@@ -1064,7 +1076,7 @@
+ 
+     /**
+      * WSSERVLET14: JAX-WS servlet initializing
+-     * 
++     *
+      */
+     public static String SERVLET_INFO_INITIALIZE() {
+         return localizer.localize(localizableSERVLET_INFO_INITIALIZE());
+@@ -1076,7 +1088,7 @@
+ 
+     /**
+      * WSSERVLET48: config file: "{0}" not found
+-     * 
++     *
+      */
+     public static String ERROR_SERVLET_INIT_CONFIG_FILE_NOT_FOUND(Object arg0) {
+         return localizer.localize(localizableERROR_SERVLET_INIT_CONFIG_FILE_NOT_FOUND(arg0));
+@@ -1088,7 +1100,7 @@
+ 
+     /**
+      * Web Service
+-     * 
++     *
+      */
+     public static String HTML_WSDL_PAGE_TITLE() {
+         return localizer.localize(localizableHTML_WSDL_PAGE_TITLE());
+@@ -1099,8 +1111,8 @@
+     }
+ 
+     /**
+-     * Port Name
+-     * 
++     * Endpoint
++     *
+      */
+     public static String SERVLET_HTML_COLUMN_HEADER_PORT_NAME() {
+         return localizer.localize(localizableSERVLET_HTML_COLUMN_HEADER_PORT_NAME());
+@@ -1112,7 +1124,7 @@
+ 
+     /**
+      * </p>
+-     * 
++     *
+      */
+     public static String HTML_ROOT_PAGE_BODY_2_B() {
+         return localizer.localize(localizableHTML_ROOT_PAGE_BODY_2_B());
+@@ -1124,7 +1136,7 @@
+ 
+     /**
+      * <p>It supports the following ports:
+-     * 
++     *
+      */
+     public static String HTML_ROOT_PAGE_BODY_2_A() {
+         return localizer.localize(localizableHTML_ROOT_PAGE_BODY_2_A());
+@@ -1136,7 +1148,7 @@
+ 
+     /**
+      * Normal web service invocation.
+-     * 
++     *
+      */
+     public static String WSSERVLET_21_DIAG_CHECK_1() {
+         return localizer.localize(localizableWSSERVLET_21_DIAG_CHECK_1());
+@@ -1148,7 +1160,7 @@
+ 
+     /**
+      * WSSERVLET53: no port specified in HTTP POST request URL
+-     * 
++     *
+      */
+     public static String ERROR_SERVLET_NO_PORT_SPECIFIED() {
+         return localizer.localize(localizableERROR_SERVLET_NO_PORT_SPECIFIED());
+@@ -1160,7 +1172,7 @@
+ 
+     /**
+      * WSSERVLET55: got empty request message
+-     * 
++     *
+      */
+     public static String INFO_SERVLET_GOT_EMPTY_REQUEST_MESSAGE() {
+         return localizer.localize(localizableINFO_SERVLET_GOT_EMPTY_REQUEST_MESSAGE());
+@@ -1172,7 +1184,7 @@
+ 
+     /**
+      * Check the server.xml log file for exception information
+-     * 
++     *
+      */
+     public static String WSSERVLET_51_DIAG_CHECK_1() {
+         return localizer.localize(localizableWSSERVLET_51_DIAG_CHECK_1());
+@@ -1184,7 +1196,7 @@
+ 
+     /**
+      * The request generated no response from the service
+-     * 
++     *
+      */
+     public static String WSSERVLET_23_DIAG_CAUSE_1() {
+         return localizer.localize(localizableWSSERVLET_23_DIAG_CAUSE_1());
+@@ -1196,7 +1208,7 @@
+ 
+     /**
+      * The jaxrpc-ri.xml file may be missing from the war file
+-     * 
++     *
+      */
+     public static String WSSERVLET_16_DIAG_CAUSE_1() {
+         return localizer.localize(localizableWSSERVLET_16_DIAG_CAUSE_1());
+@@ -1208,7 +1220,7 @@
+ 
+     /**
+      * An exception was thrown during creation of the template. View exception and stacktrace for more details.
+-     * 
++     *
+      */
+     public static String WSSERVLET_35_DIAG_CHECK_1() {
+         return localizer.localize(localizableWSSERVLET_35_DIAG_CHECK_1());
+@@ -1220,7 +1232,7 @@
+ 
+     /**
+      * Add SOAPAction and appropriate value
+-     * 
++     *
+      */
+     public static String WSSERVLET_65_DIAG_CHECK_1() {
+         return localizer.localize(localizableWSSERVLET_65_DIAG_CHECK_1());
+@@ -1232,7 +1244,7 @@
+ 
+     /**
+      * WSSERVLET59: handing request over to implementor: {0}
+-     * 
++     *
+      */
+     public static String TRACE_SERVLET_HANDING_REQUEST_OVER_TO_IMPLEMENTOR(Object arg0) {
+         return localizer.localize(localizableTRACE_SERVLET_HANDING_REQUEST_OVER_TO_IMPLEMENTOR(arg0));
+@@ -1244,7 +1256,7 @@
+ 
+     /**
+      * Informational message only. Normal operation.
+-     * 
++     *
+      */
+     public static String WSSERVLET_19_DIAG_CHECK_1() {
+         return localizer.localize(localizableWSSERVLET_19_DIAG_CHECK_1());
+@@ -1256,7 +1268,7 @@
+ 
+     /**
+      * WSSERVLET32: generating WSDL for endpoint: {0}
+-     * 
++     *
+      */
+     public static String PUBLISHER_INFO_GENERATING_WSDL(Object arg0) {
+         return localizer.localize(localizablePUBLISHER_INFO_GENERATING_WSDL(arg0));
+@@ -1268,7 +1280,7 @@
+ 
+     /**
+      * WSSERVLET26: duplicate URL pattern in endpoint: {0}
+-     * 
++     *
+      */
+     public static String SERVLET_WARNING_DUPLICATE_ENDPOINT_URL_PATTERN(Object arg0) {
+         return localizer.localize(localizableSERVLET_WARNING_DUPLICATE_ENDPOINT_URL_PATTERN(arg0));
+@@ -1280,7 +1292,7 @@
+ 
+     /**
+      * '>this page</a> for information about the deployed services.</p>
+-     * 
++     *
+      */
+     public static String HTML_NON_ROOT_PAGE_BODY_3_B() {
+         return localizer.localize(localizableHTML_NON_ROOT_PAGE_BODY_3_B());
+@@ -1292,7 +1304,7 @@
+ 
+     /**
+      * Check the server.xml log file for exception information
+-     * 
++     *
+      */
+     public static String WSSERVLET_49_DIAG_CHECK_1() {
+         return localizer.localize(localizableWSSERVLET_49_DIAG_CHECK_1());
+@@ -1304,7 +1316,7 @@
+ 
+     /**
+      * <p>Please refer to <a href='
+-     * 
++     *
+      */
+     public static String HTML_NON_ROOT_PAGE_BODY_3_A() {
+         return localizer.localize(localizableHTML_NON_ROOT_PAGE_BODY_3_A());
+@@ -1316,7 +1328,7 @@
+ 
+     /**
+      * WSSERVLET39: cannot read configuration
+-     * 
++     *
+      */
+     public static String ERROR_IMPLEMENTOR_REGISTRY_CANNOT_READ_CONFIGURATION() {
+         return localizer.localize(localizableERROR_IMPLEMENTOR_REGISTRY_CANNOT_READ_CONFIGURATION());
+@@ -1328,7 +1340,7 @@
+ 
+     /**
+      * WSSERVLET60: got response from implementor: {0}
+-     * 
++     *
+      */
+     public static String TRACE_SERVLET_GOT_RESPONSE_FROM_IMPLEMENTOR(Object arg0) {
+         return localizer.localize(localizableTRACE_SERVLET_GOT_RESPONSE_FROM_IMPLEMENTOR(arg0));
+@@ -1340,7 +1352,7 @@
+ 
+     /**
+      * WSSERVLET41: configuration information is incomplete
+-     * 
++     *
+      */
+     public static String ERROR_IMPLEMENTOR_REGISTRY_INCOMPLETE_INFORMATION() {
+         return localizer.localize(localizableERROR_IMPLEMENTOR_REGISTRY_INCOMPLETE_INFORMATION());
+@@ -1352,7 +1364,7 @@
+ 
+     /**
+      * Normal web service startup
+-     * 
++     *
+      */
+     public static String WSSERVLET_12_DIAG_CHECK_1() {
+         return localizer.localize(localizableWSSERVLET_12_DIAG_CHECK_1());
+@@ -1364,7 +1376,7 @@
+ 
+     /**
+      * There was a server error processing the request
+-     * 
++     *
+      */
+     public static String WSSERVLET_30_DIAG_CAUSE_1() {
+         return localizer.localize(localizableWSSERVLET_30_DIAG_CAUSE_1());
+@@ -1376,7 +1388,7 @@
+ 
+     /**
+      * <p>No WSDL document available for publishing.</p><p>Please check your deployment information.</p>
+-     * 
++     *
+      */
+     public static String HTML_WSDL_PAGE_NO_WSDL() {
+         return localizer.localize(localizableHTML_WSDL_PAGE_NO_WSDL());
+@@ -1388,7 +1400,7 @@
+ 
+     /**
+      * Web Services servlet starting up.
+-     * 
++     *
+      */
+     public static String WSSERVLET_14_DIAG_CAUSE_1() {
+         return localizer.localize(localizableWSSERVLET_14_DIAG_CAUSE_1());
+@@ -1400,7 +1412,7 @@
+ 
+     /**
+      * WSSERVLET57: JAX-WS servlet: destroy
+-     * 
++     *
+      */
+     public static String INFO_SERVLET_DESTROYING() {
+         return localizer.localize(localizableINFO_SERVLET_DESTROYING());
+@@ -1412,7 +1424,7 @@
+ 
+     /**
+      * WSSERVLET54: no response was produced (internal error)
+-     * 
++     *
+      */
+     public static String ERROR_SERVLET_NO_RESPONSE_WAS_PRODUCED() {
+         return localizer.localize(localizableERROR_SERVLET_NO_RESPONSE_WAS_PRODUCED());
+@@ -1424,7 +1436,7 @@
+ 
+     /**
+      * This may cause a problem, please remove duplicate endpoints
+-     * 
++     *
+      */
+     public static String WSSERVLET_26_DIAG_CHECK_1() {
+         return localizer.localize(localizableWSSERVLET_26_DIAG_CHECK_1());
+@@ -1436,7 +1448,7 @@
+ 
+     /**
+      * Web Services
+-     * 
++     *
+      */
+     public static String SERVLET_HTML_TITLE() {
+         return localizer.localize(localizableSERVLET_HTML_TITLE());
+@@ -1448,7 +1460,7 @@
+ 
+     /**
+      * The web service was instantiated, however, it could not be initialized
+-     * 
++     *
+      */
+     public static String WSSERVLET_44_DIAG_CAUSE_1() {
+         return localizer.localize(localizableWSSERVLET_44_DIAG_CAUSE_1());
+@@ -1460,7 +1472,7 @@
+ 
+     /**
+      * Make sure that your HTTP client is using POST requests, not GET requests
+-     * 
++     *
+      */
+     public static String WSSERVLET_63_DIAG_CHECK_1() {
+         return localizer.localize(localizableWSSERVLET_63_DIAG_CHECK_1());
+@@ -1472,7 +1484,7 @@
+ 
+     /**
+      * Target endpoint is null
+-     * 
++     *
+      */
+     public static String WSSERVLET_28_DIAG_CAUSE_1() {
+         return localizer.localize(localizableWSSERVLET_28_DIAG_CAUSE_1());
+@@ -1484,7 +1496,7 @@
+ 
+     /**
+      * WSSERVLET36: no configuration specified
+-     * 
++     *
+      */
+     public static String ERROR_IMPLEMENTOR_FACTORY_NO_CONFIGURATION() {
+         return localizer.localize(localizableERROR_IMPLEMENTOR_FACTORY_NO_CONFIGURATION());
+@@ -1496,7 +1508,7 @@
+ 
+     /**
+      * <p>This endpoint is incorrectly configured. Please check the location and contents of the configuration file.</p>
+-     * 
++     *
+      */
+     public static String HTML_ROOT_PAGE_BODY_4() {
+         return localizer.localize(localizableHTML_ROOT_PAGE_BODY_4());
+@@ -1508,7 +1520,7 @@
+ 
+     /**
+      * <p>A Web Service is installed at this URL.</p>
+-     * 
++     *
+      */
+     public static String HTML_ROOT_PAGE_BODY_1() {
+         return localizer.localize(localizableHTML_ROOT_PAGE_BODY_1());
+@@ -1520,7 +1532,7 @@
+ 
+     /**
+      * WSSERVLET34: transformation failed : {0}
+-     * 
++     *
+      */
+     public static String EXCEPTION_TRANSFORMATION_FAILED(Object arg0) {
+         return localizer.localize(localizableEXCEPTION_TRANSFORMATION_FAILED(arg0));
+@@ -1532,7 +1544,7 @@
+ 
+     /**
+      * WSSERVLET63: must use Post for this type of request
+-     * 
++     *
+      */
+     public static String SERVLET_HTML_METHOD() {
+         return localizer.localize(localizableSERVLET_HTML_METHOD());
+@@ -1544,7 +1556,7 @@
+ 
+     /**
+      * WSSERVLET28: Missing port information
+-     * 
++     *
+      */
+     public static String SERVLET_FAULTSTRING_MISSING_PORT() {
+         return localizer.localize(localizableSERVLET_FAULTSTRING_MISSING_PORT());
+@@ -1556,7 +1568,7 @@
+ 
+     /**
+      * The Web service is being invoked
+-     * 
++     *
+      */
+     public static String WSSERVLET_21_DIAG_CAUSE_1() {
+         return localizer.localize(localizableWSSERVLET_21_DIAG_CAUSE_1());
+@@ -1568,7 +1580,7 @@
+ 
+     /**
+      * WSSERVLET25: writing success response
+-     * 
++     *
+      */
+     public static String SERVLET_TRACE_WRITING_SUCCESS_RESPONSE() {
+         return localizer.localize(localizableSERVLET_TRACE_WRITING_SUCCESS_RESPONSE());
+@@ -1580,7 +1592,7 @@
+ 
+     /**
+      * There maybe a tranformation engine may not be supported or compatible. Check the server.xml file for exceptions.
+-     * 
++     *
+      */
+     public static String WSSERVLET_33_DIAG_CHECK_2() {
+         return localizer.localize(localizableWSSERVLET_33_DIAG_CHECK_2());
+@@ -1592,7 +1604,7 @@
+ 
+     /**
+      * There maybe a tranformation engine being used that is not compatible. Make sure you are using the correct transformer and version.
+-     * 
++     *
+      */
+     public static String WSSERVLET_33_DIAG_CHECK_1() {
+         return localizer.localize(localizableWSSERVLET_33_DIAG_CHECK_1());
+@@ -1604,7 +1616,7 @@
+ 
+     /**
+      * Service processing of the request generated an exception; while attempting to return a SOAPPFaultMessage a thowable was again generated
+-     * 
++     *
+      */
+     public static String WSSERVLET_51_DIAG_CAUSE_1() {
+         return localizer.localize(localizableWSSERVLET_51_DIAG_CAUSE_1());
+@@ -1616,7 +1628,7 @@
+ 
+     /**
+      * Tracing message fault recorded.
+-     * 
++     *
+      */
+     public static String WSSERVLET_24_DIAG_CHECK_1() {
+         return localizer.localize(localizableWSSERVLET_24_DIAG_CHECK_1());
+@@ -1628,7 +1640,7 @@
+ 
+     /**
+      * Note that this may cause problems with service deployment
+-     * 
++     *
+      */
+     public static String WSSERVLET_17_DIAG_CHECK_1() {
+         return localizer.localize(localizableWSSERVLET_17_DIAG_CHECK_1());
+@@ -1640,7 +1652,7 @@
+ 
+     /**
+      * A XSLT stylesheet template is create for the wsdl location patching using transformation. Template create failed.
+-     * 
++     *
+      */
+     public static String WSSERVLET_35_DIAG_CAUSE_1() {
+         return localizer.localize(localizableWSSERVLET_35_DIAG_CAUSE_1());
+@@ -1652,7 +1664,7 @@
+ 
+     /**
+      * Client request for this endpoint arrived
+-     * 
++     *
+      */
+     public static String WSSERVLET_19_DIAG_CAUSE_1() {
+         return localizer.localize(localizableWSSERVLET_19_DIAG_CAUSE_1());
+@@ -1664,7 +1676,7 @@
+ 
+     /**
+      * SOAP Action is required
+-     * 
++     *
+      */
+     public static String WSSERVLET_65_DIAG_CAUSE_1() {
+         return localizer.localize(localizableWSSERVLET_65_DIAG_CAUSE_1());
+@@ -1676,7 +1688,7 @@
+ 
+     /**
+      * WSSERVLET11: failed to parse runtime descriptor: {0}
+-     * 
++     *
+      */
+     public static String LISTENER_PARSING_FAILED(Object arg0) {
+         return localizer.localize(localizableLISTENER_PARSING_FAILED(arg0));
+@@ -1688,7 +1700,7 @@
+ 
+     /**
+      * WSSERVLET27: unsupported implicit URL pattern in endpoint: {0}
+-     * 
++     *
+      */
+     public static String SERVLET_WARNING_IGNORING_IMPLICIT_URL_PATTERN(Object arg0) {
+         return localizer.localize(localizableSERVLET_WARNING_IGNORING_IMPLICIT_URL_PATTERN(arg0));
+@@ -1700,7 +1712,7 @@
+ 
+     /**
+      * Service processing of the request generated an exception; while attempting to return a SOAPFaultMessage a thowable was again generated
+-     * 
++     *
+      */
+     public static String WSSERVLET_49_DIAG_CAUSE_1() {
+         return localizer.localize(localizableWSSERVLET_49_DIAG_CAUSE_1());
+@@ -1712,7 +1724,7 @@
+ 
+     /**
+      * WSSERVLET43: failed to instantiate service implementor for port "{0}"
+-     * 
++     *
+      */
+     public static String ERROR_IMPLEMENTOR_FACTORY_NEW_INSTANCE_FAILED(Object arg0) {
+         return localizer.localize(localizableERROR_IMPLEMENTOR_FACTORY_NEW_INSTANCE_FAILED(arg0));
+@@ -1724,7 +1736,7 @@
+ 
+     /**
+      * Context listener starting
+-     * 
++     *
+      */
+     public static String WSSERVLET_12_DIAG_CAUSE_1() {
+         return localizer.localize(localizableWSSERVLET_12_DIAG_CAUSE_1());
+@@ -1736,7 +1748,7 @@
+ 
+     /**
+      * Normal operation
+-     * 
++     *
+      */
+     public static String WSSERVLET_31_DIAG_CHECK_1() {
+         return localizer.localize(localizableWSSERVLET_31_DIAG_CHECK_1());
+@@ -1748,7 +1760,7 @@
+ 
+     /**
+      * WSSERVLET64: Invalid Content-Type, text/xml required
+-     * 
++     *
+      */
+     public static String SERVLET_FAULTSTRING_INVALID_CONTENT_TYPE() {
+         return localizer.localize(localizableSERVLET_FAULTSTRING_INVALID_CONTENT_TYPE());
+@@ -1760,7 +1772,7 @@
+ 
+     /**
+      * WSSERVLET49: caught throwable: {0}
+-     * 
++     *
+      */
+     public static String ERROR_SERVLET_CAUGHT_THROWABLE(Object arg0) {
+         return localizer.localize(localizableERROR_SERVLET_CAUGHT_THROWABLE(arg0));
+@@ -1772,7 +1784,7 @@
+ 
+     /**
+      * WSSERVLET62: writing success response
+-     * 
++     *
+      */
+     public static String TRACE_SERVLET_WRITING_SUCCESS_RESPONSE() {
+         return localizer.localize(localizableTRACE_SERVLET_WRITING_SUCCESS_RESPONSE());
+@@ -1784,7 +1796,7 @@
+ 
+     /**
+      * WSSERVLET40: class not found: {0}
+-     * 
++     *
+      */
+     public static String ERROR_IMPLEMENTOR_REGISTRY_CLASS_NOT_FOUND(Object arg0) {
+         return localizer.localize(localizableERROR_IMPLEMENTOR_REGISTRY_CLASS_NOT_FOUND(arg0));
+@@ -1796,7 +1808,7 @@
+ 
+     /**
+      * Normal Web service undeployment. Undeployment complete.
+-     * 
++     *
+      */
+     public static String WSSERVLET_15_DIAG_CHECK_1() {
+         return localizer.localize(localizableWSSERVLET_15_DIAG_CHECK_1());
+@@ -1808,7 +1820,7 @@
+ 
+     /**
+      * WSSERVLET29: Port not found ({0})
+-     * 
++     *
+      */
+     public static String SERVLET_FAULTSTRING_PORT_NOT_FOUND(Object arg0) {
+         return localizer.localize(localizableSERVLET_FAULTSTRING_PORT_NOT_FOUND(arg0));
+@@ -1820,7 +1832,7 @@
+ 
+     /**
+      * WSSERVLET15: JAX-WS servlet destroyed
+-     * 
++     *
+      */
+     public static String SERVLET_INFO_DESTROY() {
+         return localizer.localize(localizableSERVLET_INFO_DESTROY());
+@@ -1832,7 +1844,7 @@
+ 
+     /**
+      * WSSERVLET30: Internal server error ({0})
+-     * 
++     *
+      */
+     public static String SERVLET_FAULTSTRING_INTERNAL_SERVER_ERROR(Object arg0) {
+         return localizer.localize(localizableSERVLET_FAULTSTRING_INTERNAL_SERVER_ERROR(arg0));
+@@ -1844,7 +1856,7 @@
+ 
+     /**
+      * The endpoint URL is a duplicate
+-     * 
++     *
+      */
+     public static String WSSERVLET_26_DIAG_CAUSE_1() {
+         return localizer.localize(localizableWSSERVLET_26_DIAG_CAUSE_1());
+@@ -1856,7 +1868,7 @@
+ 
+     /**
+      * Status
+-     * 
++     *
+      */
+     public static String SERVLET_HTML_COLUMN_HEADER_STATUS() {
+         return localizer.localize(localizableSERVLET_HTML_COLUMN_HEADER_STATUS());
+@@ -1868,7 +1880,7 @@
+ 
+     /**
+      * Web service requests must use HTTP POST method: WSI BP 1.0
+-     * 
++     *
+      */
+     public static String WSSERVLET_63_DIAG_CAUSE_1() {
+         return localizer.localize(localizableWSSERVLET_63_DIAG_CAUSE_1());
+@@ -1880,7 +1892,7 @@
+ 
+     /**
+      * WSSERVLET17: duplicate endpoint name
+-     * 
++     *
+      */
+     public static String SERVLET_WARNING_DUPLICATE_ENDPOINT_NAME() {
+         return localizer.localize(localizableSERVLET_WARNING_DUPLICATE_ENDPOINT_NAME());
+@@ -1892,7 +1904,7 @@
+ 
+     /**
+      * WSSERVLET58: got request for port: {0}
+-     * 
++     *
+      */
+     public static String TRACE_SERVLET_REQUEST_FOR_PORT_NAMED(Object arg0) {
+         return localizer.localize(localizableTRACE_SERVLET_REQUEST_FOR_PORT_NAMED(arg0));
+@@ -1904,7 +1916,7 @@
+ 
+     /**
+      * No address is available for {0}
+-     * 
++     *
+      */
+     public static String SERVLET_NO_ADDRESS_AVAILABLE(Object arg0) {
+         return localizer.localize(localizableSERVLET_NO_ADDRESS_AVAILABLE(arg0));
+--- old/src/share/classes/com/sun/xml/internal/ws/resources/XmlmessageMessages.java	Thu Jul 30 18:32:50 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/XmlmessageMessages.java	Thu Jul 30 18:32:50 2009
+@@ -31,7 +31,7 @@
+ 
+ /**
+  * Defines string formatting method for each constant in the resource file
+- * 
++ *
+  */
+ public final class XmlmessageMessages {
+ 
+@@ -44,7 +44,7 @@
+ 
+     /**
+      * Invalid argument. MimeHeaders=null
+-     * 
++     *
+      */
+     public static String XML_NULL_HEADERS() {
+         return localizer.localize(localizableXML_NULL_HEADERS());
+@@ -56,7 +56,7 @@
+ 
+     /**
+      * Couldn't set Payload in XMLMessage
+-     * 
++     *
+      */
+     public static String XML_SET_PAYLOAD_ERR() {
+         return localizer.localize(localizableXML_SET_PAYLOAD_ERR());
+@@ -68,7 +68,7 @@
+ 
+     /**
+      * Content-Type needs to be Multipart/Related and with type=text/xml
+-     * 
++     *
+      */
+     public static String XML_CONTENT_TYPE_MUSTBE_MULTIPART() {
+         return localizer.localize(localizableXML_CONTENT_TYPE_MUSTBE_MULTIPART());
+@@ -80,7 +80,7 @@
+ 
+     /**
+      * Unrecognized Content-Type
+-     * 
++     *
+      */
+     public static String XML_UNKNOWN_CONTENT_TYPE() {
+         return localizer.localize(localizableXML_UNKNOWN_CONTENT_TYPE());
+@@ -92,7 +92,7 @@
+ 
+     /**
+      * Couldn't get DataSource
+-     * 
++     *
+      */
+     public static String XML_GET_DS_ERR() {
+         return localizer.localize(localizableXML_GET_DS_ERR());
+@@ -104,7 +104,7 @@
+ 
+     /**
+      * Error while parsing MimeHeaders for Content-Type
+-     * 
++     *
+      */
+     public static String XML_CONTENT_TYPE_PARSE_ERR() {
+         return localizer.localize(localizableXML_CONTENT_TYPE_PARSE_ERR());
+@@ -116,7 +116,7 @@
+ 
+     /**
+      * Couldn't return Source
+-     * 
++     *
+      */
+     public static String XML_GET_SOURCE_ERR() {
+         return localizer.localize(localizableXML_GET_SOURCE_ERR());
+@@ -128,7 +128,7 @@
+ 
+     /**
+      * Cannot create XMLMessage
+-     * 
++     *
+      */
+     public static String XML_CANNOT_INTERNALIZE_MESSAGE() {
+         return localizer.localize(localizableXML_CANNOT_INTERNALIZE_MESSAGE());
+@@ -140,7 +140,7 @@
+ 
+     /**
+      * MimeHeaders doesn't contain Content-Type header
+-     * 
++     *
+      */
+     public static String XML_NO_CONTENT_TYPE() {
+         return localizer.localize(localizableXML_NO_CONTENT_TYPE());
+@@ -152,7 +152,7 @@
+ 
+     /**
+      * Bad Content-Type for Root Part : {0}
+-     * 
++     *
+      */
+     public static String XML_ROOT_PART_INVALID_CONTENT_TYPE(Object arg0) {
+         return localizer.localize(localizableXML_ROOT_PART_INVALID_CONTENT_TYPE(arg0));
+@@ -164,7 +164,7 @@
+ 
+     /**
+      * Invalid Content-Type: {0}
+-     * 
++     *
+      */
+     public static String XML_INVALID_CONTENT_TYPE(Object arg0) {
+         return localizer.localize(localizableXML_INVALID_CONTENT_TYPE(arg0));
+--- old/src/share/classes/com/sun/xml/internal/ws/resources/addressing.properties	Thu Jul 30 18:32:54 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/addressing.properties	Thu Jul 30 18:32:53 2009
+@@ -41,6 +41,7 @@
+ null.headers=No headers found when processing the server inbound request and WS-Addressing is required
+ null.wsa.headers=No WS-Addressing headers found processing the server inbound request
+ addressing.notEnabled=Addressing is not enabled, {0} should not be included in the pipeline"
++addressing.should.be.enabled.=Addressing is not enabled
+ validation.client.nullAction=Validating inbound Addressing headers on client and found null Action
+ validation.server.nullAction=Validating inbound Addressing headers on server and found null Action
+ 
+@@ -50,4 +51,7 @@
+ nonAnonymous.response.nullHeaders=No response headers found in non-anonymous response from "{0}"
+ nonAnonymous.response.nullMessage=No message for non-anonymous response from "{0}"
+ nonAnonymous.response.oneway=Ignoring non-anonymous response for one-way message
+- 
++
++invalid.addressing.header.exception=Invalid WS-Addressing header: "{0}",Reason: "{1}"
++action.not.supported.exception=Action: "{0}" not supported
++missing.header.exception=Missing WS-Addressing header: "{0}"
+--- old/src/share/classes/com/sun/xml/internal/ws/resources/client.properties	Thu Jul 30 18:32:57 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/client.properties	Thu Jul 30 18:32:57 2009
+@@ -51,4 +51,4 @@
+   Use BindingProvider.SOAPACTION_URI_PROPERTY to set it.
+ failed.to.parseWithMEX=Failed to access the WSDL at: {0}. It failed with: \n\t{1}.\nRetrying with MEX gave: \n\t{2}
+ failed.to.parse=Failed to access the WSDL at: {0}. It failed with: \n\t{1}.
+- 
++wsdl.contains.no.service=WSDL {0} contains no service definition.
+--- old/src/share/classes/com/sun/xml/internal/ws/resources/dispatch.properties	Thu Jul 30 18:33:01 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/dispatch.properties	Thu Jul 30 18:33:00 2009
+@@ -39,4 +39,3 @@
+ duplicate.port=WSDLPort {0} already exists. Can not create a port of the same QName.
+ invalid.query.leading.char=Leading '?' of MessageContext.QUERY_STRING: {0} is not valid. Remove '?' and run again.
+ duplicate.port=WSDLPort {0} already exists. Can not create a port of the same QName.
+- 
+--- old/src/share/classes/com/sun/xml/internal/ws/resources/encoding.properties	Thu Jul 30 18:33:04 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/encoding.properties	Thu Jul 30 18:33:04 2009
+@@ -39,4 +39,3 @@
+ xsd.unexpectedElementName=unexpected element name: expected={0}, actual: {1}
+ 
+ failed.to.read.response=Failed to read a response: {0}
+- 
+--- old/src/share/classes/com/sun/xml/internal/ws/resources/handler.properties	Thu Jul 30 18:33:08 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/handler.properties	Thu Jul 30 18:33:07 2009
+@@ -30,4 +30,3 @@
+ handler.not.valid.type= {0} does not implement one of the handler interfaces.
+ handler.messageContext.invalid.class= \"{0}\" is not an allowed value for the property \"{1}\"
+ handler.predestroy.ignore=Exception ignored from invoking handler @PreDestroy method: {0}
+- 
+--- old/src/share/classes/com/sun/xml/internal/ws/resources/httpserver.properties	Thu Jul 30 18:33:11 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/httpserver.properties	Thu Jul 30 18:33:11 2009
+@@ -24,4 +24,3 @@
+ #
+ 
+ unexpected.http.method=Cannot handle HTTP method: {0}
+- 
+--- old/src/share/classes/com/sun/xml/internal/ws/resources/modeler.properties	Thu Jul 30 18:33:15 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/modeler.properties	Thu Jul 30 18:33:14 2009
+@@ -31,7 +31,8 @@
+ runtime.modeler.wrapper.not.found=Wrapper class {0} is not found. Have you run APT to generate them?
+ runtime.modeler.method.not.found=method: {0} could not be found on class: {1}
+ runtime.modeler.webmethod.must.be.public=@WebMethod is not allowed on a non-public method {0}
+-runtime.modeler.webmethod.must.be.nonstatic=@WebMethod is not allowed on a static method {0}  
++runtime.modeler.webmethod.must.be.nonstatic=@WebMethod is not allowed on a static method {0}
++runtime.modeler.webmethod.must.be.nonstaticfinal=@WebMethod is not allowed on a static or final method {0}
+ runtime.modeler.oneway.operation.no.out.parameters=oneway operation should not have out parameters class: {0} method: {1}
+ runtime.modeler.cannot.get.serviceName.from.interface=The serviceName cannot be retrieved from an interface.  class {0}
+ runtime.modeler.portname.servicename.namespace.mismatch=The namespace of the serviceName \"{0}\" and the namespace of the portName \"{1}\" must match
+@@ -38,12 +39,11 @@
+ runtime.modeler.no.package=A @WebService.targetNamespace must be specified on classes with no package.  Class: {0}
+ runtime.modeler.no.operations=The web service defined by the class {0} does not contain any valid WebMethods.
+ runtime.modeler.mtom.conflict = Error in  @BindingType: MTOM Configuration in binding identifier {0} conflicts with feature @MTOM {1}
+-runtime.modeler.feature.conflict= Feature {0} in implementation conflicts with {1} in WSDL configuration 
++runtime.modeler.feature.conflict= Feature {0} in implementation conflicts with {1} in WSDL configuration
+ 
+ runtime.modeler.wsfeature.no.ftrconstructor=Annotation {0} is not recognizable, atleast one constructor of {1} should be marked with @FeatureConstructor
+ runtime.modeler.wsfeature.morethanone.ftrconstructor=Annotation {0} is illegal, Only one constructor of {1} can be marked as @FeatureConstructor
+ runtime.modeler.wsfeature.illegal.ftrconstructor=Annotation {0} is illegal, In {1} @FeatureConstructor value does n't match the constructor parameters
+ 
+-unable.to.create.JAXBContext=Unable to create JAXBContext due to the security restriction
++unable.to.create.JAXBContext=Unable to create JAXBContext
+ not.a.valid.bare.method=SEI {0} has method {1} annotated as BARE but it has more than one parameter bound to body. This is invalid. Please annotate the method with annotation: @SOAPBinding(parameterStyle=SOAPBinding.ParameterStyle.WRAPPED)
+- 
+--- old/src/share/classes/com/sun/xml/internal/ws/resources/providerApi.properties	Thu Jul 30 18:33:18 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/providerApi.properties	Thu Jul 30 18:33:17 2009
+@@ -29,7 +29,8 @@
+ null.portname=EPR does n't have EndpointName in the Metadata
+ null.wsdl= EPR does n't have WSDL Metadata which is needed for the current operation
+ notfound.service.in.wsdl= Service: {0} not found in WSDL: {1}
++no.wsdl.no.port = WSDL Metadata not available to create the proxy, either Service instance or \
++  ServiceEndpointInterface {0} should have WSDL information
+ notfound.port.in.wsdl=Port: {0} not a valid port in Service: {1} in WSDL: {2}
+ error.wsdl= Error in parsing WSDL: {0}
+ null.epr= EndpointReference is null
+- 
+--- old/src/share/classes/com/sun/xml/internal/ws/resources/sender.properties	Thu Jul 30 18:33:22 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/sender.properties	Thu Jul 30 18:33:21 2009
+@@ -27,4 +27,3 @@
+ sender.request.messageNotReady=message not ready to be sent
+ sender.response.cannotDecodeFaultDetail=fault detail cannot be decoded
+ sender.request.illegalValueForContentNegotiation=illegal value for content negotiation property \"{0}\"
+- 
+--- old/src/share/classes/com/sun/xml/internal/ws/resources/server.properties	Thu Jul 30 18:33:25 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/server.properties	Thu Jul 30 18:33:24 2009
+@@ -49,7 +49,7 @@
+ port.name.required=Port QName is not found
+ wrong.tns.for.port=Port namespace {0} doesn't match Service namespace {1}
+ 
+-already.http.server=There is already a HTTP server at : {0} 
++already.http.server=There is already a HTTP server at : {0}
+ already.https.server=There is already a HTTPS server at : {0}
+ not.HttpContext.type=Required com.sun.net.httpserver.HttpContext. Got : {0}
+ 
+@@ -73,6 +73,18 @@
+ runtime.parser.wsdl.noservice=can\'t apply binding! service {0} not found in the WSDL {1}
+ runtime.parser.wsdl.nobinding=can\'t apply binding! no binding found for binding ID {0] for service {1} in WSDL {2}
+ runtime.parser.wsdl.multiplebinding=multiple bindings found for binding ID {0} for service {1} in WSDL {2}
++runtime.parser.wsdl.noservice.in.wsdlmodel=There is an error in processing the WSDL {0} and no valid services are found.
++runtime.parser.wsdl.incorrectservice=could not get binding from WSDL! service: {0} not found in the WSDL {1}.\n\
++  It could be because service name does not match WSDL''s wsdl:service name:\n\
++    1. service name is not there in deployment descriptor OR\n\
++    2. Either there is a typo in deployment descriptor''s service name OR\n\
++    3. The computed names from @WebService do not match wsdl:service name\n\
++  OR\n\
++    1. There is an error while parsing the wsdl and Service with name {0} is not found in the WSDLModel.\n\
++  Suggest doing the following:\n\
++    1. Add/Correct entries for service name in deployment descriptor OR \n\
++    2. Specify targetNamespace, serviceName in @WebService on the endpoint class
++
+ runtime.parser.wsdl.incorrectserviceport=could not get binding from WSDL! service: {0} or port {1} not found in the WSDL {2}.\n\
+   It could be because service and port names do not match WSDL''s wsdl:service and wsdl:port names:\n\
+     1. service and port names are not there in deployment descriptor OR\n\
+@@ -95,8 +107,16 @@
+ 
+ dd.mtom.conflict = Error in Deployment Descriptor : MTOM Configuration in binding {0} conflicts with enable-mtom attribute value {1}
+ 
+-dispatch.cannotFindMethod=Cannot find dispatch method for {0} using "{1}"
++dispatch.cannotFindMethod=Cannot find dispatch method for {0}
++non.unique.dispatch.qname=Non unique body parts! In a port, as per BP 1.1 R2710 operations must have unique \
++  operation signature on the wire for successful dispatch. Methods {0} have the \
++  same request body block {1}. Method dispatching may fail, runtime will try to \
++  dispatch using SOAPAction.
++
++
+ unsupported.contentType=Unsupported Content-Type: {0} Supported ones are: {1}
+ no.contentType=Request doesn't have a Content-Type
++unsupported.charset=Unsupported charset "{0}" in the received message''s Content-Type
+ duplicate.portKnownHeader=Received SOAP message contains duplicate header: {0} for a bound parameter
+- 
++
++runtimemodeler.invalidannotationOnImpl=Invalid annotation: {0} on endpoint implementation class \"{1}\" - will be ignored. \"{1}\" is annotated with @WebService(endpointInterface=\"{2}\"}, it MUST NOT be annotated with {0}, to fix it - put this annotation on the SEI {2}.
+--- old/src/share/classes/com/sun/xml/internal/ws/resources/soap.properties	Thu Jul 30 18:33:29 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/soap.properties	Thu Jul 30 18:33:28 2009
+@@ -28,5 +28,4 @@
+ soap.protocol.invalidFaultCode=Invalid fault code: {0}
+ soap.factory.create.err=Couldn''t create SOAP factory due to exception: {0}
+ soap.fault.create.err=Couldn''t create SOAP Fault due to exception: {0}
+-soap.version.mismatch.err=Couldn''t create SOAP message. Expecting Envelope in namespace {0}, but got {1} 
+- 
++soap.version.mismatch.err=Couldn''t create SOAP message. Expecting Envelope in namespace {0}, but got {1}
+--- old/src/share/classes/com/sun/xml/internal/ws/resources/streaming.properties	Thu Jul 30 18:33:32 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/streaming.properties	Thu Jul 30 18:33:31 2009
+@@ -48,4 +48,3 @@
+ fastinfoset.noImplementation=Unable to locate compatible implementation of Fast Infoset in classpath
+ 
+ sourcereader.invalidSource=Unable to create reader from source \"{0}\"
+- 
+--- old/src/share/classes/com/sun/xml/internal/ws/resources/util.properties	Thu Jul 30 18:33:35 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/util.properties	Thu Jul 30 18:33:35 2009
+@@ -31,4 +31,3 @@
+ util.failed.to.find.handlerchain.file=Could not find handler chain file {1} for class {0}
+ util.failed.to.parse.handlerchain.file=Could not parse handler chain file {1} for class {0}
+ util.location=at line {0} of {1}
+- 
+--- old/src/share/classes/com/sun/xml/internal/ws/resources/wsdlmodel.properties	Thu Jul 30 18:33:39 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/wsdlmodel.properties	Thu Jul 30 18:33:38 2009
+@@ -28,4 +28,3 @@
+   R2001 A DESCRIPTION MUST only use the WSDL \"import\" statement to import another WSDL description.
+ wsdl.portaddress.epraddress.not.match= For Port: {0}, service location {1} does not match address {2} \
+   in the EndpointReference
+- 
+--- old/src/share/classes/com/sun/xml/internal/ws/resources/wsservlet.properties	Thu Jul 30 18:33:42 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/wsservlet.properties	Thu Jul 30 18:33:42 2009
+@@ -81,7 +81,6 @@
+ servlet.error.noResponseMessage=WSSERVLET23: no response message
+ WSSERVLET23.diag.cause.1=The request generated no response from the service
+ WSSERVLET23.diag.check.1=If a response was expected, check that a request message was actually sent
+-WSSERVLET23.diag.cause.1=The request generated no response from the service
+ WSSERVLET23.diag.check.2=The request may be malformed and be accepted by the service, yet did not generate a response
+ 
+ servlet.trace.writingFaultResponse=WSSERVLET24: writing fault response
+@@ -178,12 +177,13 @@
+ servlet.html.title= Web Services
+ servlet.html.title2=<h1>Web Services</h1>
+ servlet.html.noInfoAvailable=<p>No JAX-WS context information available.</p>
+-servlet.html.columnHeader.portName=Port Name
++servlet.html.columnHeader.portName=Endpoint
+ servlet.html.columnHeader.status=Status
+ servlet.html.columnHeader.information=Information
+ servlet.html.status.active=ACTIVE
+ servlet.html.status.error=ERROR
+-servlet.html.information.table=<table border=\"0\"><tr><td>Address\:</td><td>{0}</td></tr><tr><td>WSDL\:</td><td><a href\="{0}?wsdl">{0}?wsdl</a></td></tr><tr><td>Port QName\:</td><td>{1}</td></tr><tr><td>Implementation class\:</td><td>{2}</td></tr></table>
++servlet.html.endpoint.table=<table border=\"0\"><tr><td>Service Name\:</td><td>{0}</td></tr><tr><td>Port Name\:</td><td>{1}</td></tr></table>
++servlet.html.information.table=<table border=\"0\"><tr><td>Address\:</td><td>{0}</td></tr><tr><td>WSDL\:</td><td><a href\="{0}?wsdl">{0}?wsdl</a></td></tr><tr><td>Implementation class\:</td><td>{1}</td></tr></table>
+ servlet.html.notFound=<h1>404 Not Found: {0}</h1>
+ 
+ 
+@@ -234,4 +234,3 @@
+ html.rootPage.body3a=<p>A WSDL description of these ports is available <a href='
+ html.rootPage.body3b='>here.</a></p>
+ html.rootPage.body4=<p>This endpoint is incorrectly configured. Please check the location and contents of the configuration file.</p>
+- 
+--- old/src/share/classes/com/sun/xml/internal/ws/resources/xmlmessage.properties	Thu Jul 30 18:33:46 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/resources/xmlmessage.properties	Thu Jul 30 18:33:45 2009
+@@ -34,4 +34,3 @@
+ xml.content-type.mustbe.multipart=Content-Type needs to be Multipart/Related and with type=text/xml
+ xml.invalid.content-type=Invalid Content-Type: {0}
+ xml.Content-Type.parse.err=Error while parsing MimeHeaders for Content-Type
+- 
+--- old/src/share/classes/com/sun/xml/internal/ws/server/AbstractInstanceResolver.java	Thu Jul 30 18:33:49 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/server/AbstractInstanceResolver.java	Thu Jul 30 18:33:49 2009
+@@ -199,35 +199,43 @@
+     InjectionPlan<T,R> buildInjectionPlan(Class<? extends T> clazz, Class<R> resourceType, boolean isStatic) {
+         List<InjectionPlan<T,R>> plan = new ArrayList<InjectionPlan<T,R>>();
+ 
+-        for(Field field: clazz.getDeclaredFields()) {
+-            Resource resource = field.getAnnotation(Resource.class);
+-            if (resource != null) {
+-                if(isInjectionPoint(resource, field.getType(),
+-                    ServerMessages.localizableWRONG_FIELD_TYPE(field.getName()),resourceType)) {
++        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));
++                        if(isStatic && !Modifier.isStatic(field.getModifiers()))
++                            throw new WebServiceException(ServerMessages.STATIC_RESOURCE_INJECTION_ONLY(resourceType,field));
+ 
+-                    plan.add(new FieldInjectionPlan<T,R>(field));
++                        plan.add(new FieldInjectionPlan<T,R>(field));
++                    }
+                 }
+             }
++            cl = cl.getSuperclass();
+         }
+ 
+-        for(Method method : clazz.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)) {
++        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));
++                        if(isStatic && !Modifier.isStatic(method.getModifiers()))
++                            throw new WebServiceException(ServerMessages.STATIC_RESOURCE_INJECTION_ONLY(resourceType,method));
+ 
+-                    plan.add(new MethodInjectionPlan<T,R>(method));
++                        plan.add(new MethodInjectionPlan<T,R>(method));
++                    }
+                 }
+             }
++            cl = cl.getSuperclass();
+         }
+ 
+         return new Compositor<T,R>(plan);
+--- old/src/share/classes/com/sun/xml/internal/ws/server/AbstractWebServiceContext.java	Thu Jul 30 18:33:53 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/server/AbstractWebServiceContext.java	Thu Jul 30 18:33:52 2009
+@@ -93,5 +93,5 @@
+         }
+         return clazz.cast(((WSEndpointImpl)endpoint).getEndpointReference(clazz,address,wsdlAddress, referenceParameters));
+     }
+-    
++
+ }
+--- old/src/share/classes/com/sun/xml/internal/ws/server/EndpointFactory.java	Thu Jul 30 18:33:56 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/server/EndpointFactory.java	Thu Jul 30 18:33:56 2009
+@@ -50,6 +50,7 @@
+ 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.resources.ServerMessages;
+ import com.sun.xml.internal.ws.server.provider.ProviderInvokerTube;
+ import com.sun.xml.internal.ws.server.sei.SEIInvokerTube;
+@@ -160,7 +161,7 @@
+         AbstractSEIModelImpl seiModel = null;
+         // create WSDL model
+         if (primaryDoc != null) {
+-            wsdlPort = getWSDLPort(primaryDoc, docList, serviceName, portName);
++            wsdlPort = getWSDLPort(primaryDoc, docList, serviceName, portName, container);
+         }
+ 
+         WebServiceFeatureList features=((BindingImpl)binding).getFeatures();
+@@ -184,7 +185,7 @@
+             if (primaryDoc == null) {
+                 primaryDoc = generateWSDL(binding, seiModel, docList, container, implType);
+                 // create WSDL model
+-                wsdlPort = getWSDLPort(primaryDoc, docList, serviceName, portName);
++                wsdlPort = getWSDLPort(primaryDoc, docList, serviceName, portName, container);
+                 seiModel.freeze(wsdlPort);
+             }
+             // New Features might have been added in WSDL through Policy.
+@@ -297,7 +298,7 @@
+         // wsdlPort will be null, means we will generate WSDL. Hence no need to apply
+         // bindings or need to look in the WSDL
+         if(wsdlPort == null){
+-            rap = new RuntimeModeler(implType,serviceName, binding.getBindingId());
++            rap = new RuntimeModeler(implType,serviceName, binding.getBindingId(), binding.getFeatures().toArray());
+         } else {
+             /*
+             This not needed anymore as wsdlFeatures are merged later anyway
+@@ -305,7 +306,7 @@
+             applyEffectiveMtomSetting(wsdlPort.getBinding(), binding);
+             */
+             //now we got the Binding so lets build the model
+-            rap = new RuntimeModeler(implType, serviceName, (WSDLPortImpl)wsdlPort);
++            rap = new RuntimeModeler(implType, serviceName, (WSDLPortImpl)wsdlPort, binding.getFeatures().toArray());
+         }
+         rap.setPortName(portName);
+         return rap.buildRuntimeModel();
+@@ -441,8 +442,11 @@
+         }
+         SDDocument.WSDL wsdlDoc = (SDDocument.WSDL)primaryDoc;
+         if (!wsdlDoc.hasService()) {
+-            throw new WebServiceException("Not a primary WSDL="+primaryWsdl.getSystemId()+
+-                    " since it doesn't have Service "+serviceName);
++            if(wsdlDoc.getAllServices().isEmpty())
++                throw new WebServiceException("Not a primary WSDL="+primaryWsdl.getSystemId()+
++                        " since it doesn't have Service "+serviceName);
++            else
++                throw new WebServiceException("WSDL "+primaryDoc.getSystemId()+" has the following services "+wsdlDoc.getAllServices()+" but not "+serviceName+". Maybe you forgot to specify a service name in @WebService/@WebServiceProvider?");
+         }
+     }
+ 
+@@ -487,17 +491,25 @@
+      * @param metadata it may contain imported WSDL and schema documents
+      * @param serviceName service name in wsdl
+      * @param portName port name in WSDL
++     * @param container container in which this service is running
+      * @return non-null wsdl port object
+      */
+     private static @NotNull WSDLPortImpl getWSDLPort(SDDocumentSource primaryWsdl, List<? extends SDDocumentSource> metadata,
+-                                                     @NotNull QName serviceName, @NotNull QName portName) {
++                                                     @NotNull QName serviceName, @NotNull QName portName, Container container) {
+         URL wsdlUrl = primaryWsdl.getSystemId();
+         try {
+             // TODO: delegate to another entity resolver
+             WSDLModelImpl wsdlDoc = RuntimeWSDLParser.parse(
+                 new Parser(primaryWsdl), new EntityResolverImpl(metadata),
+-                    false, ServiceFinder.find(WSDLParserExtension.class).toArray());
+-            WSDLPortImpl wsdlPort = wsdlDoc.getService(serviceName).get(portName);
++                    false, container, ServiceFinder.find(WSDLParserExtension.class).toArray());
++            if(wsdlDoc.getServices().size() == 0) {
++                throw new ServerRtException(ServerMessages.localizableRUNTIME_PARSER_WSDL_NOSERVICE_IN_WSDLMODEL(wsdlUrl));
++            }
++            WSDLServiceImpl wsdlService = wsdlDoc.getService(serviceName);
++            if (wsdlService == null) {
++                throw new ServerRtException(ServerMessages.localizableRUNTIME_PARSER_WSDL_INCORRECTSERVICE(serviceName,wsdlUrl));
++            }
++            WSDLPortImpl wsdlPort = wsdlService.get(portName);
+             if (wsdlPort == null) {
+                 throw new ServerRtException(ServerMessages.localizableRUNTIME_PARSER_WSDL_INCORRECTSERVICEPORT(serviceName, portName, wsdlUrl));
+             }
+--- old/src/share/classes/com/sun/xml/internal/ws/server/SDDocumentImpl.java	Thu Jul 30 18:34:00 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/server/SDDocumentImpl.java	Thu Jul 30 18:33:59 2009
+@@ -25,24 +25,16 @@
+ 
+ package com.sun.xml.internal.ws.server;
+ 
+-import com.sun.xml.internal.ws.api.server.DocumentAddressResolver;
+-import com.sun.xml.internal.ws.api.server.PortAddressResolver;
+-import com.sun.xml.internal.ws.api.server.SDDocument;
+-import com.sun.xml.internal.ws.api.server.SDDocumentFilter;
+-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.server.*;
+ import com.sun.xml.internal.ws.api.streaming.XMLStreamWriterFactory;
+ import com.sun.xml.internal.ws.streaming.XMLStreamReaderUtil;
++import com.sun.xml.internal.ws.util.RuntimeVersion;
++import com.sun.xml.internal.ws.util.xml.XMLStreamReaderToXMLStreamWriter;
+ import com.sun.xml.internal.ws.wsdl.parser.ParserUtil;
+ import com.sun.xml.internal.ws.wsdl.parser.WSDLConstants;
+-import com.sun.xml.internal.ws.util.RuntimeVersion;
+ 
+ import javax.xml.namespace.QName;
+-import javax.xml.stream.XMLInputFactory;
+-import javax.xml.stream.XMLStreamConstants;
+-import javax.xml.stream.XMLStreamException;
+-import javax.xml.stream.XMLStreamReader;
+-import javax.xml.stream.XMLStreamWriter;
++import javax.xml.stream.*;
+ import javax.xml.ws.WebServiceException;
+ import java.io.IOException;
+ import java.io.OutputStream;
+@@ -61,11 +53,12 @@
+  * @author Kohsuke Kawaguchi
+  * @author Jitendra Kotamraju
+  */
+-class SDDocumentImpl extends SDDocumentSource implements SDDocument {
++public class SDDocumentImpl extends SDDocumentSource implements SDDocument {
+ 
+     private static final String NS_XSD = "http://www.w3.org/2001/XMLSchema";
+     private static final QName SCHEMA_INCLUDE_QNAME = new QName(NS_XSD, "include");
+     private static final QName SCHEMA_IMPORT_QNAME = new QName(NS_XSD, "import");
++    private static final QName SCHEMA_REDEFINE_QNAME = new QName(NS_XSD, "redefine");
+     private static final String VERSION_COMMENT =
+         " Published by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is "+RuntimeVersion.VERSION+". ";
+ 
+@@ -98,7 +91,8 @@
+                          if (reader.getEventType() != XMLStreamConstants.START_ELEMENT)
+                             continue;
+                         QName name = reader.getName();
+-                        if (SCHEMA_INCLUDE_QNAME.equals(name) || SCHEMA_IMPORT_QNAME.equals(name)) {
++                        if (SCHEMA_INCLUDE_QNAME.equals(name) || SCHEMA_IMPORT_QNAME.equals(name) ||
++                                SCHEMA_REDEFINE_QNAME.equals(name)) {
+                             String importedDoc = reader.getAttributeValue(null, "schemaLocation");
+                             if (importedDoc != null) {
+                                 importedDocs.add(new URL(src.getSystemId(), importedDoc).toString());
+@@ -112,6 +106,7 @@
+                     boolean hasPortType = false;
+                     boolean hasService = false;
+                     Set<String> importedDocs = new HashSet<String>();
++                    Set<QName> allServices = new HashSet<QName>();
+ 
+                     // if WSDL, parse more
+                     while (XMLStreamReaderUtil.nextContent(reader) != XMLStreamConstants.END_DOCUMENT) {
+@@ -129,6 +124,7 @@
+                         } else if (WSDLConstants.QNAME_SERVICE.equals(name)) {
+                             String sn = ParserUtil.getMandatoryNonEmptyAttribute(reader, WSDLConstants.ATTR_NAME);
+                             QName sqn = new QName(tns,sn);
++                            allServices.add(sqn);
+                             if(serviceName.equals(sqn)) {
+                                 hasService = true;
+                             }
+@@ -137,7 +133,8 @@
+                             if (importedDoc != null) {
+                                 importedDocs.add(new URL(src.getSystemId(), importedDoc).toString());
+                             }
+-                        } else if (SCHEMA_INCLUDE_QNAME.equals(name) || SCHEMA_IMPORT_QNAME.equals(name)) {
++                        } else if (SCHEMA_INCLUDE_QNAME.equals(name) || SCHEMA_IMPORT_QNAME.equals(name) ||
++                                SCHEMA_REDEFINE_QNAME.equals(name)) {
+                             String importedDoc = reader.getAttributeValue(null, "schemaLocation");
+                             if (importedDoc != null) {
+                                 importedDocs.add(new URL(src.getSystemId(), importedDoc).toString());
+@@ -145,7 +142,7 @@
+                         }
+                     }
+                     return new WSDLImpl(
+-                        rootName,systemId,src,tns,hasPortType,hasService,importedDocs);
++                        rootName,systemId,src,tns,hasPortType,hasService,importedDocs,allServices);
+                 } else {
+                     return new SDDocumentImpl(rootName,systemId,src);
+                 }
+@@ -225,6 +222,31 @@
+         return imports;
+     }
+ 
++    public void writeTo(OutputStream os) throws IOException {
++        XMLStreamWriter w = null;
++        try {
++            //generate the WSDL with utf-8 encoding and XML version 1.0
++            w = XMLStreamWriterFactory.create(os, "UTF-8");
++            w.writeStartDocument("UTF-8", "1.0");
++            new XMLStreamReaderToXMLStreamWriter().bridge(source.read(), w);
++            w.writeEndDocument();
++        } catch (XMLStreamException e) {
++            IOException ioe = new IOException(e.getMessage());
++            ioe.initCause(e);
++            throw ioe;
++        } finally {
++            try {
++                if (w != null)
++                    w.close();
++            } catch (XMLStreamException e) {
++                IOException ioe = new IOException(e.getMessage());
++                ioe.initCause(e);
++                throw ioe;
++            }
++        }
++    }
++
++
+     public void writeTo(PortAddressResolver portAddressResolver, DocumentAddressResolver resolver, OutputStream os) throws IOException {
+         XMLStreamWriter w = null;
+         try {
+@@ -292,13 +314,15 @@
+         private final String targetNamespace;
+         private final boolean hasPortType;
+         private final boolean hasService;
++        private final Set<QName> allServices;
+ 
+         public WSDLImpl(QName rootName, URL url, SDDocumentSource source, String targetNamespace, boolean hasPortType,
+-                        boolean hasService, Set<String> imports) {
++                        boolean hasService, Set<String> imports,Set<QName> allServices) {
+             super(rootName, url, source, imports);
+             this.targetNamespace = targetNamespace;
+             this.hasPortType = hasPortType;
+             this.hasService = hasService;
++            this.allServices = allServices;
+         }
+ 
+         public String getTargetNamespace() {
+@@ -313,6 +337,10 @@
+             return hasService;
+         }
+ 
++        public Set<QName> getAllServices() {
++            return allServices;
++        }
++
+         public boolean isWSDL() {
+             return true;
+         }
+--- old/src/share/classes/com/sun/xml/internal/ws/server/StatefulInstanceResolver.java	Thu Jul 30 18:34:04 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/server/StatefulInstanceResolver.java	Thu Jul 30 18:34:03 2009
+@@ -352,6 +352,7 @@
+         String key = reverseInstances.get(o);
+         if(key==null)   return; // already unexported
+         instances.remove(key);
++        reverseInstances.remove(o);
+     }
+ 
+     public T resolve(EndpointReference epr) {
+@@ -405,9 +406,9 @@
+     /**
+      * Timer that controls the instance time out. Lazily created.
+      */
+-    private static volatile Timer timer;
++    private volatile Timer timer;
+ 
+-    private static synchronized void startTimer() {
++    private synchronized void startTimer() {
+         if(timer==null)
+             timer = new Timer("JAX-WS stateful web service timeout timer");
+     }
+--- old/src/share/classes/com/sun/xml/internal/ws/server/UnsupportedMediaException.java	Thu Jul 30 18:34:07 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/server/UnsupportedMediaException.java	Thu Jul 30 18:34:07 2009
+@@ -47,6 +47,10 @@
+         super(ServerMessages.localizableNO_CONTENT_TYPE());
+     }
+ 
++    public UnsupportedMediaException(String charset) {
++        super(ServerMessages.localizableUNSUPPORTED_CHARSET(charset));
++    }
++
+     public String getDefaultResourceBundleName() {
+         return "com.sun.xml.internal.ws.resources.server";
+     }
+--- old/src/share/classes/com/sun/xml/internal/ws/server/WSDLGenResolver.java	Thu Jul 30 18:34:11 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/server/WSDLGenResolver.java	Thu Jul 30 18:34:10 2009
+@@ -50,11 +50,11 @@
+  * @author Jitendra Kotamraju
+  */
+ final class WSDLGenResolver implements WSDLResolver {
+-    
++
+     private final List<SDDocumentImpl> docs;
+     private final List<SDDocumentSource> newDocs = new ArrayList<SDDocumentSource>();
+     private SDDocumentSource concreteWsdlSource;
+-    
++
+     private SDDocumentImpl abstractWsdl;
+     private SDDocumentImpl concreteWsdl;
+ 
+@@ -88,7 +88,7 @@
+             }
+         }
+     }
+-    
++
+     /**
+      * Generates the concrete WSDL that contains service element.
+      *
+@@ -174,7 +174,7 @@
+         r.setSystemId(filename.value);
+         return r;
+     }
+-    
++
+     /**
+      * Converts SDDocumentSource to SDDocumentImpl and updates original docs. It
+      * categories the generated documents into WSDL, Schema types.
+@@ -193,5 +193,5 @@
+         }
+         return concreteWsdl;
+     }
+-    
++
+ }
+--- old/src/share/classes/com/sun/xml/internal/ws/server/WSDLPatcher.java	Thu Jul 30 18:34:14 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/server/WSDLPatcher.java	Thu Jul 30 18:34:14 2009
+@@ -26,7 +26,6 @@
+ 
+ import com.sun.xml.internal.ws.api.server.PortAddressResolver;
+ import com.sun.xml.internal.ws.api.server.WSEndpoint;
+-import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort;
+ import com.sun.xml.internal.ws.api.server.DocumentAddressResolver;
+ import com.sun.xml.internal.ws.api.server.SDDocument;
+ import com.sun.xml.internal.ws.util.xml.XMLStreamReaderToXMLStreamWriter;
+@@ -48,10 +47,11 @@
+  * @author Kohsuke Kawaguchi
+  */
+ final class WSDLPatcher extends XMLStreamReaderToXMLStreamWriter {
+-    
++
+     private static final String NS_XSD = "http://www.w3.org/2001/XMLSchema";
+     private static final QName SCHEMA_INCLUDE_QNAME = new QName(NS_XSD, "include");
+     private static final QName SCHEMA_IMPORT_QNAME = new QName(NS_XSD, "import");
++    private static final QName SCHEMA_REDEFINE_QNAME = new QName(NS_XSD, "redefine");
+ 
+     private static final Logger logger = Logger.getLogger(
+             com.sun.xml.internal.ws.util.Constants.LoggingDomain + ".wsdl.patcher");
+@@ -76,6 +76,7 @@
+     private String targetNamespace;
+     private QName serviceName;
+     private QName portName;
++    private String portAddress;
+ 
+     private enum EPR_ADDRESS_STATE {IN, OUT, DONE}
+     private EPR_ADDRESS_STATE eprAddressState = EPR_ADDRESS_STATE.OUT;
+@@ -109,6 +110,7 @@
+ 
+         if((name.equals(SCHEMA_INCLUDE_QNAME) && attLocalName.equals("schemaLocation"))
+         || (name.equals(SCHEMA_IMPORT_QNAME)  && attLocalName.equals("schemaLocation"))
++        || (name.equals(SCHEMA_REDEFINE_QNAME)  && attLocalName.equals("schemaLocation"))
+         || (name.equals(WSDLConstants.QNAME_IMPORT)  && attLocalName.equals("location"))) {
+             // patch this attribute value.
+ 
+@@ -128,10 +130,11 @@
+             name.equals(WSDLConstants.NS_SOAP12_BINDING_ADDRESS)) {
+ 
+             if(attLocalName.equals("location")) {
++                portAddress = in.getAttributeValue(i);
+                 String value = getAddressLocation();
+                 if (value != null) {
+-                    logger.fine("Fixing service:"+serviceName+ " port:"+portName
+-                            + " address with "+value);
++                    logger.fine("Service:"+serviceName+ " port:"+portName
++                            + " current address "+portAddress+" Patching it with "+value);
+                     writeAttribute(i, value);
+                     return;
+                 }
+@@ -241,8 +244,6 @@
+      */
+     private String getAddressLocation() {
+         return (portAddressResolver == null || portName == null)
+-                ? null : portAddressResolver.getAddressFor(serviceName, portName.getLocalPart());
++                ? null : portAddressResolver.getAddressFor(serviceName, portName.getLocalPart(), portAddress);
+     }
+ }
+-    
+-
+--- old/src/share/classes/com/sun/xml/internal/ws/server/WSEndpointImpl.java	Thu Jul 30 18:34:18 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/server/WSEndpointImpl.java	Thu Jul 30 18:34:17 2009
+@@ -47,6 +47,7 @@
+ 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.TransportBackChannel;
+ import com.sun.xml.internal.ws.api.server.WSEndpoint;
+ import com.sun.xml.internal.ws.api.server.WebServiceContextDelegate;
+@@ -63,7 +64,9 @@
+ import javax.xml.ws.handler.Handler;
+ import java.lang.reflect.Method;
+ import java.util.Arrays;
++import java.util.LinkedHashSet;
+ import java.util.List;
++import java.util.Set;
+ import java.util.concurrent.Executor;
+ import java.util.logging.Level;
+ import java.util.logging.Logger;
+@@ -75,6 +78,16 @@
+  * @author Jitendra Kotamraju
+  */
+ public final class WSEndpointImpl<T> extends WSEndpoint<T> {
++    // Register JAX-WS JMX MBeans
++    static {
++        try {
++            JMXAgent.getDefault();
++        } catch (Throwable t) {
++            // Ignore for now by logging the stack trace
++            t.printStackTrace();
++        }
++    }
++
+     private final @NotNull QName serviceName;
+     private final @NotNull QName portName;
+     private final WSBinding binding;
+@@ -100,6 +113,7 @@
+ 
+     private final Class<T> implementationClass;
+     private final @Nullable WSDLProperties wsdlProperties;
++    private final Set<EndpointComponent> componentRegistry = new LinkedHashSet<EndpointComponent>();
+ 
+     WSEndpointImpl(@NotNull QName serviceName, @NotNull QName portName, WSBinding binding,
+                    Container container, SEIModel seiModel, WSDLPort port,
+@@ -128,7 +142,7 @@
+ 
+         Codec c = context.getCodec();
+         if(c instanceof EndpointAwareCodec) {
+-            // create a copy to avoid sharing the codec between multiple endpoints 
++            // create a copy to avoid sharing the codec between multiple endpoints
+             c = c.copy();
+             ((EndpointAwareCodec)c).setEndpoint(this);
+         }
+@@ -156,18 +170,7 @@
+         return port;
+     }
+ 
+-    /**
+-     * Gets the {@link SEIModel} that represents the relationship
+-     * between WSDL and Java SEI.
+-     *
+-     * <p>
+-     * This method returns a non-null value if and only if this
+-     * endpoint is ultimately serving an application through an SEI.
+-     *
+-     * @return
+-     *      maybe null. See above for more discussion.
+-     *      Always the same value.
+-     */
++    @Override
+     public @Nullable SEIModel getSEIModel() {
+         return seiModel;
+     }
+@@ -267,6 +270,10 @@
+         return serviceDef;
+     }
+ 
++    public Set<EndpointComponent> getComponentRegistry() {
++        return componentRegistry;
++    }
++
+     private static final Logger logger = Logger.getLogger(
+         com.sun.xml.internal.ws.util.Constants.LoggingDomain + ".server.endpoint");
+ 
+@@ -273,7 +280,7 @@
+     public <T extends EndpointReference> T getEndpointReference(Class<T> clazz, String address, String wsdlAddress, Element...referenceParameters) {
+         QName portType = null;
+         if(port != null) {
+-            portType = port.getBinding().getPortTypeName();            
++            portType = port.getBinding().getPortTypeName();
+         }
+         List<Element> refParams = null;
+         if(referenceParameters != null) {
+--- old/src/share/classes/com/sun/xml/internal/ws/server/package-info.java	Thu Jul 30 18:34:21 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/server/package-info.java	Thu Jul 30 18:34:21 2009
+@@ -25,17 +25,17 @@
+ 
+ /**
+  * <h1>JAX-WS 2.0.1 Server Runtime</h1>
+- * <P>This document describes the architecture of server side 
++ * <P>This document describes the architecture of server side
+  * JAX-WS 2.0.1 runtime. </p>
+  *
+  * <h3>JAX-WS 2.0.1 Server Runtime Sequence Diagram</h3>
+ 
+   * <img src='../../../../../jaxws/basic-server.seq.png'>
+- 
++
+  *
+  *
+  * <H3>Message Flow</H3>
+- * <P>A Web Service invocation starts with either the 
++ * <P>A Web Service invocation starts with either the
+  * {@link com.sun.xml.internal.ws.transport.http.servlet.WSServletDelegate WSServletDelegate}
+  * or the {@link com.sun.xml.internal.ws.transport.http.server.ServerConnectionImpl ServerConnectionImpl}.
+  * Both of these classes find the appropriate {@link com.sun.xml.internal.ws.server.RuntimeEndpointInfo RuntimeEndpointInfo}
+@@ -74,49 +74,49 @@
+  * <H3>External Interactions</H3>
+  * <H4>SAAJ API</H4>
+  * <UL>
+- * 	<LI><P>JAX-WS creates SAAJ javax.xml.soap.SOAPMessage 
++ *      <LI><P>JAX-WS creates SAAJ javax.xml.soap.SOAPMessage
+  *      from the HttpServletRequest.
+- * 	At present, JAX-WS reads all the bytes from the request stream and
+- * 	then creates SOAPMessage along with the HTTP headers.</P>
++ *      At present, JAX-WS reads all the bytes from the request stream and
++ *      then creates SOAPMessage along with the HTTP headers.</P>
+  * </UL>
+  * <P>javax.xml.soap.MessageFactory(binding).createMessage(MimeHeaders, InputStream)</P>
+  * <UL>
+- * 	<LI><P>SOAPMessage parses the content from the stream including MIME
+- * 	data</P>
+- * 	<LI><P>com.sun.xml.internal.ws.server.SOAPMessageDispatcher::checkHeadersPeekBody()</P>
+- * 	<P>SOAPMessage.getSOAPHeader() is used for mustUnderstand processing
+- * 	of headers. It further uses
+- * 	javax.xml.soap.SOAPHeader.examineMustUnderstandHeaderElements(role)</P>
+- * 	<P>SOAPMessage.getSOAPBody().getFistChild() is used for guessing the
+- * 	MEP of the request</P>
+- * 	<LI><P>com.sun.xml.internal.ws.handler.HandlerChainCaller:insertFaultMessage()</P>
+- * 	<P>SOAPMessage.getSOAPPart().getEnvelope() and some other SAAJ calls
+- * 	are made to create a fault in the SOAPMessage</P>
+- * 	<LI><P>com.sun.xml.internal.ws.handler.LogicalMessageImpl::getPayload()
+- * 	interacts with SAAJ to get body from SOAPMessage</P>
+- * 	<LI><P>com.sun.xml.internal.ws.encoding.soap.SOAPEncoder.toSOAPMessage(com.sun.xml.internal.ws.encoding.soap.internal.InternalMessage,
+- * 	SOAPMessage). There is a scenario where there is SOAPMessage and a
+- * 	logical handler sets payload as Source. To write to the stream,
+- * 	SOAPMessage.writeTo() is used but before that the body needs to be
+- * 	updated with logical handler' Source. Need to verify if this
+- * 	scenario is still happening since Handler.close() is changed to take
+- * 	MessageContext.</P>
+- * 	<LI><P>com.sun.xml.internal.ws.handlerSOAPMessageContextImpl.getHeaders()
+- * 	uses SAAJ API to get headers.</P>
+- * 	<LI><P>SOAPMessage.writeTo() is used to write response. At present,
+- * 	it writes into byte[] and this byte[] is written to
+- * 	HttpServletResponse.</P>
++ *      <LI><P>SOAPMessage parses the content from the stream including MIME
++ *      data</P>
++ *      <LI><P>com.sun.xml.internal.ws.server.SOAPMessageDispatcher::checkHeadersPeekBody()</P>
++ *      <P>SOAPMessage.getSOAPHeader() is used for mustUnderstand processing
++ *      of headers. It further uses
++ *      javax.xml.soap.SOAPHeader.examineMustUnderstandHeaderElements(role)</P>
++ *      <P>SOAPMessage.getSOAPBody().getFistChild() is used for guessing the
++ *      MEP of the request</P>
++ *      <LI><P>com.sun.xml.internal.ws.handler.HandlerChainCaller:insertFaultMessage()</P>
++ *      <P>SOAPMessage.getSOAPPart().getEnvelope() and some other SAAJ calls
++ *      are made to create a fault in the SOAPMessage</P>
++ *      <LI><P>com.sun.xml.internal.ws.handler.LogicalMessageImpl::getPayload()
++ *      interacts with SAAJ to get body from SOAPMessage</P>
++ *      <LI><P>com.sun.xml.internal.ws.encoding.soap.SOAPEncoder.toSOAPMessage(com.sun.xml.internal.ws.encoding.soap.internal.InternalMessage,
++ *      SOAPMessage). There is a scenario where there is SOAPMessage and a
++ *      logical handler sets payload as Source. To write to the stream,
++ *      SOAPMessage.writeTo() is used but before that the body needs to be
++ *      updated with logical handler' Source. Need to verify if this
++ *      scenario is still happening since Handler.close() is changed to take
++ *      MessageContext.</P>
++ *      <LI><P>com.sun.xml.internal.ws.handlerSOAPMessageContextImpl.getHeaders()
++ *      uses SAAJ API to get headers.</P>
++ *      <LI><P>SOAPMessage.writeTo() is used to write response. At present,
++ *      it writes into byte[] and this byte[] is written to
++ *      HttpServletResponse.</P>
+  * </UL>
+  * <H4>JAXB API</H4>
+  * <P>JAX-WS RI uses the JAXB API to marshall/unmarshall user created
+- * JAXB objects with user created {@link javax.xml.bind.JAXBContext JAXBContext}. 
++ * JAXB objects with user created {@link javax.xml.bind.JAXBContext JAXBContext}.
+  * Handler, Dispatch in JAX-WS API provide ways for the user to specify his/her own
+  * JAXBContext. {@link com.sun.xml.internal.ws.encoding.jaxb.JAXBTypeSerializer JAXBTypeSerializer} class uses all these methods.</P>
+  * <UL>
+- * 	<LI><p>{@link javax.xml.bind.Marshaller#marshal(Object,XMLStreamWriter) Marshaller.marshal(Object,XMLStreamWriter)}</p>
+- * 	<LI><P>{@link javax.xml.bind.Marshaller#marshal(Object,Result) Marshaller.marshal(Object, DomResult)}</P>
+- * 	<LI><P>{@link javax.xml.bind.Unmarshaller#unmarshal(XMLStreamReader) Object Unmarshaller.unmarshal(XMLStreamReader)}</P>
+- * 	<LI><P>{@link javax.xml.bind.Unmarshaller#unmarshal(Source) Object Unmarshaller.unmarshal(Source)}</P>
++ *      <LI><p>{@link javax.xml.bind.Marshaller#marshal(Object,XMLStreamWriter) Marshaller.marshal(Object,XMLStreamWriter)}</p>
++ *      <LI><P>{@link javax.xml.bind.Marshaller#marshal(Object,Result) Marshaller.marshal(Object, DomResult)}</P>
++ *      <LI><P>{@link javax.xml.bind.Unmarshaller#unmarshal(XMLStreamReader) Object Unmarshaller.unmarshal(XMLStreamReader)}</P>
++ *      <LI><P>{@link javax.xml.bind.Unmarshaller#unmarshal(Source) Object Unmarshaller.unmarshal(Source)}</P>
+  * </UL>
+  * The following two JAXB classes are implemented by JAX-WS to enable/implement MTOM and XOP
+  * <UL>
+@@ -129,11 +129,11 @@
+  * parameters at the time of JAXBTypeSerializer class uses all
+  * these methods.</P>
+  * <UL>
+- * 	<LI><P>{@link com.sun.xml.internal.bind.api.Bridge#marshal(BridgeContext, Object, XMLStreamWriter) Bridge.marshal(BridgeContext, Object, XMLStreamWriter)}</P>
+- * 	<LI><P>{@link com.sun.xml.internal.bind.api.Bridge#marshal(BridgeContext, Object, Node) Bridge.marshal(BridgeContext, Object, Node)}</P>
+- * 	<LI><P>{@link com.sun.xml.internal.bind.api.Bridge#unmarshal(BridgeContext, XMLStreamReader) Object Bridge.unmarshal(BridgeContext, XMLStreamReader)}</P>
++ *      <LI><P>{@link com.sun.xml.internal.bind.api.Bridge#marshal(BridgeContext, Object, XMLStreamWriter) Bridge.marshal(BridgeContext, Object, XMLStreamWriter)}</P>
++ *      <LI><P>{@link com.sun.xml.internal.bind.api.Bridge#marshal(BridgeContext, Object, Node) Bridge.marshal(BridgeContext, Object, Node)}</P>
++ *      <LI><P>{@link com.sun.xml.internal.bind.api.Bridge#unmarshal(BridgeContext, XMLStreamReader) Object Bridge.unmarshal(BridgeContext, XMLStreamReader)}</P>
+  * </UL>
+- * 
++ *
+  * @ArchitectureDocument
+  **/
+ package com.sun.xml.internal.ws.server;
+--- old/src/share/classes/com/sun/xml/internal/ws/server/provider/ProviderArgumentsBuilder.java	Thu Jul 30 18:34:25 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/server/provider/ProviderArgumentsBuilder.java	Thu Jul 30 18:34:24 2009
+@@ -74,7 +74,7 @@
+ 
+     public static ProviderArgumentsBuilder<?> create(ProviderEndpointModel model, WSBinding binding) {
+         return (binding instanceof SOAPBinding) ? SOAPProviderArgumentBuilder.create(model, binding.getSOAPVersion())
+-                : XMLProviderArgumentBuilder.create(model);
++                : XMLProviderArgumentBuilder.createBuilder(model, binding);
+     }
+ 
+ }
+--- old/src/share/classes/com/sun/xml/internal/ws/server/provider/XMLProviderArgumentBuilder.java	Thu Jul 30 18:34:28 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/server/provider/XMLProviderArgumentBuilder.java	Thu Jul 30 18:34:28 2009
+@@ -56,7 +56,7 @@
+         return response;
+     }
+ 
+-    static XMLProviderArgumentBuilder create(ProviderEndpointModel model) {
++    static XMLProviderArgumentBuilder createBuilder(ProviderEndpointModel model, WSBinding binding) {
+         if (model.mode == Service.Mode.PAYLOAD) {
+             return new PayloadSource();
+         } else {
+@@ -63,7 +63,7 @@
+             if(model.datatype==Source.class)
+                 return new PayloadSource();
+             if(model.datatype== DataSource.class)
+-                return new DataSourceParameter();
++                return new DataSourceParameter(binding);
+             throw new WebServiceException(ServerMessages.PROVIDER_INVALID_PARAMETER_TYPE(model.implClass,model.datatype));
+         }
+     }
+@@ -83,15 +83,20 @@
+     }
+ 
+     private static final class DataSourceParameter extends XMLProviderArgumentBuilder<DataSource> {
++        private final WSBinding binding;
++
++        DataSourceParameter(WSBinding binding) {
++            this.binding = binding;
++        }
+         public DataSource getParameter(Packet packet) {
+             Message msg = packet.getMessage();
+             return (msg instanceof XMLMessage.MessageDataSource)
+                     ? ((XMLMessage.MessageDataSource) msg).getDataSource()
+-                    : XMLMessage.getDataSource(msg);
++                    : XMLMessage.getDataSource(msg, binding);
+         }
+ 
+         public Message getResponseMessage(DataSource ds) {
+-            return XMLMessage.create(ds);
++            return XMLMessage.create(ds, binding);
+         }
+ 
+         protected Message getResponseMessage(Exception e) {
+--- old/src/share/classes/com/sun/xml/internal/ws/server/sei/ActionBasedDispatcher.java	Thu Jul 30 18:34:32 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/server/sei/ActionBasedDispatcher.java	Thu Jul 30 18:34:31 2009
+@@ -71,7 +71,7 @@
+                 action = m.getOperation().getOperation().getInput().getAction();
+                 if (action != null)
+                     actionMethodHandlers.put(action, handler);
+-            }    
++            }
+         }
+     }
+ 
+--- old/src/share/classes/com/sun/xml/internal/ws/server/sei/EndpointArgumentsBuilder.java	Thu Jul 30 18:34:38 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/server/sei/EndpointArgumentsBuilder.java	Thu Jul 30 18:34:37 2009
+@@ -49,6 +49,7 @@
+ 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;
+@@ -178,7 +179,7 @@
+         }
+     }
+ 
+-    
++
+     /**
+      * Reads an Attachment into a Java parameter.
+      */
+@@ -187,7 +188,7 @@
+         protected final ParameterImpl param;
+         protected final String pname;
+         protected final String pname1;
+-            
++
+         AttachmentBuilder(ParameterImpl param, EndpointValueSetter setter) {
+             this.setter = setter;
+             this.param = param;
+@@ -219,11 +220,12 @@
+             } else if(isXMLMimeType(param.getBinding().getMimeType())) {
+                 return new JAXBBuilder(param, setter);
+             } else {
+-                throw new UnsupportedOperationException("Attachment is not mapped");
++                throw new UnsupportedOperationException("Unknown Type="+type+" Attachment is not mapped.");
+             }
+         }
+-        
++
+         public void readRequest(Message msg, Object[] args) throws JAXBException, XMLStreamException {
++            boolean foundAttachment = false;
+             // TODO not to loop
+             for (Attachment att : msg.getAttachments()) {
+                 String part = getWSDLPartName(att);
+@@ -231,76 +233,90 @@
+                     continue;
+                 }
+                 if(part.equals(pname) || part.equals(pname1)){
++                    foundAttachment = true;
+                     mapAttachment(att, args);
+                     break;
+                 }
+             }
++            if (!foundAttachment) {
++                throw new WebServiceException("Missing Attachment for "+pname);
++            }
+         }
+-        
++
+         abstract void mapAttachment(Attachment att, Object[] args) throws JAXBException;
+     }
+-        
++
+     private static final class DataHandlerBuilder extends AttachmentBuilder {
+         DataHandlerBuilder(ParameterImpl param, EndpointValueSetter setter) {
+             super(param, setter);
+         }
+-        
++
+         void mapAttachment(Attachment att, Object[] args) {
+             setter.put(att.asDataHandler(), args);
+         }
+     }
+-        
++
+     private static final class ByteArrayBuilder extends AttachmentBuilder {
+         ByteArrayBuilder(ParameterImpl param, EndpointValueSetter setter) {
+             super(param, setter);
+         }
+-        
++
+         void mapAttachment(Attachment att, Object[] args) {
+             setter.put(att.asByteArray(), args);
+         }
+     }
+-        
++
+     private static final class SourceBuilder extends AttachmentBuilder {
+         SourceBuilder(ParameterImpl param, EndpointValueSetter setter) {
+             super(param, setter);
+         }
+-        
++
+         void mapAttachment(Attachment att, Object[] args) {
+             setter.put(att.asSource(), args);
+         }
+     }
+-        
++
+     private static final class ImageBuilder extends AttachmentBuilder {
+         ImageBuilder(ParameterImpl param, EndpointValueSetter setter) {
+             super(param, setter);
+         }
+-        
++
+         void mapAttachment(Attachment att, Object[] args) {
+             Image image;
++            InputStream is = null;
+             try {
+-                image = ImageIO.read(att.asInputStream());
++                is = att.asInputStream();
++                image = ImageIO.read(is);
+             } catch(IOException ioe) {
+                 throw new WebServiceException(ioe);
++            } finally {
++                if (is != null) {
++                    try {
++                        is.close();
++                    } catch(IOException ioe) {
++                        throw new WebServiceException(ioe);
++                    }
++                }
+             }
+             setter.put(image, args);
+         }
+     }
+-        
++
+     private static final class InputStreamBuilder extends AttachmentBuilder {
+         InputStreamBuilder(ParameterImpl param, EndpointValueSetter setter) {
+             super(param, setter);
+         }
+-        
++
+         void mapAttachment(Attachment att, Object[] args) {
+             setter.put(att.asInputStream(), args);
+         }
+     }
+-        
++
+     private static final class JAXBBuilder extends AttachmentBuilder {
+         JAXBBuilder(ParameterImpl param, EndpointValueSetter setter) {
+             super(param, setter);
+         }
+-        
++
+         void mapAttachment(Attachment att, Object[] args) throws JAXBException {
+             Object obj = param.getBridge().unmarshal(att.asInputStream());
+             setter.put(obj, args);
+@@ -307,7 +323,7 @@
+         }
+     }
+ 
+-    
++
+     /**
+      * Gets the WSDL part name of this attachment.
+      *
+@@ -352,9 +368,9 @@
+         }
+     }
+ 
+-    
+-    
+ 
++
++
+     /**
+      * Reads a header into a JAXB object.
+      */
+@@ -489,30 +505,27 @@
+         }
+ 
+         public void readRequest(Message msg, Object[] args) throws JAXBException, XMLStreamException {
+-            Object retVal = null;
+ 
+-            XMLStreamReader reader = msg.readPayload();
+-            Object wrapperBean = wrapper.unmarshal(reader, (msg.getAttachments() != null) ?
+-                    new AttachmentUnmarshallerImpl(msg.getAttachments()): null);
++            if (parts.length>0) {
++                XMLStreamReader reader = msg.readPayload();
++                Object wrapperBean = wrapper.unmarshal(reader, (msg.getAttachments() != null) ?
++                        new AttachmentUnmarshallerImpl(msg.getAttachments()): null);
+ 
+-            try {
+-                for (PartBuilder part : parts) {
+-                    Object o = part.readResponse(args,wrapperBean);
+-                    // there's only at most one EndpointArgumentsBuilder that returns a value.
+-                    // TODO: reorder parts so that the return value comes at the end.
+-                    if(o!=null) {
+-                        assert retVal==null;
+-                        retVal = o;
++                try {
++                    for (PartBuilder part : parts) {
++                        part.readRequest(args,wrapperBean);
+                     }
++                } catch (AccessorException e) {
++                    // this can happen when the set method throw a checked exception or something like that
++                    throw new WebServiceException(e);    // TODO:i18n
+                 }
+-            } catch (AccessorException 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);
++                // we are done with the body
++                reader.close();
++                XMLStreamReaderFactory.recycle(reader);
++            } else {
++                msg.consume();
++            }
+         }
+ 
+         /**
+@@ -535,10 +548,9 @@
+                 assert accessor!=null && setter!=null;
+             }
+ 
+-            final Object readResponse( Object[] args, Object wrapperBean ) throws AccessorException {
++            final void readRequest( Object[] args, Object wrapperBean ) throws AccessorException {
+                 Object obj = accessor.get(wrapperBean);
+                 setter.put(obj,args);
+-                return null;
+             }
+ 
+ 
+@@ -576,7 +588,7 @@
+             XMLStreamReader reader = msg.readPayload();
+             if (!reader.getName().equals(wrapperName))
+                 throw new WebServiceException( // TODO: i18n
+-                    "Unexpected response element "+reader.getName()+" expected: "+wrapperName);
++                    "Unexpected request element "+reader.getName()+" expected: "+wrapperName);
+             reader.nextTag();
+ 
+             while(reader.getEventType()==XMLStreamReader.START_ELEMENT) {
+@@ -589,6 +601,11 @@
+                 } else {
+                     part.readRequest(args,reader, msg.getAttachments());
+                 }
++                // skip any whitespace
++                if (reader.getEventType() != XMLStreamConstants.START_ELEMENT &&
++                        reader.getEventType() != XMLStreamConstants.END_ELEMENT) {
++                    XMLStreamReaderUtil.nextElementContent(reader);
++                }
+             }
+ 
+             // we are done with the body
+@@ -621,8 +638,8 @@
+             }
+         }
+     }
+-    
++
+     private static boolean isXMLMimeType(String mimeType){
+-        return (mimeType.equals("text/xml") || mimeType.equals("application/xml")) ? true : false;
++        return mimeType.equals("text/xml") || mimeType.equals("application/xml");
+     }
+ }
+--- old/src/share/classes/com/sun/xml/internal/ws/server/sei/EndpointMethodDispatcher.java	Thu Jul 30 18:34:42 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/server/sei/EndpointMethodDispatcher.java	Thu Jul 30 18:34:42 2009
+@@ -22,9 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * $Id: EndpointMethodDispatcher.java,v 1.1.2.5 2006/11/10 00:55:03 kohsuke Exp $
+- */
+ 
+ package com.sun.xml.internal.ws.server.sei;
+ 
+--- old/src/share/classes/com/sun/xml/internal/ws/server/sei/EndpointMethodDispatcherGetter.java	Thu Jul 30 18:34:46 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/server/sei/EndpointMethodDispatcherGetter.java	Thu Jul 30 18:34:45 2009
+@@ -42,7 +42,7 @@
+  * <p>
+  * {@link Message} payload's QName to obtain the handler. If no handler is
+  * registered corresponding to that QName, then uses Action Message
+- * Addressing Property value to get the handler. 
++ * Addressing Property value to get the handler.
+  *
+  * @author Arun Gupta
+  */
+@@ -59,6 +59,7 @@
+         // even when action based dispatching is in place,
+         // we still need this because clients are alowed not to use addressing headers
+         dispatcherList.add(new PayloadQNameBasedDispatcher(model, binding, invokerTube));
++        dispatcherList.add(new SOAPActionBasedDispatcher(model, binding, invokerTube));
+     }
+ 
+     List<EndpointMethodDispatcher> getDispatcherList() {
+--- old/src/share/classes/com/sun/xml/internal/ws/server/sei/EndpointMethodHandler.java	Thu Jul 30 18:34:49 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/server/sei/EndpointMethodHandler.java	Thu Jul 30 18:34:48 2009
+@@ -29,8 +29,6 @@
+ 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.SEIModel;
+-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.JavaMethodImpl;
+@@ -41,6 +39,8 @@
+ import javax.xml.bind.JAXBException;
+ import javax.xml.stream.XMLStreamException;
+ import javax.xml.ws.Holder;
++import javax.xml.ws.ProtocolException;
++import javax.xml.ws.WebServiceException;
+ import java.lang.reflect.InvocationTargetException;
+ import java.lang.reflect.Method;
+ import java.util.ArrayList;
+@@ -226,19 +226,21 @@
+ 
+ 
+     public Packet invoke(Packet req) {
+-        // Some transports(like HTTP) may want to send response before envoking endpoint method
+-        if (isOneWay && req.transportBackChannel != null) {
+-            req.transportBackChannel.close();
+-        }
+         Message reqMsg = req.getMessage();
+         Object[] args = new Object[noOfArgs];
+         try {
+             argumentsBuilder.readRequest(reqMsg,args);
+         } catch (JAXBException e) {
+-            throw new DeserializationException("failed.to.read.response",e);
++            throw new WebServiceException(e);
+         } catch (XMLStreamException e) {
+-            throw new DeserializationException("failed.to.read.response",e);
++            throw new WebServiceException(e);
+         }
++        // Some transports(like HTTP) may want to send response before envoking endpoint method
++        // Doing this here so that after closing the response stream, cannot read
++        // request from some transports(light weight http server)
++        if (isOneWay && req.transportBackChannel != null) {
++            req.transportBackChannel.close();
++        }
+         Message responseMessage;
+         try {
+             Object ret = owner.getInvoker(req).invoke(req, method, args);
+@@ -248,11 +250,17 @@
+ 
+             if (!(cause instanceof RuntimeException) && cause instanceof Exception) {
+                 // Service specific exception
+-                LOGGER.log(Level.INFO, cause.getMessage(), cause);
++                LOGGER.log(Level.FINE, cause.getMessage(), cause);
+                 responseMessage = SOAPFaultBuilder.createSOAPFaultMessage(soapVersion,
+                         javaMethodModel.getCheckedException(cause.getClass()), cause);
+             } else {
+-                LOGGER.log(Level.SEVERE, cause.getMessage(), cause);
++                if (cause instanceof ProtocolException) {
++                    // Application code may be throwing it intentionally
++                    LOGGER.log(Level.FINE, cause.getMessage(), cause);
++                } else {
++                    // Probably some bug in application code
++                    LOGGER.log(Level.SEVERE, cause.getMessage(), cause);
++                }
+                 responseMessage = SOAPFaultBuilder.createSOAPFaultMessage(soapVersion, null, cause);
+             }
+         } catch (Exception e) {
+--- old/src/share/classes/com/sun/xml/internal/ws/server/sei/EndpointResponseMessageBuilder.java	Thu Jul 30 18:34:53 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/server/sei/EndpointResponseMessageBuilder.java	Thu Jul 30 18:34:52 2009
+@@ -166,7 +166,7 @@
+          * How does each wrapped parameter binds to XML?
+          */
+         private final RawAccessor[] accessors;
+-        
++
+         //private final RawAccessor retAccessor;
+ 
+         /**
+--- old/src/share/classes/com/sun/xml/internal/ws/server/sei/EndpointValueSetter.java	Thu Jul 30 18:34:56 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/server/sei/EndpointValueSetter.java	Thu Jul 30 18:34:55 2009
+@@ -104,7 +104,7 @@
+             }
+         }
+     }
+-    
++
+     static final class HolderParam extends Param {
+ 
+         public HolderParam(int idx) {
+--- old/src/share/classes/com/sun/xml/internal/ws/server/sei/MessageFiller.java	Thu Jul 30 18:34:59 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/server/sei/MessageFiller.java	Thu Jul 30 18:34:59 2009
+@@ -65,7 +65,7 @@
+      * Moves an argument of a method invocation into a {@link Message}.
+      */
+     abstract void fillIn(Object[] methodArgs, Object returnValue, Message msg);
+-    
++
+     /**
+      * Adds a parameter as an MIME attachment to {@link Message}.
+      */
+@@ -74,7 +74,7 @@
+         protected final ValueGetter getter;
+         protected final String mimeType;
+         private final String contentIdPart;
+-        
++
+         protected AttachmentFiller(ParameterImpl param, ValueGetter getter) {
+             super(param.getIndex());
+             this.param = param;
+@@ -86,7 +86,7 @@
+                 throw new WebServiceException(e);
+             }
+         }
+-        
++
+         /**
+          * Creates an MessageFiller based on the parameter type
+          *
+@@ -108,12 +108,12 @@
+                 return new DataHandlerFiller(param, getter);
+             }
+         }
+-        
++
+         String getContentId() {
+             return contentIdPart+UUID.randomUUID()+"@jaxws.sun.com";
+         }
+     }
+-    
++
+     private static class ByteArrayFiller extends AttachmentFiller {
+         protected ByteArrayFiller(ParameterImpl param, ValueGetter getter) {
+             super(param, getter);
+@@ -127,7 +127,7 @@
+             }
+         }
+     }
+-    
++
+     private static class DataHandlerFiller extends AttachmentFiller {
+         protected DataHandlerFiller(ParameterImpl param, ValueGetter getter) {
+             super(param, getter);
+@@ -140,7 +140,7 @@
+             msg.getAttachments().add(att);
+         }
+     }
+-    
++
+     private static class JAXBFiller extends AttachmentFiller {
+         protected JAXBFiller(ParameterImpl param, ValueGetter getter) {
+             super(param, getter);
+@@ -171,7 +171,7 @@
+             msg.getHeaders().add(Headers.create(bridge,value));
+         }
+     }
+-    
++
+     private static boolean isXMLMimeType(String mimeType){
+         return mimeType.equals("text/xml") || mimeType.equals("application/xml");
+     }
+--- old/src/share/classes/com/sun/xml/internal/ws/server/sei/PayloadQNameBasedDispatcher.java	Thu Jul 30 18:35:03 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/server/sei/PayloadQNameBasedDispatcher.java	Thu Jul 30 18:35:02 2009
+@@ -25,7 +25,7 @@
+ 
+ package com.sun.xml.internal.ws.server.sei;
+ 
+-import com.sun.istack.internal.NotNull;
++import com.sun.istack.internal.Nullable;
+ 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;
+@@ -36,6 +36,9 @@
+ import com.sun.xml.internal.ws.util.QNameMap;
+ 
+ import javax.xml.namespace.QName;
++import java.util.ArrayList;
++import java.util.List;
++import java.util.logging.Logger;
+ 
+ /**
+  * An {@link com.sun.xml.internal.ws.server.sei.EndpointMethodDispatcher} that uses
+@@ -47,28 +50,60 @@
+  * handler.
+  *
+  * @author Arun Gupta
++ * @author Jitendra Kotamraju
+  */
+ final class PayloadQNameBasedDispatcher implements EndpointMethodDispatcher {
+-    private final QNameMap<EndpointMethodHandler> methodHandlers;
++    private static final Logger LOGGER = Logger.getLogger(PayloadQNameBasedDispatcher.class.getName());
++
+     private static final String EMPTY_PAYLOAD_LOCAL = "";
+     private static final String EMPTY_PAYLOAD_NSURI = "";
+-    private WSBinding binding;
++    private static final QName EMPTY_PAYLOAD = new QName(EMPTY_PAYLOAD_NSURI, EMPTY_PAYLOAD_LOCAL);
+ 
++    private final QNameMap<EndpointMethodHandler> methodHandlers = new QNameMap<EndpointMethodHandler>();
++    private final QNameMap<List<String>> unique = new QNameMap<List<String>>();
++    private final WSBinding binding;
++
+     public PayloadQNameBasedDispatcher(AbstractSEIModelImpl model, WSBinding binding, SEIInvokerTube invokerTube) {
+         this.binding = binding;
+-        methodHandlers = new QNameMap<EndpointMethodHandler>();
+-        for( JavaMethodImpl m : model.getJavaMethods() ) {
+-            EndpointMethodHandler handler = new EndpointMethodHandler(invokerTube,m,binding);
+-            QName payloadName = model.getQNameForJM(m);     // TODO need a new method on JavaMethodImpl
+-            methodHandlers.put(payloadName.getNamespaceURI(), payloadName.getLocalPart(), handler);
++        // Find if any payload QNames repeat for operations
++        for(JavaMethodImpl m : model.getJavaMethods()) {
++            QName name = m.getRequestPayloadName();
++            if (name == null)
++                name = EMPTY_PAYLOAD;
++            List<String> methods = unique.get(name);
++            if (methods == null) {
++                methods = new ArrayList<String>();
++                unique.put(name, methods);
++            }
++            methods.add(m.getMethod().getName());
+         }
++
++        // Log warnings about non unique payload QNames
++        for(QNameMap.Entry<List<String>> e : unique.entrySet()) {
++            if (e.getValue().size() > 1) {
++                LOGGER.warning(ServerMessages.NON_UNIQUE_DISPATCH_QNAME(e.getValue(), e.createQName()));
++            }
++        }
++
++        for( JavaMethodImpl m : model.getJavaMethods()) {
++            QName name = m.getRequestPayloadName();
++            if (name == null)
++                name = EMPTY_PAYLOAD;
++            // 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, new EndpointMethodHandler(invokerTube,m,binding));
++            }
++        }
+     }
+ 
+     /**
+-     * {@link PayloadQNameBasedDispatcher} never returns null because this is always
+-     * the last {@link EndpointMethodHandler} to kick in.
++     *
++     * @return not null if it finds a unique handler for the request
++     *         null otherwise
++     * @throws DispatchException if the payload itself is incorrect
+      */
+-    public @NotNull EndpointMethodHandler getEndpointMethodHandler(Packet request) throws DispatchException {
++    public @Nullable EndpointMethodHandler getEndpointMethodHandler(Packet request) throws DispatchException {
+         Message message = request.getMessage();
+         String localPart = message.getPayloadLocalPart();
+         String nsUri;
+@@ -77,18 +112,19 @@
+             nsUri = EMPTY_PAYLOAD_NSURI;
+         } else {
+             nsUri = message.getPayloadNamespaceURI();
++            if(nsUri == null)
++                nsUri = EMPTY_PAYLOAD_NSURI;
+         }
++        EndpointMethodHandler mh = methodHandlers.get(nsUri, localPart);
+ 
+-        EndpointMethodHandler h = methodHandlers.get(nsUri, localPart);
+-
+-        if (h==null) {
++        // Check if payload itself is correct. Usually it is, so let us check last
++        if (mh == null && !unique.containsKey(nsUri,localPart)) {
+             String dispatchKey = "{" + nsUri + "}" + localPart;
+-            String faultString = ServerMessages.DISPATCH_CANNOT_FIND_METHOD(dispatchKey, "Payload QName-based Dispatcher");
++            String faultString = ServerMessages.DISPATCH_CANNOT_FIND_METHOD(dispatchKey);
+             throw new DispatchException(SOAPFaultBuilder.createSOAPFaultMessage(
+-                binding.getSOAPVersion(), faultString, binding.getSOAPVersion().faultCodeClient));
++                 binding.getSOAPVersion(), faultString, binding.getSOAPVersion().faultCodeClient));
+         }
+-
+-        return h;
++        return mh;
+     }
+ 
+ }
+--- old/src/share/classes/com/sun/xml/internal/ws/server/sei/SEIInvokerTube.java	Thu Jul 30 18:35:06 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/server/sei/SEIInvokerTube.java	Thu Jul 30 18:35:06 2009
+@@ -34,8 +34,11 @@
+ 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 java.util.List;
++import java.text.MessageFormat;
+ 
+ /**
+  * This pipe is used to invoke SEI based endpoints.
+@@ -68,24 +71,26 @@
+      * that traverses through the Pipeline to transport.
+      */
+     public @NotNull NextAction processRequest(@NotNull Packet req) {
+-        Packet res = null;
+-
+-        try {
+-            for (EndpointMethodDispatcher dispatcher : dispatcherList) {
+-                EndpointMethodHandler handler = dispatcher.getEndpointMethodHandler(req);
+-                if (handler != null) {
+-                    res = handler.invoke(req);
+-                    break;
+-                }
++        for (EndpointMethodDispatcher dispatcher : dispatcherList) {
++            EndpointMethodHandler handler;
++            try {
++                handler = dispatcher.getEndpointMethodHandler(req);
++            } catch(DispatchException e) {
++                return doReturnWith(req.createServerResponse(e.fault, model.getPort(), null, binding));
+             }
+-        } catch (DispatchException e) {
+-            return doReturnWith(req.createServerResponse(e.fault, model.getPort(), null, binding));
++            if (handler != null) {
++                Packet res = handler.invoke(req);
++                assert res!=null;
++                return doReturnWith(res);
++            }
+         }
+-
+-        // PayloadQNameBasedDispatcher should throw DispatchException
+-        assert res!=null;
+-
+-        return doReturnWith(res);
++        String err = MessageFormat.format("Request=[SOAPAction={0},Payload='{'{1}'}'{2}]",
++                req.soapAction,req.getMessage().getPayloadNamespaceURI(),
++                req.getMessage().getPayloadLocalPart());
++        String faultString = ServerMessages.DISPATCH_CANNOT_FIND_METHOD(err);
++        Message faultMsg = SOAPFaultBuilder.createSOAPFaultMessage(
++            binding.getSOAPVersion(), faultString, binding.getSOAPVersion().faultCodeClient);
++        return doReturnWith(req.createServerResponse(faultMsg, model.getPort(), null, binding));
+     }
+ 
+     public @NotNull NextAction processResponse(@NotNull Packet response) {
+--- old/src/share/classes/com/sun/xml/internal/ws/spi/ProviderImpl.java	Thu Jul 30 18:35:10 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/spi/ProviderImpl.java	Thu Jul 30 18:35:09 2009
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright 2005-2008 Sun Microsystems, Inc.  All Rights Reserved.
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+  * 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,12 +27,15 @@
+ 
+ import com.sun.xml.internal.ws.api.BindingID;
+ import com.sun.xml.internal.ws.api.WSService;
+-import com.sun.xml.internal.ws.api.server.*;
+-import com.sun.xml.internal.ws.api.server.Container;
+ 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.model.wsdl.WSDLPort;
+ import com.sun.xml.internal.ws.api.model.wsdl.WSDLService;
++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.ContainerResolver;
++import com.sun.xml.internal.ws.api.server.Module;
++import com.sun.xml.internal.ws.api.server.WSEndpoint;
+ import com.sun.xml.internal.ws.api.wsdl.parser.WSDLParserExtension;
+ import com.sun.xml.internal.ws.client.WSServiceDelegate;
+ import com.sun.xml.internal.ws.developer.MemberSubmissionEndpointReference;
+@@ -51,7 +54,11 @@
+ import javax.xml.namespace.QName;
+ import javax.xml.transform.Source;
+ import javax.xml.transform.stream.StreamSource;
+-import javax.xml.ws.*;
++import javax.xml.ws.Endpoint;
++import javax.xml.ws.EndpointReference;
++import javax.xml.ws.Service;
++import javax.xml.ws.WebServiceException;
++import javax.xml.ws.WebServiceFeature;
+ import javax.xml.ws.spi.Provider;
+ import javax.xml.ws.spi.ServiceDelegate;
+ import javax.xml.ws.wsaddressing.W3CEndpointReference;
+@@ -131,12 +138,12 @@
+     }
+ 
+     public W3CEndpointReference createW3CEndpointReference(String address, QName serviceName, QName portName, List<Element> metadata, String wsdlDocumentLocation, List<Element> referenceParameters) {
++        Container container = ContainerResolver.getInstance().getContainer();
+         if (address == null) {
+             if (serviceName == null || portName == null) {
+                 throw new IllegalStateException(ProviderApiMessages.NULL_ADDRESS_SERVICE_ENDPOINT());
+             } else {
+                 //check if it is run in a Java EE Container and if so, get address using serviceName and portName
+-                Container container = ContainerResolver.getInstance().getContainer();
+                 Module module = container.getSPI(Module.class);
+                 if (module != null) {
+                     List<BoundEndpoint> beList = module.getBoundEndpoints();
+@@ -168,7 +175,7 @@
+ 
+                 URL wsdlLoc = new URL(wsdlDocumentLocation);
+                 WSDLModelImpl wsdlDoc = RuntimeWSDLParser.parse(wsdlLoc, new StreamSource(wsdlLoc.toExternalForm()), er,
+-                        false, ServiceFinder.find(WSDLParserExtension.class).toArray());
++                        false, container, ServiceFinder.find(WSDLParserExtension.class).toArray());
+                 if (serviceName != null) {
+                     WSDLService wsdlService = wsdlDoc.getService(serviceName);
+                     if (wsdlService == null)
+--- old/src/share/classes/com/sun/xml/internal/ws/streaming/DOMStreamReader.java	Thu Jul 30 18:35:13 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/streaming/DOMStreamReader.java	Thu Jul 30 18:35:13 2009
+@@ -115,12 +115,6 @@
+     private int depth = 0;
+ 
+     /**
+-     * Flag indicating if {@link #_namedNodeMap} is already split into
+-     * {@link #_currentAttributes} and {@link Scope#currentNamespaces}.
+-     */
+-    boolean _needAttributesSplit;
+-
+-    /**
+      * State of this reader. Any of the valid states defined in StAX'
+      * XMLStreamConstants class.
+      */
+@@ -254,9 +248,6 @@
+      * to attributes-proper and namespace decls.
+      */
+     private void splitAttributes() {
+-        if (!_needAttributesSplit) return;
+-        _needAttributesSplit = false;
+-
+         // Clear attribute and namespace lists
+         _currentAttributes.clear();
+ 
+@@ -281,7 +272,8 @@
+         ensureNs(_current);
+         for( int i=_currentAttributes.size()-1; i>=0; i-- ) {
+             Attr a = _currentAttributes.get(i);
+-            ensureNs(a);
++            if(fixNull(a.getNamespaceURI()).length()>0)
++                ensureNs(a);    // no need to declare "" for attributes in the default namespace
+         }
+     }
+ 
+@@ -300,7 +292,7 @@
+         String uri = fixNull(n.getNamespaceURI());
+ 
+         Scope scope = scopes[depth];
+-        
++
+         String currentUri = scope.getNamespaceURI(prefix);
+ 
+         if(prefix.length()==0) {
+@@ -312,8 +304,10 @@
+                 return; // declared correctly
+         }
+ 
+-        // needs to be declared
++        if(prefix.equals("xml") || prefix.equals("xmlns"))
++            return; // implicitly declared namespaces
+ 
++        // needs to be declared
+         scope.additionalNamespaces.add(prefix);
+         scope.additionalNamespaces.add(uri);
+     }
+@@ -322,7 +316,7 @@
+      * Allocate new {@link Scope} for {@link #splitAttributes()}.
+      */
+     private Scope allocateScope() {
+-        if(scopes.length==depth) {
++        if(scopes.length==++depth) {
+             Scope[] newBuf = new Scope[scopes.length*2];
+             System.arraycopy(scopes,0,newBuf,0,scopes.length);
+             scopes = newBuf;
+@@ -337,10 +331,8 @@
+     }
+ 
+     public int getAttributeCount() {
+-        if (_state == START_ELEMENT) {
+-            splitAttributes();
++        if (_state == START_ELEMENT)
+             return _currentAttributes.size();
+-        }
+         throw new IllegalStateException("DOMStreamReader: getAttributeCount() called in illegal state");
+     }
+ 
+@@ -349,8 +341,6 @@
+      */
+     public String getAttributeLocalName(int index) {
+         if (_state == START_ELEMENT) {
+-            splitAttributes();
+-
+             String localName = _currentAttributes.get(index).getLocalName();
+             return (localName != null) ? localName :
+                 QName.valueOf(_currentAttributes.get(index).getNodeName()).getLocalPart();
+@@ -363,8 +353,6 @@
+      */
+     public QName getAttributeName(int index) {
+         if (_state == START_ELEMENT) {
+-            splitAttributes();
+-
+             Node attr = _currentAttributes.get(index);
+             String localName = attr.getLocalName();
+             if (localName != null) {
+@@ -381,7 +369,6 @@
+ 
+     public String getAttributeNamespace(int index) {
+         if (_state == START_ELEMENT) {
+-            splitAttributes();
+             String uri = _currentAttributes.get(index).getNamespaceURI();
+             return fixNull(uri);
+         }
+@@ -390,7 +377,6 @@
+ 
+     public String getAttributePrefix(int index) {
+         if (_state == START_ELEMENT) {
+-            splitAttributes();
+             String prefix = _currentAttributes.get(index).getPrefix();
+             return fixNull(prefix);
+         }
+@@ -406,7 +392,6 @@
+ 
+     public String getAttributeValue(int index) {
+         if (_state == START_ELEMENT) {
+-            splitAttributes();
+             return _currentAttributes.get(index).getNodeValue();
+         }
+         throw new IllegalStateException("DOMStreamReader: getAttributeValue() called in illegal state");
+@@ -414,7 +399,6 @@
+ 
+     public String getAttributeValue(String namespaceURI, String localName) {
+         if (_state == START_ELEMENT) {
+-            splitAttributes();
+             if (_namedNodeMap != null) {
+                 Node attr = _namedNodeMap.getNamedItemNS(namespaceURI, localName);
+                 return attr != null ? attr.getNodeValue() : null;
+@@ -489,7 +473,6 @@
+      */
+     private Scope getCheckedScope() {
+         if (_state == START_ELEMENT || _state == END_ELEMENT) {
+-            splitAttributes();
+             return scopes[depth];
+         }
+         throw new IllegalStateException("DOMStreamReader: neither on START_ELEMENT nor END_ELEMENT");
+@@ -516,8 +499,8 @@
+     }
+ 
+     /**
+-     * This method is not particularly fast, but shouldn't be called very 
+-     * often. If we start to use it more, we should keep track of the 
++     * This method is not particularly fast, but shouldn't be called very
++     * often. If we start to use it more, we should keep track of the
+      * NS declarations using a NamespaceContext implementation instead.
+      */
+     public String getNamespaceURI(String prefix) {
+@@ -532,7 +515,6 @@
+         }
+ 
+         // check scopes
+-        splitAttributes();
+         String nsUri = scopes[depth].getNamespaceURI(prefix);
+         if(nsUri!=null)    return nsUri;
+ 
+@@ -562,7 +544,6 @@
+         }
+ 
+         // check scopes
+-        splitAttributes();
+         String prefix = scopes[depth].getPrefix(nsUri);
+         if(prefix!=null)    return prefix;
+ 
+@@ -754,27 +735,30 @@
+     public int next() throws XMLStreamException {
+         while(true) {
+             int r = _next();
+-            if(r!=CHARACTERS)   return r;
++            switch (r) {
++            case CHARACTERS:
++                // if we are currently at text node, make sure that this is a meaningful text node.
++                Node prev = _current.getPreviousSibling();
++                if(prev!=null && prev.getNodeType()==Node.TEXT_NODE)
++                    continue;   // nope. this is just a continuation of previous text that should be invisible
+ 
+-            // if we are currently at text node, make sure that this is a meaningful text node.
+-            Node prev = _current.getPreviousSibling();
+-            if(prev!=null && prev.getNodeType()==Node.TEXT_NODE)
+-                continue;   // nope. this is just a continuation of previous text that should be invisible
+-
+-            Text t = (Text)_current;
+-            wholeText = t.getWholeText();
+-            if(wholeText.length()==0)
+-                continue;   // nope. this is empty text.
+-            return CHARACTERS;
++                Text t = (Text)_current;
++                wholeText = t.getWholeText();
++                if(wholeText.length()==0)
++                    continue;   // nope. this is empty text.
++                return CHARACTERS;
++            case START_ELEMENT:
++                splitAttributes();
++                return START_ELEMENT;
++            default:
++                return r;
++            }
+         }
+     }
+-    
++
+     private int _next() throws XMLStreamException {
+         Node child;
+ 
+-        // Indicate that attributes still need processing
+-        _needAttributesSplit = true;
+-
+         switch (_state) {
+             case END_DOCUMENT:
+                 throw new IllegalStateException("DOMStreamReader: Calling next() at END_DOCUMENT");
+@@ -793,8 +777,6 @@
+                     return (_state = mapNodeTypeToState(_current.getNodeType()));
+                 }
+             case START_ELEMENT:
+-                depth++;
+-
+                 child = _current.getFirstChild();
+                 if (child == null) {
+                     return (_state = END_ELEMENT);
+--- old/src/share/classes/com/sun/xml/internal/ws/streaming/SourceReaderFactory.java	Thu Jul 30 18:35:17 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/streaming/SourceReaderFactory.java	Thu Jul 30 18:35:16 2009
+@@ -46,12 +46,12 @@
+  * @author Santiago.PericasGeertsen@sun.com
+  */
+ public class SourceReaderFactory {
+-    
++
+     /**
+      * FI FastInfosetSource class.
+      */
+     static Class fastInfosetSourceClass;
+-    
++
+     /**
+      * FI <code>StAXDocumentSerializer.setEncoding()</code> method via reflection.
+      */
+@@ -62,9 +62,9 @@
+         try {
+             fastInfosetSourceClass =
+                 Class.forName("com.sun.xml.internal.org.jvnet.fastinfoset.FastInfosetSource");
+-            fastInfosetSource_getInputStream = 
++            fastInfosetSource_getInputStream =
+                 fastInfosetSourceClass.getMethod("getInputStream");
+-        } 
++        }
+         catch (Exception e) {
+             fastInfosetSourceClass = null;
+         }
+@@ -73,7 +73,7 @@
+     public static XMLStreamReader createSourceReader(Source source, boolean rejectDTDs) {
+         return createSourceReader(source, rejectDTDs, null);
+     }
+-    
++
+     public static XMLStreamReader createSourceReader(Source source, boolean rejectDTDs, String charsetName) {
+         try {
+             if (source instanceof StreamSource) {
+@@ -84,7 +84,7 @@
+                     // Wrap input stream in Reader if charset is specified
+                     if (charsetName != null) {
+                         return XMLStreamReaderFactory.create(
+-                            source.getSystemId(), new InputStreamReader(is, charsetName), rejectDTDs);                    
++                            source.getSystemId(), new InputStreamReader(is, charsetName), rejectDTDs);
+                     }
+                     else {
+                         return XMLStreamReaderFactory.create(
+@@ -124,7 +124,7 @@
+             else {
+                 throw new XMLReaderException("sourceReader.invalidSource",
+                         source.getClass().getName());
+-            }        
++            }
+         }
+         catch (Exception e) {
+             throw new XMLReaderException(e);
+--- old/src/share/classes/com/sun/xml/internal/ws/streaming/XMLReaderException.java	Thu Jul 30 18:35:21 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/streaming/XMLReaderException.java	Thu Jul 30 18:35:20 2009
+@@ -31,10 +31,9 @@
+ /**
+  * <p> XMLReaderException represents an exception that occurred while reading an
+  * XML document. </p>
+- * 
+- * @see XMLReader
++ *
+  * @see JAXWSExceptionBase
+- * 
++ *
+  * @author WS Development Team
+  */
+ public class XMLReaderException extends JAXWSExceptionBase {
+--- old/src/share/classes/com/sun/xml/internal/ws/streaming/XMLStreamReaderException.java	Thu Jul 30 18:35:24 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/streaming/XMLStreamReaderException.java	Thu Jul 30 18:35:23 2009
+@@ -31,9 +31,9 @@
+ /**
+  * <p> XMLStream ReaderException represents an exception that occurred while reading an
+  * XML document. </p>
+- * 
++ *
+  * @see JAXWSExceptionBase
+- * 
++ *
+  * @author WS Development Team
+  */
+ public class XMLStreamReaderException extends JAXWSExceptionBase {
+--- old/src/share/classes/com/sun/xml/internal/ws/streaming/XMLStreamReaderUtil.java	Thu Jul 30 18:35:27 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/streaming/XMLStreamReaderUtil.java	Thu Jul 30 18:35:27 2009
+@@ -29,6 +29,7 @@
+ import static javax.xml.stream.XMLStreamConstants.*;
+ import javax.xml.stream.XMLStreamException;
+ import javax.xml.stream.XMLStreamReader;
++import javax.xml.stream.XMLStreamConstants;
+ 
+ /**
+  * <p> XMLStreamReaderUtil provides some utility methods intended to be used
+@@ -49,6 +50,16 @@
+         }
+     }
+ 
++    public static void readRest(XMLStreamReader reader) {
++        try {
++            while(reader.getEventType() != XMLStreamConstants.END_DOCUMENT) {
++                reader.next();
++            }
++        } catch (XMLStreamException e) {
++            throw wrapException(e);
++        }
++    }
++
+     public static int next(XMLStreamReader reader) {
+         try {
+             int readerEvent = reader.next();
+@@ -170,7 +181,7 @@
+ 
+     /**
+      * Read all attributes into an data structure. Note that this method cannot
+-     * be called multiple times to get the same list of attributes. 
++     * be called multiple times to get the same list of attributes.
+      */
+     public static Attributes getAttributes(XMLStreamReader reader) {
+         return (reader.getEventType() == START_ELEMENT ||
+@@ -195,7 +206,7 @@
+                     "{" + reader.getNamespaceURI() + "}" + reader.getLocalName());
+         }
+     }
+-    
++
+     public static void verifyTag(XMLStreamReader reader, QName name) {
+         verifyTag(reader, name.getNamespaceURI(), name.getLocalPart());
+     }
+@@ -240,7 +251,7 @@
+                 return "UNKNOWN";
+         }
+     }
+-    
++
+     private static XMLStreamReaderException wrapException(XMLStreamException e) {
+         return new XMLStreamReaderException("xmlreader.ioException",e);
+     }
+--- old/src/share/classes/com/sun/xml/internal/ws/streaming/XMLStreamWriterException.java	Thu Jul 30 18:35:31 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/streaming/XMLStreamWriterException.java	Thu Jul 30 18:35:30 2009
+@@ -31,9 +31,9 @@
+ /**
+  * <p> XMLWriterException represents an exception that occurred while writing
+  * an XML document. </p>
+- * 
++ *
+  * @see JAXWSExceptionBase
+- * 
++ *
+  * @author WS Development Team
+  */
+ public class XMLStreamWriterException extends JAXWSExceptionBase {
+--- old/src/share/classes/com/sun/xml/internal/ws/streaming/XMLStreamWriterUtil.java	Thu Jul 30 18:35:34 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/streaming/XMLStreamWriterUtil.java	Thu Jul 30 18:35:34 2009
+@@ -53,34 +53,45 @@
+      * @throws XMLStreamException if any of writer operations throw the exception
+      */
+     public static @Nullable OutputStream getOutputStream(XMLStreamWriter writer) throws XMLStreamException {
+-        // SJSXP
++        Object obj = null;
++
++        // Hack for JDK6's SJSXP
+         if (writer instanceof Map) {
+-            Object obj = ((Map) writer).get("sjsxp-outputstream");
+-            if (obj != null) {
+-                writer.writeCharacters("");  // Force completion of open elems
+-                return (OutputStream)obj;
+-            }
++            obj = ((Map) writer).get("sjsxp-outputstream");
+         }
++
+         // woodstox
+-        try {
+-            Object obj = writer.getProperty("com.ctc.wstx.outputUnderlyingStream");
+-            if (obj != null) {
+-                writer.writeCharacters("");  // Force completion of open elems
+-                writer.flush();
+-                return (OutputStream)obj;
++        if (obj == null) {
++            try {
++                obj = writer.getProperty("com.ctc.wstx.outputUnderlyingStream");
++            } catch(Exception ie) {
++                // Catch all exceptions. SJSXP in JDK throws NPE
++                // nothing to do here
+             }
+-        } catch(Exception ie) {
+-            //Above property lookup causes NPE on JDK6u1, should be ignored.
+-            // We should not fail due to such lookups.
++        }
+ 
+-            // nothing to do here
++        // SJSXP
++        if (obj == null) {
++            try {
++                obj = writer.getProperty("http://java.sun.com/xml/stream/properties/outputstream");
++            } catch(Exception ie) {
++                // Catch all exceptions. SJSXP in JDK throws NPE
++                // nothing to do here
++            }
+         }
++
++
++        if (obj != null) {
++            writer.writeCharacters("");  // Force completion of open elems
++            writer.flush();
++            return (OutputStream)obj;
++        }
+         return null;
+     }
+ 
+ 
+     public static String encodeQName(XMLStreamWriter writer, QName qname,
+-        PrefixFactory prefixFactory) 
++        PrefixFactory prefixFactory)
+     {
+         // NOTE: Here it is assumed that we do not serialize using default
+         // namespace declarations and therefore that writer.getPrefix will
+@@ -92,7 +103,7 @@
+ 
+             if (namespaceURI == null || namespaceURI.equals("")) {
+                 return localPart;
+-            } 
++            }
+             else {
+                 String prefix = writer.getPrefix(namespaceURI);
+                 if (prefix == null) {
+--- old/src/share/classes/com/sun/xml/internal/ws/transport/Headers.java	Thu Jul 30 18:35:38 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/Headers.java	Thu Jul 30 18:35:37 2009
+@@ -49,7 +49,7 @@
+  * HeaderName: value2
+  * </blockquote></pre>
+  * <p>
+- * All the normal {@link java.util.Map} methods are provided, but the following 
++ * All the normal {@link java.util.Map} methods are provided, but the following
+  * additional convenience methods are most likely to be used:
+  * <ul>
+  * <li>{@link #getFirst(String)} returns a single valued header or the first value of
+@@ -58,7 +58,7 @@
+  * <li>{@link #set(String,String)} sets the given header field to the single value given
+  * overwriting any existing values in the value list.
+  * </ul><p>
+- * All methods in this class accept <code>null</code> values for keys and values. However, null 
++ * All methods in this class accept <code>null</code> values for keys and values. However, null
+  * keys will never will be present in HTTP request headers, and will not be output/sent in response headers.
+  * Null values can be represented as either a null entry for the key (i.e. the list is null) or
+  * where the key has a list, but one (or more) of the list's values is null. Null values are output
+@@ -75,7 +75,7 @@
+ 
+     /* Normalize the key by converting to following form.
+      * First char upper case, rest lower case.
+-     * key is presumed to be ASCII 
++     * key is presumed to be ASCII
+      */
+     private String normalize (String key) {
+         if (key == null) {
+@@ -208,4 +208,9 @@
+     public int hashCode() {
+         return map.hashCode();
+     }
++
++    @Override
++    public String toString() {
++        return map.toString();
++    }
+ }
+--- old/src/share/classes/com/sun/xml/internal/ws/transport/http/DeploymentDescriptorParser.java	Thu Jul 30 18:35:41 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/DeploymentDescriptorParser.java	Thu Jul 30 18:35:41 2009
+@@ -28,8 +28,8 @@
+ 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.server.Container;
+-import com.sun.xml.internal.ws.api.server.InstanceResolver;
+ 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;
+@@ -74,7 +74,7 @@
+  * Parses {@code sun-jaxws.xml} into {@link WSEndpoint}.
+  *
+  * <p>
+- * Since {@code sun-jaxws.xml} captures more information that what {@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}.
+@@ -171,6 +171,8 @@
+         if (paths != null) {
+             for (String path : paths) {
+                 if (path.endsWith("/")) {
++                    if(path.endsWith("/CVS/") || path.endsWith("/.svn/"))
++                        continue;
+                     collectDocs(path);
+                 } else {
+                     URL res = loader.getResource(path);
+@@ -239,7 +241,7 @@
+             ensureNoContent(reader);
+             WSEndpoint<?> endpoint = WSEndpoint.create(
+                     implementorClass, !handlersSetInDD,
+-                    InstanceResolver.createDefault(implementorClass).createInvoker(),
++                    null,
+                     serviceName, portName, container, binding,
+                     primaryWSDL, docs.values(), createEntityResolver(),false
+             );
+@@ -520,6 +522,7 @@
+         }
+     }
+ 
++
+     /**
+      * Loads the class of the given name.
+      *
+--- old/src/share/classes/com/sun/xml/internal/ws/transport/http/HttpAdapter.java	Thu Jul 30 18:35:45 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/HttpAdapter.java	Thu Jul 30 18:35:44 2009
+@@ -36,7 +36,10 @@
+ import com.sun.xml.internal.ws.api.pipe.ContentType;
+ import com.sun.xml.internal.ws.api.server.AbstractServerAsyncTransport;
+ import com.sun.xml.internal.ws.api.server.Adapter;
++import com.sun.xml.internal.ws.api.server.BoundEndpoint;
+ import com.sun.xml.internal.ws.api.server.DocumentAddressResolver;
++import com.sun.xml.internal.ws.api.server.EndpointComponent;
++import com.sun.xml.internal.ws.api.server.Module;
+ import com.sun.xml.internal.ws.api.server.PortAddressResolver;
+ import com.sun.xml.internal.ws.api.server.SDDocument;
+ import com.sun.xml.internal.ws.api.server.ServiceDefinition;
+@@ -48,7 +51,9 @@
+ import com.sun.xml.internal.ws.server.UnsupportedMediaException;
+ import com.sun.xml.internal.ws.util.ByteArrayBuffer;
+ 
++import javax.xml.ws.Binding;
+ import javax.xml.ws.WebServiceException;
++import javax.xml.ws.http.HTTPBinding;
+ import java.io.IOException;
+ import java.io.InputStream;
+ import java.io.OutputStream;
+@@ -93,6 +98,12 @@
+     public final HttpAdapterList<? extends HttpAdapter> owner;
+ 
+     /**
++     * Servlet URL pattern with which this {@link HttpAdapter} is associated.
++     */
++    public final String urlPattern;
++
++
++    /**
+      * Creates a lone {@link HttpAdapter} that does not know of any other
+      * {@link HttpAdapter}s.
+      *
+@@ -106,9 +117,18 @@
+         return new DummyList().createAdapter("","",endpoint);
+     }
+ 
++    /**
++     * @deprecated
++     *      remove as soon as we can update the test util.
++     */
+     protected HttpAdapter(WSEndpoint endpoint, HttpAdapterList<? extends HttpAdapter> owner) {
++        this(endpoint,owner,null);
++    }
++
++    protected HttpAdapter(WSEndpoint endpoint, HttpAdapterList<? extends HttpAdapter> owner, String urlPattern) {
+         super(endpoint);
+         this.owner = owner;
++        this.urlPattern = urlPattern;
+ 
+         // fill in WSDL map
+         ServiceDefinition sdef = this.endpoint.getServiceDefinition();
+@@ -122,13 +142,13 @@
+             Map<String, SDDocument> systemIds = new TreeMap<String, SDDocument>();
+             for (SDDocument sdd : sdef) {
+                 if (sdd == sdef.getPrimary()) { // No sorting for Primary WSDL
+-                    wsdls.put("wsdl", sdd);     
++                    wsdls.put("wsdl", sdd);
+                     wsdls.put("WSDL", sdd);
+                 } else {
+                     systemIds.put(sdd.getURL().toString(), sdd);
+                 }
+             }
+-            
++
+             int wsdlnum = 1;
+             int xsdnum = 1;
+             for (Map.Entry<String, SDDocument> e : systemIds.entrySet()) {
+@@ -150,6 +170,18 @@
+         }
+     }
+ 
++    /**
++     * Returns the "/abc/def/ghi" portion if
++     * the URL pattern is "/abc/def/ghi/*".
++     */
++    public String getValidPath() {
++        if (urlPattern.endsWith("/*")) {
++            return urlPattern.substring(0, urlPattern.length() - 2);
++        } else {
++            return urlPattern;
++        }
++    }
++
+     protected HttpToolkit createToolkit() {
+         return new HttpToolkit();
+     }
+@@ -173,6 +205,29 @@
+      * @throws IOException when I/O errors happen
+      */
+     public void handle(@NotNull WSHTTPConnection connection) throws IOException {
++        if(connection.getRequestMethod().equals("GET")) {
++            // metadata query. let the interceptor run
++            for( EndpointComponent c : endpoint.getComponentRegistry() ) {
++                HttpMetadataPublisher spi = c.getSPI(HttpMetadataPublisher.class);
++                if(spi!=null && spi.handleMetadataRequest(this,connection))
++                    return; // handled
++            }
++
++            if (isMetadataQuery(connection.getQueryString())) {
++                // Sends published WSDL and schema documents as the default action.
++                publishWSDL(connection);
++                return;
++            }
++
++            Binding binding = getEndpoint().getBinding();
++            if (!(binding instanceof HTTPBinding)) {
++                // Writes HTML page with all the endpoint descriptions
++                writeWebServicesHtmlPage(connection);
++                return;
++            }
++        }
++
++        // normal request handling
+         HttpToolkit tk = pool.take();
+         try {
+             tk.handle(connection);
+@@ -194,7 +249,7 @@
+         String ct = con.getRequestHeader("Content-Type");
+         InputStream in = con.getInput();
+         Packet packet = new Packet();
+-        packet.soapAction = con.getRequestHeader("SOAPAction");
++        packet.soapAction = fixQuotesAroundSoapAction(con.getRequestHeader("SOAPAction"));
+         packet.wasTransportSecure = con.isSecure();
+         packet.acceptableMimeTypes = con.getRequestHeader("Accept");
+         packet.addSatellite(con);
+@@ -204,6 +259,7 @@
+         if (dump) {
+             ByteArrayBuffer buf = new ByteArrayBuffer();
+             buf.write(in);
++            in.close();
+             dump(buf, "HTTP request", con.getRequestHeaders());
+             in = buf.newInputStream();
+         }
+@@ -211,9 +267,27 @@
+         return packet;
+     }
+ 
++    /**
++     * 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.
++     *
++     * @param soapAction SoapAction HTTP Header
++     * @return
++     */
++    private String fixQuotesAroundSoapAction(String soapAction) {
++        if(soapAction != null && (!soapAction.startsWith("\"") || !soapAction.endsWith("\"")) ) {
++            LOGGER.warning("Received WS-I BP non-conformant Unquoted SoapAction HTTP header: "+ soapAction);
++            String fixedSoapAction = soapAction;
++            if(!soapAction.startsWith("\""))
++                fixedSoapAction = "\"" + fixedSoapAction;
++            if(!soapAction.endsWith("\""))
++                fixedSoapAction = fixedSoapAction + "\"";
++            return fixedSoapAction;
++        }
++        return soapAction;
++    }
+ 
+ 
+-
+     private void encodePacket(@NotNull Packet packet, @NotNull WSHTTPConnection con, @NotNull Codec codec) throws IOException {
+         if (con.isClosed()) {
+             return;                 // Connection is already closed
+@@ -347,7 +421,12 @@
+         public void close() {
+             if(!con.isClosed()) {
+                 // close the response channel now
+-                con.setStatus(WSHTTPConnection.ONEWAY);
++                if (con.getStatus() == 0) {
++                    // if the appliation didn't set the status code,
++                    // set the default one.
++                    con.setStatus(WSHTTPConnection.ONEWAY);
++                }
++
+                 try {
+                     con.getOutput().close(); // no payload
+                 } catch (IOException e) {
+@@ -360,10 +439,12 @@
+ 
+     final class HttpToolkit extends Adapter.Toolkit {
+         public void handle(WSHTTPConnection con) throws IOException {
++            boolean invoke = false;
+             try {
+                 Packet packet = new Packet();
+                 try {
+                     packet = decodePacket(con, codec);
++                    invoke = true;
+                 } catch(ExceptionHasMessage e) {
+                     LOGGER.log(Level.SEVERE, e.getMessage(), e);
+                     packet.setMessage(e.getFaultMessage());
+@@ -370,10 +451,11 @@
+                 } catch(UnsupportedMediaException e) {
+                     LOGGER.log(Level.SEVERE, e.getMessage(), e);
+                     con.setStatus(WSHTTPConnection.UNSUPPORTED_MEDIA);
+-                } catch(ServerRtException e) {
++                } catch(Exception e) {
+                     LOGGER.log(Level.SEVERE, e.getMessage(), e);
++                    con.setStatus(HttpURLConnection.HTTP_INTERNAL_ERROR);
+                 }
+-                if (packet.getMessage() != null && !packet.getMessage().isFault()) {
++                if (invoke) {
+                     try {
+                         packet = head.process(packet, con.getWebServiceContextDelegate(),
+                                 packet.transportBackChannel);
+@@ -403,7 +485,7 @@
+      * @return true for metadata requests
+      *         false for web service requests
+      */
+-    public final boolean isMetadataQuery(String query) {
++    private boolean isMetadataQuery(String query) {
+         // we intentionally return true even if documents don't exist,
+         // so that they get 404.
+         return query != null && (query.equals("WSDL") || query.startsWith("wsdl") || query.startsWith("xsd="));
+@@ -414,24 +496,12 @@
+      * in response to the GET requests to URLs like "?wsdl" or "?xsd=2".
+      *
+      * @param con
+-     *      The connection to which the data will be sent. Must not be null.
+-     * @param baseAddress
+-     *      The requested base URL (such as "http://myhost:2045/foo/bar").
+-     *      Used to reference other resoures. Must not be null.
+-     * @param queryString
+-     *      The query string given by the client (which indicates
+-     *      what document to serve.) Can be null (but it causes an 404 not found.)
++     *      The connection to which the data will be sent.
+      *
+      * @throws IOException when I/O errors happen
+      */
+-    public void publishWSDL(WSHTTPConnection con, final String baseAddress, String queryString) throws IOException {
+-        // Workaround for a bug in http server. Read and close InputStream
+-        // TODO remove once the bug is fixed in http server
+-        InputStream in = con.getInput();
+-        while(in.read() != -1);
+-        in.close();
+-
+-        SDDocument doc = wsdls.get(queryString);
++    public void publishWSDL(@NotNull WSHTTPConnection con) throws IOException {
++        SDDocument doc = wsdls.get(con.getQueryString());
+         if (doc == null) {
+             writeNotFoundErrorPage(con,"Invalid Request");
+             return;
+@@ -438,11 +508,11 @@
+         }
+ 
+         con.setStatus(HttpURLConnection.HTTP_OK);
+-        con.setContentTypeResponseHeader("text/xml;charset=utf-8");
++        con.setContentTypeResponseHeader("text/xml;charset=\"utf-8\"");
+ 
+         OutputStream os = con.getProtocol().contains("1.1") ? con.getOutput() : new Http10OutputStream(con);
+ 
+-        final PortAddressResolver portAddressResolver = owner.createPortAddressResolver(baseAddress);
++        final PortAddressResolver portAddressResolver = owner.createPortAddressResolver(con.getBaseAddress());
+         final String address = portAddressResolver.getAddressFor(endpoint.getServiceName(), endpoint.getPortName().getLocalPart());
+         assert address != null;
+         DocumentAddressResolver resolver = new DocumentAddressResolver() {
+@@ -480,7 +550,7 @@
+ 
+     private void writeNotFoundErrorPage(WSHTTPConnection con, String message) throws IOException {
+         con.setStatus(HttpURLConnection.HTTP_NOT_FOUND);
+-        con.setContentTypeResponseHeader("text/html; charset=UTF-8");
++        con.setContentTypeResponseHeader("text/html; charset=\"utf-8\"");
+ 
+         PrintWriter out = new PrintWriter(new OutputStreamWriter(con.getOutput(),"UTF-8"));
+         out.println("<html>");
+@@ -502,7 +572,7 @@
+     private static final class DummyList extends HttpAdapterList<HttpAdapter> {
+         @Override
+         protected HttpAdapter createHttpAdapter(String name, String urlPattern, WSEndpoint<?> endpoint) {
+-            return new HttpAdapter(endpoint, this);
++            return new HttpAdapter(endpoint,this,urlPattern);
+         }
+     }
+ 
+@@ -526,20 +596,95 @@
+     }
+ 
+     /**
++     * Generates the listing of all services.
++     */
++    private void writeWebServicesHtmlPage(WSHTTPConnection con) throws IOException {
++        if (!publishStatusPage) return;
++
++        // TODO: resurrect the ability to localize according to the current request.
++
++        // standard browsable page
++        con.setStatus(WSHTTPConnection.OK);
++        con.setContentTypeResponseHeader("text/html; charset=\"utf-8\"");
++
++        PrintWriter out = new PrintWriter(new OutputStreamWriter(con.getOutput(),"UTF-8"));
++        out.println("<html>");
++        out.println("<head><title>");
++        // out.println("Web Services");
++        out.println(WsservletMessages.SERVLET_HTML_TITLE());
++        out.println("</title></head>");
++        out.println("<body>");
++        // out.println("<h1>Web Services</h1>");
++        out.println(WsservletMessages.SERVLET_HTML_TITLE_2());
++
++        // what endpoints do we have in this system?
++        Module module = getEndpoint().getContainer().getSPI(Module.class);
++        List<BoundEndpoint> endpoints = Collections.emptyList();
++        if(module!=null) {
++            endpoints = module.getBoundEndpoints();
++        }
++
++        if (endpoints.isEmpty()) {
++            // out.println("<p>No JAX-WS context information available.</p>");
++            out.println(WsservletMessages.SERVLET_HTML_NO_INFO_AVAILABLE());
++        } else {
++            out.println("<table width='100%' border='1'>");
++            out.println("<tr>");
++            out.println("<td>");
++            // out.println("Endpoint");
++            out.println(WsservletMessages.SERVLET_HTML_COLUMN_HEADER_PORT_NAME());
++            out.println("</td>");
++
++            out.println("<td>");
++            // out.println("Information");
++            out.println(WsservletMessages.SERVLET_HTML_COLUMN_HEADER_INFORMATION());
++            out.println("</td>");
++            out.println("</tr>");
++
++            for (BoundEndpoint a : endpoints) {
++                String endpointAddress = a.getAddress(con.getBaseAddress()).toString();
++                out.println("<tr>");
++
++                out.println("<td>");
++                out.println(WsservletMessages.SERVLET_HTML_ENDPOINT_TABLE(
++                    a.getEndpoint().getServiceName(),
++                    a.getEndpoint().getPortName()
++                ));
++                out.println("</td>");
++
++                out.println("<td>");
++                out.println(WsservletMessages.SERVLET_HTML_INFORMATION_TABLE(
++                    endpointAddress,
++                    a.getEndpoint().getImplementationClass().getName()
++                ));
++                out.println("</td>");
++
++                out.println("</tr>");
++            }
++            out.println("</table>");
++        }
++        out.println("</body>");
++        out.println("</html>");
++        out.close();
++    }
++
++    /**
+      * Dumps what goes across HTTP transport.
+      */
+-    public static boolean dump;
++    public static boolean dump = false;
+ 
++    public static boolean publishStatusPage = true;
++
+     static {
+-        boolean b;
+         try {
+-            b = Boolean.getBoolean(HttpAdapter.class.getName()+".dump");
++            dump = Boolean.getBoolean(HttpAdapter.class.getName()+".dump");
+         } catch( Throwable t ) {
+-            b = false;
+         }
+-        dump = b;
++        try {
++            publishStatusPage = System.getProperty(HttpAdapter.class.getName()+".publishStatusPage").equals("true");
++        } catch( Throwable t ) {
++        }
+     }
+ 
+     private static final Logger LOGGER = Logger.getLogger(HttpAdapter.class.getName());
+-
+ }
+--- old/src/share/classes/com/sun/xml/internal/ws/transport/http/WSHTTPConnection.java	Thu Jul 30 18:35:49 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/WSHTTPConnection.java	Thu Jul 30 18:35:48 2009
+@@ -89,7 +89,7 @@
+      *      This parameter may not be null, but since the user application
+      *      code may invoke this method, a graceful error checking with
+      *      an helpful error message should be provided if it's actually null.
+-     * @see #setContentTypeResponseHeader(String) 
++     * @see #setContentTypeResponseHeader(String)
+      */
+     public abstract void setResponseHeaders(@NotNull Map<String,List<String>> headers);
+ 
+@@ -120,7 +120,7 @@
+      * so do not consider the value to be final until {@link #getOutput()}
+      * is invoked.
+      */
+-    
++
+     public abstract void setStatus(int status);
+ 
+     /**
+@@ -214,6 +214,16 @@
+     public abstract @Nullable String getPathInfo();
+ 
+     /**
++     * Gets the absolute URL up to the context path.
++     * @return
++     *      String like "http://myhost/myapp"
++     * @since 2.1.2
++     */
++    public @NotNull String getBaseAddress() {
++        throw new UnsupportedOperationException();
++    }
++
++    /**
+      * Whether connection is HTTPS or not
+      *
+      * @return if the received request is on HTTPS, return true
+@@ -253,5 +263,5 @@
+      */
+     public void setContentLengthResponseHeader(int value) {
+     }
+-    
++
+ }
+--- old/src/share/classes/com/sun/xml/internal/ws/transport/http/client/HttpClientTransport.java	Thu Jul 30 18:35:52 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/client/HttpClientTransport.java	Thu Jul 30 18:35:51 2009
+@@ -33,6 +33,7 @@
+ import com.sun.xml.internal.ws.resources.ClientMessages;
+ import com.sun.xml.internal.ws.transport.Headers;
+ import com.sun.xml.internal.ws.developer.JAXWSProperties;
++import com.sun.xml.internal.ws.util.RuntimeVersion;
+ import com.sun.istack.internal.Nullable;
+ import com.sun.istack.internal.NotNull;
+ 
+@@ -47,6 +48,8 @@
+ import static javax.xml.ws.BindingProvider.SESSION_MAINTAIN_PROPERTY;
+ import javax.xml.ws.WebServiceException;
+ import javax.xml.ws.handler.MessageContext;
++import java.io.FilterInputStream;
++import java.io.FilterOutputStream;
+ import java.io.IOException;
+ import java.io.InputStream;
+ import java.io.OutputStream;
+@@ -63,7 +66,7 @@
+  * @author WS Development Team
+  */
+ final class HttpClientTransport {
+-    
++
+     // Need to use JAXB first to register DatatypeConverter
+     static {
+         try {
+@@ -72,12 +75,9 @@
+             // Nothing much can be done. Intentionally left empty
+         }
+     }
+-    private static String LAST_ENDPOINT = "";
+-    private static boolean redirect = true;
+-    private static final int START_REDIRECT_COUNT = 3;
+-    private static int redirectCount = START_REDIRECT_COUNT;
+ 
+     /*package*/ int statusCode;
++    /*package*/ String statusMessage;
+     private final Map<String, List<String>> reqHeaders;
+     private Map<String, List<String>> respHeaders = null;
+ 
+@@ -84,10 +84,9 @@
+     private OutputStream outputStream;
+     private boolean https;
+     private HttpURLConnection httpConnection = null;
+-    private EndpointAddress endpoint = null;
+-    private Packet context = null;
++    private final EndpointAddress endpoint;
++    private final Packet context;
+     private CookieJar cookieJar = null;
+-    private boolean isFailure = false;
+     private final Integer chunkSize;
+ 
+ 
+@@ -98,7 +97,7 @@
+         chunkSize = (Integer)context.invocationProperties.get(JAXWSProperties.HTTP_CLIENT_STREAMING_CHUNK_SIZE);
+     }
+ 
+-    /**
++    /*
+      * Prepare the stream for HTTP request
+      */
+     public OutputStream getOutput() {
+@@ -133,32 +132,24 @@
+         }
+     }
+ 
+-    /**
++    /*
+      * Get the response from HTTP connection and prepare the input stream for response
+      */
+-    public InputStream getInput() {
++    public @Nullable InputStream getInput() {
+         // response processing
+ 
+         InputStream in;
+         try {
++            saveCookieAsNeeded();
+             in = readResponse();
+-            String contentEncoding = httpConnection.getContentEncoding();
+-            if (contentEncoding != null && contentEncoding.contains("gzip")) {
+-                in = new GZIPInputStream(in);
+-            }
+-        } catch (IOException e) {
+-            if (statusCode == HttpURLConnection.HTTP_NO_CONTENT
+-                || (isFailure
+-                && statusCode != HttpURLConnection.HTTP_INTERNAL_ERROR)) {
+-                try {
+-                    throw new ClientTransportException(ClientMessages.localizableHTTP_STATUS_CODE(
+-                        statusCode, httpConnection.getResponseMessage()));
+-                } catch (IOException ex) {
+-                    throw new ClientTransportException(ClientMessages.localizableHTTP_STATUS_CODE(
+-                        statusCode, ex));
++            if (in != null) {
++                String contentEncoding = httpConnection.getContentEncoding();
++                if (contentEncoding != null && contentEncoding.contains("gzip")) {
++                    in = new GZIPInputStream(in);
+                 }
+             }
+-            throw new ClientTransportException(ClientMessages.localizableHTTP_CLIENT_FAILED(e),e);
++        } catch (IOException e) {
++            throw new ClientTransportException(ClientMessages.localizableHTTP_STATUS_CODE(statusCode, statusMessage), e);
+         }
+         return in;
+     }
+@@ -172,75 +163,43 @@
+         return respHeaders;
+     }
+ 
+-    protected InputStream readResponse() throws IOException {
+-        return (isFailure
+-                ? httpConnection.getErrorStream()
+-                : httpConnection.getInputStream());
+-    }
+-
+-    /*
+-     * Will throw an exception instead of returning 'false' if there is no
+-     * return message to be processed (i.e., in the case of an UNAUTHORIZED
+-     * response from the servlet or 404 not found)
+-     */
+-    /*package*/void checkResponseCode() {
++    protected @Nullable InputStream readResponse() {
++        InputStream is;
+         try {
+-
+-            statusCode = httpConnection.getResponseCode();
+-
+-            if ((httpConnection.getResponseCode()
+-                == HttpURLConnection.HTTP_INTERNAL_ERROR)) {
+-                isFailure = true;
+-                //added HTTP_ACCEPT for 1-way operations
+-            } else if (
+-                httpConnection.getResponseCode()
+-                    == HttpURLConnection.HTTP_UNAUTHORIZED) {
+-
+-                // no soap message returned, so skip reading message and throw exception
+-                throw new ClientTransportException(
+-                    ClientMessages.localizableHTTP_CLIENT_UNAUTHORIZED(httpConnection.getResponseMessage()));
+-            } else if (
+-                httpConnection.getResponseCode()
+-                    == HttpURLConnection.HTTP_NOT_FOUND) {
+-
+-                // no message returned, so skip reading message and throw exception
+-                throw new ClientTransportException(
+-                    ClientMessages.localizableHTTP_NOT_FOUND(httpConnection.getResponseMessage()));
+-            } else if (
+-                (statusCode == HttpURLConnection.HTTP_MOVED_TEMP) ||
+-                    (statusCode == HttpURLConnection.HTTP_MOVED_PERM)) {
+-                isFailure = true;
+-
+-                if (!redirect || (redirectCount <= 0)) {
+-                    throw new ClientTransportException(
+-                        ClientMessages.localizableHTTP_STATUS_CODE(statusCode,getStatusMessage()));
++            is = httpConnection.getInputStream();
++        } catch(IOException ioe) {
++            is = httpConnection.getErrorStream();
++        }
++        if (is == null) {
++            return is;
++        }
++        // Since StreamMessage doesn't read </s:Body></s:Envelope>, there
++        // are some bytes left in the InputStream. This confuses JDK and may
++        // not reuse underlying sockets. Hopefully JDK fixes it in its code !
++        final InputStream temp = is;
++        return new FilterInputStream(temp) {
++            // Workaround for "SJSXP XMLStreamReader.next() closes stream".
++            // So it doesn't read from the closed stream
++            boolean closed;
++            @Override
++            public void close() throws IOException {
++                if (!closed) {
++                    closed = true;
++                    byte[] buf = new byte[8192];
++                    while(temp.read(buf) != -1);
++                    super.close();
+                 }
+-            } else if (
+-                statusCode < 200 || (statusCode >= 303 && statusCode < 500)) {
+-                throw new ClientTransportException(
+-                    ClientMessages.localizableHTTP_STATUS_CODE(statusCode,getStatusMessage()));
+-            } else if (statusCode >= 500) {
+-                isFailure = true;
+             }
+-        } catch (IOException e) {
+-            throw new WebServiceException(e);
+-        }
+-        // Hack for now
+-        saveCookieAsNeeded();
++        };
+     }
+ 
+-    private String getStatusMessage() throws IOException {
+-        int statusCode = httpConnection.getResponseCode();
+-        String message = httpConnection.getResponseMessage();
+-        if (statusCode == HttpURLConnection.HTTP_CREATED
+-            || (statusCode >= HttpURLConnection.HTTP_MULT_CHOICE
+-            && statusCode != HttpURLConnection.HTTP_NOT_MODIFIED
+-            && statusCode < HttpURLConnection.HTTP_BAD_REQUEST)) {
+-            String location = httpConnection.getHeaderField("Location");
+-            if (location != null)
+-                message += " - Location: " + location;
++    protected void readResponseCodeAndMessage() {
++        try {
++            statusCode = httpConnection.getResponseCode();
++            statusMessage = httpConnection.getResponseMessage();
++        } catch(IOException ioe) {
++            throw new WebServiceException(ioe);
+         }
+-        return message;
+     }
+ 
+     protected void sendCookieAsNeeded() {
+@@ -264,24 +223,16 @@
+         }
+     }
+ 
+-
+     private void createHttpConnection() throws IOException {
+ 
+-        // does the client want request redirection to occur
+-        String redirectProperty =
+-            (String) context.invocationProperties.get(REDIRECT_REQUEST_PROPERTY);
+-        if (redirectProperty != null) {
+-            if (redirectProperty.equalsIgnoreCase("false"))
+-                redirect = false;
+-        }
+-
+-        checkEndpoints();
+-
+         httpConnection = (HttpURLConnection) endpoint.openConnection();
+         if (httpConnection instanceof HttpsURLConnection) {
+             https = true;
+ 
+             boolean verification = false;
++            // TODO The above property needs to be removed in future version as the semantics of this property are not preoperly defined.
++            // One should use JAXWSProperties.HOSTNAME_VERIFIER to control the behavior
++
+             // does the client want client hostname verification by the service
+             String verificationProperty =
+                 (String) context.invocationProperties.get(HOSTNAME_VERIFICATION_PROPERTY);
+@@ -289,7 +240,8 @@
+                 if (verificationProperty.equalsIgnoreCase("true"))
+                     verification = true;
+             }
+-            if (!verification) {
++            // By default, JAX-WS should not disable any host verification.
++            if (verification) {
+                 ((HttpsURLConnection) httpConnection).setHostnameVerifier(new HttpClientVerifier());
+             }
+ 
+@@ -326,12 +278,12 @@
+ 
+         //this code or something similiar needs t be moved elsewhere for error checking
+         /*if (context.invocationProperties.get(BindingProviderProperties.BINDING_ID_PROPERTY).equals(HTTPBinding.HTTP_BINDING)){
+-            method = (requestMethod != null)?requestMethod:method;            
++            method = (requestMethod != null)?requestMethod:method;
+         } else if
+             (context.invocationProperties.get(BindingProviderProperties.BINDING_ID_PROPERTY).equals(SOAPBinding.SOAP12HTTP_BINDING) &&
+             "GET".equalsIgnoreCase(requestMethod)) {
+         }
+-       */     
++       */
+ 
+         Integer reqTimeout = (Integer)context.invocationProperties.get(BindingProviderProperties.REQUEST_TIMEOUT);
+         if (reqTimeout != null) {
+@@ -338,6 +290,11 @@
+             httpConnection.setReadTimeout(reqTimeout);
+         }
+ 
++        Integer connectTimeout = (Integer)context.invocationProperties.get(JAXWSProperties.CONNECT_TIMEOUT);
++        if (connectTimeout != null) {
++            httpConnection.setConnectTimeout(connectTimeout);
++        }
++
+         Integer chunkSize = (Integer)context.invocationProperties.get(JAXWSProperties.HTTP_CLIENT_STREAMING_CHUNK_SIZE);
+         if (chunkSize != null) {
+             httpConnection.setChunkedStreamingMode(chunkSize);
+@@ -347,6 +304,7 @@
+         for (Map.Entry<String, List<String>> entry : reqHeaders.entrySet()) {
+             httpConnection.addRequestProperty(entry.getKey(), entry.getValue().get(0));
+         }
++        httpConnection.addRequestProperty("User-Agent", RuntimeVersion.VERSION.toString());
+     }
+ 
+     public boolean isSecure() {
+@@ -353,27 +311,6 @@
+         return https;
+     }
+ 
+-    //    private void redirectRequest(HttpURLConnection httpConnection, SOAPMessageContext context) {
+-//        String redirectEndpoint = httpConnection.getHeaderField("Location");
+-//        if (redirectEndpoint != null) {
+-//            httpConnection.disconnect();
+-//            invoke(redirectEndpoint, context);
+-//        } else
+-//            System.out.println("redirection Failed");
+-//    }
+-
+-    private boolean checkForRedirect(int statusCode) {
+-        return (((statusCode == 301) || (statusCode == 302)) && redirect && (redirectCount-- > 0));
+-    }
+-
+-    private void checkEndpoints() {
+-        if (!LAST_ENDPOINT.equalsIgnoreCase(endpoint.toString())) {
+-            redirectCount = START_REDIRECT_COUNT;
+-            LAST_ENDPOINT = endpoint.toString();
+-        }
+-    }
+-
+-
+     private void writeBasicAuthAsNeeded(Packet context, Map<String, List<String>> reqHeaders) {
+         String user = (String) context.invocationProperties.get(BindingProvider.USERNAME_PROPERTY);
+         if (user != null) {
+@@ -412,49 +349,24 @@
+      * is kept in memory. This wraps the ChunkedOuputStream so that it writes only small
+      * chunks.
+      */
+-    private static final class WSChunkedOuputStream extends OutputStream {
+-        final OutputStream actual;
++    private static final class WSChunkedOuputStream extends FilterOutputStream {
+         final int chunkSize;
+ 
+         WSChunkedOuputStream(OutputStream actual, int chunkSize) {
+-            this.actual = actual;
++            super(actual);
+             this.chunkSize = chunkSize;
+         }
+ 
+         @Override
+         public void write(byte b[], int off, int len) throws IOException {
+-            int sent = 0;
+-            while(sent < len) {
+-                int chunk = len-sent;
+-                if (chunk > chunkSize) {
+-                    chunk = chunkSize;
+-                }
+-                actual.write(b, off, chunk);
+-                off += chunk;
+-                sent += chunk;
++            while(len > 0) {
++                int sent = (len > chunkSize) ? chunkSize : len;
++                out.write(b, off, sent);        // don't use super.write() as it writes byte-by-byte
++                len -= sent;
++                off += sent;
+             }
+         }
+ 
+-        @Override
+-        public void write(byte b[]) throws IOException {
+-            write(b, 0, b.length);
+-        }
+-
+-        @Override
+-        public void write(int b) throws IOException {
+-            actual.write(b);
+-        }
+-
+-        @Override
+-        public void flush() throws IOException {
+-            actual.flush();
+-        }
+-
+-        @Override
+-        public void close() throws IOException {
+-            actual.close();
+-        }
+     }
+ 
+ }
+-
+--- old/src/share/classes/com/sun/xml/internal/ws/transport/http/client/HttpResponseProperties.java	Thu Jul 30 18:35:56 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/client/HttpResponseProperties.java	Thu Jul 30 18:35:55 2009
+@@ -60,7 +60,7 @@
+     protected PropertyMap getPropertyMap() {
+         return model;
+     }
+-        
++
+     private static final PropertyMap model;
+ 
+     static {
+--- old/src/share/classes/com/sun/xml/internal/ws/transport/http/client/HttpTransportPipe.java	Thu Jul 30 18:35:59 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/client/HttpTransportPipe.java	Thu Jul 30 18:35:59 2009
+@@ -25,19 +25,19 @@
+ package com.sun.xml.internal.ws.transport.http.client;
+ 
+ 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.pipe.Codec;
+-import com.sun.xml.internal.ws.api.pipe.ContentType;
+-import com.sun.xml.internal.ws.api.pipe.NextAction;
+-import com.sun.xml.internal.ws.api.pipe.Pipe;
+-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.*;
+ import com.sun.xml.internal.ws.api.pipe.helper.AbstractTubeImpl;
+ import com.sun.xml.internal.ws.transport.http.WSHTTPConnection;
++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 javax.xml.ws.BindingProvider;
+ import javax.xml.ws.WebServiceException;
++import javax.xml.ws.soap.SOAPBinding;
+ import javax.xml.ws.handler.MessageContext;
+ import java.io.IOException;
+ import java.io.InputStream;
+@@ -47,18 +47,24 @@
+ import java.util.List;
+ import java.util.Map;
+ import java.util.Map.Entry;
++import java.net.HttpURLConnection;
+ 
+ /**
+  * {@link Pipe} and {@link Tube} that sends a request to a remote HTTP server.
+  *
++ * TODO: need to create separate HTTP transport pipes for binding. SOAP1.1, SOAP1.2,
++ * TODO: XML/HTTP differ in handling status codes.
++ *
+  * @author Jitendra Kotamraju
+  */
+ public class HttpTransportPipe extends AbstractTubeImpl {
+ 
+     private final Codec codec;
++    private final WSBinding binding;
+ 
+-    public HttpTransportPipe(Codec codec) {
++    public HttpTransportPipe(Codec codec, WSBinding binding) {
+         this.codec = codec;
++        this.binding = binding;
+     }
+ 
+     /**
+@@ -65,7 +71,7 @@
+      * Copy constructor for {@link Tube#copy(TubeCloner)}.
+      */
+     private HttpTransportPipe(HttpTransportPipe that, TubeCloner cloner) {
+-        this( that.codec.copy() );
++        this( that.codec.copy(), that.binding);
+         cloner.add(that,this);
+     }
+ 
+@@ -85,10 +91,11 @@
+         HttpClientTransport con;
+         try {
+             // get transport headers from message
+-            Map<String, List<String>> reqHeaders = (Map<String, List<String>>) request.invocationProperties.get(MessageContext.HTTP_REQUEST_HEADERS);
+-            //assign empty map if its null
+-            if(reqHeaders == null){
+-                reqHeaders = new HashMap<String, List<String>>();
++            Map<String, List<String>> reqHeaders = new Headers();
++            Map<String, List<String>> userHeaders = (Map<String, List<String>>) request.invocationProperties.get(MessageContext.HTTP_REQUEST_HEADERS);
++            if (userHeaders != null) {
++                // userHeaders may not be modifiable like SingletonMap, just copy them
++                reqHeaders.putAll(userHeaders);
+             }
+ 
+             con = new HttpClientTransport(request,reqHeaders);
+@@ -97,7 +104,7 @@
+             ContentType ct = codec.getStaticContentType(request);
+             if (ct == null) {
+                 ByteArrayBuffer buf = new ByteArrayBuffer();
+-                
++
+                 ct = codec.encode(request, buf);
+                 // data size is available, set it as Content-Length
+                 reqHeaders.put("Content-Length", Collections.singletonList(Integer.toString(buf.size())));
+@@ -105,11 +112,13 @@
+                 if (ct.getAcceptHeader() != null) {
+                     reqHeaders.put("Accept", Collections.singletonList(ct.getAcceptHeader()));
+                 }
+-                writeSOAPAction(reqHeaders, ct.getSOAPActionHeader(),request);
+-                
++                if (binding instanceof SOAPBinding) {
++                    writeSOAPAction(reqHeaders, ct.getSOAPActionHeader(),request);
++                }
++
+                 if(dump)
+                     dump(buf, "HTTP request", reqHeaders);
+-                
++
+                 buf.writeTo(con.getOutput());
+             } else {
+                 // Set static Content-Type
+@@ -117,12 +126,14 @@
+                 if (ct.getAcceptHeader() != null) {
+                     reqHeaders.put("Accept", Collections.singletonList(ct.getAcceptHeader()));
+                 }
+-                writeSOAPAction(reqHeaders, ct.getSOAPActionHeader(), request);
+-                
++                if (binding instanceof SOAPBinding) {
++                    writeSOAPAction(reqHeaders, ct.getSOAPActionHeader(), request);
++                }
++
+                 if(dump) {
+                     ByteArrayBuffer buf = new ByteArrayBuffer();
+                     codec.encode(request, buf);
+-                    dump(buf, "HTTP request", reqHeaders);
++                    dump(buf, "HTTP request - "+request.endpointAddress, reqHeaders);
+                     OutputStream out = con.getOutput();
+                     if (out != null) {
+                         buf.writeTo(out);
+@@ -137,10 +148,25 @@
+ 
+             con.closeOutput();
+ 
+-            con.checkResponseCode();
+-            if (con.statusCode== WSHTTPConnection.ONEWAY) {
++            con.readResponseCodeAndMessage();   // throws IOE
++            InputStream response = con.getInput();
++            if(dump) {
++                ByteArrayBuffer buf = new ByteArrayBuffer();
++                if (response != null) {
++                    buf.write(response);
++                    response.close();
++                }
++                dump(buf,"HTTP response - "+request.endpointAddress+" - "+con.statusCode, con.getHeaders());
++                response = buf.newInputStream();
++            }
++
++            if (con.statusCode== WSHTTPConnection.ONEWAY || (request.expectReply != null && !request.expectReply)) {
++                checkStatusCodeOneway(response, con.statusCode, con.statusMessage);   // throws ClientTransportException
+                 return request.createClientResponse(null);    // one way. no response given.
+             }
++
++            checkStatusCode(response, con.statusCode, con.statusMessage); // throws ClientTransportException
++
+             String contentType = con.getContentType();
+             if (contentType == null) {
+                 throw new WebServiceException("No Content-type in the header!");
+@@ -151,13 +177,6 @@
+             Packet reply = request.createClientResponse(null);
+             //reply.addSatellite(new HttpResponseProperties(con));
+             reply.wasTransportSecure = con.isSecure();
+-            InputStream response = con.getInput();
+-            if(dump) {
+-                ByteArrayBuffer buf = new ByteArrayBuffer();
+-                buf.write(response);
+-                dump(buf,"HTTP response "+con.statusCode, con.getHeaders());
+-                response = buf.newInputStream();
+-            }
+             codec.decode(response, contentType, reply);
+             return reply;
+         } catch(WebServiceException wex) {
+@@ -167,11 +186,36 @@
+         }
+     }
+ 
++    private void checkStatusCode(InputStream in, int statusCode, String statusMessage) throws IOException {
++        // SOAP1.1 and SOAP1.2 differ here
++        if (binding instanceof SOAPBinding) {
++            if (statusCode != HttpURLConnection.HTTP_OK && statusCode != HttpURLConnection.HTTP_INTERNAL_ERROR) {
++                if (in != null) {
++                    in.close();
++                }
++                throw new ClientTransportException(ClientMessages.localizableHTTP_STATUS_CODE(statusCode, statusMessage));
++            }
++        }
++        // Every status code is OK for XML/HTTP
++    }
++
++    private void checkStatusCodeOneway(InputStream in, int statusCode, String statusMessage) throws IOException {
++        if (statusCode != WSHTTPConnection.ONEWAY && statusCode != WSHTTPConnection.OK) {
++            if (in != null) {
++                in.close();
++            }
++            throw new ClientTransportException(ClientMessages.localizableHTTP_STATUS_CODE(statusCode,statusMessage));
++        }
++    }
++
+     /**
+      * write SOAPAction header if the soapAction parameter is non-null or BindingProvider properties set.
+      * BindingProvider properties take precedence.
+      */
+     private void writeSOAPAction(Map<String, List<String>> reqHeaders, String soapAction, Packet packet) {
++        //dont write SOAPAction HTTP header for SOAP 1.2 messages.
++        if(SOAPVersion.SOAP_12.equals(binding.getSOAPVersion()))
++            return;
+         if (soapAction != null)
+             reqHeaders.put("SOAPAction", Collections.singletonList(soapAction));
+         else
+--- old/src/share/classes/com/sun/xml/internal/ws/transport/http/server/EndpointImpl.java	Thu Jul 30 18:36:03 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/server/EndpointImpl.java	Thu Jul 30 18:36:02 2009
+@@ -46,6 +46,7 @@
+ import javax.xml.transform.TransformerException;
+ import javax.xml.ws.*;
+ import javax.xml.ws.wsaddressing.W3CEndpointReference;
++import javax.xml.parsers.ParserConfigurationException;
+ 
+ import java.io.IOException;
+ import java.net.URL;
+@@ -57,6 +58,7 @@
+ import java.util.concurrent.Executor;
+ 
+ import org.xml.sax.EntityResolver;
++import org.xml.sax.SAXException;
+ import org.w3c.dom.Element;
+ 
+ 
+@@ -205,7 +207,7 @@
+         try {
+             Class.forName("com.sun.net.httpserver.HttpServer");
+         } catch (Exception e) {
+-            throw new UnsupportedOperationException("NOT SUPPORTED");
++            throw new UnsupportedOperationException("Couldn't load light weight http server", e);
+         }
+ 
+         WSEndpoint wse = WSEndpoint.create(
+@@ -243,8 +245,7 @@
+             Transformer transformer = XmlUtil.newTransformer();
+             for (Source source : metadata) {
+                 try {
+-                    XMLStreamBufferResult xsbr = new XMLStreamBufferResult();
+-                    transformer.transform(source, xsbr);
++                    XMLStreamBufferResult xsbr = XmlUtil.identityTransform(source, new XMLStreamBufferResult());
+                     String systemId = source.getSystemId();
+ 
+                     r.add(SDDocumentSource.create(new URL(systemId), xsbr.getXMLStreamBuffer()));
+@@ -252,6 +253,10 @@
+                     throw new ServerRtException("server.rt.err", te);
+                 } catch (IOException te) {
+                     throw new ServerRtException("server.rt.err", te);
++                } catch (SAXException e) {
++                    throw new ServerRtException("server.rt.err", e);
++                } catch (ParserConfigurationException e) {
++                    throw new ServerRtException("server.rt.err", e);
+                 }
+             }
+         }
+@@ -265,6 +270,7 @@
+     private @Nullable SDDocumentSource getPrimaryWsdl() {
+         Class implType = implementor.getClass();
+         // Takes care of @WebService, @WebServiceProvider's wsdlLocation
++        EndpointFactory.verifyImplementorClass(implType);
+         String wsdlLocation = EndpointFactory.getWsdlLocation(implType);
+         if (wsdlLocation != null) {
+             ClassLoader cl = implType.getClassLoader();
+@@ -299,4 +305,3 @@
+         return ((HttpEndpoint)actualEndpoint).getEndpointReference(clazz,referenceParameters);
+     }
+ }
+-
+--- old/src/share/classes/com/sun/xml/internal/ws/transport/http/server/HttpEndpoint.java	Thu Jul 30 18:36:06 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/server/HttpEndpoint.java	Thu Jul 30 18:36:06 2009
+@@ -51,7 +51,7 @@
+  *
+  * @author Jitendra Kotamraju
+  */
+-final class HttpEndpoint {
++public final class HttpEndpoint extends com.sun.xml.internal.ws.api.server.HttpEndpoint {
+     private String address;
+     private HttpContext httpContext;
+     private final HttpAdapter adapter;
+@@ -95,7 +95,7 @@
+             // httpContext.setHandler(null);
+             httpContext.getServer().removeContext(httpContext);
+         } else {
+-            // Remove HttpContext created by JAXWS runtime 
++            // Remove HttpContext created by JAXWS runtime
+             ServerMgr.getInstance().removeContext(httpContext);
+         }
+ 
+--- old/src/share/classes/com/sun/xml/internal/ws/transport/http/server/ServerConnectionImpl.java	Thu Jul 30 18:36:10 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/server/ServerConnectionImpl.java	Thu Jul 30 18:36:09 2009
+@@ -1,228 +1,262 @@
+-/*
+- * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+- *
+- * This code is free software; you can redistribute it and/or modify it
+- * under the terms of the GNU General Public License version 2 only, as
+- * published by the Free Software Foundation.  Sun designates this
+- * particular file as subject to the "Classpath" exception as provided
+- * by Sun in the LICENSE file that accompanied this code.
+- *
+- * This code is distributed in the hope that it will be useful, but WITHOUT
+- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+- * version 2 for more details (a copy is included in the LICENSE file that
+- * accompanied this code).
+- *
+- * You should have received a copy of the GNU General Public License version
+- * 2 along with this work; if not, write to the Free Software Foundation,
+- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+- *
+- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+- * CA 95054 USA or visit www.sun.com if you need additional information or
+- * have any questions.
+- */
+-
+-package com.sun.xml.internal.ws.transport.http.server;
+-
+-import com.sun.istack.internal.NotNull;
+-import com.sun.net.httpserver.Headers;
+-import com.sun.net.httpserver.HttpExchange;
+-import com.sun.net.httpserver.HttpsExchange;
+-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.WebServiceContextDelegate;
+-import com.sun.xml.internal.ws.transport.http.HttpAdapter;
+-import com.sun.xml.internal.ws.transport.http.WSHTTPConnection;
+-
+-import javax.xml.ws.handler.MessageContext;
+-import java.io.*;
+-import java.net.URI;
+-import java.security.Principal;
+-import java.util.ArrayList;
+-import java.util.List;
+-import java.util.Map;
+-
+-
+-/**
+- * {@link WSHTTPConnection} used with Java SE endpoints. It provides connection
+- * implementation using {@link HttpExchange} object.
+- *
+- * @author Jitendra Kotamraju
+- */
+-final class ServerConnectionImpl extends WSHTTPConnection implements WebServiceContextDelegate {
+-
+-    private final HttpExchange httpExchange;
+-    private int status;
+-    private final HttpAdapter adapter;
+-    private boolean outputWritten;
+-
+-
+-    public ServerConnectionImpl(@NotNull HttpAdapter adapter, @NotNull HttpExchange httpExchange) {
+-        this.adapter = adapter;
+-        this.httpExchange = httpExchange;
+-    }
+-
+-    @Override
+-    @Property(value = {MessageContext.HTTP_REQUEST_HEADERS, Packet.INBOUND_TRANSPORT_HEADERS})
+-    public @NotNull Map<String,List<String>> getRequestHeaders() {
+-        return httpExchange.getRequestHeaders();
+-    }
+-
+-    @Override
+-    public String getRequestHeader(String headerName) {
+-        return httpExchange.getRequestHeaders().getFirst(headerName);
+-    }
+-
+-    @Override
+-    public void setResponseHeaders(Map<String,List<String>> headers) {
+-        Headers r = httpExchange.getResponseHeaders();
+-        r.clear();
+-        for(Map.Entry <String, List<String>> entry : headers.entrySet()) {
+-            String name = entry.getKey();
+-            List<String> values = entry.getValue();
+-            if (name.equalsIgnoreCase("Content-Length") || name.equalsIgnoreCase("Content-Type")) {
+-                continue;  // ignore headers that interfere with our correct operations
+-            } else {
+-                r.put(name,new ArrayList<String>(values));
+-            }
+-        }
+-    }
+-    @Override
+-    @Property({MessageContext.HTTP_RESPONSE_HEADERS,Packet.OUTBOUND_TRANSPORT_HEADERS})
+-    public Map<String,List<String>> getResponseHeaders() {
+-        return httpExchange.getResponseHeaders();
+-    }
+-
+-    @Override
+-    public void setContentTypeResponseHeader(@NotNull String value) {
+-        httpExchange.getResponseHeaders().set("Content-Type",value);
+-    }
+-
+-    @Override
+-    public void setStatus(int status) {
+-        this.status = status;
+-    }
+-
+-    @Override
+-    @Property(MessageContext.HTTP_RESPONSE_CODE)
+-    public int getStatus() {
+-        return status;
+-    }
+-
+-    public @NotNull InputStream getInput() {
+-        // Light weight http server's InputStream.close() throws exception if
+-        // all the bytes are not read. Work around until it is fixed.
+-        return new FilterInputStream(httpExchange.getRequestBody()) {
+-            @Override
+-            public void close() throws IOException {
+-                try {
+-                    while (read() != -1);
+-                } catch(IOException e) {
+-                    //Ignore
+-                }
+-            	super.close();
+-            }
+-        };
+-    }
+-
+-    public @NotNull OutputStream getOutput() throws IOException {
+-        assert !outputWritten;
+-        outputWritten = true;
+-
+-        List<String> lenHeader = httpExchange.getResponseHeaders().get("Content-Length");
+-        int length = (lenHeader != null) ? Integer.parseInt(lenHeader.get(0)) : 0;
+-        httpExchange.sendResponseHeaders(getStatus(), length);
+-
+-        // Light weight http server's OutputStream.close() throws exception if
+-        // all the bytes are not read on the client side(StreamMessage on the client
+-        // side doesn't read all bytes.
+-        return new FilterOutputStream(httpExchange.getResponseBody()) {
+-            @Override
+-            public void close() throws IOException {
+-                try {
+-                    super.close();
+-                } catch(IOException ioe) {
+-                    // Ignoring purposefully.
+-                }
+-            }
+-        };
+-    }
+-
+-    public @NotNull WebServiceContextDelegate getWebServiceContextDelegate() {
+-        return this;
+-    }
+-
+-    public Principal getUserPrincipal(Packet request) {
+-        return httpExchange.getPrincipal();
+-    }
+-
+-    public boolean isUserInRole(Packet request, String role) {
+-        return false;
+-    }
+-
+-    public @NotNull String getEPRAddress(Packet request, WSEndpoint endpoint) {
+-        return WSHttpHandler.getRequestAddress(httpExchange);
+-    }
+-
+-    public String getWSDLAddress(@NotNull Packet request, @NotNull WSEndpoint endpoint) {
+-        String eprAddress = getEPRAddress(request,endpoint);
+-        if(adapter.getEndpoint().getPort() != null)
+-            return eprAddress+"?wsdl";
+-        else
+-            return null;
+-    }
+-
+-    @Override
+-    public boolean isSecure() {
+-        return (httpExchange instanceof HttpsExchange);
+-    }
+-
+-    @Override
+-    @Property(MessageContext.HTTP_REQUEST_METHOD)
+-    public @NotNull String getRequestMethod() {
+-        return httpExchange.getRequestMethod();
+-    }
+-
+-    @Override
+-    @Property(MessageContext.QUERY_STRING)
+-    public String getQueryString() {
+-        URI requestUri = httpExchange.getRequestURI();
+-        String query = requestUri.getQuery();
+-        if (query != null)
+-            return query;
+-        return null;
+-    }
+-
+-    @Override
+-    @Property(MessageContext.PATH_INFO)
+-    public String getPathInfo() {
+-        URI requestUri = httpExchange.getRequestURI();
+-        String reqPath = requestUri.getPath();
+-        String ctxtPath = httpExchange.getHttpContext().getPath();
+-        if (reqPath.length() > ctxtPath.length()) {
+-            return reqPath.substring(ctxtPath.length());
+-        }
+-        return null;
+-    }
+-
+-    @Override
+-    public String getProtocol() {
+-        return httpExchange.getProtocol();
+-    }
+-
+-    @Override
+-    public void setContentLengthResponseHeader(int value) {
+-        httpExchange.getResponseHeaders().set("Content-Length", ""+value);
+-    }
+-
+-    protected PropertyMap getPropertyMap() {
+-        return model;
+-    }
+-
+-    private static final PropertyMap model;
+-
+-    static {
+-        model = parse(ServerConnectionImpl.class);
+-    }
+-}
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++
++package com.sun.xml.internal.ws.transport.http.server;
++
++import com.sun.istack.internal.NotNull;
++import com.sun.net.httpserver.Headers;
++import com.sun.net.httpserver.HttpExchange;
++import com.sun.net.httpserver.HttpsExchange;
++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.WebServiceContextDelegate;
++import com.sun.xml.internal.ws.api.server.PortAddressResolver;
++import com.sun.xml.internal.ws.transport.http.HttpAdapter;
++import com.sun.xml.internal.ws.transport.http.WSHTTPConnection;
++import com.sun.xml.internal.ws.developer.JAXWSProperties;
++import com.sun.xml.internal.ws.resources.WsservletMessages;
++
++import javax.xml.ws.handler.MessageContext;
++import javax.xml.ws.WebServiceException;
++import java.io.FilterInputStream;
++import java.io.FilterOutputStream;
++import java.io.IOException;
++import java.io.InputStream;
++import java.io.OutputStream;
++import java.net.URI;
++import java.security.Principal;
++import java.util.ArrayList;
++import java.util.List;
++import java.util.Map;
++
++
++/**
++ * {@link WSHTTPConnection} used with Java SE endpoints. It provides connection
++ * implementation using {@link HttpExchange} object.
++ *
++ * @author Jitendra Kotamraju
++ */
++final class ServerConnectionImpl extends WSHTTPConnection implements WebServiceContextDelegate {
++
++    private final HttpExchange httpExchange;
++    private int status;
++    private final HttpAdapter adapter;
++    private boolean outputWritten;
++
++
++    public ServerConnectionImpl(@NotNull HttpAdapter adapter, @NotNull HttpExchange httpExchange) {
++        this.adapter = adapter;
++        this.httpExchange = httpExchange;
++    }
++
++    @Override
++    @Property(value = {MessageContext.HTTP_REQUEST_HEADERS, Packet.INBOUND_TRANSPORT_HEADERS})
++    public @NotNull Map<String,List<String>> getRequestHeaders() {
++        return httpExchange.getRequestHeaders();
++    }
++
++    @Override
++    public String getRequestHeader(String headerName) {
++        return httpExchange.getRequestHeaders().getFirst(headerName);
++    }
++
++    @Override
++    public void setResponseHeaders(Map<String,List<String>> headers) {
++        Headers r = httpExchange.getResponseHeaders();
++        r.clear();
++        for(Map.Entry <String, List<String>> entry : headers.entrySet()) {
++            String name = entry.getKey();
++            List<String> values = entry.getValue();
++            // ignore headers that interfere with our correct operations
++            if (!name.equalsIgnoreCase("Content-Length") && !name.equalsIgnoreCase("Content-Type")) {
++                r.put(name,new ArrayList<String>(values));
++            }
++        }
++    }
++    @Override
++    @Property({MessageContext.HTTP_RESPONSE_HEADERS,Packet.OUTBOUND_TRANSPORT_HEADERS})
++    public Map<String,List<String>> getResponseHeaders() {
++        return httpExchange.getResponseHeaders();
++    }
++
++    @Override
++    public void setContentTypeResponseHeader(@NotNull String value) {
++        httpExchange.getResponseHeaders().set("Content-Type",value);
++    }
++
++    @Override
++    public void setStatus(int status) {
++        this.status = status;
++    }
++
++    @Override
++    @Property(MessageContext.HTTP_RESPONSE_CODE)
++    public int getStatus() {
++        return status;
++    }
++
++    public @NotNull InputStream getInput() {
++
++        // Light weight http server's InputStream.close() throws exception if
++        // all the bytes are not read. Work around until it is fixed.
++        return new FilterInputStream(httpExchange.getRequestBody()) {
++            // Workaround for "SJSXP XMLStreamReader.next() closes stream".
++            boolean closed;
++
++            @Override
++            public void close() throws IOException {
++                if (!closed) {
++                    while (read() != -1);
++                    super.close();
++                    closed = true;
++                }
++            }
++        };
++    }
++
++    public @NotNull OutputStream getOutput() throws IOException {
++        assert !outputWritten;
++        outputWritten = true;
++
++        List<String> lenHeader = httpExchange.getResponseHeaders().get("Content-Length");
++        int length = (lenHeader != null) ? Integer.parseInt(lenHeader.get(0)) : 0;
++        httpExchange.sendResponseHeaders(getStatus(), length);
++
++        // Light weight http server's OutputStream.close() throws exception if
++        // all the bytes are not read on the client side(StreamMessage on the client
++        // side doesn't read all bytes.
++        return new FilterOutputStream(httpExchange.getResponseBody()) {
++            @Override
++            public void close() throws IOException {
++                try {
++                    super.close();
++                } catch(IOException ioe) {
++                    // Ignoring purposefully.
++                }
++            }
++
++            // Otherwise, FilterOutpuStream writes byte by byte
++            @Override
++            public void write(byte[] buf, int start, int len) throws IOException {
++                out.write(buf, start, len);
++            }
++        };
++
++    }
++
++    public @NotNull WebServiceContextDelegate getWebServiceContextDelegate() {
++        return this;
++    }
++
++    public Principal getUserPrincipal(Packet request) {
++        return httpExchange.getPrincipal();
++    }
++
++    public boolean isUserInRole(Packet request, String role) {
++        return false;
++    }
++
++    public @NotNull String getEPRAddress(Packet request, WSEndpoint endpoint) {
++        //return WSHttpHandler.getRequestAddress(httpExchange);
++
++        PortAddressResolver resolver = adapter.owner.createPortAddressResolver(getBaseAddress());
++        String address = resolver.getAddressFor(endpoint.getServiceName(), endpoint.getPortName().getLocalPart());
++        if(address==null)
++            throw new WebServiceException(WsservletMessages.SERVLET_NO_ADDRESS_AVAILABLE(endpoint.getPortName()));
++        return address;
++
++    }
++
++    public String getWSDLAddress(@NotNull Packet request, @NotNull WSEndpoint endpoint) {
++        String eprAddress = getEPRAddress(request,endpoint);
++        if(adapter.getEndpoint().getPort() != null)
++            return eprAddress+"?wsdl";
++        else
++            return null;
++    }
++
++    @Override
++    public boolean isSecure() {
++        return (httpExchange instanceof HttpsExchange);
++    }
++
++    @Override
++    @Property(MessageContext.HTTP_REQUEST_METHOD)
++    public @NotNull String getRequestMethod() {
++        return httpExchange.getRequestMethod();
++    }
++
++    @Override
++    @Property(MessageContext.QUERY_STRING)
++    public String getQueryString() {
++        URI requestUri = httpExchange.getRequestURI();
++        String query = requestUri.getQuery();
++        if (query != null)
++            return query;
++        return null;
++    }
++
++    @Override
++    @Property(MessageContext.PATH_INFO)
++    public String getPathInfo() {
++        URI requestUri = httpExchange.getRequestURI();
++        String reqPath = requestUri.getPath();
++        String ctxtPath = httpExchange.getHttpContext().getPath();
++        if (reqPath.length() > ctxtPath.length()) {
++            return reqPath.substring(ctxtPath.length());
++        }
++        return null;
++    }
++
++    @Property(JAXWSProperties.HTTP_EXCHANGE)
++    public HttpExchange getExchange() {
++        return httpExchange;
++    }
++
++    @Override @NotNull
++    public String getBaseAddress() {
++        return WSHttpHandler.getRequestAddress(httpExchange);
++    }
++
++    @Override
++    public String getProtocol() {
++        return httpExchange.getProtocol();
++    }
++
++    @Override
++    public void setContentLengthResponseHeader(int value) {
++        httpExchange.getResponseHeaders().set("Content-Length", ""+value);
++    }
++
++    protected PropertyMap getPropertyMap() {
++        return model;
++    }
++
++    private static final PropertyMap model;
++
++    static {
++        model = parse(ServerConnectionImpl.class);
++    }
++}
+--- old/src/share/classes/com/sun/xml/internal/ws/transport/http/server/ServerMgr.java	Thu Jul 30 18:36:13 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/server/ServerMgr.java	Thu Jul 30 18:36:13 2009
+@@ -30,7 +30,6 @@
+ 
+ import java.net.InetSocketAddress;
+ import java.net.URL;
+-import java.net.URI;
+ import java.util.HashMap;
+ import java.util.Map;
+ import java.util.concurrent.ExecutorService;
+@@ -43,28 +42,29 @@
+  * @author Jitendra Kotamraju
+  */
+ final class ServerMgr {
+-    
++
+     private static final ServerMgr serverMgr = new ServerMgr();
+     private static final Logger logger =
+         Logger.getLogger(
+             com.sun.xml.internal.ws.util.Constants.LoggingDomain + ".server.http");
+     private final Map<InetSocketAddress,ServerState> servers = new HashMap<InetSocketAddress,ServerState>();
+-            
++
+     private ServerMgr() {}
+ 
+     /**
+      * Gets the singleton instance.
++     * @return manager instance
+      */
+-    public static ServerMgr getInstance() {
++    static ServerMgr getInstance() {
+         return serverMgr;
+     }
+-    
++
+     /*
+      * Creates a HttpContext at the given address. If there is already a server
+      * it uses that server to create a context. Otherwise, it creates a new
+      * HTTP server. This sever is added to servers Map.
+      */
+-    public HttpContext createContext(String address) {
++    /*package*/ HttpContext createContext(String address) {
+         try {
+             HttpServer server;
+             ServerState state;
+@@ -80,7 +80,7 @@
+                 if (state == null) {
+                     logger.fine("Creating new HTTP Server at "+inetAddress);
+                     server = HttpServer.create(inetAddress, 5);
+-                    server.setExecutor(Executors.newFixedThreadPool(5));
++                    server.setExecutor(Executors.newCachedThreadPool());
+                     String path = url.toURI().getPath();
+                     logger.fine("Creating HTTP Context at = "+path);
+                     HttpContext context = server.createContext(path);
+@@ -100,12 +100,12 @@
+             throw new ServerRtException("server.rt.err",e );
+         }
+     }
+-    
++
+     /*
+      * Removes a context. If the server doesn't have anymore contexts, it
+      * would stop the server and server is removed from servers Map.
+      */
+-    public void removeContext(HttpContext context) {
++    /*package*/ void removeContext(HttpContext context) {
+         InetSocketAddress inetAddress = context.getServer().getAddress();
+         synchronized(servers) {
+             ServerState state = servers.get(inetAddress);
+@@ -120,28 +120,28 @@
+             }
+         }
+     }
+-    
++
+     private static final class ServerState {
+         private final HttpServer server;
+         private int instances;
+-        
++
+         ServerState(HttpServer server) {
+             this.server = server;
+             this.instances = 1;
+         }
+-        
++
+         public HttpServer getServer() {
+             return server;
+         }
+-        
++
+         public void oneMoreContext() {
+             ++instances;
+         }
+-        
++
+         public void oneLessContext() {
+             --instances;
+         }
+-        
++
+         public int noOfContexts() {
+             return instances;
+         }
+--- old/src/share/classes/com/sun/xml/internal/ws/transport/http/server/WSHttpHandler.java	Thu Jul 30 18:36:17 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/server/WSHttpHandler.java	Thu Jul 30 18:36:16 2009
+@@ -65,7 +65,7 @@
+         this.adapter = adapter;
+         this.executor = executor;
+     }
+-    
++
+     /**
+      * Called by HttpServer when there is a matching request for the context
+      */
+@@ -90,16 +90,8 @@
+         try {
+             logger.fine("Received HTTP request:"+msg.getRequestURI());
+             String method = msg.getRequestMethod();
+-            if (method.equals(GET_METHOD)) {
+-                String queryString = msg.getRequestURI().getQuery();
+-                logger.fine("Query String for request ="+queryString);
+-                if (adapter.isMetadataQuery(queryString)) {
+-                    adapter.publishWSDL(con,getRequestAddress(msg), msg.getRequestURI().getQuery());
+-                } else {
+-                    adapter.handle(con);
+-                }
+-            } else if (method.equals(POST_METHOD) || method.equals(HEAD_METHOD)
+-                        || method.equals(PUT_METHOD) || method.equals(DELETE_METHOD)) {
++            if(method.equals(GET_METHOD) || method.equals(POST_METHOD) || method.equals(HEAD_METHOD)
++            || method.equals(PUT_METHOD) || method.equals(DELETE_METHOD)) {
+                 adapter.handle(con);
+             } else {
+                 logger.warning(HttpserverMessages.UNEXPECTED_HTTP_METHOD(method));
+@@ -144,9 +136,9 @@
+         strBuf.append((msg instanceof HttpsExchange) ? "https" : "http");
+         strBuf.append("://");
+ 
+-        List<String> hostHeader = msg.getRequestHeaders().get("Host");
++        String hostHeader = msg.getRequestHeaders().getFirst("Host");
+         if (hostHeader != null) {
+-            strBuf.append(hostHeader.get(0));   // Uses Host header
++            strBuf.append(hostHeader);   // Uses Host header
+         } else {
+             strBuf.append(msg.getLocalAddress().getHostName());
+             strBuf.append(":");
+--- old/src/share/classes/com/sun/xml/internal/ws/util/ASCIIUtility.java	Thu Jul 30 18:36:20 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/util/ASCIIUtility.java	Thu Jul 30 18:36:20 2009
+@@ -97,7 +97,7 @@
+         if (negative) {
+             if (i > start + 1) {
+                 return result;
+-            } else {	/* Only got "-" */
++            } else {    /* Only got "-" */
+                 throw new NumberFormatException("illegal number");
+             }
+         } else {
+--- old/src/share/classes/com/sun/xml/internal/ws/util/ByteArrayBuffer.java	Thu Jul 30 18:36:24 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/util/ByteArrayBuffer.java	Thu Jul 30 18:36:23 2009
+@@ -82,7 +82,12 @@
+     }
+ 
+     public ByteArrayBuffer(byte[] data) {
++        this(data,data.length);
++    }
++
++    public ByteArrayBuffer(byte[] data, int length) {
+         this.buf = data;
++        this.count = length;
+     }
+ 
+     /**
+@@ -99,7 +104,7 @@
+             if(sz<0)    return;     // hit EOS
+             count += sz;
+ 
+-            
++
+             if(cap==sz)
+                 ensureCapacity(buf.length*2);   // buffer filled up.
+         }
+--- old/src/share/classes/com/sun/xml/internal/ws/util/ByteArrayDataSource.java	Thu Jul 30 18:36:27 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/util/ByteArrayDataSource.java	Thu Jul 30 18:36:27 2009
+@@ -32,7 +32,7 @@
+ 
+ /**
+  * {@link DataSource} backed by a byte buffer.
+- * 
++ *
+  * @author Kohsuke Kawaguchi
+  */
+ public final class ByteArrayDataSource implements DataSource {
+--- old/src/share/classes/com/sun/xml/internal/ws/util/DOMUtil.java	Thu Jul 30 18:36:31 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/util/DOMUtil.java	Thu Jul 30 18:36:30 2009
+@@ -50,7 +50,7 @@
+ import com.sun.istack.internal.Nullable;
+ 
+ /**
+- * $author: JAXWS Development Team
++ * @author: JAXWS Development Team
+  */
+ public class DOMUtil {
+ 
+@@ -135,11 +135,13 @@
+     public static void writeTagWithAttributes(Element node, XMLStreamWriter writer) throws XMLStreamException {
+         String nodePrefix = fixNull(node.getPrefix());
+         String nodeNS = fixNull(node.getNamespaceURI());
++        //fix to work with DOM level 1 nodes.
++        String nodeLocalName = node.getLocalName()== null?node.getNodeName():node.getLocalName();
+ 
+         // See if nodePrefix:nodeNS is declared in writer's NamespaceContext before writing start element
+         // Writing start element puts nodeNS in NamespaceContext even though namespace declaration not written
+         boolean prefixDecl = isPrefixDeclared(writer, nodeNS, nodePrefix);
+-        writer.writeStartElement(nodePrefix, node.getLocalName(), nodeNS);
++        writer.writeStartElement(nodePrefix, nodeLocalName, nodeNS);
+ 
+         if (node.hasAttributes()) {
+             NamedNodeMap attrs = node.getAttributes();
+--- old/src/share/classes/com/sun/xml/internal/ws/util/FastInfosetReflection.java	Thu Jul 30 18:36:34 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/util/FastInfosetReflection.java	Thu Jul 30 18:36:34 2009
+@@ -39,17 +39,17 @@
+      * FI StAXDocumentParser constructor using reflection.
+      */
+     public static final Constructor fiStAXDocumentParser_new;
+-    
++
+     /**
+      * FI <code>StAXDocumentParser.setInputStream()</code> method via reflection.
+      */
+     public static final Method fiStAXDocumentParser_setInputStream;
+-    
++
+     /**
+      * FI <code>StAXDocumentParser.setStringInterning()</code> method via reflection.
+      */
+     public static final Method fiStAXDocumentParser_setStringInterning;
+-    
++
+     static {
+         Constructor tmp_new = null;
+         Method tmp_setInputStream = null;
+@@ -63,7 +63,7 @@
+                 clazz.getMethod("setInputStream", java.io.InputStream.class);
+             tmp_setStringInterning =
+                 clazz.getMethod("setStringInterning", boolean.class);
+-        } 
++        }
+         catch (Exception e) {
+             // falls through
+         }
+--- old/src/share/classes/com/sun/xml/internal/ws/util/HandlerAnnotationInfo.java	Thu Jul 30 18:36:38 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/util/HandlerAnnotationInfo.java	Thu Jul 30 18:36:37 2009
+@@ -40,10 +40,10 @@
+  * @author JAX-WS Development Team
+  */
+ public class HandlerAnnotationInfo {
+-    
++
+     private List<Handler> handlers;
+     private Set<String> roles;
+-    
++
+     /**
+      * Return the handlers specified by the handler chain descriptor.
+      *
+@@ -52,7 +52,7 @@
+     public List<Handler> getHandlers() {
+         return handlers;
+     }
+-    
++
+     /**
+      * This method should only be called by HandlerAnnotationProcessor.
+      *
+@@ -61,7 +61,7 @@
+     public void setHandlers(List<Handler> handlers) {
+         this.handlers = handlers;
+     }
+-    
++
+     /**
+      * Return the roles contained in the handler chain descriptor.
+      *
+@@ -70,7 +70,7 @@
+     public Set<String> getRoles() {
+         return roles;
+     }
+-    
++
+     /**
+      * This method should only be called by HandlerAnnotationProcessor.
+      *
+@@ -79,5 +79,5 @@
+     public void setRoles(Set<String> roles) {
+         this.roles = roles;
+     }
+-    
++
+ }
+--- old/src/share/classes/com/sun/xml/internal/ws/util/HandlerAnnotationProcessor.java	Thu Jul 30 18:36:41 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/util/HandlerAnnotationProcessor.java	Thu Jul 30 18:36:40 2009
+@@ -30,6 +30,7 @@
+ import com.sun.xml.internal.ws.handler.HandlerChainsModel;
+ import com.sun.xml.internal.ws.server.EndpointFactory;
+ import com.sun.xml.internal.ws.streaming.XMLStreamReaderUtil;
++import com.sun.istack.internal.NotNull;
+ 
+ import javax.jws.HandlerChain;
+ import javax.jws.WebService;
+@@ -49,7 +50,7 @@
+  * from annotated class. The public methods all return a
+  * HandlerChainInfo that contains the handlers and role information
+  * needed at runtime.
+- * 
++ *
+  * <p>All of the handler chain descriptors follow the same schema,
+  * whether they are wsdl customizations, handler files specified
+  * by an annotation, or are included in the sun-jaxws.xml file.
+@@ -84,7 +85,7 @@
+      * handlers and roles. Will return null if the class passed
+      * in has no handler chain annotation.
+      */
+-    public static HandlerAnnotationInfo buildHandlerInfo(
++    public static HandlerAnnotationInfo buildHandlerInfo(@NotNull
+         Class<?> clazz, QName serviceName, QName portName, WSBinding binding) {
+ 
+ //        clazz = checkClass(clazz);
+--- old/src/share/classes/com/sun/xml/internal/ws/util/NoCloseOutputStream.java	Thu Jul 30 18:36:45 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/util/NoCloseOutputStream.java	Thu Jul 30 18:36:44 2009
+@@ -31,7 +31,7 @@
+ 
+ /**
+  * {@link OutputStream} that cannot be closed.
+- * 
++ *
+  * @author Kohsuke Kawaguchi
+  */
+ public class NoCloseOutputStream extends FilterOutputStream {
+--- old/src/share/classes/com/sun/xml/internal/ws/util/Pool.java	Thu Jul 30 18:36:48 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/util/Pool.java	Thu Jul 30 18:36:47 2009
+@@ -31,6 +31,7 @@
+ import javax.xml.bind.JAXBContext;
+ import javax.xml.bind.JAXBException;
+ import java.util.concurrent.ConcurrentLinkedQueue;
++import java.lang.ref.WeakReference;
+ 
+ /**
+  * General-purpose object pool.
+@@ -47,8 +48,10 @@
+  * @author Kohsuke Kawaguchi
+  */
+ public abstract class Pool<T> {
+-    private final ConcurrentLinkedQueue<T> queue = new ConcurrentLinkedQueue<T>();
+ 
++    // volatile since multiple threads may access queue reference
++    private volatile WeakReference<ConcurrentLinkedQueue<T>> queue;
++
+     /**
+      * Gets a new object from the pool.
+      *
+@@ -59,17 +62,32 @@
+      *      always non-null.
+      */
+     public final T take() {
+-        T t = queue.poll();
++        T t = getQueue().poll();
+         if(t==null)
+             return create();
+         return t;
+     }
+ 
++    private ConcurrentLinkedQueue<T> getQueue() {
++        WeakReference<ConcurrentLinkedQueue<T>> q = queue;
++        if (q != null) {
++            ConcurrentLinkedQueue<T> d = q.get();
++            if (d != null)
++                return d;
++        }
++
++        // overwrite the queue
++        ConcurrentLinkedQueue<T> d = new ConcurrentLinkedQueue<T>();
++        queue = new WeakReference<ConcurrentLinkedQueue<T>>(d);
++
++        return d;
++    }
++
+     /**
+      * Returns an object back to the pool.
+      */
+     public final void recycle(T t) {
+-        queue.offer(t);
++        getQueue().offer(t);
+     }
+ 
+     /**
+--- old/src/share/classes/com/sun/xml/internal/ws/util/QNameMap.java	Thu Jul 30 18:36:51 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/util/QNameMap.java	Thu Jul 30 18:36:51 2009
+@@ -25,6 +25,8 @@
+ 
+ package com.sun.xml.internal.ws.util;
+ 
++import com.sun.istack.internal.NotNull;
++
+ import javax.xml.namespace.QName;
+ import java.util.AbstractSet;
+ import java.util.Collection;
+@@ -134,7 +136,7 @@
+      *          <tt>null</tt> if the map contains no mapping for this set of keys.
+      * @see #put(String,String, Object)
+      */
+-    public V get( String nsUri, String localPart ) {
++    public V get( @NotNull String nsUri, String localPart ) {
+         Entry<V> e = getEntry(nsUri,localPart);
+         if(e==null) return null;
+         else        return e.value;
+@@ -301,8 +303,8 @@
+     };
+ 
+     private abstract class HashIterator<E> implements Iterator<E> {
+-        Entry<V> next;	// next entry to return
+-        int index;		// current slot
++        Entry<V> next;  // next entry to return
++        int index;              // current slot
+ 
+         HashIterator() {
+             Entry<V>[] t = table;
+@@ -346,7 +348,7 @@
+         }
+     }
+ 
+-    public boolean containsKey(String nsUri,String localName) {
++    public boolean containsKey(@NotNull String nsUri,String localName) {
+         return getEntry(nsUri,localName)!=null;
+     }
+ 
+@@ -458,7 +460,7 @@
+         }
+     }
+ 
+-    private Entry<V> getEntry(String nsUri,String localName) {
++    private Entry<V> getEntry(@NotNull String nsUri,String localName) {
+         int hash = hash(localName);
+         int i = indexFor(hash, table.length);
+         Entry<V> e = table[i];
+--- old/src/share/classes/com/sun/xml/internal/ws/util/RuntimeVersion.java	Thu Jul 30 18:36:55 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/util/RuntimeVersion.java	Thu Jul 30 18:36:54 2009
+@@ -25,13 +25,43 @@
+ 
+ package com.sun.xml.internal.ws.util;
+ 
++import com.sun.xml.internal.ws.util.RuntimeVersionMBean;
++
++import java.io.InputStream;
++import java.io.IOException;
++
+ /**
+  * Obtains the version number of the JAX-WS runtime.
+  *
+  * @author Kohsuke Kawaguchi
++ * @author Jitendra Kotamraju
+  */
+-public abstract class RuntimeVersion {
+-    private RuntimeVersion() {}    // no instanciation please
++public final class RuntimeVersion implements RuntimeVersionMBean {
+ 
+-    public static final Version VERSION = Version.create(RuntimeVersion.class.getResourceAsStream("version.properties"));
++    public static final Version VERSION;
++
++    static {
++        Version version = null;
++        InputStream in = RuntimeVersion.class.getResourceAsStream("version.properties");
++        try {
++            version = Version.create(in);
++        } finally {
++            if (in != null) {
++                try {
++                    in.close();
++                } catch(IOException ioe) {
++                    // Nothing to do
++                }
++            }
++        }
++        VERSION = version == null ? Version.create(null) : version;
++    }
++
++    /**
++     * Get JAX-WS version
++     */
++    public String getVersion() {
++        return VERSION.toString();
++    }
++
+ }
+--- old/src/share/classes/com/sun/xml/internal/ws/util/UtilException.java	Thu Jul 30 18:36:58 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/util/UtilException.java	Thu Jul 30 18:36:58 2009
+@@ -31,9 +31,9 @@
+ /**
+  * UtilException represents an exception that occurred while
+  * one of the util classes is operating.
+- * 
++ *
+  * @see JAXWSExceptionBase
+- * 
++ *
+  * @author JAX-WS Development Team
+  */
+ public class UtilException extends JAXWSExceptionBase {
+--- old/src/share/classes/com/sun/xml/internal/ws/util/exception/JAXWSExceptionBase.java	Thu Jul 30 18:37:02 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/util/exception/JAXWSExceptionBase.java	Thu Jul 30 18:37:01 2009
+@@ -35,7 +35,7 @@
+ /**
+  * Represents a {@link WebServiceException} with
+  * localizable message.
+- * 
++ *
+  * @author WS Development Team
+  */
+ public abstract class JAXWSExceptionBase
+@@ -55,7 +55,7 @@
+ 
+     protected JAXWSExceptionBase(String message) {
+         super(message);
+-        msg=null;        
++        msg=null;
+     }
+ 
+     private static Object[] fixNull(Object[] x) {
+--- old/src/share/classes/com/sun/xml/internal/ws/util/localization/LocalizableImpl.java	Thu Jul 30 18:37:05 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/util/localization/LocalizableImpl.java	Thu Jul 30 18:37:05 2009
+@@ -27,7 +27,7 @@
+ 
+ /**
+  * Straight-forward {@link Localizable} implementation.
+- * 
++ *
+  * @author Kohsuke Kawaguchi
+  */
+ public final class LocalizableImpl implements Localizable {
+--- old/src/share/classes/com/sun/xml/internal/ws/util/pipe/DumpTube.java	Thu Jul 30 18:37:09 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/util/pipe/DumpTube.java	Thu Jul 30 18:37:08 2009
+@@ -82,11 +82,13 @@
+         this.staxOut = that.staxOut;
+     }
+ 
++    @Override
+     public NextAction processRequest(Packet request) {
+         dump("request",request);
+         return super.processRequest(request);
+     }
+ 
++    @Override
+     public NextAction processResponse(Packet response) {
+         dump("response",response);
+         return super.processResponse(response);
+--- old/src/share/classes/com/sun/xml/internal/ws/util/pipe/StandalonePipeAssembler.java	Thu Jul 30 18:37:12 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/util/pipe/StandalonePipeAssembler.java	Thu Jul 30 18:37:12 2009
+@@ -56,7 +56,7 @@
+         }
+         head = context.createWsaPipe(head);
+         head = context.createClientMUPipe(head);
+-        return context.createHandlerPipe(head);        
++        return context.createHandlerPipe(head);
+     }
+ 
+     /**
+--- old/src/share/classes/com/sun/xml/internal/ws/util/pipe/StandaloneTubeAssembler.java	Thu Jul 30 18:37:16 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/util/pipe/StandaloneTubeAssembler.java	Thu Jul 30 18:37:15 2009
+@@ -51,7 +51,8 @@
+         }
+         head = context.createWsaTube(head);
+         head = context.createClientMUTube(head);
+-        return context.createHandlerTube(head);        
++        head = context.createValidationTube(head);
++        return context.createHandlerTube(head);
+     }
+ 
+     /**
+@@ -61,6 +62,7 @@
+      */
+     public Tube createServer(ServerTubeAssemblerContext context) {
+         Tube head = context.getTerminalTube();
++        head = context.createValidationTube(head);
+         head = context.createHandlerTube(head);
+         head = context.createMonitoringTube(head);
+         head = context.createServerMUTube(head);
+--- old/src/share/classes/com/sun/xml/internal/ws/util/resources/Messages_en.properties	Thu Jul 30 18:37:19 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/util/resources/Messages_en.properties	Thu Jul 30 18:37:19 2009
+@@ -241,4 +241,3 @@
+ V-039 = IDREFS attributes must have at least one value
+ 
+ V-040 = ENTITIES attributes must have at least one value
+- 
+--- old/src/share/classes/com/sun/xml/internal/ws/util/version.properties	Thu Jul 30 18:37:23 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/util/version.properties	Thu Jul 30 18:37:22 2009
+@@ -23,7 +23,7 @@
+ # have any questions.
+ #
+ 
+-build-id=JAX-WS RI 2.1.1
+-build-version=JAX-WS RI 2.1.1
+-major-version=2.1.1
+- 
++#Fri May 15 16:16:14 CEST 2009
++build-id=JAX-WS RI 2.1.6
++major-version=2.1.6
++build-version=JAX-WS RI 2.1.6
+--- old/src/share/classes/com/sun/xml/internal/ws/util/xml/ContentHandlerToXMLStreamWriter.java	Thu Jul 30 18:37:26 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/util/xml/ContentHandlerToXMLStreamWriter.java	Thu Jul 30 18:37:26 2009
+@@ -175,15 +175,15 @@
+     public void startPrefixMapping(String prefix, String uri)
+         throws SAXException {
+ 
+-        if (prefix.equals("xml")) {
+-            return;
+-        }
+-
+         // defend against parsers that pass null in for "xmlns" prefix
+         if (prefix == null) {
+             prefix = "";
+         }
+ 
++        if (prefix.equals("xml")) {
++            return;
++        }
++
+         prefixBindings.add(prefix);
+         prefixBindings.add(uri);
+     }
+--- old/src/share/classes/com/sun/xml/internal/ws/util/xml/StAXSource.java	Thu Jul 30 18:37:30 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/util/xml/StAXSource.java	Thu Jul 30 18:37:29 2009
+@@ -25,16 +25,10 @@
+ 
+ package com.sun.xml.internal.ws.util.xml;
+ 
++import com.sun.istack.internal.NotNull;
++import com.sun.istack.internal.SAXParseException2;
+ import com.sun.istack.internal.XMLStreamReaderToContentHandler;
+-import org.xml.sax.ContentHandler;
+-import org.xml.sax.DTDHandler;
+-import org.xml.sax.EntityResolver;
+-import org.xml.sax.ErrorHandler;
+-import org.xml.sax.InputSource;
+-import org.xml.sax.SAXException;
+-import org.xml.sax.SAXNotRecognizedException;
+-import org.xml.sax.SAXParseException;
+-import org.xml.sax.XMLReader;
++import org.xml.sax.*;
+ import org.xml.sax.ext.LexicalHandler;
+ import org.xml.sax.helpers.XMLFilterImpl;
+ 
+@@ -88,6 +82,8 @@
+     // this object will be wrapped by the XMLReader exposed to the client
+     private final XMLStreamReaderToContentHandler reader;
+ 
++    private final XMLStreamReader staxReader;
++
+     // SAX allows ContentHandler to be changed during the parsing,
+     // but JAXB doesn't. So this repeater will sit between those
+     // two components.
+@@ -102,7 +98,14 @@
+         }
+ 
+         public void setFeature(String name, boolean value) throws SAXNotRecognizedException {
+-            throw new SAXNotRecognizedException(name);
++            // Should support these two features according to XMLReader javadoc.
++            if (name.equals("http://xml.org/sax/features/namespaces") && value) {
++                // Ignore for now
++            } else if (name.equals("http://xml.org/sax/features/namespace-prefixes") && !value) {
++                // Ignore for now
++            } else {
++                throw new SAXNotRecognizedException(name);
++            }
+         }
+ 
+         public Object getProperty(String name) throws SAXNotRecognizedException {
+@@ -171,12 +174,12 @@
+             } catch( XMLStreamException e ) {
+                 // wrap it in a SAXException
+                 SAXParseException se =
+-                    new SAXParseException(
++                    new SAXParseException2(
+                         e.getMessage(),
+                         null,
+                         null,
+-                        e.getLocation().getLineNumber(),
+-                        e.getLocation().getColumnNumber(),
++                        e.getLocation() == null ? -1 : e.getLocation().getLineNumber(),
++                        e.getLocation() == null ? -1 : e.getLocation().getColumnNumber(),
+                         e);
+ 
+                 // if the consumer sets an error handler, it is our responsibility
+@@ -188,6 +191,12 @@
+                 // returns, we will abort anyway.
+                 throw se;
+ 
++            } finally {
++                try {
++                    staxReader.close();
++                } catch(XMLStreamException xe) {
++                    //falls through. Not much can be done.
++                }
+             }
+         }
+     };
+@@ -196,18 +205,36 @@
+      * Creates a new {@link javax.xml.transform.Source} for the given
+      * {@link XMLStreamReader}.
+      *
++     * @param reader XMLStreamReader that will be exposed as a Source
++     * @param eagerQuit if true, when the conversion is completed, leave the cursor to the last
++     *                  event that was fired (such as end element)
++     * @see #StAXSource(XMLStreamReader, boolean, String[])
++     */
++    public StAXSource(XMLStreamReader reader, boolean eagerQuit) {
++        this(reader, eagerQuit, new String[0]);
++    }
++
++    /**
++     * Creates a new {@link javax.xml.transform.Source} for the given
++     * {@link XMLStreamReader}.
++     *
+      * The XMLStreamReader must be pointing at either a
+      * {@link javax.xml.stream.XMLStreamConstants#START_DOCUMENT} or
+      * {@link javax.xml.stream.XMLStreamConstants#START_ELEMENT} event.
+      *
+      * @param reader XMLStreamReader that will be exposed as a Source
++     * @param eagerQuit if true, when the conversion is completed, leave the cursor to the last
++     *                  event that was fired (such as end element)
++     * @param inscope inscope Namespaces
++     *                array of the even length of the form { prefix0, uri0, prefix1, uri1, ... }
+      * @throws IllegalArgumentException iff the reader is null
+      * @throws IllegalStateException iff the reader is not pointing at either a
+      * START_DOCUMENT or START_ELEMENT event
+      */
+-    public StAXSource(XMLStreamReader reader, boolean eagerQuit) {
++    public StAXSource(XMLStreamReader reader, boolean eagerQuit, @NotNull String[] inscope) {
+         if( reader == null )
+             throw new IllegalArgumentException();
++        this.staxReader = reader;
+ 
+         int eventType = reader.getEventType();
+         if (!(eventType == XMLStreamConstants.START_DOCUMENT)
+@@ -215,7 +242,7 @@
+             throw new IllegalStateException();
+         }
+ 
+-        this.reader = new XMLStreamReaderToContentHandler(reader,repeater,eagerQuit,false);
++        this.reader = new XMLStreamReaderToContentHandler(reader,repeater,eagerQuit,false,inscope);
+ 
+         super.setXMLReader(pseudoParser);
+         // pass a dummy InputSource. We don't care
+--- old/src/share/classes/com/sun/xml/internal/ws/util/xml/XMLStreamReaderToXMLStreamWriter.java	Thu Jul 30 18:37:33 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/util/xml/XMLStreamReaderToXMLStreamWriter.java	Thu Jul 30 18:37:33 2009
+@@ -43,6 +43,8 @@
+  */
+ public class XMLStreamReaderToXMLStreamWriter {
+ 
++    private static final int BUF_SIZE = 4096;
++
+     protected XMLStreamReader in;
+     protected XMLStreamWriter out;
+ 
+@@ -126,11 +128,13 @@
+             in.getPIData());
+     }
+ 
++
+     protected void handleCharacters() throws XMLStreamException {
+-        out.writeCharacters(
+-            in.getTextCharacters(),
+-            in.getTextStart(),
+-            in.getTextLength() );
++        char[] buf = new char[BUF_SIZE];
++        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);
++        }
+     }
+ 
+     protected void handleEndElement() throws XMLStreamException {
+--- old/src/share/classes/com/sun/xml/internal/ws/util/xml/XmlUtil.java	Thu Jul 30 18:37:37 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/util/xml/XmlUtil.java	Thu Jul 30 18:37:36 2009
+@@ -40,11 +40,21 @@
+ 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 javax.xml.namespace.QName;
++import javax.xml.parsers.ParserConfigurationException;
++import javax.xml.parsers.SAXParserFactory;
++import javax.xml.transform.Result;
++import javax.xml.transform.Source;
+ import javax.xml.transform.Transformer;
+ import javax.xml.transform.TransformerConfigurationException;
++import javax.xml.transform.TransformerException;
+ import javax.xml.transform.TransformerFactory;
++import javax.xml.transform.sax.SAXTransformerFactory;
++import javax.xml.transform.sax.TransformerHandler;
++import javax.xml.transform.stream.StreamSource;
+ import javax.xml.ws.WebServiceException;
+ import java.io.IOException;
+ import java.io.InputStream;
+@@ -61,6 +71,8 @@
+  * @author WS Development Team
+  */
+ public class XmlUtil {
++    private final static String LEXICAL_HANDLER_PROPERTY =
++        "http://xml.org/sax/properties/lexical-handler";
+ 
+     public static String getPrefix(String s) {
+         int i = s.indexOf(':');
+@@ -188,6 +200,12 @@
+ 
+     static final TransformerFactory transformerFactory = TransformerFactory.newInstance();
+ 
++    static final SAXParserFactory saxParserFactory = SAXParserFactory.newInstance();
++
++    static {
++        saxParserFactory.setNamespaceAware(true);
++    }
++
+     /**
+      * Creates a new identity transformer.
+      */
+@@ -199,6 +217,36 @@
+         }
+     }
+ 
++    /**
++     * Performs identity transformation.
++     */
++    public static <T extends Result>
++    T identityTransform(Source src, T result) throws TransformerException, SAXException, ParserConfigurationException, IOException {
++        if (src instanceof StreamSource) {
++            // work around a bug in JAXP in JDK6u4 and earlier where the namespace processing
++            // is not turned on by default
++            StreamSource ssrc = (StreamSource) src;
++            TransformerHandler th = ((SAXTransformerFactory) transformerFactory).newTransformerHandler();
++            th.setResult(result);
++            XMLReader reader = saxParserFactory.newSAXParser().getXMLReader();
++            reader.setContentHandler(th);
++            reader.setProperty(LEXICAL_HANDLER_PROPERTY, th);
++            reader.parse(toInputSource(ssrc));
++        } else {
++            newTransformer().transform(src, result);
++        }
++        return result;
++    }
++
++    private static InputSource toInputSource(StreamSource src) {
++        InputSource is = new InputSource();
++        is.setByteStream(src.getInputStream());
++        is.setCharacterStream(src.getReader());
++        is.setPublicId(src.getPublicId());
++        is.setSystemId(src.getSystemId());
++        return is;
++    }
++
+     /*
+     * Gets an EntityResolver using XML catalog
+     */
+--- old/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/DelegatingParserExtension.java	Thu Jul 30 18:37:40 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/DelegatingParserExtension.java	Thu Jul 30 18:37:40 2009
+@@ -25,16 +25,7 @@
+ 
+ package com.sun.xml.internal.ws.wsdl.parser;
+ 
+-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.WSDLFault;
+-import com.sun.xml.internal.ws.api.model.wsdl.WSDLInput;
+-import com.sun.xml.internal.ws.api.model.wsdl.WSDLMessage;
+-import com.sun.xml.internal.ws.api.model.wsdl.WSDLOperation;
+-import com.sun.xml.internal.ws.api.model.wsdl.WSDLOutput;
+-import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort;
+-import com.sun.xml.internal.ws.api.model.wsdl.WSDLPortType;
+-import com.sun.xml.internal.ws.api.model.wsdl.WSDLService;
++import com.sun.xml.internal.ws.api.model.wsdl.*;
+ import com.sun.xml.internal.ws.api.wsdl.parser.WSDLParserExtension;
+ import com.sun.xml.internal.ws.api.wsdl.parser.WSDLParserExtensionContext;
+ 
+@@ -42,7 +33,7 @@
+ 
+ /**
+  * Delegate to another {@link WSDLParserExtension}
+- * useful for the base class for filtering. 
++ * useful for the base class for filtering.
+  *
+  * @author Kohsuke Kawaguchi
+  */
+@@ -169,12 +160,12 @@
+         core.bindingOperationOutputAttributes(operation, reader);
+     }
+ 
+-    public boolean bindingOperationFaultElements(WSDLBoundOperation operation, XMLStreamReader reader) {
+-        return core.bindingOperationFaultElements(operation, reader);
++    public boolean bindingOperationFaultElements(WSDLBoundFault fault, XMLStreamReader reader) {
++        return core.bindingOperationFaultElements(fault, reader);
+     }
+ 
+-    public void bindingOperationFaultAttributes(WSDLBoundOperation operation, XMLStreamReader reader) {
+-        core.bindingOperationFaultAttributes(operation, reader);
++    public void bindingOperationFaultAttributes(WSDLBoundFault fault, XMLStreamReader reader) {
++        core.bindingOperationFaultAttributes(fault, reader);
+     }
+ 
+     public void finished(WSDLParserExtensionContext context) {
+--- old/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/FoolProofParserExtension.java	Thu Jul 30 18:37:44 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/FoolProofParserExtension.java	Thu Jul 30 18:37:43 2009
+@@ -25,16 +25,7 @@
+ package com.sun.xml.internal.ws.wsdl.parser;
+ 
+ 
+-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.WSDLFault;
+-import com.sun.xml.internal.ws.api.model.wsdl.WSDLInput;
+-import com.sun.xml.internal.ws.api.model.wsdl.WSDLMessage;
+-import com.sun.xml.internal.ws.api.model.wsdl.WSDLOperation;
+-import com.sun.xml.internal.ws.api.model.wsdl.WSDLOutput;
+-import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort;
+-import com.sun.xml.internal.ws.api.model.wsdl.WSDLPortType;
+-import com.sun.xml.internal.ws.api.model.wsdl.WSDLService;
++import com.sun.xml.internal.ws.api.model.wsdl.*;
+ import com.sun.xml.internal.ws.api.wsdl.parser.WSDLParserExtension;
+ 
+ import javax.xml.namespace.QName;
+@@ -133,7 +124,7 @@
+         return post(pre(reader),reader,super.bindingOperationOutputElements(operation, reader));
+     }
+ 
+-    public boolean bindingOperationFaultElements(WSDLBoundOperation operation, XMLStreamReader reader) {
+-        return post(pre(reader),reader,super.bindingOperationFaultElements(operation, reader));
++    public boolean bindingOperationFaultElements(WSDLBoundFault fault, XMLStreamReader reader) {
++        return post(pre(reader),reader,super.bindingOperationFaultElements(fault, reader));
+     }
+ }
+--- old/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/ParserUtil.java	Thu Jul 30 18:37:47 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/ParserUtil.java	Thu Jul 30 18:37:47 2009
+@@ -26,9 +26,10 @@
+ 
+ 
+ import com.sun.xml.internal.ws.streaming.Attributes;
+-import com.sun.xml.internal.ws.streaming.XMLReader;
+ import com.sun.xml.internal.ws.streaming.XMLReaderException;
+ import com.sun.xml.internal.ws.util.xml.XmlUtil;
++import com.sun.istack.internal.NotNull;
++import com.sun.istack.internal.Nullable;
+ 
+ 
+ import java.io.File;
+@@ -56,17 +57,10 @@
+         return reader.getAttributeValue(name.getNamespaceURI(), name.getLocalPart());
+     }
+ 
+-    public static void verifyTag(XMLReader reader, QName name) {
+-        if (!name.equals(reader.getName())) {
+-            throw new XMLReaderException("xmlreader.unexpectedState.tag",
+-                new Object[] { name, reader.getName() });
+-        }
+-    }
+-
+     public static QName getQName(XMLStreamReader reader, String tag){
+         String localName = XmlUtil.getLocalPart(tag);
+         String pfix = XmlUtil.getPrefix(tag);
+-        String uri = reader.getNamespaceURI(pfix);
++        String uri = reader.getNamespaceURI(fixNull(pfix));
+         return new QName(uri, localName);
+     }
+ 
+@@ -84,18 +78,6 @@
+         return value;
+     }
+ 
+-    public static void fail(String key, XMLReader reader) {
+-        //throw new WebServicesClientException(key,
+-        //        Integer.toString(reader.getLineNumber()));
+-    }
+-
+-    public static void failWithFullName(String key, XMLReader reader) {
+-        //throw new WebServicesClientException(key,
+-        //new Object[]{
+-        //  Integer.toString(reader.getLineNumber()),
+-        //  reader.getName().toString()});
+-    }
+-
+     public static void failWithFullName(String key, XMLStreamReader reader) {
+ //        throw new WebServicesClientException(key,
+ //        new Object[]{
+@@ -110,7 +92,7 @@
+         //          reader.getLocalName()});
+     }
+ 
+-    public static void failWithLocalName(String key, XMLReader reader,
++    public static void failWithLocalName(String key, XMLStreamReader reader,
+         String arg) {
+         //throw new WebServicesClientException(key,
+         //      new Object[]{
+@@ -119,12 +101,8 @@
+         //          arg});
+     }
+ 
+-    public static void failWithLocalName(String key, XMLStreamReader reader,
+-        String arg) {
+-        //throw new WebServicesClientException(key,
+-        //      new Object[]{
+-        //          Integer.toString(reader.getLineNumber()),
+-        //          reader.getLocalName(),
+-        //          arg});
++    private static @NotNull String fixNull(@Nullable String s) {
++        if (s == null) return "";
++        else return s;
+     }
+ }
+--- old/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/RuntimeWSDLParser.java	Thu Jul 30 18:37:51 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/RuntimeWSDLParser.java	Thu Jul 30 18:37:50 2009
+@@ -29,13 +29,17 @@
+ import com.sun.istack.internal.Nullable;
+ import com.sun.xml.internal.ws.api.BindingID;
+ import com.sun.xml.internal.ws.api.EndpointAddress;
+-import com.sun.xml.internal.ws.api.streaming.XMLStreamReaderFactory;
+ 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.model.ParameterBinding;
+ import com.sun.xml.internal.ws.api.model.wsdl.WSDLDescriptorKind;
+-import com.sun.xml.internal.ws.api.model.wsdl.WSDLModel;
+-import com.sun.xml.internal.ws.api.wsdl.parser.*;
++import com.sun.xml.internal.ws.api.server.Container;
++import com.sun.xml.internal.ws.api.streaming.XMLStreamReaderFactory;
++import com.sun.xml.internal.ws.api.wsdl.parser.MetaDataResolver;
++import com.sun.xml.internal.ws.api.wsdl.parser.MetadataResolverFactory;
++import com.sun.xml.internal.ws.api.wsdl.parser.ServiceDescriptor;
++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;
+ import com.sun.xml.internal.ws.model.wsdl.*;
+ import com.sun.xml.internal.ws.resources.ClientMessages;
+@@ -60,7 +64,11 @@
+ import java.io.InputStream;
+ import java.net.URISyntaxException;
+ import java.net.URL;
+-import java.util.*;
++import java.util.ArrayList;
++import java.util.HashSet;
++import java.util.List;
++import java.util.Map;
++import java.util.Set;
+ import java.util.logging.Logger;
+ 
+ /**
+@@ -101,10 +109,10 @@
+      *      Either this or <tt>wsdl</tt> parameter must be given.
+      *      Null location means the system won't be able to resolve relative references in the WSDL,
+      */
+-    public static WSDLModelImpl parse(@Nullable URL wsdlLoc, @NotNull Source wsdlSource, @NotNull EntityResolver resolver, boolean isClientSide, WSDLParserExtension... extensions) throws IOException, XMLStreamException, SAXException {
++    public static WSDLModelImpl parse(@Nullable URL wsdlLoc, @NotNull Source wsdlSource, @NotNull EntityResolver resolver, boolean isClientSide, Container container, WSDLParserExtension... extensions) throws IOException, XMLStreamException, SAXException {
+         assert resolver != null;
+ 
+-        RuntimeWSDLParser wsdlParser = new RuntimeWSDLParser(wsdlSource.getSystemId(), new EntityResolverWrapper(resolver), isClientSide, extensions);
++        RuntimeWSDLParser wsdlParser = new RuntimeWSDLParser(wsdlSource.getSystemId(), new EntityResolverWrapper(resolver), isClientSide, container, extensions);
+         Parser parser;
+         try{
+             parser = wsdlParser.resolveWSDL(wsdlLoc, wsdlSource);
+@@ -116,25 +124,29 @@
+             //Try MEX if there is WSDLLoc available
+             if(wsdlLoc == null)
+                 throw e;
+-            return tryWithMex(wsdlParser, wsdlLoc, resolver, isClientSide, e, extensions);
++            return tryWithMex(wsdlParser, wsdlLoc, resolver, isClientSide, container, e, extensions);
+ 
+         }catch(IOException e){
+             //Try MEX if there is WSDLLoc available
+             if(wsdlLoc == null)
+                 throw e;
+-            return tryWithMex(wsdlParser, wsdlLoc, resolver, isClientSide, e, extensions);
++            return tryWithMex(wsdlParser, wsdlLoc, resolver, isClientSide, container, e, extensions);
+         }
+         wsdlParser.parseWSDL(parser, false);
+         wsdlParser.wsdlDoc.freeze();
+         wsdlParser.extensionFacade.finished(wsdlParser.context);
+         wsdlParser.extensionFacade.postFinished(wsdlParser.context);
++
++        if(wsdlParser.wsdlDoc.getServices().isEmpty())
++            throw new WebServiceException(ClientMessages.WSDL_CONTAINS_NO_SERVICE(wsdlLoc));
++
+         return wsdlParser.wsdlDoc;
+     }
+ 
+-    private static WSDLModelImpl tryWithMex(@NotNull RuntimeWSDLParser wsdlParser, @NotNull URL wsdlLoc, @NotNull EntityResolver resolver, boolean isClientSide, Throwable e, WSDLParserExtension... extensions) throws SAXException, XMLStreamException {
++    private static WSDLModelImpl tryWithMex(@NotNull RuntimeWSDLParser wsdlParser, @NotNull URL wsdlLoc, @NotNull EntityResolver resolver, boolean isClientSide, Container container, Throwable e, WSDLParserExtension... extensions) throws SAXException, XMLStreamException {
+         ArrayList<Throwable> exceptions = new ArrayList<Throwable>();
+         try {
+-            WSDLModelImpl wsdlModel =  wsdlParser.parseUsingMex(wsdlLoc, resolver, isClientSide, extensions);
++            WSDLModelImpl wsdlModel =  wsdlParser.parseUsingMex(wsdlLoc, resolver, isClientSide, container, extensions);
+             if(wsdlModel == null){
+                 throw new WebServiceException(ClientMessages.FAILED_TO_PARSE(wsdlLoc.toExternalForm(), e.getMessage()), e);
+             }
+@@ -146,10 +158,10 @@
+             exceptions.add(e);
+             exceptions.add(e1);
+         }
+-        throw new InaccessibleWSDLException(exceptions);                
++        throw new InaccessibleWSDLException(exceptions);
+     }
+ 
+-    private WSDLModelImpl parseUsingMex(@NotNull URL wsdlLoc, @NotNull EntityResolver resolver, boolean isClientSide, WSDLParserExtension[] extensions) throws IOException, SAXException, XMLStreamException, URISyntaxException {
++    private WSDLModelImpl parseUsingMex(@NotNull URL wsdlLoc, @NotNull EntityResolver resolver, boolean isClientSide, Container container, WSDLParserExtension[] extensions) throws IOException, SAXException, XMLStreamException, URISyntaxException {
+         //try MEX
+         MetaDataResolver mdResolver = null;
+         ServiceDescriptor serviceDescriptor = null;
+@@ -165,11 +177,10 @@
+         }
+         if (serviceDescriptor != null) {
+             List<? extends Source> wsdls = serviceDescriptor.getWSDLs();
+-            wsdlParser = new RuntimeWSDLParser(wsdlLoc.toExternalForm(), new MexEntityResolver(wsdls), isClientSide, extensions);
++            wsdlParser = new RuntimeWSDLParser(wsdlLoc.toExternalForm(), new MexEntityResolver(wsdls), isClientSide, container, extensions);
+ 
+-            //now parse the first WSDL in the list
+-            if(wsdls.size() > 0){
+-                String systemId = wsdls.get(0).getSystemId();
++            for(Source src: wsdls ) {
++                String systemId = src.getSystemId();
+                 Parser parser = wsdlParser.resolver.resolveEntity(null, systemId);
+                 wsdlParser.parseWSDL(parser, false);
+             }
+@@ -176,11 +187,11 @@
+         }
+         //Incase that mex is not present or it couldn't get the metadata, try by appending ?wsdl and give
+         // it a last shot else fail
+-        if (mdResolver == null && (wsdlLoc.getProtocol().equals("http") || wsdlLoc.getProtocol().equals("https")) && (wsdlLoc.getQuery() == null)) {
++        if ((mdResolver == null || serviceDescriptor == null) && (wsdlLoc.getProtocol().equals("http") || wsdlLoc.getProtocol().equals("https")) && (wsdlLoc.getQuery() == null)) {
+             String urlString = wsdlLoc.toExternalForm();
+             urlString += "?wsdl";
+             wsdlLoc = new URL(urlString);
+-            wsdlParser = new RuntimeWSDLParser(wsdlLoc.toExternalForm(),new EntityResolverWrapper(resolver), isClientSide, extensions);
++            wsdlParser = new RuntimeWSDLParser(wsdlLoc.toExternalForm(),new EntityResolverWrapper(resolver), isClientSide, container, extensions);
+             Parser parser = resolveWSDL(wsdlLoc, new StreamSource(wsdlLoc.toExternalForm()));
+             wsdlParser.parseWSDL(parser, false);
+         }
+@@ -199,9 +210,9 @@
+         return reader.getName().equals(WSDLConstants.QNAME_DEFINITIONS);
+     }
+ 
+-    public static WSDLModelImpl parse(XMLEntityResolver.Parser wsdl, XMLEntityResolver resolver, boolean isClientSide, WSDLParserExtension... extensions) throws IOException, XMLStreamException, SAXException {
++    public static WSDLModelImpl parse(XMLEntityResolver.Parser wsdl, XMLEntityResolver resolver, boolean isClientSide, Container container, WSDLParserExtension... extensions) throws IOException, XMLStreamException, SAXException {
+         assert resolver != null;
+-        RuntimeWSDLParser parser = new RuntimeWSDLParser( wsdl.systemId.toExternalForm(), resolver, isClientSide, extensions);
++        RuntimeWSDLParser parser = new RuntimeWSDLParser( wsdl.systemId.toExternalForm(), resolver, isClientSide, container, extensions);
+         parser.parseWSDL(wsdl, false);
+         parser.wsdlDoc.freeze();
+         parser.extensionFacade.finished(parser.context);
+@@ -209,16 +220,17 @@
+         return parser.wsdlDoc;
+     }
+ 
+-    private RuntimeWSDLParser(@NotNull String sourceLocation, XMLEntityResolver resolver, boolean isClientSide, WSDLParserExtension... extensions) {
++    private RuntimeWSDLParser(@NotNull String sourceLocation, XMLEntityResolver resolver, boolean isClientSide, Container container, WSDLParserExtension... extensions) {
+         this.wsdlDoc = sourceLocation!=null ? new WSDLModelImpl(sourceLocation) : new WSDLModelImpl();
+         this.resolver = resolver;
+ 
+         this.extensions = new ArrayList<WSDLParserExtension>();
+-        this.context = new WSDLParserExtensionContextImpl(wsdlDoc, isClientSide);
++        this.context = new WSDLParserExtensionContextImpl(wsdlDoc, isClientSide, container);
+ 
+         // register handlers for default extensions
+         register(new MemberSubmissionAddressingWSDLParserExtension());
+         register(new W3CAddressingWSDLParserExtension());
++        register(new W3CAddressingMetadataWSDLParserExtension());
+ 
+         for (WSDLParserExtension e : extensions)
+             register(e);
+@@ -267,7 +279,7 @@
+ 
+             if(reader.getEventType() == XMLStreamConstants.START_DOCUMENT)
+                 XMLStreamReaderUtil.nextElementContent(reader);
+-            
++
+             if (reader.getEventType()!= XMLStreamConstants.END_DOCUMENT && reader.getName().equals(WSDLConstants.QNAME_SCHEMA)) {
+                 if (imported) {
+                     // wsdl:import could be a schema. Relaxing BP R2001 requirement.
+@@ -406,7 +418,7 @@
+                 } else {
+                     binding.setStyle(Style.DOCUMENT);
+                 }
+-                XMLStreamReaderUtil.next(reader);
++                goToEnd(reader);
+             } else if (WSDLConstants.NS_SOAP12_BINDING.equals(name)) {
+                 binding.setBindingId(BindingID.SOAP12_HTTP);
+                 String style = reader.getAttributeValue(null, "style");
+@@ -415,7 +427,7 @@
+                 } else {
+                     binding.setStyle(Style.DOCUMENT);
+                 }
+-                XMLStreamReaderUtil.next(reader);
++                goToEnd(reader);
+             } else if (WSDLConstants.QNAME_OPERATION.equals(name)) {
+                 parseBindingOperation(reader, binding);
+             } else {
+@@ -441,6 +453,7 @@
+ 
+         while (XMLStreamReaderUtil.nextElementContent(reader) != XMLStreamConstants.END_ELEMENT) {
+             QName name = reader.getName();
++            String style = null;
+             if (WSDLConstants.QNAME_INPUT.equals(name)) {
+                 parseInputBinding(reader, bindingOp);
+             } else if (WSDLConstants.QNAME_OUTPUT.equals(name)) {
+@@ -449,28 +462,28 @@
+                 parseFaultBinding(reader, bindingOp);
+             } else if (SOAPConstants.QNAME_OPERATION.equals(name) ||
+                     SOAPConstants.QNAME_SOAP12OPERATION.equals(name)) {
+-                String style = reader.getAttributeValue(null, "style");
+-                /**
+-                 *  If style attribute is present set it otherwise set the style as defined
+-                 *  on the <soap:binding> element
+-                 */
+-                if (style != null) {
+-                    if (style.equals("rpc"))
+-                        bindingOp.setStyle(Style.RPC);
+-                    else
+-                        bindingOp.setStyle(Style.DOCUMENT);
+-                } else {
+-                    bindingOp.setStyle(binding.getStyle());
+-                }
++                style = reader.getAttributeValue(null, "style");
+                 String soapAction = reader.getAttributeValue(null, "soapAction");
+ 
+                 if (soapAction != null)
+                     bindingOp.setSoapAction(soapAction);
+ 
+-                XMLStreamReaderUtil.next(reader);
++                goToEnd(reader);
+             } else {
+                 extensionFacade.bindingOperationElements(bindingOp, reader);
+             }
++            /**
++             *  If style attribute is present set it otherwise set the style as defined
++             *  on the <soap:binding> element
++             */
++            if (style != null) {
++                if (style.equals("rpc"))
++                    bindingOp.setStyle(Style.RPC);
++                else
++                    bindingOp.setStyle(Style.DOCUMENT);
++            } else {
++                bindingOp.setStyle(binding.getStyle());
++            }
+         }
+     }
+ 
+@@ -513,21 +526,14 @@
+     }
+ 
+     private void parseFaultBinding(XMLStreamReader reader, WSDLBoundOperationImpl bindingOp) {
+-        boolean bodyFound = false;
+-        extensionFacade.bindingOperationFaultAttributes(bindingOp, reader);
++        String faultName = ParserUtil.getMandatoryNonEmptyAttribute(reader, "name");
++        WSDLBoundFaultImpl wsdlBoundFault = new WSDLBoundFaultImpl(reader, faultName, bindingOp);
++        bindingOp.addFault(wsdlBoundFault);
++
++        extensionFacade.bindingOperationFaultAttributes(wsdlBoundFault, reader);
++
+         while (XMLStreamReaderUtil.nextElementContent(reader) != XMLStreamConstants.END_ELEMENT) {
+-            QName name = reader.getName();
+-            if ((SOAPConstants.QNAME_BODY.equals(name) || SOAPConstants.QNAME_SOAP12BODY.equals(name)) && !bodyFound) {
+-                bodyFound = true;
+-                bindingOp.setFaultExplicitBodyParts(parseSOAPBodyBinding(reader, bindingOp.getFaultParts()));
+-                goToEnd(reader);
+-            } else if ((SOAPConstants.QNAME_HEADER.equals(name) || SOAPConstants.QNAME_SOAP12HEADER.equals(name))) {
+-                parseSOAPHeaderBinding(reader, bindingOp.getFaultParts());
+-            } else if (MIMEConstants.QNAME_MULTIPART_RELATED.equals(name)) {
+-                parseMimeMultipartBinding(reader, bindingOp, BindingMode.FAULT);
+-            } else {
+-                extensionFacade.bindingOperationFaultElements(bindingOp, reader);
+-            }
++            extensionFacade.bindingOperationFaultElements(wsdlBoundFault, reader);
+         }
+     }
+ 
+@@ -698,7 +704,7 @@
+         String msg = ParserUtil.getMandatoryNonEmptyAttribute(reader, "message");
+         QName msgName = ParserUtil.getQName(reader, msg);
+         String name = ParserUtil.getMandatoryNonEmptyAttribute(reader, "name");
+-        WSDLFaultImpl fault = new WSDLFaultImpl(reader,name, msgName);
++        WSDLFaultImpl fault = new WSDLFaultImpl(reader,name, msgName, operation);
+         operation.addFault(fault);
+         extensionFacade.portTypeOperationFaultAttributes(fault, reader);
+         extensionFacade.portTypeOperationFault(operation, reader);
+@@ -757,11 +763,10 @@
+                         break;
+                     }
+                 }
+-                if (desc == null)
+-                    continue;
+-
+-                WSDLPartImpl wsdlPart = new WSDLPartImpl(reader, part, partIndex, new WSDLPartDescriptorImpl(reader,ParserUtil.getQName(reader, desc), kind));
+-                msg.add(wsdlPart);
++                if (desc != null) {
++                    WSDLPartImpl wsdlPart = new WSDLPartImpl(reader, part, partIndex, new WSDLPartDescriptorImpl(reader,ParserUtil.getQName(reader, desc), kind));
++                    msg.add(wsdlPart);
++                }
+                 if (reader.getEventType() != XMLStreamConstants.END_ELEMENT)
+                     goToEnd(reader);
+             } else {
+--- old/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/SOAPConstants.java	Thu Jul 30 18:37:55 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/SOAPConstants.java	Thu Jul 30 18:37:54 2009
+@@ -64,7 +64,7 @@
+     public static final QName QNAME_OPERATION =
+         new QName(NS_WSDL_SOAP, "operation");
+     public static final QName QNAME_SOAP12OPERATION =
+-        new QName(NS_WSDL_SOAP12, "operation"); 
++        new QName(NS_WSDL_SOAP12, "operation");
+     public static final QName QNAME_MUSTUNDERSTAND =
+         new QName(URI_ENVELOPE, "mustUnderstand");
+ 
+--- old/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/WSDLParserExtensionContextImpl.java	Thu Jul 30 18:37:58 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/WSDLParserExtensionContextImpl.java	Thu Jul 30 18:37:58 2009
+@@ -25,6 +25,7 @@
+ package com.sun.xml.internal.ws.wsdl.parser;
+ 
+ import com.sun.xml.internal.ws.api.model.wsdl.WSDLModel;
++import com.sun.xml.internal.ws.api.server.Container;
+ import com.sun.xml.internal.ws.api.wsdl.parser.WSDLParserExtensionContext;
+ 
+ /**
+@@ -31,18 +32,21 @@
+  * Provides implementation of {@link WSDLParserExtensionContext}
+  *
+  * @author Vivek Pandey
++ * @author Fabian Ritzmann
+  */
+ final class WSDLParserExtensionContextImpl implements WSDLParserExtensionContext {
+     private final boolean isClientSide;
+     private final WSDLModel wsdlModel;
++    private final Container container;
+ 
+     /**
+      * Construct {@link WSDLParserExtensionContextImpl} with information that whether its on client side
+      * or server side.
+      */
+-    protected WSDLParserExtensionContextImpl(WSDLModel model, boolean isClientSide) {
++    protected WSDLParserExtensionContextImpl(WSDLModel model, boolean isClientSide, Container container) {
+         this.wsdlModel = model;
+         this.isClientSide = isClientSide;
++        this.container = container;
+     }
+ 
+     public boolean isClientSide() {
+@@ -52,4 +56,8 @@
+     public WSDLModel getWSDLModel() {
+         return wsdlModel;
+     }
++
++    public Container getContainer() {
++        return this.container;
++    }
+ }
+--- old/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/WSDLParserExtensionFacade.java	Thu Jul 30 18:38:02 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/WSDLParserExtensionFacade.java	Thu Jul 30 18:38:01 2009
+@@ -296,9 +296,9 @@
+         }
+     }
+ 
+-    public boolean bindingOperationFaultElements(WSDLBoundOperation operation, XMLStreamReader reader) {
++    public boolean bindingOperationFaultElements(WSDLBoundFault fault, XMLStreamReader reader) {
+         for (WSDLParserExtension e : extensions) {
+-            if (e.bindingOperationFaultElements(operation, reader)) {
++            if (e.bindingOperationFaultElements(fault, reader)) {
+                 return true;
+             }
+         }
+@@ -306,9 +306,9 @@
+         return true;
+     }
+ 
+-    public void bindingOperationFaultAttributes(WSDLBoundOperation operation, XMLStreamReader reader) {
++    public void bindingOperationFaultAttributes(WSDLBoundFault fault, XMLStreamReader reader) {
+         for (WSDLParserExtension e : extensions) {
+-            e.bindingOperationFaultAttributes(operation, reader);
++            e.bindingOperationFaultAttributes(fault, reader);
+         }
+     }
+ 
+--- old/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/UsingAddressing.java	Thu Jul 30 18:38:05 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/UsingAddressing.java	Thu Jul 30 18:38:05 2009
+@@ -22,9 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * $Id: UsingAddressing.java,v 1.1.2.3 2006/09/26 22:17:15 ramapulavarthi Exp $
+- */
+ 
+ package com.sun.xml.internal.ws.wsdl.writer;
+ 
+--- old/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/W3CAddressingWSDLGeneratorExtension.java	Thu Jul 30 18:38:09 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/W3CAddressingWSDLGeneratorExtension.java	Thu Jul 30 18:38:08 2009
+@@ -22,29 +22,27 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/*
+- * $Id: W3CAddressingWSDLGeneratorExtension.java,v 1.1.2.14 2007/03/15 07:22:13 ramapulavarthi Exp $
+- */
+ 
+ package com.sun.xml.internal.ws.wsdl.writer;
+ 
+-import javax.xml.ws.Action;
+-import javax.xml.ws.FaultAction;
+-import javax.xml.ws.soap.AddressingFeature;
+-
+-import com.sun.istack.internal.NotNull;
+ import com.sun.xml.internal.txw2.TypedXmlWriter;
+ import com.sun.xml.internal.ws.api.WSBinding;
+ import com.sun.xml.internal.ws.api.addressing.AddressingVersion;
+ import com.sun.xml.internal.ws.api.model.CheckedException;
+ 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.server.Container;
+-import com.sun.xml.internal.ws.api.wsdl.writer.WSDLGeneratorExtension;
+ import com.sun.xml.internal.ws.api.wsdl.writer.WSDLGenExtnContext;
++import com.sun.xml.internal.ws.api.wsdl.writer.WSDLGeneratorExtension;
+ 
++import javax.xml.ws.Action;
++import javax.xml.ws.FaultAction;
++import javax.xml.ws.soap.AddressingFeature;
++import java.net.URI;
++import java.net.URISyntaxException;
++import java.util.logging.Logger;
++
+ /**
+  * @author Arun Gupta
++ * @author Rama Pulavarthi
+  */
+ public class W3CAddressingWSDLGeneratorExtension extends WSDLGeneratorExtension {
+     private boolean enabled;
+@@ -70,9 +68,38 @@
+         Action a = method.getSEIMethod().getAnnotation(Action.class);
+         if (a != null && !a.input().equals("")) {
+             addAttribute(input, a.input());
++        } else {
++            if (method.getBinding().getSOAPAction().equals("")) {
++                //hack: generate default action for interop with .Net3.0 when soapAction is non-empty
++                String defaultAction = getDefaultAction(method);
++                addAttribute(input, defaultAction);
++            }
+         }
+     }
+ 
++    protected static final String getDefaultAction(JavaMethod method) {
++        String tns = method.getOwner().getTargetNamespace();
++        String delim = "/";
++        // TODO: is this the correct way to find the separator ?
++        try {
++            URI uri = new URI(tns);
++            if(uri.getScheme().equalsIgnoreCase("urn"))
++                delim = ":";
++        } catch (URISyntaxException e) {
++            LOGGER.warning("TargetNamespace of WebService is not a valid URI");
++        }
++        if (tns.endsWith(delim))
++            tns = tns.substring(0, tns.length() - 1);
++        //this assumes that fromjava case there won't be input name.
++        // if there is input name in future, then here name=inputName
++        //else use operation name as follows.
++        String name = (method.getMEP().isOneWay())?method.getOperationName():method.getOperationName()+"Request";
++
++        return new StringBuilder(tns).append(delim).append(
++                method.getOwner().getPortTypeName().getLocalPart()).append(
++                delim).append(name).toString();
++    }
++
+     @Override
+     public void addOperationOutputExtension(TypedXmlWriter output, JavaMethod method) {
+         if (!enabled)
+@@ -124,4 +151,5 @@
+         }
+         */
+     }
++     private static final Logger LOGGER = Logger.getLogger(W3CAddressingWSDLGeneratorExtension.class.getName());
+ }
+--- old/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/WSDLGenerator.java	Thu Jul 30 18:38:12 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/WSDLGenerator.java	Thu Jul 30 18:38:12 2009
+@@ -122,7 +122,7 @@
+     /**
+      * The WSDL namespace
+      */
+-    private static final String WSDL_NAMESPACE   = WSDLConstants.NS_WSDL; 
++    private static final String WSDL_NAMESPACE   = WSDLConstants.NS_WSDL;
+ 
+     /**
+      * the XSD namespace
+@@ -139,7 +139,7 @@
+     /**
+      * The SOAP 1.2 namespace
+      */
+-    private static final String SOAP12_NAMESPACE = SOAPConstants.NS_WSDL_SOAP12; 
++    private static final String SOAP12_NAMESPACE = SOAPConstants.NS_WSDL_SOAP12;
+     /**
+      * The namespace prefix to use for the SOAP 1.1 namespace
+      */
+@@ -195,7 +195,7 @@
+      * @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 extensions an array {@link WSDLGeneratorExtension} that will 
++     * @param extensions an array {@link WSDLGeneratorExtension} that will
+      * be invoked to generate WSDL extensions
+      */
+     public WSDLGenerator(AbstractSEIModelImpl model, WSDLResolver wsdlResolver, WSBinding binding, Container container,
+@@ -235,7 +235,7 @@
+         Result result = wsdlResolver.getWSDL(fileName+DOT_WSDL);
+         wsdlLocation = result.getSystemId();
+         serviceWriter = new CommentFilter(ResultFactory.createSerializer(result));
+-        if (model.getServiceQName().getNamespaceURI().equals(model.getTargetNamespace())) { 
++        if (model.getServiceQName().getNamespaceURI().equals(model.getTargetNamespace())) {
+             portWriter = serviceWriter;
+             schemaPrefix = fileName+"_";
+         } else {
+@@ -245,7 +245,7 @@
+             Holder<String> absWSDLName = new Holder<String>();
+             absWSDLName.value = wsdlName+DOT_WSDL;
+             result = wsdlResolver.getAbstractWSDL(absWSDLName);
+-          
++
+             if (result != null) {
+                 portWSDLID = result.getSystemId();
+                 if (portWSDLID.equals(wsdlLocation)) {
+@@ -261,7 +261,7 @@
+             if (idx > 0)
+                 schemaPrefix = schemaPrefix.substring(0, idx);
+             schemaPrefix = JAXBRIContext.mangleNameToClassName(schemaPrefix)+"_";
+-        }    
++        }
+         generateDocument(serviceWriter, portWriter);
+     }
+ 
+@@ -324,9 +324,9 @@
+         public void flush() {
+             serializer.flush();
+         }
+-        
++
+     }
+-    
++
+     private void generateDocument(XmlSerializer serviceStream, XmlSerializer portStream) {
+         serviceDefinitions = TXW.create(Definitions.class, serviceStream);
+         serviceDefinitions._namespace(WSDL_NAMESPACE, "");//WSDL_PREFIX);
+@@ -349,8 +349,8 @@
+                 portDefinitions.targetNamespace(model.getTargetNamespace());
+                 portDefinitions._namespace(model.getTargetNamespace(), TNS_PREFIX);
+             }
+-        
+-            String schemaLoc = relativize(portWSDLID, wsdlLocation);            
++
++            String schemaLoc = relativize(portWSDLID, wsdlLocation);
+             Import _import = serviceDefinitions._import().namespace(model.getTargetNamespace());
+             _import.location(schemaLoc);
+         } else if (portStream != null) {
+@@ -358,9 +358,9 @@
+             portDefinitions = serviceDefinitions;
+         } else {
+             // import a provided abstract wsdl
+-            String schemaLoc = relativize(portWSDLID, wsdlLocation);            
++            String schemaLoc = relativize(portWSDLID, wsdlLocation);
+             Import _import = serviceDefinitions._import().namespace(model.getTargetNamespace());
+-            _import.location(schemaLoc);            
++            _import.location(schemaLoc);
+         }
+         extension.addDefinitionsExtension(serviceDefinitions);
+ 
+@@ -394,7 +394,7 @@
+             }
+         }
+     }
+-    
++
+     /**
+      * Generates the WSDL messages
+      */
+@@ -500,9 +500,9 @@
+         PortType portType = portDefinitions.portType().name(model.getPortTypeName().getLocalPart());
+         extension.addPortTypeExtension(portType);
+         for (JavaMethodImpl method : model.getJavaMethods()) {
+-//            Operation operation = portType.operation().name(method.getOperation().getLocalName());
+             Operation operation = portType.operation().name(method.getOperationName());
+             generateParameterOrder(operation, method);
++            extension.addOperationExtension(operation, method);
+             switch (method.getMEP()) {
+                 case REQUEST_RESPONSE:
+                     // input message
+@@ -519,7 +519,7 @@
+                 QName messageName = new QName(model.getTargetNamespace(), exception.getMessageName());
+                 FaultType paramType = operation.fault().message(messageName).name(exception.getMessageName());
+                 extension.addOperationFaultExtension(paramType, method, exception);
+-            }            
++            }
+         }
+     }
+ 
+@@ -527,7 +527,7 @@
+      * Determines if the <CODE>method</CODE> is wrapper style
+      * @param method The {@link JavaMethod} to check if it is wrapper style
+      * @return true if the method is wrapper style, otherwise, false.
+-     */    
++     */
+     protected boolean isWrapperStyle(JavaMethodImpl method) {
+         if (method.getRequestParameters().size() > 0) {
+             ParameterImpl param = method.getRequestParameters().iterator().next();
+@@ -540,7 +540,7 @@
+      * Determines if a {@link JavaMethod} is rpc/literal
+      * @param method The method to check
+      * @return true if method is rpc/literal, otherwise, false
+-     */    
++     */
+     protected boolean isRpcLit(JavaMethodImpl method) {
+         return method.getBinding().getStyle() == Style.RPC;
+     }
+@@ -549,7 +549,7 @@
+      * Generates the parameterOrder for a PortType operation
+      * @param operation The operation to generate the parameterOrder for
+      * @param method The {@link JavaMethod} to generate the parameterOrder from
+-     */    
++     */
+     protected void generateParameterOrder(Operation operation, JavaMethodImpl method) {
+         if (method.getMEP() == MEP.ONE_WAY)
+             return;
+@@ -563,7 +563,7 @@
+      * Generates the parameterOrder for a PortType operation
+      * @param operation the operation to generate the parameterOrder for
+      * @param method the {@link JavaMethod} to generate the parameterOrder from
+-     */    
++     */
+     protected void generateRpcParameterOrder(Operation operation, JavaMethodImpl method) {
+         String partName;
+         StringBuffer paramOrder = new StringBuffer();
+@@ -581,7 +581,9 @@
+                 }
+             }
+         }
+-        operation.parameterOrder(paramOrder.toString());
++        if (i>1) {
++            operation.parameterOrder(paramOrder.toString());
++        }
+     }
+ 
+ 
+@@ -589,7 +591,7 @@
+      * Generates the parameterOrder for a PortType operation
+      * @param operation the operation to generate the parameterOrder for
+      * @param method the {@link JavaMethod} to generate the parameterOrder from
+-     */    
++     */
+     protected void generateDocumentParameterOrder(Operation operation, JavaMethodImpl method) {
+         String partName;
+         StringBuffer paramOrder = new StringBuffer();
+@@ -628,7 +630,7 @@
+      * Sorts the parameters for the method by their position
+      * @param method the {@link JavaMethod} used to sort the parameters
+      * @return the sorted {@link List} of parameters
+-     */    
++     */
+     protected List<ParameterImpl> sortMethodParameters(JavaMethodImpl method) {
+         Set<ParameterImpl> paramSet = new HashSet<ParameterImpl>();
+         List<ParameterImpl> sortedParams = new ArrayList<ParameterImpl>();
+@@ -678,7 +680,7 @@
+      * Determines if a parameter is associated with the message Body
+      * @param parameter the parameter to check
+      * @return true if the parameter is a <code>body</code> parameter
+-     */    
++     */
+     protected boolean isBodyParameter(ParameterImpl parameter) {
+         ParameterBinding paramBinding = parameter.getBinding();
+         return paramBinding.isBody();
+@@ -697,7 +699,7 @@
+ 
+     /**
+      * Generates the Binding section of the WSDL
+-     */    
++     */
+     protected void generateBinding() {
+         Binding binding = serviceDefinitions.binding().name(model.getBoundPortTypeName().getLocalPart());
+         extension.addBindingExtension(binding);
+@@ -709,7 +711,7 @@
+                 SOAPVersion soapVersion = sBinding.getSOAPVersion();
+                 if (soapVersion == SOAPVersion.SOAP_12){
+                     com.sun.xml.internal.ws.wsdl.writer.document.soap12.SOAPBinding soapBinding = binding.soap12Binding();
+-                    soapBinding.transport(SOAP12_HTTP_TRANSPORT);
++                    soapBinding.transport(this.binding.getBindingId().getTransport());
+                     if (sBinding.getStyle().equals(Style.DOCUMENT))
+                         soapBinding.style(DOCUMENT);
+                     else
+@@ -716,7 +718,7 @@
+                         soapBinding.style(RPC);
+                 } else {
+                 com.sun.xml.internal.ws.wsdl.writer.document.soap.SOAPBinding soapBinding = binding.soapBinding();
+-                    soapBinding.transport(SOAP_HTTP_TRANSPORT);
++                    soapBinding.transport(this.binding.getBindingId().getTransport());
+                     if (sBinding.getStyle().equals(Style.DOCUMENT))
+                         soapBinding.style(DOCUMENT);
+                     else
+@@ -816,7 +818,7 @@
+                     }
+                 }
+                 body.parts(parts);
+-                QName responseMessage = new QName(targetNamespace, method.getResponseMessageName());                
++                QName responseMessage = new QName(targetNamespace, method.getResponseMessageName());
+                 generateSOAPHeaders(output, headerParams, responseMessage);
+             }
+             if (isRpc) {
+@@ -825,16 +827,17 @@
+         }
+         for (CheckedExceptionImpl exception : method.getCheckedExceptions()) {
+             Fault fault = operation.fault().name(exception.getMessageName());
++            extension.addBindingOperationFaultExtension(fault, method, exception);
+             SOAPFault soapFault = fault._element(SOAPFault.class).name(exception.getMessageName());
+             soapFault.use(LITERAL);
+-        }        
++        }
+     }
+ 
+     protected void generateSOAP12BindingOperation(JavaMethodImpl method, Binding binding) {
+         BindingOperationType operation = binding.operation().name(method.getOperationName());
++        extension.addBindingOperationExtension(operation, method);
+         String targetNamespace = model.getTargetNamespace();
+         QName requestMessage = new QName(targetNamespace, method.getOperationName());
+-
+         ArrayList<ParameterImpl> bodyParams = new ArrayList<ParameterImpl>();
+         ArrayList<ParameterImpl> headerParams = new ArrayList<ParameterImpl>();
+         splitParameters(bodyParams, headerParams, method.getRequestParameters());
+@@ -843,7 +846,7 @@
+ 
+         // input
+         TypedXmlWriter input = operation.input();
+-
++        extension.addBindingOperationInputExtension(input, method);
+         com.sun.xml.internal.ws.wsdl.writer.document.soap12.BodyType body = input._element(com.sun.xml.internal.ws.wsdl.writer.document.soap12.Body.class);
+         boolean isRpc = soapBinding.getStyle().equals(Style.RPC);
+         if (soapBinding.getUse().equals(Use.LITERAL)) {
+@@ -886,6 +889,7 @@
+             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);
+             body.use(LITERAL);
+             if (headerParams.size() > 0) {
+@@ -921,17 +925,18 @@
+         }
+         for (CheckedExceptionImpl exception : method.getCheckedExceptions()) {
+             Fault fault = operation.fault().name(exception.getMessageName());
++            extension.addBindingOperationFaultExtension(fault, method, exception);
+             com.sun.xml.internal.ws.wsdl.writer.document.soap12.SOAPFault soapFault = fault._element(com.sun.xml.internal.ws.wsdl.writer.document.soap12.SOAPFault.class).name(exception.getMessageName());
+-            soapFault.use(LITERAL);                
+-        }            
++            soapFault.use(LITERAL);
++        }
+     }
+ 
+     /**
+-     * 
+-     * @param bodyParams 
+-     * @param headerParams 
+-     * @param params 
+-     */    
++     *
++     * @param bodyParams
++     * @param headerParams
++     * @param params
++     */
+     protected void splitParameters(List<ParameterImpl> bodyParams, List<ParameterImpl>headerParams, List<ParameterImpl>params) {
+         for (ParameterImpl parameter : params) {
+             if (isBodyParameter(parameter)) {
+@@ -943,11 +948,11 @@
+     }
+ 
+     /**
+-     * 
+-     * @param writer 
+-     * @param parameters 
+-     * @param message 
+-     */    
++     *
++     * @param writer
++     * @param parameters
++     * @param message
++     */
+     protected void generateSOAPHeaders(TypedXmlWriter writer, List<ParameterImpl> parameters, QName message) {
+ 
+         for (ParameterImpl headerParam : parameters) {
+@@ -959,10 +964,10 @@
+     }
+ 
+     /**
+-     * 
+-     * @param writer 
+-     * @param parameters 
+-     * @param message 
++     *
++     * @param writer
++     * @param parameters
++     * @param message
+      */
+     protected void generateSOAP12Headers(TypedXmlWriter writer, List<ParameterImpl> parameters, QName message) {
+ 
+@@ -978,7 +983,7 @@
+ 
+     /**
+      * Generates the Service section of the WSDL
+-     */    
++     */
+     protected void generateService() {
+         QName portQName = model.getPortName();
+         QName serviceQName = model.getServiceQName();
+@@ -1000,10 +1005,10 @@
+     }
+ 
+     /**
+-     * 
+-     * @param operation 
+-     * @param method 
+-     */    
++     *
++     * @param operation
++     * @param method
++     */
+     protected void generateInputMessage(Operation operation, JavaMethodImpl method) {
+         ParamType paramType = operation.input();
+         extension.addOperationInputExtension(paramType, method);
+@@ -1012,9 +1017,9 @@
+     }
+ 
+     /**
+-     * 
+-     * @param operation 
+-     * @param method 
++     *
++     * @param operation
++     * @param method
+      */
+     protected void generateOutputMessage(Operation operation, JavaMethodImpl method) {
+         ParamType paramType = operation.output();
+@@ -1030,7 +1035,7 @@
+      * @param suggestedFileName the JAXB suggested file name for the schema file
+      * @return the {@link Result} for JAXB to generate the schema into
+      * @throws java.io.IOException thrown if on IO error occurs
+-     */    
++     */
+     public Result createOutputFile(String namespaceUri, String suggestedFileName) throws IOException {
+         Result result;
+         if (namespaceUri.equals("")) {
+@@ -1055,20 +1060,20 @@
+ 
+    /**
+      * Relativizes a URI by using another URI (base URI.)
+-     * 
++     *
+      * <p>
+      * For example, {@code relative("http://www.sun.com/abc/def","http://www.sun.com/pqr/stu") => "../abc/def"}
+-     * 
++     *
+      * <p>
+      * This method only works on hierarchical URI's, not opaque URI's (refer to the
+      * <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/net/URI.html">java.net.URI</a>
+      * javadoc for complete definitions of these terms.
+-     * 
++     *
+      * <p>
+      * This method will not normalize the relative URI.
+      * @param uri the URI to relativize
+-     * 
+-     * 
++     *
++     *
+      * @param baseUri the base URI to use for the relativization
+      * @return the relative URI or the original URI if a relative one could not be computed
+      */
+@@ -1130,7 +1135,7 @@
+ 
+     /**
+      * Implements the SchemaOutputResolver used by JAXB to
+-     */    
++     */
+     protected class JAXWSOutputSchemaResolver extends SchemaOutputResolver {
+ 
+         /**
+@@ -1140,7 +1145,7 @@
+          * @param suggestedFileName the JAXB suggested file name for the schema file
+          * @return the {@link Result} for JAXB to generate the schema into
+          * @throws java.io.IOException thrown if on IO error occurs
+-         */        
++         */
+         public Result createOutput(String namespaceUri, String suggestedFileName) throws IOException {
+             return createOutputFile(namespaceUri, suggestedFileName);
+         }
+--- old/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/WSDLResolver.java	Thu Jul 30 18:38:16 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/writer/WSDLResolver.java	Thu Jul 30 18:38:16 2009
+@@ -51,7 +51,7 @@
+     /**
+      * 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
+@@ -63,7 +63,7 @@
+     /**
+      * 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
+--- old/src/share/classes/com/sun/xml/internal/xsom/ForeignAttributes.java	Thu Jul 30 18:38:20 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/ForeignAttributes.java	Thu Jul 30 18:38:19 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.xsom;
+ 
+ import org.xml.sax.Attributes;
+--- old/src/share/classes/com/sun/xml/internal/xsom/SCD.java	Thu Jul 30 18:38:23 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/SCD.java	Thu Jul 30 18:38:23 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.xsom;
+ 
+ import com.sun.xml.internal.xsom.impl.scd.Iterators;
+--- old/src/share/classes/com/sun/xml/internal/xsom/XSAnnotation.java	Thu Jul 30 18:38:27 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSAnnotation.java	Thu Jul 30 18:38:26 2009
+@@ -22,6 +22,8 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom;
+ 
+ import org.xml.sax.Locator;
+@@ -30,8 +32,8 @@
+ /**
+  * <a href="http://www.w3.org/TR/xmlschema-1/#Annotation_details">
+  * XML Schema annotation</a>.
+- * 
+- * 
++ *
++ *
+  */
+ public interface XSAnnotation
+ {
+@@ -40,7 +42,7 @@
+      * <p>
+      * annotations are parsed by the user-specified
+      * {@link AnnotationParser}.
+-     * 
++     *
+      * @return may return null
+      */
+     Object getAnnotation();
+--- old/src/share/classes/com/sun/xml/internal/xsom/XSAttContainer.java	Thu Jul 30 18:38:30 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSAttContainer.java	Thu Jul 30 18:38:30 2009
+@@ -22,6 +22,8 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom;
+ 
+ import java.util.Iterator;
+@@ -30,28 +32,28 @@
+ /**
+  * Common aspect of {@link XSComplexType} and {@link XSAttGroupDecl}
+  * as the container of attribute uses/attribute groups.
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+ public interface XSAttContainer extends XSDeclaration {
+     XSWildcard getAttributeWildcard();
+-    
++
+     /**
+      * Looks for the attribute use with the specified name from
+      * all the attribute uses that are directly/indirectly
+      * referenced from this component.
+-     * 
++     *
+      * <p>
+      * This is the exact implementation of the "attribute use"
+      * schema component.
+      */
+     XSAttributeUse getAttributeUse( String nsURI, String localName );
+-    
++
+     /**
+      * Lists all the attribute uses that are directly/indirectly
+      * referenced from this component.
+-     * 
++     *
+      * <p>
+      * This is the exact implementation of the "attribute use"
+      * schema component.
+@@ -66,13 +68,13 @@
+     /**
+      * Looks for the attribute use with the specified name from
+      * the attribute uses which are declared in this complex type.
+-     * 
++     *
+      * This does not include att uses declared in att groups that
+      * are referenced from this complex type, nor does include
+      * att uses declared in base types.
+      */
+     XSAttributeUse getDeclaredAttributeUse( String nsURI, String localName );
+-    
++
+     /**
+      * Lists all the attribute uses that are declared in this complex type.
+      */
+--- old/src/share/classes/com/sun/xml/internal/xsom/XSAttGroupDecl.java	Thu Jul 30 18:38:34 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSAttGroupDecl.java	Thu Jul 30 18:38:33 2009
+@@ -22,14 +22,16 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom;
+ 
+ /**
+  * Attribute group declaration.
+- * 
++ *
+  * @author
+  *  Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+ public interface XSAttGroupDecl extends XSAttContainer {
+-    
++
+ }
+--- old/src/share/classes/com/sun/xml/internal/xsom/XSAttributeDecl.java	Thu Jul 30 18:38:37 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSAttributeDecl.java	Thu Jul 30 18:38:37 2009
+@@ -22,11 +22,13 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom;
+ 
+ /**
+  * Attribute declaration.
+- * 
++ *
+  * @author
+  *  Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+--- old/src/share/classes/com/sun/xml/internal/xsom/XSAttributeUse.java	Thu Jul 30 18:38:41 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSAttributeUse.java	Thu Jul 30 18:38:40 2009
+@@ -22,6 +22,8 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom;
+ 
+ import org.relaxng.datatype.ValidationContext;
+@@ -28,7 +30,7 @@
+ 
+ /**
+  * Attribute use.
+- * 
++ *
+  * @author
+  *  Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+@@ -39,7 +41,7 @@
+ 
+     /**
+      * Gets the default value of this attribute use, if one is specified.
+-     * 
++     *
+      * Note that if a default value is specified in the attribute
+      * declaration, this method returns that value.
+      */
+@@ -47,7 +49,7 @@
+ 
+     /**
+      * Gets the fixed value of this attribute use, if one is specified.
+-     * 
++     *
+      * Note that if a fixed value is specified in the attribute
+      * declaration, this method returns that value.
+      */
+--- old/src/share/classes/com/sun/xml/internal/xsom/XSComplexType.java	Thu Jul 30 18:38:44 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSComplexType.java	Thu Jul 30 18:38:44 2009
+@@ -22,12 +22,16 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom;
+ 
++import java.util.List;
+ 
++
+ /**
+  * Complex type.
+- * 
++ *
+  * @author
+  *  Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+@@ -44,11 +48,11 @@
+      * for gory detail.
+      */
+     boolean isSubstitutionProhibited(int method);
+-    
++
+     /**
+      * Gets the scope of this complex type.
+      * This is not a property defined in the schema spec.
+-     * 
++     *
+      * @return
+      *      null if this complex type is global. Otherwise
+      *      return the element declaration that contains this anonymous
+@@ -58,27 +62,27 @@
+ 
+     /**
+      * The content of this complex type.
+-     * 
++     *
+      * @return
+      *      always non-null.
+      */
+     XSContentType getContentType();
+-    
++
+     /**
+      * Gets the explicit content of a complex type with a complex content
+      * that was derived by extension.
+-     * 
++     *
+      * <p>
+-     * Informally, the "explicit content" is the portion of the 
++     * Informally, the "explicit content" is the portion of the
+      * content model added in this derivation. IOW, it's a delta between
+      * the base complex type and this complex type.
+-     * 
++     *
+      * <p>
+      * For example, when a complex type T2 derives fom T1, then:
+      * <pre>
+      * content type of T2 = SEQUENCE( content type of T1, explicit content of T2 )
+      * </pre>
+-     * 
++     *
+      * @return
+      *      If this complex type is derived by restriction or has a
+      *      simple content, this method returns null.
+@@ -98,4 +102,19 @@
+      *      if this component has not been redefined.
+      */
+     public XSComplexType getRedefinedBy();
++
++    /**
++     * Returns a list of direct subtypes of this complex type. If the type is not subtyped, returns empty list.
++     * Doesn't return null.
++     * Note that the complex type may be extended outside of the scope of the schemaset known to XSOM.
++     * @return
++     */
++    public List<XSComplexType> getSubtypes();
++
++    /**
++     * Returns a list of element declarations of this type.
++     * @return
++     */
++    public List<XSElementDecl> getElementDecls();
++
+ }
+--- old/src/share/classes/com/sun/xml/internal/xsom/XSComponent.java	Thu Jul 30 18:38:48 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSComponent.java	Thu Jul 30 18:38:47 2009
+@@ -22,6 +22,8 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom;
+ 
+ import com.sun.xml.internal.xsom.parser.SchemaDocument;
+@@ -35,7 +37,7 @@
+ 
+ /**
+  * Base interface for all the schema components.
+- * 
++ *
+  * @author
+  *  Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+--- old/src/share/classes/com/sun/xml/internal/xsom/XSContentType.java	Thu Jul 30 18:38:51 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSContentType.java	Thu Jul 30 18:38:51 2009
+@@ -22,6 +22,8 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom;
+ 
+ import com.sun.xml.internal.xsom.visitor.XSContentTypeFunction;
+@@ -29,7 +31,7 @@
+ 
+ /**
+  * Content of a complex type.
+- * 
++ *
+  * @author
+  *  Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+--- old/src/share/classes/com/sun/xml/internal/xsom/XSDeclaration.java	Thu Jul 30 18:38:55 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSDeclaration.java	Thu Jul 30 18:38:54 2009
+@@ -22,11 +22,13 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom;
+ 
+ /**
+  * Base interface of all "declarations".
+- * 
++ *
+  * @author
+  *  Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+@@ -53,7 +55,7 @@
+ 
+     /**
+      * Returns true if this declaration is a global declaration.
+-     * 
++     *
+      * Global declarations are those declaration that can be enumerated
+      * through the schema object.
+      */
+--- old/src/share/classes/com/sun/xml/internal/xsom/XSElementDecl.java	Thu Jul 30 18:38:58 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSElementDecl.java	Thu Jul 30 18:38:57 2009
+@@ -22,6 +22,8 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom;
+ 
+ import java.util.List;
+@@ -29,7 +31,7 @@
+ 
+ /**
+  * Element declaration.
+- * 
++ *
+  * @author
+  *  Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+@@ -60,10 +62,10 @@
+ 
+     /**
+      * Checks the substitution excluded property of the schema component.
+-     * 
++     *
+      * IOW, this checks the value of the <code>final</code> attribute
+      * (plus <code>finalDefault</code>).
+-     * 
++     *
+      * @param method
+      *      Possible values are {@link XSType#EXTENSION} or
+      *      <code>XSType.RESTRICTION</code>.
+@@ -72,10 +74,10 @@
+ 
+     /**
+      * Checks the diallowed substitution property of the schema component.
+-     * 
++     *
+      * IOW, this checks the value of the <code>block</code> attribute
+      * (plus <code>blockDefault</code>).
+-     * 
++     *
+      * @param method
+      *      Possible values are {@link XSType#EXTENSION},
+      *      <code>XSType.RESTRICTION</code>, or <code>XSType.SUBSTITUTION</code>
+@@ -87,17 +89,17 @@
+     /**
+      * Returns the element declarations that can substitute
+      * this element.
+-     * 
++     *
+      * <p>
+      * IOW, this set returns all the element decls that satisfies
+      * <a href="http://www.w3.org/TR/xmlschema-1/#cos-equiv-derived-ok-rec">
+      * the "Substitution Group OK" constraint.
+      * </a>
+-     * 
++     *
+      * @return
+      *      nun-null valid array. The return value always contains this element
+-     *      decl itself. 
+-     * 
++     *      decl itself.
++     *
+      * @deprecated
+      *      this method allocates a new array every time, so it could be
+      *      inefficient when working with a large schema. Use
+@@ -104,32 +106,32 @@
+      *      {@link #getSubstitutables()} instead.
+      */
+     XSElementDecl[] listSubstitutables();
+-    
++
+     /**
+      * Returns the element declarations that can substitute
+      * this element.
+-     * 
++     *
+      * <p>
+      * IOW, this set returns all the element decls that satisfies
+      * <a href="http://www.w3.org/TR/xmlschema-1/#cos-equiv-derived-ok-rec">
+      * the "Substitution Group OK" constraint.
+      * </a>
+-     * 
++     *
+      * <p>
+      * Note that the above clause does <em>NOT</em> check for
+      * abstract elements. So abstract elements may still show up
+      * in the returned set.
+-     * 
++     *
+      * @return
+      *      nun-null unmodifiable list.
+-     *      The returned list always contains this element decl itself. 
++     *      The returned list always contains this element decl itself.
+      */
+     Set<? extends XSElementDecl> getSubstitutables();
+-    
++
+     /**
+      * Returns true if this element declaration can be validly substituted
+      * by the given declaration.
+-     * 
++     *
+      * <p>
+      * Just a short cut of <tt>getSubstitutables().contain(e);</tt>
+      */
+@@ -140,4 +142,15 @@
+ 
+     XmlString getDefaultValue();
+     XmlString getFixedValue();
++
++    /**
++     * Used for javadoc schema generation
++     *
++     * @return
++     *    null if form attribute not present,
++     *    true if form attribute present and set to qualified,
++     *    false if form attribute present and set to unqualified.
++     */
++
++    Boolean getForm();
+ }
+--- old/src/share/classes/com/sun/xml/internal/xsom/XSFacet.java	Thu Jul 30 18:39:02 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSFacet.java	Thu Jul 30 18:39:01 2009
+@@ -22,11 +22,13 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom;
+ 
+ /**
+  * Facet for a simple type.
+- * 
++ *
+  * @author
+  *  Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+@@ -34,14 +36,14 @@
+ {
+     /** Gets the name of the facet, such as "length". */
+     String getName();
+-    
++
+     /** Gets the value of the facet. */
+     XmlString getValue();
+-    
++
+     /** Returns true if this facet is "fixed". */
+     boolean isFixed();
+-    
+-    
++
++
+     // well-known facet name constants
+     final static String FACET_LENGTH            = "length";
+     final static String FACET_MINLENGTH         = "minLength";
+--- old/src/share/classes/com/sun/xml/internal/xsom/XSIdentityConstraint.java	Thu Jul 30 18:39:05 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSIdentityConstraint.java	Thu Jul 30 18:39:04 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.xsom;
+ 
+ import java.util.List;
+--- old/src/share/classes/com/sun/xml/internal/xsom/XSListSimpleType.java	Thu Jul 30 18:39:08 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSListSimpleType.java	Thu Jul 30 18:39:08 2009
+@@ -22,11 +22,13 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom;
+ 
+ /**
+  * List simple type.
+- * 
++ *
+  * @author
+  *  Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+--- old/src/share/classes/com/sun/xml/internal/xsom/XSModelGroup.java	Thu Jul 30 18:39:12 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSModelGroup.java	Thu Jul 30 18:39:11 2009
+@@ -22,11 +22,13 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom;
+ 
+ /**
+  * Model group.
+- * 
++ *
+  * @author
+  *  Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+@@ -46,7 +48,7 @@
+         private final String value;
+         /**
+          * Returns the human-readable compositor name.
+-         * 
++         *
+          * @return
+          *      Either "all", "sequence", or "choice".
+          */
+--- old/src/share/classes/com/sun/xml/internal/xsom/XSModelGroupDecl.java	Thu Jul 30 18:39:15 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSModelGroupDecl.java	Thu Jul 30 18:39:15 2009
+@@ -22,12 +22,14 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom;
+ 
+ 
+ /**
+  * Named model group declaration.
+- * 
++ *
+  * @author
+  *  Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+--- old/src/share/classes/com/sun/xml/internal/xsom/XSNotation.java	Thu Jul 30 18:39:19 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSNotation.java	Thu Jul 30 18:39:18 2009
+@@ -22,11 +22,13 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom;
+ 
+ /**
+  * Notation declaration.
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+--- old/src/share/classes/com/sun/xml/internal/xsom/XSParticle.java	Thu Jul 30 18:39:22 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSParticle.java	Thu Jul 30 18:39:22 2009
+@@ -22,11 +22,13 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom;
+ 
+ /**
+  * Particle schema component.
+- * 
++ *
+  * @author
+  *  Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+@@ -35,7 +37,7 @@
+     int getMinOccurs();
+     /**
+      * Gets the max occurs property.
+-     * 
++     *
+      * @return
+      *      {@link UNBOUNDED} will be returned if the value
+      *      is "unbounded".
+--- old/src/share/classes/com/sun/xml/internal/xsom/XSRestrictionSimpleType.java	Thu Jul 30 18:39:26 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSRestrictionSimpleType.java	Thu Jul 30 18:39:25 2009
+@@ -22,6 +22,8 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom;
+ 
+ import java.util.Iterator;
+@@ -30,25 +32,31 @@
+ 
+ /**
+  * Restriction simple type.
+- * 
++ *
+  * @author
+  *  Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+ public interface XSRestrictionSimpleType extends XSSimpleType {
+     // TODO
+-    
++
+     /** Iterates facets that are specified in this step of derivation. */
+     public Iterator<XSFacet> iterateDeclaredFacets();
+ 
++    /**
++     * Gets all the facets that are declared on this restriction.
++     *
++     * @return
++     *      Can be empty but always non-null.
++     */
+     public Collection<? extends XSFacet> getDeclaredFacets();
+ 
+     /**
+      * Gets the declared facet object of the given name.
+-     * 
++     *
+      * <p>
+      * This method returns a facet object that is added in this
+      * type and does not recursively check the ancestors.
+-     * 
++     *
+      * <p>
+      * For those facets that can have multiple values
+      * (pattern facets and enumeration facets), this method
+--- old/src/share/classes/com/sun/xml/internal/xsom/XSSchema.java	Thu Jul 30 18:39:29 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSSchema.java	Thu Jul 30 18:39:28 2009
+@@ -22,6 +22,8 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom;
+ 
+ import com.sun.xml.internal.xsom.parser.SchemaDocument;
+@@ -31,9 +33,9 @@
+ 
+ /**
+  * Schema.
+- * 
++ *
+  * Container of declarations that belong to the same target namespace.
+- * 
++ *
+  * @author
+  *  Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+--- old/src/share/classes/com/sun/xml/internal/xsom/XSSchemaSet.java	Thu Jul 30 18:39:33 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSSchemaSet.java	Thu Jul 30 18:39:32 2009
+@@ -22,6 +22,8 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom;
+ 
+ import javax.xml.namespace.NamespaceContext;
+@@ -30,7 +32,7 @@
+ 
+ /**
+  * Set of {@link XSSchema} objects.
+- * 
++ *
+  * @author
+  *  Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+--- old/src/share/classes/com/sun/xml/internal/xsom/XSSimpleType.java	Thu Jul 30 18:39:36 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSSimpleType.java	Thu Jul 30 18:39:35 2009
+@@ -22,14 +22,18 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom;
+ 
+ import com.sun.xml.internal.xsom.visitor.XSSimpleTypeFunction;
+ import com.sun.xml.internal.xsom.visitor.XSSimpleTypeVisitor;
+ 
++import java.util.List;
++
+ /**
+  * Simple type.
+- * 
++ *
+  * @author
+  *  Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+@@ -37,7 +41,7 @@
+ {
+     /**
+      * Gets the base type as XSSimpleType.
+-     * 
++     *
+      * Equivalent to
+      * <code>
+      * (XSSimpleType)getBaseType()
+@@ -52,7 +56,7 @@
+      *      null if this is xs:anySimpleType. Otherwise non-null.
+      */
+     XSSimpleType getSimpleBaseType();
+-    
++
+     /**
+      * Gets the variety of this simple type.
+      */
+@@ -97,7 +101,7 @@
+      *      true if the type is marked final.
+      */
+     boolean isFinal(XSVariety v);
+-    
++
+     /**
+      * If this {@link XSSimpleType} is redefined by another simple type,
+      * return that component.
+@@ -109,7 +113,7 @@
+ 
+     /**
+      * Gets the effective facet object of the given name.
+-     * 
++     *
+      * <p>
+      * For example, if a simple type "foo" is derived from
+      * xs:string by restriction with the "maxLength" facet and
+@@ -117,13 +121,13 @@
+      * restriction with another "maxLength" facet, this method
+      * will return the latter one, because that is the most
+      * restrictive, effective facet.
+-     * 
++     *
+      * <p>
+      * For those facets that can have multiple values
+      * (pattern facets and enumeration facets), this method
+      * will return only the first one.
+      * TODO: allow clients to access all of them by some means.
+-     * 
++     *
+      * @return
+      *      If this datatype has a facet of the given name,
+      *      return that object. If the facet is not specified
+@@ -130,12 +134,22 @@
+      *      anywhere in its derivation chain, null will be returned.
+      */
+     XSFacet getFacet( String name );
+-    
+-    
+-    
++
++    /**
++     * For multi-valued facets (enumeration and pattern), obtain all values.
++     *
++     * @see #getFacet(String)
++     *
++     * @return
++     *      can be empty but never null.
++     */
++    List<XSFacet> getFacets( String name );
++
++
++
+     void visit( XSSimpleTypeVisitor visitor );
+     <T> T apply( XSSimpleTypeFunction<T> function );
+-    
++
+     /** Returns true if <code>this instanceof XSRestrictionSimpleType</code>. */
+     boolean isRestriction();
+     /** Returns true if <code>this instanceof XSListSimpleType</code>. */
+@@ -142,7 +156,7 @@
+     boolean isList();
+     /** Returns true if <code>this instanceof XSUnionSimpleType</code>. */
+     boolean isUnion();
+-    
++
+     XSRestrictionSimpleType asRestriction();
+     XSListSimpleType asList();
+     XSUnionSimpleType asUnion();
+--- old/src/share/classes/com/sun/xml/internal/xsom/XSTerm.java	Thu Jul 30 18:39:40 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSTerm.java	Thu Jul 30 18:39:39 2009
+@@ -22,6 +22,8 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom;
+ 
+ import com.sun.xml.internal.xsom.visitor.XSTermFunction;
+@@ -30,19 +32,19 @@
+ 
+ /**
+  * A component that can be referenced from {@link XSParticle}
+- * 
++ *
+  * This interface provides a set of type check functions (<code>isXXX</code>),
+  * which are essentially:
+- * 
++ *
+  * <pre>
+  * boolean isXXX() {
+  *     return this instanceof XXX;
+  * }
+  * <pre>
+- * 
++ *
+  * and a set of cast functions (<code>asXXX</code>), which are
+  * essentially:
+- * 
++ *
+  * <pre>
+  * XXX asXXX() {
+  *     if(isXXX())  return (XXX)this;
+--- old/src/share/classes/com/sun/xml/internal/xsom/XSType.java	Thu Jul 30 18:39:43 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSType.java	Thu Jul 30 18:39:43 2009
+@@ -22,11 +22,13 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom;
+ 
+ /**
+  * Base interface for {@link XSComplexType} and {@link XSSimpleType}.
+- * 
++ *
+  * @author
+  *  Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+--- old/src/share/classes/com/sun/xml/internal/xsom/XSUnionSimpleType.java	Thu Jul 30 18:39:47 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSUnionSimpleType.java	Thu Jul 30 18:39:46 2009
+@@ -22,11 +22,13 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom;
+ 
+ /**
+  * Union simple type.
+- * 
++ *
+  * @author
+  *  Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+--- old/src/share/classes/com/sun/xml/internal/xsom/XSVariety.java	Thu Jul 30 18:39:51 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSVariety.java	Thu Jul 30 18:39:50 2009
+@@ -22,11 +22,13 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom;
+ 
+ /**
+  * Constants that represent variety of simple types.
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke,kawaguchi@sun.com)
+  */
+@@ -34,9 +36,8 @@
+     public static final XSVariety ATOMIC = new XSVariety("atomic");
+     public static final XSVariety UNION  = new XSVariety("union");
+     public static final XSVariety LIST   = new XSVariety("list");
+-    
++
+     private XSVariety(String _name) { this.name=_name; }
+     private final String name;
+     public String toString() { return name; }
+ }
+-
+--- old/src/share/classes/com/sun/xml/internal/xsom/XSWildcard.java	Thu Jul 30 18:39:54 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSWildcard.java	Thu Jul 30 18:39:53 2009
+@@ -22,6 +22,8 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom;
+ 
+ import java.util.Iterator;
+@@ -33,7 +35,7 @@
+ /**
+  * Wildcard schema component (used for both attribute wildcard
+  * and element wildcard.)
+- * 
++ *
+  * XSWildcard interface can always be downcasted to either
+  * Any, Other, or Union.
+  */
+@@ -44,7 +46,7 @@
+     static final int SKIP = 3;
+     /**
+      * Gets the processing mode.
+-     * 
++     *
+      * @return
+      *      Either LAX, STRICT, or SKIP.
+      */
+@@ -53,7 +55,7 @@
+     /**
+      * Returns true if the specified namespace URI is valid
+      * wrt this wildcard.
+-     * 
++     *
+      * @param namespaceURI
+      *      Use the empty string to test the default no-namespace.
+      */
+--- old/src/share/classes/com/sun/xml/internal/xsom/XSXPath.java	Thu Jul 30 18:39:57 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/XSXPath.java	Thu Jul 30 18:39:57 2009
+@@ -22,11 +22,12 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.xsom;
+ 
+ /**
+  * Selector or field of {@link XSIdentityConstraint}.
+- * 
++ *
+  * @author Kohsuke Kawaguchi
+  */
+ public interface XSXPath extends XSComponent  {
+--- old/src/share/classes/com/sun/xml/internal/xsom/XmlString.java	Thu Jul 30 18:40:01 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/XmlString.java	Thu Jul 30 18:40:00 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.xsom;
+ 
+ import org.relaxng.datatype.ValidationContext;
+@@ -82,9 +83,9 @@
+      * as defined in the XML Namespaces Recommendation.
+      *
+      * @return
+-     *		namespace URI of this prefix.
+-     *		If the specified prefix is not declared,
+-     *		the implementation returns null.
++     *          namespace URI of this prefix.
++     *          If the specified prefix is not declared,
++     *          the implementation returns null.
+      */
+     public final String resolvePrefix(String prefix) {
+         return context.resolveNamespacePrefix(prefix);
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/AnnotationImpl.java	Thu Jul 30 18:40:04 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/AnnotationImpl.java	Thu Jul 30 18:40:04 2009
+@@ -22,6 +22,8 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom.impl;
+ 
+ import com.sun.xml.internal.xsom.XSAnnotation;
+@@ -51,6 +53,28 @@
+         locator = NULL_LOCATION;
+     }
+ 
++    private static class LocatorImplUnmodifiable extends LocatorImpl {
+ 
+-    private static final LocatorImpl NULL_LOCATION = new LocatorImpl();
++        @Override
++        public void setColumnNumber(int columnNumber) {
++            return;
++        }
++
++        @Override
++        public void setPublicId(String publicId) {
++            return;
++        }
++
++        @Override
++        public void setSystemId(String systemId) {
++            return;
++        }
++
++        @Override
++        public void setLineNumber(int lineNumber) {
++            return;
++        }
++    };
++
++    private static final LocatorImplUnmodifiable NULL_LOCATION = new LocatorImplUnmodifiable();
+ }
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/AttGroupDeclImpl.java	Thu Jul 30 18:40:08 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/AttGroupDeclImpl.java	Thu Jul 30 18:40:07 2009
+@@ -22,6 +22,8 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom.impl;
+ 
+ import com.sun.xml.internal.xsom.XSAttGroupDecl;
+@@ -39,18 +41,18 @@
+ {
+     public AttGroupDeclImpl( SchemaDocumentImpl _parent, AnnotationImpl _annon,
+         Locator _loc, ForeignAttributesImpl _fa, String _name, WildcardImpl _wildcard ) {
+-        
++
+         this(_parent,_annon,_loc,_fa,_name);
+         setWildcard(_wildcard);
+     }
+-        
++
+     public AttGroupDeclImpl( SchemaDocumentImpl _parent, AnnotationImpl _annon,
+         Locator _loc, ForeignAttributesImpl _fa, String _name ) {
+-            
++
+         super(_parent,_annon,_loc,_fa,_name,false);
+     }
+-    
+-    
++
++
+     private WildcardImpl wildcard;
+     public void setWildcard( WildcardImpl wc ) { wildcard=wc; }
+     public XSWildcard getAttributeWildcard() { return wildcard; }
+@@ -58,16 +60,16 @@
+     public XSAttributeUse getAttributeUse( String nsURI, String localName ) {
+         UName name = new UName(nsURI,localName);
+         XSAttributeUse o=null;
+-        
++
+         Iterator itr = iterateAttGroups();
+         while(itr.hasNext() && o==null)
+             o = ((XSAttGroupDecl)itr.next()).getAttributeUse(nsURI,localName);
+-        
++
+         if(o==null)     o = attributes.get(name);
+-        
++
+         return o;
+     }
+-    
++
+     public void redefine( AttGroupDeclImpl ag ) {
+         for (Iterator itr = attGroups.iterator(); itr.hasNext();) {
+             DelayedRef.AttGroup r = (DelayedRef.AttGroup) itr.next();
+@@ -74,7 +76,7 @@
+             r.redefine(ag);
+         }
+     }
+-    
++
+     public void visit( XSVisitor visitor ) {
+         visitor.attGroupDecl(this);
+     }
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/AttributeDeclImpl.java	Thu Jul 30 18:40:11 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/AttributeDeclImpl.java	Thu Jul 30 18:40:11 2009
+@@ -22,6 +22,8 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom.impl;
+ 
+ import com.sun.xml.internal.xsom.XSAttributeDecl;
+@@ -39,26 +41,26 @@
+         AnnotationImpl _annon, Locator _loc, ForeignAttributesImpl _fa, boolean _anonymous,
+         XmlString _defValue, XmlString _fixedValue,
+         Ref.SimpleType _type ) {
+-        
++
+         super(owner,_annon,_loc,_fa,_targetNamespace,_name,_anonymous);
+-        
++
+         if(_name==null) // assertion failed.
+             throw new IllegalArgumentException();
+-        
++
+         this.defaultValue = _defValue;
+         this.fixedValue = _fixedValue;
+         this.type = _type;
+     }
+-    
++
+     private final Ref.SimpleType type;
+     public XSSimpleType getType() { return type.getType(); }
+ 
+     private final XmlString defaultValue;
+     public XmlString getDefaultValue() { return defaultValue; }
+-    
++
+     private final XmlString fixedValue;
+     public XmlString getFixedValue() { return fixedValue; }
+-    
++
+     public void visit( XSVisitor visitor ) {
+         visitor.attributeDecl(this);
+     }
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/AttributeUseImpl.java	Thu Jul 30 18:40:15 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/AttributeUseImpl.java	Thu Jul 30 18:40:14 2009
+@@ -22,6 +22,8 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom.impl;
+ 
+ import com.sun.xml.internal.xsom.XSAttributeDecl;
+@@ -36,33 +38,33 @@
+ {
+     public AttributeUseImpl( SchemaDocumentImpl owner, AnnotationImpl ann, Locator loc, ForeignAttributesImpl fa, Ref.Attribute _decl,
+         XmlString def, XmlString fixed, boolean req ) {
+-        
++
+         super(owner,ann,loc,fa);
+-        
++
+         this.att = _decl;
+         this.defaultValue = def;
+         this.fixedValue = fixed;
+         this.required = req;
+     }
+-    
+-    private final Ref.Attribute att;    
++
++    private final Ref.Attribute att;
+     public XSAttributeDecl getDecl() { return att.getAttribute(); }
+-    
++
+     private final XmlString defaultValue;
+     public XmlString getDefaultValue() {
+         if( defaultValue!=null )    return defaultValue;
+         else                        return getDecl().getDefaultValue();
+     }
+-    
++
+     private final XmlString fixedValue;
+     public XmlString getFixedValue() {
+         if( fixedValue!=null )      return fixedValue;
+         else                        return getDecl().getFixedValue();
+     }
+-    
++
+     private final boolean required;
+     public boolean isRequired() { return required; }
+-    
++
+     public Object apply( XSFunction f ) {
+         return f.attributeUse(this);
+     }
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/AttributesHolder.java	Thu Jul 30 18:40:18 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/AttributesHolder.java	Thu Jul 30 18:40:18 2009
+@@ -22,6 +22,8 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom.impl;
+ 
+ import com.sun.xml.internal.xsom.XSAttGroupDecl;
+@@ -67,7 +69,12 @@
+     public void addProhibitedAttribute( UName name ) {
+         prohibitedAtts.add(name);
+     }
+-    public List<XSAttributeUse> getAttributeUses() {
++
++    /**
++     * Returns the attribute uses by looking at attribute groups and etc.
++     * Searching for the base type is done in {@link ComplexTypeImpl}.
++     */
++    public Collection<XSAttributeUse> getAttributeUses() {
+         // TODO: this is fairly inefficient
+         List<XSAttributeUse> v = new ArrayList<XSAttributeUse>();
+         v.addAll(attributes.values());
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/ComplexTypeImpl.java	Thu Jul 30 18:40:22 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/ComplexTypeImpl.java	Thu Jul 30 18:40:21 2009
+@@ -22,6 +22,8 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom.impl;
+ 
+ import com.sun.xml.internal.xsom.XSAttGroupDecl;
+@@ -30,6 +32,8 @@
+ import com.sun.xml.internal.xsom.XSComplexType;
+ import com.sun.xml.internal.xsom.XSContentType;
+ import com.sun.xml.internal.xsom.XSElementDecl;
++import com.sun.xml.internal.xsom.XSSchema;
++import com.sun.xml.internal.xsom.XSSchemaSet;
+ import com.sun.xml.internal.xsom.XSSimpleType;
+ import com.sun.xml.internal.xsom.XSType;
+ import com.sun.xml.internal.xsom.XSWildcard;
+@@ -38,9 +42,14 @@
+ import com.sun.xml.internal.xsom.impl.scd.Iterators;
+ import com.sun.xml.internal.xsom.visitor.XSFunction;
+ import com.sun.xml.internal.xsom.visitor.XSVisitor;
++import java.util.ArrayList;
++import java.util.List;
+ import org.xml.sax.Locator;
+ 
++import java.util.Collection;
++import java.util.HashMap;
+ import java.util.Iterator;
++import java.util.Map;
+ 
+ public class ComplexTypeImpl extends AttributesHolder implements XSComplexType, Ref.ComplexType
+ {
+@@ -47,15 +56,15 @@
+     public ComplexTypeImpl( SchemaDocumentImpl _parent,
+         AnnotationImpl _annon, Locator _loc, ForeignAttributesImpl _fa,
+         String _name, boolean _anonymous,
+-        
++
+         boolean _abstract, int _derivationMethod,
+         Ref.Type _base, int _final, int _block, boolean _mixed ) {
+-        
++
+         super(_parent,_annon,_loc,_fa,_name,_anonymous);
+-        
++
+         if(_base==null)
+             throw new IllegalArgumentException();
+-            
++
+         this._abstract = _abstract;
+         this.derivationMethod = _derivationMethod;
+         this.baseType = _base;
+@@ -63,7 +72,7 @@
+         this.blockValue = _block;
+         this.mixed = _mixed;
+     }
+-    
++
+     public XSComplexType asComplexType(){ return this; }
+ 
+     public boolean isDerivedFrom(XSType t) {
+@@ -81,10 +90,10 @@
+     public XSSimpleType  asSimpleType()    { return null; }
+     public final boolean isSimpleType() { return false; }
+     public final boolean isComplexType(){ return true; }
+-    
++
+     private int derivationMethod;
+     public int getDerivationMethod() { return derivationMethod; }
+-    
++
+     private Ref.Type baseType;
+     public XSType getBaseType() { return baseType.getType(); }
+ 
+@@ -125,7 +134,7 @@
+ 
+     private final boolean _abstract;
+     public boolean isAbstract() { return _abstract; }
+-    
++
+     private WildcardImpl localAttWildcard;
+     /**
+      * Set the local attribute wildcard.
+@@ -135,13 +144,13 @@
+     }
+     public XSWildcard getAttributeWildcard() {
+         WildcardImpl complete = localAttWildcard;
+-        
++
+         Iterator itr = iterateAttGroups();
+         while( itr.hasNext() ) {
+             WildcardImpl w = (WildcardImpl)((XSAttGroupDecl)itr.next()).getAttributeWildcard();
+-            
++
+             if(w==null)     continue;
+-            
++
+             if(complete==null)
+                 complete = w;
+             else
+@@ -149,17 +158,17 @@
+                 // but I think it has to be union.
+                 complete = complete.union(ownerDocument,w);
+         }
+-        
++
+         if( getDerivationMethod()==RESTRICTION )    return complete;
+-        
++
+         WildcardImpl base=null;
+         XSType baseType = getBaseType();
+         if(baseType.asComplexType()!=null)
+             base = (WildcardImpl)baseType.asComplexType().getAttributeWildcard();
+-        
++
+         if(complete==null)  return base;
+         if(base==null)      return complete;
+-        
++
+         return complete.union(ownerDocument,base);
+     }
+ 
+@@ -167,23 +176,23 @@
+     public boolean isFinal( int derivationMethod ) {
+         return (finalValue&derivationMethod)!=0;
+     }
+-    
++
+     private final int blockValue;
+     public boolean isSubstitutionProhibited( int method ) {
+         return (blockValue&method)!=0;
+     }
+-    
+-    
++
++
+     private Ref.ContentType contentType;
+     public void setContentType( Ref.ContentType v ) { contentType = v; }
+     public XSContentType getContentType() { return contentType.getContentType(); }
+-    
++
+     private XSContentType explicitContent;
+     public void setExplicitContent( XSContentType v ) {
+         this.explicitContent = v;
+     }
+     public XSContentType getExplicitContent() { return explicitContent; }
+-    
++
+     private final boolean mixed;
+     public boolean isMixed() { return mixed; }
+ 
+@@ -192,33 +201,33 @@
+ 
+     public XSAttributeUse getAttributeUse( String nsURI, String localName ) {
+         UName name = new UName(nsURI,localName);
+-        
++
+         if(prohibitedAtts.contains(name))       return null;
+-        
++
+         XSAttributeUse o = attributes.get(name);
+-        
+-        
++
++
+         if(o==null) {
+             Iterator itr = iterateAttGroups();
+             while(itr.hasNext() && o==null)
+                 o = ((XSAttGroupDecl)itr.next()).getAttributeUse(nsURI,localName);
+         }
+-        
++
+         if(o==null) {
+             XSType base = getBaseType();
+             if(base.asComplexType()!=null)
+                 o = base.asComplexType().getAttributeUse(nsURI,localName);
+         }
+-        
++
+         return o;
+     }
+ 
+     public Iterator<XSAttributeUse> iterateAttributeUses() {
+-        
++
+         XSComplexType baseType = getBaseType().asComplexType();
+-        
++
+         if( baseType==null )    return super.iterateAttributeUses();
+-        
++
+         return new Iterators.Union<XSAttributeUse>(
+             new Iterators.Filter<XSAttributeUse>(baseType.iterateAttributeUses()) {
+                 protected boolean matches(XSAttributeUse value) {
+@@ -229,14 +238,30 @@
+             },
+             super.iterateAttributeUses() );
+     }
+-    
+-    
++
++    public Collection<XSAttributeUse> getAttributeUses() {
++        XSComplexType baseType = getBaseType().asComplexType();
++
++        if( baseType==null )    return super.getAttributeUses();
++
++        // TODO: this is fairly inefficient
++        Map<UName,XSAttributeUse> uses = new HashMap<UName, XSAttributeUse>();
++        for( XSAttributeUse a : baseType.getAttributeUses())
++            uses.put(new UName(a.getDecl()),a);
++
++        uses.keySet().removeAll(prohibitedAtts);
++
++        for( XSAttributeUse a : super.getAttributeUses())
++            uses.put(new UName(a.getDecl()),a);
++
++        return uses.values();
++    }
++
++
+     public XSType[] listSubstitutables() {
+         return Util.listSubstitutables(this);
+     }
+-    
+ 
+-
+     public void visit( XSVisitor visitor ) {
+         visitor.complexType(this);
+     }
+@@ -246,4 +271,30 @@
+ 
+     // Ref.ComplexType implementation
+     public XSComplexType getType() { return this; }
++
++    public List<XSComplexType> getSubtypes() {
++        ArrayList subtypeList = new ArrayList();
++        Iterator<XSComplexType> cTypes = getRoot().iterateComplexTypes();
++        while (cTypes.hasNext()) {
++            XSComplexType cType= cTypes.next();
++            XSType base = cType.getBaseType();
++            if ((base != null) && (base.equals(this))) {
++                subtypeList.add(cType);
++            }
++        }
++        return subtypeList;
++    }
++
++    public List<XSElementDecl> getElementDecls() {
++        ArrayList declList = new ArrayList();
++        XSSchemaSet schemaSet = getRoot();
++        for (XSSchema sch : schemaSet.getSchemas()) {
++            for (XSElementDecl decl : sch.getElementDecls().values()) {
++                if (decl.getType().equals(this)) {
++                    declList.add(decl);
++                }
++            }
++        }
++        return declList;
++    }
+ }
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/ComponentImpl.java	Thu Jul 30 18:40:25 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/ComponentImpl.java	Thu Jul 30 18:40:25 2009
+@@ -22,6 +22,8 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom.impl;
+ 
+ import com.sun.xml.internal.xsom.SCD;
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/Const.java	Thu Jul 30 18:40:29 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/Const.java	Thu Jul 30 18:40:28 2009
+@@ -22,6 +22,8 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom.impl;
+ 
+ public class Const
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/ContentTypeImpl.java	Thu Jul 30 18:40:32 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/ContentTypeImpl.java	Thu Jul 30 18:40:32 2009
+@@ -22,6 +22,8 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom.impl;
+ 
+ import com.sun.xml.internal.xsom.XSContentType;
+@@ -29,7 +31,7 @@
+ /**
+  * Marker interface that says this implementation
+  * implements XSContentType.
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/DeclarationImpl.java	Thu Jul 30 18:40:36 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/DeclarationImpl.java	Thu Jul 30 18:40:35 2009
+@@ -22,6 +22,8 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom.impl;
+ 
+ import com.sun.xml.internal.xsom.XSDeclaration;
+@@ -34,23 +36,23 @@
+     DeclarationImpl( SchemaDocumentImpl owner,
+         AnnotationImpl _annon, Locator loc, ForeignAttributesImpl fa,
+         String _targetNamespace, String _name,    boolean _anonymous ) {
+-        
++
+         super(owner,_annon,loc,fa);
+         this.targetNamespace = _targetNamespace;
+         this.name = _name;
+         this.anonymous = _anonymous;
+     }
+-    
++
+     private final String name;
+     public String getName() { return name; }
+-    
++
+     private final String targetNamespace;
+     public String getTargetNamespace() { return targetNamespace; }
+-    
++
+     private final boolean anonymous;
+     /** @deprecated */
+     public boolean isAnonymous() { return anonymous; }
+-    
++
+     public final boolean isGlobal() { return !isAnonymous(); }
+     public final boolean isLocal() { return isAnonymous(); }
+ }
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/ElementDecl.java	Thu Jul 30 18:40:39 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/ElementDecl.java	Thu Jul 30 18:40:39 2009
+@@ -22,6 +22,8 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom.impl;
+ 
+ import com.sun.xml.internal.xsom.XSElementDecl;
+@@ -51,19 +53,20 @@
+     public ElementDecl( PatcherManager reader, SchemaDocumentImpl owner,
+         AnnotationImpl _annon, Locator _loc, ForeignAttributesImpl fa,
+         String _tns, String _name, boolean _anonymous,
+-        
++
+         XmlString _defv, XmlString _fixedv,
+-        boolean _nillable, boolean _abstract,
++        boolean _nillable, boolean _abstract, Boolean _form,
+         Ref.Type _type, Ref.Element _substHead,
+         int _substDisallowed, int _substExcluded,
+-        List<IdentityConstraintImpl> idConstraints ) {
+-        
++        List<IdentityConstraintImpl> idConstraints) {
++
+         super(owner,_annon,_loc,fa,_tns,_name,_anonymous);
+-        
++
+         this.defaultValue = _defv;
+         this.fixedValue = _fixedv;
+         this.nillable = _nillable;
+         this._abstract = _abstract;
++        this.form = _form;
+         this.type = _type;
+         this.substHead = _substHead;
+         this.substDisallowed = _substDisallowed;
+@@ -76,33 +79,33 @@
+         if(type==null)
+             throw new IllegalArgumentException();
+     }
+-    
++
+     private XmlString defaultValue;
+     public XmlString getDefaultValue() { return defaultValue; }
+-    
++
+     private XmlString fixedValue;
+     public XmlString getFixedValue() { return fixedValue; }
+ 
+     private boolean nillable;
+     public boolean isNillable() { return nillable; }
+-    
++
+     private boolean _abstract;
+     public boolean isAbstract() { return _abstract; }
+-    
++
+     private Ref.Type type;
+     public XSType getType() { return type.getType(); }
+-    
++
+     private Ref.Element substHead;
+     public XSElementDecl getSubstAffiliation() {
+         if(substHead==null)     return null;
+         return substHead.get();
+     }
+-    
++
+     private int substDisallowed;
+     public boolean isSubstitutionDisallowed( int method ) {
+         return (substDisallowed&method)!=0;
+     }
+-    
++
+     private int substExcluded;
+     public boolean isSubstitutionExcluded( int method ) {
+         return (substExcluded&method)!=0;
+@@ -113,9 +116,14 @@
+         return idConstraints;
+     }
+ 
++    private Boolean form;
++    public Boolean getForm() {
++        return form;
++    }
+ 
++
+     /**
+-     * @deprecated 
++     * @deprecated
+      */
+     public XSElementDecl[] listSubstitutables() {
+         Set<? extends XSElementDecl> s = getSubstitutables();
+@@ -127,7 +135,7 @@
+ 
+     /** Unmodifieable view of {@link #substitutables}. */
+     private Set<XSElementDecl> substitutablesView = null;
+-    
++
+     public Set<? extends XSElementDecl> getSubstitutables() {
+         if( substitutables==null ) {
+             // if the field is null by the time this method
+@@ -136,7 +144,7 @@
+         }
+         return substitutablesView;
+     }
+-    
++
+     protected void addSubstitutable( ElementDecl decl ) {
+         if( substitutables==null ) {
+             substitutables = new HashSet<XSElementDecl>();
+@@ -145,47 +153,47 @@
+         }
+         substitutables.add(decl);
+     }
+-    
+-    
++
++
+     public void updateSubstitutabilityMap() {
+         ElementDecl parent = this;
+-        XSType type = this.getType(); 
++        XSType type = this.getType();
+ 
+         boolean rused = false;
+         boolean eused = false;
+-        
++
+         while( (parent=(ElementDecl)parent.getSubstAffiliation())!=null ) {
+-            
++
+             if(parent.isSubstitutionDisallowed(XSType.SUBSTITUTION))
+                 continue;
+-            
++
+             boolean rd = parent.isSubstitutionDisallowed(XSType.RESTRICTION);
+             boolean ed = parent.isSubstitutionDisallowed(XSType.EXTENSION);
+ 
+             if( (rd && rused) || ( ed && eused ) )   continue;
+-            
++
+             XSType parentType = parent.getType();
+             while(type!=parentType) {
+                 if(type.getDerivationMethod()==XSType.RESTRICTION)  rused = true;
+                 else                                                eused = true;
+-                
++
+                 type = type.getBaseType();
+                 if(type==null)  // parentType and type doesn't share the common base type. a bug in the schema.
+                     break;
+-                
++
+                 if( type.isComplexType() ) {
+                     rd |= type.asComplexType().isSubstitutionProhibited(XSType.RESTRICTION);
+                     ed |= type.asComplexType().isSubstitutionProhibited(XSType.EXTENSION);
+                 }
+             }
+-            
++
+             if( (rd && rused) || ( ed && eused ) )   continue;
+-            
++
+             // this element can substitute "parent"
+             parent.addSubstitutable(this);
+         }
+     }
+-    
++
+     public boolean canBeSubstitutedBy(XSElementDecl e) {
+         return getSubstitutables().contains(e);
+     }
+@@ -202,7 +210,7 @@
+ 
+ 
+ 
+-    
++
+     public void visit( XSVisitor visitor ) {
+         visitor.elementDecl(this);
+     }
+@@ -220,8 +228,8 @@
+     public Object apply( XSFunction function ) {
+         return function.elementDecl(this);
+     }
+-    
+-    
++
++
+     // Ref.Term implementation
+     public XSTerm getTerm() { return this; }
+ }
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/EmptyImpl.java	Thu Jul 30 18:40:43 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/EmptyImpl.java	Thu Jul 30 18:40:42 2009
+@@ -22,6 +22,8 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom.impl;
+ 
+ import com.sun.xml.internal.xsom.XSContentType;
+@@ -33,17 +35,17 @@
+ import com.sun.xml.internal.xsom.visitor.XSVisitor;
+ 
+ /**
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+ public class EmptyImpl extends ComponentImpl implements ContentTypeImpl {
+     public EmptyImpl() { super(null,null,null,null); }
+-    
++
+     public XSSimpleType asSimpleType()  { return null; }
+     public XSParticle asParticle()      { return null; }
+     public XSContentType asEmpty()      { return this; }
+-    
++
+     public Object apply( XSContentTypeFunction function ) {
+         return function.empty(this);
+     }
+@@ -56,6 +58,6 @@
+     public void visit( XSContentTypeVisitor visitor ) {
+         visitor.empty(this);
+     }
+-    
++
+     public XSContentType getContentType() { return this; }
+ }
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/FacetImpl.java	Thu Jul 30 18:40:46 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/FacetImpl.java	Thu Jul 30 18:40:46 2009
+@@ -22,6 +22,8 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom.impl;
+ 
+ import com.sun.xml.internal.xsom.XSFacet;
+@@ -34,24 +36,24 @@
+ public class FacetImpl extends ComponentImpl implements XSFacet {
+     public FacetImpl( SchemaDocumentImpl owner, AnnotationImpl _annon, Locator _loc, ForeignAttributesImpl _fa,
+         String _name, XmlString _value, boolean _fixed ) {
+-        
++
+         super(owner,_annon,_loc,_fa);
+-        
++
+         this.name = _name;
+         this.value = _value;
+         this.fixed = _fixed;
+     }
+-    
++
+     private final String name;
+     public String getName() { return name; }
+-    
++
+     private final XmlString value;
+     public XmlString getValue() { return value; }
+ 
+     private boolean fixed;
+     public boolean isFixed() { return fixed; }
+-    
+-    
++
++
+     public void visit( XSVisitor visitor ) {
+         visitor.facet(this);
+     }
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/ForeignAttributesImpl.java	Thu Jul 30 18:40:50 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/ForeignAttributesImpl.java	Thu Jul 30 18:40:49 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.xsom.impl;
+ 
+ import com.sun.xml.internal.xsom.ForeignAttributes;
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/IdentityConstraintImpl.java	Thu Jul 30 18:40:53 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/IdentityConstraintImpl.java	Thu Jul 30 18:40:53 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.xsom.impl;
+ 
+ import com.sun.xml.internal.xsom.XSElementDecl;
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/ListSimpleTypeImpl.java	Thu Jul 30 18:40:57 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/ListSimpleTypeImpl.java	Thu Jul 30 18:40:56 2009
+@@ -22,6 +22,8 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom.impl;
+ 
+ import com.sun.xml.internal.xsom.XSFacet;
+@@ -33,6 +35,8 @@
+ import com.sun.xml.internal.xsom.visitor.XSSimpleTypeVisitor;
+ import org.xml.sax.Locator;
+ 
++import java.util.Collections;
++import java.util.List;
+ import java.util.Set;
+ 
+ public class ListSimpleTypeImpl extends SimpleTypeImpl implements XSListSimpleType
+@@ -60,6 +64,7 @@
+ 
+     // list type by itself doesn't have any facet. */
+     public XSFacet getFacet( String name ) { return null; }
++    public List<XSFacet> getFacets( String name ) { return Collections.EMPTY_LIST; }
+ 
+     public XSVariety getVariety() { return XSVariety.LIST; }
+ 
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/ModelGroupDeclImpl.java	Thu Jul 30 18:41:00 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/ModelGroupDeclImpl.java	Thu Jul 30 18:41:00 2009
+@@ -22,6 +22,8 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom.impl;
+ 
+ import com.sun.xml.internal.xsom.XSElementDecl;
+@@ -43,26 +45,26 @@
+         AnnotationImpl _annon, Locator _loc, ForeignAttributesImpl _fa,
+         String _targetNamespace, String _name,
+         ModelGroupImpl _modelGroup ) {
+-        
++
+         super(owner,_annon,_loc,_fa,_targetNamespace,_name,false);
+         this.modelGroup = _modelGroup;
+-        
++
+         if(modelGroup==null)
+             throw new IllegalArgumentException();
+     }
+-    
++
+     private final ModelGroupImpl modelGroup;
+     public XSModelGroup getModelGroup() { return modelGroup; }
+-    
++
+     /**
+      * This component is a redefinition of "oldMG". Fix up the internal state
+-     * as such. 
++     * as such.
+      */
+     public void redefine( ModelGroupDeclImpl oldMG ) {
+         modelGroup.redefine(oldMG);
+     }
+-    
+-    
++
++
+     public void visit( XSVisitor visitor ) {
+         visitor.modelGroupDecl(this);
+     }
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/ModelGroupImpl.java	Thu Jul 30 18:41:04 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/ModelGroupImpl.java	Thu Jul 30 18:41:03 2009
+@@ -22,6 +22,8 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom.impl;
+ 
+ import com.sun.xml.internal.xsom.XSElementDecl;
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/NotationImpl.java	Thu Jul 30 18:41:07 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/NotationImpl.java	Thu Jul 30 18:41:07 2009
+@@ -22,6 +22,8 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom.impl;
+ 
+ import com.sun.xml.internal.xsom.XSNotation;
+@@ -31,24 +33,24 @@
+ import org.xml.sax.Locator;
+ 
+ /**
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+ public class NotationImpl extends DeclarationImpl implements XSNotation {
+-    
++
+     public NotationImpl( SchemaDocumentImpl owner, AnnotationImpl _annon,
+         Locator _loc, ForeignAttributesImpl _fa, String _name,
+         String _publicId, String _systemId ) {
+         super(owner,_annon,_loc,_fa,owner.getTargetNamespace(),_name,false);
+-        
++
+         this.publicId = _publicId;
+         this.systemId = _systemId;
+     }
+-    
++
+     private final String publicId;
+     private final String systemId;
+-    
++
+     public String getPublicId() { return publicId; }
+     public String getSystemId() { return systemId; }
+ 
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/ParticleImpl.java	Thu Jul 30 18:41:11 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/ParticleImpl.java	Thu Jul 30 18:41:10 2009
+@@ -22,6 +22,8 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom.impl;
+ 
+ import com.sun.xml.internal.xsom.XSContentType;
+@@ -43,7 +45,7 @@
+ {
+     public ParticleImpl( SchemaDocumentImpl owner, AnnotationImpl _ann,
+         Ref.Term _term, Locator _loc, int _maxOccurs, int _minOccurs ) {
+-            
++
+         super(owner,_ann,_loc,null);
+         this.term = _term;
+         this.maxOccurs = _maxOccurs;
+@@ -52,10 +54,10 @@
+     public ParticleImpl( SchemaDocumentImpl owner, AnnotationImpl _ann, Ref.Term _term, Locator _loc ) {
+         this(owner,_ann,_term,_loc,1,1);
+     }
+-    
++
+     private Ref.Term term;
+     public XSTerm getTerm() { return term.getTerm(); }
+-    
++
+     private int maxOccurs;
+     public int getMaxOccurs() { return maxOccurs; }
+ 
+@@ -65,8 +67,8 @@
+ 
+     private int minOccurs;
+     public int getMinOccurs() { return minOccurs; }
+-    
+-    
++
++
+     public void redefine(ModelGroupDeclImpl oldMG) {
+         if( term instanceof ModelGroupImpl ) {
+             ((ModelGroupImpl)term).redefine(oldMG);
+@@ -76,13 +78,13 @@
+             ((DelayedRef)term).redefine(oldMG);
+         }
+     }
+-    
+-    
++
++
+     public XSSimpleType asSimpleType()  { return null; }
+     public XSParticle asParticle()      { return this; }
+     public XSContentType asEmpty()      { return null; }
+-    
+-    
++
++
+     public final Object apply( XSFunction function ) {
+         return function.particle(this);
+     }
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/Ref.java	Thu Jul 30 18:41:14 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/Ref.java	Thu Jul 30 18:41:14 2009
+@@ -22,6 +22,8 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom.impl;
+ 
+ import com.sun.xml.internal.xsom.XSAttGroupDecl;
+@@ -36,7 +38,7 @@
+ 
+ /**
+  * Reference to other schema components.
+- * 
++ *
+  * <p>
+  * There are mainly two different types of references. One is
+  * the direct reference, which is only possible when schema components
+@@ -43,15 +45,15 @@
+  * are already available when references are made.
+  * The other is the lazy reference, which keeps references by names
+  * and later look for the component by name.
+- * 
++ *
+  * <p>
+  * This class defines interfaces that define the behavior of such
+  * references and classes that implement direct reference semantics.
+- * 
++ *
+  * @author Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+ public abstract class Ref {
+-    
++
+     public static interface Term {
+         /** Obtains a reference as a term. */
+         XSTerm getTerm();
+@@ -65,15 +67,15 @@
+     public static interface ContentType {
+         XSContentType getContentType();
+     }
+-    
++
+     public static interface SimpleType extends Ref.Type {
+         public XSSimpleType getType();
+     }
+-    
++
+     public static interface ComplexType extends Ref.Type {
+         public XSComplexType getType();
+     }
+-    
++
+     public static interface Attribute {
+         XSAttributeDecl getAttribute();
+     }
+@@ -81,7 +83,7 @@
+     public static interface AttGroup {
+         XSAttGroupDecl get();
+     }
+-    
++
+     public static interface Element extends Term {
+         XSElementDecl get();
+     }
+@@ -90,7 +92,7 @@
+         XSIdentityConstraint get();
+     }
+ //
+-//    
++//
+ //    private static void _assert( boolean b ) {
+ //        if(!b)
+ //            throw new InternalError("assertion failed");
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/RestrictionSimpleTypeImpl.java	Thu Jul 30 18:41:18 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/RestrictionSimpleTypeImpl.java	Thu Jul 30 18:41:17 2009
+@@ -22,6 +22,8 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom.impl;
+ 
+ import com.sun.xml.internal.xsom.XSFacet;
+@@ -88,6 +90,14 @@
+         return getSimpleBaseType().getFacet(name);
+     }
+ 
++    public List<XSFacet> getFacets( String name ) {
++        List<XSFacet> f = getDeclaredFacets(name);
++        if(!f.isEmpty())     return f;
++
++        // none was found on this datatype. check the base type.
++        return getSimpleBaseType().getFacets(name);
++    }
++
+     public XSVariety getVariety() { return getSimpleBaseType().getVariety(); }
+ 
+     public XSSimpleType getPrimitiveType() {
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/SchemaImpl.java	Thu Jul 30 18:41:21 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/SchemaImpl.java	Thu Jul 30 18:41:21 2009
+@@ -22,6 +22,8 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom.impl;
+ 
+ import com.sun.xml.internal.xsom.ForeignAttributes;
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/SchemaSetImpl.java	Thu Jul 30 18:41:25 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/SchemaSetImpl.java	Thu Jul 30 18:41:24 2009
+@@ -22,6 +22,8 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom.impl;
+ 
+ import com.sun.xml.internal.xsom.SCD;
+@@ -58,6 +60,7 @@
+ 
+ import javax.xml.namespace.NamespaceContext;
+ import java.text.ParseException;
++import java.util.ArrayList;
+ import java.util.Collection;
+ import java.util.Collections;
+ import java.util.HashMap;
+@@ -285,6 +288,7 @@
+         public XSListSimpleType getBaseListType() {return null;}
+         public XSUnionSimpleType getBaseUnionType() {return null;}
+         public XSFacet getFacet(String name) { return null; }
++        public List<XSFacet> getFacets( String name ) { return Collections.EMPTY_LIST; }
+         public XSFacet getDeclaredFacet(String name) { return null; }
+         public List<XSFacet> getDeclaredFacets(String name) { return Collections.EMPTY_LIST; }
+ 
+@@ -362,5 +366,30 @@
+                         XSParticle.UNBOUNDED, 0 )
+                 })
+                 ,null,1,1);
++        public List<XSComplexType> getSubtypes() {
++            ArrayList subtypeList = new ArrayList();
++            Iterator<XSComplexType> cTypes = getRoot().iterateComplexTypes();
++            while (cTypes.hasNext()) {
++                XSComplexType cType= cTypes.next();
++                XSType base = cType.getBaseType();
++                if ((base != null) && (base.equals(this))) {
++                    subtypeList.add(cType);
++                }
++            }
++            return subtypeList;
++        }
++
++        public List<XSElementDecl> getElementDecls() {
++            ArrayList declList = new ArrayList();
++            XSSchemaSet schemaSet = getRoot();
++            for (XSSchema sch : schemaSet.getSchemas()) {
++                for (XSElementDecl decl : sch.getElementDecls().values()) {
++                    if (decl.getType().equals(this)) {
++                        declList.add(decl);
++                    }
++                }
++            }
++            return declList;
++        }
+     }
+ }
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/SimpleTypeImpl.java	Thu Jul 30 18:41:28 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/SimpleTypeImpl.java	Thu Jul 30 18:41:28 2009
+@@ -22,6 +22,8 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom.impl;
+ 
+ import com.sun.xml.internal.xsom.XSComplexType;
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/UName.java	Thu Jul 30 18:41:32 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/UName.java	Thu Jul 30 18:41:31 2009
+@@ -22,13 +22,16 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.xsom.impl;
+ 
++import com.sun.xml.internal.xsom.XSDeclaration;
++
+ import java.util.Comparator;
+ 
+ /**
+  * UName.
+- * 
++ *
+  * @author Kohsuke Kawaguchi (kk@kohsuke.org)
+  */
+ public final class UName {
+@@ -44,19 +47,49 @@
+         this.localName = _localName.intern();
+         this.qname = _qname.intern();
+     }
+-    
++
+     public UName( String nsUri, String localName ) {
+         this(nsUri,localName,localName);
+     }
+-    
++
++    public UName(XSDeclaration decl) {
++        this(decl.getTargetNamespace(),decl.getName());
++    }
++
+     private final String nsUri;
+     private final String localName;
+     private final String qname;
+-    
++
+     public String getName() { return localName; }
+     public String getNamespaceURI() { return nsUri; }
+     public String getQualifiedName() { return qname; }
+-    
++
++
++    // Issue 540; XSComplexType.getAttributeUse(String,String) always return null
++    // UName was used in HashMap without overriden equals and hashCode methods.
++
++    @Override
++    public boolean equals(Object obj) {
++        if(obj instanceof UName) {
++            UName u = (UName)obj;
++
++            return ((this.getName().compareTo(u.getName()) == 0) &&
++                    (this.getNamespaceURI().compareTo(u.getNamespaceURI()) == 0) &&
++                    (this.getQualifiedName().compareTo(u.getQualifiedName()) == 0));
++        } else {
++            return false;
++        }
++    }
++
++    @Override
++    public int hashCode() {
++        int hash = 7;
++        hash = 13 * hash + (this.nsUri != null ? this.nsUri.hashCode() : 0);
++        hash = 13 * hash + (this.localName != null ? this.localName.hashCode() : 0);
++        hash = 13 * hash + (this.qname != null ? this.qname.hashCode() : 0);
++        return hash;
++    }
++
+     /**
+      * Compares {@link UName}s by their names.
+      */
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/UnionSimpleTypeImpl.java	Thu Jul 30 18:41:35 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/UnionSimpleTypeImpl.java	Thu Jul 30 18:41:35 2009
+@@ -22,6 +22,8 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom.impl;
+ 
+ import com.sun.xml.internal.xsom.XSFacet;
+@@ -35,6 +37,8 @@
+ 
+ import java.util.Iterator;
+ import java.util.Set;
++import java.util.List;
++import java.util.Collections;
+ 
+ public class UnionSimpleTypeImpl extends SimpleTypeImpl implements XSUnionSimpleType
+ {
+@@ -83,8 +87,9 @@
+ 
+     // union type by itself doesn't have any facet. */
+     public XSFacet getFacet( String name ) { return null; }
++    public List<XSFacet> getFacets( String name ) { return Collections.EMPTY_LIST; }
+ 
+-    public XSVariety getVariety() { return XSVariety.LIST; }
++    public XSVariety getVariety() { return XSVariety.UNION; }
+ 
+     public XSSimpleType getPrimitiveType() { return null; }
+ 
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/Util.java	Thu Jul 30 18:41:39 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/Util.java	Thu Jul 30 18:41:38 2009
+@@ -22,6 +22,8 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom.impl;
+ 
+ import com.sun.xml.internal.xsom.XSComplexType;
+@@ -33,8 +35,8 @@
+ import java.util.Set;
+ 
+ /**
+- * 
+- * 
++ *
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+@@ -41,7 +43,7 @@
+ class Util {
+     private static XSType[] listDirectSubstitutables( XSType _this ) {
+         ArrayList r = new ArrayList();
+-        
++
+         // TODO: handle @block
+         Iterator itr = ((SchemaImpl)_this.getOwnerSchema()).parent.iterateTypes();
+         while( itr.hasNext() ) {
+@@ -57,16 +59,16 @@
+         buildSubstitutables( _this, substitables );
+         return (XSType[]) substitables.toArray(new XSType[substitables.size()]);
+     }
+-    
++
+     public static void buildSubstitutables( XSType _this, Set substitutables ) {
+         if( _this.isLocal() )    return;
+         buildSubstitutables( _this, _this, substitutables );
+     }
+-    
++
+     private static void buildSubstitutables( XSType head, XSType _this, Set substitutables ) {
+         if(!isSubstitutable(head,_this))
+             return;    // no derived type of _this can substitute head.
+-        
++
+         if(substitutables.add(_this)) {
+             XSType[] child = listDirectSubstitutables(_this);
+             for( int i=0; i<child.length; i++ )
+@@ -73,10 +75,10 @@
+                 buildSubstitutables( head, child[i], substitutables );
+         }
+     }
+-    
++
+     /**
+      * Implements
+-     * <code>Validation Rule: Schema-Validity Assessment (Element) 1.2.1.2.4</code> 
++     * <code>Validation Rule: Schema-Validity Assessment (Element) 1.2.1.2.4</code>
+      */
+     private static boolean isSubstitutable( XSType _base, XSType derived ) {
+         // too ugly to the point that it's almost unbearable.
+@@ -84,7 +86,7 @@
+         // for each candidate
+         if( _base.isComplexType() ) {
+             XSComplexType base = _base.asComplexType();
+-            
++
+             for( ; base!=derived; derived=derived.getBaseType() ) {
+                 if( base.isSubstitutionProhibited( derived.getDerivationMethod() ) )
+                     return false;    // Type Derivation OK (Complex)-1
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/WildcardImpl.java	Thu Jul 30 18:41:42 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/WildcardImpl.java	Thu Jul 30 18:41:42 2009
+@@ -22,6 +22,8 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom.impl;
+ 
+ import com.sun.xml.internal.xsom.XSElementDecl;
+@@ -51,15 +53,15 @@
+         super(owner,_annon,_loc,_fa);
+         this.mode = _mode;
+     }
+-    
++
+     private final int mode;
+     public int getMode() { return mode; }
+-    
++
+     // compute the union
+     public WildcardImpl union( SchemaDocumentImpl owner, WildcardImpl rhs ) {
+         if(this instanceof Any || rhs instanceof Any)
+             return new Any(owner,null,null,null,mode);
+-        
++
+         if(this instanceof Finite && rhs instanceof Finite) {
+             Set<String> values = new HashSet<String>();
+             values.addAll( ((Finite)this).names );
+@@ -66,7 +68,7 @@
+             values.addAll( ((Finite)rhs ).names );
+             return new Finite(owner,null,null,null,values,mode);
+         }
+-        
++
+         if(this instanceof Other && rhs instanceof Other) {
+             if( ((Other)this).otherNamespace.equals(
+                 ((Other)rhs).otherNamespace) )
+@@ -75,29 +77,29 @@
+                 // this somewhat strange rule is indeed in the spec
+                 return new Other(owner,null,null,null, "", mode );
+         }
+-        
++
+         Other o;
+         Finite f;
+-        
++
+         if( this instanceof Other ) {
+             o=(Other)this; f=(Finite)rhs;
+         } else {
+             o=(Other)rhs; f=(Finite)this;
+         }
+-        
++
+         if(f.names.contains(o.otherNamespace))
+             return new Any(owner,null,null,null,mode);
+         else
+             return new Other(owner,null,null,null,o.otherNamespace,mode);
+     }
+-    
+-    
+-    
++
++
++
+     public final static class Any extends WildcardImpl implements XSWildcard.Any {
+         public Any( SchemaDocumentImpl owner, AnnotationImpl _annon, Locator _loc, ForeignAttributesImpl _fa, int _mode ) {
+             super(owner,_annon,_loc,_fa,_mode);
+         }
+-        
++
+         public boolean acceptsNamespace( String namespaceURI ) {
+             return true;
+         }
+@@ -108,7 +110,7 @@
+             return function.any(this);
+         }
+     }
+-    
++
+     public final static class Other extends WildcardImpl implements XSWildcard.Other {
+         public Other( SchemaDocumentImpl owner, AnnotationImpl _annon, Locator _loc, ForeignAttributesImpl _fa,
+                     String otherNamespace, int _mode ) {
+@@ -115,11 +117,11 @@
+             super(owner,_annon,_loc,_fa,_mode);
+             this.otherNamespace = otherNamespace;
+         }
+-        
++
+         private final String otherNamespace;
+ 
+         public String getOtherNamespace() { return otherNamespace; }
+-        
++
+         public boolean acceptsNamespace( String namespaceURI ) {
+             return !namespaceURI.equals(otherNamespace);
+         }
+@@ -131,7 +133,7 @@
+             return function.other(this);
+         }
+     }
+-    
++
+     public final static class Finite extends WildcardImpl implements XSWildcard.Union {
+         public Finite( SchemaDocumentImpl owner, AnnotationImpl _annon, Locator _loc, ForeignAttributesImpl _fa,
+                     Set<String> ns, int _mode ) {
+@@ -139,7 +141,7 @@
+             names = ns;
+             namesView = Collections.unmodifiableSet(names);
+         }
+-        
++
+         private final Set<String> names;
+         private final Set<String> namesView;
+ 
+@@ -162,7 +164,7 @@
+             return function.union(this);
+         }
+     }
+-    
++
+     public final void visit( XSVisitor visitor ) {
+         visitor.wildcard(this);
+     }
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/XPathImpl.java	Thu Jul 30 18:41:46 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/XPathImpl.java	Thu Jul 30 18:41:45 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.xsom.impl;
+ 
+ import com.sun.xml.internal.xsom.XSIdentityConstraint;
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/package.html	Thu Jul 30 18:41:49 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/package.html	Thu Jul 30 18:41:49 2009
+@@ -23,5 +23,5 @@
+  have any questions.
+ -->
+ <html><body>
+-Implementation of the <code>com.sun.xml.xsom</code> package.
++Implementation of the <code>com.sun.xml.internal.xsom</code> package.
+ </body></html>
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/parser/BaseContentRef.java	Thu Jul 30 18:41:53 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/BaseContentRef.java	Thu Jul 30 18:41:52 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.xsom.impl.parser;
+ 
+ import com.sun.xml.internal.xsom.impl.Ref;
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/parser/DefaultAnnotationParser.java	Thu Jul 30 18:41:57 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/DefaultAnnotationParser.java	Thu Jul 30 18:41:56 2009
+@@ -22,6 +22,8 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom.impl.parser;
+ 
+ import com.sun.xml.internal.xsom.parser.AnnotationContext;
+@@ -33,28 +35,27 @@
+ 
+ /**
+  * AnnotationParser that just ignores annotation.
+- * 
++ *
+  * <p>
+  * This class doesn't have any state. So it should be used as a singleton.
+- * 
++ *
+  * @author Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+ class DefaultAnnotationParser extends AnnotationParser {
+-    
++
+     private DefaultAnnotationParser() {}
+-    
++
+     public static final AnnotationParser theInstance = new DefaultAnnotationParser();
+-    
++
+     public ContentHandler getContentHandler(
+         AnnotationContext contest, String elementName,
+         ErrorHandler errorHandler, EntityResolver entityResolver ) {
+         return new DefaultHandler();
+     }
+-    
++
+     public Object getResult( Object existing ) {
+         return null;
+     }
+-    
+-    
+-}
+ 
++
++}
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/parser/DelayedRef.java	Thu Jul 30 18:42:00 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/DelayedRef.java	Thu Jul 30 18:41:59 2009
+@@ -22,6 +22,8 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom.impl.parser;
+ 
+ import com.sun.xml.internal.xsom.XSAttGroupDecl;
+@@ -43,7 +45,7 @@
+ 
+ /**
+  * Reference by name.
+- * 
++ *
+  * UName will be later resolved to a target object,
+  * after all the schemas are parsed.
+  */
+@@ -54,12 +56,12 @@
+         this.manager = _manager;
+         this.name = _name;
+         this.source = _source;
+-        
++
+         if(name==null)  throw new InternalError();
+-        
++
+         manager.addPatcher(this);
+     }
+-    
++
+     /**
+      * Patch implementation. Makes sure that the name resolves
+      * to a schema component.
+@@ -87,7 +89,7 @@
+         if(ref==null)   throw new InternalError("unresolved reference");
+         return ref;
+     }
+-    
++
+     private void resolve() throws SAXException {
+         ref = resolveReference(name);
+         if(ref==null)
+@@ -98,13 +100,13 @@
+ 
+     /**
+      * If this reference refers to the given declaration,
+-     * resolve the reference now. This is used to implement redefinition. 
++     * resolve the reference now. This is used to implement redefinition.
+      */
+     public void redefine(XSDeclaration d) {
+         if( !d.getTargetNamespace().equals(name.getNamespaceURI())
+         ||  !d.getName().equals(name.getName()) )
+             return;
+-        
++
+         ref = d;
+         manager = null;
+         name = null;
+@@ -120,7 +122,7 @@
+             Object o = super.schema.getSimpleType(
+                 name.getNamespaceURI(), name.getName() );
+             if(o!=null)     return o;
+-            
++
+             return super.schema.getComplexType(
+                 name.getNamespaceURI(),
+                 name.getName());
+@@ -128,7 +130,7 @@
+         protected String getErrorProperty() {
+             return Messages.ERR_UNDEFINED_TYPE;
+         }
+-    
++
+         public XSType getType() { return (XSType)super._get(); }
+     }
+ 
+@@ -143,7 +145,7 @@
+                 name.getNamespaceURI(),
+                 name.getName());
+         }
+-        
++
+         protected String getErrorProperty() {
+             return Messages.ERR_UNDEFINED_SIMPLETYPE;
+         }
+@@ -158,11 +160,11 @@
+                 name.getNamespaceURI(),
+                 name.getName());
+         }
+-        
++
+         protected String getErrorProperty() {
+             return Messages.ERR_UNDEFINED_COMPLEXTYPE;
+         }
+-    
++
+         public XSComplexType getType() { return (XSComplexType)super._get(); }
+     }
+ 
+@@ -175,15 +177,15 @@
+                 name.getNamespaceURI(),
+                 name.getName());
+         }
+-        
++
+         protected String getErrorProperty() {
+             return Messages.ERR_UNDEFINED_ELEMENT;
+         }
+-    
++
+         public XSElementDecl get() { return (XSElementDecl)super._get(); }
+         public XSTerm getTerm() { return get(); }
+     }
+-    
++
+     public static class ModelGroup extends DelayedRef implements Ref.Term {
+         public ModelGroup( PatcherManager manager, Locator loc, SchemaImpl schema, UName name ) {
+             super(manager,loc,schema,name);
+@@ -193,15 +195,15 @@
+                 name.getNamespaceURI(),
+                 name.getName());
+         }
+-        
++
+         protected String getErrorProperty() {
+             return Messages.ERR_UNDEFINED_MODELGROUP;
+         }
+-    
++
+         public XSModelGroupDecl get() { return (XSModelGroupDecl)super._get(); }
+         public XSTerm getTerm() { return get(); }
+     }
+-    
++
+     public static class AttGroup extends DelayedRef implements Ref.AttGroup {
+         public AttGroup( PatcherManager manager, Locator loc, SchemaImpl schema, UName name ) {
+             super(manager,loc,schema,name);
+@@ -211,11 +213,11 @@
+                 name.getNamespaceURI(),
+                 name.getName());
+         }
+-        
++
+         protected String getErrorProperty() {
+             return Messages.ERR_UNDEFINED_ATTRIBUTEGROUP;
+         }
+-    
++
+         public XSAttGroupDecl get() { return (XSAttGroupDecl)super._get(); }
+     }
+ 
+@@ -228,11 +230,11 @@
+                 name.getNamespaceURI(),
+                 name.getName());
+         }
+-        
++
+         protected String getErrorProperty() {
+             return Messages.ERR_UNDEFINED_ATTRIBUTE;
+         }
+-    
++
+         public XSAttributeDecl getAttribute() { return (XSAttributeDecl)super._get(); }
+     }
+ 
+@@ -253,4 +255,3 @@
+         public XSIdentityConstraint get() { return (XSIdentityConstraint)super._get(); }
+     }
+ }
+-
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/parser/Messages.java	Thu Jul 30 18:42:04 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/Messages.java	Thu Jul 30 18:42:03 2009
+@@ -22,6 +22,8 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom.impl.parser;
+ 
+ import java.text.MessageFormat;
+@@ -38,7 +40,7 @@
+             Messages.class.getName()).getString(property);
+         return MessageFormat.format(text,args);
+     }
+-    
++
+ //
+ //
+ // Message resources
+@@ -67,10 +69,10 @@
+         "DoubleDefinition"; // arg:1
+     public static final String ERR_DOUBLE_DEFINITION_ORIGINAL =
+         "DoubleDefinition.Original"; // arg:0
+-    
++
+     public static final String ERR_MISSING_SCHEMALOCATION =
+         "MissingSchemaLocation"; // arg:0
+-        
++
+     public static final String ERR_ENTITY_RESOLUTION_FAILURE =
+         "EntityResolutionFailure"; // arg:2
+ 
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/parser/Messages.properties	Thu Jul 30 18:42:07 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/Messages.properties	Thu Jul 30 18:42:06 2009
+@@ -24,50 +24,49 @@
+ #
+ 
+ UndefinedSimpleType = \
+-	undefined simple type ''{0}''
++        undefined simple type ''{0}''
+ 
+ UndefinedCompplexType = \
+-	undefined complex type ''{0}''
++        undefined complex type ''{0}''
+ 
+ UndefinedType = \
+-	undefined simple or complex type ''{0}''
++        undefined simple or complex type ''{0}''
+ 
+ UndefinedElement = \
+-	undefined element declaration ''{0}''
++        undefined element declaration ''{0}''
+ 
+ UndefinedModelGroup = \
+-	undefined model group ''{0}''
++        undefined model group ''{0}''
+ 
+ UndefinedAttribute = \
+-	undefined attribute ''{0}''
++        undefined attribute ''{0}''
+ 
+ UndefinedAttributeGroup = \
+-	undefined attribute group ''{0}''
++        undefined attribute group ''{0}''
+ 
+ UndefinedIdentityConstraint = \
+     undefined identity constraint ''{0}''
+ 
+ UndefinedPrefix = \
+-	unbounded prefix ''{0}''
++        unbounded prefix ''{0}''
+ 
+ UnexpectedTargetnamespace.Include = \
+-	the target namespace of the included schema "{0}" doesn''t agree with the expected value "{1}"
++        the target namespace of the included schema "{0}" doesn''t agree with the expected value "{1}"
+ 
+ UnexpectedTargetnamespace.Import = \
+-	the target namespace of the imported schema "{0}" doesn''t agree with the expected value "{1}"
++        the target namespace of the imported schema "{0}" doesn''t agree with the expected value "{1}"
+ 
+ DoubleDefinition = \
+-	''{0}'' is already defined
++        ''{0}'' is already defined
+ 
+ DoubleDefinition.Original = \
+-	(related to above error) the first definition appears here
+-	
++        (related to above error) the first definition appears here
++
+ MissingSchemaLocation = \
+-	a "schemaLocation" attribute is required
++        a "schemaLocation" attribute is required
+ 
+ EntityResolutionFailure = \
+-	failed to retrieve ''{0}'': {1}
++        failed to retrieve ''{0}'': {1}
+ 
+ SimpleContentExpected = \
+   A complex type with a simple content or a simple type is expected but found ''{0}'':{1}
+- 
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/parser/Messages_ja.properties	Thu Jul 30 18:42:11 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/Messages_ja.properties	Thu Jul 30 18:42:10 2009
+@@ -24,47 +24,46 @@
+ #
+ 
+ UndefinedSimpleType = \
+-	\u672A\u5B9A\u7FA9\u306E\u30B7\u30F3\u30D7\u30EB\u30BF\u30A4\u30D7''{0}''\u304C\u4F7F\u308F\u308C\u3066\u3044\u307E\u3059
++        \u672A\u5B9A\u7FA9\u306E\u30B7\u30F3\u30D7\u30EB\u30BF\u30A4\u30D7''{0}''\u304C\u4F7F\u308F\u308C\u3066\u3044\u307E\u3059
+ 
+ UndefinedCompplexType = \
+-	\u672A\u5B9A\u7FA9\u306E\u30B3\u30F3\u30D7\u30EC\u30C3\u30AF\u30B9\u30BF\u30A4\u30D7''{0}''\u304C\u4F7F\u308F\u308C\u3066\u3044\u307E\u3059
++        \u672A\u5B9A\u7FA9\u306E\u30B3\u30F3\u30D7\u30EC\u30C3\u30AF\u30B9\u30BF\u30A4\u30D7''{0}''\u304C\u4F7F\u308F\u308C\u3066\u3044\u307E\u3059
+ 
+ UndefinedType = \
+-	\u672A\u5B9A\u7FA9\u306E\u578B''{0}''\u304C\u4F7F\u308F\u308C\u3066\u3044\u307E\u3059
++        \u672A\u5B9A\u7FA9\u306E\u578B''{0}''\u304C\u4F7F\u308F\u308C\u3066\u3044\u307E\u3059
+ 
+ UndefinedElement = \
+-	\u672A\u5B9A\u7FA9\u306E\u8981\u7D20''{0}''\u304C\u4F7F\u308F\u308C\u3066\u3044\u307E\u3059
++        \u672A\u5B9A\u7FA9\u306E\u8981\u7D20''{0}''\u304C\u4F7F\u308F\u308C\u3066\u3044\u307E\u3059
+ 
+ UndefinedModelGroup = \
+-	\u672A\u5B9A\u7FA9\u306E\u30E2\u30C7\u30EB\u30B0\u30EB\u30FC\u30D7''{0}''\u304C\u4F7F\u308F\u308C\u3066\u3044\u307E\u3059
++        \u672A\u5B9A\u7FA9\u306E\u30E2\u30C7\u30EB\u30B0\u30EB\u30FC\u30D7''{0}''\u304C\u4F7F\u308F\u308C\u3066\u3044\u307E\u3059
+ 
+ UndefinedAttribute = \
+-	\u672A\u5B9A\u7FA9\u306E\u5C5E\u6027''{0}''\u304C\u4F7F\u308F\u308C\u3066\u3044\u307E\u3059
++        \u672A\u5B9A\u7FA9\u306E\u5C5E\u6027''{0}''\u304C\u4F7F\u308F\u308C\u3066\u3044\u307E\u3059
+ 
+ UndefinedAttributeGroup = \
+-	\u672A\u5B9A\u7FA9\u306E\u5C5E\u6027\u30B0\u30EB\u30FC\u30D7''{0}''\u304C\u4F7F\u308F\u308C\u3066\u3044\u307E\u3059
++        \u672A\u5B9A\u7FA9\u306E\u5C5E\u6027\u30B0\u30EB\u30FC\u30D7''{0}''\u304C\u4F7F\u308F\u308C\u3066\u3044\u307E\u3059
+ 
+ UndefinedIdentityConstraint = \
+-	\u672A\u5B9A\u7FA9\u306E\u4E00\u610F\u6027\u5236\u7D04''{0}''\u304C\u4F7F\u308F\u308C\u3066\u3044\u307E\u3059
++        \u672A\u5B9A\u7FA9\u306E\u4E00\u610F\u6027\u5236\u7D04''{0}''\u304C\u4F7F\u308F\u308C\u3066\u3044\u307E\u3059
+ 
+ UndefinedPrefix = \
+-	xmlns\u5BA3\u8A00\u306E\u3055\u308C\u3066\u3044\u306A\u3044\u30D7\u30EC\u30D5\u30A3\u30C3\u30AF\u30B9''{0}''\u304C\u4F7F\u308F\u308C\u3066\u3044\u307E\u3059
++        xmlns\u5BA3\u8A00\u306E\u3055\u308C\u3066\u3044\u306A\u3044\u30D7\u30EC\u30D5\u30A3\u30C3\u30AF\u30B9''{0}''\u304C\u4F7F\u308F\u308C\u3066\u3044\u307E\u3059
+ 
+ UnexpectedTargetnamespace.Include = \
+-	include\u3057\u305F\u5074\u3068\u3055\u308C\u305F\u5074\u306EtargetNamespace\u5C5E\u6027\u306E\u5024\u304C\u98DF\u3044\u9055\u3063\u3066\u3044\u307E\u3059({0}\u3068{1})
++        include\u3057\u305F\u5074\u3068\u3055\u308C\u305F\u5074\u306EtargetNamespace\u5C5E\u6027\u306E\u5024\u304C\u98DF\u3044\u9055\u3063\u3066\u3044\u307E\u3059({0}\u3068{1})
+ 
+ UnexpectedTargetnamespace.Import = \
+-	import\u3057\u305F\u5074\u3068\u3055\u308C\u305F\u5074\u306EtargetNamespace\u5C5E\u6027\u306E\u5024\u304C\u98DF\u3044\u9055\u3063\u3066\u3044\u307E\u3059({0}\u3068{1})
++        import\u3057\u305F\u5074\u3068\u3055\u308C\u305F\u5074\u306EtargetNamespace\u5C5E\u6027\u306E\u5024\u304C\u98DF\u3044\u9055\u3063\u3066\u3044\u307E\u3059({0}\u3068{1})
+ 
+ DoubleDefinition = \
+-	''{0}''\u306F\u65E2\u306B\u5B9A\u7FA9\u3055\u308C\u3066\u3044\u307E\u3059
++        ''{0}''\u306F\u65E2\u306B\u5B9A\u7FA9\u3055\u308C\u3066\u3044\u307E\u3059
+ 
+ DoubleDefinition.Original = \
+-	\uFF08\u4E0A\u306E\u30A8\u30E9\u30FC\u306B\u95A2\u9023\uFF09\u5143\u3005\u306E\u5B9A\u7FA9\u306F\u3053\u3053\u3067\u884C\u308F\u308C\u3066\u3044\u307E\u3059
++        \uFF08\u4E0A\u306E\u30A8\u30E9\u30FC\u306B\u95A2\u9023\uFF09\u5143\u3005\u306E\u5B9A\u7FA9\u306F\u3053\u3053\u3067\u884C\u308F\u308C\u3066\u3044\u307E\u3059
+ 
+ MissingSchemaLocation = \
+-	schemaLocation\u5C5E\u6027\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093
++        schemaLocation\u5C5E\u6027\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093
+ 
+ EntityResolutionFailure = \
+-	''{0}''\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093: {1}
+- 
++        ''{0}''\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093: {1}
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/parser/NGCCRuntimeEx.java	Thu Jul 30 18:42:14 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/NGCCRuntimeEx.java	Thu Jul 30 18:42:14 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.xsom.impl.parser;
+ 
+ import com.sun.xml.internal.xsom.XSDeclaration;
+@@ -52,48 +53,48 @@
+ /**
+  * NGCCRuntime extended with various utility methods for
+  * parsing XML Schema.
+- * 
++ *
+  * @author Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+ public class NGCCRuntimeEx extends NGCCRuntime implements PatcherManager {
+-    
++
+     /** coordinator. */
+     public final ParserContext parser;
+-    
++
+     /** The schema currently being parsed. */
+     public SchemaImpl currentSchema;
+-    
++
+     /** The @finalDefault value of the current schema. */
+     public int finalDefault = 0;
+     /** The @blockDefault value of the current schema. */
+     public int blockDefault = 0;
+-    
++
+     /**
+      * The @elementFormDefault value of the current schema.
+      * True if local elements are qualified by default.
+      */
+     public boolean elementFormDefault = false;
+-    
++
+     /**
+      * The @attributeFormDefault value of the current schema.
+      * True if local attributes are qualified by default.
+      */
+     public boolean attributeFormDefault = false;
+-    
++
+     /**
+      * True if the current schema is in a chameleon mode.
+      * This changes the way QNames are interpreted.
+-     * 
+-     * Life is very miserable with XML Schema, as you see. 
++     *
++     * Life is very miserable with XML Schema, as you see.
+      */
+     public boolean chameleonMode = false;
+-    
++
+     /**
+      * URI that identifies the schema document.
+      * Maybe null if the system ID is not available.
+      */
+     private String documentSystemId;
+-    
++
+     /**
+      * Keep the local name of elements encountered so far.
+      * This information is passed to AnnotationParser as
+@@ -116,17 +117,17 @@
+     NGCCRuntimeEx( ParserContext _parser ) {
+         this(_parser,false,null);
+     }
+-    
++
+     private NGCCRuntimeEx( ParserContext _parser, boolean chameleonMode, NGCCRuntimeEx referer ) {
+         this.parser = _parser;
+         this.chameleonMode = chameleonMode;
+         this.referer = referer;
+-        
++
+         // set up the default namespace binding
+         currentContext = new Context("","",null);
+         currentContext = new Context("xml","http://www.w3.org/XML/1998/namespace",currentContext);
+     }
+-    
++
+     public void checkDoubleDefError( XSDeclaration c ) throws SAXException {
+         if(c==null || ignorableDuplicateComponent(c)) return;
+ 
+@@ -144,9 +145,9 @@
+         }
+         return false;
+     }
+-    
+-    
+-    
++
++
++
+     /* registers a patcher that will run after all the parsing has finished. */
+     public void addPatcher( Patch patcher ) {
+         parser.patcherManager.addPatcher(patcher);
+@@ -161,7 +162,7 @@
+         reportError(msg,getLocator());
+     }
+ 
+-    
++
+     /**
+      * Resolves relative URI found in the document.
+      *
+@@ -204,7 +205,7 @@
+             return null;
+         }
+     }
+-    
++
+     /** Includes the specified schema. */
+     public void includeSchema( String schemaLocation ) throws SAXException {
+         NGCCRuntimeEx runtime = new NGCCRuntimeEx(parser,chameleonMode,this);
+@@ -211,7 +212,7 @@
+         runtime.currentSchema = this.currentSchema;
+         runtime.blockDefault = this.blockDefault;
+         runtime.finalDefault = this.finalDefault;
+-        
++
+         if( schemaLocation==null ) {
+             SAXParseException e = new SAXParseException(
+                 Messages.format( Messages.ERR_MISSING_SCHEMALOCATION ), getLocator() );
+@@ -218,11 +219,11 @@
+             parser.errorHandler.fatalError(e);
+             throw e;
+         }
+-            
++
+         runtime.parseEntity( resolveRelativeURL(null,schemaLocation),
+             true, currentSchema.getTargetNamespace(), getLocator() );
+     }
+-    
++
+     /** Imports the specified schema. */
+     public void importSchema( String ns, String schemaLocation ) throws SAXException {
+         NGCCRuntimeEx newRuntime = new NGCCRuntimeEx(parser,false,this);
+@@ -234,35 +235,35 @@
+         // we already have the schema components for this schema
+         // or we will receive them in the future.
+     }
+-    
++
+     /**
+      * Called when a new document is being parsed and checks
+      * if the document has already been parsed before.
+-     * 
++     *
+      * <p>
+      * Used to avoid recursive inclusion. Note that the same
+      * document will be parsed multiple times if they are for different
+      * target namespaces.
+-     * 
++     *
+      * <h2>Document Graph Model</h2>
+      * <p>
+-     * The challenge we are facing here is that you have a graph of 
++     * The challenge we are facing here is that you have a graph of
+      * documents that reference each other. Each document has an unique
+      * URI to identify themselves, and references are done by using those.
+      * The graph may contain cycles.
+-     * 
++     *
+      * <p>
+      * Our goal here is to parse all the documents in the graph, without
+      * parsing the same document twice. This method implements this check.
+-     * 
++     *
+      * <p>
+      * One complication is the chameleon schema; a document can be parsed
+      * multiple times if they are under different target namespaces.
+-     * 
++     *
+      * <p>
+      * Also, note that when you resolve relative URIs in the @schemaLocation,
+      * their base URI is *NOT* the URI of the document.
+-     * 
++     *
+      * @return true if the document has already been processed and thus
+      *      needs to be skipped.
+      */
+@@ -301,10 +302,10 @@
+ 
+         return existing!=null;
+     }
+-    
++
+     /**
+      * Parses the specified entity.
+-     * 
++     *
+      * @param importLocation
+      *      The source location of the import/include statement.
+      *      Used for reporting errors.
+@@ -311,7 +312,7 @@
+      */
+     public void parseEntity( InputSource source, boolean includeMode, String expectedNamespace, Locator importLocation )
+             throws SAXException {
+-                
++
+         documentSystemId = source.getSystemId();
+ //        System.out.println("parsing "+baseUri);
+ 
+@@ -320,7 +321,7 @@
+         try {
+             Schema s = new Schema(this,includeMode,expectedNamespace);
+             setRootHandler(s);
+-            
++
+             try {
+                 parser.parser.parse(source,this,
+                     getErrorHandler(),
+@@ -336,7 +337,7 @@
+             throw e;
+         }
+     }
+-    
++
+     /**
+      * Creates a new instance of annotation parser.
+      */
+@@ -346,7 +347,7 @@
+         else
+             return parser.getAnnotationParserFactory().create();
+     }
+-    
++
+     /**
+      * Gets the element name that contains the annotation element.
+      * This method works correctly only when called by the annotation handler.
+@@ -391,25 +392,25 @@
+             this.prefix = _prefix;
+             this.uri = _uri;
+         }
+-        
++
+         public String resolveNamespacePrefix(String p) {
+             if(p.equals(prefix))    return uri;
+             if(previous==null)      return null;
+             else                    return previous.resolveNamespacePrefix(p);
+         }
+-        
++
+         private final String prefix;
+         private final String uri;
+         private final Context previous;
+-        
++
+         // XSDLib don't use those methods, so we cut a corner here.
+         public String getBaseUri() { return null; }
+         public boolean isNotation(String arg0) { return false; }
+         public boolean isUnparsedEntity(String arg0) { return false; }
+     }
+-    
++
+     private Context currentContext=null;
+-    
++
+     /** Returns an immutable snapshot of the current context. */
+     public ValidationContext createValidationContext() {
+         return currentContext;
+@@ -445,11 +446,11 @@
+         int idx = qname.indexOf(':');
+         if(idx<0) {
+             String uri = resolveNamespacePrefix("");
+-            
++
+             // chamelon behavior. ugly...
+             if( uri.equals("") && chameleonMode )
+                 uri = currentSchema.getTargetNamespace();
+-            
++
+             // this is guaranteed to resolve
+             return new UName(uri,qname,qname);
+         } else {
+@@ -479,7 +480,7 @@
+                 getLocator().getLineNumber(),
+                 getLocator().getColumnNumber()),
+             getLocator());
+-            
++
+         parser.errorHandler.fatalError(e);
+         throw e;    // we will abort anyway
+     }
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/parser/ParserContext.java	Thu Jul 30 18:42:18 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/ParserContext.java	Thu Jul 30 18:42:17 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.xsom.impl.parser;
+ 
+ import com.sun.xml.internal.xsom.XSSchemaSet;
+@@ -45,12 +46,12 @@
+ 
+ /**
+  * Provides context information to be used by {@link NGCCRuntimeEx}s.
+- * 
++ *
+  * <p>
+  * This class does the actual processing for {@link XSOMParser},
+  * but to hide the details from the public API, this class in
+  * a different package.
+- * 
++ *
+  * @author Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+ public class ParserContext {
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/parser/Patch.java	Thu Jul 30 18:42:22 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/Patch.java	Thu Jul 30 18:42:21 2009
+@@ -22,6 +22,8 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom.impl.parser;
+ 
+ import org.xml.sax.SAXException;
+@@ -28,7 +30,7 @@
+ 
+ /**
+  * Patch program that runs later to "fix" references among components.
+- * 
++ *
+  * The only difference from the Runnable interface is that this interface
+  * allows the program to throw a SAXException.
+  */
+@@ -35,4 +37,3 @@
+ public interface Patch {
+     void run() throws SAXException;
+ }
+-
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/parser/PatcherManager.java	Thu Jul 30 18:42:25 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/PatcherManager.java	Thu Jul 30 18:42:24 2009
+@@ -22,6 +22,8 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom.impl.parser;
+ 
+ import org.xml.sax.Locator;
+@@ -29,7 +31,7 @@
+ 
+ /**
+  * Manages patchers.
+- * 
++ *
+  * @author Kohsuke Kawaguchi (kk@kohsuke.org)
+  */
+ public interface PatcherManager {
+@@ -37,14 +39,14 @@
+     void addErrorChecker( Patch p );
+     /**
+      * Reports an error during the parsing.
+-     * 
++     *
+      * @param source
+      *      location of the error in the source file, or null if
+      *      it's unavailable.
+      */
+     void reportError( String message, Locator source ) throws SAXException;
+-    
+-    
++
++
+     public interface Patcher {
+         void run() throws SAXException;
+     }
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/parser/SAXParserFactoryAdaptor.java	Thu Jul 30 18:42:28 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/SAXParserFactoryAdaptor.java	Thu Jul 30 18:42:28 2009
+@@ -22,6 +22,8 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom.impl.parser;
+ 
+ import com.sun.xml.internal.xsom.parser.XMLParser;
+@@ -40,18 +42,18 @@
+ /**
+  * {@link SAXParserFactory} implementation that ultimately
+  * uses {@link XMLParser} to parse documents.
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+ public class SAXParserFactoryAdaptor extends SAXParserFactory {
+-    
++
+     private final XMLParser parser;
+-    
++
+     public SAXParserFactoryAdaptor( XMLParser _parser ) {
+         this.parser = _parser;
+     }
+-    
++
+     public SAXParser newSAXParser() throws ParserConfigurationException, SAXException {
+         return new SAXParserImpl();
+     }
+@@ -63,11 +65,11 @@
+     public boolean getFeature(String name) {
+         return false;
+     }
+-    
++
+     private class SAXParserImpl extends SAXParser
+     {
+         private final XMLReaderImpl reader = new XMLReaderImpl();
+-        
++
+         /**
+          * @deprecated
+          */
+@@ -94,7 +96,7 @@
+             return null;
+         }
+     }
+-    
++
+     private class XMLReaderImpl extends XMLFilterImpl
+     {
+         public void parse(InputSource input) throws IOException, SAXException {
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/parser/SchemaDocumentImpl.java	Thu Jul 30 18:42:32 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/SchemaDocumentImpl.java	Thu Jul 30 18:42:31 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.xsom.impl.parser;
+ 
+ import com.sun.xml.internal.xsom.impl.SchemaImpl;
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/parser/SubstGroupBaseTypeRef.java	Thu Jul 30 18:42:36 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/SubstGroupBaseTypeRef.java	Thu Jul 30 18:42:35 2009
+@@ -22,6 +22,8 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom.impl.parser;
+ 
+ import com.sun.xml.internal.xsom.XSType;
+@@ -28,14 +30,14 @@
+ import com.sun.xml.internal.xsom.impl.Ref;
+ 
+ /**
+- * 
+- * 
++ *
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+ public class SubstGroupBaseTypeRef implements Ref.Type {
+     private final Ref.Element e;
+-    
++
+     public SubstGroupBaseTypeRef( Ref.Element _e ) {
+         this.e = _e;
+     }
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/AttributesImpl.java	Thu Jul 30 18:42:39 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/AttributesImpl.java	Thu Jul 30 18:42:38 2009
+@@ -44,8 +44,8 @@
+  * </blockquote>
+  *
+  * <p>This class provides a default implementation of the SAX2
+- * {@link org.xml.sax.Attributes Attributes} interface, with the 
+- * addition of manipulators so that the list can be modified or 
++ * {@link org.xml.sax.Attributes Attributes} interface, with the
++ * addition of manipulators so that the list can be modified or
+  * reused.</p>
+  *
+  * <p>There are two typical uses of this class:</p>
+@@ -56,15 +56,15 @@
+  * <li>to construct or modify an Attributes object in a SAX2 driver or filter.</li>
+  * </ol>
+  *
+- * <p>This class replaces the now-deprecated SAX1 {@link 
++ * <p>This class replaces the now-deprecated SAX1 {@link
+  * org.xml.sax.helpers.AttributeListImpl AttributeListImpl}
+  * class; in addition to supporting the updated Attributes
+  * interface rather than the deprecated {@link org.xml.sax.AttributeList
+- * AttributeList} interface, it also includes a much more efficient 
++ * AttributeList} interface, it also includes a much more efficient
+  * implementation using a single array rather than a set of Vectors.</p>
+  *
+  * @since SAX 2.0
+- * @author David Megginson, 
++ * @author David Megginson,
+  *         <a href="mailto:sax@megginson.com">sax@megginson.com</a>
+  * @version 2.0
+  */
+@@ -71,7 +71,7 @@
+ public class AttributesImpl implements Attributes
+ {
+ 
+-
++
+     ////////////////////////////////////////////////////////////////////
+     // Constructors.
+     ////////////////////////////////////////////////////////////////////
+@@ -101,7 +101,7 @@
+     }
+ 
+ 
+-
++
+     ////////////////////////////////////////////////////////////////////
+     // Implementation of org.xml.sax.Attributes.
+     ////////////////////////////////////////////////////////////////////
+@@ -141,7 +141,7 @@
+      * Return an attribute's local name.
+      *
+      * @param index The attribute's index (zero-based).
+-     * @return The attribute's local name, the empty string if 
++     * @return The attribute's local name, the empty string if
+      *         none is available, or null if the index if out of range.
+      * @see org.xml.sax.Attributes#getLocalName
+      */
+@@ -159,7 +159,7 @@
+      * Return an attribute's qualified (prefixed) name.
+      *
+      * @param index The attribute's index (zero-based).
+-     * @return The attribute's qualified name, the empty string if 
++     * @return The attribute's qualified name, the empty string if
+      *         none is available, or null if the index is out of bounds.
+      * @see org.xml.sax.Attributes#getQName
+      */
+@@ -228,7 +228,7 @@
+         if (data[i].equals(uri) && data[i+1].equals(localName)) {
+         return i / 5;
+         }
+-    } 
++    }
+     return -1;
+     }
+ 
+@@ -247,7 +247,7 @@
+         if (data[i+2].equals(qName)) {
+         return i / 5;
+         }
+-    } 
++    }
+     return -1;
+     }
+ 
+@@ -269,7 +269,7 @@
+         if (data[i].equals(uri) && data[i+1].equals(localName)) {
+         return data[i+3];
+         }
+-    } 
++    }
+     return null;
+     }
+ 
+@@ -336,7 +336,7 @@
+     }
+ 
+ 
+-
++
+     ////////////////////////////////////////////////////////////////////
+     // Manipulators.
+     ////////////////////////////////////////////////////////////////////
+@@ -346,7 +346,7 @@
+      * Clear the attribute list for reuse.
+      *
+      * <p>Note that no memory is actually freed by this call:
+-     * the current arrays are kept so that they can be 
++     * the current arrays are kept so that they can be
+      * reused.</p>
+      */
+     public void clear ()
+@@ -360,7 +360,7 @@
+      *
+      * <p>It may be more efficient to reuse an existing object
+      * rather than constantly allocating new ones.</p>
+-     * 
++     *
+      * @param atts The attributes to copy.
+      */
+     public void setAttributes (Attributes atts)
+@@ -367,7 +367,7 @@
+     {
+     clear();
+     length = atts.getLength();
+-    data = new String[length*5]; 
++    data = new String[length*5];
+     for (int i = 0; i < length; i++) {
+         data[i*5] = atts.getURI(i);
+         data[i*5+1] = atts.getLocalName(i);
+@@ -564,7 +564,7 @@
+     }
+ 
+ 
+-
++
+     ////////////////////////////////////////////////////////////////////
+     // Internal methods.
+     ////////////////////////////////////////////////////////////////////
+@@ -612,7 +612,7 @@
+     }
+ 
+ 
+-
++
+     ////////////////////////////////////////////////////////////////////
+     // Internal state.
+     ////////////////////////////////////////////////////////////////////
+@@ -623,4 +623,3 @@
+ }
+ 
+ // end of AttributesImpl.java
+-
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/NGCCEventReceiver.java	Thu Jul 30 18:42:43 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/NGCCEventReceiver.java	Thu Jul 30 18:42:42 2009
+@@ -28,8 +28,8 @@
+ import org.xml.sax.SAXException;
+ 
+ /**
+- * 
+- * 
++ *
++ *
+  * @author Kohsuke Kawaguchi (kk@kohsuke.org)
+  */
+ public interface NGCCEventReceiver {
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/NGCCEventSource.java	Thu Jul 30 18:42:46 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/NGCCEventSource.java	Thu Jul 30 18:42:46 2009
+@@ -28,8 +28,8 @@
+ import org.xml.sax.SAXException;
+ 
+ /**
+- * 
+- * 
++ *
++ *
+  * @author Kohsuke Kawaguchi (kk@kohsuke.org)
+  */
+ public interface NGCCEventSource {
+@@ -38,7 +38,7 @@
+      * ID of the EventReceiver thread.
+      */
+     int replace( NGCCEventReceiver _old, NGCCEventReceiver _new );
+-    
++
+     /** Sends an enter element event to the specified EventReceiver thread. */
+     void sendEnterElement( int receiverThreadId, String uri, String local, String qname, Attributes atts ) throws SAXException;
+ 
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/NGCCHandler.java	Thu Jul 30 18:42:50 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/NGCCHandler.java	Thu Jul 30 18:42:49 2009
+@@ -28,51 +28,51 @@
+ import org.xml.sax.SAXException;
+ 
+ /**
+- * 
+- * 
++ *
++ *
+  * @version $Id: NGCCHandler.java,v 1.9 2002/09/29 02:55:48 okajima Exp $
+  * @author Kohsuke Kawaguchi (kk@kohsuke.org)
+  */
+ public abstract class NGCCHandler implements NGCCEventReceiver {
+     protected NGCCHandler( NGCCEventSource source, NGCCHandler parent, int parentCookie ) {
+-            
++
+         _parent = parent;
+         _source = source;
+         _cookie = parentCookie;
+     }
+-    
++
+     /**
+      * Parent NGCCHandler, if any.
+      * If this is the root handler, this field will be null.
+      */
+     protected final NGCCHandler _parent;
+-    
++
+     /**
+      * Event source.
+      */
+     protected final NGCCEventSource _source;
+-    
++
+     /**
+      * This method will be implemented by the generated code
+      * and returns a reference to the current runtime.
+      */
+     protected abstract NGCCRuntime getRuntime();
+-    
++
+     /**
+      * Cookie assigned by the parent.
+-     * 
++     *
+      * This value will be passed to the onChildCompleted handler
+      * of the parent.
+      */
+     protected final int _cookie;
+-    
++
+     // used to copy parameters to (enter|leave)(Element|Attribute) events.
+     //protected String localName,uri,qname;
+-    
+-    
++
++
+     /**
+      * Notifies the completion of a child object.
+-     * 
++     *
+      * @param result
+      *      The parsing result of the child state.
+      * @param cookie
+@@ -85,7 +85,7 @@
+      *      attribute transition.
+      */
+     protected abstract void onChildCompleted( Object result, int cookie, boolean needAttCheck ) throws SAXException;
+-    
++
+ //
+ //
+ // spawns a new child object from event handlers.
+@@ -93,35 +93,35 @@
+ //
+     public void spawnChildFromEnterElement( NGCCEventReceiver child,
+         String uri, String localname, String qname, Attributes atts) throws SAXException {
+-        
++
+         int id = _source.replace(this,child);
+         _source.sendEnterElement(id,uri,localname,qname,atts);
+     }
+     public void spawnChildFromEnterAttribute( NGCCEventReceiver child,
+         String uri, String localname, String qname) throws SAXException {
+-            
++
+         int id = _source.replace(this,child);
+         _source.sendEnterAttribute(id,uri,localname,qname);
+     }
+     public void spawnChildFromLeaveElement( NGCCEventReceiver child,
+         String uri, String localname, String qname) throws SAXException {
+-            
++
+         int id = _source.replace(this,child);
+         _source.sendLeaveElement(id,uri,localname,qname);
+     }
+     public void spawnChildFromLeaveAttribute( NGCCEventReceiver child,
+         String uri, String localname, String qname) throws SAXException {
+-            
++
+         int id = _source.replace(this,child);
+         _source.sendLeaveAttribute(id,uri,localname,qname);
+     }
+     public void spawnChildFromText( NGCCEventReceiver child,
+         String value) throws SAXException {
+-            
++
+         int id = _source.replace(this,child);
+         _source.sendText(id,value);
+     }
+-    
++
+ //
+ //
+ // reverts to the parent object from the child handler
+@@ -129,7 +129,7 @@
+ //
+     public void revertToParentFromEnterElement( Object result, int cookie,
+         String uri,String local,String qname, Attributes atts ) throws SAXException {
+-            
++
+         int id = _source.replace(this,_parent);
+         _parent.onChildCompleted(result,cookie,true);
+         _source.sendEnterElement(id,uri,local,qname,atts);
+@@ -136,13 +136,13 @@
+     }
+     public void revertToParentFromLeaveElement( Object result, int cookie,
+         String uri,String local,String qname ) throws SAXException {
+-        
++
+         if(uri==NGCCRuntime.IMPOSSIBLE && uri==local && uri==qname && _parent==null )
+             // all the handlers are properly finalized.
+             // quit now, because we don't have any more NGCCHandler.
+             // see the endDocument handler for detail
+             return;
+-        
++
+         int id = _source.replace(this,_parent);
+         _parent.onChildCompleted(result,cookie,true);
+         _source.sendLeaveElement(id,uri,local,qname);
+@@ -149,7 +149,7 @@
+     }
+     public void revertToParentFromEnterAttribute( Object result, int cookie,
+         String uri,String local,String qname ) throws SAXException {
+-            
++
+         int id = _source.replace(this,_parent);
+         _parent.onChildCompleted(result,cookie,true);
+         _source.sendEnterAttribute(id,uri,local,qname);
+@@ -156,7 +156,7 @@
+     }
+     public void revertToParentFromLeaveAttribute( Object result, int cookie,
+         String uri,String local,String qname ) throws SAXException {
+-            
++
+         int id = _source.replace(this,_parent);
+         _parent.onChildCompleted(result,cookie,true);
+         _source.sendLeaveAttribute(id,uri,local,qname);
+@@ -163,7 +163,7 @@
+     }
+     public void revertToParentFromText( Object result, int cookie,
+         String text ) throws SAXException {
+-            
++
+         int id = _source.replace(this,_parent);
+         _parent.onChildCompleted(result,cookie,true);
+         _source.sendText(id,text);
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/NGCCInterleaveFilter.java	Thu Jul 30 18:42:53 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/NGCCInterleaveFilter.java	Thu Jul 30 18:42:53 2009
+@@ -30,7 +30,7 @@
+ /**
+  * Dispatches incoming events into sub handlers appropriately
+  * so that the interleaving semantics will be correctly realized.
+- * 
++ *
+  * @author Kohsuke Kawaguchi (kk@kohsuke.org)
+  */
+ public abstract class NGCCInterleaveFilter implements NGCCEventSource, NGCCEventReceiver {
+@@ -38,14 +38,14 @@
+         this._parent = parent;
+         this._cookie = cookie;
+     }
+-    
++
+     protected void setHandlers( NGCCEventReceiver[] receivers ) {
+         this._receivers = receivers;
+     }
+-    
++
+     /** event receiverse. */
+     protected NGCCEventReceiver[] _receivers;
+-    
++
+     public int replace(NGCCEventReceiver oldHandler, NGCCEventReceiver newHandler) {
+         for( int i=0; i<_receivers.length; i++ )
+             if( _receivers[i]==oldHandler ) {
+@@ -86,12 +86,12 @@
+      * Nest level. Lock will be release when the lockCount becomes 0.
+      */
+     private int lockCount=0;
+-    
++
+     public void enterElement(
+         String uri, String localName, String qname,Attributes atts) throws SAXException {
+-        
++
+         if(isJoining)   return; // ignore any token if we are joining. See joinByXXXX.
+-        
++
+         if(lockCount++==0) {
+             lockedReceiver = findReceiverOfElement(uri,localName);
+             if(lockedReceiver==-1) {
+@@ -100,7 +100,7 @@
+                 return;
+             }
+         }
+-        
++
+         _receivers[lockedReceiver].enterElement(uri,localName,qname,atts);
+     }
+     public void leaveElement(String uri, String localName, String qname) throws SAXException {
+@@ -113,7 +113,7 @@
+     }
+     public void enterAttribute(String uri, String localName, String qname) throws SAXException {
+         if(isJoining)   return; // ignore any token if we are joining. See joinByXXXX.
+-        
++
+         if(lockCount++==0) {
+             lockedReceiver = findReceiverOfAttribute(uri,localName);
+             if(lockedReceiver==-1) {
+@@ -122,12 +122,12 @@
+                 return;
+             }
+         }
+-                
++
+         _receivers[lockedReceiver].enterAttribute(uri,localName,qname);
+     }
+     public void leaveAttribute(String uri, String localName, String qname) throws SAXException {
+         if(isJoining)   return; // ignore any token if we are joining. See joinByXXXX.
+-        
++
+         if( lockCount-- == 0 )
+             joinByLeaveAttribute(null,uri,localName,qname);
+         else
+@@ -135,7 +135,7 @@
+     }
+     public void text(String value) throws SAXException {
+         if(isJoining)   return; // ignore any token if we are joining. See joinByXXXX.
+-        
++
+         if(lockCount!=0)
+             _receivers[lockedReceiver].text(value);
+         else {
+@@ -150,18 +150,18 @@
+     /**
+      * Implemented by the generated code to determine the handler
+      * that can receive the given element.
+-     * 
++     *
+      * @return
+      *      Thread ID of the receiver that can handle this event,
+      *      or -1 if none.
+      */
+     protected abstract int findReceiverOfElement( String uri, String local );
+-    
++
+     /**
+      * Returns the handler that can receive the given attribute, or null.
+      */
+     protected abstract int findReceiverOfAttribute( String uri, String local );
+-    
++
+     /**
+      * Returns the handler that can receive text events, or null.
+      */
+@@ -176,7 +176,7 @@
+ //
+ //
+ 
+-    
++
+     /**
+      * Set to true when this handler is in the process of
+      * joining all branches.
+@@ -185,16 +185,16 @@
+ 
+     /**
+      * Joins all the child receivers.
+-     * 
++     *
+      * <p>
+      * This method is called by a child receiver when it sees
+      * something that it cannot handle, or by this object itself
+      * when it sees an event that it can't process.
+-     * 
++     *
+      * <p>
+      * This method forces children to move to its final state,
+      * then revert to the parent.
+-     * 
++     *
+      * @param source
+      *      If this method is called by one of the child receivers,
+      *      the receiver object. If this method is called by itself,
+@@ -202,7 +202,7 @@
+      */
+     public void joinByEnterElement( NGCCEventReceiver source,
+         String uri, String local, String qname, Attributes atts ) throws SAXException {
+-        
++
+         if(isJoining)   return; // we are already in the process of joining. ignore.
+         isJoining = true;
+ 
+@@ -214,7 +214,7 @@
+         for( int i=0; i<_receivers.length; i++ )
+             if( _receivers[i]!=source )
+                 _receivers[i].enterElement(uri,local,qname,atts);
+-        
++
+         // revert to the parent
+         _parent._source.replace(this,_parent);
+         _parent.onChildCompleted(null,_cookie,true);
+@@ -221,10 +221,10 @@
+         // send this event to the parent
+         _parent.enterElement(uri,local,qname,atts);
+     }
+-    
++
+     public void joinByLeaveElement( NGCCEventReceiver source,
+         String uri, String local, String qname ) throws SAXException {
+-        
++
+         if(isJoining)   return; // we are already in the process of joining. ignore.
+         isJoining = true;
+ 
+@@ -236,7 +236,7 @@
+         for( int i=0; i<_receivers.length; i++ )
+             if( _receivers[i]!=source )
+                 _receivers[i].leaveElement(uri,local,qname);
+-        
++
+         // revert to the parent
+         _parent._source.replace(this,_parent);
+         _parent.onChildCompleted(null,_cookie,true);
+@@ -243,10 +243,10 @@
+         // send this event to the parent
+         _parent.leaveElement(uri,local,qname);
+     }
+-    
++
+     public void joinByEnterAttribute( NGCCEventReceiver source,
+         String uri, String local, String qname ) throws SAXException {
+-        
++
+         if(isJoining)   return; // we are already in the process of joining. ignore.
+         isJoining = true;
+ 
+@@ -258,7 +258,7 @@
+         for( int i=0; i<_receivers.length; i++ )
+             if( _receivers[i]!=source )
+                 _receivers[i].enterAttribute(uri,local,qname);
+-        
++
+         // revert to the parent
+         _parent._source.replace(this,_parent);
+         _parent.onChildCompleted(null,_cookie,true);
+@@ -265,10 +265,10 @@
+         // send this event to the parent
+         _parent.enterAttribute(uri,local,qname);
+     }
+-    
++
+     public void joinByLeaveAttribute( NGCCEventReceiver source,
+         String uri, String local, String qname ) throws SAXException {
+-        
++
+         if(isJoining)   return; // we are already in the process of joining. ignore.
+         isJoining = true;
+ 
+@@ -280,7 +280,7 @@
+         for( int i=0; i<_receivers.length; i++ )
+             if( _receivers[i]!=source )
+                 _receivers[i].leaveAttribute(uri,local,qname);
+-        
++
+         // revert to the parent
+         _parent._source.replace(this,_parent);
+         _parent.onChildCompleted(null,_cookie,true);
+@@ -287,13 +287,13 @@
+         // send this event to the parent
+         _parent.leaveAttribute(uri,local,qname);
+     }
+-    
++
+     public void joinByText( NGCCEventReceiver source,
+         String value ) throws SAXException {
+ 
+         if(isJoining)   return; // we are already in the process of joining. ignore.
+         isJoining = true;
+-        
++
+         // send special token to the rest of the branches.
+         // these branches don't understand this token, so they will
+         // try to move to a final state and send the token back to us,
+@@ -317,28 +317,28 @@
+ // event dispatching methods
+ //
+ //
+-    
++
+     public void sendEnterAttribute( int threadId,
+         String uri, String local, String qname) throws SAXException {
+-        
++
+         _receivers[threadId].enterAttribute(uri,local,qname);
+     }
+ 
+     public void sendEnterElement( int threadId,
+         String uri, String local, String qname, Attributes atts) throws SAXException {
+-        
++
+         _receivers[threadId].enterElement(uri,local,qname,atts);
+     }
+ 
+     public void sendLeaveAttribute( int threadId,
+         String uri, String local, String qname) throws SAXException {
+-        
++
+         _receivers[threadId].leaveAttribute(uri,local,qname);
+     }
+ 
+     public void sendLeaveElement( int threadId,
+         String uri, String local, String qname) throws SAXException {
+-        
++
+         _receivers[threadId].leaveElement(uri,local,qname);
+     }
+ 
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/NGCCRuntime.java	Thu Jul 30 18:42:57 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/NGCCRuntime.java	Thu Jul 30 18:42:56 2009
+@@ -37,28 +37,28 @@
+ 
+ /**
+  * Runtime Engine for RELAXNGCC execution.
+- * 
++ *
+  * This class has the following functionalities:
+- * 
++ *
+  * <ol>
+  *  <li>Managing a stack of NGCCHandler objects and
+  *      switching between them appropriately.
+- * 
++ *
+  *  <li>Keep track of all Attributes.
+- * 
++ *
+  *  <li>manage mapping between namespace URIs and prefixes.
+- * 
++ *
+  *  <li>TODO: provide support for interleaving.
+- * 
++ *
+  * @version $Id: NGCCRuntime.java,v 1.15 2002/09/29 02:55:48 okajima Exp $
+  * @author Kohsuke Kawaguchi (kk@kohsuke.org)
+  */
+ public class NGCCRuntime implements ContentHandler, NGCCEventSource {
+-    
++
+     public NGCCRuntime() {
+         reset();
+     }
+-    
++
+     /**
+      * Sets the root handler, which will be used to parse the
+      * root element.
+@@ -70,7 +70,7 @@
+      * Usually a generated class that corresponds to the &lt;start>
+      * pattern will be used as the root handler, but any NGCCHandler
+      * can be a root handler.
+-     * 
++     *
+      * @exception IllegalStateException
+      *      If this method is called but it doesn't satisfy the
+      *      pre-condition stated above.
+@@ -80,12 +80,12 @@
+             throw new IllegalStateException();
+         currentHandler = rootHandler;
+     }
+-    
+-    
++
++
+     /**
+      * Cleans up all the data structure so that the object can be reused later.
+      * Normally, applications do not need to call this method directly,
+-     * 
++     *
+      * as the runtime resets itself after the endDocument method.
+      */
+     public void reset() {
+@@ -99,30 +99,30 @@
+         redirect = null;
+         redirectionDepth = 0;
+         text = new StringBuffer();
+-        
++
+         // add a dummy attributes at the bottom as a "centinel."
+         attStack.push(new AttributesImpl());
+     }
+ 
+     // current content handler can be acccessed via set/getContentHandler.
+-    
++
+     private Locator locator;
+     public void setDocumentLocator( Locator _loc ) { this.locator=_loc; }
+     /**
+      * Gets the source location of the current event.
+-     * 
++     *
+      * <p>
+      * One can call this method from RelaxNGCC handlers to access
+-     * the line number information. Note that to 
++     * the line number information. Note that to
+      */
+     public Locator getLocator() { return locator; }
+-    
+ 
++
+     /** stack of {@link Attributes}. */
+     private final Stack attStack = new Stack();
+     /** current attributes set. always equal to attStack.peek() */
+     private AttributesImpl currentAtts;
+-    
++
+     /**
+      * Attributes that belong to the current element.
+      * <p>
+@@ -134,34 +134,34 @@
+     public Attributes getCurrentAttributes() {
+         return currentAtts;
+     }
+-    
++
+     /** accumulated text. */
+     private StringBuffer text = new StringBuffer();
+-    
+-    
+-    
+-    
++
++
++
++
+     /** The current NGCCHandler. Always equals to handlerStack.peek() */
+     private NGCCEventReceiver currentHandler;
+-    
++
+     public int replace( NGCCEventReceiver o, NGCCEventReceiver n ) {
+         if(o!=currentHandler)
+             throw new IllegalStateException();  // bug of RelaxNGCC
+         currentHandler = n;
+-        
++
+         return 0;   // we only have one thread.
+     }
+-    
++
+     /**
+      * Processes buffered text.
+-     * 
++     *
+      * This method will be called by the start/endElement event to process
+      * buffered text as a text event.
+-     * 
++     *
+      * <p>
+      * Whitespace handling is a tricky business. Consider the following
+      * schema fragment:
+-     * 
++     *
+      * <xmp>
+      * <element name="foo">
+      *   <choice>
+@@ -170,24 +170,24 @@
+      *   </choice>
+      * </element>
+      * </xmp>
+-     * 
++     *
+      * Assume we hit the following instance:
+      * <xmp>
+      * <foo> <bar/></foo>
+      * </xmp>
+-     * 
++     *
+      * Then this first space needs to be ignored (for otherwise, we will
+      * end up treating this space as the match to &lt;text/> and won't
+      * be able to process &lt;bar>.)
+-     * 
++     *
+      * Now assume the following instance:
+      * <xmp>
+      * <foo/>
+      * </xmp>
+-     * 
++     *
+      * This time, we need to treat this empty string as a text, for
+      * otherwise we won't be able to accept this instance.
+-     * 
++     *
+      * <p>
+      * This is very difficult to solve in general, but one seemingly
+      * easy solution is to use the type of next event. If a text is
+@@ -194,22 +194,22 @@
+      * followed by a start tag, it follows from the constraint on
+      * RELAX NG that that text must be either whitespaces or a match
+      * to &lt;text/>.
+-     * 
++     *
+      * <p>
+      * On the contrary, if a text is followed by a end tag, then it
+      * cannot be whitespace unless the content model can accept empty,
+      * in which case sending a text event will be harmlessly ignored
+      * by the NGCCHandler.
+-     * 
++     *
+      * <p>
+      * Thus this method take one parameter, which controls the
+      * behavior of this method.
+-     * 
++     *
+      * <p>
+      * TODO: according to the constraint of RELAX NG, if characters
+      * follow an end tag, then they must be either whitespaces or
+      * must match to &lt;text/>.
+-     * 
++     *
+      * @param   possiblyWhitespace
+      *      True if the buffered character can be ignorabale. False if
+      *      it needs to be consumed.
+@@ -219,21 +219,21 @@
+             ; // ignore. See the above javadoc comment for the description
+         else
+             currentHandler.text(text.toString());   // otherwise consume this token
+-        
++
+         // truncate StringBuffer, but avoid excessive allocation.
+         if(text.length()>1024)  text = new StringBuffer();
+         else                    text.setLength(0);
+     }
+-    
++
+     public void processList( String str ) throws SAXException {
+         StringTokenizer t = new StringTokenizer(str, " \t\r\n");
+         while(t.hasMoreTokens())
+             currentHandler.text(t.nextToken());
+     }
+-    
++
+     public void startElement(String uri, String localname, String qname, Attributes atts)
+             throws SAXException {
+-        
++
+         if(redirect!=null) {
+             redirect.startElement(uri,localname,qname,atts);
+             redirectionDepth++;
+@@ -243,14 +243,14 @@
+             currentHandler.enterElement(uri, localname, qname, atts);
+         }
+     }
+-    
++
+     /**
+      * Called by the generated handler code when an enter element
+      * event is consumed.
+-     * 
++     *
+      * <p>
+      * Pushes a new attribute set.
+-     * 
++     *
+      * <p>
+      * Note that attributes are NOT pushed at the startElement method,
+      * because the processing of the enterElement event can trigger
+@@ -265,7 +265,7 @@
+         nsEffectiveStack.push( new Integer(nsEffectivePtr) );
+         nsEffectivePtr = namespaces.size();
+     }
+-    
++
+     public void onLeaveElementConsumed(String uri, String localName, String qname) throws SAXException {
+         attStack.pop();
+         if(attStack.isEmpty())
+@@ -274,32 +274,32 @@
+             currentAtts = (AttributesImpl)attStack.peek();
+         nsEffectivePtr = ((Integer)nsEffectiveStack.pop()).intValue();
+     }
+-    
++
+     public void endElement(String uri, String localname, String qname)
+             throws SAXException {
+-        
++
+         if(redirect!=null) {
+             redirect.endElement(uri,localname,qname);
+             redirectionDepth--;
+-            
++
+             if(redirectionDepth!=0)
+                 return;
+-                
++
+             // finished redirection.
+             for( int i=0; i<namespaces.size(); i+=2 )
+                 redirect.endPrefixMapping((String)namespaces.get(i));
+             redirect.endDocument();
+-            
++
+             redirect = null;
+             // then process this element normally
+         }
+-        
++
+         processPendingText(false);
+-        
++
+         currentHandler.leaveElement(uri, localname, qname);
+ //        System.out.println("endElement:"+localname);
+     }
+-    
++
+     public void characters(char[] ch, int start, int length) throws SAXException {
+         if(redirect!=null)
+             redirect.characters(ch,start,length);
+@@ -312,7 +312,7 @@
+         else
+             text.append(ch,start,length);
+     }
+-    
++
+     public int getAttributeIndex(String uri, String localname) {
+         return currentAtts.getIndex(uri, localname);
+     }
+@@ -322,7 +322,7 @@
+         final String qname  = currentAtts.getQName(index);
+         final String value  = currentAtts.getValue(index);
+         currentAtts.removeAttribute(index);
+-        
++
+         currentHandler.enterAttribute(uri,local,qname);
+         currentHandler.text(value);
+         currentHandler.leaveAttribute(uri,local,qname);
+@@ -337,7 +337,7 @@
+             namespaces.add(uri);
+         }
+     }
+-    
++
+     public void endPrefixMapping( String prefix ) throws SAXException {
+         if(redirect!=null)
+             redirect.endPrefixMapping(prefix);
+@@ -346,20 +346,20 @@
+             namespaces.remove(namespaces.size()-1);
+         }
+     }
+-    
++
+     public void skippedEntity( String name ) throws SAXException {
+         if(redirect!=null)
+             redirect.skippedEntity(name);
+     }
+-    
++
+     public void processingInstruction( String target, String data ) throws SAXException {
+         if(redirect!=null)
+             redirect.processingInstruction(target,data);
+     }
+-    
++
+     /** Impossible token. This value can never be a valid XML name. */
+     static final String IMPOSSIBLE = "\u0000";
+-    
++
+     public void endDocument() throws SAXException {
+         // consume the special "end document" token so that all the handlers
+         // currently at the stack will revert to their respective parents.
+@@ -373,10 +373,10 @@
+         // With this grammar, when the endElement event is consumed, two handlers
+         // are on the stack (because a child object won't revert to its parent
+         // unless it sees a next event.)
+-        
++
+         // pass around an "impossible" token.
+         currentHandler.leaveElement(IMPOSSIBLE,IMPOSSIBLE,IMPOSSIBLE);
+-        
++
+         reset();
+     }
+     public void startDocument() {}
+@@ -389,28 +389,28 @@
+ // event dispatching methods
+ //
+ //
+-    
++
+     public void sendEnterAttribute( int threadId,
+         String uri, String local, String qname) throws SAXException {
+-        
++
+         currentHandler.enterAttribute(uri,local,qname);
+     }
+ 
+     public void sendEnterElement( int threadId,
+         String uri, String local, String qname, Attributes atts) throws SAXException {
+-        
++
+         currentHandler.enterElement(uri,local,qname,atts);
+     }
+ 
+     public void sendLeaveAttribute( int threadId,
+         String uri, String local, String qname) throws SAXException {
+-        
++
+         currentHandler.leaveAttribute(uri,local,qname);
+     }
+ 
+     public void sendLeaveElement( int threadId,
+         String uri, String local, String qname) throws SAXException {
+-        
++
+         currentHandler.leaveElement(uri,local,qname);
+     }
+ 
+@@ -426,7 +426,7 @@
+ //
+     /** When redirecting a sub-tree, this value will be non-null. */
+     private ContentHandler redirect = null;
+-    
++
+     /**
+      * Counts the depth of the elements when we are re-directing
+      * a sub-tree to another ContentHandler.
+@@ -437,11 +437,11 @@
+      * This method can be called only from the enterElement handler.
+      * The sub-tree rooted at the new element will be redirected
+      * to the specified ContentHandler.
+-     * 
++     *
+      * <p>
+      * Currently active NGCCHandler will only receive the leaveElement
+      * event of the newly started element.
+-     * 
++     *
+      * @param   uri,local,qname
+      *      Parameters passed to the enter element event. Used to
+      *      simulate the startElement event for the new ContentHandler.
+@@ -448,11 +448,11 @@
+      */
+     public void redirectSubtree( ContentHandler child,
+         String uri, String local, String qname ) throws SAXException {
+-        
++
+         redirect = child;
+         redirect.setDocumentLocator(locator);
+         redirect.startDocument();
+-        
++
+         // TODO: when a prefix is re-bound to something else,
+         // the following code is potentially dangerous. It should be
+         // modified to report active bindings only.
+@@ -461,7 +461,7 @@
+                 (String)namespaces.get(i),
+                 (String)namespaces.get(i+1)
+             );
+-        
++
+         redirect.startElement(uri,local,qname,currentAtts);
+         redirectionDepth=1;
+     }
+@@ -495,17 +495,17 @@
+      * namespace bindings declared on "bob".
+      */
+     private int nsEffectivePtr=0;
+-    
++
+     /**
+      * Stack to preserve old nsEffectivePtr values.
+      */
+     private final Stack nsEffectiveStack = new Stack();
+-    
++
+     public String resolveNamespacePrefix( String prefix ) {
+         for( int i = nsEffectivePtr-2; i>=0; i-=2 )
+             if( namespaces.get(i).equals(prefix) )
+                 return (String)namespaces.get(i+1);
+-        
++
+         // no binding was found.
+         if(prefix.equals(""))   return "";  // return the default no-namespace
+         if(prefix.equals("xml"))    // pre-defined xml prefix
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/Schema.java	Thu Jul 30 18:43:01 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/Schema.java	Thu Jul 30 18:43:00 2009
+@@ -39,9 +39,9 @@
+     import org.xml.sax.ContentHandler;
+     import org.xml.sax.helpers.*;
+     import java.util.*;
+-  
+ 
+ 
++
+ public class Schema extends NGCCHandler {
+     private Integer finalDefault;
+     private boolean efd;
+@@ -152,7 +152,7 @@
+ 
+     private void action15()throws SAXException {
+         Attributes test = $runtime.getCurrentAttributes();
+-    	String tns = test.getValue("targetNamespace");
++        String tns = test.getValue("targetNamespace");
+ 
+       if(!includeMode) {
+         // importing
+@@ -165,7 +165,7 @@
+         }
+       } else {
+         // including
+-        
++
+         // check the consistency of @targetNamespace.
+         // @targetNamespace must be null or equal to the target namespace of the schema
+         if(tns!=null && expectedNamespace!=null && !expectedNamespace.equals(tns)) {
+@@ -175,7 +175,7 @@
+         if(tns==null)
+           $runtime.chameleonMode = true;
+       }
+-      
++
+       // multiple inclusion test.
+       if( $runtime.hasAlreadyBeenRead() ) {
+           // skip this document
+@@ -182,7 +182,7 @@
+           $runtime.redirectSubtree(new DefaultHandler(),"","","" );
+           return;
+       }
+-        
++
+       anno = (AnnotationImpl)$runtime.currentSchema.getAnnotation();
+       $runtime.blockDefault = 0;
+       $runtime.finalDefault = 0;
+@@ -194,30 +194,51 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
+-        case 41:
++        case 16:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","blockDefault"))>=0) {
++                if(($ai = $runtime.getAttributeIndex("","default"))>=0) {
+                     $runtime.consumeAttribute($ai);
+                     $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+-                    $_ngcc_current_state = 37;
++                    $_ngcc_current_state = 12;
+                     $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                 }
+             }
+             break;
+-        case 16:
++        case 11:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","default"))>=0) {
+-                    $runtime.consumeAttribute($ai);
+-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
++                if((($ai = $runtime.getAttributeIndex("","name"))>=0 || ($ai = $runtime.getAttributeIndex("","form"))>=0)) {
++                    NGCCHandler h = new attributeDeclBody(this, super._source, $runtime, 24, locator,false,defaultValue,fixedValue);
++                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+-                    $_ngcc_current_state = 12;
+-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
++                    unexpectedEnterElement($__qname);
+                 }
+             }
+             break;
++        case 36:
++            {
++                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("import")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("redefine")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("include")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("notation")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute"))))))))))))) {
++                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 130, null);
++                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
++                }
++                else {
++                    unexpectedEnterElement($__qname);
++                }
++            }
++            break;
++        case 27:
++            {
++                if((($ai = $runtime.getAttributeIndex("","default"))>=0 || (($ai = $runtime.getAttributeIndex("","block"))>=0 || (($ai = $runtime.getAttributeIndex("","fixed"))>=0 || (($ai = $runtime.getAttributeIndex("","form"))>=0 || (($ai = $runtime.getAttributeIndex("","final"))>=0 || (($ai = $runtime.getAttributeIndex("","abstract"))>=0 || ($ai = $runtime.getAttributeIndex("","name"))>=0))))))) {
++                    NGCCHandler h = new elementDeclBody(this, super._source, $runtime, 42, locator,true);
++                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
++                }
++                else {
++                    unexpectedEnterElement($__qname);
++                }
++            }
++            break;
+         case 45:
+             {
+                 if(($ai = $runtime.getAttributeIndex("","elementFormDefault"))>=0) {
+@@ -230,23 +251,42 @@
+                 }
+             }
+             break;
+-        case 0:
++        case 41:
+             {
+-                revertToParentFromEnterElement(this, super._cookie, $__uri, $__local, $__qname, $attrs);
++                if(($ai = $runtime.getAttributeIndex("","blockDefault"))>=0) {
++                    $runtime.consumeAttribute($ai);
++                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
++                }
++                else {
++                    $_ngcc_current_state = 37;
++                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
++                }
+             }
+             break;
+-        case 12:
++        case 37:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","fixed"))>=0) {
++                if(($ai = $runtime.getAttributeIndex("","finalDefault"))>=0) {
+                     $runtime.consumeAttribute($ai);
+                     $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+-                    $_ngcc_current_state = 11;
++                    $_ngcc_current_state = 36;
+                     $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                 }
+             }
+             break;
++        case 49:
++            {
++                if(($ai = $runtime.getAttributeIndex("","attributeFormDefault"))>=0) {
++                    $runtime.consumeAttribute($ai);
++                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
++                }
++                else {
++                    $_ngcc_current_state = 45;
++                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
++                }
++            }
++            break;
+         case 53:
+             {
+                 if(($ai = $runtime.getAttributeIndex("","targetNamespace"))>=0) {
+@@ -259,25 +299,37 @@
+                 }
+             }
+             break;
++        case 12:
++            {
++                if(($ai = $runtime.getAttributeIndex("","fixed"))>=0) {
++                    $runtime.consumeAttribute($ai);
++                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
++                }
++                else {
++                    $_ngcc_current_state = 11;
++                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
++                }
++            }
++            break;
+         case 2:
+             {
+                 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
+-                    NGCCHandler h = new annotation(this, super._source, $runtime, 376, anno,AnnotationContext.SCHEMA);
++                    NGCCHandler h = new annotation(this, super._source, $runtime, 118, anno,AnnotationContext.SCHEMA);
+                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+                     if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("include"))) {
+-                        NGCCHandler h = new includeDecl(this, super._source, $runtime, 377);
++                        NGCCHandler h = new includeDecl(this, super._source, $runtime, 119);
+                         spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                     }
+                     else {
+                         if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("import"))) {
+-                            NGCCHandler h = new importDecl(this, super._source, $runtime, 378);
++                            NGCCHandler h = new importDecl(this, super._source, $runtime, 120);
+                             spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                         }
+                         else {
+                             if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("redefine"))) {
+-                                NGCCHandler h = new redefine(this, super._source, $runtime, 379);
++                                NGCCHandler h = new redefine(this, super._source, $runtime, 121);
+                                 spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                             }
+                             else {
+@@ -288,12 +340,12 @@
+                                 }
+                                 else {
+                                     if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))) {
+-                                        NGCCHandler h = new simpleType(this, super._source, $runtime, 381);
++                                        NGCCHandler h = new simpleType(this, super._source, $runtime, 123);
+                                         spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                                     }
+                                     else {
+                                         if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) {
+-                                            NGCCHandler h = new complexType(this, super._source, $runtime, 382);
++                                            NGCCHandler h = new complexType(this, super._source, $runtime, 124);
+                                             spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                                         }
+                                         else {
+@@ -304,17 +356,17 @@
+                                             }
+                                             else {
+                                                 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group"))) {
+-                                                    NGCCHandler h = new group(this, super._source, $runtime, 384);
++                                                    NGCCHandler h = new group(this, super._source, $runtime, 126);
+                                                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                                                 }
+                                                 else {
+                                                     if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("notation"))) {
+-                                                        NGCCHandler h = new notation(this, super._source, $runtime, 385);
++                                                        NGCCHandler h = new notation(this, super._source, $runtime, 127);
+                                                         spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                                                     }
+                                                     else {
+                                                         if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup"))) {
+-                                                            NGCCHandler h = new attributeGroupDecl(this, super._source, $runtime, 386);
++                                                            NGCCHandler h = new attributeGroupDecl(this, super._source, $runtime, 128);
+                                                             spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                                                         }
+                                                         else {
+@@ -333,28 +385,11 @@
+                 }
+             }
+             break;
+-        case 27:
++        case 0:
+             {
+-                if((($ai = $runtime.getAttributeIndex("","default"))>=0 || (($ai = $runtime.getAttributeIndex("","block"))>=0 || (($ai = $runtime.getAttributeIndex("","fixed"))>=0 || (($ai = $runtime.getAttributeIndex("","name"))>=0 || (($ai = $runtime.getAttributeIndex("","form"))>=0 || (($ai = $runtime.getAttributeIndex("","abstract"))>=0 || ($ai = $runtime.getAttributeIndex("","final"))>=0))))))) {
+-                    NGCCHandler h = new elementDeclBody(this, super._source, $runtime, 300, locator,true);
+-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+-                }
+-                else {
+-                    unexpectedEnterElement($__qname);
+-                }
++                revertToParentFromEnterElement(this, super._cookie, $__uri, $__local, $__qname, $attrs);
+             }
+             break;
+-        case 11:
+-            {
+-                if((($ai = $runtime.getAttributeIndex("","form"))>=0 || ($ai = $runtime.getAttributeIndex("","name"))>=0)) {
+-                    NGCCHandler h = new attributeDeclBody(this, super._source, $runtime, 282, locator,false,defaultValue,fixedValue);
+-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+-                }
+-                else {
+-                    unexpectedEnterElement($__qname);
+-                }
+-            }
+-            break;
+         case 57:
+             {
+                 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("schema"))) {
+@@ -370,22 +405,22 @@
+         case 1:
+             {
+                 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
+-                    NGCCHandler h = new annotation(this, super._source, $runtime, 365, anno,AnnotationContext.SCHEMA);
++                    NGCCHandler h = new annotation(this, super._source, $runtime, 107, anno,AnnotationContext.SCHEMA);
+                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+                     if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("include"))) {
+-                        NGCCHandler h = new includeDecl(this, super._source, $runtime, 366);
++                        NGCCHandler h = new includeDecl(this, super._source, $runtime, 108);
+                         spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                     }
+                     else {
+                         if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("import"))) {
+-                            NGCCHandler h = new importDecl(this, super._source, $runtime, 367);
++                            NGCCHandler h = new importDecl(this, super._source, $runtime, 109);
+                             spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                         }
+                         else {
+                             if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("redefine"))) {
+-                                NGCCHandler h = new redefine(this, super._source, $runtime, 368);
++                                NGCCHandler h = new redefine(this, super._source, $runtime, 110);
+                                 spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                             }
+                             else {
+@@ -396,12 +431,12 @@
+                                 }
+                                 else {
+                                     if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))) {
+-                                        NGCCHandler h = new simpleType(this, super._source, $runtime, 370);
++                                        NGCCHandler h = new simpleType(this, super._source, $runtime, 112);
+                                         spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                                     }
+                                     else {
+                                         if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) {
+-                                            NGCCHandler h = new complexType(this, super._source, $runtime, 371);
++                                            NGCCHandler h = new complexType(this, super._source, $runtime, 113);
+                                             spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                                         }
+                                         else {
+@@ -412,17 +447,17 @@
+                                             }
+                                             else {
+                                                 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group"))) {
+-                                                    NGCCHandler h = new group(this, super._source, $runtime, 373);
++                                                    NGCCHandler h = new group(this, super._source, $runtime, 115);
+                                                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                                                 }
+                                                 else {
+                                                     if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("notation"))) {
+-                                                        NGCCHandler h = new notation(this, super._source, $runtime, 374);
++                                                        NGCCHandler h = new notation(this, super._source, $runtime, 116);
+                                                         spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                                                     }
+                                                     else {
+                                                         if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup"))) {
+-                                                            NGCCHandler h = new attributeGroupDecl(this, super._source, $runtime, 375);
++                                                            NGCCHandler h = new attributeGroupDecl(this, super._source, $runtime, 117);
+                                                             spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                                                         }
+                                                         else {
+@@ -440,41 +475,6 @@
+                 }
+             }
+             break;
+-        case 49:
+-            {
+-                if(($ai = $runtime.getAttributeIndex("","attributeFormDefault"))>=0) {
+-                    $runtime.consumeAttribute($ai);
+-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+-                }
+-                else {
+-                    $_ngcc_current_state = 45;
+-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+-                }
+-            }
+-            break;
+-        case 36:
+-            {
+-                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("import")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("include")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("notation")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("redefine")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))))))))))))) {
+-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 388, null);
+-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+-                }
+-                else {
+-                    unexpectedEnterElement($__qname);
+-                }
+-            }
+-            break;
+-        case 37:
+-            {
+-                if(($ai = $runtime.getAttributeIndex("","finalDefault"))>=0) {
+-                    $runtime.consumeAttribute($ai);
+-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+-                }
+-                else {
+-                    $_ngcc_current_state = 36;
+-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+-                }
+-            }
+-            break;
+         default:
+             {
+                 unexpectedEnterElement($__qname);
+@@ -489,18 +489,6 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
+-        case 41:
+-            {
+-                if(($ai = $runtime.getAttributeIndex("","blockDefault"))>=0) {
+-                    $runtime.consumeAttribute($ai);
+-                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+-                }
+-                else {
+-                    $_ngcc_current_state = 37;
+-                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+-                }
+-            }
+-            break;
+         case 16:
+             {
+                 if(($ai = $runtime.getAttributeIndex("","default"))>=0) {
+@@ -513,57 +501,43 @@
+                 }
+             }
+             break;
+-        case 45:
++        case 11:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","elementFormDefault"))>=0) {
+-                    $runtime.consumeAttribute($ai);
+-                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
++                if(((($ai = $runtime.getAttributeIndex("","name"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute"))) || (($ai = $runtime.getAttributeIndex("","form"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute"))))) {
++                    NGCCHandler h = new attributeDeclBody(this, super._source, $runtime, 24, locator,false,defaultValue,fixedValue);
++                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
+                 }
+                 else {
+-                    $_ngcc_current_state = 41;
+-                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
++                    unexpectedLeaveElement($__qname);
+                 }
+             }
+             break;
+-        case 0:
++        case 36:
+             {
+-                revertToParentFromLeaveElement(this, super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+-        case 12:
+-            {
+-                if(($ai = $runtime.getAttributeIndex("","fixed"))>=0) {
+-                    $runtime.consumeAttribute($ai);
+-                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
++                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("schema"))) {
++                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 130, null);
++                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
+                 }
+                 else {
+-                    $_ngcc_current_state = 11;
+-                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
++                    unexpectedLeaveElement($__qname);
+                 }
+             }
+             break;
+-        case 53:
++        case 10:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","targetNamespace"))>=0) {
+-                    $runtime.consumeAttribute($ai);
+-                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
++                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute"))) {
++                    $runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
++                    $_ngcc_current_state = 1;
+                 }
+                 else {
+-                    $_ngcc_current_state = 49;
+-                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
++                    unexpectedLeaveElement($__qname);
+                 }
+             }
+             break;
+-        case 2:
+-            {
+-                $_ngcc_current_state = 1;
+-                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+         case 27:
+             {
+-                if(((($ai = $runtime.getAttributeIndex("","default"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || ((($ai = $runtime.getAttributeIndex("","block"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || ((($ai = $runtime.getAttributeIndex("","fixed"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || ((($ai = $runtime.getAttributeIndex("","name"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || ((($ai = $runtime.getAttributeIndex("","form"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || ((($ai = $runtime.getAttributeIndex("","abstract"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || (($ai = $runtime.getAttributeIndex("","final"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element")))))))))) {
+-                    NGCCHandler h = new elementDeclBody(this, super._source, $runtime, 300, locator,true);
++                if(((($ai = $runtime.getAttributeIndex("","default"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || ((($ai = $runtime.getAttributeIndex("","block"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || ((($ai = $runtime.getAttributeIndex("","fixed"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || ((($ai = $runtime.getAttributeIndex("","form"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || ((($ai = $runtime.getAttributeIndex("","final"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || ((($ai = $runtime.getAttributeIndex("","abstract"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || (($ai = $runtime.getAttributeIndex("","name"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element")))))))))) {
++                    NGCCHandler h = new elementDeclBody(this, super._source, $runtime, 42, locator,true);
+                     spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
+                 }
+                 else {
+@@ -571,36 +545,39 @@
+                 }
+             }
+             break;
+-        case 11:
++        case 45:
+             {
+-                if(((($ai = $runtime.getAttributeIndex("","form"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute"))) || (($ai = $runtime.getAttributeIndex("","name"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute"))))) {
+-                    NGCCHandler h = new attributeDeclBody(this, super._source, $runtime, 282, locator,false,defaultValue,fixedValue);
+-                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
++                if(($ai = $runtime.getAttributeIndex("","elementFormDefault"))>=0) {
++                    $runtime.consumeAttribute($ai);
++                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                 }
+                 else {
+-                    unexpectedLeaveElement($__qname);
++                    $_ngcc_current_state = 41;
++                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                 }
+             }
+             break;
+-        case 10:
++        case 41:
+             {
+-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute"))) {
+-                    $runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
+-                    $_ngcc_current_state = 1;
++                if(($ai = $runtime.getAttributeIndex("","blockDefault"))>=0) {
++                    $runtime.consumeAttribute($ai);
++                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                 }
+                 else {
+-                    unexpectedLeaveElement($__qname);
++                    $_ngcc_current_state = 37;
++                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                 }
+             }
+             break;
+-        case 1:
++        case 37:
+             {
+-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("schema"))) {
+-                    $runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
+-                    $_ngcc_current_state = 0;
++                if(($ai = $runtime.getAttributeIndex("","finalDefault"))>=0) {
++                    $runtime.consumeAttribute($ai);
++                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                 }
+                 else {
+-                    unexpectedLeaveElement($__qname);
++                    $_ngcc_current_state = 36;
++                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                 }
+             }
+             break;
+@@ -616,34 +593,57 @@
+                 }
+             }
+             break;
+-        case 36:
++        case 53:
+             {
+-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("schema"))) {
+-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 388, null);
+-                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
++                if(($ai = $runtime.getAttributeIndex("","targetNamespace"))>=0) {
++                    $runtime.consumeAttribute($ai);
++                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                 }
+                 else {
++                    $_ngcc_current_state = 49;
++                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
++                }
++            }
++            break;
++        case 26:
++            {
++                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) {
++                    $runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
++                    $_ngcc_current_state = 1;
++                }
++                else {
+                     unexpectedLeaveElement($__qname);
+                 }
+             }
+             break;
+-        case 37:
++        case 12:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","finalDefault"))>=0) {
++                if(($ai = $runtime.getAttributeIndex("","fixed"))>=0) {
+                     $runtime.consumeAttribute($ai);
+                     $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                 }
+                 else {
+-                    $_ngcc_current_state = 36;
++                    $_ngcc_current_state = 11;
+                     $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                 }
+             }
+             break;
+-        case 26:
++        case 2:
+             {
+-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) {
++                $_ngcc_current_state = 1;
++                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
++            }
++            break;
++        case 0:
++            {
++                revertToParentFromLeaveElement(this, super._cookie, $__uri, $__local, $__qname);
++            }
++            break;
++        case 1:
++            {
++                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("schema"))) {
+                     $runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
+-                    $_ngcc_current_state = 1;
++                    $_ngcc_current_state = 0;
+                 }
+                 else {
+                     unexpectedLeaveElement($__qname);
+@@ -664,62 +664,68 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
+-        case 41:
++        case 37:
+             {
+-                if(($__uri.equals("") && $__local.equals("blockDefault"))) {
+-                    $_ngcc_current_state = 43;
++                if(($__uri.equals("") && $__local.equals("finalDefault"))) {
++                    $_ngcc_current_state = 39;
+                 }
+                 else {
+-                    $_ngcc_current_state = 37;
++                    $_ngcc_current_state = 36;
+                     $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+                 }
+             }
+             break;
+-        case 45:
++        case 16:
+             {
+-                if(($__uri.equals("") && $__local.equals("elementFormDefault"))) {
+-                    $_ngcc_current_state = 47;
++                if(($__uri.equals("") && $__local.equals("default"))) {
++                    $_ngcc_current_state = 18;
+                 }
+                 else {
+-                    $_ngcc_current_state = 41;
++                    $_ngcc_current_state = 12;
+                     $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+                 }
+             }
+             break;
+-        case 16:
++        case 11:
+             {
+-                if(($__uri.equals("") && $__local.equals("default"))) {
+-                    $_ngcc_current_state = 18;
++                if((($__uri.equals("") && $__local.equals("name")) || ($__uri.equals("") && $__local.equals("form")))) {
++                    NGCCHandler h = new attributeDeclBody(this, super._source, $runtime, 24, locator,false,defaultValue,fixedValue);
++                    spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
+                 }
+                 else {
+-                    $_ngcc_current_state = 12;
+-                    $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
++                    unexpectedEnterAttribute($__qname);
+                 }
+             }
+             break;
+-        case 12:
++        case 53:
+             {
+-                if(($__uri.equals("") && $__local.equals("fixed"))) {
+-                    $_ngcc_current_state = 14;
++                if(($__uri.equals("") && $__local.equals("targetNamespace"))) {
++                    $_ngcc_current_state = 55;
+                 }
+                 else {
+-                    $_ngcc_current_state = 11;
++                    $_ngcc_current_state = 49;
+                     $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+                 }
+             }
+             break;
+-        case 0:
++        case 49:
+             {
+-                revertToParentFromEnterAttribute(this, super._cookie, $__uri, $__local, $__qname);
++                if(($__uri.equals("") && $__local.equals("attributeFormDefault"))) {
++                    $_ngcc_current_state = 51;
++                }
++                else {
++                    $_ngcc_current_state = 45;
++                    $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
++                }
+             }
+             break;
+-        case 53:
++        case 12:
+             {
+-                if(($__uri.equals("") && $__local.equals("targetNamespace"))) {
+-                    $_ngcc_current_state = 55;
++                if(($__uri.equals("") && $__local.equals("fixed"))) {
++                    $_ngcc_current_state = 14;
+                 }
+                 else {
+-                    $_ngcc_current_state = 49;
++                    $_ngcc_current_state = 11;
+                     $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+                 }
+             }
+@@ -730,10 +736,15 @@
+                 $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
++        case 0:
++            {
++                revertToParentFromEnterAttribute(this, super._cookie, $__uri, $__local, $__qname);
++            }
++            break;
+         case 27:
+             {
+-                if((($__uri.equals("") && $__local.equals("default")) || (($__uri.equals("") && $__local.equals("block")) || (($__uri.equals("") && $__local.equals("fixed")) || (($__uri.equals("") && $__local.equals("name")) || (($__uri.equals("") && $__local.equals("form")) || (($__uri.equals("") && $__local.equals("abstract")) || ($__uri.equals("") && $__local.equals("final"))))))))) {
+-                    NGCCHandler h = new elementDeclBody(this, super._source, $runtime, 300, locator,true);
++                if((($__uri.equals("") && $__local.equals("default")) || (($__uri.equals("") && $__local.equals("block")) || (($__uri.equals("") && $__local.equals("fixed")) || (($__uri.equals("") && $__local.equals("form")) || (($__uri.equals("") && $__local.equals("final")) || (($__uri.equals("") && $__local.equals("abstract")) || ($__uri.equals("") && $__local.equals("name"))))))))) {
++                    NGCCHandler h = new elementDeclBody(this, super._source, $runtime, 42, locator,true);
+                     spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
+                 }
+                 else {
+@@ -741,39 +752,28 @@
+                 }
+             }
+             break;
+-        case 49:
++        case 45:
+             {
+-                if(($__uri.equals("") && $__local.equals("attributeFormDefault"))) {
+-                    $_ngcc_current_state = 51;
++                if(($__uri.equals("") && $__local.equals("elementFormDefault"))) {
++                    $_ngcc_current_state = 47;
+                 }
+                 else {
+-                    $_ngcc_current_state = 45;
++                    $_ngcc_current_state = 41;
+                     $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+                 }
+             }
+             break;
+-        case 37:
++        case 41:
+             {
+-                if(($__uri.equals("") && $__local.equals("finalDefault"))) {
+-                    $_ngcc_current_state = 39;
++                if(($__uri.equals("") && $__local.equals("blockDefault"))) {
++                    $_ngcc_current_state = 43;
+                 }
+                 else {
+-                    $_ngcc_current_state = 36;
++                    $_ngcc_current_state = 37;
+                     $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+                 }
+             }
+             break;
+-        case 11:
+-            {
+-                if((($__uri.equals("") && $__local.equals("form")) || ($__uri.equals("") && $__local.equals("name")))) {
+-                    NGCCHandler h = new attributeDeclBody(this, super._source, $runtime, 282, locator,false,defaultValue,fixedValue);
+-                    spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
+-                }
+-                else {
+-                    unexpectedEnterAttribute($__qname);
+-                }
+-            }
+-            break;
+         default:
+             {
+                 unexpectedEnterAttribute($__qname);
+@@ -788,16 +788,20 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
+-        case 41:
++        case 16:
+             {
+-                $_ngcc_current_state = 37;
++                $_ngcc_current_state = 12;
+                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 16:
++        case 17:
+             {
+-                $_ngcc_current_state = 12;
+-                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
++                if(($__uri.equals("") && $__local.equals("default"))) {
++                    $_ngcc_current_state = 12;
++                }
++                else {
++                    unexpectedLeaveAttribute($__qname);
++                }
+             }
+             break;
+         case 45:
+@@ -806,33 +810,26 @@
+                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 0:
++        case 13:
+             {
+-                revertToParentFromLeaveAttribute(this, super._cookie, $__uri, $__local, $__qname);
++                if(($__uri.equals("") && $__local.equals("fixed"))) {
++                    $_ngcc_current_state = 11;
++                }
++                else {
++                    unexpectedLeaveAttribute($__qname);
++                }
+             }
+             break;
+-        case 12:
++        case 41:
+             {
+-                $_ngcc_current_state = 11;
++                $_ngcc_current_state = 37;
+                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 53:
++        case 46:
+             {
+-                $_ngcc_current_state = 49;
+-                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+-        case 2:
+-            {
+-                $_ngcc_current_state = 1;
+-                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+-        case 50:
+-            {
+-                if(($__uri.equals("") && $__local.equals("attributeFormDefault"))) {
+-                    $_ngcc_current_state = 45;
++                if(($__uri.equals("") && $__local.equals("elementFormDefault"))) {
++                    $_ngcc_current_state = 41;
+                 }
+                 else {
+                     unexpectedLeaveAttribute($__qname);
+@@ -839,6 +836,12 @@
+                 }
+             }
+             break;
++        case 37:
++            {
++                $_ngcc_current_state = 36;
++                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
++            }
++            break;
+         case 54:
+             {
+                 if(($__uri.equals("") && $__local.equals("targetNamespace"))) {
+@@ -849,16 +852,18 @@
+                 }
+             }
+             break;
+-        case 38:
++        case 49:
+             {
+-                if(($__uri.equals("") && $__local.equals("finalDefault"))) {
+-                    $_ngcc_current_state = 36;
+-                }
+-                else {
+-                    unexpectedLeaveAttribute($__qname);
+-                }
++                $_ngcc_current_state = 45;
++                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
++        case 53:
++            {
++                $_ngcc_current_state = 49;
++                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
++            }
++            break;
+         case 42:
+             {
+                 if(($__uri.equals("") && $__local.equals("blockDefault"))) {
+@@ -869,10 +874,10 @@
+                 }
+             }
+             break;
+-        case 17:
++        case 38:
+             {
+-                if(($__uri.equals("") && $__local.equals("default"))) {
+-                    $_ngcc_current_state = 12;
++                if(($__uri.equals("") && $__local.equals("finalDefault"))) {
++                    $_ngcc_current_state = 36;
+                 }
+                 else {
+                     unexpectedLeaveAttribute($__qname);
+@@ -879,22 +884,22 @@
+                 }
+             }
+             break;
+-        case 49:
++        case 12:
+             {
+-                $_ngcc_current_state = 45;
++                $_ngcc_current_state = 11;
+                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 37:
++        case 2:
+             {
+-                $_ngcc_current_state = 36;
++                $_ngcc_current_state = 1;
+                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 13:
++        case 50:
+             {
+-                if(($__uri.equals("") && $__local.equals("fixed"))) {
+-                    $_ngcc_current_state = 11;
++                if(($__uri.equals("") && $__local.equals("attributeFormDefault"))) {
++                    $_ngcc_current_state = 45;
+                 }
+                 else {
+                     unexpectedLeaveAttribute($__qname);
+@@ -901,14 +906,9 @@
+                 }
+             }
+             break;
+-        case 46:
++        case 0:
+             {
+-                if(($__uri.equals("") && $__local.equals("elementFormDefault"))) {
+-                    $_ngcc_current_state = 41;
+-                }
+-                else {
+-                    unexpectedLeaveAttribute($__qname);
+-                }
++                revertToParentFromLeaveAttribute(this, super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+         default:
+@@ -922,24 +922,6 @@
+     public void text(String $value) throws SAXException {
+         int $ai;
+         switch($_ngcc_current_state) {
+-        case 41:
+-            {
+-                if(($ai = $runtime.getAttributeIndex("","blockDefault"))>=0) {
+-                    $runtime.consumeAttribute($ai);
+-                    $runtime.sendText(super._cookie, $value);
+-                }
+-                else {
+-                    $_ngcc_current_state = 37;
+-                    $runtime.sendText(super._cookie, $value);
+-                }
+-            }
+-            break;
+-        case 39:
+-            {
+-                NGCCHandler h = new erSet(this, super._source, $runtime, 390);
+-                spawnChildFromText(h, $value);
+-            }
+-            break;
+         case 16:
+             {
+                 if(($ai = $runtime.getAttributeIndex("","default"))>=0) {
+@@ -952,107 +934,74 @@
+                 }
+             }
+             break;
+-        case 45:
++        case 47:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","elementFormDefault"))>=0) {
+-                    $runtime.consumeAttribute($ai);
+-                    $runtime.sendText(super._cookie, $value);
+-                }
+-                else {
+-                    $_ngcc_current_state = 41;
+-                    $runtime.sendText(super._cookie, $value);
+-                }
+-            }
+-            break;
+-        case 51:
+-            {
+                 if($value.equals("unqualified")) {
+-                    NGCCHandler h = new qualification(this, super._source, $runtime, 405);
++                    NGCCHandler h = new qualification(this, super._source, $runtime, 142);
+                     spawnChildFromText(h, $value);
+                 }
+                 else {
+                     if($value.equals("qualified")) {
+-                        NGCCHandler h = new qualification(this, super._source, $runtime, 405);
++                        NGCCHandler h = new qualification(this, super._source, $runtime, 142);
+                         spawnChildFromText(h, $value);
+                     }
+                 }
+             }
+             break;
+-        case 18:
++        case 11:
+             {
+-                defaultValue = $value;
+-                $_ngcc_current_state = 17;
+-            }
+-            break;
+-        case 0:
+-            {
+-                revertToParentFromText(this, super._cookie, $value);
+-            }
+-            break;
+-        case 12:
+-            {
+-                if(($ai = $runtime.getAttributeIndex("","fixed"))>=0) {
+-                    $runtime.consumeAttribute($ai);
+-                    $runtime.sendText(super._cookie, $value);
++                if(($ai = $runtime.getAttributeIndex("","form"))>=0) {
++                    NGCCHandler h = new attributeDeclBody(this, super._source, $runtime, 24, locator,false,defaultValue,fixedValue);
++                    spawnChildFromText(h, $value);
+                 }
+                 else {
+-                    $_ngcc_current_state = 11;
+-                    $runtime.sendText(super._cookie, $value);
++                    if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
++                        NGCCHandler h = new attributeDeclBody(this, super._source, $runtime, 24, locator,false,defaultValue,fixedValue);
++                        spawnChildFromText(h, $value);
++                    }
+                 }
+             }
+             break;
+-        case 53:
++        case 14:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","targetNamespace"))>=0) {
+-                    $runtime.consumeAttribute($ai);
+-                    $runtime.sendText(super._cookie, $value);
+-                }
+-                else {
+-                    $_ngcc_current_state = 49;
+-                    $runtime.sendText(super._cookie, $value);
+-                }
++                fixedValue = $value;
++                $_ngcc_current_state = 13;
+             }
+             break;
+-        case 2:
+-            {
+-                $_ngcc_current_state = 1;
+-                $runtime.sendText(super._cookie, $value);
+-            }
+-            break;
+         case 27:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","final"))>=0) {
+-                    NGCCHandler h = new elementDeclBody(this, super._source, $runtime, 300, locator,true);
++                if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
++                    NGCCHandler h = new elementDeclBody(this, super._source, $runtime, 42, locator,true);
+                     spawnChildFromText(h, $value);
+                 }
+                 else {
+                     if(($ai = $runtime.getAttributeIndex("","abstract"))>=0) {
+-                        NGCCHandler h = new elementDeclBody(this, super._source, $runtime, 300, locator,true);
++                        NGCCHandler h = new elementDeclBody(this, super._source, $runtime, 42, locator,true);
+                         spawnChildFromText(h, $value);
+                     }
+                     else {
+-                        if(($ai = $runtime.getAttributeIndex("","form"))>=0) {
+-                            NGCCHandler h = new elementDeclBody(this, super._source, $runtime, 300, locator,true);
++                        if(($ai = $runtime.getAttributeIndex("","final"))>=0) {
++                            NGCCHandler h = new elementDeclBody(this, super._source, $runtime, 42, locator,true);
+                             spawnChildFromText(h, $value);
+                         }
+                         else {
+-                            if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
+-                                NGCCHandler h = new elementDeclBody(this, super._source, $runtime, 300, locator,true);
++                            if(($ai = $runtime.getAttributeIndex("","form"))>=0) {
++                                NGCCHandler h = new elementDeclBody(this, super._source, $runtime, 42, locator,true);
+                                 spawnChildFromText(h, $value);
+                             }
+                             else {
+                                 if(($ai = $runtime.getAttributeIndex("","fixed"))>=0) {
+-                                    NGCCHandler h = new elementDeclBody(this, super._source, $runtime, 300, locator,true);
++                                    NGCCHandler h = new elementDeclBody(this, super._source, $runtime, 42, locator,true);
+                                     spawnChildFromText(h, $value);
+                                 }
+                                 else {
+                                     if(($ai = $runtime.getAttributeIndex("","block"))>=0) {
+-                                        NGCCHandler h = new elementDeclBody(this, super._source, $runtime, 300, locator,true);
++                                        NGCCHandler h = new elementDeclBody(this, super._source, $runtime, 42, locator,true);
+                                         spawnChildFromText(h, $value);
+                                     }
+                                     else {
+                                         if(($ai = $runtime.getAttributeIndex("","default"))>=0) {
+-                                            NGCCHandler h = new elementDeclBody(this, super._source, $runtime, 300, locator,true);
++                                            NGCCHandler h = new elementDeclBody(this, super._source, $runtime, 42, locator,true);
+                                             spawnChildFromText(h, $value);
+                                         }
+                                     }
+@@ -1063,51 +1012,48 @@
+                 }
+             }
+             break;
+-        case 11:
++        case 45:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
+-                    NGCCHandler h = new attributeDeclBody(this, super._source, $runtime, 282, locator,false,defaultValue,fixedValue);
+-                    spawnChildFromText(h, $value);
++                if(($ai = $runtime.getAttributeIndex("","elementFormDefault"))>=0) {
++                    $runtime.consumeAttribute($ai);
++                    $runtime.sendText(super._cookie, $value);
+                 }
+                 else {
+-                    if(($ai = $runtime.getAttributeIndex("","form"))>=0) {
+-                        NGCCHandler h = new attributeDeclBody(this, super._source, $runtime, 282, locator,false,defaultValue,fixedValue);
+-                        spawnChildFromText(h, $value);
+-                    }
++                    $_ngcc_current_state = 41;
++                    $runtime.sendText(super._cookie, $value);
+                 }
+             }
+             break;
+-        case 47:
++        case 41:
+             {
+-                if($value.equals("unqualified")) {
+-                    NGCCHandler h = new qualification(this, super._source, $runtime, 400);
+-                    spawnChildFromText(h, $value);
++                if(($ai = $runtime.getAttributeIndex("","blockDefault"))>=0) {
++                    $runtime.consumeAttribute($ai);
++                    $runtime.sendText(super._cookie, $value);
+                 }
+                 else {
+-                    if($value.equals("qualified")) {
+-                        NGCCHandler h = new qualification(this, super._source, $runtime, 400);
+-                        spawnChildFromText(h, $value);
+-                    }
++                    $_ngcc_current_state = 37;
++                    $runtime.sendText(super._cookie, $value);
+                 }
+             }
+             break;
+-        case 43:
++        case 37:
+             {
+-                NGCCHandler h = new ersSet(this, super._source, $runtime, 395);
+-                spawnChildFromText(h, $value);
++                if(($ai = $runtime.getAttributeIndex("","finalDefault"))>=0) {
++                    $runtime.consumeAttribute($ai);
++                    $runtime.sendText(super._cookie, $value);
++                }
++                else {
++                    $_ngcc_current_state = 36;
++                    $runtime.sendText(super._cookie, $value);
++                }
+             }
+             break;
+-        case 55:
++        case 43:
+             {
+-                $_ngcc_current_state = 54;
++                NGCCHandler h = new ersSet(this, super._source, $runtime, 137);
++                spawnChildFromText(h, $value);
+             }
+             break;
+-        case 14:
+-            {
+-                fixedValue = $value;
+-                $_ngcc_current_state = 13;
+-            }
+-            break;
+         case 49:
+             {
+                 if(($ai = $runtime.getAttributeIndex("","attributeFormDefault"))>=0) {
+@@ -1120,31 +1066,85 @@
+                 }
+             }
+             break;
+-        case 37:
++        case 53:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","finalDefault"))>=0) {
++                if(($ai = $runtime.getAttributeIndex("","targetNamespace"))>=0) {
+                     $runtime.consumeAttribute($ai);
+                     $runtime.sendText(super._cookie, $value);
+                 }
+                 else {
+-                    $_ngcc_current_state = 36;
++                    $_ngcc_current_state = 49;
+                     $runtime.sendText(super._cookie, $value);
+                 }
+             }
+             break;
++        case 12:
++            {
++                if(($ai = $runtime.getAttributeIndex("","fixed"))>=0) {
++                    $runtime.consumeAttribute($ai);
++                    $runtime.sendText(super._cookie, $value);
++                }
++                else {
++                    $_ngcc_current_state = 11;
++                    $runtime.sendText(super._cookie, $value);
++                }
++            }
++            break;
++        case 51:
++            {
++                if($value.equals("unqualified")) {
++                    NGCCHandler h = new qualification(this, super._source, $runtime, 147);
++                    spawnChildFromText(h, $value);
++                }
++                else {
++                    if($value.equals("qualified")) {
++                        NGCCHandler h = new qualification(this, super._source, $runtime, 147);
++                        spawnChildFromText(h, $value);
++                    }
++                }
++            }
++            break;
++        case 18:
++            {
++                defaultValue = $value;
++                $_ngcc_current_state = 17;
++            }
++            break;
++        case 2:
++            {
++                $_ngcc_current_state = 1;
++                $runtime.sendText(super._cookie, $value);
++            }
++            break;
++        case 0:
++            {
++                revertToParentFromText(this, super._cookie, $value);
++            }
++            break;
++        case 39:
++            {
++                NGCCHandler h = new erSet(this, super._source, $runtime, 132);
++                spawnChildFromText(h, $value);
++            }
++            break;
++        case 55:
++            {
++                $_ngcc_current_state = 54;
++            }
++            break;
+         }
+     }
+ 
+     public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException {
+         switch($__cookie__) {
+-        case 395:
++        case 24:
+             {
+-                blockDefault = ((Integer)$__result__);
+-                action12();
+-                $_ngcc_current_state = 42;
++                ad = ((AttributeDeclImpl)$__result__);
++                action3();
++                $_ngcc_current_state = 10;
+             }
+             break;
+-        case 388:
++        case 130:
+             {
+                 fa = ((ForeignAttributesImpl)$__result__);
+                 action10();
+@@ -1151,50 +1151,43 @@
+                 $_ngcc_current_state = 2;
+             }
+             break;
+-        case 390:
++        case 137:
+             {
++                blockDefault = ((Integer)$__result__);
++                action12();
++                $_ngcc_current_state = 42;
++            }
++            break;
++        case 132:
++            {
+                 finalDefault = ((Integer)$__result__);
+                 action11();
+                 $_ngcc_current_state = 38;
+             }
+             break;
+-        case 405:
++        case 107:
+             {
+-                afd = ((Boolean)$__result__).booleanValue();
+-                action14();
+-                $_ngcc_current_state = 50;
+-            }
+-            break;
+-        case 300:
+-            {
+-                e = ((ElementDecl)$__result__);
+-                action7();
+-                $_ngcc_current_state = 26;
+-            }
+-            break;
+-        case 376:
+-            {
+                 anno = ((AnnotationImpl)$__result__);
+                 action9();
+                 $_ngcc_current_state = 1;
+             }
+             break;
+-        case 377:
++        case 108:
+             {
+                 $_ngcc_current_state = 1;
+             }
+             break;
+-        case 378:
++        case 109:
+             {
+                 $_ngcc_current_state = 1;
+             }
+             break;
+-        case 379:
++        case 110:
+             {
+                 $_ngcc_current_state = 1;
+             }
+             break;
+-        case 381:
++        case 112:
+             {
+                 st = ((SimpleTypeImpl)$__result__);
+                 action6();
+@@ -1201,7 +1194,7 @@
+                 $_ngcc_current_state = 1;
+             }
+             break;
+-        case 382:
++        case 113:
+             {
+                 ct = ((ComplexTypeImpl)$__result__);
+                 action5();
+@@ -1208,7 +1201,7 @@
+                 $_ngcc_current_state = 1;
+             }
+             break;
+-        case 384:
++        case 115:
+             {
+                 group = ((ModelGroupDeclImpl)$__result__);
+                 action2();
+@@ -1215,7 +1208,7 @@
+                 $_ngcc_current_state = 1;
+             }
+             break;
+-        case 385:
++        case 116:
+             {
+                 notation = ((XSNotation)$__result__);
+                 action1();
+@@ -1222,7 +1215,7 @@
+                 $_ngcc_current_state = 1;
+             }
+             break;
+-        case 386:
++        case 117:
+             {
+                 ag = ((AttGroupDeclImpl)$__result__);
+                 action0();
+@@ -1229,43 +1222,50 @@
+                 $_ngcc_current_state = 1;
+             }
+             break;
+-        case 282:
++        case 142:
+             {
+-                ad = ((AttributeDeclImpl)$__result__);
+-                action3();
+-                $_ngcc_current_state = 10;
+-            }
+-            break;
+-        case 400:
+-            {
+                 efd = ((Boolean)$__result__).booleanValue();
+                 action13();
+                 $_ngcc_current_state = 46;
+             }
+             break;
+-        case 365:
++        case 147:
+             {
++                afd = ((Boolean)$__result__).booleanValue();
++                action14();
++                $_ngcc_current_state = 50;
++            }
++            break;
++        case 42:
++            {
++                e = ((ElementDecl)$__result__);
++                action7();
++                $_ngcc_current_state = 26;
++            }
++            break;
++        case 118:
++            {
+                 anno = ((AnnotationImpl)$__result__);
+                 action9();
+                 $_ngcc_current_state = 1;
+             }
+             break;
+-        case 366:
++        case 119:
+             {
+                 $_ngcc_current_state = 1;
+             }
+             break;
+-        case 367:
++        case 120:
+             {
+                 $_ngcc_current_state = 1;
+             }
+             break;
+-        case 368:
++        case 121:
+             {
+                 $_ngcc_current_state = 1;
+             }
+             break;
+-        case 370:
++        case 123:
+             {
+                 st = ((SimpleTypeImpl)$__result__);
+                 action6();
+@@ -1272,7 +1272,7 @@
+                 $_ngcc_current_state = 1;
+             }
+             break;
+-        case 371:
++        case 124:
+             {
+                 ct = ((ComplexTypeImpl)$__result__);
+                 action5();
+@@ -1279,7 +1279,7 @@
+                 $_ngcc_current_state = 1;
+             }
+             break;
+-        case 373:
++        case 126:
+             {
+                 group = ((ModelGroupDeclImpl)$__result__);
+                 action2();
+@@ -1286,7 +1286,7 @@
+                 $_ngcc_current_state = 1;
+             }
+             break;
+-        case 374:
++        case 127:
+             {
+                 notation = ((XSNotation)$__result__);
+                 action1();
+@@ -1293,7 +1293,7 @@
+                 $_ngcc_current_state = 1;
+             }
+             break;
+-        case 375:
++        case 128:
+             {
+                 ag = ((AttGroupDeclImpl)$__result__);
+                 action0();
+@@ -1307,9 +1307,8 @@
+         return(($_ngcc_current_state == 0));
+     }
+ 
+-    
++
+       private String tns=null;  // it defaults to the no namespace.
+       private Locator locator;
+-    
+-}
+ 
++}
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/SimpleType_List.java	Thu Jul 30 18:43:05 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/SimpleType_List.java	Thu Jul 30 18:43:05 2009
+@@ -37,9 +37,9 @@
+     import org.xml.sax.ContentHandler;
+     import org.xml.sax.helpers.*;
+     import java.util.*;
+-  
+ 
+ 
++
+ class SimpleType_List extends NGCCHandler {
+     private Locator locator;
+     private AnnotationImpl annotation;
+@@ -73,18 +73,18 @@
+     }
+ 
+     private void action0()throws SAXException {
+-        
+-    	result = new ListSimpleTypeImpl(
+-    		$runtime.document, annotation, locator, fa,
+-    		name, name==null, finalSet, itemType );
+-    
++
++        result = new ListSimpleTypeImpl(
++                $runtime.document, annotation, locator, fa,
++                name, name==null, finalSet, itemType );
++
+ }
+ 
+     private void action1()throws SAXException {
+-        
+-          	itemType = new DelayedRef.SimpleType(
+-          		$runtime, lloc, $runtime.currentSchema, itemTypeName);
+-          
++
++                itemType = new DelayedRef.SimpleType(
++                        $runtime, lloc, $runtime.currentSchema, itemTypeName);
++
+ }
+ 
+     private void action2()throws SAXException {
+@@ -97,17 +97,6 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
+-        case 9:
+-            {
+-                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || ((($ai = $runtime.getAttributeIndex("","itemType"))>=0 && (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))))) {
+-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 11, fa);
+-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+-                }
+-                else {
+-                    unexpectedEnterElement($__qname);
+-                }
+-            }
+-            break;
+         case 2:
+             {
+                 if(($ai = $runtime.getAttributeIndex("","itemType"))>=0) {
+@@ -116,7 +105,7 @@
+                 }
+                 else {
+                     if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))) {
+-                        NGCCHandler h = new simpleType(this, super._source, $runtime, 3);
++                        NGCCHandler h = new simpleType(this, super._source, $runtime, 166);
+                         spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                     }
+                     else {
+@@ -140,7 +129,7 @@
+         case 7:
+             {
+                 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
+-                    NGCCHandler h = new annotation(this, super._source, $runtime, 9, annotation,AnnotationContext.SIMPLETYPE_DECL);
++                    NGCCHandler h = new annotation(this, super._source, $runtime, 172, annotation,AnnotationContext.SIMPLETYPE_DECL);
+                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+@@ -154,6 +143,17 @@
+                 revertToParentFromEnterElement(result, super._cookie, $__uri, $__local, $__qname, $attrs);
+             }
+             break;
++        case 9:
++            {
++                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || ((($ai = $runtime.getAttributeIndex("","itemType"))>=0 && (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))))) {
++                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 174, fa);
++                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
++                }
++                else {
++                    unexpectedEnterElement($__qname);
++                }
++            }
++            break;
+         default:
+             {
+                 unexpectedEnterElement($__qname);
+@@ -168,17 +168,6 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
+-        case 9:
+-            {
+-                if((($ai = $runtime.getAttributeIndex("","itemType"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("list")))) {
+-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 11, fa);
+-                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
+-                }
+-                else {
+-                    unexpectedLeaveElement($__qname);
+-                }
+-            }
+-            break;
+         case 2:
+             {
+                 if(($ai = $runtime.getAttributeIndex("","itemType"))>=0) {
+@@ -213,6 +202,17 @@
+                 revertToParentFromLeaveElement(result, super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
++        case 9:
++            {
++                if((($ai = $runtime.getAttributeIndex("","itemType"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("list")))) {
++                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 174, fa);
++                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
++                }
++                else {
++                    unexpectedLeaveElement($__qname);
++                }
++            }
++            break;
+         default:
+             {
+                 unexpectedLeaveElement($__qname);
+@@ -227,17 +227,6 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
+-        case 9:
+-            {
+-                if(($__uri.equals("") && $__local.equals("itemType"))) {
+-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 11, fa);
+-                    spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
+-                }
+-                else {
+-                    unexpectedEnterAttribute($__qname);
+-                }
+-            }
+-            break;
+         case 2:
+             {
+                 if(($__uri.equals("") && $__local.equals("itemType"))) {
+@@ -259,6 +248,17 @@
+                 revertToParentFromEnterAttribute(result, super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
++        case 9:
++            {
++                if(($__uri.equals("") && $__local.equals("itemType"))) {
++                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 174, fa);
++                    spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
++                }
++                else {
++                    unexpectedEnterAttribute($__qname);
++                }
++            }
++            break;
+         default:
+             {
+                 unexpectedEnterAttribute($__qname);
+@@ -273,6 +273,16 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
++        case 4:
++            {
++                if(($__uri.equals("") && $__local.equals("itemType"))) {
++                    $_ngcc_current_state = 1;
++                }
++                else {
++                    unexpectedLeaveAttribute($__qname);
++                }
++            }
++            break;
+         case 7:
+             {
+                 $_ngcc_current_state = 2;
+@@ -284,16 +294,6 @@
+                 revertToParentFromLeaveAttribute(result, super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 4:
+-            {
+-                if(($__uri.equals("") && $__local.equals("itemType"))) {
+-                    $_ngcc_current_state = 1;
+-                }
+-                else {
+-                    unexpectedLeaveAttribute($__qname);
+-                }
+-            }
+-            break;
+         default:
+             {
+                 unexpectedLeaveAttribute($__qname);
+@@ -305,20 +305,6 @@
+     public void text(String $value) throws SAXException {
+         int $ai;
+         switch($_ngcc_current_state) {
+-        case 5:
+-            {
+-                NGCCHandler h = new qname(this, super._source, $runtime, 5);
+-                spawnChildFromText(h, $value);
+-            }
+-            break;
+-        case 9:
+-            {
+-                if(($ai = $runtime.getAttributeIndex("","itemType"))>=0) {
+-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 11, fa);
+-                    spawnChildFromText(h, $value);
+-                }
+-            }
+-            break;
+         case 2:
+             {
+                 if(($ai = $runtime.getAttributeIndex("","itemType"))>=0) {
+@@ -327,6 +313,12 @@
+                 }
+             }
+             break;
++        case 5:
++            {
++                NGCCHandler h = new qname(this, super._source, $runtime, 168);
++                spawnChildFromText(h, $value);
++            }
++            break;
+         case 7:
+             {
+                 $_ngcc_current_state = 2;
+@@ -338,36 +330,44 @@
+                 revertToParentFromText(result, super._cookie, $value);
+             }
+             break;
++        case 9:
++            {
++                if(($ai = $runtime.getAttributeIndex("","itemType"))>=0) {
++                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 174, fa);
++                    spawnChildFromText(h, $value);
++                }
++            }
++            break;
+         }
+     }
+ 
+     public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException {
+         switch($__cookie__) {
+-        case 11:
++        case 168:
+             {
+-                fa = ((ForeignAttributesImpl)$__result__);
+-                $_ngcc_current_state = 7;
+-            }
+-            break;
+-        case 5:
+-            {
+                 itemTypeName = ((UName)$__result__);
+                 action1();
+                 $_ngcc_current_state = 4;
+             }
+             break;
+-        case 3:
++        case 166:
+             {
+                 itemType = ((SimpleTypeImpl)$__result__);
+                 $_ngcc_current_state = 1;
+             }
+             break;
+-        case 9:
++        case 172:
+             {
+                 annotation = ((AnnotationImpl)$__result__);
+                 $_ngcc_current_state = 2;
+             }
+             break;
++        case 174:
++            {
++                fa = ((ForeignAttributesImpl)$__result__);
++                $_ngcc_current_state = 7;
++            }
++            break;
+         }
+     }
+ 
+@@ -375,15 +375,14 @@
+         return(($_ngcc_current_state == 0));
+     }
+ 
+-    
+-  		/** computed simple type object */
+-  		private ListSimpleTypeImpl result;
+-  		
+-  		// reference to the base type
+-  		private Ref.SimpleType itemType;
+-  		
+-  		// locator of <list>
+-  		private Locator lloc;
+-  	
+-}
+ 
++                /** computed simple type object */
++                private ListSimpleTypeImpl result;
++
++                // reference to the base type
++                private Ref.SimpleType itemType;
++
++                // locator of <list>
++                private Locator lloc;
++
++}
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/SimpleType_Restriction.java	Thu Jul 30 18:43:09 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/SimpleType_Restriction.java	Thu Jul 30 18:43:08 2009
+@@ -37,9 +37,9 @@
+     import org.xml.sax.ContentHandler;
+     import org.xml.sax.helpers.*;
+     import java.util.*;
+-  
+ 
+ 
++
+ class SimpleType_Restriction extends NGCCHandler {
+     private Locator locator;
+     private AnnotationImpl annotation;
+@@ -74,23 +74,23 @@
+     }
+ 
+     private void action0()throws SAXException {
+-        
+-        	result.addFacet(facet);
+-        
++
++                result.addFacet(facet);
++
+ }
+ 
+     private void action1()throws SAXException {
+-        
+-      	result = new RestrictionSimpleTypeImpl(
+-					$runtime.document, annotation, locator, fa, name, name==null, finalSet, baseType );
+-      
++
++        result = new RestrictionSimpleTypeImpl(
++                                        $runtime.document, annotation, locator, fa, name, name==null, finalSet, baseType );
++
+ }
+ 
+     private void action2()throws SAXException {
+-        
++
+             baseType = new DelayedRef.SimpleType(
+               $runtime, rloc, $runtime.currentSchema, baseTypeName );
+-           
++
+ }
+ 
+     private void action3()throws SAXException {
+@@ -106,7 +106,7 @@
+         case 1:
+             {
+                 if((((((((((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minExclusive")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxExclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minInclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxInclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("totalDigits"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("fractionDigits"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("length"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxLength"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minLength"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("enumeration"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("whiteSpace"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("pattern")))) {
+-                    NGCCHandler h = new facet(this, super._source, $runtime, 40);
++                    NGCCHandler h = new facet(this, super._source, $runtime, 529);
+                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+@@ -114,11 +114,6 @@
+                 }
+             }
+             break;
+-        case 0:
+-            {
+-                revertToParentFromEnterElement(result, super._cookie, $__uri, $__local, $__qname, $attrs);
+-            }
+-            break;
+         case 13:
+             {
+                 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("restriction"))) {
+@@ -134,7 +129,7 @@
+         case 10:
+             {
+                 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
+-                    NGCCHandler h = new annotation(this, super._source, $runtime, 51, annotation,AnnotationContext.SIMPLETYPE_DECL);
++                    NGCCHandler h = new annotation(this, super._source, $runtime, 540, annotation,AnnotationContext.SIMPLETYPE_DECL);
+                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+@@ -151,7 +146,7 @@
+                 }
+                 else {
+                     if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))) {
+-                        NGCCHandler h = new simpleType(this, super._source, $runtime, 45);
++                        NGCCHandler h = new simpleType(this, super._source, $runtime, 534);
+                         spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                     }
+                     else {
+@@ -162,8 +157,8 @@
+             break;
+         case 12:
+             {
+-                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || ((($ai = $runtime.getAttributeIndex("","base"))>=0 && ((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType")) || (((((((((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minExclusive")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxExclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minInclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxInclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("totalDigits"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("fractionDigits"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("length"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxLength"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minLength"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("enumeration"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("whiteSpace"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("pattern")))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))))) {
+-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 53, fa);
++                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || ((($ai = $runtime.getAttributeIndex("","base"))>=0 && (((((((((((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minExclusive")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxExclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minInclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxInclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("totalDigits"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("fractionDigits"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("length"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxLength"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minLength"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("enumeration"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("whiteSpace"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("pattern"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))))) {
++                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 542, fa);
+                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+@@ -181,7 +176,7 @@
+         case 2:
+             {
+                 if((((((((((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minExclusive")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxExclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minInclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxInclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("totalDigits"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("fractionDigits"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("length"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxLength"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minLength"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("enumeration"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("whiteSpace"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("pattern")))) {
+-                    NGCCHandler h = new facet(this, super._source, $runtime, 41);
++                    NGCCHandler h = new facet(this, super._source, $runtime, 530);
+                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+@@ -190,6 +185,11 @@
+                 }
+             }
+             break;
++        case 0:
++            {
++                revertToParentFromEnterElement(result, super._cookie, $__uri, $__local, $__qname, $attrs);
++            }
++            break;
+         default:
+             {
+                 unexpectedEnterElement($__qname);
+@@ -215,11 +215,6 @@
+                 }
+             }
+             break;
+-        case 0:
+-            {
+-                revertToParentFromLeaveElement(result, super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+         case 10:
+             {
+                 $_ngcc_current_state = 5;
+@@ -240,7 +235,7 @@
+         case 12:
+             {
+                 if((($ai = $runtime.getAttributeIndex("","base"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("restriction")))) {
+-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 53, fa);
++                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 542, fa);
+                     spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
+                 }
+                 else {
+@@ -261,6 +256,11 @@
+                 $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
++        case 0:
++            {
++                revertToParentFromLeaveElement(result, super._cookie, $__uri, $__local, $__qname);
++            }
++            break;
+         default:
+             {
+                 unexpectedLeaveElement($__qname);
+@@ -275,11 +275,6 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
+-        case 0:
+-            {
+-                revertToParentFromEnterAttribute(result, super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+         case 10:
+             {
+                 $_ngcc_current_state = 5;
+@@ -299,7 +294,7 @@
+         case 12:
+             {
+                 if(($__uri.equals("") && $__local.equals("base"))) {
+-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 53, fa);
++                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 542, fa);
+                     spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
+                 }
+                 else {
+@@ -320,6 +315,11 @@
+                 $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
++        case 0:
++            {
++                revertToParentFromEnterAttribute(result, super._cookie, $__uri, $__local, $__qname);
++            }
++            break;
+         default:
+             {
+                 unexpectedEnterAttribute($__qname);
+@@ -334,17 +334,6 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
+-        case 0:
+-            {
+-                revertToParentFromLeaveAttribute(result, super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+-        case 10:
+-            {
+-                $_ngcc_current_state = 5;
+-                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+         case 7:
+             {
+                 if(($__uri.equals("") && $__local.equals("base"))) {
+@@ -355,6 +344,12 @@
+                 }
+             }
+             break;
++        case 10:
++            {
++                $_ngcc_current_state = 5;
++                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
++            }
++            break;
+         case 4:
+             {
+                 action1();
+@@ -368,6 +363,11 @@
+                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
++        case 0:
++            {
++                revertToParentFromLeaveAttribute(result, super._cookie, $__uri, $__local, $__qname);
++            }
++            break;
+         default:
+             {
+                 unexpectedLeaveAttribute($__qname);
+@@ -379,9 +379,10 @@
+     public void text(String $value) throws SAXException {
+         int $ai;
+         switch($_ngcc_current_state) {
+-        case 0:
++        case 8:
+             {
+-                revertToParentFromText(result, super._cookie, $value);
++                NGCCHandler h = new qname(this, super._source, $runtime, 536);
++                spawnChildFromText(h, $value);
+             }
+             break;
+         case 10:
+@@ -401,17 +402,11 @@
+         case 12:
+             {
+                 if(($ai = $runtime.getAttributeIndex("","base"))>=0) {
+-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 53, fa);
++                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 542, fa);
+                     spawnChildFromText(h, $value);
+                 }
+             }
+             break;
+-        case 8:
+-            {
+-                NGCCHandler h = new qname(this, super._source, $runtime, 47);
+-                spawnChildFromText(h, $value);
+-            }
+-            break;
+         case 4:
+             {
+                 action1();
+@@ -425,12 +420,17 @@
+                 $runtime.sendText(super._cookie, $value);
+             }
+             break;
++        case 0:
++            {
++                revertToParentFromText(result, super._cookie, $value);
++            }
++            break;
+         }
+     }
+ 
+     public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException {
+         switch($__cookie__) {
+-        case 40:
++        case 529:
+             {
+                 facet = ((XSFacet)$__result__);
+                 action0();
+@@ -437,13 +437,14 @@
+                 $_ngcc_current_state = 1;
+             }
+             break;
+-        case 51:
++        case 530:
+             {
+-                annotation = ((AnnotationImpl)$__result__);
+-                $_ngcc_current_state = 5;
++                facet = ((XSFacet)$__result__);
++                action0();
++                $_ngcc_current_state = 1;
+             }
+             break;
+-        case 47:
++        case 536:
+             {
+                 baseTypeName = ((UName)$__result__);
+                 action2();
+@@ -450,23 +451,22 @@
+                 $_ngcc_current_state = 7;
+             }
+             break;
+-        case 53:
++        case 540:
+             {
+-                fa = ((ForeignAttributesImpl)$__result__);
+-                $_ngcc_current_state = 10;
++                annotation = ((AnnotationImpl)$__result__);
++                $_ngcc_current_state = 5;
+             }
+             break;
+-        case 45:
++        case 534:
+             {
+                 baseType = ((SimpleTypeImpl)$__result__);
+                 $_ngcc_current_state = 4;
+             }
+             break;
+-        case 41:
++        case 542:
+             {
+-                facet = ((XSFacet)$__result__);
+-                action0();
+-                $_ngcc_current_state = 1;
++                fa = ((ForeignAttributesImpl)$__result__);
++                $_ngcc_current_state = 10;
+             }
+             break;
+         }
+@@ -476,15 +476,14 @@
+         return(($_ngcc_current_state == 0));
+     }
+ 
+-    
+-  		/** computed simple type object */
+-  		private RestrictionSimpleTypeImpl result;
+-  		
+-  		// reference to the base type
+-  		private Ref.SimpleType baseType;
+-  		
+-  		// location of restriction
+-  		private Locator rloc;
+-  	
+-}
+ 
++                /** computed simple type object */
++                private RestrictionSimpleTypeImpl result;
++
++                // reference to the base type
++                private Ref.SimpleType baseType;
++
++                // location of restriction
++                private Locator rloc;
++
++}
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/SimpleType_Union.java	Thu Jul 30 18:43:13 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/SimpleType_Union.java	Thu Jul 30 18:43:12 2009
+@@ -37,7 +37,7 @@
+     import org.xml.sax.ContentHandler;
+     import org.xml.sax.helpers.*;
+     import java.util.*;
+-  
++
+ import java.util.Vector;
+ 
+ 
+@@ -76,24 +76,24 @@
+     }
+ 
+     private void action0()throws SAXException {
+-        
+-			result = new UnionSimpleTypeImpl(
+-				$runtime.document, annotation, locator, fa, name, name==null, finalSet,
+-				(Ref.SimpleType[])members.toArray(new Ref.SimpleType[members.size()]) );
+-    
++
++                        result = new UnionSimpleTypeImpl(
++                                $runtime.document, annotation, locator, fa, name, name==null, finalSet,
++                                (Ref.SimpleType[])members.toArray(new Ref.SimpleType[members.size()]) );
++
+ }
+ 
+     private void action1()throws SAXException {
+-        
++
+           members.add(anonymousMemberType);
+-        
++
+ }
+ 
+     private void action2()throws SAXException {
+-        
+-              	members.add( new DelayedRef.SimpleType(
+-	            		$runtime, uloc, $runtime.currentSchema, memberTypeName));
+-              
++
++                members.add( new DelayedRef.SimpleType(
++                                $runtime, uloc, $runtime.currentSchema, memberTypeName));
++
+ }
+ 
+     private void action3()throws SAXException {
+@@ -109,39 +109,34 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
+-        case 7:
++        case 4:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","memberTypes"))>=0) {
+-                    $runtime.consumeAttribute($ai);
+-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
++                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
++                    NGCCHandler h = new annotation(this, super._source, $runtime, 191, annotation,AnnotationContext.SIMPLETYPE_DECL);
++                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+-                    $_ngcc_current_state = 6;
++                    $_ngcc_current_state = 2;
+                     $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                 }
+             }
+             break;
+-        case 12:
++        case 2:
+             {
+-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("union"))) {
+-                    $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
+-                    action4();
+-                    $_ngcc_current_state = 7;
++                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))) {
++                    NGCCHandler h = new simpleType(this, super._source, $runtime, 188);
++                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+-                    unexpectedEnterElement($__qname);
++                    $_ngcc_current_state = 1;
++                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                 }
+             }
+             break;
+-        case 0:
++        case 6:
+             {
+-                revertToParentFromEnterElement(result, super._cookie, $__uri, $__local, $__qname, $attrs);
+-            }
+-            break;
+-        case 1:
+-            {
+-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))) {
+-                    NGCCHandler h = new simpleType(this, super._source, $runtime, 682);
++                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType")))) {
++                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 193, fa);
+                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+@@ -149,35 +144,35 @@
+                 }
+             }
+             break;
+-        case 2:
++        case 7:
+             {
+-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))) {
+-                    NGCCHandler h = new simpleType(this, super._source, $runtime, 683);
+-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
++                if(($ai = $runtime.getAttributeIndex("","memberTypes"))>=0) {
++                    $runtime.consumeAttribute($ai);
++                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+-                    $_ngcc_current_state = 1;
++                    $_ngcc_current_state = 6;
+                     $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                 }
+             }
+             break;
+-        case 4:
++        case 1:
+             {
+-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
+-                    NGCCHandler h = new annotation(this, super._source, $runtime, 686, annotation,AnnotationContext.SIMPLETYPE_DECL);
++                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))) {
++                    NGCCHandler h = new simpleType(this, super._source, $runtime, 187);
+                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+-                    $_ngcc_current_state = 2;
+-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
++                    unexpectedEnterElement($__qname);
+                 }
+             }
+             break;
+-        case 6:
++        case 12:
+             {
+-                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType")))) {
+-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 688, fa);
+-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
++                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("union"))) {
++                    $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
++                    action4();
++                    $_ngcc_current_state = 7;
+                 }
+                 else {
+                     unexpectedEnterElement($__qname);
+@@ -184,6 +179,11 @@
+                 }
+             }
+             break;
++        case 0:
++            {
++                revertToParentFromEnterElement(result, super._cookie, $__uri, $__local, $__qname, $attrs);
++            }
++            break;
+         default:
+             {
+                 unexpectedEnterElement($__qname);
+@@ -198,6 +198,29 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
++        case 4:
++            {
++                $_ngcc_current_state = 2;
++                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
++            }
++            break;
++        case 2:
++            {
++                $_ngcc_current_state = 1;
++                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
++            }
++            break;
++        case 6:
++            {
++                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("union"))) {
++                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 193, fa);
++                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
++                }
++                else {
++                    unexpectedLeaveElement($__qname);
++                }
++            }
++            break;
+         case 7:
+             {
+                 if(($ai = $runtime.getAttributeIndex("","memberTypes"))>=0) {
+@@ -210,11 +233,6 @@
+                 }
+             }
+             break;
+-        case 0:
+-            {
+-                revertToParentFromLeaveElement(result, super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+         case 1:
+             {
+                 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("union"))) {
+@@ -227,29 +245,11 @@
+                 }
+             }
+             break;
+-        case 2:
++        case 0:
+             {
+-                $_ngcc_current_state = 1;
+-                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
++                revertToParentFromLeaveElement(result, super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 4:
+-            {
+-                $_ngcc_current_state = 2;
+-                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+-        case 6:
+-            {
+-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("union"))) {
+-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 688, fa);
+-                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
+-                }
+-                else {
+-                    unexpectedLeaveElement($__qname);
+-                }
+-            }
+-            break;
+         default:
+             {
+                 unexpectedLeaveElement($__qname);
+@@ -264,6 +264,18 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
++        case 4:
++            {
++                $_ngcc_current_state = 2;
++                $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
++            }
++            break;
++        case 2:
++            {
++                $_ngcc_current_state = 1;
++                $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
++            }
++            break;
+         case 7:
+             {
+                 if(($__uri.equals("") && $__local.equals("memberTypes"))) {
+@@ -280,18 +292,6 @@
+                 revertToParentFromEnterAttribute(result, super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 2:
+-            {
+-                $_ngcc_current_state = 1;
+-                $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+-        case 4:
+-            {
+-                $_ngcc_current_state = 2;
+-                $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+         default:
+             {
+                 unexpectedEnterAttribute($__qname);
+@@ -306,17 +306,12 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
+-        case 7:
++        case 4:
+             {
+-                $_ngcc_current_state = 6;
++                $_ngcc_current_state = 2;
+                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 0:
+-            {
+-                revertToParentFromLeaveAttribute(result, super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+         case 2:
+             {
+                 $_ngcc_current_state = 1;
+@@ -323,9 +318,9 @@
+                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 4:
++        case 7:
+             {
+-                $_ngcc_current_state = 2;
++                $_ngcc_current_state = 6;
+                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+@@ -339,6 +334,11 @@
+                 }
+             }
+             break;
++        case 0:
++            {
++                revertToParentFromLeaveAttribute(result, super._cookie, $__uri, $__local, $__qname);
++            }
++            break;
+         default:
+             {
+                 unexpectedLeaveAttribute($__qname);
+@@ -350,21 +350,16 @@
+     public void text(String $value) throws SAXException {
+         int $ai;
+         switch($_ngcc_current_state) {
+-        case 7:
++        case 4:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","memberTypes"))>=0) {
+-                    $runtime.consumeAttribute($ai);
+-                    $runtime.sendText(super._cookie, $value);
+-                }
+-                else {
+-                    $_ngcc_current_state = 6;
+-                    $runtime.sendText(super._cookie, $value);
+-                }
++                $_ngcc_current_state = 2;
++                $runtime.sendText(super._cookie, $value);
+             }
+             break;
+-        case 0:
++        case 9:
+             {
+-                revertToParentFromText(result, super._cookie, $value);
++                NGCCHandler h = new qname(this, super._source, $runtime, 195);
++                spawnChildFromText(h, $value);
+             }
+             break;
+         case 2:
+@@ -373,12 +368,6 @@
+                 $runtime.sendText(super._cookie, $value);
+             }
+             break;
+-        case 4:
+-            {
+-                $_ngcc_current_state = 2;
+-                $runtime.sendText(super._cookie, $value);
+-            }
+-            break;
+         case 10:
+             {
+                 __text = $value;
+@@ -386,24 +375,35 @@
+                 action3();
+             }
+             break;
+-        case 9:
++        case 7:
+             {
+-                NGCCHandler h = new qname(this, super._source, $runtime, 690);
+-                spawnChildFromText(h, $value);
++                if(($ai = $runtime.getAttributeIndex("","memberTypes"))>=0) {
++                    $runtime.consumeAttribute($ai);
++                    $runtime.sendText(super._cookie, $value);
++                }
++                else {
++                    $_ngcc_current_state = 6;
++                    $runtime.sendText(super._cookie, $value);
++                }
+             }
+             break;
+         case 8:
+             {
+-                NGCCHandler h = new qname(this, super._source, $runtime, 691);
++                NGCCHandler h = new qname(this, super._source, $runtime, 196);
+                 spawnChildFromText(h, $value);
+             }
+             break;
++        case 0:
++            {
++                revertToParentFromText(result, super._cookie, $value);
++            }
++            break;
+         }
+     }
+ 
+     public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException {
+         switch($__cookie__) {
+-        case 682:
++        case 188:
+             {
+                 anonymousMemberType = ((SimpleTypeImpl)$__result__);
+                 action1();
+@@ -410,37 +410,37 @@
+                 $_ngcc_current_state = 1;
+             }
+             break;
+-        case 683:
++        case 196:
+             {
+-                anonymousMemberType = ((SimpleTypeImpl)$__result__);
+-                action1();
+-                $_ngcc_current_state = 1;
+-            }
+-            break;
+-        case 691:
+-            {
+                 memberTypeName = ((UName)$__result__);
+                 action2();
+                 $_ngcc_current_state = 8;
+             }
+             break;
+-        case 690:
++        case 191:
+             {
++                annotation = ((AnnotationImpl)$__result__);
++                $_ngcc_current_state = 2;
++            }
++            break;
++        case 195:
++            {
+                 memberTypeName = ((UName)$__result__);
+                 action2();
+                 $_ngcc_current_state = 8;
+             }
+             break;
+-        case 686:
++        case 193:
+             {
+-                annotation = ((AnnotationImpl)$__result__);
+-                $_ngcc_current_state = 2;
++                fa = ((ForeignAttributesImpl)$__result__);
++                $_ngcc_current_state = 4;
+             }
+             break;
+-        case 688:
++        case 187:
+             {
+-                fa = ((ForeignAttributesImpl)$__result__);
+-                $_ngcc_current_state = 4;
++                anonymousMemberType = ((SimpleTypeImpl)$__result__);
++                action1();
++                $_ngcc_current_state = 1;
+             }
+             break;
+         }
+@@ -450,15 +450,14 @@
+         return(($_ngcc_current_state == 0));
+     }
+ 
+-    
+-  		/** computed simple type object */
+-  		private UnionSimpleTypeImpl result;
+-  		
+-  		// Vector of Ref.SimpleType
+-  		private final Vector members = new Vector();
+-  		
+-  		// locator of <union>
+-  		private Locator uloc;
+-  	
+-}
+ 
++                /** computed simple type object */
++                private UnionSimpleTypeImpl result;
++
++                // Vector of Ref.SimpleType
++                private final Vector members = new Vector();
++
++                // locator of <union>
++                private Locator uloc;
++
++}
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/annotation.java	Thu Jul 30 18:43:16 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/annotation.java	Thu Jul 30 18:43:16 2009
+@@ -37,7 +37,7 @@
+     import org.xml.sax.ContentHandler;
+     import org.xml.sax.helpers.*;
+     import java.util.*;
+-  
++
+ import com.sun.xml.internal.xsom.parser.AnnotationParser;
+ 
+ 
+@@ -67,7 +67,7 @@
+     }
+ 
+     private void action0()throws SAXException {
+-        
++
+         locator = $runtime.copyLocator();
+         parser = $runtime.createAnnotationParser();
+         $runtime.redirectSubtree(parser.getContentHandler(
+@@ -76,7 +76,7 @@
+             $runtime.getErrorHandler(),
+             $runtime.parser.getEntityResolver()
+           ), $uri, $localName, $qname );
+-      
++
+ }
+ 
+     public void enterElement(String $__uri, String $__local, String $__qname, Attributes $attrs) throws SAXException {
+@@ -85,6 +85,11 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
++        case 0:
++            {
++                revertToParentFromEnterElement(makeResult(), super._cookie, $__uri, $__local, $__qname, $attrs);
++            }
++            break;
+         case 2:
+             {
+                 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
+@@ -97,11 +102,6 @@
+                 }
+             }
+             break;
+-        case 0:
+-            {
+-                revertToParentFromEnterElement(makeResult(), super._cookie, $__uri, $__local, $__qname, $attrs);
+-            }
+-            break;
+         default:
+             {
+                 unexpectedEnterElement($__qname);
+@@ -198,16 +198,15 @@
+         return(($_ngcc_current_state == 0));
+     }
+ 
+-    
++
+       private AnnotationParser parser;
+       private Locator locator;
+-      
++
+       public AnnotationImpl makeResult() {
+         Object e = null;
+         if(existing!=null)  e=existing.getAnnotation();
+-        
++
+         return new AnnotationImpl( parser.getResult(e),locator);
+       }
+-    
+-}
+ 
++}
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/attributeDeclBody.java	Thu Jul 30 18:43:20 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/attributeDeclBody.java	Thu Jul 30 18:43:19 2009
+@@ -37,9 +37,9 @@
+     import org.xml.sax.ContentHandler;
+     import org.xml.sax.helpers.*;
+     import java.util.*;
+-  
+ 
+ 
++
+ class attributeDeclBody extends NGCCHandler {
+     private String name;
+     private ForeignAttributesImpl fa;
+@@ -74,10 +74,10 @@
+     }
+ 
+     private void action0()throws SAXException {
+-        
++
+           type = new DelayedRef.SimpleType(
+             $runtime, locator, $runtime.currentSchema, typeName );
+-        
++
+ }
+ 
+     private void action1()throws SAXException {
+@@ -90,14 +90,42 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
++        case 13:
++            {
++                if(($ai = $runtime.getAttributeIndex("","form"))>=0) {
++                    $runtime.consumeAttribute($ai);
++                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
++                }
++                else {
++                    $_ngcc_current_state = 12;
++                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
++                }
++            }
++            break;
++        case 0:
++            {
++                revertToParentFromEnterElement(makeResult(), super._cookie, $__uri, $__local, $__qname, $attrs);
++            }
++            break;
++        case 12:
++            {
++                if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
++                    $runtime.consumeAttribute($ai);
++                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
++                }
++                else {
++                    unexpectedEnterElement($__qname);
++                }
++            }
++            break;
+         case 9:
+             {
+                 if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || ((($ai = $runtime.getAttributeIndex("","type"))>=0 && (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))))) {
+-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 218, fa);
++                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 340, fa);
+                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 218, fa);
++                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 340, fa);
+                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                 }
+             }
+@@ -105,7 +133,7 @@
+         case 7:
+             {
+                 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
+-                    NGCCHandler h = new annotation(this, super._source, $runtime, 216, null,AnnotationContext.ATTRIBUTE_DECL);
++                    NGCCHandler h = new annotation(this, super._source, $runtime, 338, null,AnnotationContext.ATTRIBUTE_DECL);
+                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+@@ -114,11 +142,6 @@
+                 }
+             }
+             break;
+-        case 0:
+-            {
+-                revertToParentFromEnterElement(makeResult(), super._cookie, $__uri, $__local, $__qname, $attrs);
+-            }
+-            break;
+         case 1:
+             {
+                 if(($ai = $runtime.getAttributeIndex("","type"))>=0) {
+@@ -127,7 +150,7 @@
+                 }
+                 else {
+                     if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))) {
+-                        NGCCHandler h = new simpleType(this, super._source, $runtime, 207);
++                        NGCCHandler h = new simpleType(this, super._source, $runtime, 329);
+                         spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                     }
+                     else {
+@@ -137,51 +160,56 @@
+                 }
+             }
+             break;
++        default:
++            {
++                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 13:
+             {
+                 if(($ai = $runtime.getAttributeIndex("","form"))>=0) {
+                     $runtime.consumeAttribute($ai);
+-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
++                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                 }
+                 else {
+                     $_ngcc_current_state = 12;
+-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
++                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                 }
+             }
+             break;
++        case 0:
++            {
++                revertToParentFromLeaveElement(makeResult(), super._cookie, $__uri, $__local, $__qname);
++            }
++            break;
+         case 12:
+             {
+                 if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
+                     $runtime.consumeAttribute($ai);
+-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
++                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                 }
+                 else {
+-                    unexpectedEnterElement($__qname);
++                    unexpectedLeaveElement($__qname);
+                 }
+             }
+             break;
+-        default:
+-            {
+-                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 9:
+             {
+                 if(($ai = $runtime.getAttributeIndex("","type"))>=0) {
+-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 218, fa);
++                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 340, fa);
+                     spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
+                 }
+                 else {
+-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 218, fa);
++                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 340, fa);
+                     spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
+                 }
+             }
+@@ -192,11 +220,6 @@
+                 $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 0:
+-            {
+-                revertToParentFromLeaveElement(makeResult(), super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+         case 1:
+             {
+                 if(($ai = $runtime.getAttributeIndex("","type"))>=0) {
+@@ -209,29 +232,6 @@
+                 }
+             }
+             break;
+-        case 13:
+-            {
+-                if(($ai = $runtime.getAttributeIndex("","form"))>=0) {
+-                    $runtime.consumeAttribute($ai);
+-                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+-                }
+-                else {
+-                    $_ngcc_current_state = 12;
+-                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+-                }
+-            }
+-            break;
+-        case 12:
+-            {
+-                if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
+-                    $runtime.consumeAttribute($ai);
+-                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+-                }
+-                else {
+-                    unexpectedLeaveElement($__qname);
+-                }
+-            }
+-            break;
+         default:
+             {
+                 unexpectedLeaveElement($__qname);
+@@ -246,58 +246,58 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
+-        case 9:
++        case 13:
+             {
+-                if(($__uri.equals("") && $__local.equals("type"))) {
+-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 218, fa);
+-                    spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
++                if(($__uri.equals("") && $__local.equals("form"))) {
++                    $_ngcc_current_state = 15;
+                 }
+                 else {
+-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 218, fa);
+-                    spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
++                    $_ngcc_current_state = 12;
++                    $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+                 }
+             }
+             break;
+-        case 7:
+-            {
+-                $_ngcc_current_state = 1;
+-                $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+         case 0:
+             {
+                 revertToParentFromEnterAttribute(makeResult(), super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 1:
++        case 12:
+             {
+-                if(($__uri.equals("") && $__local.equals("type"))) {
+-                    $_ngcc_current_state = 5;
++                if(($__uri.equals("") && $__local.equals("name"))) {
++                    $_ngcc_current_state = 11;
+                 }
+                 else {
+-                    $_ngcc_current_state = 0;
+-                    $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
++                    unexpectedEnterAttribute($__qname);
+                 }
+             }
+             break;
+-        case 13:
++        case 9:
+             {
+-                if(($__uri.equals("") && $__local.equals("form"))) {
+-                    $_ngcc_current_state = 15;
++                if(($__uri.equals("") && $__local.equals("type"))) {
++                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 340, fa);
++                    spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
+                 }
+                 else {
+-                    $_ngcc_current_state = 12;
+-                    $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
++                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 340, fa);
++                    spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
+                 }
+             }
+             break;
+-        case 12:
++        case 7:
+             {
+-                if(($__uri.equals("") && $__local.equals("name"))) {
+-                    $_ngcc_current_state = 11;
++                $_ngcc_current_state = 1;
++                $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
++            }
++            break;
++        case 1:
++            {
++                if(($__uri.equals("") && $__local.equals("type"))) {
++                    $_ngcc_current_state = 5;
+                 }
+                 else {
+-                    unexpectedEnterAttribute($__qname);
++                    $_ngcc_current_state = 0;
++                    $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+                 }
+             }
+             break;
+@@ -315,6 +315,17 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
++        case 13:
++            {
++                $_ngcc_current_state = 12;
++                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
++            }
++            break;
++        case 0:
++            {
++                revertToParentFromLeaveAttribute(makeResult(), super._cookie, $__uri, $__local, $__qname);
++            }
++            break;
+         case 10:
+             {
+                 if(($__uri.equals("") && $__local.equals("name"))) {
+@@ -327,7 +338,7 @@
+             break;
+         case 9:
+             {
+-                NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 218, fa);
++                NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 340, fa);
+                 spawnChildFromLeaveAttribute(h, $__uri, $__local, $__qname);
+             }
+             break;
+@@ -337,10 +348,10 @@
+                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 14:
++        case 4:
+             {
+-                if(($__uri.equals("") && $__local.equals("form"))) {
+-                    $_ngcc_current_state = 12;
++                if(($__uri.equals("") && $__local.equals("type"))) {
++                    $_ngcc_current_state = 0;
+                 }
+                 else {
+                     unexpectedLeaveAttribute($__qname);
+@@ -347,21 +358,10 @@
+                 }
+             }
+             break;
+-        case 0:
++        case 14:
+             {
+-                revertToParentFromLeaveAttribute(makeResult(), super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+-        case 1:
+-            {
+-                $_ngcc_current_state = 0;
+-                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+-        case 4:
+-            {
+-                if(($__uri.equals("") && $__local.equals("type"))) {
+-                    $_ngcc_current_state = 0;
++                if(($__uri.equals("") && $__local.equals("form"))) {
++                    $_ngcc_current_state = 12;
+                 }
+                 else {
+                     unexpectedLeaveAttribute($__qname);
+@@ -368,9 +368,9 @@
+                 }
+             }
+             break;
+-        case 13:
++        case 1:
+             {
+-                $_ngcc_current_state = 12;
++                $_ngcc_current_state = 0;
+                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+@@ -385,34 +385,59 @@
+     public void text(String $value) throws SAXException {
+         int $ai;
+         switch($_ngcc_current_state) {
++        case 11:
++            {
++                name = $value;
++                $_ngcc_current_state = 10;
++            }
++            break;
++        case 13:
++            {
++                if(($ai = $runtime.getAttributeIndex("","form"))>=0) {
++                    $runtime.consumeAttribute($ai);
++                    $runtime.sendText(super._cookie, $value);
++                }
++                else {
++                    $_ngcc_current_state = 12;
++                    $runtime.sendText(super._cookie, $value);
++                }
++            }
++            break;
++        case 0:
++            {
++                revertToParentFromText(makeResult(), super._cookie, $value);
++            }
++            break;
+         case 15:
+             {
+                 if($value.equals("unqualified")) {
+-                    NGCCHandler h = new qualification(this, super._source, $runtime, 223);
++                    NGCCHandler h = new qualification(this, super._source, $runtime, 345);
+                     spawnChildFromText(h, $value);
+                 }
+                 else {
+                     if($value.equals("qualified")) {
+-                        NGCCHandler h = new qualification(this, super._source, $runtime, 223);
++                        NGCCHandler h = new qualification(this, super._source, $runtime, 345);
+                         spawnChildFromText(h, $value);
+                     }
+                 }
+             }
+             break;
+-        case 5:
++        case 12:
+             {
+-                NGCCHandler h = new qname(this, super._source, $runtime, 209);
+-                spawnChildFromText(h, $value);
++                if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
++                    $runtime.consumeAttribute($ai);
++                    $runtime.sendText(super._cookie, $value);
++                }
+             }
+             break;
+         case 9:
+             {
+                 if(($ai = $runtime.getAttributeIndex("","type"))>=0) {
+-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 218, fa);
++                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 340, fa);
+                     spawnChildFromText(h, $value);
+                 }
+                 else {
+-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 218, fa);
++                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 340, fa);
+                     spawnChildFromText(h, $value);
+                 }
+             }
+@@ -423,17 +448,6 @@
+                 $runtime.sendText(super._cookie, $value);
+             }
+             break;
+-        case 11:
+-            {
+-                name = $value;
+-                $_ngcc_current_state = 10;
+-            }
+-            break;
+-        case 0:
+-            {
+-                revertToParentFromText(makeResult(), super._cookie, $value);
+-            }
+-            break;
+         case 1:
+             {
+                 if(($ai = $runtime.getAttributeIndex("","type"))>=0) {
+@@ -446,32 +460,18 @@
+                 }
+             }
+             break;
+-        case 13:
++        case 5:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","form"))>=0) {
+-                    $runtime.consumeAttribute($ai);
+-                    $runtime.sendText(super._cookie, $value);
+-                }
+-                else {
+-                    $_ngcc_current_state = 12;
+-                    $runtime.sendText(super._cookie, $value);
+-                }
++                NGCCHandler h = new qname(this, super._source, $runtime, 331);
++                spawnChildFromText(h, $value);
+             }
+             break;
+-        case 12:
+-            {
+-                if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
+-                    $runtime.consumeAttribute($ai);
+-                    $runtime.sendText(super._cookie, $value);
+-                }
+-            }
+-            break;
+         }
+     }
+ 
+     public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException {
+         switch($__cookie__) {
+-        case 223:
++        case 345:
+             {
+                 form = ((Boolean)$__result__).booleanValue();
+                 action1();
+@@ -478,25 +478,25 @@
+                 $_ngcc_current_state = 14;
+             }
+             break;
+-        case 216:
++        case 340:
+             {
+-                annotation = ((AnnotationImpl)$__result__);
+-                $_ngcc_current_state = 1;
++                fa = ((ForeignAttributesImpl)$__result__);
++                $_ngcc_current_state = 7;
+             }
+             break;
+-        case 218:
++        case 338:
+             {
+-                fa = ((ForeignAttributesImpl)$__result__);
+-                $_ngcc_current_state = 7;
++                annotation = ((AnnotationImpl)$__result__);
++                $_ngcc_current_state = 1;
+             }
+             break;
+-        case 207:
++        case 329:
+             {
+                 type = ((SimpleTypeImpl)$__result__);
+                 $_ngcc_current_state = 0;
+             }
+             break;
+-        case 209:
++        case 331:
+             {
+                 typeName = ((UName)$__result__);
+                 action0();
+@@ -507,27 +507,27 @@
+     }
+ 
+     public boolean accepted() {
+-        return((($_ngcc_current_state == 0) || (($_ngcc_current_state == 1) || ($_ngcc_current_state == 7))));
++        return((($_ngcc_current_state == 1) || (($_ngcc_current_state == 0) || ($_ngcc_current_state == 7))));
+     }
+ 
+-    
++
+       private boolean form;
+       private boolean formSpecified = false;
+-      
++
+       private AttributeDeclImpl makeResult() {
+-        
++
+         if(type==null)
+           // type defaults to anySimpleType
+           type = $runtime.parser.schemaSet.anySimpleType;
+-        
++
+         if(!formSpecified) form = $runtime.attributeFormDefault;
+           // global attributes are always qualified
+           if(!isLocal)       form = true;
+-        
++
+         String tns;
+         if(form==true)  tns = $runtime.currentSchema.getTargetNamespace();
+         else            tns = "";
+-        
++
+         // proper handling of anonymous types
+         return new AttributeDeclImpl( $runtime.document, tns, name,
+           annotation, locator, fa, isLocal,
+@@ -536,6 +536,5 @@
+           type );
+       }
+       private Ref.SimpleType type;
+-    
+-}
+ 
++}
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/attributeGroupDecl.java	Thu Jul 30 18:43:24 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/attributeGroupDecl.java	Thu Jul 30 18:43:23 2009
+@@ -37,9 +37,9 @@
+     import org.xml.sax.ContentHandler;
+     import org.xml.sax.helpers.*;
+     import java.util.*;
+-  
+ 
+ 
++
+ class attributeGroupDecl extends NGCCHandler {
+     private AnnotationImpl annotation;
+     private String name;
+@@ -65,10 +65,10 @@
+     }
+ 
+     private void action0()throws SAXException {
+-        
++
+         result = new AttGroupDeclImpl(
+           $runtime.document, annotation, locator, fa, name );
+-      
++
+ }
+ 
+     private void action1()throws SAXException {
+@@ -81,34 +81,28 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
+-        case 7:
++        case 13:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","id"))>=0) {
++                if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
+                     $runtime.consumeAttribute($ai);
+                     $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+-                    $_ngcc_current_state = 6;
+-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
++                    unexpectedEnterElement($__qname);
+                 }
+             }
+             break;
+-        case 4:
++        case 3:
+             {
+-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
+-                    NGCCHandler h = new annotation(this, super._source, $runtime, 17, null,AnnotationContext.ATTRIBUTE_GROUP);
+-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+-                }
+-                else {
+-                    $_ngcc_current_state = 3;
+-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+-                }
++                action0();
++                $_ngcc_current_state = 2;
++                $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+             }
+             break;
+         case 6:
+             {
+-                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("anyAttribute")))))) {
+-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 19, fa);
++                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("anyAttribute")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute")))))) {
++                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 674, fa);
+                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+@@ -128,16 +122,11 @@
+                 }
+             }
+             break;
+-        case 0:
++        case 2:
+             {
+-                revertToParentFromEnterElement(result, super._cookie, $__uri, $__local, $__qname, $attrs);
+-            }
+-            break;
+-        case 13:
+-            {
+-                if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
+-                    $runtime.consumeAttribute($ai);
+-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
++                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("anyAttribute")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute"))))) {
++                    NGCCHandler h = new attributeUses(this, super._source, $runtime, 669, result);
++                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+                     unexpectedEnterElement($__qname);
+@@ -144,24 +133,35 @@
+                 }
+             }
+             break;
+-        case 3:
++        case 0:
+             {
+-                action0();
+-                $_ngcc_current_state = 2;
+-                $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
++                revertToParentFromEnterElement(result, super._cookie, $__uri, $__local, $__qname, $attrs);
+             }
+             break;
+-        case 2:
++        case 4:
+             {
+-                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("anyAttribute"))))) {
+-                    NGCCHandler h = new attributeUses(this, super._source, $runtime, 14, result);
++                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
++                    NGCCHandler h = new annotation(this, super._source, $runtime, 672, null,AnnotationContext.ATTRIBUTE_GROUP);
+                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+-                    unexpectedEnterElement($__qname);
++                    $_ngcc_current_state = 3;
++                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                 }
+             }
+             break;
++        case 7:
++            {
++                if(($ai = $runtime.getAttributeIndex("","id"))>=0) {
++                    $runtime.consumeAttribute($ai);
++                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
++                }
++                else {
++                    $_ngcc_current_state = 6;
++                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
++                }
++            }
++            break;
+         default:
+             {
+                 unexpectedEnterElement($__qname);
+@@ -176,21 +176,21 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
+-        case 7:
++        case 13:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","id"))>=0) {
++                if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
+                     $runtime.consumeAttribute($ai);
+                     $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                 }
+                 else {
+-                    $_ngcc_current_state = 6;
+-                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
++                    unexpectedLeaveElement($__qname);
+                 }
+             }
+             break;
+-        case 4:
++        case 3:
+             {
+-                $_ngcc_current_state = 3;
++                action0();
++                $_ngcc_current_state = 2;
+                 $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+@@ -197,7 +197,7 @@
+         case 6:
+             {
+                 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup"))) {
+-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 19, fa);
++                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 674, fa);
+                     spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
+                 }
+                 else {
+@@ -205,16 +205,11 @@
+                 }
+             }
+             break;
+-        case 0:
++        case 2:
+             {
+-                revertToParentFromLeaveElement(result, super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+-        case 13:
+-            {
+-                if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
+-                    $runtime.consumeAttribute($ai);
+-                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
++                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup"))) {
++                    NGCCHandler h = new attributeUses(this, super._source, $runtime, 669, result);
++                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
+                 }
+                 else {
+                     unexpectedLeaveElement($__qname);
+@@ -221,13 +216,6 @@
+                 }
+             }
+             break;
+-        case 3:
+-            {
+-                action0();
+-                $_ngcc_current_state = 2;
+-                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+         case 1:
+             {
+                 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup"))) {
+@@ -239,14 +227,26 @@
+                 }
+             }
+             break;
+-        case 2:
++        case 0:
+             {
+-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup"))) {
+-                    NGCCHandler h = new attributeUses(this, super._source, $runtime, 14, result);
+-                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
++                revertToParentFromLeaveElement(result, super._cookie, $__uri, $__local, $__qname);
++            }
++            break;
++        case 4:
++            {
++                $_ngcc_current_state = 3;
++                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
++            }
++            break;
++        case 7:
++            {
++                if(($ai = $runtime.getAttributeIndex("","id"))>=0) {
++                    $runtime.consumeAttribute($ai);
++                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                 }
+                 else {
+-                    unexpectedLeaveElement($__qname);
++                    $_ngcc_current_state = 6;
++                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                 }
+             }
+             break;
+@@ -264,20 +264,20 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
+-        case 7:
++        case 13:
+             {
+-                if(($__uri.equals("") && $__local.equals("id"))) {
+-                    $_ngcc_current_state = 9;
++                if(($__uri.equals("") && $__local.equals("name"))) {
++                    $_ngcc_current_state = 12;
+                 }
+                 else {
+-                    $_ngcc_current_state = 6;
+-                    $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
++                    unexpectedEnterAttribute($__qname);
+                 }
+             }
+             break;
+-        case 4:
++        case 3:
+             {
+-                $_ngcc_current_state = 3;
++                action0();
++                $_ngcc_current_state = 2;
+                 $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+@@ -286,23 +286,23 @@
+                 revertToParentFromEnterAttribute(result, super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 13:
++        case 4:
+             {
+-                if(($__uri.equals("") && $__local.equals("name"))) {
+-                    $_ngcc_current_state = 12;
++                $_ngcc_current_state = 3;
++                $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
++            }
++            break;
++        case 7:
++            {
++                if(($__uri.equals("") && $__local.equals("id"))) {
++                    $_ngcc_current_state = 9;
+                 }
+                 else {
+-                    unexpectedEnterAttribute($__qname);
++                    $_ngcc_current_state = 6;
++                    $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+                 }
+             }
+             break;
+-        case 3:
+-            {
+-                action0();
+-                $_ngcc_current_state = 2;
+-                $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+         default:
+             {
+                 unexpectedEnterAttribute($__qname);
+@@ -317,6 +317,13 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
++        case 3:
++            {
++                action0();
++                $_ngcc_current_state = 2;
++                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
++            }
++            break;
+         case 8:
+             {
+                 if(($__uri.equals("") && $__local.equals("id"))) {
+@@ -327,38 +334,31 @@
+                 }
+             }
+             break;
+-        case 7:
++        case 11:
+             {
+-                $_ngcc_current_state = 6;
+-                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
++                if(($__uri.equals("") && $__local.equals("name"))) {
++                    $_ngcc_current_state = 7;
++                }
++                else {
++                    unexpectedLeaveAttribute($__qname);
++                }
+             }
+             break;
+-        case 4:
+-            {
+-                $_ngcc_current_state = 3;
+-                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+         case 0:
+             {
+                 revertToParentFromLeaveAttribute(result, super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 3:
++        case 4:
+             {
+-                action0();
+-                $_ngcc_current_state = 2;
++                $_ngcc_current_state = 3;
+                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 11:
++        case 7:
+             {
+-                if(($__uri.equals("") && $__local.equals("name"))) {
+-                    $_ngcc_current_state = 7;
+-                }
+-                else {
+-                    unexpectedLeaveAttribute($__qname);
+-                }
++                $_ngcc_current_state = 6;
++                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+         default:
+@@ -372,22 +372,18 @@
+     public void text(String $value) throws SAXException {
+         int $ai;
+         switch($_ngcc_current_state) {
+-        case 7:
++        case 13:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","id"))>=0) {
++                if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
+                     $runtime.consumeAttribute($ai);
+                     $runtime.sendText(super._cookie, $value);
+                 }
+-                else {
+-                    $_ngcc_current_state = 6;
+-                    $runtime.sendText(super._cookie, $value);
+-                }
+             }
+             break;
+-        case 4:
++        case 12:
+             {
+-                $_ngcc_current_state = 3;
+-                $runtime.sendText(super._cookie, $value);
++                name = $value;
++                $_ngcc_current_state = 11;
+             }
+             break;
+         case 9:
+@@ -395,10 +391,11 @@
+                 $_ngcc_current_state = 8;
+             }
+             break;
+-        case 12:
++        case 3:
+             {
+-                name = $value;
+-                $_ngcc_current_state = 11;
++                action0();
++                $_ngcc_current_state = 2;
++                $runtime.sendText(super._cookie, $value);
+             }
+             break;
+         case 0:
+@@ -406,41 +403,44 @@
+                 revertToParentFromText(result, super._cookie, $value);
+             }
+             break;
+-        case 13:
++        case 4:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
++                $_ngcc_current_state = 3;
++                $runtime.sendText(super._cookie, $value);
++            }
++            break;
++        case 7:
++            {
++                if(($ai = $runtime.getAttributeIndex("","id"))>=0) {
+                     $runtime.consumeAttribute($ai);
+                     $runtime.sendText(super._cookie, $value);
+                 }
++                else {
++                    $_ngcc_current_state = 6;
++                    $runtime.sendText(super._cookie, $value);
++                }
+             }
+             break;
+-        case 3:
+-            {
+-                action0();
+-                $_ngcc_current_state = 2;
+-                $runtime.sendText(super._cookie, $value);
+-            }
+-            break;
+         }
+     }
+ 
+     public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException {
+         switch($__cookie__) {
+-        case 19:
++        case 669:
+             {
+-                fa = ((ForeignAttributesImpl)$__result__);
+-                $_ngcc_current_state = 4;
++                $_ngcc_current_state = 1;
+             }
+             break;
+-        case 17:
++        case 672:
+             {
+                 annotation = ((AnnotationImpl)$__result__);
+                 $_ngcc_current_state = 3;
+             }
+             break;
+-        case 14:
++        case 674:
+             {
+-                $_ngcc_current_state = 1;
++                fa = ((ForeignAttributesImpl)$__result__);
++                $_ngcc_current_state = 4;
+             }
+             break;
+         }
+@@ -450,9 +450,8 @@
+         return(($_ngcc_current_state == 0));
+     }
+ 
+-    
++
+       private AttGroupDeclImpl result;
+       private Locator locator;
+-    
+-}
+ 
++}
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/attributeUses.java	Thu Jul 30 18:43:27 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/attributeUses.java	Thu Jul 30 18:43:27 2009
+@@ -37,9 +37,9 @@
+     import org.xml.sax.ContentHandler;
+     import org.xml.sax.helpers.*;
+     import java.util.*;
+-  
+ 
+ 
++
+ class attributeUses extends NGCCHandler {
+     private String use;
+     private AttributesHolder owner;
+@@ -73,9 +73,9 @@
+     }
+ 
+     private void action0()throws SAXException {
+-        
++
+           owner.setWildcard(wildcard);
+-        
++
+ }
+ 
+     private void action1()throws SAXException {
+@@ -83,10 +83,10 @@
+ }
+ 
+     private void action2()throws SAXException {
+-        
++
+             owner.addAttGroup(new DelayedRef.AttGroup(
+               $runtime, locator, $runtime.currentSchema, groupName ));
+-          
++
+ }
+ 
+     private void action3()throws SAXException {
+@@ -94,7 +94,7 @@
+ }
+ 
+     private void action4()throws SAXException {
+-        
++
+             if("prohibited".equals(use))
+               owner.addProhibitedAttribute(attDeclName);
+             else
+@@ -103,18 +103,18 @@
+                   $runtime.createXmlString(defaultValue),
+                   $runtime.createXmlString(fixedValue),
+                   "required".equals(use)));
+-          
++
+ }
+ 
+     private void action5()throws SAXException {
+-        
++
+                   decl = new DelayedRef.Attribute(
+                     $runtime, locator, $runtime.currentSchema, attDeclName );
+-                
++
+ }
+ 
+     private void action6()throws SAXException {
+-        
++
+                 decl = anonymousDecl;
+                 attDeclName = new UName(
+                   anonymousDecl.getTargetNamespace(),
+@@ -121,11 +121,11 @@
+                   anonymousDecl.getName());
+                 defaultValue = null;
+                 fixedValue = null;
+-              
++
+ }
+ 
+     private void action7()throws SAXException {
+-        
++
+             locator=$runtime.copyLocator();
+             use=null;
+             defaultValue=null;
+@@ -132,7 +132,7 @@
+             fixedValue=null;
+             decl=null;
+             annotation=null;
+-          
++
+ }
+ 
+     public void enterElement(String $__uri, String $__local, String $__qname, Attributes $attrs) throws SAXException {
+@@ -141,27 +141,41 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
+-        case 33:
++        case 1:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","use"))>=0) {
+-                    $runtime.consumeAttribute($ai);
+-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
++                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute"))) {
++                    $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
++                    action7();
++                    $_ngcc_current_state = 33;
+                 }
+                 else {
+-                    $_ngcc_current_state = 29;
+-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
++                    if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup"))) {
++                        $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
++                        action3();
++                        $_ngcc_current_state = 13;
++                    }
++                    else {
++                        if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("anyAttribute"))) {
++                            $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
++                            action1();
++                            $_ngcc_current_state = 3;
++                        }
++                        else {
++                            $_ngcc_current_state = 0;
++                            $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
++                        }
++                    }
+                 }
+             }
+             break;
+-        case 19:
++        case 13:
+             {
+-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
+-                    NGCCHandler h = new annotation(this, super._source, $runtime, 621, null,AnnotationContext.ATTRIBUTE_USE);
+-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
++                if(($ai = $runtime.getAttributeIndex("","ref"))>=0) {
++                    $runtime.consumeAttribute($ai);
++                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+-                    $_ngcc_current_state = 18;
+-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
++                    unexpectedEnterElement($__qname);
+                 }
+             }
+             break;
+@@ -177,26 +191,6 @@
+                 }
+             }
+             break;
+-        case 5:
+-            {
+-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute"))) {
+-                    $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
+-                    action7();
+-                    $_ngcc_current_state = 33;
+-                }
+-                else {
+-                    if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup"))) {
+-                        $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
+-                        action3();
+-                        $_ngcc_current_state = 13;
+-                    }
+-                    else {
+-                        $_ngcc_current_state = 1;
+-                        $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+-                    }
+-                }
+-            }
+-            break;
+         case 8:
+             {
+                 action2();
+@@ -204,28 +198,22 @@
+                 $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+             }
+             break;
+-        case 3:
++        case 33:
+             {
+-                if((($ai = $runtime.getAttributeIndex("","namespace"))>=0 || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || ($ai = $runtime.getAttributeIndex("","processContents"))>=0))) {
+-                    NGCCHandler h = new wildcardBody(this, super._source, $runtime, 603, wloc);
+-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
++                if(($ai = $runtime.getAttributeIndex("","use"))>=0) {
++                    $runtime.consumeAttribute($ai);
++                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+-                    unexpectedEnterElement($__qname);
++                    $_ngcc_current_state = 29;
++                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                 }
+             }
+             break;
+-        case 16:
+-            {
+-                action4();
+-                $_ngcc_current_state = 15;
+-                $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+-            }
+-            break;
+         case 9:
+             {
+                 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
+-                    NGCCHandler h = new annotation(this, super._source, $runtime, 610, null,AnnotationContext.ATTRIBUTE_USE);
++                    NGCCHandler h = new annotation(this, super._source, $runtime, 409, null,AnnotationContext.ATTRIBUTE_USE);
+                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+@@ -234,6 +222,17 @@
+                 }
+             }
+             break;
++        case 3:
++            {
++                if((($ai = $runtime.getAttributeIndex("","processContents"))>=0 || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || ($ai = $runtime.getAttributeIndex("","namespace"))>=0))) {
++                    NGCCHandler h = new wildcardBody(this, super._source, $runtime, 402, wloc);
++                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
++                }
++                else {
++                    unexpectedEnterElement($__qname);
++                }
++            }
++            break;
+         case 29:
+             {
+                 if(($ai = $runtime.getAttributeIndex("","default"))>=0) {
+@@ -246,66 +245,67 @@
+                 }
+             }
+             break;
+-        case 17:
++        case 0:
+             {
+-                if((($ai = $runtime.getAttributeIndex("","form"))>=0 || ($ai = $runtime.getAttributeIndex("","name"))>=0)) {
+-                    NGCCHandler h = new attributeDeclBody(this, super._source, $runtime, 628, locator,true,defaultValue,fixedValue);
+-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
++                revertToParentFromEnterElement(this, super._cookie, $__uri, $__local, $__qname, $attrs);
++            }
++            break;
++        case 5:
++            {
++                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute"))) {
++                    $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
++                    action7();
++                    $_ngcc_current_state = 33;
+                 }
+                 else {
+-                    if(($ai = $runtime.getAttributeIndex("","ref"))>=0) {
+-                        $runtime.consumeAttribute($ai);
+-                        $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
++                    if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup"))) {
++                        $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
++                        action3();
++                        $_ngcc_current_state = 13;
+                     }
+                     else {
+-                        unexpectedEnterElement($__qname);
++                        $_ngcc_current_state = 1;
++                        $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                     }
+                 }
+             }
+             break;
+-        case 0:
++        case 19:
+             {
+-                revertToParentFromEnterElement(this, super._cookie, $__uri, $__local, $__qname, $attrs);
+-            }
+-            break;
+-        case 13:
+-            {
+-                if(($ai = $runtime.getAttributeIndex("","ref"))>=0) {
+-                    $runtime.consumeAttribute($ai);
+-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
++                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
++                    NGCCHandler h = new annotation(this, super._source, $runtime, 420, null,AnnotationContext.ATTRIBUTE_USE);
++                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+-                    unexpectedEnterElement($__qname);
++                    $_ngcc_current_state = 18;
++                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                 }
+             }
+             break;
+-        case 1:
++        case 17:
+             {
+-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute"))) {
+-                    $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
+-                    action7();
+-                    $_ngcc_current_state = 33;
++                if((($ai = $runtime.getAttributeIndex("","name"))>=0 || ($ai = $runtime.getAttributeIndex("","form"))>=0)) {
++                    NGCCHandler h = new attributeDeclBody(this, super._source, $runtime, 427, locator,true,defaultValue,fixedValue);
++                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+-                    if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup"))) {
+-                        $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
+-                        action3();
+-                        $_ngcc_current_state = 13;
++                    if(($ai = $runtime.getAttributeIndex("","ref"))>=0) {
++                        $runtime.consumeAttribute($ai);
++                        $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                     }
+                     else {
+-                        if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("anyAttribute"))) {
+-                            $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
+-                            action1();
+-                            $_ngcc_current_state = 3;
+-                        }
+-                        else {
+-                            $_ngcc_current_state = 0;
+-                            $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+-                        }
++                        unexpectedEnterElement($__qname);
+                     }
+                 }
+             }
+             break;
++        case 16:
++            {
++                action4();
++                $_ngcc_current_state = 15;
++                $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
++            }
++            break;
+         default:
+             {
+                 unexpectedEnterElement($__qname);
+@@ -320,61 +320,43 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
+-        case 33:
++        case 2:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","use"))>=0) {
+-                    $runtime.consumeAttribute($ai);
+-                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
++                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("anyAttribute"))) {
++                    $runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
++                    $_ngcc_current_state = 0;
+                 }
+                 else {
+-                    $_ngcc_current_state = 29;
+-                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
++                    unexpectedLeaveElement($__qname);
+                 }
+             }
+             break;
+-        case 19:
++        case 1:
+             {
+-                $_ngcc_current_state = 18;
++                $_ngcc_current_state = 0;
+                 $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 25:
++        case 13:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","fixed"))>=0) {
++                if(($ai = $runtime.getAttributeIndex("","ref"))>=0) {
+                     $runtime.consumeAttribute($ai);
+                     $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                 }
+                 else {
+-                    $_ngcc_current_state = 17;
+-                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+-                }
+-            }
+-            break;
+-        case 5:
+-            {
+-                $_ngcc_current_state = 1;
+-                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+-        case 2:
+-            {
+-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("anyAttribute"))) {
+-                    $runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
+-                    $_ngcc_current_state = 0;
+-                }
+-                else {
+                     unexpectedLeaveElement($__qname);
+                 }
+             }
+             break;
+-        case 15:
++        case 25:
+             {
+-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute"))) {
+-                    $runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
+-                    $_ngcc_current_state = 1;
++                if(($ai = $runtime.getAttributeIndex("","fixed"))>=0) {
++                    $runtime.consumeAttribute($ai);
++                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                 }
+                 else {
+-                    unexpectedLeaveElement($__qname);
++                    $_ngcc_current_state = 17;
++                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                 }
+             }
+             break;
+@@ -385,24 +367,18 @@
+                 $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 3:
++        case 33:
+             {
+-                if(((($ai = $runtime.getAttributeIndex("","namespace"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("anyAttribute"))) || ((($ai = $runtime.getAttributeIndex("","processContents"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("anyAttribute"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("anyAttribute"))))) {
+-                    NGCCHandler h = new wildcardBody(this, super._source, $runtime, 603, wloc);
+-                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
++                if(($ai = $runtime.getAttributeIndex("","use"))>=0) {
++                    $runtime.consumeAttribute($ai);
++                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                 }
+                 else {
+-                    unexpectedLeaveElement($__qname);
++                    $_ngcc_current_state = 29;
++                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                 }
+             }
+             break;
+-        case 16:
+-            {
+-                action4();
+-                $_ngcc_current_state = 15;
+-                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+         case 9:
+             {
+                 $_ngcc_current_state = 8;
+@@ -421,11 +397,11 @@
+                 }
+             }
+             break;
+-        case 7:
++        case 3:
+             {
+-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup"))) {
+-                    $runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
+-                    $_ngcc_current_state = 1;
++                if(((($ai = $runtime.getAttributeIndex("","processContents"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("anyAttribute"))) || ((($ai = $runtime.getAttributeIndex("","namespace"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("anyAttribute"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("anyAttribute"))))) {
++                    NGCCHandler h = new wildcardBody(this, super._source, $runtime, 402, wloc);
++                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
+                 }
+                 else {
+                     unexpectedLeaveElement($__qname);
+@@ -432,20 +408,14 @@
+                 }
+             }
+             break;
+-        case 17:
++        case 7:
+             {
+-                if(((($ai = $runtime.getAttributeIndex("","form"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute"))) || (($ai = $runtime.getAttributeIndex("","name"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute"))))) {
+-                    NGCCHandler h = new attributeDeclBody(this, super._source, $runtime, 628, locator,true,defaultValue,fixedValue);
+-                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
++                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup"))) {
++                    $runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
++                    $_ngcc_current_state = 1;
+                 }
+                 else {
+-                    if(($ai = $runtime.getAttributeIndex("","ref"))>=0) {
+-                        $runtime.consumeAttribute($ai);
+-                        $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+-                    }
+-                    else {
+-                        unexpectedLeaveElement($__qname);
+-                    }
++                    unexpectedLeaveElement($__qname);
+                 }
+             }
+             break;
+@@ -454,10 +424,16 @@
+                 revertToParentFromLeaveElement(this, super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
++        case 5:
++            {
++                $_ngcc_current_state = 1;
++                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
++            }
++            break;
+         case 18:
+             {
+                 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute"))) {
+-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 619, null);
++                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 418, null);
+                     spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
+                 }
+                 else {
+@@ -465,11 +441,11 @@
+                 }
+             }
+             break;
+-        case 13:
++        case 15:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","ref"))>=0) {
+-                    $runtime.consumeAttribute($ai);
+-                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
++                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute"))) {
++                    $runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
++                    $_ngcc_current_state = 1;
+                 }
+                 else {
+                     unexpectedLeaveElement($__qname);
+@@ -476,12 +452,36 @@
+                 }
+             }
+             break;
+-        case 1:
++        case 17:
+             {
+-                $_ngcc_current_state = 0;
++                if(((($ai = $runtime.getAttributeIndex("","name"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute"))) || (($ai = $runtime.getAttributeIndex("","form"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute"))))) {
++                    NGCCHandler h = new attributeDeclBody(this, super._source, $runtime, 427, locator,true,defaultValue,fixedValue);
++                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
++                }
++                else {
++                    if(($ai = $runtime.getAttributeIndex("","ref"))>=0) {
++                        $runtime.consumeAttribute($ai);
++                        $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
++                    }
++                    else {
++                        unexpectedLeaveElement($__qname);
++                    }
++                }
++            }
++            break;
++        case 19:
++            {
++                $_ngcc_current_state = 18;
+                 $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
++        case 16:
++            {
++                action4();
++                $_ngcc_current_state = 15;
++                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
++            }
++            break;
+         default:
+             {
+                 unexpectedLeaveElement($__qname);
+@@ -496,23 +496,22 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
+-        case 33:
++        case 1:
+             {
+-                if(($__uri.equals("") && $__local.equals("use"))) {
+-                    $_ngcc_current_state = 35;
++                $_ngcc_current_state = 0;
++                $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
++            }
++            break;
++        case 13:
++            {
++                if(($__uri.equals("") && $__local.equals("ref"))) {
++                    $_ngcc_current_state = 12;
+                 }
+                 else {
+-                    $_ngcc_current_state = 29;
+-                    $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
++                    unexpectedEnterAttribute($__qname);
+                 }
+             }
+             break;
+-        case 19:
+-            {
+-                $_ngcc_current_state = 18;
+-                $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+         case 25:
+             {
+                 if(($__uri.equals("") && $__local.equals("fixed"))) {
+@@ -524,12 +523,6 @@
+                 }
+             }
+             break;
+-        case 5:
+-            {
+-                $_ngcc_current_state = 1;
+-                $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+         case 8:
+             {
+                 action2();
+@@ -537,28 +530,32 @@
+                 $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 3:
++        case 33:
+             {
+-                if((($__uri.equals("") && $__local.equals("namespace")) || ($__uri.equals("") && $__local.equals("processContents")))) {
+-                    NGCCHandler h = new wildcardBody(this, super._source, $runtime, 603, wloc);
+-                    spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
++                if(($__uri.equals("") && $__local.equals("use"))) {
++                    $_ngcc_current_state = 35;
+                 }
+                 else {
+-                    unexpectedEnterAttribute($__qname);
++                    $_ngcc_current_state = 29;
++                    $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+                 }
+             }
+             break;
+-        case 16:
++        case 9:
+             {
+-                action4();
+-                $_ngcc_current_state = 15;
++                $_ngcc_current_state = 8;
+                 $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 9:
++        case 3:
+             {
+-                $_ngcc_current_state = 8;
+-                $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
++                if((($__uri.equals("") && $__local.equals("processContents")) || ($__uri.equals("") && $__local.equals("namespace")))) {
++                    NGCCHandler h = new wildcardBody(this, super._source, $runtime, 402, wloc);
++                    spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
++                }
++                else {
++                    unexpectedEnterAttribute($__qname);
++                }
+             }
+             break;
+         case 29:
+@@ -572,10 +569,27 @@
+                 }
+             }
+             break;
++        case 0:
++            {
++                revertToParentFromEnterAttribute(this, super._cookie, $__uri, $__local, $__qname);
++            }
++            break;
++        case 5:
++            {
++                $_ngcc_current_state = 1;
++                $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
++            }
++            break;
++        case 19:
++            {
++                $_ngcc_current_state = 18;
++                $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
++            }
++            break;
+         case 17:
+             {
+-                if((($__uri.equals("") && $__local.equals("form")) || ($__uri.equals("") && $__local.equals("name")))) {
+-                    NGCCHandler h = new attributeDeclBody(this, super._source, $runtime, 628, locator,true,defaultValue,fixedValue);
++                if((($__uri.equals("") && $__local.equals("name")) || ($__uri.equals("") && $__local.equals("form")))) {
++                    NGCCHandler h = new attributeDeclBody(this, super._source, $runtime, 427, locator,true,defaultValue,fixedValue);
+                     spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
+                 }
+                 else {
+@@ -588,24 +602,10 @@
+                 }
+             }
+             break;
+-        case 0:
++        case 16:
+             {
+-                revertToParentFromEnterAttribute(this, super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+-        case 13:
+-            {
+-                if(($__uri.equals("") && $__local.equals("ref"))) {
+-                    $_ngcc_current_state = 12;
+-                }
+-                else {
+-                    unexpectedEnterAttribute($__qname);
+-                }
+-            }
+-            break;
+-        case 1:
+-            {
+-                $_ngcc_current_state = 0;
++                action4();
++                $_ngcc_current_state = 15;
+                 $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+@@ -623,58 +623,62 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
+-        case 33:
++        case 1:
+             {
+-                $_ngcc_current_state = 29;
++                $_ngcc_current_state = 0;
+                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 19:
++        case 25:
+             {
+-                $_ngcc_current_state = 18;
++                $_ngcc_current_state = 17;
+                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 25:
++        case 8:
+             {
+-                $_ngcc_current_state = 17;
++                action2();
++                $_ngcc_current_state = 7;
+                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 5:
++        case 33:
+             {
+-                $_ngcc_current_state = 1;
++                $_ngcc_current_state = 29;
+                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 30:
++        case 9:
+             {
+-                if(($__uri.equals("") && $__local.equals("default"))) {
+-                    $_ngcc_current_state = 25;
+-                }
+-                else {
+-                    unexpectedLeaveAttribute($__qname);
+-                }
++                $_ngcc_current_state = 8;
++                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 8:
++        case 29:
+             {
+-                action2();
+-                $_ngcc_current_state = 7;
++                $_ngcc_current_state = 25;
+                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 16:
++        case 34:
+             {
+-                action4();
+-                $_ngcc_current_state = 15;
+-                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
++                if(($__uri.equals("") && $__local.equals("use"))) {
++                    $_ngcc_current_state = 29;
++                }
++                else {
++                    unexpectedLeaveAttribute($__qname);
++                }
+             }
+             break;
+-        case 26:
++        case 0:
+             {
+-                if(($__uri.equals("") && $__local.equals("fixed"))) {
+-                    $_ngcc_current_state = 17;
++                revertToParentFromLeaveAttribute(this, super._cookie, $__uri, $__local, $__qname);
++            }
++            break;
++        case 30:
++            {
++                if(($__uri.equals("") && $__local.equals("default"))) {
++                    $_ngcc_current_state = 25;
+                 }
+                 else {
+                     unexpectedLeaveAttribute($__qname);
+@@ -681,9 +685,9 @@
+                 }
+             }
+             break;
+-        case 9:
++        case 5:
+             {
+-                $_ngcc_current_state = 8;
++                $_ngcc_current_state = 1;
+                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+@@ -697,27 +701,26 @@
+                 }
+             }
+             break;
+-        case 29:
++        case 21:
+             {
+-                $_ngcc_current_state = 25;
+-                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
++                if(($__uri.equals("") && $__local.equals("ref"))) {
++                    $_ngcc_current_state = 19;
++                }
++                else {
++                    unexpectedLeaveAttribute($__qname);
++                }
+             }
+             break;
+-        case 0:
++        case 19:
+             {
+-                revertToParentFromLeaveAttribute(this, super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+-        case 1:
+-            {
+-                $_ngcc_current_state = 0;
++                $_ngcc_current_state = 18;
+                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 34:
++        case 26:
+             {
+-                if(($__uri.equals("") && $__local.equals("use"))) {
+-                    $_ngcc_current_state = 29;
++                if(($__uri.equals("") && $__local.equals("fixed"))) {
++                    $_ngcc_current_state = 17;
+                 }
+                 else {
+                     unexpectedLeaveAttribute($__qname);
+@@ -724,14 +727,11 @@
+                 }
+             }
+             break;
+-        case 21:
++        case 16:
+             {
+-                if(($__uri.equals("") && $__local.equals("ref"))) {
+-                    $_ngcc_current_state = 19;
+-                }
+-                else {
+-                    unexpectedLeaveAttribute($__qname);
+-                }
++                action4();
++                $_ngcc_current_state = 15;
++                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+         default:
+@@ -745,30 +745,32 @@
+     public void text(String $value) throws SAXException {
+         int $ai;
+         switch($_ngcc_current_state) {
+-        case 33:
++        case 12:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","use"))>=0) {
+-                    $runtime.consumeAttribute($ai);
+-                    $runtime.sendText(super._cookie, $value);
+-                }
+-                else {
+-                    $_ngcc_current_state = 29;
+-                    $runtime.sendText(super._cookie, $value);
+-                }
++                NGCCHandler h = new qname(this, super._source, $runtime, 412);
++                spawnChildFromText(h, $value);
+             }
+             break;
+-        case 19:
++        case 1:
+             {
+-                $_ngcc_current_state = 18;
++                $_ngcc_current_state = 0;
+                 $runtime.sendText(super._cookie, $value);
+             }
+             break;
+-        case 12:
++        case 13:
+             {
+-                NGCCHandler h = new qname(this, super._source, $runtime, 613);
+-                spawnChildFromText(h, $value);
++                if(($ai = $runtime.getAttributeIndex("","ref"))>=0) {
++                    $runtime.consumeAttribute($ai);
++                    $runtime.sendText(super._cookie, $value);
++                }
+             }
+             break;
++        case 27:
++            {
++                fixedValue = $value;
++                $_ngcc_current_state = 26;
++            }
++            break;
+         case 25:
+             {
+                 if(($ai = $runtime.getAttributeIndex("","fixed"))>=0) {
+@@ -781,85 +783,83 @@
+                 }
+             }
+             break;
+-        case 5:
++        case 8:
+             {
+-                $_ngcc_current_state = 1;
++                action2();
++                $_ngcc_current_state = 7;
+                 $runtime.sendText(super._cookie, $value);
+             }
+             break;
+-        case 35:
++        case 33:
+             {
+-                use = $value;
+-                $_ngcc_current_state = 34;
++                if(($ai = $runtime.getAttributeIndex("","use"))>=0) {
++                    $runtime.consumeAttribute($ai);
++                    $runtime.sendText(super._cookie, $value);
++                }
++                else {
++                    $_ngcc_current_state = 29;
++                    $runtime.sendText(super._cookie, $value);
++                }
+             }
+             break;
+-        case 8:
++        case 9:
+             {
+-                action2();
+-                $_ngcc_current_state = 7;
++                $_ngcc_current_state = 8;
+                 $runtime.sendText(super._cookie, $value);
+             }
+             break;
+         case 3:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","processContents"))>=0) {
+-                    NGCCHandler h = new wildcardBody(this, super._source, $runtime, 603, wloc);
++                if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) {
++                    NGCCHandler h = new wildcardBody(this, super._source, $runtime, 402, wloc);
+                     spawnChildFromText(h, $value);
+                 }
+                 else {
+-                    if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) {
+-                        NGCCHandler h = new wildcardBody(this, super._source, $runtime, 603, wloc);
++                    if(($ai = $runtime.getAttributeIndex("","processContents"))>=0) {
++                        NGCCHandler h = new wildcardBody(this, super._source, $runtime, 402, wloc);
+                         spawnChildFromText(h, $value);
+                     }
+                 }
+             }
+             break;
+-        case 16:
++        case 29:
+             {
+-                action4();
+-                $_ngcc_current_state = 15;
+-                $runtime.sendText(super._cookie, $value);
++                if(($ai = $runtime.getAttributeIndex("","default"))>=0) {
++                    $runtime.consumeAttribute($ai);
++                    $runtime.sendText(super._cookie, $value);
++                }
++                else {
++                    $_ngcc_current_state = 25;
++                    $runtime.sendText(super._cookie, $value);
++                }
+             }
+             break;
+-        case 27:
++        case 0:
+             {
+-                fixedValue = $value;
+-                $_ngcc_current_state = 26;
++                revertToParentFromText(this, super._cookie, $value);
+             }
+             break;
+-        case 31:
++        case 5:
+             {
+-                defaultValue = $value;
+-                $_ngcc_current_state = 30;
+-            }
+-            break;
+-        case 9:
+-            {
+-                $_ngcc_current_state = 8;
++                $_ngcc_current_state = 1;
+                 $runtime.sendText(super._cookie, $value);
+             }
+             break;
+-        case 29:
++        case 22:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","default"))>=0) {
+-                    $runtime.consumeAttribute($ai);
+-                    $runtime.sendText(super._cookie, $value);
+-                }
+-                else {
+-                    $_ngcc_current_state = 25;
+-                    $runtime.sendText(super._cookie, $value);
+-                }
++                NGCCHandler h = new qname(this, super._source, $runtime, 423);
++                spawnChildFromText(h, $value);
+             }
+             break;
+         case 17:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
+-                    NGCCHandler h = new attributeDeclBody(this, super._source, $runtime, 628, locator,true,defaultValue,fixedValue);
++                if(($ai = $runtime.getAttributeIndex("","form"))>=0) {
++                    NGCCHandler h = new attributeDeclBody(this, super._source, $runtime, 427, locator,true,defaultValue,fixedValue);
+                     spawnChildFromText(h, $value);
+                 }
+                 else {
+-                    if(($ai = $runtime.getAttributeIndex("","form"))>=0) {
+-                        NGCCHandler h = new attributeDeclBody(this, super._source, $runtime, 628, locator,true,defaultValue,fixedValue);
++                    if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
++                        NGCCHandler h = new attributeDeclBody(this, super._source, $runtime, 427, locator,true,defaultValue,fixedValue);
+                         spawnChildFromText(h, $value);
+                     }
+                     else {
+@@ -871,29 +871,29 @@
+                 }
+             }
+             break;
+-        case 0:
++        case 19:
+             {
+-                revertToParentFromText(this, super._cookie, $value);
++                $_ngcc_current_state = 18;
++                $runtime.sendText(super._cookie, $value);
+             }
+             break;
+-        case 22:
++        case 31:
+             {
+-                NGCCHandler h = new qname(this, super._source, $runtime, 624);
+-                spawnChildFromText(h, $value);
++                defaultValue = $value;
++                $_ngcc_current_state = 30;
+             }
+             break;
+-        case 13:
++        case 16:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","ref"))>=0) {
+-                    $runtime.consumeAttribute($ai);
+-                    $runtime.sendText(super._cookie, $value);
+-                }
++                action4();
++                $_ngcc_current_state = 15;
++                $runtime.sendText(super._cookie, $value);
+             }
+             break;
+-        case 1:
++        case 35:
+             {
+-                $_ngcc_current_state = 0;
+-                $runtime.sendText(super._cookie, $value);
++                use = $value;
++                $_ngcc_current_state = 34;
+             }
+             break;
+         }
+@@ -901,13 +901,13 @@
+ 
+     public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException {
+         switch($__cookie__) {
+-        case 621:
++        case 412:
+             {
+-                annotation = ((AnnotationImpl)$__result__);
+-                $_ngcc_current_state = 18;
++                groupName = ((UName)$__result__);
++                $_ngcc_current_state = 11;
+             }
+             break;
+-        case 603:
++        case 402:
+             {
+                 wildcard = ((WildcardImpl)$__result__);
+                 action0();
+@@ -914,31 +914,24 @@
+                 $_ngcc_current_state = 2;
+             }
+             break;
+-        case 610:
++        case 418:
+             {
+-                $_ngcc_current_state = 8;
+-            }
+-            break;
+-        case 628:
+-            {
+-                anonymousDecl = ((AttributeDeclImpl)$__result__);
+-                action6();
++                fa = ((ForeignAttributesImpl)$__result__);
+                 $_ngcc_current_state = 16;
+             }
+             break;
+-        case 619:
++        case 420:
+             {
+-                fa = ((ForeignAttributesImpl)$__result__);
+-                $_ngcc_current_state = 16;
++                annotation = ((AnnotationImpl)$__result__);
++                $_ngcc_current_state = 18;
+             }
+             break;
+-        case 613:
++        case 409:
+             {
+-                groupName = ((UName)$__result__);
+-                $_ngcc_current_state = 11;
++                $_ngcc_current_state = 8;
+             }
+             break;
+-        case 624:
++        case 423:
+             {
+                 attDeclName = ((UName)$__result__);
+                 action5();
+@@ -945,17 +938,23 @@
+                 $_ngcc_current_state = 21;
+             }
+             break;
++        case 427:
++            {
++                anonymousDecl = ((AttributeDeclImpl)$__result__);
++                action6();
++                $_ngcc_current_state = 16;
++            }
++            break;
+         }
+     }
+ 
+     public boolean accepted() {
+-        return((($_ngcc_current_state == 1) || (($_ngcc_current_state == 0) || ($_ngcc_current_state == 5))));
++        return((($_ngcc_current_state == 5) || (($_ngcc_current_state == 0) || ($_ngcc_current_state == 1))));
+     }
+ 
+-    
++
+       private Ref.Attribute decl;
+       private Locator wloc; // locator for wildcards
+       private Locator locator;
+-    
+-}
+ 
++}
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/complexType.java	Thu Jul 30 18:43:32 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/complexType.java	Thu Jul 30 18:43:31 2009
+@@ -37,9 +37,9 @@
+     import org.xml.sax.ContentHandler;
+     import org.xml.sax.helpers.*;
+     import java.util.*;
+-  
+ 
+ 
++
+ class complexType extends NGCCHandler {
+     private Integer finalValue;
+     private String name;
+@@ -72,32 +72,32 @@
+     }
+ 
+     private void action0()throws SAXException {
+-        
++
+             result.setContentType(explicitContent);
+-          
++
+ }
+ 
+     private void action1()throws SAXException {
+-        
++
+             baseType = $runtime.parser.schemaSet.anyType;
+             makeResult(XSType.RESTRICTION);
+-          
++
+ }
+ 
+     private void action2()throws SAXException {
+-        
++
+                 result.setExplicitContent(explicitContent);
+                 result.setContentType(
+                   buildComplexExtensionContentModel(explicitContent));
+-              
++
+ }
+ 
+     private void action3()throws SAXException {
+-        
++
+                   baseType = new DelayedRef.Type(
+                     $runtime, locator2, $runtime.currentSchema, baseTypeName );
+                   makeResult(XSType.EXTENSION);
+-                
++
+ }
+ 
+     private void action4()throws SAXException {
+@@ -105,17 +105,17 @@
+ }
+ 
+     private void action5()throws SAXException {
+-        
++
+                 result.setContentType(explicitContent);
+-              
++
+ }
+ 
+     private void action6()throws SAXException {
+-        
++
+                   baseType = new DelayedRef.Type(
+                     $runtime, locator2, $runtime.currentSchema, baseTypeName );
+                   makeResult(XSType.RESTRICTION);
+-                
++
+ }
+ 
+     private void action7()throws SAXException {
+@@ -123,18 +123,18 @@
+ }
+ 
+     private void action8()throws SAXException {
+-        
++
+                 contentType = new BaseContentRef($runtime,baseType);
+                 makeResult(XSType.EXTENSION);
+                 result.setContentType(contentType);
+-              
++
+ }
+ 
+     private void action9()throws SAXException {
+-        
++
+                   baseType = new DelayedRef.Type(
+                     $runtime, locator2, $runtime.currentSchema, baseTypeName );
+-                
++
+ }
+ 
+     private void action10()throws SAXException {
+@@ -142,10 +142,10 @@
+ }
+ 
+     private void action11()throws SAXException {
+-        
++
+                 makeResult(XSType.RESTRICTION);
+                 result.setContentType(contentType);
+-              
++
+ }
+ 
+     private void action12()throws SAXException {
+@@ -153,24 +153,24 @@
+ }
+ 
+     private void action13()throws SAXException {
+-        
++
+                 if(baseContentType==null) {
+                   // contentType of the base type, which must be a complex type
+                   baseContentType = new BaseContentSimpleTypeRef(baseType);
+                 }
+-                
++
+                 contentSimpleType = new RestrictionSimpleTypeImpl(
+                   $runtime.document, null/*?*/, locator2, null,
+                   null, true, Collections.EMPTY_SET, baseContentType );
+                 contentType = contentSimpleType;
+-              
++
+ }
+ 
+     private void action14()throws SAXException {
+-        
++
+                   baseType = new DelayedRef.Type(
+                     $runtime, locator2, $runtime.currentSchema, baseTypeName );
+-                
++
+ }
+ 
+     private void action15()throws SAXException {
+@@ -187,14 +187,42 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
+-        case 28:
++        case 7:
+             {
+-                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("extension")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("restriction"))))) {
+-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 113, fa);
++                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("restriction"))) {
++                    $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
++                    action7();
++                    $_ngcc_current_state = 24;
++                }
++                else {
++                    if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("extension"))) {
++                        $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
++                        action4();
++                        $_ngcc_current_state = 15;
++                    }
++                    else {
++                        unexpectedEnterElement($__qname);
++                    }
++                }
++            }
++            break;
++        case 38:
++            {
++                action8();
++                $_ngcc_current_state = 37;
++                $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
++            }
++            break;
++        case 48:
++            {
++                if((((((((((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minExclusive")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxExclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minInclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxInclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("totalDigits"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("fractionDigits"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("length"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxLength"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minLength"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("enumeration"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("whiteSpace"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("pattern")))) {
++                    NGCCHandler h = new facet(this, super._source, $runtime, 257);
+                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+-                    unexpectedEnterElement($__qname);
++                    action11();
++                    $_ngcc_current_state = 47;
++                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                 }
+             }
+             break;
+@@ -210,11 +238,11 @@
+                 }
+             }
+             break;
+-        case 47:
++        case 44:
+             {
+-                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("anyAttribute"))))) {
+-                    NGCCHandler h = new attributeUses(this, super._source, $runtime, 135, result);
+-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
++                if(($ai = $runtime.getAttributeIndex("","base"))>=0) {
++                    $runtime.consumeAttribute($ai);
++                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+                     unexpectedEnterElement($__qname);
+@@ -221,67 +249,40 @@
+                 }
+             }
+             break;
+-        case 18:
++        case 49:
+             {
+-                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any")) || (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence"))) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("anyAttribute")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup"))))))))) {
+-                    NGCCHandler h = new complexType_complexContent_body(this, super._source, $runtime, 100, result);
++                if((((((((((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minExclusive")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxExclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minInclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxInclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("totalDigits"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("fractionDigits"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("length"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxLength"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minLength"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("enumeration"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("whiteSpace"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("pattern")))) {
++                    NGCCHandler h = new facet(this, super._source, $runtime, 258);
+                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+-                    unexpectedEnterElement($__qname);
++                    $_ngcc_current_state = 48;
++                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                 }
+             }
+             break;
+-        case 52:
++        case 18:
+             {
+-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))) {
+-                    NGCCHandler h = new simpleType(this, super._source, $runtime, 143);
++                if((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence"))) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("anyAttribute")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group"))))))))) {
++                    NGCCHandler h = new complexType_complexContent_body(this, super._source, $runtime, 219, result);
+                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+-                    $_ngcc_current_state = 51;
+-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
++                    unexpectedEnterElement($__qname);
+                 }
+             }
+             break;
+-        case 38:
++        case 67:
+             {
+-                action8();
+-                $_ngcc_current_state = 37;
+-                $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+-            }
+-            break;
+-        case 61:
+-            {
+-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
+-                    NGCCHandler h = new annotation(this, super._source, $runtime, 155, annotation,AnnotationContext.COMPLEXTYPE_DECL);
++                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence"))) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexContent")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("anyAttribute")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleContent")))))))))))) {
++                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 284, fa);
+                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+-                    $_ngcc_current_state = 35;
+-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
++                    unexpectedEnterElement($__qname);
+                 }
+             }
+             break;
+-        case 35:
+-            {
+-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("restriction"))) {
+-                    $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
+-                    action15();
+-                    $_ngcc_current_state = 59;
+-                }
+-                else {
+-                    if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("extension"))) {
+-                        $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
+-                        action10();
+-                        $_ngcc_current_state = 44;
+-                    }
+-                    else {
+-                        unexpectedEnterElement($__qname);
+-                    }
+-                }
+-            }
+-            break;
+         case 88:
+             {
+                 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) {
+@@ -294,90 +295,101 @@
+                 }
+             }
+             break;
+-        case 48:
++        case 61:
+             {
+-                if((((((((((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minExclusive")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxExclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minInclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxInclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("totalDigits"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("fractionDigits"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("length"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxLength"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minLength"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("enumeration"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("whiteSpace"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("pattern")))) {
+-                    NGCCHandler h = new facet(this, super._source, $runtime, 138);
++                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
++                    NGCCHandler h = new annotation(this, super._source, $runtime, 274, annotation,AnnotationContext.COMPLEXTYPE_DECL);
+                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+-                    action11();
+-                    $_ngcc_current_state = 47;
++                    $_ngcc_current_state = 35;
+                     $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                 }
+             }
+             break;
+-        case 49:
++        case 28:
+             {
+-                if((((((((((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minExclusive")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxExclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minInclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxInclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("totalDigits"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("fractionDigits"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("length"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxLength"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minLength"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("enumeration"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("whiteSpace"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("pattern")))) {
+-                    NGCCHandler h = new facet(this, super._source, $runtime, 139);
++                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("restriction")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("extension"))))) {
++                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 232, fa);
+                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+-                    $_ngcc_current_state = 48;
+-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
++                    unexpectedEnterElement($__qname);
+                 }
+             }
+             break;
+-        case 59:
++        case 80:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","base"))>=0) {
++                if(($ai = $runtime.getAttributeIndex("","block"))>=0) {
+                     $runtime.consumeAttribute($ai);
+                     $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+-                    unexpectedEnterElement($__qname);
++                    $_ngcc_current_state = 76;
++                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                 }
+             }
+             break;
+-        case 39:
++        case 12:
+             {
+-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
+-                    NGCCHandler h = new annotation(this, super._source, $runtime, 126, annotation,AnnotationContext.COMPLEXTYPE_DECL);
++                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence"))) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("anyAttribute")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group")))))))))) {
++                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 212, fa);
+                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+-                    $_ngcc_current_state = 38;
+-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
++                    unexpectedEnterElement($__qname);
+                 }
+             }
+             break;
+-        case 2:
++        case 35:
+             {
+-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleContent"))) {
++                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("restriction"))) {
+                     $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
+-                    $_ngcc_current_state = 63;
++                    action15();
++                    $_ngcc_current_state = 59;
+                 }
+                 else {
+-                    if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexContent"))) {
++                    if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("extension"))) {
+                         $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
+-                        $_ngcc_current_state = 29;
++                        action10();
++                        $_ngcc_current_state = 44;
+                     }
+                     else {
+-                        if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any")) || (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence"))) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("anyAttribute")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup"))))))))) {
+-                            action1();
+-                            NGCCHandler h = new complexType_complexContent_body(this, super._source, $runtime, 86, result);
+-                            spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+-                        }
+-                        else {
+-                            unexpectedEnterElement($__qname);
+-                        }
++                        unexpectedEnterElement($__qname);
+                     }
+                 }
+             }
+             break;
+-        case 65:
++        case 76:
+             {
+-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
+-                    NGCCHandler h = new annotation(this, super._source, $runtime, 163, null,AnnotationContext.COMPLEXTYPE_DECL);
+-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
++                if(($ai = $runtime.getAttributeIndex("","final"))>=0) {
++                    $runtime.consumeAttribute($ai);
++                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+-                    $_ngcc_current_state = 2;
++                    $_ngcc_current_state = 72;
+                     $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                 }
+             }
+             break;
++        case 51:
++            {
++                action13();
++                $_ngcc_current_state = 49;
++                $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
++            }
++            break;
++        case 47:
++            {
++                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("anyAttribute")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute"))))) {
++                    NGCCHandler h = new attributeUses(this, super._source, $runtime, 254, result);
++                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
++                }
++                else {
++                    unexpectedEnterElement($__qname);
++                }
++            }
++            break;
+         case 68:
+             {
+                 if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
+@@ -401,40 +413,33 @@
+                 }
+             }
+             break;
+-        case 7:
++        case 37:
+             {
+-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("restriction"))) {
+-                    $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
+-                    action7();
+-                    $_ngcc_current_state = 24;
++                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("anyAttribute")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute"))))) {
++                    NGCCHandler h = new attributeUses(this, super._source, $runtime, 242, result);
++                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+-                    if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("extension"))) {
+-                        $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
+-                        action4();
+-                        $_ngcc_current_state = 15;
+-                    }
+-                    else {
+-                        unexpectedEnterElement($__qname);
+-                    }
++                    unexpectedEnterElement($__qname);
+                 }
+             }
+             break;
+-        case 24:
++        case 26:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","base"))>=0) {
+-                    $runtime.consumeAttribute($ai);
+-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
++                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
++                    NGCCHandler h = new annotation(this, super._source, $runtime, 230, annotation,AnnotationContext.COMPLEXTYPE_DECL);
++                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+-                    unexpectedEnterElement($__qname);
++                    $_ngcc_current_state = 7;
++                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                 }
+             }
+             break;
+-        case 21:
++        case 56:
+             {
+-                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any")) || (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence"))) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("anyAttribute")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup")))))))))) {
+-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 104, fa);
++                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("anyAttribute")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType")) || (((((((((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minExclusive")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxExclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minInclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxInclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("totalDigits"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("fractionDigits"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("length"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxLength"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minLength"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("enumeration"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("whiteSpace"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("pattern"))))))))) {
++                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 267, fa);
+                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+@@ -442,34 +447,33 @@
+                 }
+             }
+             break;
+-        case 54:
++        case 24:
+             {
+-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
+-                    NGCCHandler h = new annotation(this, super._source, $runtime, 146, annotation,AnnotationContext.COMPLEXTYPE_DECL);
+-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
++                if(($ai = $runtime.getAttributeIndex("","base"))>=0) {
++                    $runtime.consumeAttribute($ai);
++                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+-                    $_ngcc_current_state = 52;
+-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
++                    unexpectedEnterElement($__qname);
+                 }
+             }
+             break;
+-        case 80:
++        case 10:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","block"))>=0) {
+-                    $runtime.consumeAttribute($ai);
+-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
++                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
++                    NGCCHandler h = new annotation(this, super._source, $runtime, 210, annotation,AnnotationContext.COMPLEXTYPE_DECL);
++                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+-                    $_ngcc_current_state = 76;
++                    $_ngcc_current_state = 9;
+                     $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                 }
+             }
+             break;
+-        case 9:
++        case 41:
+             {
+-                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any")) || (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence"))) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("anyAttribute")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup"))))))))) {
+-                    NGCCHandler h = new complexType_complexContent_body(this, super._source, $runtime, 89, result);
++                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("anyAttribute")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute")))))) {
++                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 247, fa);
+                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+@@ -477,40 +481,58 @@
+                 }
+             }
+             break;
+-        case 51:
++        case 84:
+             {
+-                action13();
+-                $_ngcc_current_state = 49;
+-                $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
++                if(($ai = $runtime.getAttributeIndex("","abstract"))>=0) {
++                    $runtime.consumeAttribute($ai);
++                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
++                }
++                else {
++                    $_ngcc_current_state = 80;
++                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
++                }
+             }
+             break;
+-        case 12:
++        case 2:
+             {
+-                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any")) || (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence"))) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("anyAttribute")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup")))))))))) {
+-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 93, fa);
+-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
++                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleContent"))) {
++                    $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
++                    $_ngcc_current_state = 63;
+                 }
+                 else {
+-                    unexpectedEnterElement($__qname);
++                    if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexContent"))) {
++                        $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
++                        $_ngcc_current_state = 29;
++                    }
++                    else {
++                        if((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence"))) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("anyAttribute")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group"))))))))) {
++                            action1();
++                            NGCCHandler h = new complexType_complexContent_body(this, super._source, $runtime, 205, result);
++                            spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
++                        }
++                        else {
++                            unexpectedEnterElement($__qname);
++                        }
++                    }
+                 }
+             }
+             break;
+-        case 26:
++        case 65:
+             {
+                 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
+-                    NGCCHandler h = new annotation(this, super._source, $runtime, 111, annotation,AnnotationContext.COMPLEXTYPE_DECL);
++                    NGCCHandler h = new annotation(this, super._source, $runtime, 282, null,AnnotationContext.COMPLEXTYPE_DECL);
+                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+-                    $_ngcc_current_state = 7;
++                    $_ngcc_current_state = 2;
+                     $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                 }
+             }
+             break;
+-        case 67:
++        case 21:
+             {
+-                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexContent")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleContent")) || (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence"))) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("anyAttribute")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup")))))))))))) {
+-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 165, fa);
++                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence"))) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("anyAttribute")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group")))))))))) {
++                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 223, fa);
+                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+@@ -518,38 +540,38 @@
+                 }
+             }
+             break;
+-        case 10:
++        case 54:
+             {
+                 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
+-                    NGCCHandler h = new annotation(this, super._source, $runtime, 91, annotation,AnnotationContext.COMPLEXTYPE_DECL);
++                    NGCCHandler h = new annotation(this, super._source, $runtime, 265, annotation,AnnotationContext.COMPLEXTYPE_DECL);
+                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+-                    $_ngcc_current_state = 9;
++                    $_ngcc_current_state = 52;
+                     $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                 }
+             }
+             break;
+-        case 29:
++        case 52:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","mixed"))>=0) {
+-                    $runtime.consumeAttribute($ai);
+-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
++                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))) {
++                    NGCCHandler h = new simpleType(this, super._source, $runtime, 262);
++                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+-                    $_ngcc_current_state = 28;
++                    $_ngcc_current_state = 51;
+                     $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                 }
+             }
+             break;
+-        case 84:
++        case 39:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","abstract"))>=0) {
+-                    $runtime.consumeAttribute($ai);
+-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
++                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
++                    NGCCHandler h = new annotation(this, super._source, $runtime, 245, annotation,AnnotationContext.COMPLEXTYPE_DECL);
++                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+-                    $_ngcc_current_state = 80;
++                    $_ngcc_current_state = 38;
+                     $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                 }
+             }
+@@ -559,23 +581,23 @@
+                 revertToParentFromEnterElement(result, super._cookie, $__uri, $__local, $__qname, $attrs);
+             }
+             break;
+-        case 76:
++        case 29:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","final"))>=0) {
++                if(($ai = $runtime.getAttributeIndex("","mixed"))>=0) {
+                     $runtime.consumeAttribute($ai);
+                     $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+-                    $_ngcc_current_state = 72;
++                    $_ngcc_current_state = 28;
+                     $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                 }
+             }
+             break;
+-        case 44:
++        case 9:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","base"))>=0) {
+-                    $runtime.consumeAttribute($ai);
+-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
++                if((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence"))) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("anyAttribute")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group"))))))))) {
++                    NGCCHandler h = new complexType_complexContent_body(this, super._source, $runtime, 208, result);
++                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+                     unexpectedEnterElement($__qname);
+@@ -585,7 +607,7 @@
+         case 19:
+             {
+                 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
+-                    NGCCHandler h = new annotation(this, super._source, $runtime, 102, annotation,AnnotationContext.COMPLEXTYPE_DECL);
++                    NGCCHandler h = new annotation(this, super._source, $runtime, 221, annotation,AnnotationContext.COMPLEXTYPE_DECL);
+                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+@@ -594,10 +616,10 @@
+                 }
+             }
+             break;
+-        case 37:
++        case 63:
+             {
+-                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("anyAttribute"))))) {
+-                    NGCCHandler h = new attributeUses(this, super._source, $runtime, 123, result);
++                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("extension")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("restriction")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))))) {
++                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 276, fa);
+                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+@@ -605,11 +627,11 @@
+                 }
+             }
+             break;
+-        case 41:
++        case 59:
+             {
+-                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("anyAttribute")))))) {
+-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 128, fa);
+-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
++                if(($ai = $runtime.getAttributeIndex("","base"))>=0) {
++                    $runtime.consumeAttribute($ai);
++                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+                     unexpectedEnterElement($__qname);
+@@ -616,28 +638,6 @@
+                 }
+             }
+             break;
+-        case 56:
+-            {
+-                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType")) || ((((((((((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minExclusive")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxExclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minInclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxInclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("totalDigits"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("fractionDigits"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("length"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxLength"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minLength"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("enumeration"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("whiteSpace"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("pattern"))) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("anyAttribute")))))))) {
+-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 148, fa);
+-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+-                }
+-                else {
+-                    unexpectedEnterElement($__qname);
+-                }
+-            }
+-            break;
+-        case 63:
+-            {
+-                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("restriction")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("extension"))))) {
+-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 157, fa);
+-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+-                }
+-                else {
+-                    unexpectedEnterElement($__qname);
+-                }
+-            }
+-            break;
+         default:
+             {
+                 unexpectedEnterElement($__qname);
+@@ -652,11 +652,25 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
+-        case 1:
++        case 38:
+             {
+-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) {
++                action8();
++                $_ngcc_current_state = 37;
++                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
++            }
++            break;
++        case 48:
++            {
++                action11();
++                $_ngcc_current_state = 47;
++                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
++            }
++            break;
++        case 6:
++            {
++                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexContent"))) {
+                     $runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
+-                    $_ngcc_current_state = 0;
++                    $_ngcc_current_state = 1;
+                 }
+                 else {
+                     unexpectedLeaveElement($__qname);
+@@ -663,11 +677,11 @@
+                 }
+             }
+             break;
+-        case 8:
++        case 36:
+             {
+                 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("extension"))) {
+                     $runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
+-                    $_ngcc_current_state = 6;
++                    $_ngcc_current_state = 34;
+                 }
+                 else {
+                     unexpectedLeaveElement($__qname);
+@@ -674,6 +688,17 @@
+                 }
+             }
+             break;
++        case 44:
++            {
++                if(($ai = $runtime.getAttributeIndex("","base"))>=0) {
++                    $runtime.consumeAttribute($ai);
++                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
++                }
++                else {
++                    unexpectedLeaveElement($__qname);
++                }
++            }
++            break;
+         case 72:
+             {
+                 if(($ai = $runtime.getAttributeIndex("","mixed"))>=0) {
+@@ -686,21 +711,16 @@
+                 }
+             }
+             break;
+-        case 47:
++        case 49:
+             {
+-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("restriction"))) {
+-                    NGCCHandler h = new attributeUses(this, super._source, $runtime, 135, result);
+-                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
+-                }
+-                else {
+-                    unexpectedLeaveElement($__qname);
+-                }
++                $_ngcc_current_state = 48;
++                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+         case 18:
+             {
+                 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("restriction"))) {
+-                    NGCCHandler h = new complexType_complexContent_body(this, super._source, $runtime, 100, result);
++                    NGCCHandler h = new complexType_complexContent_body(this, super._source, $runtime, 219, result);
+                     spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
+                 }
+                 else {
+@@ -708,11 +728,11 @@
+                 }
+             }
+             break;
+-        case 46:
++        case 67:
+             {
+-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("restriction"))) {
+-                    $runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
+-                    $_ngcc_current_state = 34;
++                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) {
++                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 284, fa);
++                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
+                 }
+                 else {
+                     unexpectedLeaveElement($__qname);
+@@ -719,60 +739,69 @@
+                 }
+             }
+             break;
+-        case 52:
++        case 61:
+             {
+-                $_ngcc_current_state = 51;
++                $_ngcc_current_state = 35;
+                 $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 38:
++        case 34:
+             {
+-                action8();
+-                $_ngcc_current_state = 37;
+-                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
++                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleContent"))) {
++                    $runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
++                    $_ngcc_current_state = 1;
++                }
++                else {
++                    unexpectedLeaveElement($__qname);
++                }
+             }
+             break;
+-        case 61:
++        case 80:
+             {
+-                $_ngcc_current_state = 35;
+-                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
++                if(($ai = $runtime.getAttributeIndex("","block"))>=0) {
++                    $runtime.consumeAttribute($ai);
++                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
++                }
++                else {
++                    $_ngcc_current_state = 76;
++                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
++                }
+             }
+             break;
+-        case 48:
++        case 12:
+             {
+-                action11();
+-                $_ngcc_current_state = 47;
+-                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
++                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("extension"))) {
++                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 212, fa);
++                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
++                }
++                else {
++                    unexpectedLeaveElement($__qname);
++                }
+             }
+             break;
+-        case 49:
++        case 76:
+             {
+-                $_ngcc_current_state = 48;
+-                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+-        case 59:
+-            {
+-                if(($ai = $runtime.getAttributeIndex("","base"))>=0) {
++                if(($ai = $runtime.getAttributeIndex("","final"))>=0) {
+                     $runtime.consumeAttribute($ai);
+                     $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                 }
+                 else {
+-                    unexpectedLeaveElement($__qname);
++                    $_ngcc_current_state = 72;
++                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                 }
+             }
+             break;
+-        case 39:
++        case 51:
+             {
+-                $_ngcc_current_state = 38;
++                action13();
++                $_ngcc_current_state = 49;
+                 $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 2:
++        case 47:
+             {
+-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) {
+-                    action1();
+-                    NGCCHandler h = new complexType_complexContent_body(this, super._source, $runtime, 86, result);
++                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("restriction"))) {
++                    NGCCHandler h = new attributeUses(this, super._source, $runtime, 254, result);
+                     spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
+                 }
+                 else {
+@@ -780,12 +809,6 @@
+                 }
+             }
+             break;
+-        case 65:
+-            {
+-                $_ngcc_current_state = 2;
+-                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+         case 68:
+             {
+                 if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
+@@ -809,11 +832,11 @@
+                 }
+             }
+             break;
+-        case 24:
++        case 37:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","base"))>=0) {
+-                    $runtime.consumeAttribute($ai);
+-                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
++                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("extension"))) {
++                    NGCCHandler h = new attributeUses(this, super._source, $runtime, 242, result);
++                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
+                 }
+                 else {
+                     unexpectedLeaveElement($__qname);
+@@ -820,11 +843,11 @@
+                 }
+             }
+             break;
+-        case 21:
++        case 46:
+             {
+                 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("restriction"))) {
+-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 104, fa);
+-                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
++                    $runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
++                    $_ngcc_current_state = 34;
+                 }
+                 else {
+                     unexpectedLeaveElement($__qname);
+@@ -831,28 +854,44 @@
+                 }
+             }
+             break;
+-        case 54:
++        case 26:
+             {
+-                $_ngcc_current_state = 52;
++                $_ngcc_current_state = 7;
+                 $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 80:
++        case 56:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","block"))>=0) {
++                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("restriction"))) {
++                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 267, fa);
++                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
++                }
++                else {
++                    unexpectedLeaveElement($__qname);
++                }
++            }
++            break;
++        case 24:
++            {
++                if(($ai = $runtime.getAttributeIndex("","base"))>=0) {
+                     $runtime.consumeAttribute($ai);
+                     $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                 }
+                 else {
+-                    $_ngcc_current_state = 76;
+-                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
++                    unexpectedLeaveElement($__qname);
+                 }
+             }
+             break;
+-        case 9:
++        case 10:
+             {
++                $_ngcc_current_state = 9;
++                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
++            }
++            break;
++        case 41:
++            {
+                 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("extension"))) {
+-                    NGCCHandler h = new complexType_complexContent_body(this, super._source, $runtime, 89, result);
++                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 247, fa);
+                     spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
+                 }
+                 else {
+@@ -860,17 +899,23 @@
+                 }
+             }
+             break;
+-        case 51:
++        case 84:
+             {
+-                action13();
+-                $_ngcc_current_state = 49;
+-                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
++                if(($ai = $runtime.getAttributeIndex("","abstract"))>=0) {
++                    $runtime.consumeAttribute($ai);
++                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
++                }
++                else {
++                    $_ngcc_current_state = 80;
++                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
++                }
+             }
+             break;
+-        case 12:
++        case 2:
+             {
+-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("extension"))) {
+-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 93, fa);
++                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) {
++                    action1();
++                    NGCCHandler h = new complexType_complexContent_body(this, super._source, $runtime, 205, result);
+                     spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
+                 }
+                 else {
+@@ -878,9 +923,9 @@
+                 }
+             }
+             break;
+-        case 26:
++        case 65:
+             {
+-                $_ngcc_current_state = 7;
++                $_ngcc_current_state = 2;
+                 $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+@@ -895,10 +940,10 @@
+                 }
+             }
+             break;
+-        case 67:
++        case 21:
+             {
+-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) {
+-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 165, fa);
++                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("restriction"))) {
++                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 223, fa);
+                     spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
+                 }
+                 else {
+@@ -906,40 +951,29 @@
+                 }
+             }
+             break;
+-        case 10:
++        case 54:
+             {
+-                $_ngcc_current_state = 9;
++                $_ngcc_current_state = 52;
+                 $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 34:
++        case 52:
+             {
+-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleContent"))) {
+-                    $runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
+-                    $_ngcc_current_state = 1;
+-                }
+-                else {
+-                    unexpectedLeaveElement($__qname);
+-                }
++                $_ngcc_current_state = 51;
++                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 29:
++        case 39:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","mixed"))>=0) {
+-                    $runtime.consumeAttribute($ai);
+-                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+-                }
+-                else {
+-                    $_ngcc_current_state = 28;
+-                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+-                }
++                $_ngcc_current_state = 38;
++                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 6:
++        case 8:
+             {
+-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexContent"))) {
++                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("extension"))) {
+                     $runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
+-                    $_ngcc_current_state = 1;
++                    $_ngcc_current_state = 6;
+                 }
+                 else {
+                     unexpectedLeaveElement($__qname);
+@@ -946,15 +980,14 @@
+                 }
+             }
+             break;
+-        case 84:
++        case 1:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","abstract"))>=0) {
+-                    $runtime.consumeAttribute($ai);
+-                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
++                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) {
++                    $runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
++                    $_ngcc_current_state = 0;
+                 }
+                 else {
+-                    $_ngcc_current_state = 80;
+-                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
++                    unexpectedLeaveElement($__qname);
+                 }
+             }
+             break;
+@@ -963,23 +996,23 @@
+                 revertToParentFromLeaveElement(result, super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 76:
++        case 29:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","final"))>=0) {
++                if(($ai = $runtime.getAttributeIndex("","mixed"))>=0) {
+                     $runtime.consumeAttribute($ai);
+                     $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                 }
+                 else {
+-                    $_ngcc_current_state = 72;
++                    $_ngcc_current_state = 28;
+                     $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                 }
+             }
+             break;
+-        case 44:
++        case 9:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","base"))>=0) {
+-                    $runtime.consumeAttribute($ai);
+-                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
++                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("extension"))) {
++                    NGCCHandler h = new complexType_complexContent_body(this, super._source, $runtime, 208, result);
++                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
+                 }
+                 else {
+                     unexpectedLeaveElement($__qname);
+@@ -992,11 +1025,11 @@
+                 $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 37:
++        case 59:
+             {
+-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("extension"))) {
+-                    NGCCHandler h = new attributeUses(this, super._source, $runtime, 123, result);
+-                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
++                if(($ai = $runtime.getAttributeIndex("","base"))>=0) {
++                    $runtime.consumeAttribute($ai);
++                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                 }
+                 else {
+                     unexpectedLeaveElement($__qname);
+@@ -1003,57 +1036,49 @@
+                 }
+             }
+             break;
+-        case 41:
++        default:
+             {
+-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("extension"))) {
+-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 128, fa);
+-                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
+-                }
+-                else {
+-                    unexpectedLeaveElement($__qname);
+-                }
++                unexpectedLeaveElement($__qname);
+             }
+             break;
+-        case 56:
++        }
++    }
++
++    public void enterAttribute(String $__uri, String $__local, String $__qname) throws SAXException {
++        int $ai;
++        $uri = $__uri;
++        $localName = $__local;
++        $qname = $__qname;
++        switch($_ngcc_current_state) {
++        case 68:
+             {
+-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("restriction"))) {
+-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 148, fa);
+-                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
++                if(($__uri.equals("") && $__local.equals("name"))) {
++                    $_ngcc_current_state = 70;
+                 }
+                 else {
+-                    unexpectedLeaveElement($__qname);
++                    $_ngcc_current_state = 67;
++                    $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+                 }
+             }
+             break;
+-        case 36:
++        case 38:
+             {
+-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("extension"))) {
+-                    $runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
+-                    $_ngcc_current_state = 34;
+-                }
+-                else {
+-                    unexpectedLeaveElement($__qname);
+-                }
++                action8();
++                $_ngcc_current_state = 37;
++                $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        default:
++        case 48:
+             {
+-                unexpectedLeaveElement($__qname);
++                action11();
++                $_ngcc_current_state = 47;
++                $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        }
+-    }
+-
+-    public void enterAttribute(String $__uri, String $__local, String $__qname) throws SAXException {
+-        int $ai;
+-        $uri = $__uri;
+-        $localName = $__local;
+-        $qname = $__qname;
+-        switch($_ngcc_current_state) {
+-        case 59:
++        case 15:
+             {
+                 if(($__uri.equals("") && $__local.equals("base"))) {
+-                    $_ngcc_current_state = 58;
++                    $_ngcc_current_state = 14;
+                 }
+                 else {
+                     unexpectedEnterAttribute($__qname);
+@@ -1060,39 +1085,43 @@
+                 }
+             }
+             break;
+-        case 49:
++        case 26:
+             {
+-                $_ngcc_current_state = 48;
++                $_ngcc_current_state = 7;
+                 $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 39:
++        case 24:
+             {
+-                $_ngcc_current_state = 38;
+-                $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
++                if(($__uri.equals("") && $__local.equals("base"))) {
++                    $_ngcc_current_state = 23;
++                }
++                else {
++                    unexpectedEnterAttribute($__qname);
++                }
+             }
+             break;
+-        case 65:
++        case 10:
+             {
+-                $_ngcc_current_state = 2;
++                $_ngcc_current_state = 9;
+                 $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 68:
++        case 84:
+             {
+-                if(($__uri.equals("") && $__local.equals("name"))) {
+-                    $_ngcc_current_state = 70;
++                if(($__uri.equals("") && $__local.equals("abstract"))) {
++                    $_ngcc_current_state = 86;
+                 }
+                 else {
+-                    $_ngcc_current_state = 67;
++                    $_ngcc_current_state = 80;
+                     $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+                 }
+             }
+             break;
+-        case 15:
++        case 44:
+             {
+                 if(($__uri.equals("") && $__local.equals("base"))) {
+-                    $_ngcc_current_state = 14;
++                    $_ngcc_current_state = 43;
+                 }
+                 else {
+                     unexpectedEnterAttribute($__qname);
+@@ -1099,16 +1128,29 @@
+                 }
+             }
+             break;
+-        case 24:
++        case 72:
+             {
+-                if(($__uri.equals("") && $__local.equals("base"))) {
+-                    $_ngcc_current_state = 23;
++                if(($__uri.equals("") && $__local.equals("mixed"))) {
++                    $_ngcc_current_state = 74;
+                 }
+                 else {
+-                    unexpectedEnterAttribute($__qname);
++                    $_ngcc_current_state = 68;
++                    $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+                 }
+             }
+             break;
++        case 49:
++            {
++                $_ngcc_current_state = 48;
++                $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
++            }
++            break;
++        case 65:
++            {
++                $_ngcc_current_state = 2;
++                $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
++            }
++            break;
+         case 54:
+             {
+                 $_ngcc_current_state = 52;
+@@ -1115,43 +1157,36 @@
+                 $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 80:
++        case 52:
+             {
+-                if(($__uri.equals("") && $__local.equals("block"))) {
+-                    $_ngcc_current_state = 82;
+-                }
+-                else {
+-                    $_ngcc_current_state = 76;
+-                    $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+-                }
++                $_ngcc_current_state = 51;
++                $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 51:
++        case 39:
+             {
+-                action13();
+-                $_ngcc_current_state = 49;
++                $_ngcc_current_state = 38;
+                 $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 26:
++        case 61:
+             {
+-                $_ngcc_current_state = 7;
++                $_ngcc_current_state = 35;
+                 $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 10:
++        case 0:
+             {
+-                $_ngcc_current_state = 9;
+-                $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
++                revertToParentFromEnterAttribute(result, super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 72:
++        case 80:
+             {
+-                if(($__uri.equals("") && $__local.equals("mixed"))) {
+-                    $_ngcc_current_state = 74;
++                if(($__uri.equals("") && $__local.equals("block"))) {
++                    $_ngcc_current_state = 82;
+                 }
+                 else {
+-                    $_ngcc_current_state = 68;
++                    $_ngcc_current_state = 76;
+                     $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+                 }
+             }
+@@ -1167,22 +1202,6 @@
+                 }
+             }
+             break;
+-        case 84:
+-            {
+-                if(($__uri.equals("") && $__local.equals("abstract"))) {
+-                    $_ngcc_current_state = 86;
+-                }
+-                else {
+-                    $_ngcc_current_state = 80;
+-                    $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+-                }
+-            }
+-            break;
+-        case 0:
+-            {
+-                revertToParentFromEnterAttribute(result, super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+         case 76:
+             {
+                 if(($__uri.equals("") && $__local.equals("final"))) {
+@@ -1194,35 +1213,13 @@
+                 }
+             }
+             break;
+-        case 52:
++        case 51:
+             {
+-                $_ngcc_current_state = 51;
++                action13();
++                $_ngcc_current_state = 49;
+                 $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 44:
+-            {
+-                if(($__uri.equals("") && $__local.equals("base"))) {
+-                    $_ngcc_current_state = 43;
+-                }
+-                else {
+-                    unexpectedEnterAttribute($__qname);
+-                }
+-            }
+-            break;
+-        case 38:
+-            {
+-                action8();
+-                $_ngcc_current_state = 37;
+-                $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+-        case 61:
+-            {
+-                $_ngcc_current_state = 35;
+-                $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+         case 19:
+             {
+                 $_ngcc_current_state = 18;
+@@ -1229,11 +1226,14 @@
+                 $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 48:
++        case 59:
+             {
+-                action11();
+-                $_ngcc_current_state = 47;
+-                $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
++                if(($__uri.equals("") && $__local.equals("base"))) {
++                    $_ngcc_current_state = 58;
++                }
++                else {
++                    unexpectedEnterAttribute($__qname);
++                }
+             }
+             break;
+         default:
+@@ -1250,10 +1250,10 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
+-        case 42:
++        case 81:
+             {
+-                if(($__uri.equals("") && $__local.equals("base"))) {
+-                    $_ngcc_current_state = 41;
++                if(($__uri.equals("") && $__local.equals("block"))) {
++                    $_ngcc_current_state = 76;
+                 }
+                 else {
+                     unexpectedLeaveAttribute($__qname);
+@@ -1260,22 +1260,10 @@
+                 }
+             }
+             break;
+-        case 72:
++        case 22:
+             {
+-                $_ngcc_current_state = 68;
+-                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+-        case 52:
+-            {
+-                $_ngcc_current_state = 51;
+-                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+-        case 69:
+-            {
+-                if(($__uri.equals("") && $__local.equals("name"))) {
+-                    $_ngcc_current_state = 67;
++                if(($__uri.equals("") && $__local.equals("base"))) {
++                    $_ngcc_current_state = 21;
+                 }
+                 else {
+                     unexpectedLeaveAttribute($__qname);
+@@ -1289,16 +1277,17 @@
+                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 61:
++        case 48:
+             {
+-                $_ngcc_current_state = 35;
++                action11();
++                $_ngcc_current_state = 47;
+                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 81:
++        case 73:
+             {
+-                if(($__uri.equals("") && $__local.equals("block"))) {
+-                    $_ngcc_current_state = 76;
++                if(($__uri.equals("") && $__local.equals("mixed"))) {
++                    $_ngcc_current_state = 68;
+                 }
+                 else {
+                     unexpectedLeaveAttribute($__qname);
+@@ -1305,10 +1294,10 @@
+                 }
+             }
+             break;
+-        case 73:
++        case 30:
+             {
+                 if(($__uri.equals("") && $__local.equals("mixed"))) {
+-                    $_ngcc_current_state = 68;
++                    $_ngcc_current_state = 28;
+                 }
+                 else {
+                     unexpectedLeaveAttribute($__qname);
+@@ -1315,10 +1304,9 @@
+                 }
+             }
+             break;
+-        case 48:
++        case 72:
+             {
+-                action11();
+-                $_ngcc_current_state = 47;
++                $_ngcc_current_state = 68;
+                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+@@ -1328,28 +1316,22 @@
+                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 39:
++        case 61:
+             {
+-                $_ngcc_current_state = 38;
++                $_ngcc_current_state = 35;
+                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 65:
++        case 80:
+             {
+-                $_ngcc_current_state = 2;
++                $_ngcc_current_state = 76;
+                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 68:
++        case 69:
+             {
+-                $_ngcc_current_state = 67;
+-                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+-        case 57:
+-            {
+-                if(($__uri.equals("") && $__local.equals("base"))) {
+-                    $_ngcc_current_state = 56;
++                if(($__uri.equals("") && $__local.equals("name"))) {
++                    $_ngcc_current_state = 67;
+                 }
+                 else {
+                     unexpectedLeaveAttribute($__qname);
+@@ -1356,18 +1338,12 @@
+                 }
+             }
+             break;
+-        case 80:
++        case 76:
+             {
+-                $_ngcc_current_state = 76;
++                $_ngcc_current_state = 72;
+                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 54:
+-            {
+-                $_ngcc_current_state = 52;
+-                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+         case 51:
+             {
+                 action13();
+@@ -1375,28 +1351,26 @@
+                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 26:
++        case 77:
+             {
+-                $_ngcc_current_state = 7;
+-                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
++                if(($__uri.equals("") && $__local.equals("final"))) {
++                    $_ngcc_current_state = 72;
++                }
++                else {
++                    unexpectedLeaveAttribute($__qname);
++                }
+             }
+             break;
+-        case 10:
++        case 68:
+             {
+-                $_ngcc_current_state = 9;
++                $_ngcc_current_state = 67;
+                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 29:
++        case 85:
+             {
+-                $_ngcc_current_state = 28;
+-                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+-        case 22:
+-            {
+-                if(($__uri.equals("") && $__local.equals("base"))) {
+-                    $_ngcc_current_state = 21;
++                if(($__uri.equals("") && $__local.equals("abstract"))) {
++                    $_ngcc_current_state = 80;
+                 }
+                 else {
+                     unexpectedLeaveAttribute($__qname);
+@@ -1403,16 +1377,10 @@
+                 }
+             }
+             break;
+-        case 84:
++        case 13:
+             {
+-                $_ngcc_current_state = 80;
+-                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+-        case 77:
+-            {
+-                if(($__uri.equals("") && $__local.equals("final"))) {
+-                    $_ngcc_current_state = 72;
++                if(($__uri.equals("") && $__local.equals("base"))) {
++                    $_ngcc_current_state = 12;
+                 }
+                 else {
+                     unexpectedLeaveAttribute($__qname);
+@@ -1419,21 +1387,10 @@
+                 }
+             }
+             break;
+-        case 0:
++        case 42:
+             {
+-                revertToParentFromLeaveAttribute(result, super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+-        case 76:
+-            {
+-                $_ngcc_current_state = 72;
+-                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+-        case 30:
+-            {
+-                if(($__uri.equals("") && $__local.equals("mixed"))) {
+-                    $_ngcc_current_state = 28;
++                if(($__uri.equals("") && $__local.equals("base"))) {
++                    $_ngcc_current_state = 41;
+                 }
+                 else {
+                     unexpectedLeaveAttribute($__qname);
+@@ -1440,91 +1397,86 @@
+                 }
+             }
+             break;
+-        case 19:
++        case 10:
+             {
+-                $_ngcc_current_state = 18;
++                $_ngcc_current_state = 9;
+                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 85:
++        case 26:
+             {
+-                if(($__uri.equals("") && $__local.equals("abstract"))) {
+-                    $_ngcc_current_state = 80;
+-                }
+-                else {
+-                    unexpectedLeaveAttribute($__qname);
+-                }
++                $_ngcc_current_state = 7;
++                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 13:
++        case 84:
+             {
+-                if(($__uri.equals("") && $__local.equals("base"))) {
+-                    $_ngcc_current_state = 12;
+-                }
+-                else {
+-                    unexpectedLeaveAttribute($__qname);
+-                }
++                $_ngcc_current_state = 80;
++                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        default:
++        case 65:
+             {
+-                unexpectedLeaveAttribute($__qname);
++                $_ngcc_current_state = 2;
++                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        }
+-    }
+-
+-    public void text(String $value) throws SAXException {
+-        int $ai;
+-        switch($_ngcc_current_state) {
+-        case 82:
++        case 54:
+             {
+-                NGCCHandler h = new erSet(this, super._source, $runtime, 182);
+-                spawnChildFromText(h, $value);
++                $_ngcc_current_state = 52;
++                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 23:
++        case 52:
+             {
+-                NGCCHandler h = new qname(this, super._source, $runtime, 106);
+-                spawnChildFromText(h, $value);
++                $_ngcc_current_state = 51;
++                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 43:
++        case 39:
+             {
+-                NGCCHandler h = new qname(this, super._source, $runtime, 130);
+-                spawnChildFromText(h, $value);
++                $_ngcc_current_state = 38;
++                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 72:
++        case 57:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","mixed"))>=0) {
+-                    $runtime.consumeAttribute($ai);
+-                    $runtime.sendText(super._cookie, $value);
++                if(($__uri.equals("") && $__local.equals("base"))) {
++                    $_ngcc_current_state = 56;
+                 }
+                 else {
+-                    $_ngcc_current_state = 68;
+-                    $runtime.sendText(super._cookie, $value);
++                    unexpectedLeaveAttribute($__qname);
+                 }
+             }
+             break;
+-        case 58:
++        case 0:
+             {
+-                NGCCHandler h = new qname(this, super._source, $runtime, 150);
+-                spawnChildFromText(h, $value);
++                revertToParentFromLeaveAttribute(result, super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 31:
++        case 29:
+             {
+-                mixedValue = $value;
+-                $_ngcc_current_state = 30;
++                $_ngcc_current_state = 28;
++                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 52:
++        case 19:
+             {
+-                $_ngcc_current_state = 51;
+-                $runtime.sendText(super._cookie, $value);
++                $_ngcc_current_state = 18;
++                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
++        default:
++            {
++                unexpectedLeaveAttribute($__qname);
++            }
++            break;
++        }
++    }
++
++    public void text(String $value) throws SAXException {
++        int $ai;
++        switch($_ngcc_current_state) {
+         case 38:
+             {
+                 action8();
+@@ -1532,9 +1484,10 @@
+                 $runtime.sendText(super._cookie, $value);
+             }
+             break;
+-        case 61:
++        case 48:
+             {
+-                $_ngcc_current_state = 35;
++                action11();
++                $_ngcc_current_state = 47;
+                 $runtime.sendText(super._cookie, $value);
+             }
+             break;
+@@ -1544,21 +1497,32 @@
+                 $_ngcc_current_state = 69;
+             }
+             break;
+-        case 48:
++        case 82:
+             {
+-                action11();
+-                $_ngcc_current_state = 47;
+-                $runtime.sendText(super._cookie, $value);
++                NGCCHandler h = new erSet(this, super._source, $runtime, 301);
++                spawnChildFromText(h, $value);
+             }
+             break;
+-        case 49:
++        case 78:
+             {
+-                $_ngcc_current_state = 48;
+-                $runtime.sendText(super._cookie, $value);
++                NGCCHandler h = new erSet(this, super._source, $runtime, 296);
++                spawnChildFromText(h, $value);
+             }
+             break;
+-        case 59:
++        case 72:
+             {
++                if(($ai = $runtime.getAttributeIndex("","mixed"))>=0) {
++                    $runtime.consumeAttribute($ai);
++                    $runtime.sendText(super._cookie, $value);
++                }
++                else {
++                    $_ngcc_current_state = 68;
++                    $runtime.sendText(super._cookie, $value);
++                }
++            }
++            break;
++        case 44:
++            {
+                 if(($ai = $runtime.getAttributeIndex("","base"))>=0) {
+                     $runtime.consumeAttribute($ai);
+                     $runtime.sendText(super._cookie, $value);
+@@ -1565,30 +1529,42 @@
+                 }
+             }
+             break;
+-        case 39:
++        case 49:
+             {
+-                $_ngcc_current_state = 38;
++                $_ngcc_current_state = 48;
+                 $runtime.sendText(super._cookie, $value);
+             }
+             break;
+-        case 65:
++        case 31:
+             {
+-                $_ngcc_current_state = 2;
++                mixedValue = $value;
++                $_ngcc_current_state = 30;
++            }
++            break;
++        case 61:
++            {
++                $_ngcc_current_state = 35;
+                 $runtime.sendText(super._cookie, $value);
+             }
+             break;
+-        case 68:
++        case 80:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
++                if(($ai = $runtime.getAttributeIndex("","block"))>=0) {
+                     $runtime.consumeAttribute($ai);
+                     $runtime.sendText(super._cookie, $value);
+                 }
+                 else {
+-                    $_ngcc_current_state = 67;
++                    $_ngcc_current_state = 76;
+                     $runtime.sendText(super._cookie, $value);
+                 }
+             }
+             break;
++        case 14:
++            {
++                NGCCHandler h = new qname(this, super._source, $runtime, 214);
++                spawnChildFromText(h, $value);
++            }
++            break;
+         case 74:
+             {
+                 mixedValue = $value;
+@@ -1595,56 +1571,48 @@
+                 $_ngcc_current_state = 73;
+             }
+             break;
+-        case 15:
++        case 76:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","base"))>=0) {
++                if(($ai = $runtime.getAttributeIndex("","final"))>=0) {
+                     $runtime.consumeAttribute($ai);
+                     $runtime.sendText(super._cookie, $value);
+                 }
+-            }
+-            break;
+-        case 24:
+-            {
+-                if(($ai = $runtime.getAttributeIndex("","base"))>=0) {
+-                    $runtime.consumeAttribute($ai);
++                else {
++                    $_ngcc_current_state = 72;
+                     $runtime.sendText(super._cookie, $value);
+                 }
+             }
+             break;
+-        case 86:
++        case 51:
+             {
+-                abstractValue = $value;
+-                $_ngcc_current_state = 85;
+-            }
+-            break;
+-        case 54:
+-            {
+-                $_ngcc_current_state = 52;
++                action13();
++                $_ngcc_current_state = 49;
+                 $runtime.sendText(super._cookie, $value);
+             }
+             break;
+-        case 80:
++        case 68:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","block"))>=0) {
++                if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
+                     $runtime.consumeAttribute($ai);
+                     $runtime.sendText(super._cookie, $value);
+                 }
+                 else {
+-                    $_ngcc_current_state = 76;
++                    $_ngcc_current_state = 67;
+                     $runtime.sendText(super._cookie, $value);
+                 }
+             }
+             break;
+-        case 51:
++        case 15:
+             {
+-                action13();
+-                $_ngcc_current_state = 49;
+-                $runtime.sendText(super._cookie, $value);
++                if(($ai = $runtime.getAttributeIndex("","base"))>=0) {
++                    $runtime.consumeAttribute($ai);
++                    $runtime.sendText(super._cookie, $value);
++                }
+             }
+             break;
+-        case 78:
++        case 58:
+             {
+-                NGCCHandler h = new erSet(this, super._source, $runtime, 177);
++                NGCCHandler h = new qname(this, super._source, $runtime, 269);
+                 spawnChildFromText(h, $value);
+             }
+             break;
+@@ -1660,16 +1628,12 @@
+                 $runtime.sendText(super._cookie, $value);
+             }
+             break;
+-        case 29:
++        case 24:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","mixed"))>=0) {
++                if(($ai = $runtime.getAttributeIndex("","base"))>=0) {
+                     $runtime.consumeAttribute($ai);
+                     $runtime.sendText(super._cookie, $value);
+                 }
+-                else {
+-                    $_ngcc_current_state = 28;
+-                    $runtime.sendText(super._cookie, $value);
+-                }
+             }
+             break;
+         case 84:
+@@ -1684,35 +1648,63 @@
+                 }
+             }
+             break;
+-        case 14:
++        case 65:
+             {
+-                NGCCHandler h = new qname(this, super._source, $runtime, 95);
+-                spawnChildFromText(h, $value);
++                $_ngcc_current_state = 2;
++                $runtime.sendText(super._cookie, $value);
+             }
+             break;
++        case 54:
++            {
++                $_ngcc_current_state = 52;
++                $runtime.sendText(super._cookie, $value);
++            }
++            break;
++        case 52:
++            {
++                $_ngcc_current_state = 51;
++                $runtime.sendText(super._cookie, $value);
++            }
++            break;
++        case 39:
++            {
++                $_ngcc_current_state = 38;
++                $runtime.sendText(super._cookie, $value);
++            }
++            break;
+         case 0:
+             {
+                 revertToParentFromText(result, super._cookie, $value);
+             }
+             break;
+-        case 76:
++        case 86:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","final"))>=0) {
++                abstractValue = $value;
++                $_ngcc_current_state = 85;
++            }
++            break;
++        case 23:
++            {
++                NGCCHandler h = new qname(this, super._source, $runtime, 225);
++                spawnChildFromText(h, $value);
++            }
++            break;
++        case 29:
++            {
++                if(($ai = $runtime.getAttributeIndex("","mixed"))>=0) {
+                     $runtime.consumeAttribute($ai);
+                     $runtime.sendText(super._cookie, $value);
+                 }
+                 else {
+-                    $_ngcc_current_state = 72;
++                    $_ngcc_current_state = 28;
+                     $runtime.sendText(super._cookie, $value);
+                 }
+             }
+             break;
+-        case 44:
++        case 43:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","base"))>=0) {
+-                    $runtime.consumeAttribute($ai);
+-                    $runtime.sendText(super._cookie, $value);
+-                }
++                NGCCHandler h = new qname(this, super._source, $runtime, 249);
++                spawnChildFromText(h, $value);
+             }
+             break;
+         case 19:
+@@ -1721,107 +1713,109 @@
+                 $runtime.sendText(super._cookie, $value);
+             }
+             break;
++        case 59:
++            {
++                if(($ai = $runtime.getAttributeIndex("","base"))>=0) {
++                    $runtime.consumeAttribute($ai);
++                    $runtime.sendText(super._cookie, $value);
++                }
++            }
++            break;
+         }
+     }
+ 
+     public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException {
+         switch($__cookie__) {
+-        case 106:
++        case 257:
+             {
+-                baseTypeName = ((UName)$__result__);
+-                action6();
+-                $_ngcc_current_state = 22;
++                facet = ((XSFacet)$__result__);
++                action12();
++                $_ngcc_current_state = 48;
+             }
+             break;
+-        case 143:
++        case 301:
+             {
+-                baseContentType = ((SimpleTypeImpl)$__result__);
+-                $_ngcc_current_state = 51;
++                blockValue = ((Integer)$__result__);
++                $_ngcc_current_state = 81;
+             }
+             break;
+-        case 155:
++        case 258:
+             {
+-                annotation = ((AnnotationImpl)$__result__);
+-                $_ngcc_current_state = 35;
+-            }
+-            break;
+-        case 138:
+-            {
+                 facet = ((XSFacet)$__result__);
+                 action12();
+                 $_ngcc_current_state = 48;
+             }
+             break;
+-        case 139:
++        case 219:
+             {
+-                facet = ((XSFacet)$__result__);
+-                action12();
+-                $_ngcc_current_state = 48;
++                explicitContent = ((ContentTypeImpl)$__result__);
++                action5();
++                $_ngcc_current_state = 17;
+             }
+             break;
+-        case 86:
++        case 232:
+             {
+-                explicitContent = ((ContentTypeImpl)$__result__);
+-                action0();
+-                $_ngcc_current_state = 1;
++                fa = ((ForeignAttributesImpl)$__result__);
++                $_ngcc_current_state = 26;
+             }
+             break;
+-        case 89:
++        case 212:
+             {
+-                explicitContent = ((ContentTypeImpl)$__result__);
+-                action2();
+-                $_ngcc_current_state = 8;
++                fa = ((ForeignAttributesImpl)$__result__);
++                $_ngcc_current_state = 10;
+             }
+             break;
+-        case 177:
++        case 242:
+             {
+-                finalValue = ((Integer)$__result__);
+-                $_ngcc_current_state = 77;
++                $_ngcc_current_state = 36;
+             }
+             break;
+-        case 111:
++        case 267:
+             {
+-                annotation = ((AnnotationImpl)$__result__);
+-                $_ngcc_current_state = 7;
++                fa = ((ForeignAttributesImpl)$__result__);
++                $_ngcc_current_state = 54;
+             }
+             break;
+-        case 91:
++        case 210:
+             {
+                 annotation = ((AnnotationImpl)$__result__);
+                 $_ngcc_current_state = 9;
+             }
+             break;
+-        case 95:
++        case 247:
+             {
+-                baseTypeName = ((UName)$__result__);
+-                action3();
+-                $_ngcc_current_state = 13;
++                fa = ((ForeignAttributesImpl)$__result__);
++                $_ngcc_current_state = 39;
+             }
+             break;
+-        case 102:
++        case 205:
+             {
+-                annotation = ((AnnotationImpl)$__result__);
+-                $_ngcc_current_state = 18;
++                explicitContent = ((ContentTypeImpl)$__result__);
++                action0();
++                $_ngcc_current_state = 1;
+             }
+             break;
+-        case 123:
++        case 262:
+             {
+-                $_ngcc_current_state = 36;
++                baseContentType = ((SimpleTypeImpl)$__result__);
++                $_ngcc_current_state = 51;
+             }
+             break;
+-        case 113:
++        case 225:
+             {
+-                fa = ((ForeignAttributesImpl)$__result__);
+-                $_ngcc_current_state = 26;
++                baseTypeName = ((UName)$__result__);
++                action6();
++                $_ngcc_current_state = 22;
+             }
+             break;
+-        case 182:
++        case 208:
+             {
+-                blockValue = ((Integer)$__result__);
+-                $_ngcc_current_state = 81;
++                explicitContent = ((ContentTypeImpl)$__result__);
++                action2();
++                $_ngcc_current_state = 8;
+             }
+             break;
+-        case 130:
++        case 249:
+             {
+                 baseTypeName = ((UName)$__result__);
+                 action9();
+@@ -1828,79 +1822,85 @@
+                 $_ngcc_current_state = 42;
+             }
+             break;
+-        case 150:
++        case 296:
+             {
++                finalValue = ((Integer)$__result__);
++                $_ngcc_current_state = 77;
++            }
++            break;
++        case 284:
++            {
++                fa = ((ForeignAttributesImpl)$__result__);
++                $_ngcc_current_state = 65;
++            }
++            break;
++        case 274:
++            {
++                annotation = ((AnnotationImpl)$__result__);
++                $_ngcc_current_state = 35;
++            }
++            break;
++        case 214:
++            {
+                 baseTypeName = ((UName)$__result__);
+-                action14();
+-                $_ngcc_current_state = 57;
++                action3();
++                $_ngcc_current_state = 13;
+             }
+             break;
+-        case 135:
++        case 254:
+             {
+                 $_ngcc_current_state = 46;
+             }
+             break;
+-        case 100:
++        case 269:
+             {
+-                explicitContent = ((ContentTypeImpl)$__result__);
+-                action5();
+-                $_ngcc_current_state = 17;
++                baseTypeName = ((UName)$__result__);
++                action14();
++                $_ngcc_current_state = 57;
+             }
+             break;
+-        case 126:
++        case 230:
+             {
+                 annotation = ((AnnotationImpl)$__result__);
+-                $_ngcc_current_state = 38;
++                $_ngcc_current_state = 7;
+             }
+             break;
+-        case 163:
++        case 282:
+             {
+                 annotation = ((AnnotationImpl)$__result__);
+                 $_ngcc_current_state = 2;
+             }
+             break;
+-        case 146:
++        case 265:
+             {
+                 annotation = ((AnnotationImpl)$__result__);
+                 $_ngcc_current_state = 52;
+             }
+             break;
+-        case 104:
++        case 223:
+             {
+                 fa = ((ForeignAttributesImpl)$__result__);
+                 $_ngcc_current_state = 19;
+             }
+             break;
+-        case 93:
++        case 245:
+             {
+-                fa = ((ForeignAttributesImpl)$__result__);
+-                $_ngcc_current_state = 10;
++                annotation = ((AnnotationImpl)$__result__);
++                $_ngcc_current_state = 38;
+             }
+             break;
+-        case 165:
++        case 276:
+             {
+                 fa = ((ForeignAttributesImpl)$__result__);
+-                $_ngcc_current_state = 65;
++                $_ngcc_current_state = 61;
+             }
+             break;
+-        case 128:
++        case 221:
+             {
+-                fa = ((ForeignAttributesImpl)$__result__);
+-                $_ngcc_current_state = 39;
++                annotation = ((AnnotationImpl)$__result__);
++                $_ngcc_current_state = 18;
+             }
+             break;
+-        case 148:
+-            {
+-                fa = ((ForeignAttributesImpl)$__result__);
+-                $_ngcc_current_state = 54;
+-            }
+-            break;
+-        case 157:
+-            {
+-                fa = ((ForeignAttributesImpl)$__result__);
+-                $_ngcc_current_state = 61;
+-            }
+-            break;
+         }
+     }
+ 
+@@ -1908,17 +1908,17 @@
+         return(($_ngcc_current_state == 0));
+     }
+ 
+-    
++
+       private ComplexTypeImpl result;
+       private Ref.Type baseType;
+       private Ref.ContentType contentType;
+-      
++
+       // local variables for simpleContent/restriction
+       private Ref.SimpleType baseContentType;
+       private RestrictionSimpleTypeImpl contentSimpleType;
+-      
++
+       private Locator locator,locator2;
+-      
++
+       private static class BaseContentSimpleTypeRef implements Ref.SimpleType {
+         private final Ref.Type baseType;
+         private BaseContentSimpleTypeRef(Ref.Type _baseType ) { this.baseType = _baseType; }
+@@ -1926,16 +1926,16 @@
+           return (XSSimpleType)((XSComplexType)baseType.getType()).getContentType();
+         }
+       }
+-      
+-    
++
++
+       // baseType and contentType must be computed before calling this method.
+       private void makeResult( int derivationMethod ) {
+-      
++
+         if(finalValue==null)
+           finalValue = $runtime.finalDefault;
+         if(blockValue==null)
+           blockValue = $runtime.blockDefault;
+-        
++
+         result = new ComplexTypeImpl(
+             $runtime.document,
+             annotation,
+@@ -1951,10 +1951,10 @@
+             $runtime.parseBoolean(mixedValue)
+         );
+       }
+-      
++
+       // I had to make them static inner classes (as opposed to anonymous ones),
+       // so that they will not keep references to parser.
+-      
++
+       private static class BaseComplexTypeContentRef implements Ref.ContentType {
+         private final Ref.Type baseType;
+         private BaseComplexTypeContentRef(Ref.Type _baseType) { this.baseType = _baseType; }
+@@ -1969,7 +1969,7 @@
+         private final SchemaDocumentImpl currentDocument;
+         private InheritBaseContentTypeRef(
+           Ref.Type _baseType,XSContentType _explicitContent,NGCCRuntimeEx $runtime) {
+-          
++
+           this.baseType = _baseType;
+           this.currentDocument = $runtime.document;
+           expContent = _explicitContent;
+@@ -1976,7 +1976,7 @@
+           this.empty = $runtime.parser.schemaSet.empty;
+         }
+           public XSContentType getContentType() {
+-              XSContentType baseContentType = 
++              XSContentType baseContentType =
+                   ((XSComplexType)baseType.getType()).getContentType();
+               if(baseContentType==empty)
+                   return expContent;
+@@ -1989,14 +1989,13 @@
+                           (ParticleImpl)expContent}), null );
+           }
+       };
+-      
++
+       private Ref.ContentType buildComplexExtensionContentModel( XSContentType explicitContent ) {
+-        
++
+         if(explicitContent==$runtime.parser.schemaSet.empty)
+           return new BaseComplexTypeContentRef(baseType);
+         else
+           return new InheritBaseContentTypeRef(baseType,explicitContent,$runtime);
+       }
+-    
+-}
+ 
++}
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/complexType_complexContent_body.java	Thu Jul 30 18:43:37 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/complexType_complexContent_body.java	Thu Jul 30 18:43:37 2009
+@@ -37,9 +37,9 @@
+     import org.xml.sax.ContentHandler;
+     import org.xml.sax.helpers.*;
+     import java.util.*;
+-  
+ 
+ 
++
+ class complexType_complexContent_body extends NGCCHandler {
+     private AttributesHolder owner;
+     protected final NGCCRuntimeEx $runtime;
+@@ -65,7 +65,7 @@
+ 
+     private void action0()throws SAXException {
+         if(particle==null)
+- 	  particle = $runtime.parser.schemaSet.empty;
++          particle = $runtime.parser.schemaSet.empty;
+ }
+ 
+     public void enterElement(String $__uri, String $__local, String $__qname, Attributes $attrs) throws SAXException {
+@@ -81,12 +81,12 @@
+             break;
+         case 1:
+             {
+-                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("anyAttribute"))))) {
+-                    NGCCHandler h = new attributeUses(this, super._source, $runtime, 676, owner);
++                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("anyAttribute")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute"))))) {
++                    NGCCHandler h = new attributeUses(this, super._source, $runtime, 515, owner);
+                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+-                    NGCCHandler h = new attributeUses(this, super._source, $runtime, 676, owner);
++                    NGCCHandler h = new attributeUses(this, super._source, $runtime, 515, owner);
+                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                 }
+             }
+@@ -93,8 +93,8 @@
+             break;
+         case 2:
+             {
+-                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any")) || (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element")))))) {
+-                    NGCCHandler h = new particle(this, super._source, $runtime, 678);
++                if((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence"))) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element")))))) {
++                    NGCCHandler h = new particle(this, super._source, $runtime, 517);
+                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+@@ -124,7 +124,7 @@
+             break;
+         case 1:
+             {
+-                NGCCHandler h = new attributeUses(this, super._source, $runtime, 676, owner);
++                NGCCHandler h = new attributeUses(this, super._source, $runtime, 515, owner);
+                 spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
+             }
+             break;
+@@ -155,7 +155,7 @@
+             break;
+         case 1:
+             {
+-                NGCCHandler h = new attributeUses(this, super._source, $runtime, 676, owner);
++                NGCCHandler h = new attributeUses(this, super._source, $runtime, 515, owner);
+                 spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
+             }
+             break;
+@@ -186,7 +186,7 @@
+             break;
+         case 1:
+             {
+-                NGCCHandler h = new attributeUses(this, super._source, $runtime, 676, owner);
++                NGCCHandler h = new attributeUses(this, super._source, $runtime, 515, owner);
+                 spawnChildFromLeaveAttribute(h, $__uri, $__local, $__qname);
+             }
+             break;
+@@ -214,7 +214,7 @@
+             break;
+         case 1:
+             {
+-                NGCCHandler h = new attributeUses(this, super._source, $runtime, 676, owner);
++                NGCCHandler h = new attributeUses(this, super._source, $runtime, 515, owner);
+                 spawnChildFromText(h, $value);
+             }
+             break;
+@@ -229,13 +229,13 @@
+ 
+     public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException {
+         switch($__cookie__) {
+-        case 676:
++        case 515:
+             {
+                 action0();
+                 $_ngcc_current_state = 0;
+             }
+             break;
+-        case 678:
++        case 517:
+             {
+                 particle = ((ParticleImpl)$__result__);
+                 $_ngcc_current_state = 1;
+@@ -248,8 +248,7 @@
+         return(($_ngcc_current_state == 0));
+     }
+ 
+-    
++
+       private ContentTypeImpl particle;
+-    
+-}
+ 
++}
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/elementDeclBody.java	Thu Jul 30 18:43:41 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/elementDeclBody.java	Thu Jul 30 18:43:40 2009
+@@ -37,9 +37,9 @@
+     import org.xml.sax.ContentHandler;
+     import org.xml.sax.helpers.*;
+     import java.util.*;
+-  
+ 
+ 
++
+ class elementDeclBody extends NGCCHandler {
+     private Integer finalValue;
+     private String name;
+@@ -82,17 +82,17 @@
+ }
+ 
+     private void action1()throws SAXException {
+-        
++
+             type = new DelayedRef.Type(
+               $runtime, locator, $runtime.currentSchema, typeName );
+-          
++
+ }
+ 
+     private void action2()throws SAXException {
+-        
++
+           substHeadRef = new DelayedRef.Element(
+             $runtime, locator, $runtime.currentSchema, substRef );
+-        
++
+ }
+ 
+     private void action3()throws SAXException {
+@@ -105,10 +105,22 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
++        case 24:
++            {
++                if(($ai = $runtime.getAttributeIndex("","form"))>=0) {
++                    $runtime.consumeAttribute($ai);
++                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
++                }
++                else {
++                    $_ngcc_current_state = 23;
++                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
++                }
++            }
++            break;
+         case 0:
+             {
+                 if(((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique")))) {
+-                    NGCCHandler h = new identityConstraint(this, super._source, $runtime, 492);
++                    NGCCHandler h = new identityConstraint(this, super._source, $runtime, 451);
+                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+@@ -116,6 +128,18 @@
+                 }
+             }
+             break;
++        case 11:
++            {
++                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
++                    NGCCHandler h = new annotation(this, super._source, $runtime, 469, null,AnnotationContext.ELEMENT_DECL);
++                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
++                }
++                else {
++                    $_ngcc_current_state = 3;
++                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
++                }
++            }
++            break;
+         case 17:
+             {
+                 if(($ai = $runtime.getAttributeIndex("","nillable"))>=0) {
+@@ -140,27 +164,26 @@
+                 }
+             }
+             break;
+-        case 32:
++        case 1:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","default"))>=0) {
+-                    $runtime.consumeAttribute($ai);
+-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
++                if(((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique")))) {
++                    NGCCHandler h = new identityConstraint(this, super._source, $runtime, 452);
++                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+-                    $_ngcc_current_state = 28;
++                    $_ngcc_current_state = 0;
+                     $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                 }
+             }
+             break;
+-        case 44:
++        case 48:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","abstract"))>=0) {
+-                    $runtime.consumeAttribute($ai);
+-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
++                if(((($ai = $runtime.getAttributeIndex("","block"))>=0 && (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType")) || ((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique")))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType")))) || ((($ai = $runtime.getAttributeIndex("","default"))>=0 && (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType")) || ((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique")))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType")))) || ((($ai = $runtime.getAttributeIndex("","fixed"))>=0 && (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType")) || ((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique")))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType")))) || ((($ai = $runtime.getAttributeIndex("","abstract"))>=0 && (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType")) || ((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique")))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType")))) || ((($ai = $runtime.getAttributeIndex("","final"))>=0 && (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType")) || ((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique")))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType")))) || ((($ai = $runtime.getAttributeIndex("","form"))>=0 && (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType")) || ((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique")))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType")))) || (($ai = $runtime.getAttributeIndex("","name"))>=0 && (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType")) || ((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique")))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))))))))))) {
++                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 514, fa);
++                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+-                    $_ngcc_current_state = 40;
+-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
++                    unexpectedEnterElement($__qname);
+                 }
+             }
+             break;
+@@ -176,38 +199,27 @@
+                 }
+             }
+             break;
+-        case 11:
++        case 32:
+             {
+-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
+-                    NGCCHandler h = new annotation(this, super._source, $runtime, 510, null,AnnotationContext.ELEMENT_DECL);
+-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+-                }
+-                else {
+-                    $_ngcc_current_state = 3;
++                if(($ai = $runtime.getAttributeIndex("","default"))>=0) {
++                    $runtime.consumeAttribute($ai);
+                     $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                 }
+-            }
+-            break;
+-        case 1:
+-            {
+-                if(((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique")))) {
+-                    NGCCHandler h = new identityConstraint(this, super._source, $runtime, 493);
+-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+-                }
+                 else {
+-                    $_ngcc_current_state = 0;
++                    $_ngcc_current_state = 28;
+                     $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                 }
+             }
+             break;
+-        case 23:
++        case 13:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
++                if(($ai = $runtime.getAttributeIndex("","substitutionGroup"))>=0) {
+                     $runtime.consumeAttribute($ai);
+                     $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+-                    unexpectedEnterElement($__qname);
++                    $_ngcc_current_state = 11;
++                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                 }
+             }
+             break;
+@@ -214,12 +226,12 @@
+         case 3:
+             {
+                 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))) {
+-                    NGCCHandler h = new simpleType(this, super._source, $runtime, 505);
++                    NGCCHandler h = new simpleType(this, super._source, $runtime, 464);
+                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+                     if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) {
+-                        NGCCHandler h = new complexType(this, super._source, $runtime, 506);
++                        NGCCHandler h = new complexType(this, super._source, $runtime, 465);
+                         spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                     }
+                     else {
+@@ -235,49 +247,37 @@
+                 }
+             }
+             break;
+-        case 48:
++        case 40:
+             {
+-                if(((($ai = $runtime.getAttributeIndex("","default"))>=0 && (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) || ((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique")))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) || ((($ai = $runtime.getAttributeIndex("","block"))>=0 && (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) || ((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique")))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) || ((($ai = $runtime.getAttributeIndex("","fixed"))>=0 && (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) || ((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique")))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) || ((($ai = $runtime.getAttributeIndex("","abstract"))>=0 && (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) || ((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique")))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) || ((($ai = $runtime.getAttributeIndex("","form"))>=0 && (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) || ((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique")))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) || ((($ai = $runtime.getAttributeIndex("","name"))>=0 && (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) || ((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique")))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) || (($ai = $runtime.getAttributeIndex("","final"))>=0 && (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) || ((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique")))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))))))))))) {
+-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 555, fa);
+-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+-                }
+-                else {
+-                    unexpectedEnterElement($__qname);
+-                }
+-            }
+-            break;
+-        case 13:
+-            {
+-                if(($ai = $runtime.getAttributeIndex("","substitutionGroup"))>=0) {
++                if(($ai = $runtime.getAttributeIndex("","block"))>=0) {
+                     $runtime.consumeAttribute($ai);
+                     $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+-                    $_ngcc_current_state = 11;
++                    $_ngcc_current_state = 36;
+                     $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                 }
+             }
+             break;
+-        case 40:
++        case 23:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","block"))>=0) {
++                if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
+                     $runtime.consumeAttribute($ai);
+                     $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+-                    $_ngcc_current_state = 36;
+-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
++                    unexpectedEnterElement($__qname);
+                 }
+             }
+             break;
+-        case 24:
++        case 44:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","form"))>=0) {
++                if(($ai = $runtime.getAttributeIndex("","abstract"))>=0) {
+                     $runtime.consumeAttribute($ai);
+                     $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+-                    $_ngcc_current_state = 23;
++                    $_ngcc_current_state = 40;
+                     $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                 }
+             }
+@@ -296,11 +296,29 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
++        case 24:
++            {
++                if(($ai = $runtime.getAttributeIndex("","form"))>=0) {
++                    $runtime.consumeAttribute($ai);
++                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
++                }
++                else {
++                    $_ngcc_current_state = 23;
++                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
++                }
++            }
++            break;
+         case 0:
+             {
+                 revertToParentFromLeaveElement(makeResult(), super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
++        case 11:
++            {
++                $_ngcc_current_state = 3;
++                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
++            }
++            break;
+         case 17:
+             {
+                 if(($ai = $runtime.getAttributeIndex("","nillable"))>=0) {
+@@ -325,62 +343,56 @@
+                 }
+             }
+             break;
+-        case 32:
++        case 1:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","default"))>=0) {
+-                    $runtime.consumeAttribute($ai);
+-                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
++                $_ngcc_current_state = 0;
++                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
++            }
++            break;
++        case 48:
++            {
++                if((($ai = $runtime.getAttributeIndex("","block"))>=0 || (($ai = $runtime.getAttributeIndex("","default"))>=0 || (($ai = $runtime.getAttributeIndex("","fixed"))>=0 || (($ai = $runtime.getAttributeIndex("","abstract"))>=0 || (($ai = $runtime.getAttributeIndex("","final"))>=0 || (($ai = $runtime.getAttributeIndex("","form"))>=0 || ($ai = $runtime.getAttributeIndex("","name"))>=0))))))) {
++                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 514, fa);
++                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
+                 }
+                 else {
+-                    $_ngcc_current_state = 28;
+-                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
++                    unexpectedLeaveElement($__qname);
+                 }
+             }
+             break;
+-        case 44:
++        case 28:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","abstract"))>=0) {
++                if(($ai = $runtime.getAttributeIndex("","fixed"))>=0) {
+                     $runtime.consumeAttribute($ai);
+                     $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                 }
+                 else {
+-                    $_ngcc_current_state = 40;
++                    $_ngcc_current_state = 24;
+                     $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                 }
+             }
+             break;
+-        case 28:
++        case 32:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","fixed"))>=0) {
++                if(($ai = $runtime.getAttributeIndex("","default"))>=0) {
+                     $runtime.consumeAttribute($ai);
+                     $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                 }
+                 else {
+-                    $_ngcc_current_state = 24;
++                    $_ngcc_current_state = 28;
+                     $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                 }
+             }
+             break;
+-        case 11:
++        case 13:
+             {
+-                $_ngcc_current_state = 3;
+-                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+-        case 1:
+-            {
+-                $_ngcc_current_state = 0;
+-                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+-        case 23:
+-            {
+-                if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
++                if(($ai = $runtime.getAttributeIndex("","substitutionGroup"))>=0) {
+                     $runtime.consumeAttribute($ai);
+                     $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                 }
+                 else {
+-                    unexpectedLeaveElement($__qname);
++                    $_ngcc_current_state = 11;
++                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                 }
+             }
+             break;
+@@ -396,49 +408,37 @@
+                 }
+             }
+             break;
+-        case 48:
++        case 40:
+             {
+-                if((($ai = $runtime.getAttributeIndex("","default"))>=0 || (($ai = $runtime.getAttributeIndex("","block"))>=0 || (($ai = $runtime.getAttributeIndex("","fixed"))>=0 || (($ai = $runtime.getAttributeIndex("","abstract"))>=0 || (($ai = $runtime.getAttributeIndex("","form"))>=0 || (($ai = $runtime.getAttributeIndex("","name"))>=0 || ($ai = $runtime.getAttributeIndex("","final"))>=0))))))) {
+-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 555, fa);
+-                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
+-                }
+-                else {
+-                    unexpectedLeaveElement($__qname);
+-                }
+-            }
+-            break;
+-        case 13:
+-            {
+-                if(($ai = $runtime.getAttributeIndex("","substitutionGroup"))>=0) {
++                if(($ai = $runtime.getAttributeIndex("","block"))>=0) {
+                     $runtime.consumeAttribute($ai);
+                     $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                 }
+                 else {
+-                    $_ngcc_current_state = 11;
++                    $_ngcc_current_state = 36;
+                     $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                 }
+             }
+             break;
+-        case 40:
++        case 23:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","block"))>=0) {
++                if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
+                     $runtime.consumeAttribute($ai);
+                     $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                 }
+                 else {
+-                    $_ngcc_current_state = 36;
+-                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
++                    unexpectedLeaveElement($__qname);
+                 }
+             }
+             break;
+-        case 24:
++        case 44:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","form"))>=0) {
++                if(($ai = $runtime.getAttributeIndex("","abstract"))>=0) {
+                     $runtime.consumeAttribute($ai);
+                     $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                 }
+                 else {
+-                    $_ngcc_current_state = 23;
++                    $_ngcc_current_state = 40;
+                     $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                 }
+             }
+@@ -457,11 +457,28 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
++        case 24:
++            {
++                if(($__uri.equals("") && $__local.equals("form"))) {
++                    $_ngcc_current_state = 26;
++                }
++                else {
++                    $_ngcc_current_state = 23;
++                    $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
++                }
++            }
++            break;
+         case 0:
+             {
+                 revertToParentFromEnterAttribute(makeResult(), super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
++        case 11:
++            {
++                $_ngcc_current_state = 3;
++                $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
++            }
++            break;
+         case 17:
+             {
+                 if(($__uri.equals("") && $__local.equals("nillable"))) {
+@@ -484,25 +501,20 @@
+                 }
+             }
+             break;
+-        case 32:
++        case 1:
+             {
+-                if(($__uri.equals("") && $__local.equals("default"))) {
+-                    $_ngcc_current_state = 34;
+-                }
+-                else {
+-                    $_ngcc_current_state = 28;
+-                    $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+-                }
++                $_ngcc_current_state = 0;
++                $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 44:
++        case 48:
+             {
+-                if(($__uri.equals("") && $__local.equals("abstract"))) {
+-                    $_ngcc_current_state = 46;
++                if((($__uri.equals("") && $__local.equals("block")) || (($__uri.equals("") && $__local.equals("default")) || (($__uri.equals("") && $__local.equals("fixed")) || (($__uri.equals("") && $__local.equals("abstract")) || (($__uri.equals("") && $__local.equals("final")) || (($__uri.equals("") && $__local.equals("form")) || ($__uri.equals("") && $__local.equals("name"))))))))) {
++                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 514, fa);
++                    spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
+                 }
+                 else {
+-                    $_ngcc_current_state = 40;
+-                    $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
++                    unexpectedEnterAttribute($__qname);
+                 }
+             }
+             break;
+@@ -517,25 +529,25 @@
+                 }
+             }
+             break;
+-        case 11:
++        case 32:
+             {
+-                $_ngcc_current_state = 3;
+-                $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
++                if(($__uri.equals("") && $__local.equals("default"))) {
++                    $_ngcc_current_state = 34;
++                }
++                else {
++                    $_ngcc_current_state = 28;
++                    $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
++                }
+             }
+             break;
+-        case 1:
++        case 13:
+             {
+-                $_ngcc_current_state = 0;
+-                $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+-        case 23:
+-            {
+-                if(($__uri.equals("") && $__local.equals("name"))) {
+-                    $_ngcc_current_state = 22;
++                if(($__uri.equals("") && $__local.equals("substitutionGroup"))) {
++                    $_ngcc_current_state = 15;
+                 }
+                 else {
+-                    unexpectedEnterAttribute($__qname);
++                    $_ngcc_current_state = 11;
++                    $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+                 }
+             }
+             break;
+@@ -550,46 +562,34 @@
+                 }
+             }
+             break;
+-        case 48:
++        case 40:
+             {
+-                if((($__uri.equals("") && $__local.equals("default")) || (($__uri.equals("") && $__local.equals("block")) || (($__uri.equals("") && $__local.equals("fixed")) || (($__uri.equals("") && $__local.equals("abstract")) || (($__uri.equals("") && $__local.equals("form")) || (($__uri.equals("") && $__local.equals("name")) || ($__uri.equals("") && $__local.equals("final"))))))))) {
+-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 555, fa);
+-                    spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
++                if(($__uri.equals("") && $__local.equals("block"))) {
++                    $_ngcc_current_state = 42;
+                 }
+                 else {
+-                    unexpectedEnterAttribute($__qname);
+-                }
+-            }
+-            break;
+-        case 13:
+-            {
+-                if(($__uri.equals("") && $__local.equals("substitutionGroup"))) {
+-                    $_ngcc_current_state = 15;
+-                }
+-                else {
+-                    $_ngcc_current_state = 11;
++                    $_ngcc_current_state = 36;
+                     $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+                 }
+             }
+             break;
+-        case 40:
++        case 23:
+             {
+-                if(($__uri.equals("") && $__local.equals("block"))) {
+-                    $_ngcc_current_state = 42;
++                if(($__uri.equals("") && $__local.equals("name"))) {
++                    $_ngcc_current_state = 22;
+                 }
+                 else {
+-                    $_ngcc_current_state = 36;
+-                    $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
++                    unexpectedEnterAttribute($__qname);
+                 }
+             }
+             break;
+-        case 24:
++        case 44:
+             {
+-                if(($__uri.equals("") && $__local.equals("form"))) {
+-                    $_ngcc_current_state = 26;
++                if(($__uri.equals("") && $__local.equals("abstract"))) {
++                    $_ngcc_current_state = 46;
+                 }
+                 else {
+-                    $_ngcc_current_state = 23;
++                    $_ngcc_current_state = 40;
+                     $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+                 }
+             }
+@@ -608,27 +608,37 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
+-        case 17:
++        case 24:
+             {
+-                $_ngcc_current_state = 13;
++                $_ngcc_current_state = 23;
+                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 0:
++        case 45:
+             {
+-                revertToParentFromLeaveAttribute(makeResult(), super._cookie, $__uri, $__local, $__qname);
++                if(($__uri.equals("") && $__local.equals("abstract"))) {
++                    $_ngcc_current_state = 40;
++                }
++                else {
++                    unexpectedLeaveAttribute($__qname);
++                }
+             }
+             break;
+-        case 36:
++        case 29:
+             {
+-                $_ngcc_current_state = 32;
+-                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
++                if(($__uri.equals("") && $__local.equals("fixed"))) {
++                    $_ngcc_current_state = 24;
++                }
++                else {
++                    unexpectedLeaveAttribute($__qname);
++                }
+             }
+             break;
+-        case 25:
++        case 5:
+             {
+-                if(($__uri.equals("") && $__local.equals("form"))) {
+-                    $_ngcc_current_state = 23;
++                if(($__uri.equals("") && $__local.equals("type"))) {
++                    $_ngcc_current_state = 1;
++                    action1();
+                 }
+                 else {
+                     unexpectedLeaveAttribute($__qname);
+@@ -635,22 +645,34 @@
+                 }
+             }
+             break;
+-        case 44:
++        case 21:
+             {
+-                $_ngcc_current_state = 40;
+-                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
++                if(($__uri.equals("") && $__local.equals("name"))) {
++                    $_ngcc_current_state = 17;
++                }
++                else {
++                    unexpectedLeaveAttribute($__qname);
++                }
+             }
+             break;
+-        case 32:
++        case 18:
+             {
+-                $_ngcc_current_state = 28;
+-                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
++                if(($__uri.equals("") && $__local.equals("nillable"))) {
++                    $_ngcc_current_state = 13;
++                }
++                else {
++                    unexpectedLeaveAttribute($__qname);
++                }
+             }
+             break;
+-        case 28:
++        case 25:
+             {
+-                $_ngcc_current_state = 24;
+-                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
++                if(($__uri.equals("") && $__local.equals("form"))) {
++                    $_ngcc_current_state = 23;
++                }
++                else {
++                    unexpectedLeaveAttribute($__qname);
++                }
+             }
+             break;
+         case 11:
+@@ -659,20 +681,21 @@
+                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 1:
++        case 0:
+             {
+-                $_ngcc_current_state = 0;
++                revertToParentFromLeaveAttribute(makeResult(), super._cookie, $__uri, $__local, $__qname);
++            }
++            break;
++        case 17:
++            {
++                $_ngcc_current_state = 13;
+                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 18:
++        case 1:
+             {
+-                if(($__uri.equals("") && $__local.equals("nillable"))) {
+-                    $_ngcc_current_state = 13;
+-                }
+-                else {
+-                    unexpectedLeaveAttribute($__qname);
+-                }
++                $_ngcc_current_state = 0;
++                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+         case 37:
+@@ -685,21 +708,16 @@
+                 }
+             }
+             break;
+-        case 21:
++        case 36:
+             {
+-                if(($__uri.equals("") && $__local.equals("name"))) {
+-                    $_ngcc_current_state = 17;
+-                }
+-                else {
+-                    unexpectedLeaveAttribute($__qname);
+-                }
++                $_ngcc_current_state = 32;
++                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 5:
++        case 14:
+             {
+-                if(($__uri.equals("") && $__local.equals("type"))) {
+-                    $_ngcc_current_state = 1;
+-                    action1();
++                if(($__uri.equals("") && $__local.equals("substitutionGroup"))) {
++                    $_ngcc_current_state = 11;
+                 }
+                 else {
+                     unexpectedLeaveAttribute($__qname);
+@@ -706,10 +724,16 @@
+                 }
+             }
+             break;
+-        case 29:
++        case 28:
+             {
+-                if(($__uri.equals("") && $__local.equals("fixed"))) {
+-                    $_ngcc_current_state = 24;
++                $_ngcc_current_state = 24;
++                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
++            }
++            break;
++        case 41:
++            {
++                if(($__uri.equals("") && $__local.equals("block"))) {
++                    $_ngcc_current_state = 36;
+                 }
+                 else {
+                     unexpectedLeaveAttribute($__qname);
+@@ -716,12 +740,6 @@
+                 }
+             }
+             break;
+-        case 3:
+-            {
+-                $_ngcc_current_state = 1;
+-                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+         case 33:
+             {
+                 if(($__uri.equals("") && $__local.equals("default"))) {
+@@ -732,14 +750,10 @@
+                 }
+             }
+             break;
+-        case 14:
++        case 32:
+             {
+-                if(($__uri.equals("") && $__local.equals("substitutionGroup"))) {
+-                    $_ngcc_current_state = 11;
+-                }
+-                else {
+-                    unexpectedLeaveAttribute($__qname);
+-                }
++                $_ngcc_current_state = 28;
++                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+         case 13:
+@@ -748,19 +762,15 @@
+                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 45:
++        case 3:
+             {
+-                if(($__uri.equals("") && $__local.equals("abstract"))) {
+-                    $_ngcc_current_state = 40;
+-                }
+-                else {
+-                    unexpectedLeaveAttribute($__qname);
+-                }
++                $_ngcc_current_state = 1;
++                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 24:
++        case 44:
+             {
+-                $_ngcc_current_state = 23;
++                $_ngcc_current_state = 40;
+                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+@@ -770,16 +780,6 @@
+                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 41:
+-            {
+-                if(($__uri.equals("") && $__local.equals("block"))) {
+-                    $_ngcc_current_state = 36;
+-                }
+-                else {
+-                    unexpectedLeaveAttribute($__qname);
+-                }
+-            }
+-            break;
+         default:
+             {
+                 unexpectedLeaveAttribute($__qname);
+@@ -791,59 +791,24 @@
+     public void text(String $value) throws SAXException {
+         int $ai;
+         switch($_ngcc_current_state) {
+-        case 17:
++        case 24:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","nillable"))>=0) {
++                if(($ai = $runtime.getAttributeIndex("","form"))>=0) {
+                     $runtime.consumeAttribute($ai);
+                     $runtime.sendText(super._cookie, $value);
+                 }
+                 else {
+-                    $_ngcc_current_state = 13;
++                    $_ngcc_current_state = 23;
+                     $runtime.sendText(super._cookie, $value);
+                 }
+             }
+             break;
+-        case 0:
++        case 19:
+             {
+-                revertToParentFromText(makeResult(), super._cookie, $value);
++                nillable = $value;
++                $_ngcc_current_state = 18;
+             }
+             break;
+-        case 36:
+-            {
+-                if(($ai = $runtime.getAttributeIndex("","final"))>=0) {
+-                    $runtime.consumeAttribute($ai);
+-                    $runtime.sendText(super._cookie, $value);
+-                }
+-                else {
+-                    $_ngcc_current_state = 32;
+-                    $runtime.sendText(super._cookie, $value);
+-                }
+-            }
+-            break;
+-        case 44:
+-            {
+-                if(($ai = $runtime.getAttributeIndex("","abstract"))>=0) {
+-                    $runtime.consumeAttribute($ai);
+-                    $runtime.sendText(super._cookie, $value);
+-                }
+-                else {
+-                    $_ngcc_current_state = 40;
+-                    $runtime.sendText(super._cookie, $value);
+-                }
+-            }
+-            break;
+-        case 32:
+-            {
+-                if(($ai = $runtime.getAttributeIndex("","default"))>=0) {
+-                    $runtime.consumeAttribute($ai);
+-                    $runtime.sendText(super._cookie, $value);
+-                }
+-                else {
+-                    $_ngcc_current_state = 28;
+-                    $runtime.sendText(super._cookie, $value);
+-                }
+-            }
+-            break;
+         case 46:
+             {
+                 abstractValue = $value;
+@@ -850,34 +815,21 @@
+                 $_ngcc_current_state = 45;
+             }
+             break;
+-        case 30:
+-            {
+-                fixedValue = $value;
+-                $_ngcc_current_state = 29;
+-            }
+-            break;
+         case 6:
+             {
+-                NGCCHandler h = new qname(this, super._source, $runtime, 496);
++                NGCCHandler h = new qname(this, super._source, $runtime, 455);
+                 spawnChildFromText(h, $value);
+             }
+             break;
+-        case 28:
++        case 34:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","fixed"))>=0) {
+-                    $runtime.consumeAttribute($ai);
+-                    $runtime.sendText(super._cookie, $value);
+-                }
+-                else {
+-                    $_ngcc_current_state = 24;
+-                    $runtime.sendText(super._cookie, $value);
+-                }
++                defaultValue = $value;
++                $_ngcc_current_state = 33;
+             }
+             break;
+-        case 22:
++        case 0:
+             {
+-                name = $value;
+-                $_ngcc_current_state = 21;
++                revertToParentFromText(makeResult(), super._cookie, $value);
+             }
+             break;
+         case 11:
+@@ -889,101 +841,93 @@
+         case 26:
+             {
+                 if($value.equals("unqualified")) {
+-                    NGCCHandler h = new qualification(this, super._source, $runtime, 526);
++                    NGCCHandler h = new qualification(this, super._source, $runtime, 485);
+                     spawnChildFromText(h, $value);
+                 }
+                 else {
+                     if($value.equals("qualified")) {
+-                        NGCCHandler h = new qualification(this, super._source, $runtime, 526);
++                        NGCCHandler h = new qualification(this, super._source, $runtime, 485);
+                         spawnChildFromText(h, $value);
+                     }
+                 }
+             }
+             break;
+-        case 19:
++        case 17:
+             {
+-                nillable = $value;
+-                $_ngcc_current_state = 18;
+-            }
+-            break;
+-        case 1:
+-            {
+-                $_ngcc_current_state = 0;
+-                $runtime.sendText(super._cookie, $value);
+-            }
+-            break;
+-        case 23:
+-            {
+-                if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
++                if(($ai = $runtime.getAttributeIndex("","nillable"))>=0) {
+                     $runtime.consumeAttribute($ai);
+                     $runtime.sendText(super._cookie, $value);
+                 }
++                else {
++                    $_ngcc_current_state = 13;
++                    $runtime.sendText(super._cookie, $value);
++                }
+             }
+             break;
++        case 22:
++            {
++                name = $value;
++                $_ngcc_current_state = 21;
++            }
++            break;
+         case 38:
+             {
+-                NGCCHandler h = new erSet(this, super._source, $runtime, 541);
++                NGCCHandler h = new erSet(this, super._source, $runtime, 500);
+                 spawnChildFromText(h, $value);
+             }
+             break;
+-        case 15:
++        case 1:
+             {
+-                NGCCHandler h = new qname(this, super._source, $runtime, 513);
+-                spawnChildFromText(h, $value);
++                $_ngcc_current_state = 0;
++                $runtime.sendText(super._cookie, $value);
+             }
+             break;
+-        case 3:
++        case 36:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","type"))>=0) {
++                if(($ai = $runtime.getAttributeIndex("","final"))>=0) {
+                     $runtime.consumeAttribute($ai);
+                     $runtime.sendText(super._cookie, $value);
+                 }
+                 else {
+-                    $_ngcc_current_state = 1;
++                    $_ngcc_current_state = 32;
+                     $runtime.sendText(super._cookie, $value);
+                 }
+             }
+             break;
+-        case 42:
+-            {
+-                NGCCHandler h = new ersSet(this, super._source, $runtime, 546);
+-                spawnChildFromText(h, $value);
+-            }
+-            break;
+         case 48:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","final"))>=0) {
+-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 555, fa);
++                if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
++                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 514, fa);
+                     spawnChildFromText(h, $value);
+                 }
+                 else {
+-                    if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
+-                        NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 555, fa);
++                    if(($ai = $runtime.getAttributeIndex("","form"))>=0) {
++                        NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 514, fa);
+                         spawnChildFromText(h, $value);
+                     }
+                     else {
+-                        if(($ai = $runtime.getAttributeIndex("","form"))>=0) {
+-                            NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 555, fa);
++                        if(($ai = $runtime.getAttributeIndex("","final"))>=0) {
++                            NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 514, fa);
+                             spawnChildFromText(h, $value);
+                         }
+                         else {
+                             if(($ai = $runtime.getAttributeIndex("","abstract"))>=0) {
+-                                NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 555, fa);
++                                NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 514, fa);
+                                 spawnChildFromText(h, $value);
+                             }
+                             else {
+                                 if(($ai = $runtime.getAttributeIndex("","fixed"))>=0) {
+-                                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 555, fa);
++                                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 514, fa);
+                                     spawnChildFromText(h, $value);
+                                 }
+                                 else {
+-                                    if(($ai = $runtime.getAttributeIndex("","block"))>=0) {
+-                                        NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 555, fa);
++                                    if(($ai = $runtime.getAttributeIndex("","default"))>=0) {
++                                        NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 514, fa);
+                                         spawnChildFromText(h, $value);
+                                     }
+                                     else {
+-                                        if(($ai = $runtime.getAttributeIndex("","default"))>=0) {
+-                                            NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 555, fa);
++                                        if(($ai = $runtime.getAttributeIndex("","block"))>=0) {
++                                            NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 514, fa);
+                                             spawnChildFromText(h, $value);
+                                         }
+                                     }
+@@ -994,12 +938,30 @@
+                 }
+             }
+             break;
+-        case 34:
++        case 28:
+             {
+-                defaultValue = $value;
+-                $_ngcc_current_state = 33;
++                if(($ai = $runtime.getAttributeIndex("","fixed"))>=0) {
++                    $runtime.consumeAttribute($ai);
++                    $runtime.sendText(super._cookie, $value);
++                }
++                else {
++                    $_ngcc_current_state = 24;
++                    $runtime.sendText(super._cookie, $value);
++                }
+             }
+             break;
++        case 32:
++            {
++                if(($ai = $runtime.getAttributeIndex("","default"))>=0) {
++                    $runtime.consumeAttribute($ai);
++                    $runtime.sendText(super._cookie, $value);
++                }
++                else {
++                    $_ngcc_current_state = 28;
++                    $runtime.sendText(super._cookie, $value);
++                }
++            }
++            break;
+         case 13:
+             {
+                 if(($ai = $runtime.getAttributeIndex("","substitutionGroup"))>=0) {
+@@ -1012,18 +974,44 @@
+                 }
+             }
+             break;
+-        case 24:
++        case 15:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","form"))>=0) {
++                NGCCHandler h = new qname(this, super._source, $runtime, 472);
++                spawnChildFromText(h, $value);
++            }
++            break;
++        case 3:
++            {
++                if(($ai = $runtime.getAttributeIndex("","type"))>=0) {
+                     $runtime.consumeAttribute($ai);
+                     $runtime.sendText(super._cookie, $value);
+                 }
+                 else {
+-                    $_ngcc_current_state = 23;
++                    $_ngcc_current_state = 1;
+                     $runtime.sendText(super._cookie, $value);
+                 }
+             }
+             break;
++        case 44:
++            {
++                if(($ai = $runtime.getAttributeIndex("","abstract"))>=0) {
++                    $runtime.consumeAttribute($ai);
++                    $runtime.sendText(super._cookie, $value);
++                }
++                else {
++                    $_ngcc_current_state = 40;
++                    $runtime.sendText(super._cookie, $value);
++                }
++            }
++            break;
++        case 23:
++            {
++                if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
++                    $runtime.consumeAttribute($ai);
++                    $runtime.sendText(super._cookie, $value);
++                }
++            }
++            break;
+         case 40:
+             {
+                 if(($ai = $runtime.getAttributeIndex("","block"))>=0) {
+@@ -1036,44 +1024,42 @@
+                 }
+             }
+             break;
+-        }
+-    }
+-
+-    public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException {
+-        switch($__cookie__) {
+-        case 510:
++        case 42:
+             {
+-                annotation = ((AnnotationImpl)$__result__);
+-                $_ngcc_current_state = 3;
++                NGCCHandler h = new ersSet(this, super._source, $runtime, 505);
++                spawnChildFromText(h, $value);
+             }
+             break;
+-        case 546:
++        case 30:
+             {
+-                blockValue = ((Integer)$__result__);
+-                $_ngcc_current_state = 41;
++                fixedValue = $value;
++                $_ngcc_current_state = 29;
+             }
+             break;
+-        case 496:
++        }
++    }
++
++    public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException {
++        switch($__cookie__) {
++        case 455:
+             {
+                 typeName = ((UName)$__result__);
+                 $_ngcc_current_state = 5;
+             }
+             break;
+-        case 492:
++        case 464:
+             {
+-                idc = ((IdentityConstraintImpl)$__result__);
+-                action0();
+-                $_ngcc_current_state = 0;
++                type = ((SimpleTypeImpl)$__result__);
++                $_ngcc_current_state = 1;
+             }
+             break;
+-        case 526:
++        case 465:
+             {
+-                form = ((Boolean)$__result__).booleanValue();
+-                action3();
+-                $_ngcc_current_state = 25;
++                type = ((ComplexTypeImpl)$__result__);
++                $_ngcc_current_state = 1;
+             }
+             break;
+-        case 493:
++        case 451:
+             {
+                 idc = ((IdentityConstraintImpl)$__result__);
+                 action0();
+@@ -1080,45 +1066,59 @@
+                 $_ngcc_current_state = 0;
+             }
+             break;
+-        case 541:
++        case 469:
+             {
++                annotation = ((AnnotationImpl)$__result__);
++                $_ngcc_current_state = 3;
++            }
++            break;
++        case 500:
++            {
+                 finalValue = ((Integer)$__result__);
+                 $_ngcc_current_state = 37;
+             }
+             break;
+-        case 513:
++        case 505:
+             {
+-                substRef = ((UName)$__result__);
+-                action2();
+-                $_ngcc_current_state = 14;
++                blockValue = ((Integer)$__result__);
++                $_ngcc_current_state = 41;
+             }
+             break;
+-        case 505:
++        case 485:
+             {
+-                type = ((SimpleTypeImpl)$__result__);
+-                $_ngcc_current_state = 1;
++                form = ((Boolean)$__result__).booleanValue();
++                action3();
++                $_ngcc_current_state = 25;
+             }
+             break;
+-        case 506:
++        case 452:
+             {
+-                type = ((ComplexTypeImpl)$__result__);
+-                $_ngcc_current_state = 1;
++                idc = ((IdentityConstraintImpl)$__result__);
++                action0();
++                $_ngcc_current_state = 0;
+             }
+             break;
+-        case 555:
++        case 514:
+             {
+                 fa = ((ForeignAttributesImpl)$__result__);
+                 $_ngcc_current_state = 44;
+             }
+             break;
++        case 472:
++            {
++                substRef = ((UName)$__result__);
++                action2();
++                $_ngcc_current_state = 14;
++            }
++            break;
+         }
+     }
+ 
+     public boolean accepted() {
+-        return((($_ngcc_current_state == 13) || (($_ngcc_current_state == 17) || (($_ngcc_current_state == 3) || (($_ngcc_current_state == 1) || (($_ngcc_current_state == 0) || ($_ngcc_current_state == 11)))))));
++        return((($_ngcc_current_state == 1) || (($_ngcc_current_state == 17) || (($_ngcc_current_state == 11) || (($_ngcc_current_state == 0) || (($_ngcc_current_state == 3) || ($_ngcc_current_state == 13)))))));
+     }
+ 
+-    
++
+       private boolean form;
+       private boolean formSpecified;
+       private Ref.Type type;
+@@ -1125,29 +1125,29 @@
+       private List idcs = new ArrayList();  // identity constraints
+ 
+       private DelayedRef.Element substHeadRef;
+-      
++
+       private ElementDecl makeResult() {
+         if(finalValue==null)
+           finalValue = new Integer($runtime.finalDefault);
+         if(blockValue==null)
+           blockValue = new Integer($runtime.blockDefault);
+-        
++
+         if(!formSpecified)
+           form = $runtime.elementFormDefault;
+         if(isGlobal)  // global elements are always qualified
+           form = true;
+-        
++
+         String tns;
+         if(form)    tns = $runtime.currentSchema.getTargetNamespace();
+         else        tns = "";
+-        
++
+         if( type==null ) {
+-        	if( substHeadRef!=null )
+-        		type = new SubstGroupBaseTypeRef(substHeadRef);
+-        	else
+-        		type = $runtime.parser.schemaSet.anyType;
++                if( substHeadRef!=null )
++                        type = new SubstGroupBaseTypeRef(substHeadRef);
++                else
++                        type = $runtime.parser.schemaSet.anyType;
+         }
+-        
++
+         ElementDecl ed = new ElementDecl(
+             $runtime,
+             $runtime.document,
+@@ -1161,17 +1161,17 @@
+             $runtime.createXmlString(fixedValue),
+             $runtime.parseBoolean(nillable),
+             $runtime.parseBoolean(abstractValue),
++            (java.lang.Boolean)(formSpecified ? form : null),
+             type,
+             substHeadRef,
+             blockValue.intValue(),
+             finalValue.intValue(),
+             idcs);
+-        
++
+         // if this element has anonymous complex type, it will be set here.
+         if(type instanceof ComplexTypeImpl)
+           ((ComplexTypeImpl)type).setScope(ed);
+         return ed;
+       }
+-    
+-}
+ 
++}
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/erSet.java	Thu Jul 30 18:43:46 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/erSet.java	Thu Jul 30 18:43:45 2009
+@@ -37,9 +37,9 @@
+     import org.xml.sax.ContentHandler;
+     import org.xml.sax.helpers.*;
+     import java.util.*;
+-  
+ 
+ 
++
+ class erSet extends NGCCHandler {
+     private String v;
+     protected final NGCCRuntimeEx $runtime;
+@@ -141,6 +141,11 @@
+     public void text(String $value) throws SAXException {
+         int $ai;
+         switch($_ngcc_current_state) {
++        case 0:
++            {
++                revertToParentFromText(makeResult(), super._cookie, $value);
++            }
++            break;
+         case 1:
+             {
+                 v = $value;
+@@ -147,11 +152,6 @@
+                 $_ngcc_current_state = 0;
+             }
+             break;
+-        case 0:
+-            {
+-                revertToParentFromText(makeResult(), super._cookie, $value);
+-            }
+-            break;
+         }
+     }
+ 
+@@ -164,20 +164,19 @@
+         return(($_ngcc_current_state == 0));
+     }
+ 
+-    
++
+       private Integer makeResult() {
+         if(v==null)     return new Integer($runtime.finalDefault);
+-        
++
+         if(v.indexOf("#all")!=-1)
+             return new Integer(XSType.EXTENSION|XSType.RESTRICTION);
+-        
++
+         int r = 0;
+-        
++
+         if(v.indexOf("extension")!=-1)      r|=XSType.EXTENSION;
+         if(v.indexOf("restriction")!=-1)    r|=XSType.RESTRICTION;
+-        
++
+         return new Integer(r);
+       }
+-    
+-}
+ 
++}
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/ersSet.java	Thu Jul 30 18:43:49 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/ersSet.java	Thu Jul 30 18:43:49 2009
+@@ -37,9 +37,9 @@
+     import org.xml.sax.ContentHandler;
+     import org.xml.sax.helpers.*;
+     import java.util.*;
+-  
+ 
+ 
++
+ class ersSet extends NGCCHandler {
+     private String v;
+     protected final NGCCRuntimeEx $runtime;
+@@ -164,22 +164,21 @@
+         return(($_ngcc_current_state == 0));
+     }
+ 
+-    
++
+       private Integer makeResult() {
+         if(v==null)     return new Integer($runtime.blockDefault);
+-        
++
+         if(v.indexOf("#all")!=-1)
+             return new Integer(
+               XSType.EXTENSION|XSType.RESTRICTION|XSType.SUBSTITUTION);
+-        
++
+         int r = 0;
+-        
++
+         if(v.indexOf("extension")!=-1)      r|=XSType.EXTENSION;
+         if(v.indexOf("restriction")!=-1)    r|=XSType.RESTRICTION;
+         if(v.indexOf("substitution")!=-1)   r|=XSType.SUBSTITUTION;
+-        
++
+         return new Integer(r);
+       }
+-    
+-}
+ 
++}
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/facet.java	Thu Jul 30 18:43:53 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/facet.java	Thu Jul 30 18:43:52 2009
+@@ -37,9 +37,9 @@
+     import org.xml.sax.ContentHandler;
+     import org.xml.sax.helpers.*;
+     import java.util.*;
+-  
+ 
+ 
++
+ class facet extends NGCCHandler {
+     private AnnotationImpl annotation;
+     private String fixed;
+@@ -66,11 +66,11 @@
+     }
+ 
+     private void action0()throws SAXException {
+-        
+-    	result = new FacetImpl( $runtime.document,
+-    		annotation, locator, fa, $localName/*name of the facet*/,
+-    		$runtime.createXmlString(value), $runtime.parseBoolean(fixed) );
+-    
++
++        result = new FacetImpl( $runtime.document,
++                annotation, locator, fa, $localName/*name of the facet*/,
++                $runtime.createXmlString(value), $runtime.parseBoolean(fixed) );
++
+ }
+ 
+     private void action1()throws SAXException {
+@@ -95,17 +95,6 @@
+                 }
+             }
+             break;
+-        case 4:
+-            {
+-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
+-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 577, fa);
+-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+-                }
+-                else {
+-                    unexpectedEnterElement($__qname);
+-                }
+-            }
+-            break;
+         case 11:
+             {
+                 if(($ai = $runtime.getAttributeIndex("","value"))>=0) {
+@@ -117,15 +106,14 @@
+                 }
+             }
+             break;
+-        case 2:
++        case 4:
+             {
+                 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
+-                    NGCCHandler h = new annotation(this, super._source, $runtime, 575, null,AnnotationContext.SIMPLETYPE_DECL);
++                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 562, fa);
+                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+-                    $_ngcc_current_state = 1;
+-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
++                    unexpectedEnterElement($__qname);
+                 }
+             }
+             break;
+@@ -146,6 +134,18 @@
+                 revertToParentFromEnterElement(result, super._cookie, $__uri, $__local, $__qname, $attrs);
+             }
+             break;
++        case 2:
++            {
++                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
++                    NGCCHandler h = new annotation(this, super._source, $runtime, 560, null,AnnotationContext.SIMPLETYPE_DECL);
++                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
++                }
++                else {
++                    $_ngcc_current_state = 1;
++                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
++                }
++            }
++            break;
+         default:
+             {
+                 unexpectedEnterElement($__qname);
+@@ -160,6 +160,18 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
++        case 1:
++            {
++                if((((((((((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minExclusive")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxExclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minInclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxInclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("totalDigits"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("fractionDigits"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("length"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxLength"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minLength"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("enumeration"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("whiteSpace"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("pattern")))) {
++                    $runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
++                    $_ngcc_current_state = 0;
++                    action0();
++                }
++                else {
++                    unexpectedLeaveElement($__qname);
++                }
++            }
++            break;
+         case 5:
+             {
+                 if(($ai = $runtime.getAttributeIndex("","fixed"))>=0) {
+@@ -172,11 +184,11 @@
+                 }
+             }
+             break;
+-        case 4:
++        case 11:
+             {
+-                if((((((((((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minExclusive")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxExclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minInclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxInclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("totalDigits"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("fractionDigits"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("length"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxLength"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minLength"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("enumeration"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("whiteSpace"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("pattern")))) {
+-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 577, fa);
+-                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
++                if(($ai = $runtime.getAttributeIndex("","value"))>=0) {
++                    $runtime.consumeAttribute($ai);
++                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                 }
+                 else {
+                     unexpectedLeaveElement($__qname);
+@@ -183,11 +195,11 @@
+                 }
+             }
+             break;
+-        case 11:
++        case 4:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","value"))>=0) {
+-                    $runtime.consumeAttribute($ai);
+-                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
++                if((((((((((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minExclusive")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxExclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minInclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxInclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("totalDigits"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("fractionDigits"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("length"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxLength"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minLength"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("enumeration"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("whiteSpace"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("pattern")))) {
++                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 562, fa);
++                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
+                 }
+                 else {
+                     unexpectedLeaveElement($__qname);
+@@ -194,27 +206,15 @@
+                 }
+             }
+             break;
+-        case 2:
+-            {
+-                $_ngcc_current_state = 1;
+-                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+         case 0:
+             {
+                 revertToParentFromLeaveElement(result, super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 1:
++        case 2:
+             {
+-                if((((((((((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minExclusive")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxExclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minInclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxInclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("totalDigits"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("fractionDigits"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("length"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxLength"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minLength"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("enumeration"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("whiteSpace"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("pattern")))) {
+-                    $runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
+-                    $_ngcc_current_state = 0;
+-                    action0();
+-                }
+-                else {
+-                    unexpectedLeaveElement($__qname);
+-                }
++                $_ngcc_current_state = 1;
++                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+         default:
+@@ -252,6 +252,11 @@
+                 }
+             }
+             break;
++        case 0:
++            {
++                revertToParentFromEnterAttribute(result, super._cookie, $__uri, $__local, $__qname);
++            }
++            break;
+         case 2:
+             {
+                 $_ngcc_current_state = 1;
+@@ -258,11 +263,6 @@
+                 $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 0:
+-            {
+-                revertToParentFromEnterAttribute(result, super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+         default:
+             {
+                 unexpectedEnterAttribute($__qname);
+@@ -277,23 +277,6 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
+-        case 5:
+-            {
+-                $_ngcc_current_state = 4;
+-                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+-        case 2:
+-            {
+-                $_ngcc_current_state = 1;
+-                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+-        case 0:
+-            {
+-                revertToParentFromLeaveAttribute(result, super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+         case 9:
+             {
+                 if(($__uri.equals("") && $__local.equals("value"))) {
+@@ -304,6 +287,12 @@
+                 }
+             }
+             break;
++        case 5:
++            {
++                $_ngcc_current_state = 4;
++                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
++            }
++            break;
+         case 6:
+             {
+                 if(($__uri.equals("") && $__local.equals("fixed"))) {
+@@ -314,6 +303,17 @@
+                 }
+             }
+             break;
++        case 0:
++            {
++                revertToParentFromLeaveAttribute(result, super._cookie, $__uri, $__local, $__qname);
++            }
++            break;
++        case 2:
++            {
++                $_ngcc_current_state = 1;
++                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
++            }
++            break;
+         default:
+             {
+                 unexpectedLeaveAttribute($__qname);
+@@ -357,6 +357,11 @@
+                 $_ngcc_current_state = 6;
+             }
+             break;
++        case 0:
++            {
++                revertToParentFromText(result, super._cookie, $value);
++            }
++            break;
+         case 2:
+             {
+                 $_ngcc_current_state = 1;
+@@ -363,26 +368,21 @@
+                 $runtime.sendText(super._cookie, $value);
+             }
+             break;
+-        case 0:
+-            {
+-                revertToParentFromText(result, super._cookie, $value);
+-            }
+-            break;
+         }
+     }
+ 
+     public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException {
+         switch($__cookie__) {
+-        case 577:
++        case 560:
+             {
+-                fa = ((ForeignAttributesImpl)$__result__);
+-                $_ngcc_current_state = 2;
++                annotation = ((AnnotationImpl)$__result__);
++                $_ngcc_current_state = 1;
+             }
+             break;
+-        case 575:
++        case 562:
+             {
+-                annotation = ((AnnotationImpl)$__result__);
+-                $_ngcc_current_state = 1;
++                fa = ((ForeignAttributesImpl)$__result__);
++                $_ngcc_current_state = 2;
+             }
+             break;
+         }
+@@ -392,9 +392,8 @@
+         return(($_ngcc_current_state == 0));
+     }
+ 
+-    
+-  		private FacetImpl result;
+-  		private Locator locator;
+-  	
+-}
+ 
++                private FacetImpl result;
++                private Locator locator;
++
++}
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/foreignAttributes.java	Thu Jul 30 18:43:57 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/foreignAttributes.java	Thu Jul 30 18:43:56 2009
+@@ -37,9 +37,9 @@
+     import org.xml.sax.ContentHandler;
+     import org.xml.sax.helpers.*;
+     import java.util.*;
+-  
+ 
+ 
++
+ class foreignAttributes extends NGCCHandler {
+     private ForeignAttributesImpl current;
+     protected final NGCCRuntimeEx $runtime;
+@@ -159,10 +159,9 @@
+         return(($_ngcc_current_state == 0));
+     }
+ 
+-    
++
+       ForeignAttributesImpl makeResult() {
+         return $runtime.parseForeignAttributes(current);
+       }
+-    
+-}
+ 
++}
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/group.java	Thu Jul 30 18:44:00 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/group.java	Thu Jul 30 18:43:59 2009
+@@ -37,9 +37,9 @@
+     import org.xml.sax.ContentHandler;
+     import org.xml.sax.helpers.*;
+     import java.util.*;
+-  
+ 
+ 
++
+ class group extends NGCCHandler {
+     private AnnotationImpl annotation;
+     private String name;
+@@ -66,21 +66,21 @@
+     }
+ 
+     private void action0()throws SAXException {
+-        
+-    	result = new ModelGroupDeclImpl( $runtime.document,
+-    		annotation, loc, fa,
+-    		$runtime.currentSchema.getTargetNamespace(),
+-				name,
+-				term
+-			);
+-    
++
++        result = new ModelGroupDeclImpl( $runtime.document,
++                annotation, loc, fa,
++                $runtime.currentSchema.getTargetNamespace(),
++                                name,
++                                term
++                        );
++
+ }
+ 
+     private void action1()throws SAXException {
+-        
++
+         mloc = $runtime.copyLocator();
+         compositorName = $localName;
+-      
++
+ }
+ 
+     private void action2()throws SAXException {
+@@ -93,39 +93,34 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
+-        case 0:
++        case 11:
+             {
+-                revertToParentFromEnterElement(result, super._cookie, $__uri, $__local, $__qname, $attrs);
+-            }
+-            break;
+-        case 10:
+-            {
+-                if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
++                if(($ai = $runtime.getAttributeIndex("","ID"))>=0) {
+                     $runtime.consumeAttribute($ai);
+                     $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+-                    unexpectedEnterElement($__qname);
++                    $_ngcc_current_state = 10;
++                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                 }
+             }
+             break;
+-        case 6:
++        case 5:
+             {
+-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
+-                    NGCCHandler h = new annotation(this, super._source, $runtime, 233, null,AnnotationContext.MODELGROUP_DECL);
++                if(((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence")))) {
++                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 315, null);
+                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+-                    $_ngcc_current_state = 5;
+-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
++                    unexpectedEnterElement($__qname);
+                 }
+             }
+             break;
+-        case 3:
++        case 10:
+             {
+-                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any")) || (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))))))) {
+-                    NGCCHandler h = new modelGroupBody(this, super._source, $runtime, 229, mloc,compositorName);
+-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
++                if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
++                    $runtime.consumeAttribute($ai);
++                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+                     unexpectedEnterElement($__qname);
+@@ -132,12 +127,11 @@
+                 }
+             }
+             break;
+-        case 15:
++        case 4:
+             {
+-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group"))) {
++                if(((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence")))) {
+                     $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
+-                    action2();
+-                    $_ngcc_current_state = 11;
++                    $_ngcc_current_state = 3;
+                 }
+                 else {
+                     unexpectedEnterElement($__qname);
+@@ -144,10 +138,10 @@
+                 }
+             }
+             break;
+-        case 5:
++        case 3:
+             {
+-                if(((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence")))) {
+-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 231, null);
++                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence"))) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group"))))))) {
++                    NGCCHandler h = new modelGroupBody(this, super._source, $runtime, 313, mloc,compositorName);
+                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+@@ -155,11 +149,17 @@
+                 }
+             }
+             break;
+-        case 4:
++        case 0:
+             {
+-                if(((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence")))) {
++                revertToParentFromEnterElement(result, super._cookie, $__uri, $__local, $__qname, $attrs);
++            }
++            break;
++        case 15:
++            {
++                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group"))) {
+                     $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
+-                    $_ngcc_current_state = 3;
++                    action2();
++                    $_ngcc_current_state = 11;
+                 }
+                 else {
+                     unexpectedEnterElement($__qname);
+@@ -166,14 +166,14 @@
+                 }
+             }
+             break;
+-        case 11:
++        case 6:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","ID"))>=0) {
+-                    $runtime.consumeAttribute($ai);
+-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
++                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
++                    NGCCHandler h = new annotation(this, super._source, $runtime, 317, null,AnnotationContext.MODELGROUP_DECL);
++                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+-                    $_ngcc_current_state = 10;
++                    $_ngcc_current_state = 5;
+                     $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                 }
+             }
+@@ -192,33 +192,34 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
+-        case 0:
++        case 2:
+             {
+-                revertToParentFromLeaveElement(result, super._cookie, $__uri, $__local, $__qname);
++                if(((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence")))) {
++                    $runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
++                    $_ngcc_current_state = 1;
++                }
++                else {
++                    unexpectedLeaveElement($__qname);
++                }
+             }
+             break;
+-        case 10:
++        case 11:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
++                if(($ai = $runtime.getAttributeIndex("","ID"))>=0) {
+                     $runtime.consumeAttribute($ai);
+                     $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                 }
+                 else {
+-                    unexpectedLeaveElement($__qname);
++                    $_ngcc_current_state = 10;
++                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                 }
+             }
+             break;
+-        case 6:
++        case 10:
+             {
+-                $_ngcc_current_state = 5;
+-                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+-        case 2:
+-            {
+-                if(((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence")))) {
+-                    $runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
+-                    $_ngcc_current_state = 1;
++                if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
++                    $runtime.consumeAttribute($ai);
++                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                 }
+                 else {
+                     unexpectedLeaveElement($__qname);
+@@ -228,7 +229,7 @@
+         case 3:
+             {
+                 if(((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence")))) {
+-                    NGCCHandler h = new modelGroupBody(this, super._source, $runtime, 229, mloc,compositorName);
++                    NGCCHandler h = new modelGroupBody(this, super._source, $runtime, 313, mloc,compositorName);
+                     spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
+                 }
+                 else {
+@@ -248,18 +249,17 @@
+                 }
+             }
+             break;
+-        case 11:
++        case 0:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","ID"))>=0) {
+-                    $runtime.consumeAttribute($ai);
+-                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+-                }
+-                else {
+-                    $_ngcc_current_state = 10;
+-                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+-                }
++                revertToParentFromLeaveElement(result, super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
++        case 6:
++            {
++                $_ngcc_current_state = 5;
++                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
++            }
++            break;
+         default:
+             {
+                 unexpectedLeaveElement($__qname);
+@@ -274,9 +274,15 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
+-        case 0:
++        case 11:
+             {
+-                revertToParentFromEnterAttribute(result, super._cookie, $__uri, $__local, $__qname);
++                if(($__uri.equals("") && $__local.equals("ID"))) {
++                    $_ngcc_current_state = 13;
++                }
++                else {
++                    $_ngcc_current_state = 10;
++                    $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
++                }
+             }
+             break;
+         case 10:
+@@ -289,6 +295,11 @@
+                 }
+             }
+             break;
++        case 0:
++            {
++                revertToParentFromEnterAttribute(result, super._cookie, $__uri, $__local, $__qname);
++            }
++            break;
+         case 6:
+             {
+                 $_ngcc_current_state = 5;
+@@ -295,17 +306,6 @@
+                 $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 11:
+-            {
+-                if(($__uri.equals("") && $__local.equals("ID"))) {
+-                    $_ngcc_current_state = 13;
+-                }
+-                else {
+-                    $_ngcc_current_state = 10;
+-                    $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+-                }
+-            }
+-            break;
+         default:
+             {
+                 unexpectedEnterAttribute($__qname);
+@@ -320,11 +320,6 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
+-        case 0:
+-            {
+-                revertToParentFromLeaveAttribute(result, super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+         case 12:
+             {
+                 if(($__uri.equals("") && $__local.equals("ID"))) {
+@@ -335,6 +330,12 @@
+                 }
+             }
+             break;
++        case 11:
++            {
++                $_ngcc_current_state = 10;
++                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
++            }
++            break;
+         case 8:
+             {
+                 if(($__uri.equals("") && $__local.equals("name"))) {
+@@ -345,15 +346,14 @@
+                 }
+             }
+             break;
+-        case 6:
++        case 0:
+             {
+-                $_ngcc_current_state = 5;
+-                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
++                revertToParentFromLeaveAttribute(result, super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 11:
++        case 6:
+             {
+-                $_ngcc_current_state = 10;
++                $_ngcc_current_state = 5;
+                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+@@ -368,16 +368,18 @@
+     public void text(String $value) throws SAXException {
+         int $ai;
+         switch($_ngcc_current_state) {
+-        case 0:
++        case 11:
+             {
+-                revertToParentFromText(result, super._cookie, $value);
++                if(($ai = $runtime.getAttributeIndex("","ID"))>=0) {
++                    $runtime.consumeAttribute($ai);
++                    $runtime.sendText(super._cookie, $value);
++                }
++                else {
++                    $_ngcc_current_state = 10;
++                    $runtime.sendText(super._cookie, $value);
++                }
+             }
+             break;
+-        case 13:
+-            {
+-                $_ngcc_current_state = 12;
+-            }
+-            break;
+         case 10:
+             {
+                 if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
+@@ -386,22 +388,14 @@
+                 }
+             }
+             break;
+-        case 6:
++        case 13:
+             {
+-                $_ngcc_current_state = 5;
+-                $runtime.sendText(super._cookie, $value);
++                $_ngcc_current_state = 12;
+             }
+             break;
+-        case 11:
++        case 0:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","ID"))>=0) {
+-                    $runtime.consumeAttribute($ai);
+-                    $runtime.sendText(super._cookie, $value);
+-                }
+-                else {
+-                    $_ngcc_current_state = 10;
+-                    $runtime.sendText(super._cookie, $value);
+-                }
++                revertToParentFromText(result, super._cookie, $value);
+             }
+             break;
+         case 9:
+@@ -410,18 +404,30 @@
+                 $_ngcc_current_state = 8;
+             }
+             break;
++        case 6:
++            {
++                $_ngcc_current_state = 5;
++                $runtime.sendText(super._cookie, $value);
++            }
++            break;
+         }
+     }
+ 
+     public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException {
+         switch($__cookie__) {
+-        case 233:
++        case 313:
+             {
++                term = ((ModelGroupImpl)$__result__);
++                $_ngcc_current_state = 2;
++            }
++            break;
++        case 317:
++            {
+                 annotation = ((AnnotationImpl)$__result__);
+                 $_ngcc_current_state = 5;
+             }
+             break;
+-        case 231:
++        case 315:
+             {
+                 fa = ((ForeignAttributesImpl)$__result__);
+                 action1();
+@@ -428,12 +434,6 @@
+                 $_ngcc_current_state = 4;
+             }
+             break;
+-        case 229:
+-            {
+-                term = ((ModelGroupImpl)$__result__);
+-                $_ngcc_current_state = 2;
+-            }
+-            break;
+         }
+     }
+ 
+@@ -441,10 +441,9 @@
+         return(($_ngcc_current_state == 0));
+     }
+ 
+-    
+-  		private ModelGroupDeclImpl result;
+-  		private Locator loc,mloc;
+-  		private String compositorName;
+-  	
+-}
+ 
++                private ModelGroupDeclImpl result;
++                private Locator loc,mloc;
++                private String compositorName;
++
++}
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/identityConstraint.java	Thu Jul 30 18:44:04 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/identityConstraint.java	Thu Jul 30 18:44:03 2009
+@@ -37,9 +37,9 @@
+     import org.xml.sax.ContentHandler;
+     import org.xml.sax.helpers.*;
+     import java.util.*;
+-  
+ 
+ 
++
+ class identityConstraint extends NGCCHandler {
+     private String name;
+     private UName ref;
+@@ -71,10 +71,10 @@
+ }
+ 
+     private void action1()throws SAXException {
+-        
++
+             refer = new DelayedRef.IdentityConstraint(
+               $runtime, $runtime.copyLocator(), $runtime.currentSchema, ref );
+-          
++
+ }
+ 
+     private void action2()throws SAXException {
+@@ -94,14 +94,15 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
+-        case 7:
++        case 10:
+             {
+-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("selector"))) {
+-                    $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
+-                    $_ngcc_current_state = 6;
++                if(($ai = $runtime.getAttributeIndex("","refer"))>=0) {
++                    $runtime.consumeAttribute($ai);
++                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+-                    unexpectedEnterElement($__qname);
++                    $_ngcc_current_state = 8;
++                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                 }
+             }
+             break;
+@@ -108,7 +109,7 @@
+         case 6:
+             {
+                 if(($ai = $runtime.getAttributeIndex("","xpath"))>=0) {
+-                    NGCCHandler h = new xpath(this, super._source, $runtime, 251);
++                    NGCCHandler h = new xpath(this, super._source, $runtime, 653);
+                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+@@ -116,27 +117,21 @@
+                 }
+             }
+             break;
+-        case 10:
++        case 16:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","refer"))>=0) {
++                if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
+                     $runtime.consumeAttribute($ai);
+                     $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+-                    $_ngcc_current_state = 8;
+-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
++                    unexpectedEnterElement($__qname);
+                 }
+             }
+             break;
+-        case 0:
++        case 17:
+             {
+-                revertToParentFromEnterElement(makeResult(), super._cookie, $__uri, $__local, $__qname, $attrs);
+-            }
+-            break;
+-        case 3:
+-            {
+-                if(($ai = $runtime.getAttributeIndex("","xpath"))>=0) {
+-                    NGCCHandler h = new xpath(this, super._source, $runtime, 247);
++                if((($ai = $runtime.getAttributeIndex("","name"))>=0 && (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("selector"))))) {
++                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 666, null);
+                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+@@ -144,11 +139,17 @@
+                 }
+             }
+             break;
+-        case 16:
++        case 0:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
+-                    $runtime.consumeAttribute($ai);
+-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
++                revertToParentFromEnterElement(makeResult(), super._cookie, $__uri, $__local, $__qname, $attrs);
++            }
++            break;
++        case 18:
++            {
++                if(((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique")))) {
++                    $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
++                    action2();
++                    $_ngcc_current_state = 17;
+                 }
+                 else {
+                     unexpectedEnterElement($__qname);
+@@ -155,15 +156,14 @@
+                 }
+             }
+             break;
+-        case 8:
++        case 1:
+             {
+-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
+-                    NGCCHandler h = new annotation(this, super._source, $runtime, 254, null,AnnotationContext.IDENTITY_CONSTRAINT);
+-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
++                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("field"))) {
++                    $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
++                    $_ngcc_current_state = 3;
+                 }
+                 else {
+-                    $_ngcc_current_state = 7;
+-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
++                    unexpectedEnterElement($__qname);
+                 }
+             }
+             break;
+@@ -178,22 +178,22 @@
+                 }
+             }
+             break;
+-        case 18:
++        case 8:
+             {
+-                if(((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique")))) {
+-                    $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
+-                    action2();
+-                    $_ngcc_current_state = 17;
++                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
++                    NGCCHandler h = new annotation(this, super._source, $runtime, 656, null,AnnotationContext.IDENTITY_CONSTRAINT);
++                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+-                    unexpectedEnterElement($__qname);
++                    $_ngcc_current_state = 7;
++                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                 }
+             }
+             break;
+-        case 17:
++        case 3:
+             {
+-                if((($ai = $runtime.getAttributeIndex("","name"))>=0 && (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("selector")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))))) {
+-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 264, null);
++                if(($ai = $runtime.getAttributeIndex("","xpath"))>=0) {
++                    NGCCHandler h = new xpath(this, super._source, $runtime, 649);
+                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+@@ -201,11 +201,11 @@
+                 }
+             }
+             break;
+-        case 1:
++        case 7:
+             {
+-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("field"))) {
++                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("selector"))) {
+                     $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
+-                    $_ngcc_current_state = 3;
++                    $_ngcc_current_state = 6;
+                 }
+                 else {
+                     unexpectedEnterElement($__qname);
+@@ -226,11 +226,11 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
+-        case 6:
++        case 2:
+             {
+-                if((($ai = $runtime.getAttributeIndex("","xpath"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("selector")))) {
+-                    NGCCHandler h = new xpath(this, super._source, $runtime, 251);
+-                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
++                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("field"))) {
++                    $runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
++                    $_ngcc_current_state = 1;
+                 }
+                 else {
+                     unexpectedLeaveElement($__qname);
+@@ -237,11 +237,11 @@
+                 }
+             }
+             break;
+-        case 2:
++        case 5:
+             {
+-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("field"))) {
++                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("selector"))) {
+                     $runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
+-                    $_ngcc_current_state = 1;
++                    $_ngcc_current_state = 4;
+                 }
+                 else {
+                     unexpectedLeaveElement($__qname);
+@@ -260,15 +260,10 @@
+                 }
+             }
+             break;
+-        case 0:
++        case 6:
+             {
+-                revertToParentFromLeaveElement(makeResult(), super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+-        case 3:
+-            {
+-                if((($ai = $runtime.getAttributeIndex("","xpath"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("field")))) {
+-                    NGCCHandler h = new xpath(this, super._source, $runtime, 247);
++                if((($ai = $runtime.getAttributeIndex("","xpath"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("selector")))) {
++                    NGCCHandler h = new xpath(this, super._source, $runtime, 653);
+                     spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
+                 }
+                 else {
+@@ -287,16 +282,10 @@
+                 }
+             }
+             break;
+-        case 8:
+-            {
+-                $_ngcc_current_state = 7;
+-                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+         case 17:
+             {
+                 if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
+-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 264, null);
++                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 666, null);
+                     spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
+                 }
+                 else {
+@@ -304,11 +293,16 @@
+                 }
+             }
+             break;
+-        case 5:
++        case 0:
+             {
+-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("selector"))) {
++                revertToParentFromLeaveElement(makeResult(), super._cookie, $__uri, $__local, $__qname);
++            }
++            break;
++        case 1:
++            {
++                if(((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique")))) {
+                     $runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
+-                    $_ngcc_current_state = 4;
++                    $_ngcc_current_state = 0;
+                 }
+                 else {
+                     unexpectedLeaveElement($__qname);
+@@ -315,11 +309,17 @@
+                 }
+             }
+             break;
+-        case 1:
++        case 8:
+             {
+-                if(((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique")))) {
+-                    $runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
+-                    $_ngcc_current_state = 0;
++                $_ngcc_current_state = 7;
++                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
++            }
++            break;
++        case 3:
++            {
++                if((($ai = $runtime.getAttributeIndex("","xpath"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("field")))) {
++                    NGCCHandler h = new xpath(this, super._source, $runtime, 649);
++                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
+                 }
+                 else {
+                     unexpectedLeaveElement($__qname);
+@@ -340,17 +340,6 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
+-        case 6:
+-            {
+-                if(($__uri.equals("") && $__local.equals("xpath"))) {
+-                    NGCCHandler h = new xpath(this, super._source, $runtime, 251);
+-                    spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
+-                }
+-                else {
+-                    unexpectedEnterAttribute($__qname);
+-                }
+-            }
+-            break;
+         case 10:
+             {
+                 if(($__uri.equals("") && $__local.equals("refer"))) {
+@@ -362,15 +351,10 @@
+                 }
+             }
+             break;
+-        case 0:
++        case 6:
+             {
+-                revertToParentFromEnterAttribute(makeResult(), super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+-        case 3:
+-            {
+                 if(($__uri.equals("") && $__local.equals("xpath"))) {
+-                    NGCCHandler h = new xpath(this, super._source, $runtime, 247);
++                    NGCCHandler h = new xpath(this, super._source, $runtime, 653);
+                     spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
+                 }
+                 else {
+@@ -388,6 +372,22 @@
+                 }
+             }
+             break;
++        case 17:
++            {
++                if(($__uri.equals("") && $__local.equals("name"))) {
++                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 666, null);
++                    spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
++                }
++                else {
++                    unexpectedEnterAttribute($__qname);
++                }
++            }
++            break;
++        case 0:
++            {
++                revertToParentFromEnterAttribute(makeResult(), super._cookie, $__uri, $__local, $__qname);
++            }
++            break;
+         case 8:
+             {
+                 $_ngcc_current_state = 7;
+@@ -394,10 +394,10 @@
+                 $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 17:
++        case 3:
+             {
+-                if(($__uri.equals("") && $__local.equals("name"))) {
+-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 264, null);
++                if(($__uri.equals("") && $__local.equals("xpath"))) {
++                    NGCCHandler h = new xpath(this, super._source, $runtime, 649);
+                     spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
+                 }
+                 else {
+@@ -430,10 +430,14 @@
+                 revertToParentFromLeaveAttribute(makeResult(), super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 8:
++        case 14:
+             {
+-                $_ngcc_current_state = 7;
+-                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
++                if(($__uri.equals("") && $__local.equals("name"))) {
++                    $_ngcc_current_state = 10;
++                }
++                else {
++                    unexpectedLeaveAttribute($__qname);
++                }
+             }
+             break;
+         case 11:
+@@ -446,14 +450,10 @@
+                 }
+             }
+             break;
+-        case 14:
++        case 8:
+             {
+-                if(($__uri.equals("") && $__local.equals("name"))) {
+-                    $_ngcc_current_state = 10;
+-                }
+-                else {
+-                    unexpectedLeaveAttribute($__qname);
+-                }
++                $_ngcc_current_state = 7;
++                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+         default:
+@@ -467,12 +467,10 @@
+     public void text(String $value) throws SAXException {
+         int $ai;
+         switch($_ngcc_current_state) {
+-        case 6:
++        case 12:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","xpath"))>=0) {
+-                    NGCCHandler h = new xpath(this, super._source, $runtime, 251);
+-                    spawnChildFromText(h, $value);
+-                }
++                NGCCHandler h = new qname(this, super._source, $runtime, 659);
++                spawnChildFromText(h, $value);
+             }
+             break;
+         case 10:
+@@ -487,11 +485,6 @@
+                 }
+             }
+             break;
+-        case 0:
+-            {
+-                revertToParentFromText(makeResult(), super._cookie, $value);
+-            }
+-            break;
+         case 15:
+             {
+                 name = $value;
+@@ -498,20 +491,14 @@
+                 $_ngcc_current_state = 14;
+             }
+             break;
+-        case 3:
++        case 6:
+             {
+                 if(($ai = $runtime.getAttributeIndex("","xpath"))>=0) {
+-                    NGCCHandler h = new xpath(this, super._source, $runtime, 247);
++                    NGCCHandler h = new xpath(this, super._source, $runtime, 653);
+                     spawnChildFromText(h, $value);
+                 }
+             }
+             break;
+-        case 12:
+-            {
+-                NGCCHandler h = new qname(this, super._source, $runtime, 257);
+-                spawnChildFromText(h, $value);
+-            }
+-            break;
+         case 16:
+             {
+                 if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
+@@ -520,6 +507,19 @@
+                 }
+             }
+             break;
++        case 17:
++            {
++                if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
++                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 666, null);
++                    spawnChildFromText(h, $value);
++                }
++            }
++            break;
++        case 0:
++            {
++                revertToParentFromText(makeResult(), super._cookie, $value);
++            }
++            break;
+         case 8:
+             {
+                 $_ngcc_current_state = 7;
+@@ -526,10 +526,10 @@
+                 $runtime.sendText(super._cookie, $value);
+             }
+             break;
+-        case 17:
++        case 3:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
+-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 264, null);
++                if(($ai = $runtime.getAttributeIndex("","xpath"))>=0) {
++                    NGCCHandler h = new xpath(this, super._source, $runtime, 649);
+                     spawnChildFromText(h, $value);
+                 }
+             }
+@@ -539,26 +539,32 @@
+ 
+     public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException {
+         switch($__cookie__) {
+-        case 251:
++        case 666:
+             {
+-                selector = ((XPathImpl)$__result__);
+-                $_ngcc_current_state = 5;
++                fa = ((ForeignAttributesImpl)$__result__);
++                $_ngcc_current_state = 16;
+             }
+             break;
+-        case 257:
++        case 656:
+             {
++                ann = ((AnnotationImpl)$__result__);
++                $_ngcc_current_state = 7;
++            }
++            break;
++        case 659:
++            {
+                 ref = ((UName)$__result__);
+                 action1();
+                 $_ngcc_current_state = 11;
+             }
+             break;
+-        case 264:
++        case 653:
+             {
+-                fa = ((ForeignAttributesImpl)$__result__);
+-                $_ngcc_current_state = 16;
++                selector = ((XPathImpl)$__result__);
++                $_ngcc_current_state = 5;
+             }
+             break;
+-        case 247:
++        case 649:
+             {
+                 field = ((XPathImpl)$__result__);
+                 action0();
+@@ -565,12 +571,6 @@
+                 $_ngcc_current_state = 2;
+             }
+             break;
+-        case 254:
+-            {
+-                ann = ((AnnotationImpl)$__result__);
+-                $_ngcc_current_state = 7;
+-            }
+-            break;
+         }
+     }
+ 
+@@ -578,7 +578,7 @@
+         return(($_ngcc_current_state == 0));
+     }
+ 
+-    
++
+       private short category;
+       private List fields = new ArrayList();
+       private XPathImpl selector;
+@@ -588,6 +588,5 @@
+         return new IdentityConstraintImpl($runtime.document,ann,$runtime.copyLocator(),fa,
+           category,name,selector,fields,refer);
+       }
+-    
+-}
+ 
++}
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/importDecl.java	Thu Jul 30 18:44:08 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/importDecl.java	Thu Jul 30 18:44:07 2009
+@@ -37,9 +37,9 @@
+     import org.xml.sax.ContentHandler;
+     import org.xml.sax.helpers.*;
+     import java.util.*;
+-  
+ 
+ 
++
+ class importDecl extends NGCCHandler {
+     private String ns;
+     private String schemaLocation;
+@@ -64,10 +64,10 @@
+     }
+ 
+     private void action0()throws SAXException {
+-        
+-			if(ns==null)    ns="";
+-    	$runtime.importSchema( ns,schemaLocation );
+-		
++
++                        if(ns==null)    ns="";
++        $runtime.importSchema( ns,schemaLocation );
++
+ }
+ 
+     public void enterElement(String $__uri, String $__local, String $__qname, Attributes $attrs) throws SAXException {
+@@ -76,14 +76,25 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
+-        case 8:
++        case 12:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) {
++                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("import"))) {
++                    $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
++                    $_ngcc_current_state = 8;
++                }
++                else {
++                    unexpectedEnterElement($__qname);
++                }
++            }
++            break;
++        case 4:
++            {
++                if(($ai = $runtime.getAttributeIndex("","schemaLocation"))>=0) {
+                     $runtime.consumeAttribute($ai);
+                     $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+-                    $_ngcc_current_state = 4;
++                    $_ngcc_current_state = 2;
+                     $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                 }
+             }
+@@ -91,7 +102,7 @@
+         case 2:
+             {
+                 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
+-                    NGCCHandler h = new annotation(this, super._source, $runtime, 589, null,AnnotationContext.SCHEMA);
++                    NGCCHandler h = new annotation(this, super._source, $runtime, 3, null,AnnotationContext.SCHEMA);
+                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+@@ -100,14 +111,14 @@
+                 }
+             }
+             break;
+-        case 4:
++        case 8:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","schemaLocation"))>=0) {
++                if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) {
+                     $runtime.consumeAttribute($ai);
+                     $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+-                    $_ngcc_current_state = 2;
++                    $_ngcc_current_state = 4;
+                     $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                 }
+             }
+@@ -117,17 +128,6 @@
+                 revertToParentFromEnterElement(this, super._cookie, $__uri, $__local, $__qname, $attrs);
+             }
+             break;
+-        case 12:
+-            {
+-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("import"))) {
+-                    $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
+-                    $_ngcc_current_state = 8;
+-                }
+-                else {
+-                    unexpectedEnterElement($__qname);
+-                }
+-            }
+-            break;
+         default:
+             {
+                 unexpectedEnterElement($__qname);
+@@ -142,30 +142,18 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
+-        case 8:
++        case 4:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) {
++                if(($ai = $runtime.getAttributeIndex("","schemaLocation"))>=0) {
+                     $runtime.consumeAttribute($ai);
+                     $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                 }
+                 else {
+-                    $_ngcc_current_state = 4;
++                    $_ngcc_current_state = 2;
+                     $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                 }
+             }
+             break;
+-        case 1:
+-            {
+-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("import"))) {
+-                    $runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
+-                    $_ngcc_current_state = 0;
+-                    action0();
+-                }
+-                else {
+-                    unexpectedLeaveElement($__qname);
+-                }
+-            }
+-            break;
+         case 2:
+             {
+                 $_ngcc_current_state = 1;
+@@ -172,18 +160,30 @@
+                 $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 4:
++        case 8:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","schemaLocation"))>=0) {
++                if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) {
+                     $runtime.consumeAttribute($ai);
+                     $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                 }
+                 else {
+-                    $_ngcc_current_state = 2;
++                    $_ngcc_current_state = 4;
+                     $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                 }
+             }
+             break;
++        case 1:
++            {
++                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("import"))) {
++                    $runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
++                    $_ngcc_current_state = 0;
++                    action0();
++                }
++                else {
++                    unexpectedLeaveElement($__qname);
++                }
++            }
++            break;
+         case 0:
+             {
+                 revertToParentFromLeaveElement(this, super._cookie, $__uri, $__local, $__qname);
+@@ -203,13 +203,13 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
+-        case 8:
++        case 4:
+             {
+-                if(($__uri.equals("") && $__local.equals("namespace"))) {
+-                    $_ngcc_current_state = 10;
++                if(($__uri.equals("") && $__local.equals("schemaLocation"))) {
++                    $_ngcc_current_state = 6;
+                 }
+                 else {
+-                    $_ngcc_current_state = 4;
++                    $_ngcc_current_state = 2;
+                     $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+                 }
+             }
+@@ -220,13 +220,13 @@
+                 $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 4:
++        case 8:
+             {
+-                if(($__uri.equals("") && $__local.equals("schemaLocation"))) {
+-                    $_ngcc_current_state = 6;
++                if(($__uri.equals("") && $__local.equals("namespace"))) {
++                    $_ngcc_current_state = 10;
+                 }
+                 else {
+-                    $_ngcc_current_state = 2;
++                    $_ngcc_current_state = 4;
+                     $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+                 }
+             }
+@@ -250,18 +250,16 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
+-        case 8:
++        case 9:
+             {
+-                $_ngcc_current_state = 4;
+-                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
++                if(($__uri.equals("") && $__local.equals("namespace"))) {
++                    $_ngcc_current_state = 4;
++                }
++                else {
++                    unexpectedLeaveAttribute($__qname);
++                }
+             }
+             break;
+-        case 2:
+-            {
+-                $_ngcc_current_state = 1;
+-                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+         case 4:
+             {
+                 $_ngcc_current_state = 2;
+@@ -268,19 +266,16 @@
+                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 0:
++        case 2:
+             {
+-                revertToParentFromLeaveAttribute(this, super._cookie, $__uri, $__local, $__qname);
++                $_ngcc_current_state = 1;
++                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 9:
++        case 8:
+             {
+-                if(($__uri.equals("") && $__local.equals("namespace"))) {
+-                    $_ngcc_current_state = 4;
+-                }
+-                else {
+-                    unexpectedLeaveAttribute($__qname);
+-                }
++                $_ngcc_current_state = 4;
++                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+         case 5:
+@@ -293,6 +288,11 @@
+                 }
+             }
+             break;
++        case 0:
++            {
++                revertToParentFromLeaveAttribute(this, super._cookie, $__uri, $__local, $__qname);
++            }
++            break;
+         default:
+             {
+                 unexpectedLeaveAttribute($__qname);
+@@ -304,18 +304,30 @@
+     public void text(String $value) throws SAXException {
+         int $ai;
+         switch($_ngcc_current_state) {
+-        case 8:
++        case 10:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) {
++                ns = $value;
++                $_ngcc_current_state = 9;
++            }
++            break;
++        case 4:
++            {
++                if(($ai = $runtime.getAttributeIndex("","schemaLocation"))>=0) {
+                     $runtime.consumeAttribute($ai);
+                     $runtime.sendText(super._cookie, $value);
+                 }
+                 else {
+-                    $_ngcc_current_state = 4;
++                    $_ngcc_current_state = 2;
+                     $runtime.sendText(super._cookie, $value);
+                 }
+             }
+             break;
++        case 6:
++            {
++                schemaLocation = $value;
++                $_ngcc_current_state = 5;
++            }
++            break;
+         case 2:
+             {
+                 $_ngcc_current_state = 1;
+@@ -322,14 +334,14 @@
+                 $runtime.sendText(super._cookie, $value);
+             }
+             break;
+-        case 4:
++        case 8:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","schemaLocation"))>=0) {
++                if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) {
+                     $runtime.consumeAttribute($ai);
+                     $runtime.sendText(super._cookie, $value);
+                 }
+                 else {
+-                    $_ngcc_current_state = 2;
++                    $_ngcc_current_state = 4;
+                     $runtime.sendText(super._cookie, $value);
+                 }
+             }
+@@ -339,24 +351,12 @@
+                 revertToParentFromText(this, super._cookie, $value);
+             }
+             break;
+-        case 6:
+-            {
+-                schemaLocation = $value;
+-                $_ngcc_current_state = 5;
+-            }
+-            break;
+-        case 10:
+-            {
+-                ns = $value;
+-                $_ngcc_current_state = 9;
+-            }
+-            break;
+         }
+     }
+ 
+     public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException {
+         switch($__cookie__) {
+-        case 589:
++        case 3:
+             {
+                 $_ngcc_current_state = 1;
+             }
+@@ -370,4 +370,3 @@
+ 
+ 
+ }
+-
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/includeDecl.java	Thu Jul 30 18:44:11 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/includeDecl.java	Thu Jul 30 18:44:11 2009
+@@ -37,9 +37,9 @@
+     import org.xml.sax.ContentHandler;
+     import org.xml.sax.helpers.*;
+     import java.util.*;
+-  
+ 
+ 
++
+ class includeDecl extends NGCCHandler {
+     private String schemaLocation;
+     protected final NGCCRuntimeEx $runtime;
+@@ -77,18 +77,6 @@
+                 revertToParentFromEnterElement(this, super._cookie, $__uri, $__local, $__qname, $attrs);
+             }
+             break;
+-        case 2:
+-            {
+-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
+-                    NGCCHandler h = new annotation(this, super._source, $runtime, 268, null,AnnotationContext.SCHEMA);
+-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+-                }
+-                else {
+-                    $_ngcc_current_state = 1;
+-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+-                }
+-            }
+-            break;
+         case 6:
+             {
+                 if(($ai = $runtime.getAttributeIndex("","schemaLocation"))>=0) {
+@@ -111,6 +99,18 @@
+                 }
+             }
+             break;
++        case 2:
++            {
++                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
++                    NGCCHandler h = new annotation(this, super._source, $runtime, 521, null,AnnotationContext.SCHEMA);
++                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
++                }
++                else {
++                    $_ngcc_current_state = 1;
++                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
++                }
++            }
++            break;
+         default:
+             {
+                 unexpectedEnterElement($__qname);
+@@ -130,12 +130,6 @@
+                 revertToParentFromLeaveElement(this, super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 2:
+-            {
+-                $_ngcc_current_state = 1;
+-                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+         case 1:
+             {
+                 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("include"))) {
+@@ -159,6 +153,12 @@
+                 }
+             }
+             break;
++        case 2:
++            {
++                $_ngcc_current_state = 1;
++                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
++            }
++            break;
+         default:
+             {
+                 unexpectedLeaveElement($__qname);
+@@ -178,12 +178,6 @@
+                 revertToParentFromEnterAttribute(this, super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 2:
+-            {
+-                $_ngcc_current_state = 1;
+-                $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+         case 6:
+             {
+                 if(($__uri.equals("") && $__local.equals("schemaLocation"))) {
+@@ -194,6 +188,12 @@
+                 }
+             }
+             break;
++        case 2:
++            {
++                $_ngcc_current_state = 1;
++                $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
++            }
++            break;
+         default:
+             {
+                 unexpectedEnterAttribute($__qname);
+@@ -208,6 +208,11 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
++        case 0:
++            {
++                revertToParentFromLeaveAttribute(this, super._cookie, $__uri, $__local, $__qname);
++            }
++            break;
+         case 4:
+             {
+                 if(($__uri.equals("") && $__local.equals("schemaLocation"))) {
+@@ -218,11 +223,6 @@
+                 }
+             }
+             break;
+-        case 0:
+-            {
+-                revertToParentFromLeaveAttribute(this, super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+         case 2:
+             {
+                 $_ngcc_current_state = 1;
+@@ -245,10 +245,12 @@
+                 revertToParentFromText(this, super._cookie, $value);
+             }
+             break;
+-        case 2:
++        case 6:
+             {
+-                $_ngcc_current_state = 1;
+-                $runtime.sendText(super._cookie, $value);
++                if(($ai = $runtime.getAttributeIndex("","schemaLocation"))>=0) {
++                    $runtime.consumeAttribute($ai);
++                    $runtime.sendText(super._cookie, $value);
++                }
+             }
+             break;
+         case 5:
+@@ -257,12 +259,10 @@
+                 $_ngcc_current_state = 4;
+             }
+             break;
+-        case 6:
++        case 2:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","schemaLocation"))>=0) {
+-                    $runtime.consumeAttribute($ai);
+-                    $runtime.sendText(super._cookie, $value);
+-                }
++                $_ngcc_current_state = 1;
++                $runtime.sendText(super._cookie, $value);
+             }
+             break;
+         }
+@@ -270,7 +270,7 @@
+ 
+     public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException {
+         switch($__cookie__) {
+-        case 268:
++        case 521:
+             {
+                 $_ngcc_current_state = 1;
+             }
+@@ -284,4 +284,3 @@
+ 
+ 
+ }
+-
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/modelGroupBody.java	Thu Jul 30 18:44:15 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/modelGroupBody.java	Thu Jul 30 18:44:14 2009
+@@ -37,7 +37,7 @@
+     import org.xml.sax.ContentHandler;
+     import org.xml.sax.helpers.*;
+     import java.util.*;
+-  
++
+ import java.util.Vector;
+ 
+ 
+@@ -70,7 +70,7 @@
+     }
+ 
+     private void action0()throws SAXException {
+-        
++
+       XSModelGroup.Compositor compositor = null;
+       if(compositorName.equals("all"))      compositor = XSModelGroup.ALL;
+       if(compositorName.equals("sequence")) compositor = XSModelGroup.SEQUENCE;
+@@ -77,16 +77,16 @@
+       if(compositorName.equals("choice"))   compositor = XSModelGroup.CHOICE;
+       if(compositor==null)
+         throw new InternalError("unable to process "+compositorName);
+-      
++
+       result = new ModelGroupImpl( $runtime.document, annotation, locator, fa, compositor,
+             (ParticleImpl[])particles.toArray(new ParticleImpl[0]));
+-    
++
+ }
+ 
+     private void action1()throws SAXException {
+-        
++
+         particles.add(childParticle);
+-      
++
+ }
+ 
+     public void enterElement(String $__uri, String $__local, String $__qname, Attributes $attrs) throws SAXException {
+@@ -95,32 +95,39 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
+-        case 0:
++        case 2:
+             {
+-                revertToParentFromEnterElement(result, super._cookie, $__uri, $__local, $__qname, $attrs);
++                if((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence"))) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element")))))) {
++                    NGCCHandler h = new particle(this, super._source, $runtime, 179);
++                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
++                }
++                else {
++                    $_ngcc_current_state = 1;
++                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
++                }
+             }
+             break;
+-        case 1:
++        case 6:
+             {
+-                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any")) || (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element")))))) {
+-                    NGCCHandler h = new particle(this, super._source, $runtime, 31);
++                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence"))) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))))))) {
++                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 184, null);
+                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+-                    action0();
+-                    $_ngcc_current_state = 0;
+-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
++                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 184, null);
++                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                 }
+             }
+             break;
+-        case 2:
++        case 1:
+             {
+-                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any")) || (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element")))))) {
+-                    NGCCHandler h = new particle(this, super._source, $runtime, 32);
++                if((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence"))) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element")))))) {
++                    NGCCHandler h = new particle(this, super._source, $runtime, 178);
+                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+-                    $_ngcc_current_state = 1;
++                    action0();
++                    $_ngcc_current_state = 0;
+                     $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                 }
+             }
+@@ -128,7 +135,7 @@
+         case 4:
+             {
+                 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
+-                    NGCCHandler h = new annotation(this, super._source, $runtime, 35, null,AnnotationContext.MODELGROUP);
++                    NGCCHandler h = new annotation(this, super._source, $runtime, 182, null,AnnotationContext.MODELGROUP);
+                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+@@ -137,16 +144,9 @@
+                 }
+             }
+             break;
+-        case 6:
++        case 0:
+             {
+-                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any")) || (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))))))) {
+-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 37, null);
+-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+-                }
+-                else {
+-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 37, null);
+-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+-                }
++                revertToParentFromEnterElement(result, super._cookie, $__uri, $__local, $__qname, $attrs);
+             }
+             break;
+         default:
+@@ -163,11 +163,18 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
+-        case 0:
++        case 2:
+             {
+-                revertToParentFromLeaveElement(result, super._cookie, $__uri, $__local, $__qname);
++                $_ngcc_current_state = 1;
++                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
++        case 6:
++            {
++                NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 184, null);
++                spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
++            }
++            break;
+         case 1:
+             {
+                 action0();
+@@ -175,12 +182,6 @@
+                 $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 2:
+-            {
+-                $_ngcc_current_state = 1;
+-                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+         case 4:
+             {
+                 $_ngcc_current_state = 2;
+@@ -187,10 +188,9 @@
+                 $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 6:
++        case 0:
+             {
+-                NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 37, null);
+-                spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
++                revertToParentFromLeaveElement(result, super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+         default:
+@@ -207,11 +207,18 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
+-        case 0:
++        case 2:
+             {
+-                revertToParentFromEnterAttribute(result, super._cookie, $__uri, $__local, $__qname);
++                $_ngcc_current_state = 1;
++                $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
++        case 6:
++            {
++                NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 184, null);
++                spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
++            }
++            break;
+         case 1:
+             {
+                 action0();
+@@ -219,12 +226,6 @@
+                 $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 2:
+-            {
+-                $_ngcc_current_state = 1;
+-                $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+         case 4:
+             {
+                 $_ngcc_current_state = 2;
+@@ -231,10 +232,9 @@
+                 $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 6:
++        case 0:
+             {
+-                NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 37, null);
+-                spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
++                revertToParentFromEnterAttribute(result, super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+         default:
+@@ -251,11 +251,18 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
+-        case 0:
++        case 2:
+             {
+-                revertToParentFromLeaveAttribute(result, super._cookie, $__uri, $__local, $__qname);
++                $_ngcc_current_state = 1;
++                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
++        case 6:
++            {
++                NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 184, null);
++                spawnChildFromLeaveAttribute(h, $__uri, $__local, $__qname);
++            }
++            break;
+         case 1:
+             {
+                 action0();
+@@ -263,12 +270,6 @@
+                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 2:
+-            {
+-                $_ngcc_current_state = 1;
+-                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+         case 4:
+             {
+                 $_ngcc_current_state = 2;
+@@ -275,10 +276,9 @@
+                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 6:
++        case 0:
+             {
+-                NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 37, null);
+-                spawnChildFromLeaveAttribute(h, $__uri, $__local, $__qname);
++                revertToParentFromLeaveAttribute(result, super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+         default:
+@@ -292,11 +292,18 @@
+     public void text(String $value) throws SAXException {
+         int $ai;
+         switch($_ngcc_current_state) {
+-        case 0:
++        case 2:
+             {
+-                revertToParentFromText(result, super._cookie, $value);
++                $_ngcc_current_state = 1;
++                $runtime.sendText(super._cookie, $value);
+             }
+             break;
++        case 6:
++            {
++                NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 184, null);
++                spawnChildFromText(h, $value);
++            }
++            break;
+         case 1:
+             {
+                 action0();
+@@ -304,12 +311,6 @@
+                 $runtime.sendText(super._cookie, $value);
+             }
+             break;
+-        case 2:
+-            {
+-                $_ngcc_current_state = 1;
+-                $runtime.sendText(super._cookie, $value);
+-            }
+-            break;
+         case 4:
+             {
+                 $_ngcc_current_state = 2;
+@@ -316,10 +317,9 @@
+                 $runtime.sendText(super._cookie, $value);
+             }
+             break;
+-        case 6:
++        case 0:
+             {
+-                NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 37, null);
+-                spawnChildFromText(h, $value);
++                revertToParentFromText(result, super._cookie, $value);
+             }
+             break;
+         }
+@@ -327,7 +327,7 @@
+ 
+     public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException {
+         switch($__cookie__) {
+-        case 31:
++        case 179:
+             {
+                 childParticle = ((ParticleImpl)$__result__);
+                 action1();
+@@ -334,21 +334,21 @@
+                 $_ngcc_current_state = 1;
+             }
+             break;
+-        case 32:
++        case 184:
+             {
++                fa = ((ForeignAttributesImpl)$__result__);
++                $_ngcc_current_state = 4;
++            }
++            break;
++        case 178:
++            {
+                 childParticle = ((ParticleImpl)$__result__);
+                 action1();
+                 $_ngcc_current_state = 1;
+             }
+             break;
+-        case 37:
++        case 182:
+             {
+-                fa = ((ForeignAttributesImpl)$__result__);
+-                $_ngcc_current_state = 4;
+-            }
+-            break;
+-        case 35:
+-            {
+                 annotation = ((AnnotationImpl)$__result__);
+                 $_ngcc_current_state = 2;
+             }
+@@ -357,13 +357,12 @@
+     }
+ 
+     public boolean accepted() {
+-        return((($_ngcc_current_state == 4) || (($_ngcc_current_state == 2) || (($_ngcc_current_state == 1) || ($_ngcc_current_state == 0)))));
++        return((($_ngcc_current_state == 0) || (($_ngcc_current_state == 4) || (($_ngcc_current_state == 1) || ($_ngcc_current_state == 2)))));
+     }
+ 
+-    
+-  		private ModelGroupImpl result;
+-  		
+-  		private final List particles = new ArrayList();
+-  	
+-}
+ 
++                private ModelGroupImpl result;
++
++                private final List particles = new ArrayList();
++
++}
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/notation.java	Thu Jul 30 18:44:19 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/notation.java	Thu Jul 30 18:44:18 2009
+@@ -37,9 +37,9 @@
+     import org.xml.sax.ContentHandler;
+     import org.xml.sax.helpers.*;
+     import java.util.*;
+-  
+ 
+ 
++
+ class notation extends NGCCHandler {
+     private String name;
+     private String pub;
+@@ -76,16 +76,11 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
+-        case 0:
++        case 10:
+             {
+-                revertToParentFromEnterElement(makeResult(), super._cookie, $__uri, $__local, $__qname, $attrs);
+-            }
+-            break;
+-        case 14:
+-            {
+-                if((($ai = $runtime.getAttributeIndex("","name"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) {
+-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 571, null);
+-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
++                if(($ai = $runtime.getAttributeIndex("","public"))>=0) {
++                    $runtime.consumeAttribute($ai);
++                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+                     unexpectedEnterElement($__qname);
+@@ -95,7 +90,7 @@
+         case 2:
+             {
+                 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
+-                    NGCCHandler h = new annotation(this, super._source, $runtime, 558, null,AnnotationContext.NOTATION);
++                    NGCCHandler h = new annotation(this, super._source, $runtime, 386, null,AnnotationContext.NOTATION);
+                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+@@ -104,25 +99,13 @@
+                 }
+             }
+             break;
+-        case 4:
++        case 13:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","system"))>=0) {
++                if(($ai = $runtime.getAttributeIndex("","name"))>=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 10:
+-            {
+-                if(($ai = $runtime.getAttributeIndex("","public"))>=0) {
+-                    $runtime.consumeAttribute($ai);
+-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+-                }
+-                else {
+                     unexpectedEnterElement($__qname);
+                 }
+             }
+@@ -139,13 +122,30 @@
+                 }
+             }
+             break;
+-        case 13:
++        case 0:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
++                revertToParentFromEnterElement(makeResult(), super._cookie, $__uri, $__local, $__qname, $attrs);
++            }
++            break;
++        case 4:
++            {
++                if(($ai = $runtime.getAttributeIndex("","system"))>=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 14:
++            {
++                if((($ai = $runtime.getAttributeIndex("","name"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) {
++                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 399, null);
++                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
++                }
++                else {
+                     unexpectedEnterElement($__qname);
+                 }
+             }
+@@ -164,16 +164,11 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
+-        case 0:
++        case 10:
+             {
+-                revertToParentFromLeaveElement(makeResult(), super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+-        case 14:
+-            {
+-                if((($ai = $runtime.getAttributeIndex("","name"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("notation")))) {
+-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 571, null);
+-                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
++                if(($ai = $runtime.getAttributeIndex("","public"))>=0) {
++                    $runtime.consumeAttribute($ai);
++                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                 }
+                 else {
+                     unexpectedLeaveElement($__qname);
+@@ -180,11 +175,17 @@
+                 }
+             }
+             break;
+-        case 1:
++        case 2:
+             {
+-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("notation"))) {
+-                    $runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
+-                    $_ngcc_current_state = 0;
++                $_ngcc_current_state = 1;
++                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
++            }
++            break;
++        case 13:
++            {
++                if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
++                    $runtime.consumeAttribute($ai);
++                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                 }
+                 else {
+                     unexpectedLeaveElement($__qname);
+@@ -191,10 +192,9 @@
+                 }
+             }
+             break;
+-        case 2:
++        case 0:
+             {
+-                $_ngcc_current_state = 1;
+-                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
++                revertToParentFromLeaveElement(makeResult(), super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+         case 4:
+@@ -209,11 +209,11 @@
+                 }
+             }
+             break;
+-        case 10:
++        case 14:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","public"))>=0) {
+-                    $runtime.consumeAttribute($ai);
+-                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
++                if((($ai = $runtime.getAttributeIndex("","name"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("notation")))) {
++                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 399, null);
++                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
+                 }
+                 else {
+                     unexpectedLeaveElement($__qname);
+@@ -220,11 +220,11 @@
+                 }
+             }
+             break;
+-        case 13:
++        case 1:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
+-                    $runtime.consumeAttribute($ai);
+-                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
++                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("notation"))) {
++                    $runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
++                    $_ngcc_current_state = 0;
+                 }
+                 else {
+                     unexpectedLeaveElement($__qname);
+@@ -245,16 +245,26 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
+-        case 0:
++        case 10:
+             {
+-                revertToParentFromEnterAttribute(makeResult(), super._cookie, $__uri, $__local, $__qname);
++                if(($__uri.equals("") && $__local.equals("public"))) {
++                    $_ngcc_current_state = 9;
++                }
++                else {
++                    unexpectedEnterAttribute($__qname);
++                }
+             }
+             break;
+-        case 14:
++        case 2:
+             {
++                $_ngcc_current_state = 1;
++                $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
++            }
++            break;
++        case 13:
++            {
+                 if(($__uri.equals("") && $__local.equals("name"))) {
+-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 571, null);
+-                    spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
++                    $_ngcc_current_state = 12;
+                 }
+                 else {
+                     unexpectedEnterAttribute($__qname);
+@@ -261,10 +271,9 @@
+                 }
+             }
+             break;
+-        case 2:
++        case 0:
+             {
+-                $_ngcc_current_state = 1;
+-                $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
++                revertToParentFromEnterAttribute(makeResult(), super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+         case 4:
+@@ -278,20 +287,11 @@
+                 }
+             }
+             break;
+-        case 10:
++        case 14:
+             {
+-                if(($__uri.equals("") && $__local.equals("public"))) {
+-                    $_ngcc_current_state = 9;
+-                }
+-                else {
+-                    unexpectedEnterAttribute($__qname);
+-                }
+-            }
+-            break;
+-        case 13:
+-            {
+                 if(($__uri.equals("") && $__local.equals("name"))) {
+-                    $_ngcc_current_state = 12;
++                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 399, null);
++                    spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
+                 }
+                 else {
+                     unexpectedEnterAttribute($__qname);
+@@ -312,15 +312,16 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
+-        case 0:
++        case 2:
+             {
+-                revertToParentFromLeaveAttribute(makeResult(), super._cookie, $__uri, $__local, $__qname);
++                $_ngcc_current_state = 1;
++                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 5:
++        case 8:
+             {
+-                if(($__uri.equals("") && $__local.equals("system"))) {
+-                    $_ngcc_current_state = 2;
++                if(($__uri.equals("") && $__local.equals("public"))) {
++                    $_ngcc_current_state = 4;
+                 }
+                 else {
+                     unexpectedLeaveAttribute($__qname);
+@@ -327,18 +328,6 @@
+                 }
+             }
+             break;
+-        case 2:
+-            {
+-                $_ngcc_current_state = 1;
+-                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+-        case 4:
+-            {
+-                $_ngcc_current_state = 2;
+-                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+         case 11:
+             {
+                 if(($__uri.equals("") && $__local.equals("name"))) {
+@@ -349,10 +338,10 @@
+                 }
+             }
+             break;
+-        case 8:
++        case 5:
+             {
+-                if(($__uri.equals("") && $__local.equals("public"))) {
+-                    $_ngcc_current_state = 4;
++                if(($__uri.equals("") && $__local.equals("system"))) {
++                    $_ngcc_current_state = 2;
+                 }
+                 else {
+                     unexpectedLeaveAttribute($__qname);
+@@ -359,6 +348,17 @@
+                 }
+             }
+             break;
++        case 0:
++            {
++                revertToParentFromLeaveAttribute(makeResult(), super._cookie, $__uri, $__local, $__qname);
++            }
++            break;
++        case 4:
++            {
++                $_ngcc_current_state = 2;
++                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
++            }
++            break;
+         default:
+             {
+                 unexpectedLeaveAttribute($__qname);
+@@ -370,19 +370,12 @@
+     public void text(String $value) throws SAXException {
+         int $ai;
+         switch($_ngcc_current_state) {
+-        case 0:
++        case 9:
+             {
+-                revertToParentFromText(makeResult(), super._cookie, $value);
++                pub = $value;
++                $_ngcc_current_state = 8;
+             }
+             break;
+-        case 14:
+-            {
+-                if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
+-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 571, null);
+-                    spawnChildFromText(h, $value);
+-                }
+-            }
+-            break;
+         case 6:
+             {
+                 sys = $value;
+@@ -389,22 +382,12 @@
+                 $_ngcc_current_state = 5;
+             }
+             break;
+-        case 2:
++        case 10:
+             {
+-                $_ngcc_current_state = 1;
+-                $runtime.sendText(super._cookie, $value);
+-            }
+-            break;
+-        case 4:
+-            {
+-                if(($ai = $runtime.getAttributeIndex("","system"))>=0) {
++                if(($ai = $runtime.getAttributeIndex("","public"))>=0) {
+                     $runtime.consumeAttribute($ai);
+                     $runtime.sendText(super._cookie, $value);
+                 }
+-                else {
+-                    $_ngcc_current_state = 2;
+-                    $runtime.sendText(super._cookie, $value);
+-                }
+             }
+             break;
+         case 12:
+@@ -413,43 +396,60 @@
+                 $_ngcc_current_state = 11;
+             }
+             break;
+-        case 10:
++        case 2:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","public"))>=0) {
++                $_ngcc_current_state = 1;
++                $runtime.sendText(super._cookie, $value);
++            }
++            break;
++        case 13:
++            {
++                if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
+                     $runtime.consumeAttribute($ai);
+                     $runtime.sendText(super._cookie, $value);
+                 }
+             }
+             break;
+-        case 9:
++        case 0:
+             {
+-                pub = $value;
+-                $_ngcc_current_state = 8;
++                revertToParentFromText(makeResult(), super._cookie, $value);
+             }
+             break;
+-        case 13:
++        case 4:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
++                if(($ai = $runtime.getAttributeIndex("","system"))>=0) {
+                     $runtime.consumeAttribute($ai);
+                     $runtime.sendText(super._cookie, $value);
+                 }
++                else {
++                    $_ngcc_current_state = 2;
++                    $runtime.sendText(super._cookie, $value);
++                }
+             }
+             break;
++        case 14:
++            {
++                if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
++                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 399, null);
++                    spawnChildFromText(h, $value);
++                }
++            }
++            break;
+         }
+     }
+ 
+     public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException {
+         switch($__cookie__) {
+-        case 571:
++        case 386:
+             {
+-                fa = ((ForeignAttributesImpl)$__result__);
+-                $_ngcc_current_state = 13;
++                ann = ((AnnotationImpl)$__result__);
++                $_ngcc_current_state = 1;
+             }
+             break;
+-        case 558:
++        case 399:
+             {
+-                ann = ((AnnotationImpl)$__result__);
+-                $_ngcc_current_state = 1;
++                fa = ((ForeignAttributesImpl)$__result__);
++                $_ngcc_current_state = 13;
+             }
+             break;
+         }
+@@ -459,11 +459,10 @@
+         return(($_ngcc_current_state == 0));
+     }
+ 
+-    
++
+       private Locator loc;
+       private XSNotation makeResult() {
+         return new NotationImpl( $runtime.document,ann,loc,fa,name,pub,sys);
+       }
+-    
+-}
+ 
++}
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/occurs.java	Thu Jul 30 18:44:22 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/occurs.java	Thu Jul 30 18:44:22 2009
+@@ -37,9 +37,9 @@
+     import org.xml.sax.ContentHandler;
+     import org.xml.sax.helpers.*;
+     import java.util.*;
+-  
+ 
+ 
++
+ class occurs extends NGCCHandler {
+     private String v;
+     protected final NGCCRuntimeEx $runtime;
+@@ -80,35 +80,35 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
+-        case 1:
++        case 5:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","minOccurs"))>=0) {
++                if(($ai = $runtime.getAttributeIndex("","maxOccurs"))>=0) {
+                     $runtime.consumeAttribute($ai);
+                     $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+-                    $_ngcc_current_state = 0;
++                    $_ngcc_current_state = 1;
+                     $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                 }
+             }
+             break;
+-        case 0:
++        case 1:
+             {
+-                revertToParentFromEnterElement(this, super._cookie, $__uri, $__local, $__qname, $attrs);
+-            }
+-            break;
+-        case 5:
+-            {
+-                if(($ai = $runtime.getAttributeIndex("","maxOccurs"))>=0) {
++                if(($ai = $runtime.getAttributeIndex("","minOccurs"))>=0) {
+                     $runtime.consumeAttribute($ai);
+                     $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+-                    $_ngcc_current_state = 1;
++                    $_ngcc_current_state = 0;
+                     $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                 }
+             }
+             break;
++        case 0:
++            {
++                revertToParentFromEnterElement(this, super._cookie, $__uri, $__local, $__qname, $attrs);
++            }
++            break;
+         default:
+             {
+                 unexpectedEnterElement($__qname);
+@@ -123,35 +123,35 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
+-        case 1:
++        case 5:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","minOccurs"))>=0) {
++                if(($ai = $runtime.getAttributeIndex("","maxOccurs"))>=0) {
+                     $runtime.consumeAttribute($ai);
+                     $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                 }
+                 else {
+-                    $_ngcc_current_state = 0;
++                    $_ngcc_current_state = 1;
+                     $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                 }
+             }
+             break;
+-        case 0:
++        case 1:
+             {
+-                revertToParentFromLeaveElement(this, super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+-        case 5:
+-            {
+-                if(($ai = $runtime.getAttributeIndex("","maxOccurs"))>=0) {
++                if(($ai = $runtime.getAttributeIndex("","minOccurs"))>=0) {
+                     $runtime.consumeAttribute($ai);
+                     $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                 }
+                 else {
+-                    $_ngcc_current_state = 1;
++                    $_ngcc_current_state = 0;
+                     $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                 }
+             }
+             break;
++        case 0:
++            {
++                revertToParentFromLeaveElement(this, super._cookie, $__uri, $__local, $__qname);
++            }
++            break;
+         default:
+             {
+                 unexpectedLeaveElement($__qname);
+@@ -166,6 +166,17 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
++        case 5:
++            {
++                if(($__uri.equals("") && $__local.equals("maxOccurs"))) {
++                    $_ngcc_current_state = 7;
++                }
++                else {
++                    $_ngcc_current_state = 1;
++                    $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
++                }
++            }
++            break;
+         case 1:
+             {
+                 if(($__uri.equals("") && $__local.equals("minOccurs"))) {
+@@ -182,17 +193,6 @@
+                 revertToParentFromEnterAttribute(this, super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 5:
+-            {
+-                if(($__uri.equals("") && $__local.equals("maxOccurs"))) {
+-                    $_ngcc_current_state = 7;
+-                }
+-                else {
+-                    $_ngcc_current_state = 1;
+-                    $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+-                }
+-            }
+-            break;
+         default:
+             {
+                 unexpectedEnterAttribute($__qname);
+@@ -207,10 +207,16 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
+-        case 2:
++        case 5:
+             {
+-                if(($__uri.equals("") && $__local.equals("minOccurs"))) {
+-                    $_ngcc_current_state = 0;
++                $_ngcc_current_state = 1;
++                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
++            }
++            break;
++        case 6:
++            {
++                if(($__uri.equals("") && $__local.equals("maxOccurs"))) {
++                    $_ngcc_current_state = 1;
+                 }
+                 else {
+                     unexpectedLeaveAttribute($__qname);
+@@ -217,10 +223,10 @@
+                 }
+             }
+             break;
+-        case 6:
++        case 2:
+             {
+-                if(($__uri.equals("") && $__local.equals("maxOccurs"))) {
+-                    $_ngcc_current_state = 1;
++                if(($__uri.equals("") && $__local.equals("minOccurs"))) {
++                    $_ngcc_current_state = 0;
+                 }
+                 else {
+                     unexpectedLeaveAttribute($__qname);
+@@ -238,12 +244,6 @@
+                 revertToParentFromLeaveAttribute(this, super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 5:
+-            {
+-                $_ngcc_current_state = 1;
+-                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+         default:
+             {
+                 unexpectedLeaveAttribute($__qname);
+@@ -255,16 +255,15 @@
+     public void text(String $value) throws SAXException {
+         int $ai;
+         switch($_ngcc_current_state) {
+-        case 7:
++        case 5:
+             {
+-                if($value.equals("unbounded")) {
+-                    $_ngcc_current_state = 6;
+-                    action1();
++                if(($ai = $runtime.getAttributeIndex("","maxOccurs"))>=0) {
++                    $runtime.consumeAttribute($ai);
++                    $runtime.sendText(super._cookie, $value);
+                 }
+                 else {
+-                    v = $value;
+-                    $_ngcc_current_state = 6;
+-                    action2();
++                    $_ngcc_current_state = 1;
++                    $runtime.sendText(super._cookie, $value);
+                 }
+             }
+             break;
+@@ -280,9 +279,17 @@
+                 }
+             }
+             break;
+-        case 0:
++        case 7:
+             {
+-                revertToParentFromText(this, super._cookie, $value);
++                if($value.equals("unbounded")) {
++                    $_ngcc_current_state = 6;
++                    action1();
++                }
++                else {
++                    v = $value;
++                    $_ngcc_current_state = 6;
++                    action2();
++                }
+             }
+             break;
+         case 3:
+@@ -292,16 +299,9 @@
+                 action0();
+             }
+             break;
+-        case 5:
++        case 0:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","maxOccurs"))>=0) {
+-                    $runtime.consumeAttribute($ai);
+-                    $runtime.sendText(super._cookie, $value);
+-                }
+-                else {
+-                    $_ngcc_current_state = 1;
+-                    $runtime.sendText(super._cookie, $value);
+-                }
++                revertToParentFromText(this, super._cookie, $value);
+             }
+             break;
+         }
+@@ -313,12 +313,11 @@
+     }
+ 
+     public boolean accepted() {
+-        return((($_ngcc_current_state == 5) || (($_ngcc_current_state == 0) || ($_ngcc_current_state == 1))));
++        return((($_ngcc_current_state == 0) || (($_ngcc_current_state == 1) || ($_ngcc_current_state == 5))));
+     }
+ 
+-    
++
+       int max=1;
+       int min=1;
+-    
+-}
+ 
++}
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/particle.java	Thu Jul 30 18:44:26 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/particle.java	Thu Jul 30 18:44:25 2009
+@@ -37,9 +37,9 @@
+     import org.xml.sax.ContentHandler;
+     import org.xml.sax.helpers.*;
+     import java.util.*;
+-  
+ 
+ 
++
+ class particle extends NGCCHandler {
+     private AnnotationImpl annotation;
+     private ElementDecl anonymousElementDecl;
+@@ -69,9 +69,9 @@
+     }
+ 
+     private void action0()throws SAXException {
+-        
++
+           result = new ParticleImpl( $runtime.document, null, wcBody, wloc, occurs.max, occurs.min );
+-        
++
+ }
+ 
+     private void action1()throws SAXException {
+@@ -79,19 +79,19 @@
+ }
+ 
+     private void action2()throws SAXException {
+-        
++
+               result = new ParticleImpl( $runtime.document, null,
+                 anonymousElementDecl,
+                 loc, occurs.max, occurs.min );
+-            
++
+ }
+ 
+     private void action3()throws SAXException {
+-        
++
+               result = new ParticleImpl( $runtime.document, annotation, new DelayedRef.Element(
+                   $runtime, loc, $runtime.currentSchema, elementTypeName ),
+                   loc, occurs.max, occurs.min );
+-            
++
+ }
+ 
+     private void action4()throws SAXException {
+@@ -99,11 +99,11 @@
+ }
+ 
+     private void action5()throws SAXException {
+-        
++
+           result = new ParticleImpl( $runtime.document, annotation, new DelayedRef.ModelGroup(
+               $runtime, loc, $runtime.currentSchema, groupName ),
+             loc, occurs.max, occurs.min );
+-        
++
+ }
+ 
+     private void action6()throws SAXException {
+@@ -111,16 +111,16 @@
+ }
+ 
+     private void action7()throws SAXException {
+-        
++
+             result = new ParticleImpl( $runtime.document, null, term, loc, occurs.max, occurs.min );
+-          
++
+ }
+ 
+     private void action8()throws SAXException {
+-        
++
+           compositorName = $localName;
+           loc = $runtime.copyLocator();
+-        
++
+ }
+ 
+     public void enterElement(String $__uri, String $__local, String $__qname, Attributes $attrs) throws SAXException {
+@@ -129,10 +129,10 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
+-        case 3:
++        case 26:
+             {
+-                if((($ai = $runtime.getAttributeIndex("","namespace"))>=0 || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || ($ai = $runtime.getAttributeIndex("","processContents"))>=0))) {
+-                    NGCCHandler h = new wildcardBody(this, super._source, $runtime, 416, wloc);
++                if(((($ai = $runtime.getAttributeIndex("","maxOccurs"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) || ((($ai = $runtime.getAttributeIndex("","minOccurs"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) || (($ai = $runtime.getAttributeIndex("","ref"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))))) {
++                    NGCCHandler h = new occurs(this, super._source, $runtime, 599);
+                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+@@ -140,16 +140,26 @@
+                 }
+             }
+             break;
+-        case 10:
++        case 4:
+             {
+-                action3();
+-                $_ngcc_current_state = 7;
+-                $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
++                if(((($ai = $runtime.getAttributeIndex("","processContents"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || ((($ai = $runtime.getAttributeIndex("","maxOccurs"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) || ((($ai = $runtime.getAttributeIndex("","minOccurs"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) || (($ai = $runtime.getAttributeIndex("","namespace"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))))))) {
++                    NGCCHandler h = new occurs(this, super._source, $runtime, 574);
++                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
++                }
++                else {
++                    unexpectedEnterElement($__qname);
++                }
+             }
+             break;
+-        case 0:
++        case 25:
+             {
+-                revertToParentFromEnterElement(result, super._cookie, $__uri, $__local, $__qname, $attrs);
++                if(($ai = $runtime.getAttributeIndex("","ref"))>=0) {
++                    $runtime.consumeAttribute($ai);
++                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
++                }
++                else {
++                    unexpectedEnterElement($__qname);
++                }
+             }
+             break;
+         case 20:
+@@ -159,6 +169,17 @@
+                 $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+             }
+             break;
++        case 16:
++            {
++                if(((($ai = $runtime.getAttributeIndex("","default"))>=0 && (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType")) || ((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique")))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) || ((($ai = $runtime.getAttributeIndex("","block"))>=0 && (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType")) || ((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique")))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) || ((($ai = $runtime.getAttributeIndex("","fixed"))>=0 && (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType")) || ((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique")))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) || ((($ai = $runtime.getAttributeIndex("","maxOccurs"))>=0 && (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType")) || ((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique")))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) || ((($ai = $runtime.getAttributeIndex("","minOccurs"))>=0 && (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType")) || ((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique")))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) || ((($ai = $runtime.getAttributeIndex("","form"))>=0 && (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType")) || ((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique")))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) || ((($ai = $runtime.getAttributeIndex("","final"))>=0 && (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType")) || ((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique")))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) || ((($ai = $runtime.getAttributeIndex("","abstract"))>=0 && (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType")) || ((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique")))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) || ((($ai = $runtime.getAttributeIndex("","ref"))>=0 && (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType")) || ((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique")))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) || (($ai = $runtime.getAttributeIndex("","name"))>=0 && (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType")) || ((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique")))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))))))))))))) {
++                    NGCCHandler h = new occurs(this, super._source, $runtime, 588);
++                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
++                }
++                else {
++                    unexpectedEnterElement($__qname);
++                }
++            }
++            break;
+         case 1:
+             {
+                 if(((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence")))) {
+@@ -192,45 +213,40 @@
+                 }
+             }
+             break;
+-        case 4:
++        case 21:
+             {
+-                if(((($ai = $runtime.getAttributeIndex("","namespace"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || ((($ai = $runtime.getAttributeIndex("","maxOccurs"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) || ((($ai = $runtime.getAttributeIndex("","minOccurs"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) || (($ai = $runtime.getAttributeIndex("","processContents"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))))))) {
+-                    NGCCHandler h = new occurs(this, super._source, $runtime, 417);
++                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
++                    NGCCHandler h = new annotation(this, super._source, $runtime, 594, null,AnnotationContext.PARTICLE);
+                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+-                    unexpectedEnterElement($__qname);
++                    $_ngcc_current_state = 20;
++                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                 }
+             }
+             break;
+-        case 11:
++        case 29:
+             {
+-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
+-                    NGCCHandler h = new annotation(this, super._source, $runtime, 425, null,AnnotationContext.PARTICLE);
++                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence"))) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group"))))))) {
++                    NGCCHandler h = new modelGroupBody(this, super._source, $runtime, 603, loc,compositorName);
+                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+-                    $_ngcc_current_state = 10;
+-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
++                    unexpectedEnterElement($__qname);
+                 }
+             }
+             break;
+-        case 21:
++        case 10:
+             {
+-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
+-                    NGCCHandler h = new annotation(this, super._source, $runtime, 437, null,AnnotationContext.PARTICLE);
+-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+-                }
+-                else {
+-                    $_ngcc_current_state = 20;
+-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+-                }
++                action3();
++                $_ngcc_current_state = 7;
++                $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+             }
+             break;
+-        case 16:
++        case 30:
+             {
+-                if(((($ai = $runtime.getAttributeIndex("","maxOccurs"))>=0 && (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) || ((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique")))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) || ((($ai = $runtime.getAttributeIndex("","minOccurs"))>=0 && (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) || ((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique")))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) || ((($ai = $runtime.getAttributeIndex("","default"))>=0 && (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) || ((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique")))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) || ((($ai = $runtime.getAttributeIndex("","block"))>=0 && (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) || ((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique")))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) || ((($ai = $runtime.getAttributeIndex("","ref"))>=0 && (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) || ((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique")))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) || ((($ai = $runtime.getAttributeIndex("","fixed"))>=0 && (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) || ((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique")))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) || ((($ai = $runtime.getAttributeIndex("","name"))>=0 && (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) || ((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique")))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) || ((($ai = $runtime.getAttributeIndex("","form"))>=0 && (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) || ((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique")))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) || ((($ai = $runtime.getAttributeIndex("","abstract"))>=0 && (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) || ((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique")))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) || (($ai = $runtime.getAttributeIndex("","final"))>=0 && (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) || ((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique")))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))))))))))))) {
+-                    NGCCHandler h = new occurs(this, super._source, $runtime, 431);
++                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence"))) || ((($ai = $runtime.getAttributeIndex("","maxOccurs"))>=0 && ((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any"))) || ((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence")))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) || ((($ai = $runtime.getAttributeIndex("","minOccurs"))>=0 && ((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any"))) || ((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence")))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group"))))))))) {
++                    NGCCHandler h = new occurs(this, super._source, $runtime, 604);
+                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+@@ -245,8 +261,8 @@
+                     $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+-                    if((($ai = $runtime.getAttributeIndex("","default"))>=0 || (($ai = $runtime.getAttributeIndex("","block"))>=0 || (($ai = $runtime.getAttributeIndex("","fixed"))>=0 || (($ai = $runtime.getAttributeIndex("","name"))>=0 || (($ai = $runtime.getAttributeIndex("","form"))>=0 || (($ai = $runtime.getAttributeIndex("","abstract"))>=0 || ($ai = $runtime.getAttributeIndex("","final"))>=0))))))) {
+-                        NGCCHandler h = new elementDeclBody(this, super._source, $runtime, 422, loc,false);
++                    if((($ai = $runtime.getAttributeIndex("","default"))>=0 || (($ai = $runtime.getAttributeIndex("","block"))>=0 || (($ai = $runtime.getAttributeIndex("","fixed"))>=0 || (($ai = $runtime.getAttributeIndex("","form"))>=0 || (($ai = $runtime.getAttributeIndex("","final"))>=0 || (($ai = $runtime.getAttributeIndex("","abstract"))>=0 || ($ai = $runtime.getAttributeIndex("","name"))>=0))))))) {
++                        NGCCHandler h = new elementDeclBody(this, super._source, $runtime, 579, loc,false);
+                         spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                     }
+                     else {
+@@ -255,21 +271,15 @@
+                 }
+             }
+             break;
+-        case 29:
++        case 0:
+             {
+-                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any")) || (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))))))) {
+-                    NGCCHandler h = new modelGroupBody(this, super._source, $runtime, 446, loc,compositorName);
+-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+-                }
+-                else {
+-                    unexpectedEnterElement($__qname);
+-                }
++                revertToParentFromEnterElement(result, super._cookie, $__uri, $__local, $__qname, $attrs);
+             }
+             break;
+-        case 26:
++        case 3:
+             {
+-                if(((($ai = $runtime.getAttributeIndex("","maxOccurs"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) || ((($ai = $runtime.getAttributeIndex("","minOccurs"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) || (($ai = $runtime.getAttributeIndex("","ref"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))))) {
+-                    NGCCHandler h = new occurs(this, super._source, $runtime, 442);
++                if((($ai = $runtime.getAttributeIndex("","processContents"))>=0 || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || ($ai = $runtime.getAttributeIndex("","namespace"))>=0))) {
++                    NGCCHandler h = new wildcardBody(this, super._source, $runtime, 573, wloc);
+                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+@@ -277,26 +287,16 @@
+                 }
+             }
+             break;
+-        case 30:
++        case 11:
+             {
+-                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || ((($ai = $runtime.getAttributeIndex("","maxOccurs"))>=0 && ((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element")) || ((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence")))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group")) || ((($ai = $runtime.getAttributeIndex("","minOccurs"))>=0 && ((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element")) || ((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence")))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any")) || (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))))))))) {
+-                    NGCCHandler h = new occurs(this, super._source, $runtime, 447);
++                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
++                    NGCCHandler h = new annotation(this, super._source, $runtime, 582, null,AnnotationContext.PARTICLE);
+                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+-                    unexpectedEnterElement($__qname);
+-                }
+-            }
+-            break;
+-        case 25:
+-            {
+-                if(($ai = $runtime.getAttributeIndex("","ref"))>=0) {
+-                    $runtime.consumeAttribute($ai);
++                    $_ngcc_current_state = 10;
+                     $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                 }
+-                else {
+-                    unexpectedEnterElement($__qname);
+-                }
+             }
+             break;
+         default:
+@@ -313,9 +313,20 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
+-        case 19:
++        case 26:
+             {
+-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group"))) {
++                if(((($ai = $runtime.getAttributeIndex("","maxOccurs"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group"))) || ((($ai = $runtime.getAttributeIndex("","minOccurs"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group"))) || (($ai = $runtime.getAttributeIndex("","ref"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group")))))) {
++                    NGCCHandler h = new occurs(this, super._source, $runtime, 599);
++                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
++                }
++                else {
++                    unexpectedLeaveElement($__qname);
++                }
++            }
++            break;
++        case 28:
++            {
++                if(((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence")))) {
+                     $runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
+                     $_ngcc_current_state = 0;
+                 }
+@@ -324,10 +335,10 @@
+                 }
+             }
+             break;
+-        case 3:
++        case 4:
+             {
+-                if(((($ai = $runtime.getAttributeIndex("","namespace"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any"))) || ((($ai = $runtime.getAttributeIndex("","processContents"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any"))))) {
+-                    NGCCHandler h = new wildcardBody(this, super._source, $runtime, 416, wloc);
++                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any")) || ((($ai = $runtime.getAttributeIndex("","processContents"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any"))) || ((($ai = $runtime.getAttributeIndex("","maxOccurs"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any"))) || ((($ai = $runtime.getAttributeIndex("","minOccurs"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any"))) || (($ai = $runtime.getAttributeIndex("","namespace"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any")))))))) {
++                    NGCCHandler h = new occurs(this, super._source, $runtime, 574);
+                     spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
+                 }
+                 else {
+@@ -335,16 +346,26 @@
+                 }
+             }
+             break;
+-        case 10:
++        case 2:
+             {
+-                action3();
+-                $_ngcc_current_state = 7;
+-                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
++                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any"))) {
++                    $runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
++                    $_ngcc_current_state = 0;
++                }
++                else {
++                    unexpectedLeaveElement($__qname);
++                }
+             }
+             break;
+-        case 0:
++        case 25:
+             {
+-                revertToParentFromLeaveElement(result, super._cookie, $__uri, $__local, $__qname);
++                if(($ai = $runtime.getAttributeIndex("","ref"))>=0) {
++                    $runtime.consumeAttribute($ai);
++                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
++                }
++                else {
++                    unexpectedLeaveElement($__qname);
++                }
+             }
+             break;
+         case 20:
+@@ -354,10 +375,10 @@
+                 $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 4:
++        case 16:
+             {
+-                if(((($ai = $runtime.getAttributeIndex("","namespace"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any"))) || ((($ai = $runtime.getAttributeIndex("","maxOccurs"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any"))) || ((($ai = $runtime.getAttributeIndex("","minOccurs"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any"))) || ((($ai = $runtime.getAttributeIndex("","processContents"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any"))))))) {
+-                    NGCCHandler h = new occurs(this, super._source, $runtime, 417);
++                if(((($ai = $runtime.getAttributeIndex("","default"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || ((($ai = $runtime.getAttributeIndex("","block"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || ((($ai = $runtime.getAttributeIndex("","fixed"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || ((($ai = $runtime.getAttributeIndex("","maxOccurs"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || ((($ai = $runtime.getAttributeIndex("","minOccurs"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || ((($ai = $runtime.getAttributeIndex("","form"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || ((($ai = $runtime.getAttributeIndex("","final"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || ((($ai = $runtime.getAttributeIndex("","abstract"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || ((($ai = $runtime.getAttributeIndex("","ref"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || (($ai = $runtime.getAttributeIndex("","name"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))))))))))))) {
++                    NGCCHandler h = new occurs(this, super._source, $runtime, 588);
+                     spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
+                 }
+                 else {
+@@ -365,12 +386,6 @@
+                 }
+             }
+             break;
+-        case 11:
+-            {
+-                $_ngcc_current_state = 10;
+-                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+         case 21:
+             {
+                 $_ngcc_current_state = 20;
+@@ -377,9 +392,9 @@
+                 $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 2:
++        case 19:
+             {
+-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any"))) {
++                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group"))) {
+                     $runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
+                     $_ngcc_current_state = 0;
+                 }
+@@ -388,10 +403,10 @@
+                 }
+             }
+             break;
+-        case 16:
++        case 29:
+             {
+-                if(((($ai = $runtime.getAttributeIndex("","maxOccurs"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || ((($ai = $runtime.getAttributeIndex("","minOccurs"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || ((($ai = $runtime.getAttributeIndex("","default"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || ((($ai = $runtime.getAttributeIndex("","block"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || ((($ai = $runtime.getAttributeIndex("","ref"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || ((($ai = $runtime.getAttributeIndex("","fixed"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || ((($ai = $runtime.getAttributeIndex("","name"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || ((($ai = $runtime.getAttributeIndex("","form"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || ((($ai = $runtime.getAttributeIndex("","abstract"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || (($ai = $runtime.getAttributeIndex("","final"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))))))))))))) {
+-                    NGCCHandler h = new occurs(this, super._source, $runtime, 431);
++                if(((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence")))) {
++                    NGCCHandler h = new modelGroupBody(this, super._source, $runtime, 603, loc,compositorName);
+                     spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
+                 }
+                 else {
+@@ -399,6 +414,24 @@
+                 }
+             }
+             break;
++        case 10:
++            {
++                action3();
++                $_ngcc_current_state = 7;
++                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
++            }
++            break;
++        case 30:
++            {
++                if((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence"))) || ((($ai = $runtime.getAttributeIndex("","maxOccurs"))>=0 && ((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence")))) || (($ai = $runtime.getAttributeIndex("","minOccurs"))>=0 && ((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence"))))))) {
++                    NGCCHandler h = new occurs(this, super._source, $runtime, 604);
++                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
++                }
++                else {
++                    unexpectedLeaveElement($__qname);
++                }
++            }
++            break;
+         case 7:
+             {
+                 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) {
+@@ -417,8 +450,8 @@
+                     $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                 }
+                 else {
+-                    if(((($ai = $runtime.getAttributeIndex("","default"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || ((($ai = $runtime.getAttributeIndex("","block"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || ((($ai = $runtime.getAttributeIndex("","fixed"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || ((($ai = $runtime.getAttributeIndex("","name"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || ((($ai = $runtime.getAttributeIndex("","form"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || ((($ai = $runtime.getAttributeIndex("","abstract"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || (($ai = $runtime.getAttributeIndex("","final"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element")))))))))) {
+-                        NGCCHandler h = new elementDeclBody(this, super._source, $runtime, 422, loc,false);
++                    if(((($ai = $runtime.getAttributeIndex("","default"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || ((($ai = $runtime.getAttributeIndex("","block"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || ((($ai = $runtime.getAttributeIndex("","fixed"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || ((($ai = $runtime.getAttributeIndex("","form"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || ((($ai = $runtime.getAttributeIndex("","final"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || ((($ai = $runtime.getAttributeIndex("","abstract"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element"))) || (($ai = $runtime.getAttributeIndex("","name"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element")))))))))) {
++                        NGCCHandler h = new elementDeclBody(this, super._source, $runtime, 579, loc,false);
+                         spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
+                     }
+                     else {
+@@ -427,21 +460,15 @@
+                 }
+             }
+             break;
+-        case 29:
++        case 0:
+             {
+-                if(((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence")))) {
+-                    NGCCHandler h = new modelGroupBody(this, super._source, $runtime, 446, loc,compositorName);
+-                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
+-                }
+-                else {
+-                    unexpectedLeaveElement($__qname);
+-                }
++                revertToParentFromLeaveElement(result, super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 26:
++        case 3:
+             {
+-                if(((($ai = $runtime.getAttributeIndex("","maxOccurs"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group"))) || ((($ai = $runtime.getAttributeIndex("","minOccurs"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group"))) || (($ai = $runtime.getAttributeIndex("","ref"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group")))))) {
+-                    NGCCHandler h = new occurs(this, super._source, $runtime, 442);
++                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any")) || ((($ai = $runtime.getAttributeIndex("","processContents"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any"))) || (($ai = $runtime.getAttributeIndex("","namespace"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any")))))) {
++                    NGCCHandler h = new wildcardBody(this, super._source, $runtime, 573, wloc);
+                     spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
+                 }
+                 else {
+@@ -449,39 +476,12 @@
+                 }
+             }
+             break;
+-        case 28:
++        case 11:
+             {
+-                if(((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence")))) {
+-                    $runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
+-                    $_ngcc_current_state = 0;
+-                }
+-                else {
+-                    unexpectedLeaveElement($__qname);
+-                }
++                $_ngcc_current_state = 10;
++                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 30:
+-            {
+-                if((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence"))) || ((($ai = $runtime.getAttributeIndex("","maxOccurs"))>=0 && ((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence")))) || (($ai = $runtime.getAttributeIndex("","minOccurs"))>=0 && ((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence"))))))) {
+-                    NGCCHandler h = new occurs(this, super._source, $runtime, 447);
+-                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
+-                }
+-                else {
+-                    unexpectedLeaveElement($__qname);
+-                }
+-            }
+-            break;
+-        case 25:
+-            {
+-                if(($ai = $runtime.getAttributeIndex("","ref"))>=0) {
+-                    $runtime.consumeAttribute($ai);
+-                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+-                }
+-                else {
+-                    unexpectedLeaveElement($__qname);
+-                }
+-            }
+-            break;
+         default:
+             {
+                 unexpectedLeaveElement($__qname);
+@@ -498,8 +498,8 @@
+         switch($_ngcc_current_state) {
+         case 4:
+             {
+-                if((($__uri.equals("") && $__local.equals("namespace")) || (($__uri.equals("") && $__local.equals("maxOccurs")) || (($__uri.equals("") && $__local.equals("minOccurs")) || ($__uri.equals("") && $__local.equals("processContents")))))) {
+-                    NGCCHandler h = new occurs(this, super._source, $runtime, 417);
++                if((($__uri.equals("") && $__local.equals("processContents")) || (($__uri.equals("") && $__local.equals("maxOccurs")) || (($__uri.equals("") && $__local.equals("minOccurs")) || ($__uri.equals("") && $__local.equals("namespace")))))) {
++                    NGCCHandler h = new occurs(this, super._source, $runtime, 574);
+                     spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
+                 }
+                 else {
+@@ -507,22 +507,28 @@
+                 }
+             }
+             break;
+-        case 11:
++        case 26:
+             {
+-                $_ngcc_current_state = 10;
+-                $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
++                if((($__uri.equals("") && $__local.equals("maxOccurs")) || (($__uri.equals("") && $__local.equals("minOccurs")) || ($__uri.equals("") && $__local.equals("ref"))))) {
++                    NGCCHandler h = new occurs(this, super._source, $runtime, 599);
++                    spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
++                }
++                else {
++                    unexpectedEnterAttribute($__qname);
++                }
+             }
+             break;
+-        case 21:
++        case 10:
+             {
+-                $_ngcc_current_state = 20;
++                action3();
++                $_ngcc_current_state = 7;
+                 $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 16:
++        case 30:
+             {
+-                if((($__uri.equals("") && $__local.equals("maxOccurs")) || (($__uri.equals("") && $__local.equals("minOccurs")) || (($__uri.equals("") && $__local.equals("default")) || (($__uri.equals("") && $__local.equals("block")) || (($__uri.equals("") && $__local.equals("ref")) || (($__uri.equals("") && $__local.equals("fixed")) || (($__uri.equals("") && $__local.equals("name")) || (($__uri.equals("") && $__local.equals("form")) || (($__uri.equals("") && $__local.equals("abstract")) || ($__uri.equals("") && $__local.equals("final")))))))))))) {
+-                    NGCCHandler h = new occurs(this, super._source, $runtime, 431);
++                if((($__uri.equals("") && $__local.equals("maxOccurs")) || ($__uri.equals("") && $__local.equals("minOccurs")))) {
++                    NGCCHandler h = new occurs(this, super._source, $runtime, 604);
+                     spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
+                 }
+                 else {
+@@ -530,6 +536,23 @@
+                 }
+             }
+             break;
++        case 20:
++            {
++                action5();
++                $_ngcc_current_state = 19;
++                $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
++            }
++            break;
++        case 25:
++            {
++                if(($__uri.equals("") && $__local.equals("ref"))) {
++                    $_ngcc_current_state = 24;
++                }
++                else {
++                    unexpectedEnterAttribute($__qname);
++                }
++            }
++            break;
+         case 8:
+             {
+                 if(($__uri.equals("") && $__local.equals("ref"))) {
+@@ -536,8 +559,8 @@
+                     $_ngcc_current_state = 14;
+                 }
+                 else {
+-                    if((($__uri.equals("") && $__local.equals("default")) || (($__uri.equals("") && $__local.equals("block")) || (($__uri.equals("") && $__local.equals("fixed")) || (($__uri.equals("") && $__local.equals("name")) || (($__uri.equals("") && $__local.equals("form")) || (($__uri.equals("") && $__local.equals("abstract")) || ($__uri.equals("") && $__local.equals("final"))))))))) {
+-                        NGCCHandler h = new elementDeclBody(this, super._source, $runtime, 422, loc,false);
++                    if((($__uri.equals("") && $__local.equals("default")) || (($__uri.equals("") && $__local.equals("block")) || (($__uri.equals("") && $__local.equals("fixed")) || (($__uri.equals("") && $__local.equals("form")) || (($__uri.equals("") && $__local.equals("final")) || (($__uri.equals("") && $__local.equals("abstract")) || ($__uri.equals("") && $__local.equals("name"))))))))) {
++                        NGCCHandler h = new elementDeclBody(this, super._source, $runtime, 579, loc,false);
+                         spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
+                     }
+                     else {
+@@ -546,40 +569,15 @@
+                 }
+             }
+             break;
+-        case 3:
+-            {
+-                if((($__uri.equals("") && $__local.equals("namespace")) || ($__uri.equals("") && $__local.equals("processContents")))) {
+-                    NGCCHandler h = new wildcardBody(this, super._source, $runtime, 416, wloc);
+-                    spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
+-                }
+-                else {
+-                    unexpectedEnterAttribute($__qname);
+-                }
+-            }
+-            break;
+-        case 10:
+-            {
+-                action3();
+-                $_ngcc_current_state = 7;
+-                $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+         case 0:
+             {
+                 revertToParentFromEnterAttribute(result, super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 20:
++        case 16:
+             {
+-                action5();
+-                $_ngcc_current_state = 19;
+-                $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+-        case 26:
+-            {
+-                if((($__uri.equals("") && $__local.equals("maxOccurs")) || (($__uri.equals("") && $__local.equals("minOccurs")) || ($__uri.equals("") && $__local.equals("ref"))))) {
+-                    NGCCHandler h = new occurs(this, super._source, $runtime, 442);
++                if((($__uri.equals("") && $__local.equals("default")) || (($__uri.equals("") && $__local.equals("block")) || (($__uri.equals("") && $__local.equals("fixed")) || (($__uri.equals("") && $__local.equals("maxOccurs")) || (($__uri.equals("") && $__local.equals("minOccurs")) || (($__uri.equals("") && $__local.equals("form")) || (($__uri.equals("") && $__local.equals("final")) || (($__uri.equals("") && $__local.equals("abstract")) || (($__uri.equals("") && $__local.equals("ref")) || ($__uri.equals("") && $__local.equals("name")))))))))))) {
++                    NGCCHandler h = new occurs(this, super._source, $runtime, 588);
+                     spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
+                 }
+                 else {
+@@ -587,10 +585,10 @@
+                 }
+             }
+             break;
+-        case 30:
++        case 3:
+             {
+-                if((($__uri.equals("") && $__local.equals("maxOccurs")) || ($__uri.equals("") && $__local.equals("minOccurs")))) {
+-                    NGCCHandler h = new occurs(this, super._source, $runtime, 447);
++                if((($__uri.equals("") && $__local.equals("processContents")) || ($__uri.equals("") && $__local.equals("namespace")))) {
++                    NGCCHandler h = new wildcardBody(this, super._source, $runtime, 573, wloc);
+                     spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
+                 }
+                 else {
+@@ -598,16 +596,18 @@
+                 }
+             }
+             break;
+-        case 25:
++        case 21:
+             {
+-                if(($__uri.equals("") && $__local.equals("ref"))) {
+-                    $_ngcc_current_state = 24;
+-                }
+-                else {
+-                    unexpectedEnterAttribute($__qname);
+-                }
++                $_ngcc_current_state = 20;
++                $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
++        case 11:
++            {
++                $_ngcc_current_state = 10;
++                $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
++            }
++            break;
+         default:
+             {
+                 unexpectedEnterAttribute($__qname);
+@@ -622,10 +622,10 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
+-        case 13:
++        case 23:
+             {
+                 if(($__uri.equals("") && $__local.equals("ref"))) {
+-                    $_ngcc_current_state = 11;
++                    $_ngcc_current_state = 21;
+                 }
+                 else {
+                     unexpectedLeaveAttribute($__qname);
+@@ -632,45 +632,45 @@
+                 }
+             }
+             break;
+-        case 11:
++        case 10:
+             {
+-                $_ngcc_current_state = 10;
++                action3();
++                $_ngcc_current_state = 7;
+                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 21:
++        case 20:
+             {
+-                $_ngcc_current_state = 20;
++                action5();
++                $_ngcc_current_state = 19;
+                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 23:
++        case 0:
+             {
+-                if(($__uri.equals("") && $__local.equals("ref"))) {
+-                    $_ngcc_current_state = 21;
+-                }
+-                else {
+-                    unexpectedLeaveAttribute($__qname);
+-                }
++                revertToParentFromLeaveAttribute(result, super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 10:
++        case 21:
+             {
+-                action3();
+-                $_ngcc_current_state = 7;
++                $_ngcc_current_state = 20;
+                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 0:
++        case 11:
+             {
+-                revertToParentFromLeaveAttribute(result, super._cookie, $__uri, $__local, $__qname);
++                $_ngcc_current_state = 10;
++                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 20:
++        case 13:
+             {
+-                action5();
+-                $_ngcc_current_state = 19;
+-                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
++                if(($__uri.equals("") && $__local.equals("ref"))) {
++                    $_ngcc_current_state = 11;
++                }
++                else {
++                    unexpectedLeaveAttribute($__qname);
++                }
+             }
+             break;
+         default:
+@@ -684,70 +684,45 @@
+     public void text(String $value) throws SAXException {
+         int $ai;
+         switch($_ngcc_current_state) {
+-        case 24:
++        case 26:
+             {
+-                NGCCHandler h = new qname(this, super._source, $runtime, 440);
+-                spawnChildFromText(h, $value);
+-            }
+-            break;
+-        case 3:
+-            {
+-                if(($ai = $runtime.getAttributeIndex("","processContents"))>=0) {
+-                    NGCCHandler h = new wildcardBody(this, super._source, $runtime, 416, wloc);
++                if(($ai = $runtime.getAttributeIndex("","ref"))>=0) {
++                    NGCCHandler h = new occurs(this, super._source, $runtime, 599);
+                     spawnChildFromText(h, $value);
+                 }
+                 else {
+-                    if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) {
+-                        NGCCHandler h = new wildcardBody(this, super._source, $runtime, 416, wloc);
++                    if(($ai = $runtime.getAttributeIndex("","minOccurs"))>=0) {
++                        NGCCHandler h = new occurs(this, super._source, $runtime, 599);
+                         spawnChildFromText(h, $value);
+                     }
++                    else {
++                        if(($ai = $runtime.getAttributeIndex("","maxOccurs"))>=0) {
++                            NGCCHandler h = new occurs(this, super._source, $runtime, 599);
++                            spawnChildFromText(h, $value);
++                        }
++                    }
+                 }
+             }
+             break;
+-        case 10:
+-            {
+-                action3();
+-                $_ngcc_current_state = 7;
+-                $runtime.sendText(super._cookie, $value);
+-            }
+-            break;
+-        case 0:
+-            {
+-                revertToParentFromText(result, super._cookie, $value);
+-            }
+-            break;
+-        case 20:
+-            {
+-                action5();
+-                $_ngcc_current_state = 19;
+-                $runtime.sendText(super._cookie, $value);
+-            }
+-            break;
+-        case 14:
+-            {
+-                NGCCHandler h = new qname(this, super._source, $runtime, 428);
+-                spawnChildFromText(h, $value);
+-            }
+-            break;
+         case 4:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","processContents"))>=0) {
+-                    NGCCHandler h = new occurs(this, super._source, $runtime, 417);
++                if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) {
++                    NGCCHandler h = new occurs(this, super._source, $runtime, 574);
+                     spawnChildFromText(h, $value);
+                 }
+                 else {
+                     if(($ai = $runtime.getAttributeIndex("","minOccurs"))>=0) {
+-                        NGCCHandler h = new occurs(this, super._source, $runtime, 417);
++                        NGCCHandler h = new occurs(this, super._source, $runtime, 574);
+                         spawnChildFromText(h, $value);
+                     }
+                     else {
+                         if(($ai = $runtime.getAttributeIndex("","maxOccurs"))>=0) {
+-                            NGCCHandler h = new occurs(this, super._source, $runtime, 417);
++                            NGCCHandler h = new occurs(this, super._source, $runtime, 574);
+                             spawnChildFromText(h, $value);
+                         }
+                         else {
+-                            if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) {
+-                                NGCCHandler h = new occurs(this, super._source, $runtime, 417);
++                            if(($ai = $runtime.getAttributeIndex("","processContents"))>=0) {
++                                NGCCHandler h = new occurs(this, super._source, $runtime, 574);
+                                 spawnChildFromText(h, $value);
+                             }
+                         }
+@@ -755,67 +730,70 @@
+                 }
+             }
+             break;
+-        case 11:
++        case 25:
+             {
+-                $_ngcc_current_state = 10;
+-                $runtime.sendText(super._cookie, $value);
++                if(($ai = $runtime.getAttributeIndex("","ref"))>=0) {
++                    $runtime.consumeAttribute($ai);
++                    $runtime.sendText(super._cookie, $value);
++                }
+             }
+             break;
+-        case 21:
++        case 20:
+             {
+-                $_ngcc_current_state = 20;
++                action5();
++                $_ngcc_current_state = 19;
+                 $runtime.sendText(super._cookie, $value);
+             }
+             break;
+         case 16:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","final"))>=0) {
+-                    NGCCHandler h = new occurs(this, super._source, $runtime, 431);
++                if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
++                    NGCCHandler h = new occurs(this, super._source, $runtime, 588);
+                     spawnChildFromText(h, $value);
+                 }
+                 else {
+-                    if(($ai = $runtime.getAttributeIndex("","abstract"))>=0) {
+-                        NGCCHandler h = new occurs(this, super._source, $runtime, 431);
++                    if(($ai = $runtime.getAttributeIndex("","ref"))>=0) {
++                        NGCCHandler h = new occurs(this, super._source, $runtime, 588);
+                         spawnChildFromText(h, $value);
+                     }
+                     else {
+-                        if(($ai = $runtime.getAttributeIndex("","form"))>=0) {
+-                            NGCCHandler h = new occurs(this, super._source, $runtime, 431);
++                        if(($ai = $runtime.getAttributeIndex("","abstract"))>=0) {
++                            NGCCHandler h = new occurs(this, super._source, $runtime, 588);
+                             spawnChildFromText(h, $value);
+                         }
+                         else {
+-                            if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
+-                                NGCCHandler h = new occurs(this, super._source, $runtime, 431);
++                            if(($ai = $runtime.getAttributeIndex("","final"))>=0) {
++                                NGCCHandler h = new occurs(this, super._source, $runtime, 588);
+                                 spawnChildFromText(h, $value);
+                             }
+                             else {
+-                                if(($ai = $runtime.getAttributeIndex("","fixed"))>=0) {
+-                                    NGCCHandler h = new occurs(this, super._source, $runtime, 431);
++                                if(($ai = $runtime.getAttributeIndex("","form"))>=0) {
++                                    NGCCHandler h = new occurs(this, super._source, $runtime, 588);
+                                     spawnChildFromText(h, $value);
+                                 }
+                                 else {
+-                                    if(($ai = $runtime.getAttributeIndex("","ref"))>=0) {
+-                                        NGCCHandler h = new occurs(this, super._source, $runtime, 431);
++                                    if(($ai = $runtime.getAttributeIndex("","minOccurs"))>=0) {
++                                        NGCCHandler h = new occurs(this, super._source, $runtime, 588);
+                                         spawnChildFromText(h, $value);
+                                     }
+                                     else {
+-                                        if(($ai = $runtime.getAttributeIndex("","block"))>=0) {
+-                                            NGCCHandler h = new occurs(this, super._source, $runtime, 431);
++                                        if(($ai = $runtime.getAttributeIndex("","maxOccurs"))>=0) {
++                                            NGCCHandler h = new occurs(this, super._source, $runtime, 588);
+                                             spawnChildFromText(h, $value);
+                                         }
+                                         else {
+-                                            if(($ai = $runtime.getAttributeIndex("","default"))>=0) {
+-                                                NGCCHandler h = new occurs(this, super._source, $runtime, 431);
++                                            if(($ai = $runtime.getAttributeIndex("","fixed"))>=0) {
++                                                NGCCHandler h = new occurs(this, super._source, $runtime, 588);
+                                                 spawnChildFromText(h, $value);
+                                             }
+                                             else {
+-                                                if(($ai = $runtime.getAttributeIndex("","minOccurs"))>=0) {
+-                                                    NGCCHandler h = new occurs(this, super._source, $runtime, 431);
++                                                if(($ai = $runtime.getAttributeIndex("","block"))>=0) {
++                                                    NGCCHandler h = new occurs(this, super._source, $runtime, 588);
+                                                     spawnChildFromText(h, $value);
+                                                 }
+                                                 else {
+-                                                    if(($ai = $runtime.getAttributeIndex("","maxOccurs"))>=0) {
+-                                                        NGCCHandler h = new occurs(this, super._source, $runtime, 431);
++                                                    if(($ai = $runtime.getAttributeIndex("","default"))>=0) {
++                                                        NGCCHandler h = new occurs(this, super._source, $runtime, 588);
+                                                         spawnChildFromText(h, $value);
+                                                     }
+                                                 }
+@@ -829,6 +807,39 @@
+                 }
+             }
+             break;
++        case 21:
++            {
++                $_ngcc_current_state = 20;
++                $runtime.sendText(super._cookie, $value);
++            }
++            break;
++        case 10:
++            {
++                action3();
++                $_ngcc_current_state = 7;
++                $runtime.sendText(super._cookie, $value);
++            }
++            break;
++        case 14:
++            {
++                NGCCHandler h = new qname(this, super._source, $runtime, 585);
++                spawnChildFromText(h, $value);
++            }
++            break;
++        case 30:
++            {
++                if(($ai = $runtime.getAttributeIndex("","minOccurs"))>=0) {
++                    NGCCHandler h = new occurs(this, super._source, $runtime, 604);
++                    spawnChildFromText(h, $value);
++                }
++                else {
++                    if(($ai = $runtime.getAttributeIndex("","maxOccurs"))>=0) {
++                        NGCCHandler h = new occurs(this, super._source, $runtime, 604);
++                        spawnChildFromText(h, $value);
++                    }
++                }
++            }
++            break;
+         case 8:
+             {
+                 if(($ai = $runtime.getAttributeIndex("","ref"))>=0) {
+@@ -836,38 +847,38 @@
+                     $runtime.sendText(super._cookie, $value);
+                 }
+                 else {
+-                    if(($ai = $runtime.getAttributeIndex("","final"))>=0) {
+-                        NGCCHandler h = new elementDeclBody(this, super._source, $runtime, 422, loc,false);
++                    if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
++                        NGCCHandler h = new elementDeclBody(this, super._source, $runtime, 579, loc,false);
+                         spawnChildFromText(h, $value);
+                     }
+                     else {
+                         if(($ai = $runtime.getAttributeIndex("","abstract"))>=0) {
+-                            NGCCHandler h = new elementDeclBody(this, super._source, $runtime, 422, loc,false);
++                            NGCCHandler h = new elementDeclBody(this, super._source, $runtime, 579, loc,false);
+                             spawnChildFromText(h, $value);
+                         }
+                         else {
+-                            if(($ai = $runtime.getAttributeIndex("","form"))>=0) {
+-                                NGCCHandler h = new elementDeclBody(this, super._source, $runtime, 422, loc,false);
++                            if(($ai = $runtime.getAttributeIndex("","final"))>=0) {
++                                NGCCHandler h = new elementDeclBody(this, super._source, $runtime, 579, loc,false);
+                                 spawnChildFromText(h, $value);
+                             }
+                             else {
+-                                if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
+-                                    NGCCHandler h = new elementDeclBody(this, super._source, $runtime, 422, loc,false);
++                                if(($ai = $runtime.getAttributeIndex("","form"))>=0) {
++                                    NGCCHandler h = new elementDeclBody(this, super._source, $runtime, 579, loc,false);
+                                     spawnChildFromText(h, $value);
+                                 }
+                                 else {
+                                     if(($ai = $runtime.getAttributeIndex("","fixed"))>=0) {
+-                                        NGCCHandler h = new elementDeclBody(this, super._source, $runtime, 422, loc,false);
++                                        NGCCHandler h = new elementDeclBody(this, super._source, $runtime, 579, loc,false);
+                                         spawnChildFromText(h, $value);
+                                     }
+                                     else {
+                                         if(($ai = $runtime.getAttributeIndex("","block"))>=0) {
+-                                            NGCCHandler h = new elementDeclBody(this, super._source, $runtime, 422, loc,false);
++                                            NGCCHandler h = new elementDeclBody(this, super._source, $runtime, 579, loc,false);
+                                             spawnChildFromText(h, $value);
+                                         }
+                                         else {
+                                             if(($ai = $runtime.getAttributeIndex("","default"))>=0) {
+-                                                NGCCHandler h = new elementDeclBody(this, super._source, $runtime, 422, loc,false);
++                                                NGCCHandler h = new elementDeclBody(this, super._source, $runtime, 579, loc,false);
+                                                 spawnChildFromText(h, $value);
+                                             }
+                                         }
+@@ -879,120 +890,109 @@
+                 }
+             }
+             break;
+-        case 26:
++        case 0:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","ref"))>=0) {
+-                    NGCCHandler h = new occurs(this, super._source, $runtime, 442);
+-                    spawnChildFromText(h, $value);
+-                }
+-                else {
+-                    if(($ai = $runtime.getAttributeIndex("","minOccurs"))>=0) {
+-                        NGCCHandler h = new occurs(this, super._source, $runtime, 442);
+-                        spawnChildFromText(h, $value);
+-                    }
+-                    else {
+-                        if(($ai = $runtime.getAttributeIndex("","maxOccurs"))>=0) {
+-                            NGCCHandler h = new occurs(this, super._source, $runtime, 442);
+-                            spawnChildFromText(h, $value);
+-                        }
+-                    }
+-                }
++                revertToParentFromText(result, super._cookie, $value);
+             }
+             break;
+-        case 30:
++        case 3:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","minOccurs"))>=0) {
+-                    NGCCHandler h = new occurs(this, super._source, $runtime, 447);
++                if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) {
++                    NGCCHandler h = new wildcardBody(this, super._source, $runtime, 573, wloc);
+                     spawnChildFromText(h, $value);
+                 }
+                 else {
+-                    if(($ai = $runtime.getAttributeIndex("","maxOccurs"))>=0) {
+-                        NGCCHandler h = new occurs(this, super._source, $runtime, 447);
++                    if(($ai = $runtime.getAttributeIndex("","processContents"))>=0) {
++                        NGCCHandler h = new wildcardBody(this, super._source, $runtime, 573, wloc);
+                         spawnChildFromText(h, $value);
+                     }
+                 }
+             }
+             break;
+-        case 25:
++        case 24:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","ref"))>=0) {
+-                    $runtime.consumeAttribute($ai);
+-                    $runtime.sendText(super._cookie, $value);
+-                }
++                NGCCHandler h = new qname(this, super._source, $runtime, 597);
++                spawnChildFromText(h, $value);
+             }
+             break;
++        case 11:
++            {
++                $_ngcc_current_state = 10;
++                $runtime.sendText(super._cookie, $value);
++            }
++            break;
+         }
+     }
+ 
+     public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException {
+         switch($__cookie__) {
+-        case 440:
++        case 599:
+             {
+-                groupName = ((UName)$__result__);
+-                $_ngcc_current_state = 23;
++                occurs = ((occurs)$__result__);
++                $_ngcc_current_state = 25;
+             }
+             break;
+-        case 416:
++        case 579:
+             {
++                anonymousElementDecl = ((ElementDecl)$__result__);
++                action2();
++                $_ngcc_current_state = 7;
++            }
++            break;
++        case 573:
++            {
+                 wcBody = ((WildcardImpl)$__result__);
+                 action0();
+                 $_ngcc_current_state = 2;
+             }
+             break;
+-        case 428:
++        case 597:
+             {
+-                elementTypeName = ((UName)$__result__);
+-                $_ngcc_current_state = 13;
++                groupName = ((UName)$__result__);
++                $_ngcc_current_state = 23;
+             }
+             break;
+-        case 425:
++        case 582:
+             {
+                 annotation = ((AnnotationImpl)$__result__);
+                 $_ngcc_current_state = 10;
+             }
+             break;
+-        case 422:
++        case 574:
+             {
+-                anonymousElementDecl = ((ElementDecl)$__result__);
+-                action2();
+-                $_ngcc_current_state = 7;
++                occurs = ((occurs)$__result__);
++                $_ngcc_current_state = 3;
+             }
+             break;
+-        case 446:
++        case 588:
+             {
+-                term = ((ModelGroupImpl)$__result__);
+-                action7();
+-                $_ngcc_current_state = 28;
+-            }
+-            break;
+-        case 442:
+-            {
+                 occurs = ((occurs)$__result__);
+-                $_ngcc_current_state = 25;
++                $_ngcc_current_state = 8;
+             }
+             break;
+-        case 447:
++        case 594:
+             {
+-                occurs = ((occurs)$__result__);
+-                $_ngcc_current_state = 29;
++                annotation = ((AnnotationImpl)$__result__);
++                $_ngcc_current_state = 20;
+             }
+             break;
+-        case 417:
++        case 603:
+             {
+-                occurs = ((occurs)$__result__);
+-                $_ngcc_current_state = 3;
++                term = ((ModelGroupImpl)$__result__);
++                action7();
++                $_ngcc_current_state = 28;
+             }
+             break;
+-        case 437:
++        case 585:
+             {
+-                annotation = ((AnnotationImpl)$__result__);
+-                $_ngcc_current_state = 20;
++                elementTypeName = ((UName)$__result__);
++                $_ngcc_current_state = 13;
+             }
+             break;
+-        case 431:
++        case 604:
+             {
+                 occurs = ((occurs)$__result__);
+-                $_ngcc_current_state = 8;
++                $_ngcc_current_state = 29;
+             }
+             break;
+         }
+@@ -1002,11 +1002,10 @@
+         return(($_ngcc_current_state == 0));
+     }
+ 
+-    
+-    	private Locator wloc;
+-    	private Locator loc;
++
++        private Locator wloc;
++        private Locator loc;
+       private ParticleImpl result;
+       private String compositorName;
+-    
+-}
+ 
++}
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/qname.java	Thu Jul 30 18:44:31 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/qname.java	Thu Jul 30 18:44:30 2009
+@@ -37,9 +37,9 @@
+     import org.xml.sax.ContentHandler;
+     import org.xml.sax.helpers.*;
+     import java.util.*;
+-  
+ 
+ 
++
+ class qname extends NGCCHandler {
+     private String qvalue;
+     protected final NGCCRuntimeEx $runtime;
+@@ -141,11 +141,6 @@
+     public void text(String $value) throws SAXException {
+         int $ai;
+         switch($_ngcc_current_state) {
+-        case 0:
+-            {
+-                revertToParentFromText($runtime.parseUName(qvalue), super._cookie, $value);
+-            }
+-            break;
+         case 1:
+             {
+                 qvalue = $value;
+@@ -152,6 +147,11 @@
+                 $_ngcc_current_state = 0;
+             }
+             break;
++        case 0:
++            {
++                revertToParentFromText($runtime.parseUName(qvalue), super._cookie, $value);
++            }
++            break;
+         }
+     }
+ 
+@@ -166,4 +166,3 @@
+ 
+ 
+ }
+-
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/qualification.java	Thu Jul 30 18:44:35 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/qualification.java	Thu Jul 30 18:44:34 2009
+@@ -37,9 +37,9 @@
+     import org.xml.sax.ContentHandler;
+     import org.xml.sax.helpers.*;
+     import java.util.*;
+-  
+ 
+ 
++
+ class qualification extends NGCCHandler {
+     private String text;
+     protected final NGCCRuntimeEx $runtime;
+@@ -174,4 +174,3 @@
+ 
+ 
+ }
+-
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/redefine.java	Thu Jul 30 18:44:38 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/redefine.java	Thu Jul 30 18:44:38 2009
+@@ -37,9 +37,9 @@
+     import org.xml.sax.ContentHandler;
+     import org.xml.sax.helpers.*;
+     import java.util.*;
+-  
+ 
+ 
++
+ class redefine extends NGCCHandler {
+     private String schemaLocation;
+     private ModelGroupDeclImpl newGrp;
+@@ -116,41 +116,30 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
+-        case 15:
+-            {
+-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("redefine"))) {
+-                    $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
+-                    $_ngcc_current_state = 14;
+-                }
+-                else {
+-                    unexpectedEnterElement($__qname);
+-                }
+-            }
+-            break;
+         case 1:
+             {
+                 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
+-                    NGCCHandler h = new annotation(this, super._source, $runtime, 476, null,AnnotationContext.SCHEMA);
++                    NGCCHandler h = new annotation(this, super._source, $runtime, 369, null,AnnotationContext.SCHEMA);
+                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+                     if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))) {
+-                        NGCCHandler h = new simpleType(this, super._source, $runtime, 477);
++                        NGCCHandler h = new simpleType(this, super._source, $runtime, 370);
+                         spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                     }
+                     else {
+                         if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) {
+-                            NGCCHandler h = new complexType(this, super._source, $runtime, 478);
++                            NGCCHandler h = new complexType(this, super._source, $runtime, 371);
+                             spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                         }
+                         else {
+                             if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group"))) {
+-                                NGCCHandler h = new group(this, super._source, $runtime, 479);
++                                NGCCHandler h = new group(this, super._source, $runtime, 372);
+                                 spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                             }
+                             else {
+                                 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup"))) {
+-                                    NGCCHandler h = new attributeGroupDecl(this, super._source, $runtime, 480);
++                                    NGCCHandler h = new attributeGroupDecl(this, super._source, $runtime, 373);
+                                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                                 }
+                                 else {
+@@ -162,46 +151,30 @@
+                 }
+             }
+             break;
+-        case 0:
+-            {
+-                revertToParentFromEnterElement(this, super._cookie, $__uri, $__local, $__qname, $attrs);
+-            }
+-            break;
+-        case 14:
+-            {
+-                if(($ai = $runtime.getAttributeIndex("","schemaLocation"))>=0) {
+-                    $runtime.consumeAttribute($ai);
+-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+-                }
+-                else {
+-                    unexpectedEnterElement($__qname);
+-                }
+-            }
+-            break;
+         case 2:
+             {
+                 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
+-                    NGCCHandler h = new annotation(this, super._source, $runtime, 481, null,AnnotationContext.SCHEMA);
++                    NGCCHandler h = new annotation(this, super._source, $runtime, 374, null,AnnotationContext.SCHEMA);
+                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+                     if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))) {
+-                        NGCCHandler h = new simpleType(this, super._source, $runtime, 482);
++                        NGCCHandler h = new simpleType(this, super._source, $runtime, 375);
+                         spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                     }
+                     else {
+                         if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) {
+-                            NGCCHandler h = new complexType(this, super._source, $runtime, 483);
++                            NGCCHandler h = new complexType(this, super._source, $runtime, 376);
+                             spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                         }
+                         else {
+                             if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group"))) {
+-                                NGCCHandler h = new group(this, super._source, $runtime, 484);
++                                NGCCHandler h = new group(this, super._source, $runtime, 377);
+                                 spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                             }
+                             else {
+                                 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup"))) {
+-                                    NGCCHandler h = new attributeGroupDecl(this, super._source, $runtime, 485);
++                                    NGCCHandler h = new attributeGroupDecl(this, super._source, $runtime, 378);
+                                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                                 }
+                                 else {
+@@ -214,6 +187,33 @@
+                 }
+             }
+             break;
++        case 15:
++            {
++                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("redefine"))) {
++                    $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
++                    $_ngcc_current_state = 14;
++                }
++                else {
++                    unexpectedEnterElement($__qname);
++                }
++            }
++            break;
++        case 14:
++            {
++                if(($ai = $runtime.getAttributeIndex("","schemaLocation"))>=0) {
++                    $runtime.consumeAttribute($ai);
++                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
++                }
++                else {
++                    unexpectedEnterElement($__qname);
++                }
++            }
++            break;
++        case 0:
++            {
++                revertToParentFromEnterElement(this, super._cookie, $__uri, $__local, $__qname, $attrs);
++            }
++            break;
+         default:
+             {
+                 unexpectedEnterElement($__qname);
+@@ -239,9 +239,10 @@
+                 }
+             }
+             break;
+-        case 0:
++        case 2:
+             {
+-                revertToParentFromLeaveElement(this, super._cookie, $__uri, $__local, $__qname);
++                $_ngcc_current_state = 1;
++                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+         case 14:
+@@ -255,10 +256,9 @@
+                 }
+             }
+             break;
+-        case 2:
++        case 0:
+             {
+-                $_ngcc_current_state = 1;
+-                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
++                revertToParentFromLeaveElement(this, super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+         default:
+@@ -275,9 +275,10 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
+-        case 0:
++        case 2:
+             {
+-                revertToParentFromEnterAttribute(this, super._cookie, $__uri, $__local, $__qname);
++                $_ngcc_current_state = 1;
++                $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+         case 14:
+@@ -290,10 +291,9 @@
+                 }
+             }
+             break;
+-        case 2:
++        case 0:
+             {
+-                $_ngcc_current_state = 1;
+-                $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
++                revertToParentFromEnterAttribute(this, super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+         default:
+@@ -310,11 +310,6 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
+-        case 0:
+-            {
+-                revertToParentFromLeaveAttribute(this, super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+         case 2:
+             {
+                 $_ngcc_current_state = 1;
+@@ -331,6 +326,11 @@
+                 }
+             }
+             break;
++        case 0:
++            {
++                revertToParentFromLeaveAttribute(this, super._cookie, $__uri, $__local, $__qname);
++            }
++            break;
+         default:
+             {
+                 unexpectedLeaveAttribute($__qname);
+@@ -342,9 +342,10 @@
+     public void text(String $value) throws SAXException {
+         int $ai;
+         switch($_ngcc_current_state) {
+-        case 0:
++        case 2:
+             {
+-                revertToParentFromText(this, super._cookie, $value);
++                $_ngcc_current_state = 1;
++                $runtime.sendText(super._cookie, $value);
+             }
+             break;
+         case 14:
+@@ -355,12 +356,6 @@
+                 }
+             }
+             break;
+-        case 2:
+-            {
+-                $_ngcc_current_state = 1;
+-                $runtime.sendText(super._cookie, $value);
+-            }
+-            break;
+         case 13:
+             {
+                 schemaLocation = $value;
+@@ -368,17 +363,22 @@
+                 action4();
+             }
+             break;
++        case 0:
++            {
++                revertToParentFromText(this, super._cookie, $value);
++            }
++            break;
+         }
+     }
+ 
+     public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException {
+         switch($__cookie__) {
+-        case 476:
++        case 374:
+             {
+                 $_ngcc_current_state = 1;
+             }
+             break;
+-        case 477:
++        case 375:
+             {
+                 newSt = ((SimpleTypeImpl)$__result__);
+                 action3();
+@@ -385,7 +385,7 @@
+                 $_ngcc_current_state = 1;
+             }
+             break;
+-        case 478:
++        case 376:
+             {
+                 newCt = ((ComplexTypeImpl)$__result__);
+                 action2();
+@@ -392,7 +392,7 @@
+                 $_ngcc_current_state = 1;
+             }
+             break;
+-        case 479:
++        case 377:
+             {
+                 newGrp = ((ModelGroupDeclImpl)$__result__);
+                 action1();
+@@ -399,7 +399,7 @@
+                 $_ngcc_current_state = 1;
+             }
+             break;
+-        case 480:
++        case 378:
+             {
+                 newAg = ((AttGroupDeclImpl)$__result__);
+                 action0();
+@@ -406,12 +406,12 @@
+                 $_ngcc_current_state = 1;
+             }
+             break;
+-        case 481:
++        case 369:
+             {
+                 $_ngcc_current_state = 1;
+             }
+             break;
+-        case 482:
++        case 370:
+             {
+                 newSt = ((SimpleTypeImpl)$__result__);
+                 action3();
+@@ -418,7 +418,7 @@
+                 $_ngcc_current_state = 1;
+             }
+             break;
+-        case 483:
++        case 371:
+             {
+                 newCt = ((ComplexTypeImpl)$__result__);
+                 action2();
+@@ -425,7 +425,7 @@
+                 $_ngcc_current_state = 1;
+             }
+             break;
+-        case 484:
++        case 372:
+             {
+                 newGrp = ((ModelGroupDeclImpl)$__result__);
+                 action1();
+@@ -432,7 +432,7 @@
+                 $_ngcc_current_state = 1;
+             }
+             break;
+-        case 485:
++        case 373:
+             {
+                 newAg = ((AttGroupDeclImpl)$__result__);
+                 action0();
+@@ -448,4 +448,3 @@
+ 
+ 
+ }
+-
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/simpleType.java	Thu Jul 30 18:44:42 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/simpleType.java	Thu Jul 30 18:44:41 2009
+@@ -37,9 +37,9 @@
+     import org.xml.sax.ContentHandler;
+     import org.xml.sax.helpers.*;
+     import java.util.*;
+-  
+ 
+ 
++
+ class simpleType extends NGCCHandler {
+     private AnnotationImpl annotation;
+     private String name;
+@@ -79,14 +79,14 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
+-        case 11:
++        case 8:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
+-                    $runtime.consumeAttribute($ai);
+-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
++                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
++                    NGCCHandler h = new annotation(this, super._source, $runtime, 632, null,AnnotationContext.SIMPLETYPE_DECL);
++                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+-                    $_ngcc_current_state = 10;
++                    $_ngcc_current_state = 7;
+                     $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                 }
+             }
+@@ -103,43 +103,56 @@
+                 }
+             }
+             break;
+-        case 10:
++        case 11:
+             {
+-                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("restriction")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("list")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("union")))))) {
+-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 71, fa);
+-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
++                if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
++                    $runtime.consumeAttribute($ai);
++                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+-                    unexpectedEnterElement($__qname);
++                    $_ngcc_current_state = 10;
++                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                 }
+             }
+             break;
+-        case 8:
++        case 0:
+             {
+-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
+-                    NGCCHandler h = new annotation(this, super._source, $runtime, 69, null,AnnotationContext.SIMPLETYPE_DECL);
+-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
++                revertToParentFromEnterElement(result, super._cookie, $__uri, $__local, $__qname, $attrs);
++            }
++            break;
++        case 15:
++            {
++                if(($ai = $runtime.getAttributeIndex("","final"))>=0) {
++                    $runtime.consumeAttribute($ai);
++                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+-                    $_ngcc_current_state = 7;
++                    $_ngcc_current_state = 11;
+                     $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                 }
+             }
+             break;
++        case 7:
++            {
++                action0();
++                $_ngcc_current_state = 2;
++                $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
++            }
++            break;
+         case 2:
+             {
+                 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("restriction"))) {
+-                    NGCCHandler h = new SimpleType_Restriction(this, super._source, $runtime, 65, annotation,locator,fa,name,finalSet);
++                    NGCCHandler h = new SimpleType_Restriction(this, super._source, $runtime, 628, annotation,locator,fa,name,finalSet);
+                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+                     if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("list"))) {
+-                        NGCCHandler h = new SimpleType_List(this, super._source, $runtime, 66, annotation,locator,fa,name,finalSet);
++                        NGCCHandler h = new SimpleType_List(this, super._source, $runtime, 629, annotation,locator,fa,name,finalSet);
+                         spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                     }
+                     else {
+                         if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("union"))) {
+-                            NGCCHandler h = new SimpleType_Union(this, super._source, $runtime, 60, annotation,locator,fa,name,finalSet);
++                            NGCCHandler h = new SimpleType_Union(this, super._source, $runtime, 623, annotation,locator,fa,name,finalSet);
+                             spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                         }
+                         else {
+@@ -149,30 +162,17 @@
+                 }
+             }
+             break;
+-        case 0:
++        case 10:
+             {
+-                revertToParentFromEnterElement(result, super._cookie, $__uri, $__local, $__qname, $attrs);
+-            }
+-            break;
+-        case 15:
+-            {
+-                if(($ai = $runtime.getAttributeIndex("","final"))>=0) {
+-                    $runtime.consumeAttribute($ai);
+-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
++                if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("restriction")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("union")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("list")))))) {
++                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 634, fa);
++                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+-                    $_ngcc_current_state = 11;
+-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
++                    unexpectedEnterElement($__qname);
+                 }
+             }
+             break;
+-        case 7:
+-            {
+-                action0();
+-                $_ngcc_current_state = 2;
+-                $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+-            }
+-            break;
+         default:
+             {
+                 unexpectedEnterElement($__qname);
+@@ -187,6 +187,12 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
++        case 8:
++            {
++                $_ngcc_current_state = 7;
++                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
++            }
++            break;
+         case 11:
+             {
+                 if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
+@@ -199,28 +205,11 @@
+                 }
+             }
+             break;
+-        case 8:
+-            {
+-                $_ngcc_current_state = 7;
+-                $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+         case 0:
+             {
+                 revertToParentFromLeaveElement(result, super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 1:
+-            {
+-                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))) {
+-                    $runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
+-                    $_ngcc_current_state = 0;
+-                }
+-                else {
+-                    unexpectedLeaveElement($__qname);
+-                }
+-            }
+-            break;
+         case 15:
+             {
+                 if(($ai = $runtime.getAttributeIndex("","final"))>=0) {
+@@ -233,6 +222,17 @@
+                 }
+             }
+             break;
++        case 1:
++            {
++                if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))) {
++                    $runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
++                    $_ngcc_current_state = 0;
++                }
++                else {
++                    unexpectedLeaveElement($__qname);
++                }
++            }
++            break;
+         case 7:
+             {
+                 action0();
+@@ -254,6 +254,12 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
++        case 8:
++            {
++                $_ngcc_current_state = 7;
++                $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
++            }
++            break;
+         case 11:
+             {
+                 if(($__uri.equals("") && $__local.equals("name"))) {
+@@ -265,12 +271,6 @@
+                 }
+             }
+             break;
+-        case 8:
+-            {
+-                $_ngcc_current_state = 7;
+-                $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+         case 0:
+             {
+                 revertToParentFromEnterAttribute(result, super._cookie, $__uri, $__local, $__qname);
+@@ -308,19 +308,9 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
+-        case 16:
++        case 8:
+             {
+-                if(($__uri.equals("") && $__local.equals("final"))) {
+-                    $_ngcc_current_state = 11;
+-                }
+-                else {
+-                    unexpectedLeaveAttribute($__qname);
+-                }
+-            }
+-            break;
+-        case 11:
+-            {
+-                $_ngcc_current_state = 10;
++                $_ngcc_current_state = 7;
+                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+@@ -334,9 +324,9 @@
+                 }
+             }
+             break;
+-        case 8:
++        case 11:
+             {
+-                $_ngcc_current_state = 7;
++                $_ngcc_current_state = 10;
+                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+@@ -351,6 +341,16 @@
+                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
++        case 16:
++            {
++                if(($__uri.equals("") && $__local.equals("final"))) {
++                    $_ngcc_current_state = 11;
++                }
++                else {
++                    unexpectedLeaveAttribute($__qname);
++                }
++            }
++            break;
+         case 7:
+             {
+                 action0();
+@@ -369,6 +369,12 @@
+     public void text(String $value) throws SAXException {
+         int $ai;
+         switch($_ngcc_current_state) {
++        case 8:
++            {
++                $_ngcc_current_state = 7;
++                $runtime.sendText(super._cookie, $value);
++            }
++            break;
+         case 11:
+             {
+                 if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
+@@ -381,18 +387,6 @@
+                 }
+             }
+             break;
+-        case 17:
+-            {
+-                finalValue = $value;
+-                $_ngcc_current_state = 16;
+-            }
+-            break;
+-        case 8:
+-            {
+-                $_ngcc_current_state = 7;
+-                $runtime.sendText(super._cookie, $value);
+-            }
+-            break;
+         case 0:
+             {
+                 revertToParentFromText(result, super._cookie, $value);
+@@ -423,36 +417,42 @@
+                 $runtime.sendText(super._cookie, $value);
+             }
+             break;
++        case 17:
++            {
++                finalValue = $value;
++                $_ngcc_current_state = 16;
++            }
++            break;
+         }
+     }
+ 
+     public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException {
+         switch($__cookie__) {
+-        case 71:
++        case 634:
+             {
+                 fa = ((ForeignAttributesImpl)$__result__);
+                 $_ngcc_current_state = 8;
+             }
+             break;
+-        case 69:
++        case 632:
+             {
+                 annotation = ((AnnotationImpl)$__result__);
+                 $_ngcc_current_state = 7;
+             }
+             break;
+-        case 65:
++        case 628:
+             {
+                 result = ((RestrictionSimpleTypeImpl)$__result__);
+                 $_ngcc_current_state = 1;
+             }
+             break;
+-        case 66:
++        case 629:
+             {
+                 result = ((ListSimpleTypeImpl)$__result__);
+                 $_ngcc_current_state = 1;
+             }
+             break;
+-        case 60:
++        case 623:
+             {
+                 result = ((UnionSimpleTypeImpl)$__result__);
+                 $_ngcc_current_state = 1;
+@@ -465,12 +465,12 @@
+         return(($_ngcc_current_state == 0));
+     }
+ 
+-    
+-  		/** computed simple type object */
+-  		private SimpleTypeImpl result;
+-  		
+-  		private Locator locator;
+ 
++                /** computed simple type object */
++                private SimpleTypeImpl result;
++
++                private Locator locator;
++
+       private Set finalSet;
+ 
+       private Set makeFinalSet(String finalValue) {
+@@ -498,6 +498,5 @@
+         }
+         return s;
+       }
+-    
+-}
+ 
++}
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/wildcardBody.java	Thu Jul 30 18:44:46 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/wildcardBody.java	Thu Jul 30 18:44:45 2009
+@@ -37,7 +37,7 @@
+     import org.xml.sax.ContentHandler;
+     import org.xml.sax.helpers.*;
+     import java.util.*;
+-  
++
+ import java.util.StringTokenizer;
+       import java.util.HashSet;
+ 
+@@ -78,7 +78,7 @@
+         case 10:
+             {
+                 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
+-                    NGCCHandler h = new annotation(this, super._source, $runtime, 204, null,AnnotationContext.WILDCARD);
++                    NGCCHandler h = new annotation(this, super._source, $runtime, 556, null,AnnotationContext.WILDCARD);
+                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+@@ -92,14 +92,26 @@
+                 revertToParentFromEnterElement(makeResult(), super._cookie, $__uri, $__local, $__qname, $attrs);
+             }
+             break;
++        case 1:
++            {
++                if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) {
++                    $runtime.consumeAttribute($ai);
++                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
++                }
++                else {
++                    $_ngcc_current_state = 0;
++                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
++                }
++            }
++            break;
+         case 9:
+             {
+-                if((($ai = $runtime.getAttributeIndex("","namespace"))>=0 || ($ai = $runtime.getAttributeIndex("","processContents"))>=0)) {
+-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 202, null);
++                if((($ai = $runtime.getAttributeIndex("","processContents"))>=0 || ($ai = $runtime.getAttributeIndex("","namespace"))>=0)) {
++                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 554, null);
+                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 202, null);
++                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 554, null);
+                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                 }
+             }
+@@ -116,18 +128,6 @@
+                 }
+             }
+             break;
+-        case 1:
+-            {
+-                if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) {
+-                    $runtime.consumeAttribute($ai);
+-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+-                }
+-                else {
+-                    $_ngcc_current_state = 0;
+-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+-                }
+-            }
+-            break;
+         default:
+             {
+                 unexpectedEnterElement($__qname);
+@@ -153,14 +153,26 @@
+                 revertToParentFromLeaveElement(makeResult(), super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
++        case 1:
++            {
++                if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) {
++                    $runtime.consumeAttribute($ai);
++                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
++                }
++                else {
++                    $_ngcc_current_state = 0;
++                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
++                }
++            }
++            break;
+         case 9:
+             {
+-                if((($ai = $runtime.getAttributeIndex("","namespace"))>=0 || ($ai = $runtime.getAttributeIndex("","processContents"))>=0)) {
+-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 202, null);
++                if((($ai = $runtime.getAttributeIndex("","processContents"))>=0 || ($ai = $runtime.getAttributeIndex("","namespace"))>=0)) {
++                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 554, null);
+                     spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
+                 }
+                 else {
+-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 202, null);
++                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 554, null);
+                     spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
+                 }
+             }
+@@ -177,18 +189,6 @@
+                 }
+             }
+             break;
+-        case 1:
+-            {
+-                if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) {
+-                    $runtime.consumeAttribute($ai);
+-                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+-                }
+-                else {
+-                    $_ngcc_current_state = 0;
+-                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+-                }
+-            }
+-            break;
+         default:
+             {
+                 unexpectedLeaveElement($__qname);
+@@ -214,14 +214,25 @@
+                 revertToParentFromEnterAttribute(makeResult(), super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
++        case 1:
++            {
++                if(($__uri.equals("") && $__local.equals("namespace"))) {
++                    $_ngcc_current_state = 3;
++                }
++                else {
++                    $_ngcc_current_state = 0;
++                    $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
++                }
++            }
++            break;
+         case 9:
+             {
+-                if((($__uri.equals("") && $__local.equals("namespace")) || ($__uri.equals("") && $__local.equals("processContents")))) {
+-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 202, null);
++                if((($__uri.equals("") && $__local.equals("processContents")) || ($__uri.equals("") && $__local.equals("namespace")))) {
++                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 554, null);
+                     spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
+                 }
+                 else {
+-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 202, null);
++                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 554, null);
+                     spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
+                 }
+             }
+@@ -237,17 +248,6 @@
+                 }
+             }
+             break;
+-        case 1:
+-            {
+-                if(($__uri.equals("") && $__local.equals("namespace"))) {
+-                    $_ngcc_current_state = 3;
+-                }
+-                else {
+-                    $_ngcc_current_state = 0;
+-                    $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+-                }
+-            }
+-            break;
+         default:
+             {
+                 unexpectedEnterAttribute($__qname);
+@@ -262,16 +262,6 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
+-        case 6:
+-            {
+-                if(($__uri.equals("") && $__local.equals("processContents"))) {
+-                    $_ngcc_current_state = 1;
+-                }
+-                else {
+-                    unexpectedLeaveAttribute($__qname);
+-                }
+-            }
+-            break;
+         case 10:
+             {
+                 $_ngcc_current_state = 9;
+@@ -283,18 +273,28 @@
+                 revertToParentFromLeaveAttribute(makeResult(), super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 9:
++        case 1:
+             {
+-                NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 202, null);
+-                spawnChildFromLeaveAttribute(h, $__uri, $__local, $__qname);
++                $_ngcc_current_state = 0;
++                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 5:
++        case 6:
+             {
+-                $_ngcc_current_state = 1;
+-                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
++                if(($__uri.equals("") && $__local.equals("processContents"))) {
++                    $_ngcc_current_state = 1;
++                }
++                else {
++                    unexpectedLeaveAttribute($__qname);
++                }
+             }
+             break;
++        case 9:
++            {
++                NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 554, null);
++                spawnChildFromLeaveAttribute(h, $__uri, $__local, $__qname);
++            }
++            break;
+         case 2:
+             {
+                 if(($__uri.equals("") && $__local.equals("namespace"))) {
+@@ -305,9 +305,9 @@
+                 }
+             }
+             break;
+-        case 1:
++        case 5:
+             {
+-                $_ngcc_current_state = 0;
++                $_ngcc_current_state = 1;
+                 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+@@ -322,12 +322,6 @@
+     public void text(String $value) throws SAXException {
+         int $ai;
+         switch($_ngcc_current_state) {
+-        case 7:
+-            {
+-                modeValue = $value;
+-                $_ngcc_current_state = 6;
+-            }
+-            break;
+         case 10:
+             {
+                 $_ngcc_current_state = 9;
+@@ -339,24 +333,48 @@
+                 revertToParentFromText(makeResult(), super._cookie, $value);
+             }
+             break;
++        case 1:
++            {
++                if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) {
++                    $runtime.consumeAttribute($ai);
++                    $runtime.sendText(super._cookie, $value);
++                }
++                else {
++                    $_ngcc_current_state = 0;
++                    $runtime.sendText(super._cookie, $value);
++                }
++            }
++            break;
++        case 3:
++            {
++                ns = $value;
++                $_ngcc_current_state = 2;
++            }
++            break;
+         case 9:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","processContents"))>=0) {
+-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 202, null);
++                if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) {
++                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 554, null);
+                     spawnChildFromText(h, $value);
+                 }
+                 else {
+-                    if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) {
+-                        NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 202, null);
++                    if(($ai = $runtime.getAttributeIndex("","processContents"))>=0) {
++                        NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 554, null);
+                         spawnChildFromText(h, $value);
+                     }
+                     else {
+-                        NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 202, null);
++                        NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 554, null);
+                         spawnChildFromText(h, $value);
+                     }
+                 }
+             }
+             break;
++        case 7:
++            {
++                modeValue = $value;
++                $_ngcc_current_state = 6;
++            }
++            break;
+         case 5:
+             {
+                 if(($ai = $runtime.getAttributeIndex("","processContents"))>=0) {
+@@ -369,36 +387,18 @@
+                 }
+             }
+             break;
+-        case 1:
+-            {
+-                if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) {
+-                    $runtime.consumeAttribute($ai);
+-                    $runtime.sendText(super._cookie, $value);
+-                }
+-                else {
+-                    $_ngcc_current_state = 0;
+-                    $runtime.sendText(super._cookie, $value);
+-                }
+-            }
+-            break;
+-        case 3:
+-            {
+-                ns = $value;
+-                $_ngcc_current_state = 2;
+-            }
+-            break;
+         }
+     }
+ 
+     public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException {
+         switch($__cookie__) {
+-        case 204:
++        case 556:
+             {
+                 annotation = ((AnnotationImpl)$__result__);
+                 $_ngcc_current_state = 9;
+             }
+             break;
+-        case 202:
++        case 554:
+             {
+                 fa = ((ForeignAttributesImpl)$__result__);
+                 $_ngcc_current_state = 5;
+@@ -408,27 +408,27 @@
+     }
+ 
+     public boolean accepted() {
+-        return((($_ngcc_current_state == 1) || (($_ngcc_current_state == 5) || ($_ngcc_current_state == 0))));
++        return((($_ngcc_current_state == 5) || (($_ngcc_current_state == 1) || ($_ngcc_current_state == 0))));
+     }
+ 
+-    
++
+       private WildcardImpl makeResult() {
+         if(modeValue==null) modeValue="strict";
+-        
++
+         int mode=-1;
+         if(modeValue.equals("strict"))      mode = XSWildcard.STRTICT;
+         if(modeValue.equals("lax"))         mode = XSWildcard.LAX;
+         if(modeValue.equals("skip"))        mode = XSWildcard.SKIP;
+         if(mode==-1)        throw new InternalError();
+-        
++
+         if(ns==null || ns.equals("##any"))
+             return new WildcardImpl.Any( $runtime.document, annotation,locator,fa,mode);
+-        
++
+         if(ns.equals("##other"))
+             return new WildcardImpl.Other( $runtime.document,
+                 annotation,locator,fa,
+                 $runtime.currentSchema.getTargetNamespace(),mode);
+-        
++
+         StringTokenizer tokens = new StringTokenizer(ns);
+         HashSet s = new HashSet();
+         while(tokens.hasMoreTokens()) {
+@@ -437,9 +437,8 @@
+             if(ns.equals("##targetNamespace")) ns=$runtime.currentSchema.getTargetNamespace();
+             s.add(ns);
+         }
+-        
++
+         return new WildcardImpl.Finite( $runtime.document, annotation,locator,fa,s,mode);
+       }
+-    
+-}
+ 
++}
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/xpath.java	Thu Jul 30 18:44:49 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/parser/state/xpath.java	Thu Jul 30 18:44:49 2009
+@@ -37,9 +37,9 @@
+     import org.xml.sax.ContentHandler;
+     import org.xml.sax.helpers.*;
+     import java.util.*;
+-  
+ 
+ 
++
+ class xpath extends NGCCHandler {
+     private String xpath;
+     private ForeignAttributesImpl fa;
+@@ -70,16 +70,11 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
+-        case 0:
++        case 5:
+             {
+-                revertToParentFromEnterElement(makeResult(), super._cookie, $__uri, $__local, $__qname, $attrs);
+-            }
+-            break;
+-        case 6:
+-            {
+-                if((($ai = $runtime.getAttributeIndex("","xpath"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) {
+-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 657, null);
+-                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
++                if(($ai = $runtime.getAttributeIndex("","xpath"))>=0) {
++                    $runtime.consumeAttribute($ai);
++                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+                     unexpectedEnterElement($__qname);
+@@ -89,7 +84,7 @@
+         case 1:
+             {
+                 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
+-                    NGCCHandler h = new annotation(this, super._source, $runtime, 652, null,AnnotationContext.XPATH);
++                    NGCCHandler h = new annotation(this, super._source, $runtime, 158, null,AnnotationContext.XPATH);
+                     spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+@@ -98,11 +93,16 @@
+                 }
+             }
+             break;
+-        case 5:
++        case 0:
+             {
+-                if(($ai = $runtime.getAttributeIndex("","xpath"))>=0) {
+-                    $runtime.consumeAttribute($ai);
+-                    $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
++                revertToParentFromEnterElement(makeResult(), super._cookie, $__uri, $__local, $__qname, $attrs);
++            }
++            break;
++        case 6:
++            {
++                if((($ai = $runtime.getAttributeIndex("","xpath"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) {
++                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 163, null);
++                    spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
+                 }
+                 else {
+                     unexpectedEnterElement($__qname);
+@@ -123,16 +123,11 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
+-        case 0:
++        case 5:
+             {
+-                revertToParentFromLeaveElement(makeResult(), super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+-        case 6:
+-            {
+                 if(($ai = $runtime.getAttributeIndex("","xpath"))>=0) {
+-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 657, null);
+-                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
++                    $runtime.consumeAttribute($ai);
++                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+                 }
+                 else {
+                     unexpectedLeaveElement($__qname);
+@@ -145,11 +140,16 @@
+                 $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 5:
++        case 0:
+             {
++                revertToParentFromLeaveElement(makeResult(), super._cookie, $__uri, $__local, $__qname);
++            }
++            break;
++        case 6:
++            {
+                 if(($ai = $runtime.getAttributeIndex("","xpath"))>=0) {
+-                    $runtime.consumeAttribute($ai);
+-                    $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
++                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 163, null);
++                    spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
+                 }
+                 else {
+                     unexpectedLeaveElement($__qname);
+@@ -170,16 +170,10 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
+-        case 0:
++        case 5:
+             {
+-                revertToParentFromEnterAttribute(makeResult(), super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+-        case 6:
+-            {
+                 if(($__uri.equals("") && $__local.equals("xpath"))) {
+-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 657, null);
+-                    spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
++                    $_ngcc_current_state = 4;
+                 }
+                 else {
+                     unexpectedEnterAttribute($__qname);
+@@ -192,10 +186,16 @@
+                 $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
+             }
+             break;
+-        case 5:
++        case 0:
+             {
++                revertToParentFromEnterAttribute(makeResult(), super._cookie, $__uri, $__local, $__qname);
++            }
++            break;
++        case 6:
++            {
+                 if(($__uri.equals("") && $__local.equals("xpath"))) {
+-                    $_ngcc_current_state = 4;
++                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 163, null);
++                    spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
+                 }
+                 else {
+                     unexpectedEnterAttribute($__qname);
+@@ -216,6 +216,12 @@
+         $localName = $__local;
+         $qname = $__qname;
+         switch($_ngcc_current_state) {
++        case 1:
++            {
++                $_ngcc_current_state = 0;
++                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
++            }
++            break;
+         case 0:
+             {
+                 revertToParentFromLeaveAttribute(makeResult(), super._cookie, $__uri, $__local, $__qname);
+@@ -231,12 +237,6 @@
+                 }
+             }
+             break;
+-        case 1:
+-            {
+-                $_ngcc_current_state = 0;
+-                $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
+-            }
+-            break;
+         default:
+             {
+                 unexpectedLeaveAttribute($__qname);
+@@ -248,6 +248,20 @@
+     public void text(String $value) throws SAXException {
+         int $ai;
+         switch($_ngcc_current_state) {
++        case 5:
++            {
++                if(($ai = $runtime.getAttributeIndex("","xpath"))>=0) {
++                    $runtime.consumeAttribute($ai);
++                    $runtime.sendText(super._cookie, $value);
++                }
++            }
++            break;
++        case 1:
++            {
++                $_ngcc_current_state = 0;
++                $runtime.sendText(super._cookie, $value);
++            }
++            break;
+         case 4:
+             {
+                 xpath = $value;
+@@ -262,40 +276,26 @@
+         case 6:
+             {
+                 if(($ai = $runtime.getAttributeIndex("","xpath"))>=0) {
+-                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 657, null);
++                    NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 163, null);
+                     spawnChildFromText(h, $value);
+                 }
+             }
+             break;
+-        case 1:
+-            {
+-                $_ngcc_current_state = 0;
+-                $runtime.sendText(super._cookie, $value);
+-            }
+-            break;
+-        case 5:
+-            {
+-                if(($ai = $runtime.getAttributeIndex("","xpath"))>=0) {
+-                    $runtime.consumeAttribute($ai);
+-                    $runtime.sendText(super._cookie, $value);
+-                }
+-            }
+-            break;
+         }
+     }
+ 
+     public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException {
+         switch($__cookie__) {
+-        case 657:
++        case 158:
+             {
+-                fa = ((ForeignAttributesImpl)$__result__);
+-                $_ngcc_current_state = 5;
++                ann = ((AnnotationImpl)$__result__);
++                $_ngcc_current_state = 0;
+             }
+             break;
+-        case 652:
++        case 163:
+             {
+-                ann = ((AnnotationImpl)$__result__);
+-                $_ngcc_current_state = 0;
++                fa = ((ForeignAttributesImpl)$__result__);
++                $_ngcc_current_state = 5;
+             }
+             break;
+         }
+@@ -302,14 +302,13 @@
+     }
+ 
+     public boolean accepted() {
+-        return((($_ngcc_current_state == 1) || ($_ngcc_current_state == 0)));
++        return((($_ngcc_current_state == 0) || ($_ngcc_current_state == 1)));
+     }
+ 
+-    
++
+       private XPathImpl makeResult() {
+         return new XPathImpl($runtime.document,ann,$runtime.copyLocator(),fa,
+           $runtime.createXmlString(xpath));
+       }
+-    
+-}
+ 
++}
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/scd/AbstractAxisImpl.java	Thu Jul 30 18:44:53 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/scd/AbstractAxisImpl.java	Thu Jul 30 18:44:52 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.xsom.impl.scd;
+ 
+ import com.sun.xml.internal.xsom.XSAnnotation;
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/scd/Axis.java	Thu Jul 30 18:44:57 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/scd/Axis.java	Thu Jul 30 18:44:56 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.xsom.impl.scd;
+ 
+ import com.sun.xml.internal.xsom.XSAttContainer;
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/scd/Iterators.java	Thu Jul 30 18:45:00 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/scd/Iterators.java	Thu Jul 30 18:45:00 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.xsom.impl.scd;
+ 
+ import java.util.Iterator;
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/scd/ParseException.java	Thu Jul 30 18:45:04 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/scd/ParseException.java	Thu Jul 30 18:45:03 2009
+@@ -25,6 +25,8 @@
+ /* Generated By:JavaCC: Do not edit this line. ParseException.java Version 3.0 */
+ package com.sun.xml.internal.xsom.impl.scd;
+ 
++import java.util.List;
++
+ /**
+  * This exception is thrown when parse errors are encountered.
+  * You can explicitly create objects of this exception type by
+@@ -50,7 +52,7 @@
+    */
+   public ParseException(Token currentTokenVal,
+                         int[][] expectedTokenSequencesVal,
+-                        String[] tokenImageVal
++                        List<String> tokenImageVal
+                        )
+   {
+     super("");
+@@ -106,7 +108,7 @@
+    * parser within which the parse error occurred.  This array is
+    * defined in the generated ...Constants interface.
+    */
+-  public String[] tokenImage;
++  public List<String> tokenImage;
+ 
+   /**
+    * This method has the standard behavior when this object has been
+@@ -129,7 +131,7 @@
+         maxSize = expectedTokenSequences[i].length;
+       }
+       for (int j = 0; j < expectedTokenSequences[i].length; j++) {
+-        expected.append(tokenImage[expectedTokenSequences[i][j]]).append(" ");
++        expected.append(tokenImage.get(expectedTokenSequences[i][j])).append(" ");
+       }
+       if (expectedTokenSequences[i][expectedTokenSequences[i].length - 1] != 0) {
+         expected.append("...");
+@@ -141,11 +143,11 @@
+     for (int i = 0; i < maxSize; i++) {
+       if (i != 0) retval += " ";
+       if (tok.kind == 0) {
+-        retval += tokenImage[0];
++        retval += tokenImage.get(0);
+         break;
+       }
+       retval += add_escapes(tok.image);
+-      tok = tok.next; 
++      tok = tok.next;
+     }
+     retval += "\" at line " + currentToken.next.beginLine + ", column " + currentToken.next.beginColumn;
+     retval += "." + eol;
+@@ -162,7 +164,7 @@
+    * The end of line string for this machine.
+    */
+   protected String eol = System.getProperty("line.separator", "\n");
+- 
++
+   /**
+    * Used to convert raw characters to their escaped version
+    * when these raw version cannot be used as part of an ASCII
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/scd/SCDImpl.java	Thu Jul 30 18:45:07 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/scd/SCDImpl.java	Thu Jul 30 18:45:07 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.xsom.impl.scd;
+ 
+ import com.sun.xml.internal.xsom.SCD;
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/scd/SCDParserConstants.java	Thu Jul 30 18:45:11 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/scd/SCDParserConstants.java	Thu Jul 30 18:45:10 2009
+@@ -25,6 +25,10 @@
+ /* Generated By:JavaCC: Do not edit this line. SCDParserConstants.java */
+ package com.sun.xml.internal.xsom.impl.scd;
+ 
++import java.util.Arrays;
++import java.util.Collections;
++import java.util.List;
++
+ public interface SCDParserConstants {
+ 
+   int EOF = 0;
+@@ -40,54 +44,55 @@
+ 
+   int DEFAULT = 0;
+ 
+-  String[] tokenImage = {
+-    "<EOF>",
+-    "\" \"",
+-    "\"\\t\"",
+-    "\"\\n\"",
+-    "\"\\r\"",
+-    "\"\\f\"",
+-    "<Letter>",
+-    "<BaseChar>",
+-    "<Ideographic>",
+-    "<CombiningChar>",
+-    "<UnicodeDigit>",
+-    "<Extender>",
+-    "<NCNAME>",
+-    "<NUMBER>",
+-    "<FACETNAME>",
+-    "\":\"",
+-    "\"/\"",
+-    "\"//\"",
+-    "\"attribute::\"",
+-    "\"@\"",
+-    "\"element::\"",
+-    "\"substitutionGroup::\"",
+-    "\"type::\"",
+-    "\"~\"",
+-    "\"baseType::\"",
+-    "\"primitiveType::\"",
+-    "\"itemType::\"",
+-    "\"memberType::\"",
+-    "\"scope::\"",
+-    "\"attributeGroup::\"",
+-    "\"group::\"",
+-    "\"identityContraint::\"",
+-    "\"key::\"",
+-    "\"notation::\"",
+-    "\"model::sequence\"",
+-    "\"model::choice\"",
+-    "\"model::all\"",
+-    "\"model::*\"",
+-    "\"any::*\"",
+-    "\"anyAttribute::*\"",
+-    "\"facet::*\"",
+-    "\"facet::\"",
+-    "\"component::*\"",
+-    "\"x-schema::\"",
+-    "\"x-schema::*\"",
+-    "\"*\"",
+-    "\"0\"",
+-  };
++  static final List<String> tokenImage = Collections.unmodifiableList(Arrays.asList(
+ 
+-}
++       new String[] {
++         "<EOF>",
++         "\" \"",
++         "\"\\t\"",
++         "\"\\n\"",
++         "\"\\r\"",
++         "\"\\f\"",
++         "<Letter>",
++         "<BaseChar>",
++         "<Ideographic>",
++         "<CombiningChar>",
++         "<UnicodeDigit>",
++         "<Extender>",
++         "<NCNAME>",
++         "<NUMBER>",
++         "<FACETNAME>",
++         "\":\"",
++         "\"/\"",
++         "\"//\"",
++         "\"attribute::\"",
++         "\"@\"",
++         "\"element::\"",
++         "\"substitutionGroup::\"",
++         "\"type::\"",
++         "\"~\"",
++         "\"baseType::\"",
++         "\"primitiveType::\"",
++         "\"itemType::\"",
++         "\"memberType::\"",
++         "\"scope::\"",
++         "\"attributeGroup::\"",
++         "\"group::\"",
++         "\"identityContraint::\"",
++         "\"key::\"",
++         "\"notation::\"",
++         "\"model::sequence\"",
++         "\"model::choice\"",
++         "\"model::all\"",
++         "\"model::*\"",
++         "\"any::*\"",
++         "\"anyAttribute::*\"",
++         "\"facet::*\"",
++         "\"facet::\"",
++         "\"component::*\"",
++         "\"x-schema::\"",
++         "\"x-schema::*\"",
++         "\"*\"",
++         "\"0\"",
++       }));
++  }
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/scd/SCDParserTokenManager.java	Thu Jul 30 18:45:14 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/scd/SCDParserTokenManager.java	Thu Jul 30 18:45:14 2009
+@@ -633,7 +633,7 @@
+ private final int jjMoveStringLiteralDfa2_0(long old0, long active0)
+ {
+    if (((active0 &= old0)) == 0L)
+-      return jjStartNfa_0(0, old0); 
++      return jjStartNfa_0(0, old0);
+    try { curChar = input_stream.readChar(); }
+    catch(java.io.IOException e) {
+       jjStopStringLiteralDfa_0(1, active0);
+@@ -671,7 +671,7 @@
+ private final int jjMoveStringLiteralDfa3_0(long old0, long active0)
+ {
+    if (((active0 &= old0)) == 0L)
+-      return jjStartNfa_0(1, old0); 
++      return jjStartNfa_0(1, old0);
+    try { curChar = input_stream.readChar(); }
+    catch(java.io.IOException e) {
+       jjStopStringLiteralDfa_0(2, active0);
+@@ -711,7 +711,7 @@
+ private final int jjMoveStringLiteralDfa4_0(long old0, long active0)
+ {
+    if (((active0 &= old0)) == 0L)
+-      return jjStartNfa_0(2, old0); 
++      return jjStartNfa_0(2, old0);
+    try { curChar = input_stream.readChar(); }
+    catch(java.io.IOException e) {
+       jjStopStringLiteralDfa_0(3, active0);
+@@ -747,7 +747,7 @@
+ private final int jjMoveStringLiteralDfa5_0(long old0, long active0)
+ {
+    if (((active0 &= old0)) == 0L)
+-      return jjStartNfa_0(3, old0); 
++      return jjStartNfa_0(3, old0);
+    try { curChar = input_stream.readChar(); }
+    catch(java.io.IOException e) {
+       jjStopStringLiteralDfa_0(4, active0);
+@@ -785,7 +785,7 @@
+ private final int jjMoveStringLiteralDfa6_0(long old0, long active0)
+ {
+    if (((active0 &= old0)) == 0L)
+-      return jjStartNfa_0(4, old0); 
++      return jjStartNfa_0(4, old0);
+    try { curChar = input_stream.readChar(); }
+    catch(java.io.IOException e) {
+       jjStopStringLiteralDfa_0(5, active0);
+@@ -830,7 +830,7 @@
+ private final int jjMoveStringLiteralDfa7_0(long old0, long active0)
+ {
+    if (((active0 &= old0)) == 0L)
+-      return jjStartNfa_0(5, old0); 
++      return jjStartNfa_0(5, old0);
+    try { curChar = input_stream.readChar(); }
+    catch(java.io.IOException e) {
+       jjStopStringLiteralDfa_0(6, active0);
+@@ -874,7 +874,7 @@
+ private final int jjMoveStringLiteralDfa8_0(long old0, long active0)
+ {
+    if (((active0 &= old0)) == 0L)
+-      return jjStartNfa_0(6, old0); 
++      return jjStartNfa_0(6, old0);
+    try { curChar = input_stream.readChar(); }
+    catch(java.io.IOException e) {
+       jjStopStringLiteralDfa_0(7, active0);
+@@ -908,7 +908,7 @@
+ private final int jjMoveStringLiteralDfa9_0(long old0, long active0)
+ {
+    if (((active0 &= old0)) == 0L)
+-      return jjStartNfa_0(7, old0); 
++      return jjStartNfa_0(7, old0);
+    try { curChar = input_stream.readChar(); }
+    catch(java.io.IOException e) {
+       jjStopStringLiteralDfa_0(8, active0);
+@@ -955,7 +955,7 @@
+ private final int jjMoveStringLiteralDfa10_0(long old0, long active0)
+ {
+    if (((active0 &= old0)) == 0L)
+-      return jjStartNfa_0(8, old0); 
++      return jjStartNfa_0(8, old0);
+    try { curChar = input_stream.readChar(); }
+    catch(java.io.IOException e) {
+       jjStopStringLiteralDfa_0(9, active0);
+@@ -993,7 +993,7 @@
+ private final int jjMoveStringLiteralDfa11_0(long old0, long active0)
+ {
+    if (((active0 &= old0)) == 0L)
+-      return jjStartNfa_0(9, old0); 
++      return jjStartNfa_0(9, old0);
+    try { curChar = input_stream.readChar(); }
+    catch(java.io.IOException e) {
+       jjStopStringLiteralDfa_0(10, active0);
+@@ -1029,7 +1029,7 @@
+ private final int jjMoveStringLiteralDfa12_0(long old0, long active0)
+ {
+    if (((active0 &= old0)) == 0L)
+-      return jjStartNfa_0(10, old0); 
++      return jjStartNfa_0(10, old0);
+    try { curChar = input_stream.readChar(); }
+    catch(java.io.IOException e) {
+       jjStopStringLiteralDfa_0(11, active0);
+@@ -1059,7 +1059,7 @@
+ private final int jjMoveStringLiteralDfa13_0(long old0, long active0)
+ {
+    if (((active0 &= old0)) == 0L)
+-      return jjStartNfa_0(11, old0); 
++      return jjStartNfa_0(11, old0);
+    try { curChar = input_stream.readChar(); }
+    catch(java.io.IOException e) {
+       jjStopStringLiteralDfa_0(12, active0);
+@@ -1085,7 +1085,7 @@
+ private final int jjMoveStringLiteralDfa14_0(long old0, long active0)
+ {
+    if (((active0 &= old0)) == 0L)
+-      return jjStartNfa_0(12, old0); 
++      return jjStartNfa_0(12, old0);
+    try { curChar = input_stream.readChar(); }
+    catch(java.io.IOException e) {
+       jjStopStringLiteralDfa_0(13, active0);
+@@ -1117,7 +1117,7 @@
+ private final int jjMoveStringLiteralDfa15_0(long old0, long active0)
+ {
+    if (((active0 &= old0)) == 0L)
+-      return jjStartNfa_0(13, old0); 
++      return jjStartNfa_0(13, old0);
+    try { curChar = input_stream.readChar(); }
+    catch(java.io.IOException e) {
+       jjStopStringLiteralDfa_0(14, active0);
+@@ -1141,7 +1141,7 @@
+ private final int jjMoveStringLiteralDfa16_0(long old0, long active0)
+ {
+    if (((active0 &= old0)) == 0L)
+-      return jjStartNfa_0(14, old0); 
++      return jjStartNfa_0(14, old0);
+    try { curChar = input_stream.readChar(); }
+    catch(java.io.IOException e) {
+       jjStopStringLiteralDfa_0(15, active0);
+@@ -1161,7 +1161,7 @@
+ private final int jjMoveStringLiteralDfa17_0(long old0, long active0)
+ {
+    if (((active0 &= old0)) == 0L)
+-      return jjStartNfa_0(15, old0); 
++      return jjStartNfa_0(15, old0);
+    try { curChar = input_stream.readChar(); }
+    catch(java.io.IOException e) {
+       jjStopStringLiteralDfa_0(16, active0);
+@@ -1179,7 +1179,7 @@
+ private final int jjMoveStringLiteralDfa18_0(long old0, long active0)
+ {
+    if (((active0 &= old0)) == 0L)
+-      return jjStartNfa_0(16, old0); 
++      return jjStartNfa_0(16, old0);
+    try { curChar = input_stream.readChar(); }
+    catch(java.io.IOException e) {
+       jjStopStringLiteralDfa_0(17, active0);
+@@ -2189,7 +2189,7 @@
+    }
+ }
+ static final int[] jjnextStates = {
+-   3, 4, 103, 113, 123, 133, 140, 147, 
++   3, 4, 103, 113, 123, 133, 140, 147,
+ };
+ private static final boolean jjCanMove_0(int hiByte, int i1, int i2, long l1, long l2)
+ {
+@@ -2241,7 +2241,7 @@
+          return ((jjbitVec23[i2] & l2) != 0L);
+       case 215:
+          return ((jjbitVec24[i2] & l2) != 0L);
+-      default : 
++      default :
+          if ((jjbitVec0[i1] & l1) != 0L)
+             return true;
+          return false;
+@@ -2299,7 +2299,7 @@
+          return ((jjbitVec23[i2] & l2) != 0L);
+       case 215:
+          return ((jjbitVec24[i2] & l2) != 0L);
+-      default : 
++      default :
+          if ((jjbitVec0[i1] & l1) != 0L)
+             return true;
+          return false;
+@@ -2306,27 +2306,27 @@
+    }
+ }
+ public static final String[] jjstrLiteralImages = {
+-"", null, null, null, null, null, null, null, null, null, null, null, null, 
+-null, null, "\72", "\57", "\57\57", "\141\164\164\162\151\142\165\164\145\72\72", 
+-"\100", "\145\154\145\155\145\156\164\72\72", 
+-"\163\165\142\163\164\151\164\165\164\151\157\156\107\162\157\165\160\72\72", "\164\171\160\145\72\72", "\176", "\142\141\163\145\124\171\160\145\72\72", 
+-"\160\162\151\155\151\164\151\166\145\124\171\160\145\72\72", "\151\164\145\155\124\171\160\145\72\72", 
+-"\155\145\155\142\145\162\124\171\160\145\72\72", "\163\143\157\160\145\72\72", 
+-"\141\164\164\162\151\142\165\164\145\107\162\157\165\160\72\72", "\147\162\157\165\160\72\72", 
+-"\151\144\145\156\164\151\164\171\103\157\156\164\162\141\151\156\164\72\72", "\153\145\171\72\72", "\156\157\164\141\164\151\157\156\72\72", 
+-"\155\157\144\145\154\72\72\163\145\161\165\145\156\143\145", "\155\157\144\145\154\72\72\143\150\157\151\143\145", 
+-"\155\157\144\145\154\72\72\141\154\154", "\155\157\144\145\154\72\72\52", "\141\156\171\72\72\52", 
+-"\141\156\171\101\164\164\162\151\142\165\164\145\72\72\52", "\146\141\143\145\164\72\72\52", "\146\141\143\145\164\72\72", 
+-"\143\157\155\160\157\156\145\156\164\72\72\52", "\170\55\163\143\150\145\155\141\72\72", 
++"", null, null, null, null, null, null, null, null, null, null, null, null,
++null, null, "\72", "\57", "\57\57", "\141\164\164\162\151\142\165\164\145\72\72",
++"\100", "\145\154\145\155\145\156\164\72\72",
++"\163\165\142\163\164\151\164\165\164\151\157\156\107\162\157\165\160\72\72", "\164\171\160\145\72\72", "\176", "\142\141\163\145\124\171\160\145\72\72",
++"\160\162\151\155\151\164\151\166\145\124\171\160\145\72\72", "\151\164\145\155\124\171\160\145\72\72",
++"\155\145\155\142\145\162\124\171\160\145\72\72", "\163\143\157\160\145\72\72",
++"\141\164\164\162\151\142\165\164\145\107\162\157\165\160\72\72", "\147\162\157\165\160\72\72",
++"\151\144\145\156\164\151\164\171\103\157\156\164\162\141\151\156\164\72\72", "\153\145\171\72\72", "\156\157\164\141\164\151\157\156\72\72",
++"\155\157\144\145\154\72\72\163\145\161\165\145\156\143\145", "\155\157\144\145\154\72\72\143\150\157\151\143\145",
++"\155\157\144\145\154\72\72\141\154\154", "\155\157\144\145\154\72\72\52", "\141\156\171\72\72\52",
++"\141\156\171\101\164\164\162\151\142\165\164\145\72\72\52", "\146\141\143\145\164\72\72\52", "\146\141\143\145\164\72\72",
++"\143\157\155\160\157\156\145\156\164\72\72\52", "\170\55\163\143\150\145\155\141\72\72",
+ "\170\55\163\143\150\145\155\141\72\72\52", "\52", "\60", };
+ public static final String[] lexStateNames = {
+-   "DEFAULT", 
++   "DEFAULT",
+ };
+ static final long[] jjtoToken = {
+-   0x7ffffffff001L, 
++   0x7ffffffff001L,
+ };
+ static final long[] jjtoSkip = {
+-   0x3eL, 
++   0x3eL,
+ };
+ protected SimpleCharStream input_stream;
+ private final int[] jjrounds = new int[148];
+@@ -2388,7 +2388,7 @@
+ int jjmatchedPos;
+ int jjmatchedKind;
+ 
+-public Token getNextToken() 
++public Token getNextToken()
+ {
+   int kind;
+   Token specialToken = null;
+@@ -2397,13 +2397,13 @@
+ 
+   EOFLoop :
+   for (;;)
+-  {   
+-   try   
+-   {     
++  {
++   try
++   {
+       curChar = input_stream.BeginToken();
+-   }     
++   }
+    catch(java.io.IOException e)
+-   {        
++   {
+       jjmatchedKind = 0;
+       matchedToken = jjFillToken();
+       return matchedToken;
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/scd/SimpleCharStream.java	Thu Jul 30 18:45:18 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/scd/SimpleCharStream.java	Thu Jul 30 18:45:18 2009
+@@ -223,7 +223,7 @@
+   }
+ 
+   /**
+-   * @deprecated 
++   * @deprecated
+    * @see #getEndColumn
+    */
+ 
+@@ -232,7 +232,7 @@
+   }
+ 
+   /**
+-   * @deprecated 
++   * @deprecated
+    * @see #getEndLine
+    */
+ 
+@@ -440,7 +440,7 @@
+         bufcolumn[j] = newCol + columnDiff;
+         columnDiff = nextColDiff;
+         i++;
+-     } 
++     }
+ 
+      if (i < len)
+      {
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/scd/Step.java	Thu Jul 30 18:45:22 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/scd/Step.java	Thu Jul 30 18:45:21 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.xsom.impl.scd;
+ 
+ import com.sun.xml.internal.xsom.XSComponent;
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/scd/TokenMgrError.java	Thu Jul 30 18:45:25 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/scd/TokenMgrError.java	Thu Jul 30 18:45:25 2009
+@@ -109,7 +109,7 @@
+    /**
+     * Returns a detailed message for the Error when it is thrown by the
+     * token manager to indicate a lexical error.
+-    * Parameters : 
++    * Parameters :
+     *    EOFSeen     : indicates if EOF caused the lexicl error
+     *    curLexState : lexical state in which this error occured
+     *    errorLine   : line number when the error occured
+@@ -129,7 +129,7 @@
+    /**
+     * You can also modify the body of this method to customize your error messages.
+     * For example, cases like LOOP_DETECTED and INVALID_LEXICAL_STATE are not
+-    * of end-users concern, so you can return something like : 
++    * of end-users concern, so you can return something like :
+     *
+     *     "Internal Error : Please file a bug report .... "
+     *
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/util/DraconianErrorHandler.java	Thu Jul 30 18:45:29 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/util/DraconianErrorHandler.java	Thu Jul 30 18:45:28 2009
+@@ -22,6 +22,8 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom.impl.util;
+ 
+ import org.xml.sax.ErrorHandler;
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/util/ResourceEntityResolver.java	Thu Jul 30 18:45:32 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/util/ResourceEntityResolver.java	Thu Jul 30 18:45:32 2009
+@@ -22,6 +22,8 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom.impl.util;
+ 
+ import org.xml.sax.EntityResolver;
+@@ -31,9 +33,9 @@
+     public ResourceEntityResolver( Class _base ) {
+         this.base = _base;
+     }
+-    
++
+     private final Class base;
+-    
++
+     public InputSource resolveEntity( String publicId, String systemId ) {
+         return new InputSource(base.getResourceAsStream(systemId));
+     }
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/util/SchemaTreeTraverser.java	Thu Jul 30 18:45:36 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/util/SchemaTreeTraverser.java	Thu Jul 30 18:45:35 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.xsom.impl.util;
+ 
+ import com.sun.xml.internal.xsom.XSAnnotation;
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/util/SchemaWriter.java	Thu Jul 30 18:45:40 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/util/SchemaWriter.java	Thu Jul 30 18:45:39 2009
+@@ -22,6 +22,8 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom.impl.util;
+ 
+ import com.sun.xml.internal.xsom.XSAnnotation;
+@@ -46,10 +48,14 @@
+ import com.sun.xml.internal.xsom.XSUnionSimpleType;
+ import com.sun.xml.internal.xsom.XSWildcard;
+ import com.sun.xml.internal.xsom.XSXPath;
++import com.sun.xml.internal.xsom.XSWildcard.Any;
++import com.sun.xml.internal.xsom.XSWildcard.Other;
++import com.sun.xml.internal.xsom.XSWildcard.Union;
+ import com.sun.xml.internal.xsom.impl.Const;
+ import com.sun.xml.internal.xsom.visitor.XSSimpleTypeVisitor;
+ import com.sun.xml.internal.xsom.visitor.XSTermVisitor;
+ import com.sun.xml.internal.xsom.visitor.XSVisitor;
++import com.sun.xml.internal.xsom.visitor.XSWildcardFunction;
+ 
+ import java.io.IOException;
+ import java.io.Writer;
+@@ -124,10 +130,7 @@
+         if(s.getTargetNamespace().equals(Const.schemaNamespace))
+             return;
+ 
+-        println(MessageFormat.format("<schema targetNamespace=\"{0}\">",
+-            new Object[]{
+-                s.getTargetNamespace(),
+-            }));
++        println(MessageFormat.format("<schema targetNamespace=\"{0}\">", s.getTargetNamespace()));
+         indent++;
+ 
+         Iterator itr;
+@@ -163,12 +166,11 @@
+     public void attGroupDecl( XSAttGroupDecl decl ) {
+         Iterator itr;
+ 
+-        println(MessageFormat.format("<attGroup name=\"{0}\">",
+-            new Object[]{ decl.getName() }));
++        println(MessageFormat.format("<attGroup name=\"{0}\">", decl.getName()));
+         indent++;
+-        
++
+         // TODO: wildcard
+-        
++
+         itr = decl.iterateAttGroups();
+         while(itr.hasNext())
+             dumpRef( (XSAttGroupDecl)itr.next() );
+@@ -182,8 +184,7 @@
+     }
+ 
+     public void dumpRef( XSAttGroupDecl decl ) {
+-        println(MessageFormat.format("<attGroup ref=\"'{'{0}'}'{1}\"/>",
+-            new Object[]{ decl.getTargetNamespace(), decl.getName() }));
++        println(MessageFormat.format("<attGroup ref=\"'{'{0}'}'{1}\"/>", decl.getTargetNamespace(), decl.getName()));
+     }
+ 
+     public void attributeUse( XSAttributeUse use ) {
+@@ -204,8 +205,7 @@
+         } else {
+             // reference to a global one
+             println(MessageFormat.format("<attribute ref=\"'{'{0}'}'{1}{2}\"/>",
+-                new Object[]{ decl.getTargetNamespace(), decl.getName(),
+-                    additionalAtts }));
++                decl.getTargetNamespace(), decl.getName(), additionalAtts));
+         }
+     }
+ 
+@@ -217,21 +217,15 @@
+         XSSimpleType type=decl.getType();
+ 
+         println(MessageFormat.format("<attribute name=\"{0}\"{1}{2}{3}{4}{5}>",
+-            new Object[]{
+-                decl.getName(),
+-                additionalAtts,
+-                type.isLocal()?"":
+-                MessageFormat.format(" type=\"'{'{0}'}'{1}\"",
+-                new Object[]{
+-                    type.getTargetNamespace(),
+-                    type.getName()
+-                }),
+-                decl.getFixedValue()==null ?
+-                    "":" fixed=\""+decl.getFixedValue()+'\"',
+-                decl.getDefaultValue()==null ?
+-                    "":" default=\""+decl.getDefaultValue()+'\"',
+-                type.isLocal()?"":" /"
+-            }));
++            decl.getName(),
++            additionalAtts,
++            type.isLocal()?"":
++                MessageFormat.format(" type=\"'{'{0}'}'{1}\"", type.getTargetNamespace(), type.getName()),
++            decl.getFixedValue()==null ?
++                "":" fixed=\""+decl.getFixedValue()+'\"',
++            decl.getDefaultValue()==null ?
++                "":" default=\""+decl.getDefaultValue()+'\"',
++            type.isLocal()?"":" /"));
+ 
+         if(type.isLocal()) {
+             indent++;
+@@ -242,10 +236,7 @@
+     }
+ 
+     public void simpleType( XSSimpleType type ) {
+-        println(MessageFormat.format("<simpleType{0}>",
+-            new Object[]{
+-                type.isLocal()?"":" name=\""+type.getName()+'\"'
+-            }));
++        println(MessageFormat.format("<simpleType{0}>", type.isLocal()?"":" name=\""+type.getName()+'\"'));
+         indent++;
+ 
+         type.visit((XSSimpleTypeVisitor)this);
+@@ -266,10 +257,7 @@
+         } else {
+             // global type
+             println(MessageFormat.format("<list itemType=\"'{'{0}'}'{1}\" />",
+-                new Object[]{
+-                    itemType.getTargetNamespace(),
+-                    itemType.getName()
+-                }));
++                itemType.getTargetNamespace(), itemType.getName()));
+         }
+     }
+ 
+@@ -280,8 +268,7 @@
+         for( int i=0; i<len; i++ ) {
+             XSSimpleType member = type.getMember(i);
+             if(member.isGlobal())
+-                ref.append(MessageFormat.format(" '{'{0}'}'{1}",
+-                    new Object[]{member.getTargetNamespace(),member.getName()}));
++                ref.append(MessageFormat.format(" '{'{0}'}'{1}", member.getTargetNamespace(),member.getName()));
+         }
+ 
+         if(ref.length()==0)
+@@ -313,11 +300,9 @@
+         XSSimpleType baseType = type.getSimpleBaseType();
+ 
+         println(MessageFormat.format("<restriction{0}>",
+-            new Object[]{
+-                baseType.isLocal()?"":" base=\"{"+
+-                baseType.getTargetNamespace()+'}'+
+-                baseType.getName()+'\"'
+-            }));
++            baseType.isLocal()?"":" base=\"{"+
++            baseType.getTargetNamespace()+'}'+
++            baseType.getName()+'\"'));
+         indent++;
+ 
+         if(baseType.isLocal())
+@@ -333,17 +318,12 @@
+ 
+     public void facet( XSFacet facet ) {
+         println(MessageFormat.format("<{0} value=\"{1}\"/>",
+-            new Object[]{
+-                facet.getName(), facet.getValue(),
+-            }));
++            facet.getName(), facet.getValue()));
+     }
+ 
+     public void notation( XSNotation notation ) {
+         println(MessageFormat.format("<notation name='\"0}\" public =\"{1}\" system=\"{2}\" />",
+-            new Object[] {
+-                notation.getName(),
+-                notation.getPublicId(),
+-                notation.getSystemId() } ));
++            notation.getName(), notation.getPublicId(), notation.getSystemId()));
+     }
+ 
+ 
+@@ -350,13 +330,11 @@
+ 
+     public void complexType( XSComplexType type ) {
+         println(MessageFormat.format("<complexType{0}>",
+-            new Object[]{
+-                type.isLocal()?"":" name=\""+type.getName()+'\"'
+-            }));
++            type.isLocal()?"":" name=\""+type.getName()+'\"'));
+         indent++;
+-        
++
+         // TODO: wildcard
+-        
++
+         if(type.getContentType().asSimpleType()!=null) {
+             // simple content
+             println("<simpleContent>");
+@@ -367,9 +345,7 @@
+             if(type.getDerivationMethod()==XSType.RESTRICTION) {
+                 // restriction
+                 println(MessageFormat.format("<restriction base=\"<{0}>{1}\">",
+-                    new Object[]{
+-                        baseType.getTargetNamespace(),
+-                        baseType.getName() }));
++                    baseType.getTargetNamespace(), baseType.getName()));
+                 indent++;
+ 
+                 dumpComplexTypeAttribute(type);
+@@ -379,9 +355,7 @@
+             } else {
+                 // extension
+                 println(MessageFormat.format("<extension base=\"<{0}>{1}\">",
+-                    new Object[]{
+-                        baseType.getTargetNamespace(),
+-                        baseType.getName() }));
++                    baseType.getTargetNamespace(), baseType.getName()));
+ 
+                 // check if have redefine tag - Kirill
+                 if( type.isGlobal()
+@@ -416,9 +390,7 @@
+             if(type.getDerivationMethod()==XSType.RESTRICTION) {
+                 // restriction
+                 println(MessageFormat.format("<restriction base=\"'{'{0}'}'{1}\">",
+-                    new Object[]{
+-                        baseType.getTargetNamespace(),
+-                        baseType.getName() }));
++                    baseType.getTargetNamespace(), baseType.getName()));
+                 indent++;
+ 
+                 type.getContentType().visit(this);
+@@ -429,9 +401,7 @@
+             } else {
+                 // extension
+                 println(MessageFormat.format("<extension base=\"'{'{0}'}'{1}\">",
+-                    new Object[]{
+-                        baseType.getTargetNamespace(),
+-                        baseType.getName() }));
++                    baseType.getTargetNamespace(), baseType.getName()));
+ 
+                 // check if have redefine - Kirill
+                 if( type.isGlobal()
+@@ -473,6 +443,10 @@
+         itr = type.iterateDeclaredAttributeUses();
+         while(itr.hasNext())
+             attributeUse( (XSAttributeUse)itr.next() );
++
++        XSWildcard awc = type.getAttributeWildcard();
++        if(awc!=null)
++            wildcard("anyAttribute",awc,"");
+     }
+ 
+     public void elementDecl( XSElementDecl decl ) {
+@@ -480,18 +454,21 @@
+     }
+     private void elementDecl( XSElementDecl decl, String extraAtts ) {
+         XSType type = decl.getType();
+-        
+-        // TODO: various other attributes 
+-        
++
++        // TODO: various other attributes
++
++        // qualified attr; Issue
++        if(decl.getForm() != null) {
++            extraAtts += " form=\"" + (decl.getForm() ? "qualified" : "unqualified" ) + "\"";
++        }
++
+         println(MessageFormat.format("<element name=\"{0}\"{1}{2}{3}>",
+-            new Object[]{
+-                decl.getName(),
+-                type.isLocal()?"":" type=\"{"+
+-                    type.getTargetNamespace()+'}'+
+-                    type.getName()+'\"',
+-                extraAtts,
+-                type.isLocal()?"":"/"
+-            }));
++            decl.getName(),
++            type.isLocal()?"":" type=\"{"+
++            type.getTargetNamespace()+'}'+
++            type.getName()+'\"',
++            extraAtts,
++            type.isLocal()?"":"/"));
+ 
+         if(type.isLocal()) {
+             indent++;
+@@ -504,10 +481,7 @@
+     }
+ 
+     public void modelGroupDecl( XSModelGroupDecl decl ) {
+-        println(MessageFormat.format("<group name=\"{0}\">",
+-            new Object[]{
+-                decl.getName()
+-            }));
++        println(MessageFormat.format("<group name=\"{0}\">", decl.getName()));
+         indent++;
+ 
+         modelGroup(decl.getModelGroup());
+@@ -520,8 +494,7 @@
+         modelGroup(group,"");
+     }
+     private void modelGroup( XSModelGroup group, String extraAtts ) {
+-        println(MessageFormat.format("<{0}{1}>",
+-            new Object[]{ group.getCompositor(), extraAtts }));
++        println(MessageFormat.format("<{0}{1}>", group.getCompositor(), extraAtts));
+         indent++;
+ 
+         final int len = group.getSize();
+@@ -529,8 +502,7 @@
+             particle(group.getChild(i));
+ 
+         indent--;
+-        println(MessageFormat.format("</{0}>",
+-            new Object[]{ group.getCompositor() }));
++        println(MessageFormat.format("</{0}>", group.getCompositor()));
+     }
+ 
+     public void particle( XSParticle part ) {
+@@ -542,11 +514,11 @@
+         if(i==XSParticle.UNBOUNDED)
+             buf.append(" maxOccurs=\"unbounded\"");
+         else if(i!=1)
+-            buf.append(" maxOccurs=\""+i+'\"');
++            buf.append(" maxOccurs=\"").append(i).append('\"');
+ 
+         i = part.getMinOccurs();
+         if(i!=1)
+-            buf.append(" minOccurs=\""+i+'\"');
++            buf.append(" minOccurs=\"").append(i).append('\"');
+ 
+         final String extraAtts = buf.toString();
+ 
+@@ -557,40 +529,68 @@
+                 else {
+                     // reference
+                     println(MessageFormat.format("<element ref=\"'{'{0}'}'{1}\"{2}/>",
+-                        new Object[]{
+-                            decl.getTargetNamespace(),
+-                            decl.getName(),
+-                            extraAtts
+-                        }));
++                        decl.getTargetNamespace(),
++                        decl.getName(),
++                        extraAtts));
+                 }
+             }
+             public void modelGroupDecl( XSModelGroupDecl decl ) {
+                 // reference
+                 println(MessageFormat.format("<group ref=\"'{'{0}'}'{1}\"{2}/>",
+-                    new Object[]{
+-                        decl.getTargetNamespace(),
+-                        decl.getName(),
+-                        extraAtts
+-                    }));
++                    decl.getTargetNamespace(),
++                    decl.getName(),
++                    extraAtts));
+             }
+             public void modelGroup( XSModelGroup group ) {
+                 SchemaWriter.this.modelGroup(group,extraAtts);
+             }
+             public void wildcard( XSWildcard wc ) {
+-                SchemaWriter.this.wildcard(wc,extraAtts);
++                SchemaWriter.this.wildcard("any",wc,extraAtts);
+             }
+         });
+     }
+ 
+     public void wildcard( XSWildcard wc ) {
+-        wildcard(wc,"");
++        wildcard("any",wc,"");
+     }
+ 
+-    private void wildcard( XSWildcard wc, String extraAtts ) {
+-        // TODO
+-        println(MessageFormat.format("<any/>", new Object[]{extraAtts}));
++    private void wildcard( String tagName, XSWildcard wc, String extraAtts ) {
++        final String proessContents;
++        switch(wc.getMode()) {
++        case XSWildcard.LAX:
++            proessContents = " processContents='lax'";break;
++        case XSWildcard.STRTICT:
++            proessContents = "";break;
++        case XSWildcard.SKIP:
++            proessContents = " processContents='skip'";break;
++        default:
++            throw new AssertionError();
++        }
++
++        println(MessageFormat.format("<{0}{1}{2}{3}/>",tagName, proessContents, wc.apply(WILDCARD_NS), extraAtts));
+     }
+ 
++    private static final XSWildcardFunction<String> WILDCARD_NS = new XSWildcardFunction<String>() {
++        public String any(Any wc) {
++            return ""; // default
++        }
++
++        public String other(Other wc) {
++            return " namespace='##other'";
++        }
++
++        public String union(Union wc) {
++            StringBuffer buf = new StringBuffer(" namespace='");
++            boolean first = true;
++            for (String s : wc.getNamespaces()) {
++                if(first)   first=false;
++                else        buf.append(' ');
++                buf.append(s);
++            }
++            return buf.append('\'').toString();
++        }
++    };
++
+     public void annotation( XSAnnotation ann ) {
+         // TODO: it would be nice even if we just put <xs:documentation>
+     }
+--- old/src/share/classes/com/sun/xml/internal/xsom/impl/util/Uri.java	Thu Jul 30 18:45:43 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/impl/util/Uri.java	Thu Jul 30 18:45:43 2009
+@@ -1,28 +1,4 @@
+ /*
+- * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+- *
+- * This code is free software; you can redistribute it and/or modify it
+- * under the terms of the GNU General Public License version 2 only, as
+- * published by the Free Software Foundation.  Sun designates this
+- * particular file as subject to the "Classpath" exception as provided
+- * by Sun in the LICENSE file that accompanied this code.
+- *
+- * This code is distributed in the hope that it will be useful, but WITHOUT
+- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+- * version 2 for more details (a copy is included in the LICENSE file that
+- * accompanied this code).
+- *
+- * You should have received a copy of the GNU General Public License version
+- * 2 along with this work; if not, write to the Free Software Foundation,
+- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+- *
+- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+- * CA 95054 USA or visit www.sun.com if you need additional information or
+- * have any questions.
+- */
+-/*
+ Copyright (c) 2001, 2002 Thai Open Source Software Center Ltd
+ All rights reserved.
+ 
+@@ -138,7 +114,7 @@
+   private static boolean isDigit(char c) {
+     return '0' <= c && c <= '9';
+   }
+-  
++
+   private static boolean isSchemeChar(char c) {
+     return isAlpha(c) || isDigit(c) || c == '+' || c == '-' || c =='.';
+   }
+--- old/src/share/classes/com/sun/xml/internal/xsom/parser/AnnotationContext.java	Thu Jul 30 18:45:47 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/parser/AnnotationContext.java	Thu Jul 30 18:45:46 2009
+@@ -22,28 +22,30 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom.parser;
+ 
+ /**
+  * Enumeration used to represent the type of the schema component
+  * that is being parsed when the AnnotationParser is called.
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+ final public class AnnotationContext {
+-    
++
+     /** Display name of the context. */
+     private final String name;
+-    
++
+     private AnnotationContext( String _name ) {
+         this.name = _name;
+     }
+-    
++
+     public String toString() { return name; }
+-    
+-    
+-    
++
++
++
+     public static final AnnotationContext SCHEMA
+         = new AnnotationContext("schema");
+     public static final AnnotationContext NOTATION
+--- old/src/share/classes/com/sun/xml/internal/xsom/parser/AnnotationParser.java	Thu Jul 30 18:45:50 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/parser/AnnotationParser.java	Thu Jul 30 18:45:50 2009
+@@ -22,6 +22,8 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom.parser;
+ 
+ import org.xml.sax.ContentHandler;
+@@ -30,7 +32,7 @@
+ 
+ /**
+  * Used to parse &lt;xs:annotation>.
+- * 
++ *
+  * @author Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+ public abstract class AnnotationParser {
+@@ -37,10 +39,10 @@
+     /**
+      * Called every time a new &lt;xs:annotation> element
+      * is found.
+-     * 
++     *
+      * The sub-tree rooted at &lt;xs:annotation> will be
+      * sent to this ContentHandler as if it is a whole document.
+-     * 
++     *
+      * @param context
+      *      indicates the schema component that owns this annotation.
+      *      Always non-null.
+@@ -61,11 +63,11 @@
+         String parentElementName,
+         ErrorHandler errorHandler,
+         EntityResolver entityResolver );
+-    
++
+     /**
+      * Once the SAX events are fed to the ContentHandler,
+      * this method will be called to retrieve the parsed result.
+-     * 
++     *
+      * @param existing
+      *      An annotation object which was returned from another
+      *      AnnotationParser before. Sometimes, one schema component
+@@ -78,4 +80,3 @@
+      */
+     public abstract Object getResult( Object existing );
+ }
+-
+--- old/src/share/classes/com/sun/xml/internal/xsom/parser/AnnotationParserFactory.java	Thu Jul 30 18:45:54 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/parser/AnnotationParserFactory.java	Thu Jul 30 18:45:53 2009
+@@ -22,14 +22,15 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom.parser;
+ 
+ /**
+  * Factory for {@link AnnotationParser}.
+- * 
++ *
+  * @author Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+ public interface AnnotationParserFactory {
+     AnnotationParser create();
+ }
+-
+--- old/src/share/classes/com/sun/xml/internal/xsom/parser/JAXPParser.java	Thu Jul 30 18:45:57 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/parser/JAXPParser.java	Thu Jul 30 18:45:57 2009
+@@ -22,6 +22,8 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom.parser;
+ 
+ import java.io.IOException;
+@@ -44,38 +46,38 @@
+ 
+ /**
+  * Standard XMLParser implemented by using JAXP.
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+ public class JAXPParser implements XMLParser {
+-    
++
+     private final SAXParserFactory factory;
+-    
++
+     public JAXPParser( SAXParserFactory factory ) {
+         factory.setNamespaceAware(true);    // just in case
+         this.factory = factory;
+     }
+-    
++
+     public JAXPParser() {
+         this( SAXParserFactory.newInstance());
+     }
+-    
+ 
+ 
+-    
+-    
+ 
+ 
++
++
++
+     public void parse( InputSource source, ContentHandler handler,
+         ErrorHandler errorHandler, EntityResolver entityResolver )
+-        
++
+         throws SAXException, IOException {
+-        
++
+         try {
+             XMLReader reader = factory.newSAXParser().getXMLReader();
+             reader = new XMLReaderEx(reader);
+-            
++
+             reader.setContentHandler(handler);
+             if(errorHandler!=null)
+                 reader.setErrorHandler(errorHandler);
+@@ -94,35 +96,35 @@
+ 
+     /**
+      * XMLReader with improved error message for entity resolution failure.
+-     * 
++     *
+      * TODO: this class is completely stand-alone, so it shouldn't be
+      * an inner class.
+      */
+     private static class XMLReaderEx extends XMLFilterImpl {
+-        
++
+         private Locator locator;
+-        
++
+         XMLReaderEx( XMLReader parent ) {
+             this.setParent(parent);
+         }
+-        
++
+         /**
+          * Resolves entities and reports user-friendly error messages.
+-         * 
++         *
+          * <p>
+          * Some XML parser (at least Xerces) does not report much information
+          * when it fails to resolve an entity, which is often quite
+-         * frustrating. For example, if you are behind a firewall and the 
++         * frustrating. For example, if you are behind a firewall and the
+          * schema contains a reference to www.w3.org, and there is no
+          * entity resolver, the parser will just throw an IOException
+          * that doesn't contain any information about where that reference
+          * occurs nor what it is accessing.
+-         * 
++         *
+          * <p>
+          * By implementing an EntityResolver and resolving the reference
+          * by ourselves, we can report an error message with all the
+          * necessary information to fix the problem.
+-         * 
++         *
+          * <p>
+          * Note that we still need to the client-specified entity resolver
+          * to let the application handle entity resolution. Here we just catch
+@@ -131,12 +133,12 @@
+         public InputSource resolveEntity(String publicId, String systemId) throws SAXException {
+             try {
+                 InputSource is=null;
+-                
++
+                 // ask the client-specified entity resolver first
+-                if( this.getEntityResolver()!=null)  
++                if( this.getEntityResolver()!=null)
+                     is = this.getEntityResolver().resolveEntity(publicId,systemId);
+                 if( is!=null )  return is;  // if that succeeds, fine.
+-                
++
+                 // rather than returning null, resolve it now
+                 // so that we can detect errors.
+                 is = new InputSource( new URL(systemId).openStream() );
+@@ -155,7 +157,7 @@
+                 throw spe;
+             }
+         }
+-        
++
+         public void setDocumentLocator(Locator locator) {
+             super.setDocumentLocator(locator);
+             this.locator = locator;
+--- old/src/share/classes/com/sun/xml/internal/xsom/parser/SchemaDocument.java	Thu Jul 30 18:46:01 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/parser/SchemaDocument.java	Thu Jul 30 18:46:00 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.xsom.parser;
+ 
+ import com.sun.xml.internal.xsom.XSSchema;
+--- old/src/share/classes/com/sun/xml/internal/xsom/parser/XMLParser.java	Thu Jul 30 18:46:04 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/parser/XMLParser.java	Thu Jul 30 18:46:04 2009
+@@ -22,6 +22,8 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom.parser;
+ 
+ import java.io.IOException;
+@@ -34,7 +36,7 @@
+ 
+ /**
+  * Interface that hides the detail of parsing mechanism.
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+@@ -42,10 +44,10 @@
+     /**
+      * Parses the document identified by the given input source
+      * and sends SAX events to the given content handler.
+-     * 
++     *
+      * <p>
+      * This method must be re-entrant.
+-     * 
++     *
+      * @param errorHandler
+      *      Errors found during the parsing must be reported to
+      *      this handler so that XSOM can recognize that something went wrong.
+@@ -53,7 +55,7 @@
+      * @param entityResolver
+      *      Entity resolution should be done through this interface.
+      *      Can be null.
+-     * 
++     *
+      * @exception SAXException
+      *      If ErrorHandler throws a SAXException, this method
+      *      will tunnel it to the caller. All the other errors
+@@ -61,6 +63,6 @@
+      */
+     void parse( InputSource source, ContentHandler handler,
+         ErrorHandler errorHandler, EntityResolver entityResolver )
+-        
++
+         throws SAXException, IOException;
+ }
+--- old/src/share/classes/com/sun/xml/internal/xsom/parser/XSOMParser.java	Thu Jul 30 18:46:08 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/parser/XSOMParser.java	Thu Jul 30 18:46:07 2009
+@@ -22,6 +22,8 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom.parser;
+ 
+ import java.io.File;
+@@ -48,7 +50,7 @@
+ /**
+  * Parses possibly multiple W3C XML Schema files and compose
+  * them into one grammar.
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+@@ -56,11 +58,11 @@
+ 
+     private EntityResolver entityResolver;
+     private ErrorHandler userErrorHandler;
+-    
++
+     private AnnotationParserFactory apFactory;
+-    
++
+     private final ParserContext context;
+-    
++
+     /**
+     * Creates a new XSOMParser by using a SAX parser from JAXP.
+     */
+@@ -67,11 +69,11 @@
+    public XSOMParser() {
+        this(new JAXPParser());
+    }
+-    
++
+    /**
+     * Creates a new XSOMParser that uses the given SAXParserFactory
+     * for creating new SAX parsers.
+-    * 
++    *
+     * The caller needs to configure
+     * it properly. Don't forget to call <code>setNamespaceAware(true)</code>
+     * or you'll see some strange errors.
+@@ -79,14 +81,14 @@
+    public XSOMParser( SAXParserFactory factory ) {
+        this( new JAXPParser(factory) );
+    }
+-    
++
+    /**
+     * Creates a new XSOMParser that reads XML Schema from non-standard
+     * inputs.
+-    * 
++    *
+     * By implementing the {@link XMLParser} interface, XML Schema
+     * can be read from something other than XML.
+-    * 
++    *
+     * @param   parser
+     *      This parser will be called to parse XML Schema documents.
+     */
+@@ -126,7 +128,7 @@
+     public void parse( File schema ) throws SAXException, IOException {
+         parse(schema.toURL());
+     }
+-    
++
+     /**
+      * Parses a new XML Schema document.
+      */
+@@ -133,7 +135,7 @@
+     public void parse( URL url ) throws SAXException {
+         parse( url.toExternalForm() );
+     }
+-    
++
+     /**
+      * Parses a new XML Schema document.
+      */
+@@ -140,7 +142,7 @@
+     public void parse( String systemId ) throws SAXException {
+         parse(new InputSource(systemId));
+     }
+-    
++
+     /**
+      * Parses a new XML Schema document.
+      *
+@@ -151,22 +153,22 @@
+     public void parse( InputSource source ) throws SAXException {
+         context.parse(source);
+     }
+-    
+-    
+-    
++
++
++
+     /**
+      * Gets the parser implemented as a ContentHandler.
+-     * 
++     *
+      * One can feed XML Schema as SAX events to this interface to
+      * parse a schema. To parse multiple schema files, feed multiple
+      * sets of events.
+-     * 
++     *
+      * <p>
+      * If you don't send a complete event sequence from a startDocument
+      * event to an endDocument event, the state of XSOMParser can become
+      * unstable. This sometimes happen when you encounter an error while
+      * generating SAX events. Don't call the getResult method in that case.
+-     * 
++     *
+      * <p>
+      * This way of reading XML Schema can be useful when XML Schema is
+      * not available as a stand-alone XML document.
+@@ -178,11 +180,11 @@
+         runtime.setRootHandler(s);
+         return runtime;
+     }
+-    
++
+     /**
+      * Gets the parsed result. Don't call this method until
+      * you parse all the schemas.
+-     * 
++     *
+      * @return
+      *      If there was any parse error, this method returns null.
+      *      To receive error information, specify your error handler
+@@ -205,7 +207,7 @@
+     public Set<SchemaDocument> getDocuments() {
+         return new HashSet<SchemaDocument>(context.parsedDocuments.keySet());
+     }
+-    
++
+     public EntityResolver getEntityResolver() {
+         return entityResolver;
+     }
+@@ -229,10 +231,10 @@
+ 
+     /**
+      * Sets the annotation parser.
+-     * 
++     *
+      * Annotation parser can be used to parse application-specific
+      * annotations inside a schema.
+-     * 
++     *
+      * <p>
+      * For each annotation, new instance of this class will be
+      * created and used to parse &lt;xs:annotation>.
+@@ -253,7 +255,7 @@
+ 
+     /**
+      * Sets the annotation parser factory.
+-     * 
++     *
+      * <p>
+      * The specified factory will be used to create AnnotationParsers.
+      */
+--- old/src/share/classes/com/sun/xml/internal/xsom/parser/package.html	Thu Jul 30 18:46:11 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/parser/package.html	Thu Jul 30 18:46:10 2009
+@@ -23,5 +23,5 @@
+  have any questions.
+ -->
+ <html><body>
+-Classes to parse XML Schema documents into objects of <code>com.sun.xml.xsom</code> package.
++Classes to parse XML Schema documents into objects of <code>com.sun.xml.internal.xsom</code> package.
+ </body></html>
+--- old/src/share/classes/com/sun/xml/internal/xsom/util/ComponentNameFunction.java	Thu Jul 30 18:46:15 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/util/ComponentNameFunction.java	Thu Jul 30 18:46:14 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.xsom.util;
+ 
+ import com.sun.xml.internal.xsom.XSAnnotation;
+@@ -45,15 +46,14 @@
+ 
+ /**
+  * Extract the name of the components.
+- * 
++ *
+  * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li></ul>
+- * @version $Revision: 1.4 $
+  */
+ public class ComponentNameFunction implements XSFunction<String> {
+ 
+     // delegate to this object to get the localized name of the component type
+     private NameGetter nameGetter = new NameGetter(null);
+-    
++
+     /**
+      * @see com.sun.xml.internal.xsom.visitor.XSFunction#annotation(XSAnnotation)
+      */
+--- old/src/share/classes/com/sun/xml/internal/xsom/util/DeferedCollection.java	Thu Jul 30 18:46:18 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/util/DeferedCollection.java	Thu Jul 30 18:46:17 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.xsom.util;
+ 
+ import java.util.ArrayList;
+--- old/src/share/classes/com/sun/xml/internal/xsom/util/DomAnnotationParserFactory.java	Thu Jul 30 18:46:22 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/util/DomAnnotationParserFactory.java	Thu Jul 30 18:46:21 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.xsom.util;
+ 
+ import com.sun.xml.internal.xsom.XSAnnotation;
+--- old/src/share/classes/com/sun/xml/internal/xsom/util/NameGetter.java	Thu Jul 30 18:46:25 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/util/NameGetter.java	Thu Jul 30 18:46:24 2009
+@@ -22,6 +22,8 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom.util;
+ 
+ import java.util.Locale;
+@@ -49,10 +51,10 @@
+ 
+ /**
+  * Gets the human-readable name of a schema component.
+- * 
++ *
+  * <p>
+  * This is a function object that returns {@link String}.
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+@@ -64,15 +66,15 @@
+     public NameGetter( Locale _locale ) {
+         this.locale = _locale;
+     }
+-    
++
+     private final Locale locale;
+-    
++
+     /**
+      * An instance that gets names in the default locale.
+      * This instance is provided just for convenience.
+      */
+     public final static XSFunction theInstance = new NameGetter(null);
+-    
++
+     /**
+      * Gets the name of the specified component in the default locale.
+      * This method is just a wrapper.
+@@ -80,8 +82,8 @@
+     public static String get( XSComponent comp ) {
+         return (String)comp.apply(theInstance);
+     }
+-    
+-    
++
++
+     public String annotation(XSAnnotation ann) {
+         return localize("annotation");
+     }
+@@ -137,7 +139,7 @@
+     public String elementDecl(XSElementDecl decl) {
+         return localize("elementDecl");
+     }
+-    
++
+     public String notation( XSNotation n ) {
+         return localize("notation");
+     }
+@@ -152,12 +154,12 @@
+ 
+     private String localize( String key ) {
+         ResourceBundle rb;
+-        
++
+         if(locale==null)
+             rb = ResourceBundle.getBundle(NameGetter.class.getName());
+         else
+             rb = ResourceBundle.getBundle(NameGetter.class.getName(),locale);
+-        
++
+         return rb.getString(key);
+     }
+ }
+--- old/src/share/classes/com/sun/xml/internal/xsom/util/NameGetter.properties	Thu Jul 30 18:46:29 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/util/NameGetter.properties	Thu Jul 30 18:46:28 2009
+@@ -23,21 +23,20 @@
+ # have any questions.
+ #
+ 
+-annotation		= annotation
+-attGroupDecl	= attribute group declaration
+-attributeDecl	= attribute declaration
+-attributeUse	= attribute use
+-complexType		= complex type
+-schema			= schema
+-facet			= facet
+-simpleType		= simple type
+-particle		= particle
+-empty			= empty content model
+-wildcard		= wildcard
+-modelGroupDecl	= model group declaration
+-modelGroup		= model group
+-elementDecl		= element declaration
+-notation		= notation declaration
++annotation              = annotation
++attGroupDecl    = attribute group declaration
++attributeDecl   = attribute declaration
++attributeUse    = attribute use
++complexType             = complex type
++schema                  = schema
++facet                   = facet
++simpleType              = simple type
++particle                = particle
++empty                   = empty content model
++wildcard                = wildcard
++modelGroupDecl  = model group declaration
++modelGroup              = model group
++elementDecl             = element declaration
++notation                = notation declaration
+ idConstraint    = identity constraint
+ xpath           = xpath
+- 
+--- old/src/share/classes/com/sun/xml/internal/xsom/util/SimpleTypeSet.java	Thu Jul 30 18:46:32 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/util/SimpleTypeSet.java	Thu Jul 30 18:46:31 2009
+@@ -22,6 +22,8 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom.util;
+ 
+ import java.util.Set;
+@@ -30,20 +32,20 @@
+ 
+ /**
+  * A very simple TypeSet.
+- * 
++ *
+  * The contains method returns true iff the set explicitly contains an
+  * instance of the specified XSType.
+- * 
++ *
+  * @author <a href="mailto:Ryan.Shoemaker@Sun.COM">Ryan Shoemaker</a>, Sun Microsystems, Inc.
+  */
+ public class SimpleTypeSet extends TypeSet {
+ 
+     private final Set typeSet;
+-    
++
+     public SimpleTypeSet(Set s) {
+         typeSet = s;
+     }
+-    
++
+     /* (non-Javadoc)
+      * @see com.sun.xml.internal.xsom.util.TypeSet#contains(com.sun.xml.internal.xsom.XSDeclaration)
+      */
+--- old/src/share/classes/com/sun/xml/internal/xsom/util/TypeClosure.java	Thu Jul 30 18:46:39 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/util/TypeClosure.java	Thu Jul 30 18:46:38 2009
+@@ -22,6 +22,8 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom.util;
+ 
+ import com.sun.xml.internal.xsom.XSType;
+@@ -28,24 +30,24 @@
+ 
+ /**
+  * Perform a transitive closure operation on a type to determine if it
+- * belongs to this set. 
+- * 
++ * belongs to this set.
++ *
+  * The contains method returns true iff the TypeSet contains an instance
+  * of the specified XSType or any of the base types of the XSType.
+- * 
++ *
+  * @author <a href="mailto:Ryan.Shoemaker@Sun.COM">Ryan Shoemaker</a>, Sun Microsystems, Inc.
+  */
+ public class TypeClosure extends TypeSet {
+ 
+     private final TypeSet typeSet;
+-    
++
+     public TypeClosure(TypeSet typeSet) {
+         this.typeSet = typeSet;
+     }
+-    
++
+     /* (non-Javadoc)
+      * @see com.sun.xml.internal.xsom.util.TypeSet#contains(com.sun.xml.internal.xsom.XSDeclaration)
+-     * 
++     *
+      * transitive closure variation on the contains method.
+      */
+     public boolean contains(XSType type) {
+--- old/src/share/classes/com/sun/xml/internal/xsom/util/TypeSet.java	Thu Jul 30 18:46:42 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/util/TypeSet.java	Thu Jul 30 18:46:42 2009
+@@ -22,6 +22,8 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom.util;
+ 
+ import com.sun.xml.internal.xsom.XSType;
+@@ -28,7 +30,7 @@
+ 
+ /**
+  * A simple abstraction for a set of Types that defines containment functions.
+- * 
++ *
+  * @author <a href="mailto:Ryan.Shoemaker@Sun.COM">Ryan Shoemaker</a>, Sun Microsystems, Inc.
+  */
+ public abstract class TypeSet {
+@@ -35,10 +37,10 @@
+ 
+     /**
+      * Return true if this TypeSet contains the specified type.
+-     * 
++     *
+      * Concrete implementations of this method determine what it
+      * means for the TypeSet to "contain" a type.
+-     *  
++     *
+      * @param type the type
+      * @return true iff this TypeSet contains the specified type
+      */
+@@ -47,7 +49,7 @@
+     /**
+      * Calculate the TypeSet formed by the intersection of two
+      * other TypeSet objects.
+-     * 
++     *
+      * @param a a TypeSet
+      * @param b another TypeSet
+      * @return the intersection of a and b
+@@ -63,7 +65,7 @@
+     /**
+      * Calculate the TypeSet formed by the union of two
+      * other TypeSet objects.
+-     * 
++     *
+      * @param a a TypeSet
+      * @param b another TypeSet
+      * @return the union of a and b
+--- old/src/share/classes/com/sun/xml/internal/xsom/util/XSFinder.java	Thu Jul 30 18:46:46 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/util/XSFinder.java	Thu Jul 30 18:46:45 2009
+@@ -22,6 +22,8 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom.util;
+ 
+ import com.sun.xml.internal.xsom.XSAnnotation;
+@@ -47,17 +49,17 @@
+ /**
+  * Utility implementation of {@link XSFunction} that returns
+  * {@link Boolean} to find something from schema objects.
+- * 
++ *
+  * <p>
+  * This implementation returns <code>Boolean.FALSE</code> from
+  * all of the methods. The derived class is expected to override
+  * some of the methods to actually look for something.
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+ public class XSFinder implements XSFunction<Boolean> {
+-    
++
+     /**
+      * Invokes this object as a visitor with the specified component.
+      */
+@@ -64,7 +66,7 @@
+     public final boolean find( XSComponent c ) {
+         return c.apply(this);
+     }
+-    
++
+     /**
+      * @see com.sun.xml.internal.xsom.visitor.XSFunction#annotation(com.sun.xml.internal.xsom.XSAnnotation)
+      */
+--- old/src/share/classes/com/sun/xml/internal/xsom/util/XSFunctionFilter.java	Thu Jul 30 18:46:49 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/util/XSFunctionFilter.java	Thu Jul 30 18:46:49 2009
+@@ -22,6 +22,8 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom.util;
+ 
+ import com.sun.xml.internal.xsom.XSAnnotation;
+@@ -46,25 +48,25 @@
+ /**
+  * Filter implementation of XSFilter.
+  * This class forwards all the method calls to another XSFunction.
+- * 
++ *
+  * <p>
+  * This class is intended to be derived by client application
+  * to add some meaningful behavior.
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+ public class XSFunctionFilter<T> implements XSFunction<T> {
+-    
++
+     /** This object will receive all forwarded calls. */
+     protected XSFunction<T> core;
+-    
++
+     public XSFunctionFilter( XSFunction<T> _core ) {
+         this.core = _core;
+     }
+-    
++
+     public XSFunctionFilter() {}
+-    
++
+     public T annotation(XSAnnotation ann) {
+         return core.annotation(ann);
+     }
+@@ -76,7 +78,7 @@
+     public T attributeDecl(XSAttributeDecl decl) {
+         return core.attributeDecl(decl);
+     }
+-    
++
+     public T attributeUse(XSAttributeUse use) {
+         return core.attributeUse(use);
+     }
+--- old/src/share/classes/com/sun/xml/internal/xsom/visitor/XSContentTypeFunction.java	Thu Jul 30 18:46:53 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/visitor/XSContentTypeFunction.java	Thu Jul 30 18:46:52 2009
+@@ -22,6 +22,8 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom.visitor;
+ 
+ import com.sun.xml.internal.xsom.XSContentType;
+@@ -30,7 +32,7 @@
+ 
+ /**
+  * Function object that works on {@link XSContentType}.
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+@@ -39,4 +41,3 @@
+     T particle( XSParticle particle );
+     T empty( XSContentType empty );
+ }
+-
+--- old/src/share/classes/com/sun/xml/internal/xsom/visitor/XSContentTypeVisitor.java	Thu Jul 30 18:46:56 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/visitor/XSContentTypeVisitor.java	Thu Jul 30 18:46:56 2009
+@@ -22,6 +22,8 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom.visitor;
+ 
+ import com.sun.xml.internal.xsom.XSContentType;
+@@ -30,7 +32,7 @@
+ 
+ /**
+  * Visitor that works on {@link XSContentType}.
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+--- old/src/share/classes/com/sun/xml/internal/xsom/visitor/XSFunction.java	Thu Jul 30 18:47:00 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/visitor/XSFunction.java	Thu Jul 30 18:46:59 2009
+@@ -22,6 +22,8 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom.visitor;
+ 
+ import com.sun.xml.internal.xsom.XSAnnotation;
+@@ -39,12 +41,12 @@
+ 
+ /**
+  * Function object that works on the entire XML Schema components.
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+ public interface XSFunction<T> extends XSContentTypeFunction<T>, XSTermFunction<T> {
+-        
++
+     T annotation( XSAnnotation ann );
+     T attGroupDecl( XSAttGroupDecl decl );
+     T attributeDecl( XSAttributeDecl decl );
+--- old/src/share/classes/com/sun/xml/internal/xsom/visitor/XSSimpleTypeFunction.java	Thu Jul 30 18:47:03 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/visitor/XSSimpleTypeFunction.java	Thu Jul 30 18:47:02 2009
+@@ -22,6 +22,8 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom.visitor;
+ 
+ import com.sun.xml.internal.xsom.XSListSimpleType;
+@@ -31,7 +33,7 @@
+ /**
+  * Function object that works on {@link com.sun.xml.internal.xsom.XSSimpleType}
+  * and its derived interfaces.
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke,kawaguchi@sun.com)
+  */
+@@ -40,4 +42,3 @@
+     T unionSimpleType( XSUnionSimpleType type );
+     T restrictionSimpleType( XSRestrictionSimpleType type );
+ }
+-
+--- old/src/share/classes/com/sun/xml/internal/xsom/visitor/XSSimpleTypeVisitor.java	Thu Jul 30 18:47:06 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/visitor/XSSimpleTypeVisitor.java	Thu Jul 30 18:47:06 2009
+@@ -22,6 +22,8 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom.visitor;
+ 
+ import com.sun.xml.internal.xsom.XSListSimpleType;
+@@ -31,7 +33,7 @@
+ /**
+  * Visitor that works on {@link com.sun.xml.internal.xsom.XSSimpleType}
+  * and its derived interfaces.
+- * 
++ *
+  * @author
+  *  Kohsuke Kawaguchi (kohsuke,kawaguchi@sun.com)
+  */
+--- old/src/share/classes/com/sun/xml/internal/xsom/visitor/XSTermFunction.java	Thu Jul 30 18:47:10 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/visitor/XSTermFunction.java	Thu Jul 30 18:47:09 2009
+@@ -22,6 +22,8 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom.visitor;
+ 
+ import com.sun.xml.internal.xsom.XSElementDecl;
+@@ -32,7 +34,7 @@
+ 
+ /**
+  * Function object that works on {@link XSTerm}.
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+@@ -42,4 +44,3 @@
+     T modelGroup( XSModelGroup group );
+     T elementDecl( XSElementDecl decl );
+ }
+-
+--- old/src/share/classes/com/sun/xml/internal/xsom/visitor/XSTermFunctionWithParam.java	Thu Jul 30 18:47:13 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/visitor/XSTermFunctionWithParam.java	Thu Jul 30 18:47:13 2009
+@@ -22,6 +22,7 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
+ package com.sun.xml.internal.xsom.visitor;
+ 
+ import com.sun.xml.internal.xsom.XSWildcard;
+--- old/src/share/classes/com/sun/xml/internal/xsom/visitor/XSTermVisitor.java	Thu Jul 30 18:47:17 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/visitor/XSTermVisitor.java	Thu Jul 30 18:47:16 2009
+@@ -22,6 +22,8 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom.visitor;
+ 
+ import com.sun.xml.internal.xsom.XSElementDecl;
+@@ -31,7 +33,7 @@
+ 
+ /**
+  * Visitor that works on {@link com.sun.xml.internal.xsom.XSTerm}.
+- * 
++ *
+  * @author
+  *  Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+--- old/src/share/classes/com/sun/xml/internal/xsom/visitor/XSVisitor.java	Thu Jul 30 18:47:20 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/visitor/XSVisitor.java	Thu Jul 30 18:47:20 2009
+@@ -22,6 +22,8 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom.visitor;
+ 
+ import com.sun.xml.internal.xsom.XSAnnotation;
+--- old/src/share/classes/com/sun/xml/internal/xsom/visitor/XSWildcardFunction.java	Thu Jul 30 18:47:24 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/visitor/XSWildcardFunction.java	Thu Jul 30 18:47:23 2009
+@@ -22,6 +22,8 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom.visitor;
+ 
+ import com.sun.xml.internal.xsom.XSWildcard;
+@@ -28,7 +30,7 @@
+ 
+ /**
+  * Visits three kinds of {@link XSWildcard}.
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+--- old/src/share/classes/com/sun/xml/internal/xsom/visitor/XSWildcardVisitor.java	Thu Jul 30 18:47:27 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/visitor/XSWildcardVisitor.java	Thu Jul 30 18:47:26 2009
+@@ -22,6 +22,8 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
++
++
+ package com.sun.xml.internal.xsom.visitor;
+ 
+ import com.sun.xml.internal.xsom.XSWildcard;
+@@ -28,7 +30,7 @@
+ 
+ /**
+  * Visits three kinds of {@link XSWildcard}.
+- * 
++ *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+--- old/src/share/classes/com/sun/xml/internal/xsom/visitor/package.html	Thu Jul 30 18:47:30 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/xsom/visitor/package.html	Thu Jul 30 18:47:30 2009
+@@ -23,5 +23,5 @@
+  have any questions.
+ -->
+ <html><body>
+-Visitor pattern support for the <code>com.sun.xml.xsom</code> interfaces.
++Visitor pattern support for the <code>com.sun.xml.internal.xsom</code> interfaces.
+ </body></html>
+--- old/src/share/classes/javax/xml/bind/Binder.java	Thu Jul 30 18:47:34 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/bind/Binder.java	Thu Jul 30 18:47:33 2009
+@@ -30,23 +30,23 @@
+ import javax.xml.validation.Schema;
+ 
+ /**
+- * Enable synchronization between XML infoset nodes and JAXB objects 
++ * Enable synchronization between XML infoset nodes and JAXB objects
+  * representing same XML document.
+  *
+  * <p>
+  * An instance of this class maintains the association between XML nodes of
+- * an infoset preserving view and a JAXB representation of an XML document. 
++ * an infoset preserving view and a JAXB representation of an XML document.
+  * Navigation between the two views is provided by the methods
+  * {@link #getXMLNode(Object)} and {@link #getJAXBNode(Object)}.
+- * 
++ *
+  * <p>
+- * Modifications can be made to either the infoset preserving view or the 
+- * JAXB representation of the document while the other view remains 
+- * unmodified. The binder is able to synchronize the changes made in the 
++ * Modifications can be made to either the infoset preserving view or the
++ * JAXB representation of the document while the other view remains
++ * unmodified. The binder is able to synchronize the changes made in the
+  * modified view back into the other view using the appropriate
+- * Binder update methods, {@link #updateXML(Object, Object)} or 
++ * Binder update methods, {@link #updateXML(Object, Object)} or
+  * {@link #updateJAXB(Object)}.
+- * 
++ *
+  * <p>
+  * A typical usage scenario is the following:
+  * <ul>
+@@ -55,13 +55,13 @@
+  *       (Note to conserve resources, it is possible to only unmarshal a
+  *       subtree of the XML infoset view to the JAXB view.)</li>
+  *   <li>application access/updates JAXB view of XML document.</li>
+- *   <li>{@link #updateXML(Object)} synchronizes modifications to JAXB view 
+- *       back into the XML infoset view. Update operation preserves as 
++ *   <li>{@link #updateXML(Object)} synchronizes modifications to JAXB view
++ *       back into the XML infoset view. Update operation preserves as
+  *       much of original XML infoset as possible (i.e. comments, PI, ...)</li>
+  * </ul>
+- * 
++ *
+  * <p>
+- * A Binder instance is created using the factory method 
++ * A Binder instance is created using the factory method
+  * {@link JAXBContext#createBinder()} or {@link JAXBContext#createBinder(Class)}.
+  *
+  * <p>
+@@ -68,14 +68,14 @@
+  * The template parameter, <code>XmlNode</code>, is the
+  * root interface/class for the XML infoset preserving representation.
+  * A Binder implementation is required to minimally support
+- * an <code>XmlNode</code> value of <code>org.w3c.dom.Node.class</code>. 
+- * A Binder implementation can support alternative XML infoset 
++ * an <code>XmlNode</code> value of <code>org.w3c.dom.Node.class</code>.
++ * A Binder implementation can support alternative XML infoset
+  * preserving representations.
+  *
+  * @author
+  *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  *     Joseph Fialli
+- * 
++ *
+  * @since JAXB 2.0
+  */
+ public abstract class Binder<XmlNode> {
+@@ -84,7 +84,7 @@
+      *
+      * <p>
+      * This method is similar to {@link Unmarshaller#unmarshal(Node)}
+-     * with the addition of maintaining the association between XML nodes 
++     * with the addition of maintaining the association between XML nodes
+      * and the produced JAXB objects, enabling future update operations,
+      * {@link #updateXML(Object, Object)} or {@link #updateJAXB(Object)}.
+      *
+@@ -96,11 +96,11 @@
+      * This method throws {@link UnmarshalException} when the Binder's
+      * {@link JAXBContext} does not have a mapping for the XML element name
+      * or the type, specifiable via <tt>@xsi:type</tt>, of <tt>xmlNode</tt>
+-     * to a JAXB mapped class. The method {@link #unmarshal(Object, Class)} 
++     * to a JAXB mapped class. The method {@link #unmarshal(Object, Class)}
+      * enables an application to specify the JAXB mapped class that
+-     * the <tt>xmlNode</tt> should be mapped to. 
++     * the <tt>xmlNode</tt> should be mapped to.
+      *
+-     * @param xmlNode 
++     * @param xmlNode
+      *      the document/element to unmarshal XML data from.
+      *
+      * @return
+@@ -110,7 +110,7 @@
+      *      If any unexpected errors occur while unmarshalling
+      * @throws UnmarshalException
+      *     If the {@link ValidationEventHandler ValidationEventHandler}
+-     *     returns false from its <tt>handleEvent</tt> method or the 
++     *     returns false from its <tt>handleEvent</tt> method or the
+      *     <tt>Binder</tt> is unable to perform the XML to Java
+      *     binding.
+      * @throws IllegalArgumentException
+@@ -119,15 +119,15 @@
+     public abstract Object unmarshal( XmlNode xmlNode ) throws JAXBException;
+ 
+     /**
+-     * Unmarshal XML root element by provided <tt>declaredType</tt> 
++     * Unmarshal XML root element by provided <tt>declaredType</tt>
+      * to a JAXB object tree.
+      *
+      * <p>
+      * Implements <a href="Unmarshaller.html#unmarshalByDeclaredType">Unmarshal by Declared Type</a>
+-     * 
++     *
+      * <p>
+      * This method is similar to {@link Unmarshaller#unmarshal(Node, Class)}
+-     * with the addition of maintaining the association between XML nodes 
++     * with the addition of maintaining the association between XML nodes
+      * and the produced JAXB objects, enabling future update operations,
+      * {@link #updateXML(Object, Object)} or {@link #updateJAXB(Object)}.
+      *
+@@ -135,13 +135,13 @@
+      * When {@link #getSchema()} is non-null, <code>xmlNode</code>
+      * and its descendants is validated during this operation.
+      *
+-     * @param xmlNode 
++     * @param xmlNode
+      *      the document/element to unmarshal XML data from.
+      * @param declaredType
+      *      appropriate JAXB mapped class to hold <tt>node</tt>'s XML data.
+      *
+      * @return
+-     * <a href="#unmarshalDeclaredTypeReturn">JAXB Element</a> representation 
++     * <a href="#unmarshalDeclaredTypeReturn">JAXB Element</a> representation
+      * of <tt>node</tt>
+      *
+      * @throws JAXBException
+@@ -148,7 +148,7 @@
+      *      If any unexpected errors occur while unmarshalling
+      * @throws UnmarshalException
+      *     If the {@link ValidationEventHandler ValidationEventHandler}
+-     *     returns false from its <tt>handleEvent</tt> method or the 
++     *     returns false from its <tt>handleEvent</tt> method or the
+      *     <tt>Binder</tt> is unable to perform the XML to Java
+      *     binding.
+      * @throws IllegalArgumentException
+@@ -155,9 +155,9 @@
+      *      If any of the input parameters are null
+      * @since JAXB2.0
+      */
+-    public abstract <T> JAXBElement<T> 
+-	unmarshal( XmlNode xmlNode, Class<T> declaredType ) 
+-	throws JAXBException;
++    public abstract <T> JAXBElement<T>
++        unmarshal( XmlNode xmlNode, Class<T> declaredType )
++        throws JAXBException;
+ 
+     /**
+      * Marshal a JAXB object tree to a new XML document.
+@@ -164,9 +164,9 @@
+      *
+      * <p>
+      * This method is similar to {@link Marshaller#marshal(Object, Node)}
+-     * with the addition of maintaining the association between JAXB objects 
++     * with the addition of maintaining the association between JAXB objects
+      * and the produced XML nodes,
+-     * enabling future update operations such as 
++     * enabling future update operations such as
+      * {@link #updateXML(Object, Object)} or {@link #updateJAXB(Object)}.
+      *
+      * <p>
+@@ -174,7 +174,7 @@
+      * xml content is validated during this operation.
+      *
+      * @param jaxbObject
+-     *      The content tree to be marshalled. 
++     *      The content tree to be marshalled.
+      * @param xmlNode
+      *      The parameter must be a Node that accepts children.
+      *
+@@ -182,10 +182,10 @@
+      *      If any unexpected problem occurs during the marshalling.
+      * @throws MarshalException
+      *      If the {@link ValidationEventHandler ValidationEventHandler}
+-     *      returns false from its <tt>handleEvent</tt> method or the 
+-     *      <tt>Binder</tt> is unable to marshal <tt>jaxbObject</tt> (or any 
++     *      returns false from its <tt>handleEvent</tt> method or the
++     *      <tt>Binder</tt> is unable to marshal <tt>jaxbObject</tt> (or any
+      *      object reachable from <tt>jaxbObject</tt>).
+-     * 
++     *
+      * @throws IllegalArgumentException
+      *      If any of the method parameters are null
+      */
+@@ -205,7 +205,7 @@
+      * have associated JAXB objects, and not all JAXB objects have
+      * associated XML elements.
+      *
+-     * @param jaxbObject An instance that is reachable from a prior 
++     * @param jaxbObject An instance that is reachable from a prior
+      *                   call to a bind or update method that returned
+      *                   a JAXB object tree.
+      *
+@@ -315,7 +315,7 @@
+      *      but it maybe
+      *      a different object, for example when the name of the XML
+      *      element has changed.
+-     * 
++     *
+      * @throws JAXBException
+      *      If any unexpected problem occurs updating corresponding JAXB mapped content.
+      * @throws IllegalArgumentException
+@@ -347,8 +347,8 @@
+      * <p>
+      * The <tt>ValidationEventHandler</tt> will be called by the JAXB Provider
+      * if any validation errors are encountered during calls to any of the
+-     * Binder unmarshal, marshal and update methods.  
+-     * 
++     * Binder unmarshal, marshal and update methods.
++     *
+      * <p>
+      * Calling this method with a null parameter will cause the Binder
+      * to revert back to the default default event handler.
+@@ -371,13 +371,13 @@
+     public abstract ValidationEventHandler getEventHandler() throws JAXBException;
+ 
+     /**
+-     * 
++     *
+      * Set the particular property in the underlying implementation of
+      * <tt>Binder</tt>.  This method can only be used to set one of
+-     * the standard JAXB defined unmarshal/marshal properties 
++     * the standard JAXB defined unmarshal/marshal properties
+      * or a provider specific property for binder, unmarshal or marshal.
+      * Attempting to set an undefined property will result in
+-     * a PropertyException being thrown.  See 
++     * a PropertyException being thrown.  See
+      * <a href="Unmarshaller.html#supportedProps">Supported Unmarshal Properties</a>
+      * and
+      * <a href="Marshaller.html#supportedProps">Supported Marshal Properties</a>.
+@@ -397,12 +397,12 @@
+ 
+     /**
+      * Get the particular property in the underlying implementation of
+-     * <tt>Binder</tt>.  This method can only 
++     * <tt>Binder</tt>.  This method can only
+      * be used to get one of
+-     * the standard JAXB defined unmarshal/marshal properties 
+-     * or a provider specific property for binder, unmarshal or marshal.  
++     * the standard JAXB defined unmarshal/marshal properties
++     * or a provider specific property for binder, unmarshal or marshal.
+      * Attempting to get an undefined property will result in
+-     * a PropertyException being thrown.  See 
++     * a PropertyException being thrown.  See
+      * <a href="Unmarshaller.html#supportedProps">Supported Unmarshal Properties</a>
+      * and
+      * <a href="Marshaller.html#supportedProps">Supported Marshal Properties</a>.
+--- old/src/share/classes/javax/xml/bind/ContextFinder.java	Thu Jul 30 18:47:37 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/bind/ContextFinder.java	Thu Jul 30 18:47:37 2009
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright 2005-2008 Sun Microsystems, Inc.  All Rights Reserved.
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+  * 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,13 +47,13 @@
+ //import java.lang.reflect.InvocationTargetException;
+ 
+ /**
+- * This class is package private and therefore is not exposed as part of the 
++ * This class is package private and therefore is not exposed as part of the
+  * JAXB API.
+  *
+  * This code is designed to implement the JAXB 1.0 spec pluggability feature
+  *
+  * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li></ul>
+- * @version $Revision$
++ * @version $Revision: 1.27.2.1 $
+  * @see JAXBContext
+  */
+ class ContextFinder {
+@@ -124,7 +124,7 @@
+      * Create an instance of a class using the specified ClassLoader
+      */
+     static JAXBContext newInstance( String contextPath,
+-                               String className, 
++                               String className,
+                                ClassLoader classLoader,
+                                Map properties )
+         throws JAXBException
+@@ -289,7 +289,7 @@
+             final StringBuilder resource = new StringBuilder().append("META-INF/services/").append(jaxbContextFQCN);
+             final InputStream resourceStream =
+                     classLoader.getResourceAsStream(resource.toString());
+-            
++
+             if (resourceStream != null) {
+                 r = new BufferedReader(new InputStreamReader(resourceStream, "UTF-8"));
+                 factoryClassName = r.readLine().trim();
+@@ -398,11 +398,11 @@
+ 
+ 
+     private static Properties loadJAXBProperties( ClassLoader classLoader,
+-                                                  String propFileName ) 
++                                                  String propFileName )
+         throws JAXBException {
+-                                            
++
+         Properties props = null;
+-                                                    
++
+         try {
+             URL url;
+             if(classLoader==null)
+@@ -416,12 +416,12 @@
+                 InputStream is = url.openStream();
+                 props.load( is );
+                 is.close();
+-            } 
++            }
+         } catch( IOException ioe ) {
+             logger.log(Level.FINE,"Unable to load "+propFileName,ioe);
+             throw new JAXBException( ioe.toString(), ioe );
+         }
+-        
++
+         return props;
+     }
+ 
+@@ -484,26 +484,29 @@
+      * Loads the class, provided that the calling thread has an access to the class being loaded.
+      */
+     private static Class safeLoadClass(String className, ClassLoader classLoader) throws ClassNotFoundException {
+-        logger.fine("Trying to load "+className);
+-        try {
+-            // make sure that the current thread has an access to the package of the given name.
+-            SecurityManager s = System.getSecurityManager();
+-            if (s != null) {
+-                int i = className.lastIndexOf('.');
+-                if (i != -1) {
+-                    s.checkPackageAccess(className.substring(0,i));
+-                }
+-            }
++       logger.fine("Trying to load "+className);
++       try {
++          // make sure that the current thread has an access to the package of the given name.
++          SecurityManager s = System.getSecurityManager();
++          if (s != null) {
++              int i = className.lastIndexOf('.');
++              if (i != -1) {
++                  s.checkPackageAccess(className.substring(0,i));
++              }
++          }
+ 
+-            if (classLoader == null)
+-                return Class.forName(className);
+-            else
+-                return classLoader.loadClass(className);
+-        } catch (SecurityException se) {
+-            // anyone can access the platform default factory class without permission
+-            if (PLATFORM_DEFAULT_FACTORY_CLASS.equals(className))
+-                return Class.forName(className);
+-            throw se;
+-        }
++          if (classLoader == null) {
++              return Class.forName(className);
++          } else {
++              return classLoader.loadClass(className);
++          }
++       } catch (SecurityException se) {
++           // anyone can access the platform default factory class without permission
++           if (PLATFORM_DEFAULT_FACTORY_CLASS.equals(className)) {
++              return Class.forName(className);
++           }
++           throw se;
++       }
+     }
++
+ }
+--- old/src/share/classes/javax/xml/bind/DatatypeConverter.java	Thu Jul 30 18:47:41 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/bind/DatatypeConverter.java	Thu Jul 30 18:47:40 2009
+@@ -29,29 +29,29 @@
+ 
+ /**
+  * <p>
+- * The javaType binding declaration can be used to customize the binding of 
+- * an XML schema datatype to a Java datatype. Customizations can involve 
+- * writing a parse and print method for parsing and printing lexical 
+- * representations of a XML schema datatype respectively. However, writing 
+- * parse and print methods requires knowledge of the lexical representations ( 
+- * <a href="http://www.w3.org/TR/xmlschema-2/"> XML Schema Part2: Datatypes 
+- * specification </a>) and hence may be difficult to write. 
++ * The javaType binding declaration can be used to customize the binding of
++ * an XML schema datatype to a Java datatype. Customizations can involve
++ * writing a parse and print method for parsing and printing lexical
++ * representations of a XML schema datatype respectively. However, writing
++ * parse and print methods requires knowledge of the lexical representations (
++ * <a href="http://www.w3.org/TR/xmlschema-2/"> XML Schema Part2: Datatypes
++ * specification </a>) and hence may be difficult to write.
+  * </p>
+  * <p>
+  * This class makes it easier to write parse and print methods. It defines
+- * static parse and print methods that provide access to a JAXB provider's 
+- * implementation of parse and print methods. These methods are invoked by 
+- * custom parse and print methods. For example, the binding of xsd:dateTime 
++ * static parse and print methods that provide access to a JAXB provider's
++ * implementation of parse and print methods. These methods are invoked by
++ * custom parse and print methods. For example, the binding of xsd:dateTime
+  * to a long can be customized using parse and print methods as follows:
+  * <blockquote>
+  *    <pre>
+- *    // Customized parse method 
++ *    // Customized parse method
+  *    public long myParseCal( String dateTimeString ) {
+  *        java.util.Calendar cal = DatatypeConverter.parseDateTime(dateTimeString);
+  *        long longval = convert_calendar_to_long(cal); //application specific
+  *        return longval;
+  *    }
+- *     
++ *
+  *    // Customized print method
+  *    public String myPrintCal( Long longval ) {
+  *        java.util.Calendar cal = convert_long_to_calendar(longval) ; //application specific
+@@ -61,31 +61,31 @@
+  *    </pre>
+  * </blockquote>
+  * <p>
+- * There is a static parse and print method corresponding to each parse and 
+- * print method respectively in the {@link DatatypeConverterInterface 
+- * DatatypeConverterInterface}. 
++ * There is a static parse and print method corresponding to each parse and
++ * print method respectively in the {@link DatatypeConverterInterface
++ * DatatypeConverterInterface}.
+  * <p>
+  * The static methods defined in the class can also be used to specify
+  * a parse or a print method in a javaType binding declaration.
+  * </p>
+  * <p>
+- * JAXB Providers are required to call the 
+- * {@link #setDatatypeConverter(DatatypeConverterInterface) 
+- * setDatatypeConverter} api at some point before the first marshal or unmarshal 
+- * operation (perhaps during the call to JAXBContext.newInstance).  This step is 
+- * necessary to configure the converter that should be used to perform the 
+- * print and parse functionality.  
++ * JAXB Providers are required to call the
++ * {@link #setDatatypeConverter(DatatypeConverterInterface)
++ * setDatatypeConverter} api at some point before the first marshal or unmarshal
++ * operation (perhaps during the call to JAXBContext.newInstance).  This step is
++ * necessary to configure the converter that should be used to perform the
++ * print and parse functionality.
+  * </p>
+- * 
++ *
+  * <p>
+- * A print method for a XML schema datatype can output any lexical 
++ * A print method for a XML schema datatype can output any lexical
+  * representation that is valid with respect to the XML schema datatype.
+  * If an error is encountered during conversion, then an IllegalArgumentException,
+  * or a subclass of IllegalArgumentException must be thrown by the method.
+  * </p>
+- * 
++ *
+  * @author <ul><li>Sekhar Vajjhala, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems Inc.</li><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Ryan Shoemaker,Sun Microsystems Inc.</li></ul>
+- * @version $Revision$
++ * @version $Revision: 1.4 $
+  * @see DatatypeConverterInterface
+  * @see ParseConversionEvent
+  * @see PrintConversionEvent
+@@ -96,31 +96,31 @@
+ 
+     // delegate to this instance of DatatypeConverter
+     private static DatatypeConverterInterface theConverter = new DatatypeConverterImpl();
+-        
++
+     private DatatypeConverter() {
+         // private constructor
+     }
+-    
++
+     /**
+      * This method is for JAXB provider use only.
+      * <p>
+      * JAXB Providers are required to call this method at some point before
+      * allowing any of the JAXB client marshal or unmarshal operations to
+-     * occur.  This is necessary to configure the datatype converter that 
++     * occur.  This is necessary to configure the datatype converter that
+      * should be used to perform the print and parse conversions.
+-     * 
++     *
+      * <p>
+-     * Calling this api repeatedly will have no effect - the 
+-     * DatatypeConverterInterface instance passed into the first invocation is 
++     * Calling this api repeatedly will have no effect - the
++     * DatatypeConverterInterface instance passed into the first invocation is
+      * the one that will be used from then on.
+-     * 
+-     * @param converter an instance of a class that implements the 
++     *
++     * @param converter an instance of a class that implements the
+      * DatatypeConverterInterface class - this parameter must not be null.
+      * @throws IllegalArgumentException if the parameter is null
+      */
+     public static void setDatatypeConverter( DatatypeConverterInterface converter ) {
+         if( converter == null ) {
+-            throw new IllegalArgumentException( 
++            throw new IllegalArgumentException(
+                 Messages.format( Messages.CONVERTER_MUST_NOT_BE_NULL ) );
+         } else if( theConverter == null ) {
+             theConverter = converter;
+@@ -135,7 +135,7 @@
+      *     xsd:string.
+      * @return
+      *     A String value represented by the string argument.
+-     */ 
++     */
+     public static String parseString( String lexicalXSDString ) {
+         return theConverter.parseString( lexicalXSDString );
+     }
+@@ -149,7 +149,7 @@
+      * @return
+      *     A BigInteger value represented by the string argument.
+      * @throws NumberFormatException <code>lexicalXSDInteger</code> is not a valid string representation of a {@link java.math.BigInteger} value.
+-     */ 
++     */
+     public static java.math.BigInteger parseInteger( String lexicalXSDInteger ) {
+         return theConverter.parseInteger( lexicalXSDInteger );
+     }
+@@ -163,7 +163,7 @@
+      * @return
+      *     A int value represented by the string argument.
+      * @throws NumberFormatException <code>lexicalXSDInt</code> is not a valid string representation of an <code>int</code> value.
+-     */ 
++     */
+     public static int parseInt( String lexicalXSDInt ) {
+         return theConverter.parseInt( lexicalXSDInt );
+     }
+@@ -177,7 +177,7 @@
+      * @return
+      *     A long value represented by the string argument.
+      * @throws NumberFormatException <code>lexicalXSDLong</code> is not a valid string representation of a <code>long</code> value.
+-     */ 
++     */
+     public static long parseLong( String lexicalXSDLong ) {
+         return theConverter.parseLong( lexicalXSDLong );
+     }
+@@ -191,8 +191,8 @@
+      * @return
+      *     A short value represented by the string argument.
+      * @throws NumberFormatException <code>lexicalXSDShort</code> is not a valid string representation of a <code>short</code> value.
+-     */ 
+-    public static short parseShort( String lexicalXSDShort ) { 
++     */
++    public static short parseShort( String lexicalXSDShort ) {
+         return theConverter.parseShort( lexicalXSDShort );
+     }
+ 
+@@ -205,7 +205,7 @@
+      * @return
+      *     A BigDecimal value represented by the string argument.
+      * @throws NumberFormatException <code>lexicalXSDDecimal</code> is not a valid string representation of {@link java.math.BigDecimal}.
+-     */ 
++     */
+     public static java.math.BigDecimal parseDecimal( String lexicalXSDDecimal ) {
+         return theConverter.parseDecimal( lexicalXSDDecimal );
+     }
+@@ -219,7 +219,7 @@
+      * @return
+      *     A float value represented by the string argument.
+      * @throws NumberFormatException <code>lexicalXSDFloat</code> is not a valid string representation of a <code>float</code> value.
+-     */ 
++     */
+     public static float parseFloat( String lexicalXSDFloat ) {
+         return theConverter.parseFloat( lexicalXSDFloat );
+     }
+@@ -233,8 +233,8 @@
+      * @return
+      *     A double value represented by the string argument.
+      * @throws NumberFormatException <code>lexicalXSDDouble</code> is not a valid string representation of a <code>double</code> value.
+-     */ 
+-    public static double parseDouble( String lexicalXSDDouble ) { 
++     */
++    public static double parseDouble( String lexicalXSDDouble ) {
+         return theConverter.parseDouble( lexicalXSDDouble );
+     }
+ 
+@@ -247,7 +247,7 @@
+      * @return
+      *     A boolean value represented by the string argument.
+      * @throws IllegalArgumentException if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:boolean.
+-     */ 
++     */
+     public static boolean parseBoolean( String lexicalXSDBoolean ) {
+         return theConverter.parseBoolean( lexicalXSDBoolean );
+     }
+@@ -261,8 +261,8 @@
+      * @return
+      *     A byte value represented by the string argument.
+      * @throws IllegalArgumentException if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:byte.
+-     */ 
+-    public static byte parseByte( String lexicalXSDByte ) { 
++     */
++    public static byte parseByte( String lexicalXSDByte ) {
+         return theConverter.parseByte( lexicalXSDByte );
+     }
+ 
+@@ -271,9 +271,9 @@
+      * Converts the string argument into a byte value.
+      *
+      * <p>
+-     * String parameter <tt>lexicalXSDQname</tt> must conform to lexical value space specifed at 
++     * String parameter <tt>lexicalXSDQname</tt> must conform to lexical value space specifed at
+      * <a href="http://www.w3.org/TR/xmlschema-2/#QName">XML Schema Part 2:Datatypes specification:QNames</a>
+-     * 
++     *
+      * @param lexicalXSDQName
+      *     A string containing lexical representation of xsd:QName.
+      * @param nsc
+@@ -280,11 +280,11 @@
+      *     A namespace context for interpreting a prefix within a QName.
+      * @return
+      *     A QName value represented by the string argument.
+-     * @throws IllegalArgumentException  if string parameter does not conform to XML Schema Part 2 specification or 
++     * @throws IllegalArgumentException  if string parameter does not conform to XML Schema Part 2 specification or
+      *      if namespace prefix of <tt>lexicalXSDQname</tt> is not bound to a URI in NamespaceContext <tt>nsc</tt>.
+-     */ 
++     */
+     public static javax.xml.namespace.QName parseQName( String lexicalXSDQName,
+-    				                    NamespaceContext nsc) {
++                                                    NamespaceContext nsc) {
+         return theConverter.parseQName( lexicalXSDQName, nsc );
+     }
+ 
+@@ -297,7 +297,7 @@
+      * @return
+      *     A Calendar object represented by the string argument.
+      * @throws IllegalArgumentException if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:dateTime.
+-     */ 
++     */
+     public static java.util.Calendar parseDateTime( String lexicalXSDDateTime ) {
+         return theConverter.parseDateTime( lexicalXSDDateTime );
+     }
+@@ -311,7 +311,7 @@
+      * @return
+      *     An array of bytes represented by the string argument.
+      * @throws IllegalArgumentException if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:base64Binary
+-     */ 
++     */
+     public static byte[] parseBase64Binary( String lexicalXSDBase64Binary ) {
+         return theConverter.parseBase64Binary( lexicalXSDBase64Binary );
+     }
+@@ -325,7 +325,7 @@
+      * @return
+      *     An array of bytes represented by the string argument.
+      * @throws IllegalArgumentException if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:hexBinary.
+-     */ 
++     */
+    public static byte[] parseHexBinary( String lexicalXSDHexBinary ) {
+         return theConverter.parseHexBinary( lexicalXSDHexBinary );
+     }
+@@ -339,7 +339,7 @@
+      * @return
+      *     A long value represented by the string argument.
+      * @throws NumberFormatException if string parameter can not be parsed into a <tt>long</tt> value.
+-     */ 
++     */
+     public static long parseUnsignedInt( String lexicalXSDUnsignedInt ) {
+         return theConverter.parseUnsignedInt( lexicalXSDUnsignedInt );
+     }
+@@ -353,8 +353,8 @@
+      * @return
+      *     An int value represented by the string argument.
+      * @throws NumberFormatException if string parameter can not be parsed into an <tt>int</tt> value.
+-     */ 
+-    public static int	parseUnsignedShort( String lexicalXSDUnsignedShort ) {
++     */
++    public static int   parseUnsignedShort( String lexicalXSDUnsignedShort ) {
+         return theConverter.parseUnsignedShort( lexicalXSDUnsignedShort );
+     }
+ 
+@@ -367,9 +367,9 @@
+      * @return
+      *     A Calendar value represented by the string argument.
+      * @throws IllegalArgumentException if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:Time.
+-     */ 
++     */
+     public static java.util.Calendar parseTime( String lexicalXSDTime ) {
+-        return theConverter.parseTime( lexicalXSDTime ); 
++        return theConverter.parseTime( lexicalXSDTime );
+     }
+     /**
+      * <p>
+@@ -380,7 +380,7 @@
+      * @return
+      *     A Calendar value represented by the string argument.
+      * @throws IllegalArgumentException if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:Date.
+-     */ 
++     */
+     public static java.util.Calendar parseDate( String lexicalXSDDate ) {
+         return theConverter.parseDate( lexicalXSDDate );
+     }
+@@ -387,15 +387,15 @@
+ 
+     /**
+      * <p>
+-     * Return a string containing the lexical representation of the 
++     * Return a string containing the lexical representation of the
+      * simple type.
+      * @param lexicalXSDAnySimpleType
+      *     A string containing lexical
+      *     representation of the simple type.
+      * @return
+-     *     A string containing the lexical representation of the 
++     *     A string containing the lexical representation of the
+      *     simple type.
+-     */ 
++     */
+     public static String parseAnySimpleType( String lexicalXSDAnySimpleType ) {
+         return theConverter.parseAnySimpleType( lexicalXSDAnySimpleType );
+     }
+@@ -406,10 +406,10 @@
+      *     A string value.
+      * @return
+      *     A string containing a lexical representation of xsd:string.
+-     */ 
++     */
+      // also indicate the print methods produce a lexical
+      // representation for given Java datatypes.
+-	
++
+     public static String printString( String val ) {
+         return theConverter.printString( val );
+     }
+@@ -422,7 +422,7 @@
+      * @return
+      *     A string containing a lexical representation of xsd:integer
+      * @throws IllegalArgumentException <tt>val</tt> is null.
+-     */ 
++     */
+     public static String printInteger( java.math.BigInteger val ) {
+         return theConverter.printInteger( val );
+     }
+@@ -434,7 +434,7 @@
+      *     An int value
+      * @return
+      *     A string containing a lexical representation of xsd:int
+-     */ 
++     */
+     public static String printInt( int val ) {
+         return theConverter.printInt( val );
+     }
+@@ -446,7 +446,7 @@
+      *     A long value
+      * @return
+      *     A string containing a lexical representation of xsd:long
+-     */ 
++     */
+     public static String printLong( long val ) {
+         return theConverter.printLong( val );
+     }
+@@ -458,7 +458,7 @@
+      *     A short value
+      * @return
+      *     A string containing a lexical representation of xsd:short
+-     */ 
++     */
+     public static String printShort( short val ) {
+         return theConverter.printShort( val );
+     }
+@@ -471,7 +471,7 @@
+      * @return
+      *     A string containing a lexical representation of xsd:decimal
+      * @throws IllegalArgumentException <tt>val</tt> is null.
+-     */ 
++     */
+     public static String printDecimal( java.math.BigDecimal val ) {
+         return theConverter.printDecimal( val );
+     }
+@@ -483,7 +483,7 @@
+      *     A float value
+      * @return
+      *     A string containing a lexical representation of xsd:float
+-     */ 
++     */
+     public static String printFloat( float val ) {
+         return theConverter.printFloat( val );
+     }
+@@ -495,7 +495,7 @@
+      *     A double value
+      * @return
+      *     A string containing a lexical representation of xsd:double
+-     */ 
++     */
+     public static String printDouble( double val ) {
+         return theConverter.printDouble( val );
+     }
+@@ -507,7 +507,7 @@
+      *     A boolean value
+      * @return
+      *     A string containing a lexical representation of xsd:boolean
+-     */ 
++     */
+     public static String printBoolean( boolean val ) {
+         return theConverter.printBoolean( val );
+     }
+@@ -519,7 +519,7 @@
+      *     A byte value
+      * @return
+      *     A string containing a lexical representation of xsd:byte
+-     */ 
++     */
+     public static String printByte( byte val ) {
+         return theConverter.printByte( val );
+     }
+@@ -533,9 +533,9 @@
+      *     A namespace context for interpreting a prefix within a QName.
+      * @return
+      *     A string containing a lexical representation of QName
+-     * @throws IllegalArgumentException if <tt>val</tt> is null or 
++     * @throws IllegalArgumentException if <tt>val</tt> is null or
+      * if <tt>nsc</tt> is non-null or <tt>nsc.getPrefix(nsprefixFromVal)</tt> is null.
+-     */ 
++     */
+     public static String printQName( javax.xml.namespace.QName val,
+                                      NamespaceContext nsc ) {
+         return theConverter.printQName( val, nsc );
+@@ -549,7 +549,7 @@
+      * @return
+      *     A string containing a lexical representation of xsd:dateTime
+      * @throws IllegalArgumentException if <tt>val</tt> is null.
+-     */ 
++     */
+     public static String printDateTime( java.util.Calendar val ) {
+         return theConverter.printDateTime( val );
+     }
+@@ -562,7 +562,7 @@
+      * @return
+      *     A string containing a lexical representation of xsd:base64Binary
+      * @throws IllegalArgumentException if <tt>val</tt> is null.
+-     */ 
++     */
+     public static String printBase64Binary( byte[] val ) {
+         return theConverter.printBase64Binary( val );
+     }
+@@ -575,7 +575,7 @@
+      * @return
+      *     A string containing a lexical representation of xsd:hexBinary
+      * @throws IllegalArgumentException if <tt>val</tt> is null.
+-     */ 
++     */
+     public static String printHexBinary( byte[] val ) {
+         return theConverter.printHexBinary( val );
+     }
+@@ -587,7 +587,7 @@
+      *     A long value
+      * @return
+      *     A string containing a lexical representation of xsd:unsignedInt
+-     */ 
++     */
+     public static String printUnsignedInt( long val ) {
+         return theConverter.printUnsignedInt( val );
+     }
+@@ -599,7 +599,7 @@
+      *     An int value
+      * @return
+      *     A string containing a lexical representation of xsd:unsignedShort
+-     */ 
++     */
+     public static String printUnsignedShort( int val ) {
+         return theConverter.printUnsignedShort( val );
+     }
+@@ -612,7 +612,7 @@
+      * @return
+      *     A string containing a lexical representation of xsd:time
+      * @throws IllegalArgumentException if <tt>val</tt> is null.
+-     */ 
++     */
+     public static String printTime( java.util.Calendar val ) {
+         return theConverter.printTime( val );
+     }
+@@ -625,7 +625,7 @@
+      * @return
+      *     A string containing a lexical representation of xsd:date
+      * @throws IllegalArgumentException if <tt>val</tt> is null.
+-     */ 
++     */
+     public static String printDate( java.util.Calendar val ) {
+         return theConverter.printDate( val );
+     }
+@@ -637,7 +637,7 @@
+      *     A string value
+      * @return
+      *     A string containing a lexical representation of xsd:AnySimpleType
+-     */ 
++     */
+     public static String printAnySimpleType( String val ) {
+         return theConverter.printAnySimpleType( val );
+     }
+--- old/src/share/classes/javax/xml/bind/DatatypeConverterImpl.java	Thu Jul 30 18:47:45 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/bind/DatatypeConverterImpl.java	Thu Jul 30 18:47:44 2009
+@@ -47,7 +47,7 @@
+  * This class is responsible for whitespace normalization.
+  *
+  * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li></ul>
+- * @version $Revision$
++ * @version $Revision: 1.1 $
+  * @since JAXB2.1
+  */
+ final class DatatypeConverterImpl implements DatatypeConverterInterface {
+--- old/src/share/classes/javax/xml/bind/DatatypeConverterInterface.java	Thu Jul 30 18:47:48 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/bind/DatatypeConverterInterface.java	Thu Jul 30 18:47:47 2009
+@@ -27,16 +27,16 @@
+ 
+ /**
+  * <p>
+- * The DatatypeConverterInterface is for JAXB provider use only. A 
+- * JAXB provider must supply a class that implements this interface. 
+- * JAXB Providers are required to call the 
+- * {@link DatatypeConverter#setDatatypeConverter(DatatypeConverterInterface) 
+- * DatatypeConverter.setDatatypeConverter} api at 
++ * The DatatypeConverterInterface is for JAXB provider use only. A
++ * JAXB provider must supply a class that implements this interface.
++ * JAXB Providers are required to call the
++ * {@link DatatypeConverter#setDatatypeConverter(DatatypeConverterInterface)
++ * DatatypeConverter.setDatatypeConverter} api at
+  * some point before the first marshal or unmarshal operation (perhaps during
+- * the call to JAXBContext.newInstance).  This step is necessary to configure 
+- * the converter that should be used to perform the print and parse 
+- * functionality.  Calling this api repeatedly will have no effect - the 
+- * DatatypeConverter instance passed into the first invocation is the one that 
++ * the call to JAXBContext.newInstance).  This step is necessary to configure
++ * the converter that should be used to perform the print and parse
++ * functionality.  Calling this api repeatedly will have no effect - the
++ * DatatypeConverter instance passed into the first invocation is the one that
+  * will be used from then on.
+  * </p>
+  *
+@@ -43,12 +43,12 @@
+  * <p>
+  * This interface defines the parse and print methods. There is one
+  * parse and print method for each XML schema datatype specified in the
+- * the default binding Table 5-1 in the JAXB specification. 
++ * the default binding Table 5-1 in the JAXB specification.
+  * </p>
+  *
+  * <p>
+  * The parse and print methods defined here are invoked by the static parse
+- * and print methods defined in the {@link DatatypeConverter DatatypeConverter} 
++ * and print methods defined in the {@link DatatypeConverter DatatypeConverter}
+  * class.
+  * </p>
+  *
+@@ -55,15 +55,15 @@
+  * <p>
+  * A parse method for a XML schema datatype must be capable of converting any
+  * lexical representation of the XML schema datatype ( specified by the
+- * <a href="http://www.w3.org/TR/xmlschema-2/"> XML Schema Part2: Datatypes 
+- * specification</a> into a value in the value space of the XML schema datatype. 
++ * <a href="http://www.w3.org/TR/xmlschema-2/"> XML Schema Part2: Datatypes
++ * specification</a> into a value in the value space of the XML schema datatype.
+  * If an error is encountered during conversion, then an IllegalArgumentException
+  * or a subclass of IllegalArgumentException must be thrown by the method.
+- *  
++ *
+  * </p>
+  *
+  * <p>
+- * A print method for a XML schema datatype can output any lexical 
++ * A print method for a XML schema datatype can output any lexical
+  * representation that is valid with respect to the XML schema datatype.
+  * If an error is encountered during conversion, then an IllegalArgumentException,
+  * or a subclass of IllegalArgumentException must be thrown by the method.
+@@ -70,12 +70,12 @@
+  * </p>
+  *
+  * The prefix xsd: is used to refer to XML schema datatypes
+- * <a href="http://www.w3.org/TR/xmlschema-2/"> XML Schema Part2: Datatypes 
++ * <a href="http://www.w3.org/TR/xmlschema-2/"> XML Schema Part2: Datatypes
+  * specification.</a>
+- *  
++ *
+  * <p>
+  * @author <ul><li>Sekhar Vajjhala, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems Inc.</li><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Ryan Shoemaker,Sun Microsystems Inc.</li></ul>
+- * @version $Revision: 1.4 $
++ * @version $Revision: 1.5 $
+  * @see DatatypeConverter
+  * @see ParseConversionEvent
+  * @see PrintConversionEvent
+@@ -83,14 +83,14 @@
+  */
+ 
+ public interface DatatypeConverterInterface {
+-    /**  
++    /**
+      * <p>
+-     * Convert the string argument into a string. 
++     * Convert the string argument into a string.
+      * @param lexicalXSDString
+      *     A lexical representation of the XML Schema datatype xsd:string
+      * @return
+      *     A string that is the same as the input string.
+-     */ 
++     */
+     public String parseString( String lexicalXSDString );
+ 
+     /**
+@@ -102,7 +102,7 @@
+      * @return
+      *     A BigInteger value represented by the string argument.
+      * @throws NumberFormatException <code>lexicalXSDInteger</code> is not a valid string representation of a {@link java.math.BigInteger} value.
+-     */ 
++     */
+     public java.math.BigInteger parseInteger( String lexicalXSDInteger );
+ 
+     /**
+@@ -114,7 +114,7 @@
+      * @return
+      *     An int value represented byte the string argument.
+      * @throws NumberFormatException <code>lexicalXSDInt</code> is not a valid string representation of an <code>int</code> value.
+-     */ 
++     */
+     public int parseInt( String lexicalXSDInt );
+ 
+     /**
+@@ -126,7 +126,7 @@
+      * @return
+      *     A long value represented by the string argument.
+      * @throws NumberFormatException <code>lexicalXSDLong</code> is not a valid string representation of a <code>long</code> value.
+-     */ 
++     */
+     public long parseLong( String lexicalXSDLong );
+ 
+     /**
+@@ -138,7 +138,7 @@
+      * @return
+      *     A short value represented by the string argument.
+      * @throws NumberFormatException <code>lexicalXSDShort</code> is not a valid string representation of a <code>short</code> value.
+-     */ 
++     */
+     public short parseShort( String lexicalXSDShort );
+ 
+     /**
+@@ -150,7 +150,7 @@
+      * @return
+      *     A BigDecimal value represented by the string argument.
+      * @throws NumberFormatException <code>lexicalXSDDecimal</code> is not a valid string representation of {@link java.math.BigDecimal}.
+-     */ 
++     */
+     public java.math.BigDecimal parseDecimal( String lexicalXSDDecimal );
+ 
+     /**
+@@ -162,7 +162,7 @@
+      * @return
+      *     A float value represented by the string argument.
+      * @throws NumberFormatException <code>lexicalXSDFloat</code> is not a valid string representation of a <code>float</code> value.
+-     */ 
++     */
+     public float parseFloat( String lexicalXSDFloat );
+ 
+     /**
+@@ -174,7 +174,7 @@
+      * @return
+      *     A double value represented by the string argument.
+      * @throws NumberFormatException <code>lexicalXSDDouble</code> is not a valid string representation of a <code>double</code> value.
+-     */ 
++     */
+     public double parseDouble( String lexicalXSDDouble );
+ 
+     /**
+@@ -186,7 +186,7 @@
+      * @return
+      *     A boolean value represented by the string argument.
+      * @throws IllegalArgumentException if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:boolean.
+-     */ 
++     */
+     public boolean parseBoolean( String lexicalXSDBoolean );
+ 
+     /**
+@@ -199,17 +199,17 @@
+      *     A byte value represented by the string argument.
+      * @throws NumberFormatException <code>lexicalXSDByte</code> does not contain a parseable byte.
+      * @throws IllegalArgumentException if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:byte.
+-     */ 
++     */
+     public byte parseByte( String lexicalXSDByte );
+-    
++
+     /**
+      * <p>
+      * Converts the string argument into a QName value.
+      *
+      * <p>
+-     * String parameter <tt>lexicalXSDQname</tt> must conform to lexical value space specifed at 
++     * String parameter <tt>lexicalXSDQname</tt> must conform to lexical value space specifed at
+      * <a href="http://www.w3.org/TR/xmlschema-2/#QName">XML Schema Part 2:Datatypes specification:QNames</a>
+-     * 
++     *
+      * @param lexicalXSDQName
+      *     A string containing lexical representation of xsd:QName.
+      * @param nsc
+@@ -216,11 +216,11 @@
+      *     A namespace context for interpreting a prefix within a QName.
+      * @return
+      *     A QName value represented by the string argument.
+-     * @throws IllegalArgumentException  if string parameter does not conform to XML Schema Part 2 specification or 
++     * @throws IllegalArgumentException  if string parameter does not conform to XML Schema Part 2 specification or
+      *      if namespace prefix of <tt>lexicalXSDQname</tt> is not bound to a URI in NamespaceContext <tt>nsc</tt>.
+-     */ 
++     */
+     public javax.xml.namespace.QName parseQName( String lexicalXSDQName,
+-    				             javax.xml.namespace.NamespaceContext nsc);
++                                             javax.xml.namespace.NamespaceContext nsc);
+ 
+     /**
+      * <p>
+@@ -231,7 +231,7 @@
+      * @return
+      *     A Calendar object represented by the string argument.
+      * @throws IllegalArgumentException if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:dateTime.
+-     */ 
++     */
+     public java.util.Calendar parseDateTime( String lexicalXSDDateTime );
+ 
+     /**
+@@ -243,7 +243,7 @@
+      * @return
+      *     An array of bytes represented by the string argument.
+      * @throws IllegalArgumentException if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:base64Binary
+-     */ 
++     */
+     public byte[] parseBase64Binary( String lexicalXSDBase64Binary );
+ 
+     /**
+@@ -255,7 +255,7 @@
+      * @return
+      *     An array of bytes represented by the string argument.
+      * @throws IllegalArgumentException if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:hexBinary.
+-     */ 
++     */
+     public byte[] parseHexBinary( String lexicalXSDHexBinary );
+ 
+     /**
+@@ -267,7 +267,7 @@
+      * @return
+      *     A long value represented by the string argument.
+      * @throws NumberFormatException if string parameter can not be parsed into a <tt>long</tt> value.
+-     */ 
++     */
+     public long parseUnsignedInt( String lexicalXSDUnsignedInt );
+ 
+     /**
+@@ -279,7 +279,7 @@
+      * @return
+      *     An int value represented by the string argument.
+      * @throws NumberFormatException if string parameter can not be parsed into an <tt>int</tt> value.
+-     */ 
++     */
+     public int parseUnsignedShort( String lexicalXSDUnsignedShort );
+ 
+     /**
+@@ -291,9 +291,9 @@
+      * @return
+      *     A Calendar value represented by the string argument.
+      * @throws IllegalArgumentException if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:Time.
+-     */ 
++     */
+     public java.util.Calendar parseTime( String lexicalXSDTime );
+-    
++
+     /**
+      * <p>
+      * Converts the string argument into a Calendar value.
+@@ -303,22 +303,22 @@
+      * @return
+      *     A Calendar value represented by the string argument.
+      * @throws IllegalArgumentException if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:Date.
+-     */ 
++     */
+     public java.util.Calendar parseDate( String lexicalXSDDate );
+ 
+     /**
+      * <p>
+-     * Return a string containing the lexical representation of the 
++     * Return a string containing the lexical representation of the
+      * simple type.
+      * @param lexicalXSDAnySimpleType
+-     *     A string containing lexical 
++     *     A string containing lexical
+      *     representation of the simple type.
+      * @return
+-     *     A string containing the lexical representation of the 
++     *     A string containing the lexical representation of the
+      *     simple type.
+-     */ 
++     */
+     public String parseAnySimpleType( String lexicalXSDAnySimpleType );
+-    
++
+     /**
+      * <p>
+      * Converts the string argument into a string.
+@@ -326,7 +326,7 @@
+      *     A string value.
+      * @return
+      *     A string containing a lexical representation of xsd:string
+-     */ 
++     */
+     public String printString( String val );
+ 
+     /**
+@@ -337,7 +337,7 @@
+      * @return
+      *     A string containing a lexical representation of xsd:integer
+      * @throws IllegalArgumentException <tt>val</tt> is null.
+-     */ 
++     */
+     public String printInteger( java.math.BigInteger val );
+ 
+     /**
+@@ -347,7 +347,7 @@
+      *     An int value
+      * @return
+      *     A string containing a lexical representation of xsd:int
+-     */ 
++     */
+     public String printInt( int val );
+ 
+ 
+@@ -358,7 +358,7 @@
+      *     A long value
+      * @return
+      *     A string containing a lexical representation of xsd:long
+-     */ 
++     */
+     public String printLong( long val );
+ 
+     /**
+@@ -368,7 +368,7 @@
+      *     A short value
+      * @return
+      *     A string containing a lexical representation of xsd:short
+-     */ 
++     */
+     public String printShort( short val );
+ 
+     /**
+@@ -379,7 +379,7 @@
+      * @return
+      *     A string containing a lexical representation of xsd:decimal
+      * @throws IllegalArgumentException <tt>val</tt> is null.
+-     */ 
++     */
+     public String printDecimal( java.math.BigDecimal val );
+ 
+     /**
+@@ -389,7 +389,7 @@
+      *     A float value
+      * @return
+      *     A string containing a lexical representation of xsd:float
+-     */ 
++     */
+     public String printFloat( float val );
+ 
+     /**
+@@ -399,7 +399,7 @@
+      *     A double value
+      * @return
+      *     A string containing a lexical representation of xsd:double
+-     */ 
++     */
+     public String printDouble( double val );
+ 
+     /**
+@@ -409,7 +409,7 @@
+      *     A boolean value
+      * @return
+      *     A string containing a lexical representation of xsd:boolean
+-     */ 
++     */
+     public String printBoolean( boolean val );
+ 
+     /**
+@@ -419,7 +419,7 @@
+      *     A byte value
+      * @return
+      *     A string containing a lexical representation of xsd:byte
+-     */ 
++     */
+     public String printByte( byte val );
+ 
+     /**
+@@ -431,9 +431,9 @@
+      *     A namespace context for interpreting a prefix within a QName.
+      * @return
+      *     A string containing a lexical representation of QName
+-     * @throws IllegalArgumentException if <tt>val</tt> is null or 
++     * @throws IllegalArgumentException if <tt>val</tt> is null or
+      * if <tt>nsc</tt> is non-null or <tt>nsc.getPrefix(nsprefixFromVal)</tt> is null.
+-     */ 
++     */
+     public String printQName( javax.xml.namespace.QName val,
+                               javax.xml.namespace.NamespaceContext nsc );
+ 
+@@ -445,7 +445,7 @@
+      * @return
+      *     A string containing a lexical representation of xsd:dateTime
+      * @throws IllegalArgumentException if <tt>val</tt> is null.
+-     */ 
++     */
+     public String printDateTime( java.util.Calendar val );
+ 
+     /**
+@@ -456,7 +456,7 @@
+      * @return
+      *     A string containing a lexical representation of xsd:base64Binary
+      * @throws IllegalArgumentException if <tt>val</tt> is null.
+-     */ 
++     */
+     public String printBase64Binary( byte[] val );
+ 
+     /**
+@@ -467,7 +467,7 @@
+      * @return
+      *     A string containing a lexical representation of xsd:hexBinary
+      * @throws IllegalArgumentException if <tt>val</tt> is null.
+-     */ 
++     */
+     public String printHexBinary( byte[] val );
+ 
+     /**
+@@ -477,7 +477,7 @@
+      *     A long value
+      * @return
+      *     A string containing a lexical representation of xsd:unsignedInt
+-     */ 
++     */
+     public String printUnsignedInt( long val );
+ 
+     /**
+@@ -487,7 +487,7 @@
+      *     An int value
+      * @return
+      *     A string containing a lexical representation of xsd:unsignedShort
+-     */ 
++     */
+     public String printUnsignedShort( int val );
+ 
+     /**
+@@ -498,7 +498,7 @@
+      * @return
+      *     A string containing a lexical representation of xsd:time
+      * @throws IllegalArgumentException if <tt>val</tt> is null.
+-     */ 
++     */
+     public String printTime( java.util.Calendar val );
+ 
+     /**
+@@ -509,7 +509,7 @@
+      * @return
+      *     A string containing a lexical representation of xsd:date
+      * @throws IllegalArgumentException if <tt>val</tt> is null.
+-     */ 
++     */
+     public String printDate( java.util.Calendar val );
+ 
+     /**
+@@ -519,6 +519,6 @@
+      *     A string value
+      * @return
+      *     A string containing a lexical representation of xsd:AnySimpleType
+-     */ 
++     */
+     public String printAnySimpleType( String val );
+ }
+--- old/src/share/classes/javax/xml/bind/JAXBContext.java	Thu Jul 30 18:47:55 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/bind/JAXBContext.java	Thu Jul 30 18:47:54 2009
+@@ -33,26 +33,26 @@
+ 
+ /**
+  * <p>
+- * The <tt>JAXBContext</tt> class provides the client's entry point to the 
+- * JAXB API. It provides an abstraction for managing the XML/Java binding 
+- * information necessary to implement the JAXB binding framework operations: 
++ * The <tt>JAXBContext</tt> class provides the client's entry point to the
++ * JAXB API. It provides an abstraction for managing the XML/Java binding
++ * information necessary to implement the JAXB binding framework operations:
+  * unmarshal, marshal and validate.
+  *
+  * <p>A client application normally obtains new instances of this class using
+- * one of these two styles for newInstance methods, although there are other 
++ * one of these two styles for newInstance methods, although there are other
+  * specialized forms of the method available:
+  *
+  * <ul>
+  *   <li>{@link #newInstance(String,ClassLoader) JAXBContext.newInstance( "com.acme.foo:com.acme.bar" )} <br/>
+- *   The JAXBContext instance is initialized from a list of colon 
++ *   The JAXBContext instance is initialized from a list of colon
+  *   separated Java package names. Each java package contains
+- *   JAXB mapped classes, schema-derived classes and/or user annotated 
+- *   classes. Additionally, the java package may contain JAXB package annotations 
++ *   JAXB mapped classes, schema-derived classes and/or user annotated
++ *   classes. Additionally, the java package may contain JAXB package annotations
+  *   that must be processed. (see JLS 3rd Edition, Section 7.4.1. Package Annotations).
+  *   </li>
+  *   <li>{@link #newInstance(Class...) JAXBContext.newInstance( com.acme.foo.Foo.class )} <br/>
+- *    The JAXBContext instance is intialized with class(es) 
+- *    passed as parameter(s) and classes that are statically reachable from 
++ *    The JAXBContext instance is intialized with class(es)
++ *    passed as parameter(s) and classes that are statically reachable from
+  *    these class(es). See {@link #newInstance(Class...)} for details.
+  *   </li>
+  * </ul>
+@@ -68,24 +68,24 @@
+  * </pre>
+  *
+  * <p><i>
+- * The following JAXB 1.0 requirement is only required for schema to 
++ * The following JAXB 1.0 requirement is only required for schema to
+  * java interface/implementation binding. It does not apply to JAXB annotated
+- * classes. JAXB Providers must generate a <tt>jaxb.properties</tt> file in 
+- * each package containing schema derived classes.  The property file must 
+- * contain a property named <tt>javax.xml.bind.context.factory</tt> whose 
+- * value is the name of the class that implements the <tt>createContext</tt> 
++ * classes. JAXB Providers must generate a <tt>jaxb.properties</tt> file in
++ * each package containing schema derived classes.  The property file must
++ * contain a property named <tt>javax.xml.bind.context.factory</tt> whose
++ * value is the name of the class that implements the <tt>createContext</tt>
+  * APIs.</i>
+- * 
++ *
+  * <p><i>
+- * The class supplied by the provider does not have to be assignable to 
++ * The class supplied by the provider does not have to be assignable to
+  * <tt>javax.xml.bind.JAXBContext</tt>, it simply has to provide a class that
+  * implements the <tt>createContext</tt> APIs.</i>
+- * 
++ *
+  * <p><i>
+- * In addition, the provider must call the 
+- * {@link DatatypeConverter#setDatatypeConverter(DatatypeConverterInterface) 
+- * DatatypeConverter.setDatatypeConverter} api prior to any client 
+- * invocations of the marshal and unmarshal methods.  This is necessary to 
++ * In addition, the provider must call the
++ * {@link DatatypeConverter#setDatatypeConverter(DatatypeConverterInterface)
++ * DatatypeConverter.setDatatypeConverter} api prior to any client
++ * invocations of the marshal and unmarshal methods.  This is necessary to
+  * configure the datatype converter that will be used during these operations.</i>
+  * </blockquote>
+  *
+@@ -96,17 +96,17 @@
+  * <blockquote>
+  * The {@link Unmarshaller} class provides the client application the ability
+  * to convert XML data into a tree of Java content objects.
+- * The unmarshal method allows for 
++ * The unmarshal method allows for
+  * any global XML element declared in the schema to be unmarshalled as
+  * the root of an instance document.
+- * Additionally, the unmarshal method allows for an unrecognized root element that 
+- * has  an xsi:type attribute's value that references a type definition declared in 
++ * Additionally, the unmarshal method allows for an unrecognized root element that
++ * has  an xsi:type attribute's value that references a type definition declared in
+  * the schema  to be unmarshalled as the root of an instance document.
+- * The <tt>JAXBContext</tt> object 
++ * The <tt>JAXBContext</tt> object
+  * allows the merging of global elements and type definitions across a set of schemas (listed
+  * in the <tt>contextPath</tt>). Since each schema in the schema set can belong
+- * to distinct namespaces, the unification of schemas to an unmarshalling 
+- * context should be namespace independent.  This means that a client 
++ * to distinct namespaces, the unification of schemas to an unmarshalling
++ * context should be namespace independent.  This means that a client
+  * application is able to unmarshal XML documents that are instances of
+  * any of the schemas listed in the <tt>contextPath</tt>.  For example:
+  *
+@@ -121,21 +121,21 @@
+  * <p>
+  * The client application may also generate Java content trees explicitly rather
+  * than unmarshalling existing XML data.  For all JAXB-annotated value classes,
+- * an application can create content using constructors. 
++ * an application can create content using constructors.
+  * For schema-derived interface/implementation classes and for the
+  * creation of elements that are not bound to a JAXB-annotated
+- * class, an application needs to have access and knowledge about each of 
+- * the schema derived <tt> ObjectFactory</tt> classes that exist in each of 
+- * java packages contained in the <tt>contextPath</tt>.  For each schema 
+- * derived java class, there is a static factory method that produces objects 
+- * of that type.  For example, 
+- * assume that after compiling a schema, you have a package <tt>com.acme.foo</tt> 
+- * that contains a schema derived interface named <tt>PurchaseOrder</tt>.  In 
+- * order to create objects of that type, the client application would use the 
++ * class, an application needs to have access and knowledge about each of
++ * the schema derived <tt> ObjectFactory</tt> classes that exist in each of
++ * java packages contained in the <tt>contextPath</tt>.  For each schema
++ * derived java class, there is a static factory method that produces objects
++ * of that type.  For example,
++ * assume that after compiling a schema, you have a package <tt>com.acme.foo</tt>
++ * that contains a schema derived interface named <tt>PurchaseOrder</tt>.  In
++ * order to create objects of that type, the client application would use the
+  * factory method like this:
+  *
+  * <pre>
+- *       com.acme.foo.PurchaseOrder po = 
++ *       com.acme.foo.PurchaseOrder po =
+  *           com.acme.foo.ObjectFactory.createPurchaseOrder();
+  * </pre>
+  *
+@@ -149,9 +149,9 @@
+  *
+  * <p>
+  * <i><B>SPEC REQUIREMENT:</B> the provider must generate a class in each
+- * package that contains all of the necessary object factory methods for that 
+- * package named ObjectFactory as well as the static 
+- * <tt>newInstance( javaContentInterface )</tt> method</i>  
++ * package that contains all of the necessary object factory methods for that
++ * package named ObjectFactory as well as the static
++ * <tt>newInstance( javaContentInterface )</tt> method</i>
+  * </blockquote>
+  *
+  * <p>
+@@ -163,11 +163,11 @@
+  * between marshalling a content tree that is created manually using the factory
+  * methods and marshalling a content tree that is the result an <tt>unmarshal
+  * </tt> operation.  Clients can marshal a java content tree back to XML data
+- * to a <tt>java.io.OutputStream</tt> or a <tt>java.io.Writer</tt>.  The 
+- * marshalling process can alternatively produce SAX2 event streams to a 
+- * registered <tt>ContentHandler</tt> or produce a DOM Node object.  
+- * Client applications have control over the output encoding as well as 
+- * whether or not to marshal the XML data as a complete document or 
++ * to a <tt>java.io.OutputStream</tt> or a <tt>java.io.Writer</tt>.  The
++ * marshalling process can alternatively produce SAX2 event streams to a
++ * registered <tt>ContentHandler</tt> or produce a DOM Node object.
++ * Client applications have control over the output encoding as well as
++ * whether or not to marshal the XML data as a complete document or
+  * as a fragment.
+  *
+  * <p>
+@@ -206,18 +206,18 @@
+  * <p>
+  * <b>JAXB Runtime Binding Framework Compatibility</b><br>
+  * <blockquote>
+- * The following JAXB 1.0 restriction only applies to binding schema to 
++ * The following JAXB 1.0 restriction only applies to binding schema to
+  * interfaces/implementation classes.
+- * Since this binding does not require a common runtime system, a JAXB 
++ * Since this binding does not require a common runtime system, a JAXB
+  * client application must not attempt to mix runtime objects (<tt>JAXBContext,
+- * Marshaller</tt>, etc. ) from different providers.  This does not 
+- * mean that the client application isn't portable, it simply means that a 
+- * client has to use a runtime system provided by the same provider that was 
++ * Marshaller</tt>, etc. ) from different providers.  This does not
++ * mean that the client application isn't portable, it simply means that a
++ * client has to use a runtime system provided by the same provider that was
+  * used to compile the schema.
+  * </blockquote>
+  *
+  * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul>
+- * @version $Revision: 1.23 $ $Date: 2005/08/31 20:57:57 $
++ * @version $Revision: 1.24 $ $Date: 2006/03/08 17:05:01 $
+  * @see Marshaller
+  * @see Unmarshaller
+  * @see <a href="http://java.sun.com/docs/books/jls">S 7.4.1.1 "Package Annotations" in Java Language Specification, 3rd Edition</a>
+@@ -224,29 +224,29 @@
+  * @since JAXB1.0
+  */
+ public abstract class JAXBContext {
+-    
++
+     /**
+      * The name of the property that contains the name of the class capable
+      * of creating new <tt>JAXBContext</tt> objects.
+      */
+-    public static final String JAXB_CONTEXT_FACTORY = 
++    public static final String JAXB_CONTEXT_FACTORY =
+         "javax.xml.bind.context.factory";
+-       
+ 
++
+     protected JAXBContext() {
+     }
+ 
+-    
++
+     /**
+      * <p>
+      * Obtain a new instance of a <tt>JAXBContext</tt> class.
+      *
+      * <p>
+-     * This is a convenience method for the 
++     * This is a convenience method for the
+      * {@link #newInstance(String,ClassLoader) newInstance} method.  It uses
+      * the context class loader of the current thread.  To specify the use of
+-     * a different class loader, either set it via the 
+-     * <tt>Thread.setContextClassLoader()</tt> api or use the 
++     * a different class loader, either set it via the
++     * <tt>Thread.setContextClassLoader()</tt> api or use the
+      * {@link #newInstance(String,ClassLoader) newInstance} method.
+      * @throws JAXBException if an error was encountered while creating the
+      *                       <tt>JAXBContext</tt> such as
+@@ -257,33 +257,33 @@
+      *   <li>mixing schema derived packages from different providers on the same contextPath</li>
+      * </ol>
+      */
+-    public static JAXBContext newInstance( String contextPath ) 
++    public static JAXBContext newInstance( String contextPath )
+         throws JAXBException {
+-            
++
+         //return newInstance( contextPath, JAXBContext.class.getClassLoader() );
+         return newInstance( contextPath, Thread.currentThread().getContextClassLoader() );
+     }
+-    
++
+     /**
+      * <p>
+      * Obtain a new instance of a <tt>JAXBContext</tt> class.
+      *
+      * <p>
+-     * The client application must supply a context path which is a list of 
+-     * colon (':', \u005Cu003A) separated java package names that contain 
+-     * schema-derived classes and/or fully qualified JAXB-annotated classes. 
+-     * Schema-derived 
+-     * code is registered with the JAXBContext by the 
+-     * ObjectFactory.class generated per package. 
+-     * Alternatively than being listed in the context path, programmer 
+-     * annotated JAXB mapped classes can be listed in a 
+-     * <tt>jaxb.index</tt> resource file, format described below. 
+-     * Note that a java package can contain both schema-derived classes and 
+-     * user annotated JAXB classes. Additionally, the java package may 
+-     * contain JAXB package annotations  that must be processed. (see JLS 3rd Edition, 
++     * The client application must supply a context path which is a list of
++     * colon (':', \u005Cu003A) separated java package names that contain
++     * schema-derived classes and/or fully qualified JAXB-annotated classes.
++     * Schema-derived
++     * code is registered with the JAXBContext by the
++     * ObjectFactory.class generated per package.
++     * Alternatively than being listed in the context path, programmer
++     * annotated JAXB mapped classes can be listed in a
++     * <tt>jaxb.index</tt> resource file, format described below.
++     * Note that a java package can contain both schema-derived classes and
++     * user annotated JAXB classes. Additionally, the java package may
++     * contain JAXB package annotations  that must be processed. (see JLS 3rd Edition,
+      * Section 7.4.1. "Package Annotations").
+      * </p>
+-     * 
++     *
+      * <p>
+      * Every package listed on the contextPath must meet <b>one or both</b> of the
+      * following conditions otherwise a <tt>JAXBException</tt> will be thrown:
+@@ -296,19 +296,19 @@
+      * <p>
+      * <b>Format for jaxb.index</b>
+      * <p>
+-     * The file contains a newline-separated list of class names. 
+-     * Space and tab characters, as well as blank 
+-     * lines, are ignored. The comment character 
+-     * is '#' (0x23); on each line all characters following the first comment 
+-     * character are ignored. The file must be encoded in UTF-8. Classes that 
++     * The file contains a newline-separated list of class names.
++     * Space and tab characters, as well as blank
++     * lines, are ignored. The comment character
++     * is '#' (0x23); on each line all characters following the first comment
++     * character are ignored. The file must be encoded in UTF-8. Classes that
+      * are reachable, as defined in {@link #newInstance(Class...)}, from the
+-     * listed classes are also registered with JAXBContext. 
++     * listed classes are also registered with JAXBContext.
+      * <p>
+      * Constraints on class name occuring in a <tt>jaxb.index</tt> file are:
+      * <ul>
+      *   <li>Must not end with ".class".</li>
+-     *   <li>Class names are resolved relative to package containing 
+-     *       <tt>jaxb.index</tt> file. Only classes occuring directly in package 
++     *   <li>Class names are resolved relative to package containing
++     *       <tt>jaxb.index</tt> file. Only classes occuring directly in package
+      *       containing <tt>jaxb.index</tt> file are allowed.</li>
+      *   <li>Fully qualified class names are not allowed.
+      *       A qualified class name,relative to current package,
+@@ -316,18 +316,18 @@
+      * </ul>
+      *
+      * <p>
+-     * To maintain compatibility with JAXB 1.0 schema to java 
++     * To maintain compatibility with JAXB 1.0 schema to java
+      * interface/implementation binding, enabled by schema customization
+-     * <tt><jaxb:globalBindings valueClass="false"></tt>, 
++     * <tt><jaxb:globalBindings valueClass="false"></tt>,
+      * the JAXB provider will ensure that each package on the context path
+-     * has a <tt>jaxb.properties</tt> file which contains a value for the 
++     * has a <tt>jaxb.properties</tt> file which contains a value for the
+      * <tt>javax.xml.bind.context.factory</tt> property and that all values
+      * resolve to the same provider.  This requirement does not apply to
+      * JAXB annotated classes.
+      *
+      * <p>
+-     * If there are any global XML element name collisions across the various 
+-     * packages listed on the <tt>contextPath</tt>, a <tt>JAXBException</tt> 
++     * If there are any global XML element name collisions across the various
++     * packages listed on the <tt>contextPath</tt>, a <tt>JAXBException</tt>
+      * will be thrown.
+      *
+      * <p>
+@@ -334,8 +334,8 @@
+      * Mixing generated interface/impl bindings from multiple JAXB Providers
+      * in the same context path may result in a <tt>JAXBException</tt>
+      * being thrown.
+-     *  
+-     * @param contextPath list of java package names that contain schema 
++     *
++     * @param contextPath list of java package names that contain schema
+      *                    derived class and/or java to schema (JAXB-annotated)
+      *                    mapped classes
+      * @param classLoader
+@@ -486,8 +486,8 @@
+      *
+      * Not only the new context will recognize all the classes specified,
+      * but it will also recognize any classes that are directly/indirectly
+-     * referenced statically from the specified classes. Subclasses of 
+-     * referenced classes nor <tt>&#64;XmlTransient</tt> referenced classes 
++     * referenced statically from the specified classes. Subclasses of
++     * referenced classes nor <tt>&#64;XmlTransient</tt> referenced classes
+      * are not registered with JAXBContext.
+      *
+      * For example, in the following Java code, if you do
+@@ -508,7 +508,7 @@
+      *
+      * <p>
+      * Note that for each java package registered with JAXBContext,
+-     * when the optional package annotations exist, they must be processed. 
++     * when the optional package annotations exist, they must be processed.
+      * (see JLS 3rd Edition, Section 7.4.1. "Package Annotations").
+      *
+      * @param classesToBeBound
+@@ -602,12 +602,12 @@
+      *
+      * @throws JAXBException if an error was encountered while creating the
+      *                       <tt>Unmarshaller</tt> object
+-     */    
++     */
+     public abstract Unmarshaller createUnmarshaller() throws JAXBException;
+-    
+-    
+-    /** 
+-     * Create a <tt>Marshaller</tt> object that can be used to convert a 
++
++
++    /**
++     * Create a <tt>Marshaller</tt> object that can be used to convert a
+      * java content tree into XML data.
+      *
+      * @return a <tt>Marshaller</tt> object
+@@ -614,10 +614,10 @@
+      *
+      * @throws JAXBException if an error was encountered while creating the
+      *                       <tt>Marshaller</tt> object
+-     */    
++     */
+     public abstract Marshaller createMarshaller() throws JAXBException;
+-    
+-    
++
++
+     /**
+      * {@link Validator} has been made optional and deprecated in JAXB 2.0.  Please
+      * refer to the javadoc for {@link Validator} for more detail.
+@@ -630,7 +630,7 @@
+      * @throws JAXBException if an error was encountered while creating the
+      *                       <tt>Validator</tt> object
+      * @deprecated since JAXB2.0
+-     */    
++     */
+     public abstract Validator createValidator() throws JAXBException;
+ 
+     /**
+@@ -642,7 +642,7 @@
+      * @return always a new valid <tt>Binder</tt> object.
+      *
+      * @throws UnsupportedOperationException
+-     *      if DOM API corresponding to <tt>domType</tt> is not supported by 
++     *      if DOM API corresponding to <tt>domType</tt> is not supported by
+      *      the implementation.
+      *
+      * @since JAXB2.0
+@@ -674,7 +674,7 @@
+      * @throws UnsupportedOperationException
+      *      Calling this method on JAXB 1.0 implementations will throw
+      *      an UnsupportedOperationException.
+-     *  
++     *
+      * @since JAXB2.0
+      */
+     public JAXBIntrospector createJAXBIntrospector() {
+--- old/src/share/classes/javax/xml/bind/JAXBElement.java	Thu Jul 30 18:47:59 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/bind/JAXBElement.java	Thu Jul 30 18:47:58 2009
+@@ -31,7 +31,7 @@
+ /**
+  * <p>JAXB representation of an Xml Element.</p>
+  *
+- * <p>This class represents information about an Xml Element from both the element 
++ * <p>This class represents information about an Xml Element from both the element
+  * declaration within a schema and the element instance value within an xml document
+  * with the following properties
+  * <ul>
+@@ -41,22 +41,22 @@
+  *   <li><b><tt>scope</tt></b> of element declaration</li>
+  *   <li>boolean <b><tt>nil</tt></b> property. (element instance's <tt><b>xsi:nil</b></tt> attribute)</li>
+  * </ul>
+- * 
++ *
+  * <p>The <tt>declaredType</tt> and <tt>scope</tt> property are the
+  * JAXB class binding for the xml type definition.
+  * </p>
+- * 
+- * <p><b><tt>Scope</tt></b> is either {@link GlobalScope} or the Java class representing the 
++ *
++ * <p><b><tt>Scope</tt></b> is either {@link GlobalScope} or the Java class representing the
+  * complex type definition containing the schema element declaration.
+  * </p>
+- * 
+- * <p>There is a property constraint that if <b><tt>value</tt></b> is <tt>null</tt>, 
+- * then <tt>nil</tt> must be <tt>true</tt>. The converse is not true to enable 
+- * representing a nil element with attribute(s). If <tt>nil</tt> is true, it is possible 
+- * that <tt>value</tt> is non-null so it can hold the value of the attributes 
++ *
++ * <p>There is a property constraint that if <b><tt>value</tt></b> is <tt>null</tt>,
++ * then <tt>nil</tt> must be <tt>true</tt>. The converse is not true to enable
++ * representing a nil element with attribute(s). If <tt>nil</tt> is true, it is possible
++ * that <tt>value</tt> is non-null so it can hold the value of the attributes
+  * associated with a nil element.
+  * </p>
+- * 
++ *
+  * @author Kohsuke Kawaguchi, Joe Fialli
+  * @since JAXB 2.0
+  */
+@@ -72,13 +72,13 @@
+     /** Scope of xml element declaration representing this xml element instance.
+      *  Can be one of the following values:
+      *  - {@link GlobalScope} for global xml element declaration.
+-     *  - local element declaration has a scope set to the Java class 
++     *  - local element declaration has a scope set to the Java class
+      *     representation of complex type defintion containing
+-     *     xml element declaration. 
++     *     xml element declaration.
+      */
+     final protected Class scope;
+ 
+-    /** xml element value. 
++    /** xml element value.
+         Represents content model and attributes of an xml element instance. */
+     protected T value;
+ 
+@@ -92,7 +92,7 @@
+ 
+     /**
+      * <p>Construct an xml element instance.</p>
+-     * 
++     *
+      * @param name          Java binding of xml element tag name
+      * @param declaredType  Java binding of xml element declaration's type
+      * @param scope
+@@ -103,10 +103,10 @@
+      * @see #getScope()
+      * @see #isTypeSubstituted()
+      */
+-    public JAXBElement(QName name, 
+-		       Class<T> declaredType, 
+-		       Class scope,
+-		       T value) {
++    public JAXBElement(QName name,
++                       Class<T> declaredType,
++                       Class scope,
++                       T value) {
+         if(declaredType==null || name==null)
+             throw new IllegalArgumentException();
+         this.declaredType = declaredType;
+@@ -153,7 +153,7 @@
+ 
+     /**
+      * <p>Return the content model and attribute values for this element.</p>
+-     * 
++     *
+      * <p>See {@link #isNil()} for a description of a property constraint when
+      * this value is <tt>null</tt></p>
+      */
+@@ -170,13 +170,13 @@
+     public Class getScope() {
+         return scope;
+     }
+-    
++
+     /**
+-     * <p>Returns <tt>true</tt> iff this element instance content model 
++     * <p>Returns <tt>true</tt> iff this element instance content model
+      * is nil.</p>
+      *
+      * <p>This property always returns <tt>true</tt> when {@link #getValue()} is null.
+-     * Note that the converse is not true, when this property is <tt>true</tt>, 
++     * Note that the converse is not true, when this property is <tt>true</tt>,
+      * {@link #getValue()} can contain a non-null value for attribute(s). It is
+      * valid for a nil xml element to have attribute(s).</p>
+      */
+@@ -186,15 +186,15 @@
+ 
+     /**
+      * <p>Set whether this element has nil content.</p>
+-     * 
++     *
+      * @see #isNil()
+      */
+     public void setNil(boolean value) {
+         this.nil = value;
+     }
+-    
+-    /* Convenience methods  
+-     * (Not necessary but they do unambiguously conceptualize 
++
++    /* Convenience methods
++     * (Not necessary but they do unambiguously conceptualize
+      *  the rationale behind this class' fields.)
+      */
+ 
+--- old/src/share/classes/javax/xml/bind/JAXBException.java	Thu Jul 30 18:48:02 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/bind/JAXBException.java	Thu Jul 30 18:48:01 2009
+@@ -31,7 +31,7 @@
+  * This is the root exception class for all JAXB exceptions.
+  *
+  * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li></ul>
+- * @version $Revision: 1.3 $ $Date: 2004/10/22 15:46:02 $
++ * @version $Revision: 1.1 $ $Date: 2004/12/14 21:50:39 $
+  * @see JAXBContext
+  * @see Marshaller
+  * @see Unmarshaller
+@@ -38,14 +38,14 @@
+  * @since JAXB1.0
+  */
+ public class JAXBException extends Exception {
+-  
+-    /** 
++
++    /**
+      * Vendor specific error code
+      *
+      */
+     private String errorCode;
+ 
+-    /** 
++    /**
+      * Exception reference
+      *
+      */
+@@ -53,8 +53,8 @@
+ 
+     static final long serialVersionUID = -5621384651494307979L;
+ 
+-    /** 
+-     * Construct a JAXBException with the specified detail message.  The 
++    /**
++     * Construct a JAXBException with the specified detail message.  The
+      * errorCode and linkedException will default to null.
+      *
+      * @param message a description of the exception
+@@ -63,8 +63,8 @@
+         this( message, null, null );
+     }
+ 
+-    /** 
+-     * Construct a JAXBException with the specified detail message and vendor 
++    /**
++     * Construct a JAXBException with the specified detail message and vendor
+      * specific errorCode.  The linkedException will default to null.
+      *
+      * @param message a description of the exception
+@@ -74,7 +74,7 @@
+         this( message, errorCode, null );
+     }
+ 
+-    /** 
++    /**
+      * Construct a JAXBException with a linkedException.  The detail message and
+      * vendor specific errorCode will default to null.
+      *
+@@ -83,9 +83,9 @@
+     public JAXBException(Throwable exception) {
+         this( null, null, exception );
+     }
+-    
+-    /** 
+-     * Construct a JAXBException with the specified detail message and 
++
++    /**
++     * Construct a JAXBException with the specified detail message and
+      * linkedException.  The errorCode will default to null.
+      *
+      * @param message a description of the exception
+@@ -94,9 +94,9 @@
+     public JAXBException(String message, Throwable exception) {
+         this( message, null, exception );
+     }
+-    
+-    /** 
+-     * Construct a JAXBException with the specified detail message, vendor 
++
++    /**
++     * Construct a JAXBException with the specified detail message, vendor
+      * specific errorCode, and linkedException.
+      *
+      * @param message a description of the exception
+@@ -108,8 +108,8 @@
+         this.errorCode = errorCode;
+         this.linkedException = exception;
+     }
+-    
+-    /** 
++
++    /**
+      * Get the vendor specific error code
+      *
+      * @return a string specifying the vendor specific error code
+@@ -119,7 +119,7 @@
+     }
+ 
+     /**
+-     * Get the linked exception 
++     * Get the linked exception
+      *
+      * @return the linked Exception, null if none exists
+      */
+@@ -130,7 +130,7 @@
+     /**
+      * Add a linked Exception.
+      *
+-     * @param exception the linked Exception (A null value is permitted and 
++     * @param exception the linked Exception (A null value is permitted and
+      *                  indicates that the linked exception does not exist or
+      *                  is unknown).
+      */
+@@ -137,13 +137,13 @@
+     public synchronized void setLinkedException( Throwable exception ) {
+         this.linkedException = exception;
+     }
+-    
++
+     /**
+      * Returns a short description of this JAXBException.
+      *
+      */
+     public String toString() {
+-        return linkedException == null ? 
++        return linkedException == null ?
+             super.toString() :
+             super.toString() + "\n - with linked exception:\n[" +
+                                 linkedException.toString()+ "]";
+--- old/src/share/classes/javax/xml/bind/JAXBIntrospector.java	Thu Jul 30 18:48:06 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/bind/JAXBIntrospector.java	Thu Jul 30 18:48:05 2009
+@@ -30,14 +30,14 @@
+  * Provide access to JAXB xml binding data for a JAXB object.
+  *
+  * <p>
+- * Intially, the intent of this class is to just conceptualize how 
+- * a JAXB application developer can access xml binding information, 
++ * Intially, the intent of this class is to just conceptualize how
++ * a JAXB application developer can access xml binding information,
+  * independent if binding model is java to schema or schema to java.
+  * Since accessing the XML element name related to a JAXB element is
+  * a highly requested feature, demonstrate access to this
+  * binding information.
+  *
+- * The factory method to get a <code>JAXBIntrospector</code> instance is 
++ * The factory method to get a <code>JAXBIntrospector</code> instance is
+  * {@link JAXBContext#createJAXBIntrospector()}.
+  *
+  * @see JAXBContext#createJAXBIntrospector()
+@@ -45,12 +45,12 @@
+  */
+ public abstract class JAXBIntrospector {
+ 
+-    /** 
++    /**
+      * <p>Return true iff <code>object</code> represents a JAXB element.</p>
+      * <p>Parameter <code>object</code> is a JAXB element for following cases:
+      * <ol>
+      *   <li>It is an instance of <code>javax.xml.bind.JAXBElement</code>.</li>
+-     *   <li>The class of <code>object</code> is annotated with 
++     *   <li>The class of <code>object</code> is annotated with
+      *       <code>&#64XmlRootElement</code>.
+      *   </li>
+      * </ol>
+@@ -63,7 +63,7 @@
+      * <p>Get xml element qname for <code>jaxbElement</code>.</p>
+      *
+      * @param jaxbElement is an object that {@link #isElement(Object)} returned true.
+-     *                    
++     *
+      * @return xml element qname associated with jaxbElement;
+      *         null if <code>jaxbElement</code> is not a JAXB Element.
+      */
+@@ -72,8 +72,8 @@
+     /**
+      * <p>Get the element value of a JAXB element.</p>
+      *
+-     * <p>Convenience method to abstract whether working with either 
+-     *    a javax.xml.bind.JAXBElement instance or an instance of 
++     * <p>Convenience method to abstract whether working with either
++     *    a javax.xml.bind.JAXBElement instance or an instance of
+      *    <tt>&#64XmlRootElement</tt> annotated Java class.</p>
+      *
+      * @param jaxbElement  object that #isElement(Object) returns true.
+@@ -81,12 +81,12 @@
+      * @return The element value of the <code>jaxbElement</code>.
+      */
+     public static Object getValue(Object jaxbElement) {
+-	if (jaxbElement instanceof JAXBElement) {
+-	    return ((JAXBElement)jaxbElement).getValue();
+-	} else {
+-	    // assume that class of this instance is 
+-	    // annotated with @XmlRootElement.
+-	    return jaxbElement;
+-	}
++        if (jaxbElement instanceof JAXBElement) {
++            return ((JAXBElement)jaxbElement).getValue();
++        } else {
++            // assume that class of this instance is
++            // annotated with @XmlRootElement.
++            return jaxbElement;
++        }
+     }
+ }
+--- old/src/share/classes/javax/xml/bind/MarshalException.java	Thu Jul 30 18:48:09 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/bind/MarshalException.java	Thu Jul 30 18:48:08 2009
+@@ -28,15 +28,15 @@
+ /**
+  * This exception indicates that an error has occurred while performing
+  * a marshal operation that the provider is unable to recover from.
+- * 
++ *
+  * <p>
+  * The <tt>ValidationEventHandler</tt> can cause this exception to be thrown
+- * during the marshal operations.  See 
++ * during the marshal operations.  See
+  * {@link ValidationEventHandler#handleEvent(ValidationEvent)
+  * ValidationEventHandler.handleEvent(ValidationEvent)}.
+  *
+  * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li></ul>
+- * @version $Revision: 1.2 $
++ * @version $Revision: 1.1 $
+  * @see JAXBException
+  * @see Marshaller
+  * @since JAXB1.0
+@@ -43,8 +43,8 @@
+  */
+ public class MarshalException extends JAXBException {
+ 
+-    /** 
+-     * Construct a MarshalException with the specified detail message.  The 
++    /**
++     * Construct a MarshalException with the specified detail message.  The
+      * errorCode and linkedException will default to null.
+      *
+      * @param message a description of the exception
+@@ -53,8 +53,8 @@
+         this( message, null, null );
+     }
+ 
+-    /** 
+-     * Construct a MarshalException with the specified detail message and vendor 
++    /**
++     * Construct a MarshalException with the specified detail message and vendor
+      * specific errorCode.  The linkedException will default to null.
+      *
+      * @param message a description of the exception
+@@ -64,7 +64,7 @@
+         this( message, errorCode, null );
+     }
+ 
+-    /** 
++    /**
+      * Construct a MarshalException with a linkedException.  The detail message and
+      * vendor specific errorCode will default to null.
+      *
+@@ -73,9 +73,9 @@
+     public MarshalException( Throwable exception ) {
+         this( null, null, exception );
+     }
+-    
+-    /** 
+-     * Construct a MarshalException with the specified detail message and 
++
++    /**
++     * Construct a MarshalException with the specified detail message and
+      * linkedException.  The errorCode will default to null.
+      *
+      * @param message a description of the exception
+@@ -84,9 +84,9 @@
+     public MarshalException( String message, Throwable exception ) {
+         this( message, null, exception );
+     }
+-    
+-    /** 
+-     * Construct a MarshalException with the specified detail message, vendor 
++
++    /**
++     * Construct a MarshalException with the specified detail message, vendor
+      * specific errorCode, and linkedException.
+      *
+      * @param message a description of the exception
+@@ -98,5 +98,3 @@
+     }
+ 
+ }
+-
+-
+--- old/src/share/classes/javax/xml/bind/Marshaller.java	Thu Jul 30 18:48:13 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/bind/Marshaller.java	Thu Jul 30 18:48:12 2009
+@@ -47,7 +47,7 @@
+  *       Marshaller m = jc.createMarshaller();
+  *    </pre>
+  * </blockquote>
+- * 
++ *
+  * <p>
+  * Marshalling to a File:
+  * <blockquote>
+@@ -62,7 +62,7 @@
+  * <blockquote>
+  *    <pre>
+  *       // assume MyContentHandler instanceof ContentHandler
+- *       m.marshal( element, new MyContentHandler() );  
++ *       m.marshal( element, new MyContentHandler() );
+  *    </pre>
+  * </blockquote>
+  *
+@@ -111,7 +111,7 @@
+  * <blockquote>
+  *    <pre>
+  *       DOMResult result = new DOMResult();
+- *       
++ *
+  *       m.marshal( element, result );
+  *    </pre>
+  * </blockquote>
+@@ -121,7 +121,7 @@
+  * <blockquote>
+  *    <pre>
+  *       StreamResult result = new StreamResult( System.out );
+- * 
++ *
+  *       m.marshal( element, result );
+  *    </pre>
+  * </blockquote>
+@@ -130,9 +130,9 @@
+  * Marshalling to a javax.xml.stream.XMLStreamWriter:
+  * <blockquote>
+  *    <pre>
+- *       XMLStreamWriter xmlStreamWriter = 
++ *       XMLStreamWriter xmlStreamWriter =
+  *           XMLOutputFactory.newInstance().createXMLStreamWriter( ... );
+- * 
++ *
+  *       m.marshal( element, xmlStreamWriter );
+  *    </pre>
+  * </blockquote>
+@@ -141,9 +141,9 @@
+  * Marshalling to a javax.xml.stream.XMLEventWriter:
+  * <blockquote>
+  *    <pre>
+- *       XMLEventWriter xmlEventWriter = 
++ *       XMLEventWriter xmlEventWriter =
+  *           XMLOutputFactory.newInstance().createXMLEventWriter( ... );
+- * 
++ *
+  *       m.marshal( element, xmlEventWriter );
+  *    </pre>
+  * </blockquote>
+@@ -152,17 +152,17 @@
+  * <a name="elementMarshalling"></a>
+  * <b>Marshalling content tree rooted by a JAXB element</b><br>
+  * <blockquote>
+- * The first parameter of the overloaded 
+- * <tt>Marshaller.marshal(java.lang.Object, ...)</tt> methods must be a 
+- * JAXB element as computed by 
+- * {@link JAXBIntrospector#isElement(java.lang.Object)}; 
+- * otherwise, a <tt>Marshaller.marshal</tt> method must throw a 
+- * {@link MarshalException}. There exist two mechanisms 
++ * The first parameter of the overloaded
++ * <tt>Marshaller.marshal(java.lang.Object, ...)</tt> methods must be a
++ * JAXB element as computed by
++ * {@link JAXBIntrospector#isElement(java.lang.Object)};
++ * otherwise, a <tt>Marshaller.marshal</tt> method must throw a
++ * {@link MarshalException}. There exist two mechanisms
+  * to enable marshalling an instance that is not a JAXB element.
+- * One method is to wrap the instance as a value of a {@link JAXBElement}, 
+- * and pass the wrapper element as the first parameter to 
+- * a <tt>Marshaller.marshal</tt> method. For java to schema binding, it 
+- * is also possible to simply annotate the instance's class with 
++ * One method is to wrap the instance as a value of a {@link JAXBElement},
++ * and pass the wrapper element as the first parameter to
++ * a <tt>Marshaller.marshal</tt> method. For java to schema binding, it
++ * is also possible to simply annotate the instance's class with
+  * &#64;{@link XmlRootElement}.
+  * </blockquote>
+  *
+@@ -170,26 +170,26 @@
+  * <b>Encoding</b><br>
+  * <blockquote>
+  * By default, the Marshaller will use UTF-8 encoding when generating XML data
+- * to a <tt>java.io.OutputStream</tt>, or a <tt>java.io.Writer</tt>.  Use the 
+- * {@link #setProperty(String,Object) setProperty} API to change the output 
++ * to a <tt>java.io.OutputStream</tt>, or a <tt>java.io.Writer</tt>.  Use the
++ * {@link #setProperty(String,Object) setProperty} API to change the output
+  * encoding used during these marshal operations.  Client applications are
+  * expected to supply a valid character encoding name as defined in the
+  * <a href="http://www.w3.org/TR/2000/REC-xml-20001006#charencoding">W3C XML 1.0
+- * Recommendation</a> and supported by your 
++ * Recommendation</a> and supported by your
+  * <a href="http://java.sun.com/j2se/1.3/docs/api/java/lang/package-summary.html#charenc">
+  * Java Platform</a>.
+  * </blockquote>
+- * 
++ *
+  * <p>
+  * <b>Validation and Well-Formedness</b><br>
+  * <blockquote>
+  * <p>
+  * Client applications are not required to validate the Java content tree prior
+- * to calling any of the marshal API's.  Furthermore, there is no requirement 
++ * to calling any of the marshal API's.  Furthermore, there is no requirement
+  * that the Java content tree be valid with respect to its original schema in
+- * order to marshal it back into XML data.  Different JAXB Providers will 
++ * order to marshal it back into XML data.  Different JAXB Providers will
+  * support marshalling invalid Java content trees at varying levels, however
+- * all JAXB Providers must be able to marshal a valid content tree back to 
++ * all JAXB Providers must be able to marshal a valid content tree back to
+  * XML data.  A JAXB Provider must throw a <tt>MarshalException</tt> when it
+  * is unable to complete the marshal operation due to invalid content.  Some
+  * JAXB Providers will fully allow marshalling invalid content, others will fail
+@@ -196,7 +196,7 @@
+  * on the first validation error.
+  * <p>
+  * Even when schema validation is not explictly enabled for the marshal operation,
+- * it is possible that certain types of validation events will be detected 
++ * it is possible that certain types of validation events will be detected
+  * during the operation.  Validation events will be reported to the registered
+  * event handler.  If the client application has not registered an event handler
+  * prior to invoking one of the marshal API's, then events will be delivered to
+@@ -204,7 +204,7 @@
+  * encountering the first error or fatal error. Note that for JAXB 2.0 and
+  * later versions, {@link javax.xml.bind.helpers.DefaultValidationEventHandler} is
+  * no longer used.
+- * 
++ *
+  * </blockquote>
+  *
+  * <p>
+@@ -217,36 +217,36 @@
+  * <dl>
+  *   <dt><tt>jaxb.encoding</tt> - value must be a java.lang.String</dd>
+  *   <dd>The output encoding to use when marshalling the XML data.  The
+- * 		 Marshaller will use "UTF-8" by default if this property is not
+- *  	 specified.</dd>
++ *               Marshaller will use "UTF-8" by default if this property is not
++ *       specified.</dd>
+  *   <dt><tt>jaxb.formatted.output</tt> - value must be a java.lang.Boolean</dd>
+  *   <dd>This property controls whether or not the Marshaller will format
+- * 	 the resulting XML data with line breaks and indentation.  A
+- *       true value for this property indicates human readable indented 
++ *       the resulting XML data with line breaks and indentation.  A
++ *       true value for this property indicates human readable indented
+  *       xml data, while a false value indicates unformatted xml data.
+- *       The Marshaller will default to false (unformatted) if this 
++ *       The Marshaller will default to false (unformatted) if this
+  *       property is not specified.</dd>
+  *   <dt><tt>jaxb.schemaLocation</tt> - value must be a java.lang.String</dd>
+  *   <dd>This property allows the client application to specify an
+- *       xsi:schemaLocation attribute in the generated XML data.  The format of 
+- *       the schemaLocation attribute value is discussed in an easy to 
+- *       understand, non-normative form in 
+- *       <a href="http://www.w3.org/TR/xmlschema-0/#schemaLocation">Section 5.6 
+- *       of the W3C XML Schema Part 0: Primer</a> and specified in 
++ *       xsi:schemaLocation attribute in the generated XML data.  The format of
++ *       the schemaLocation attribute value is discussed in an easy to
++ *       understand, non-normative form in
++ *       <a href="http://www.w3.org/TR/xmlschema-0/#schemaLocation">Section 5.6
++ *       of the W3C XML Schema Part 0: Primer</a> and specified in
+  *       <a href="http://www.w3.org/TR/xmlschema-1/#Instance_Document_Constructions">
+  *       Section 2.6 of the W3C XML Schema Part 1: Structures</a>.</dd>
+  *   <dt><tt>jaxb.noNamespaceSchemaLocation</tt> - value must be a java.lang.String</dd>
+  *   <dd>This property allows the client application to specify an
+- *       xsi:noNamespaceSchemaLocation attribute in the generated XML 
+- *       data.  The format of the schemaLocation attribute value is discussed in 
+- *       an easy to understand, non-normative form in 
+- *       <a href="http://www.w3.org/TR/xmlschema-0/#schemaLocation">Section 5.6 
+- *       of the W3C XML Schema Part 0: Primer</a> and specified in 
++ *       xsi:noNamespaceSchemaLocation attribute in the generated XML
++ *       data.  The format of the schemaLocation attribute value is discussed in
++ *       an easy to understand, non-normative form in
++ *       <a href="http://www.w3.org/TR/xmlschema-0/#schemaLocation">Section 5.6
++ *       of the W3C XML Schema Part 0: Primer</a> and specified in
+  *       <a href="http://www.w3.org/TR/xmlschema-1/#Instance_Document_Constructions">
+  *       Section 2.6 of the W3C XML Schema Part 1: Structures</a>.</dd>
+  *   <dt><tt>jaxb.fragment</tt> - value must be a java.lang.Boolean</dd>
+  *   <dd>This property determines whether or not document level events will be
+- *       generated by the Marshaller.  If the property is not specified, the 
++ *       generated by the Marshaller.  If the property is not specified, the
+  *       default is <tt>false</tt>. This property has different implications depending
+  *       on which marshal api you are using - when this property is set to true:<br>
+  *       <ul>
+@@ -271,7 +271,7 @@
+  *   </dd>
+  * </dl>
+  * </blockquote>
+- * 
++ *
+  * <p>
+  * <a name="marshalEventCallback"></a>
+  * <b>Marshal Event Callbacks</b><br>
+@@ -284,22 +284,22 @@
+  * of marshal events in one callback method rather than by type event callbacks.
+  *
+  * <p>
+- * Class defined event callback methods allow any JAXB mapped class to specify 
++ * Class defined event callback methods allow any JAXB mapped class to specify
+  * its own specific callback methods by defining methods with the following method signatures:
+  * <blockquote>
+  * <pre>
+  *   // Invoked by Marshaller after it has created an instance of this object.
+  *   boolean beforeMarshal(Marshaller);
+- * 
++ *
+  *   // Invoked by Marshaller after it has marshalled all properties of this object.
+  *   void afterMmarshal(Marshaller);
+  * </pre>
+  * </blockquote>
+  * The class defined event callback methods should be used when the callback method requires
+- * access to non-public methods and/or fields of the class. 
++ * access to non-public methods and/or fields of the class.
+  * <p>
+- * The external listener callback mechanism enables the registration of a {@link Listener} 
+- * instance with a {@link Marshaller#setListener(Listener)}. The external listener receives all callback events, 
++ * The external listener callback mechanism enables the registration of a {@link Listener}
++ * instance with a {@link Marshaller#setListener(Listener)}. The external listener receives all callback events,
+  * allowing for more centralized processing than per class defined callback methods.
+  * <p>
+  * The 'class defined' and external listener event callback methods are independent of each other,
+@@ -308,9 +308,9 @@
+  * <p>
+  * An event callback method throwing an exception terminates the current marshal process.
+  * </blockquote>
+- * 
++ *
+  * @author <ul><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul>
+- * @version $Revision$ $Date$
++ * @version $Revision: 1.21 $ $Date: 2006/08/28 17:56:41 $
+  * @see JAXBContext
+  * @see Validator
+  * @see Unmarshaller
+@@ -326,8 +326,8 @@
+         "jaxb.encoding";
+ 
+     /**
+-     * The name of the property used to specify whether or not the marshalled 
+-     * XML data is formatted with linefeeds and indentation. 
++     * The name of the property used to specify whether or not the marshalled
++     * XML data is formatted with linefeeds and indentation.
+      */
+     public static final String JAXB_FORMATTED_OUTPUT =
+         "jaxb.formatted.output";
+@@ -355,27 +355,27 @@
+         "jaxb.fragment";
+ 
+     /**
+-     * Marshal the content tree rooted at <tt>jaxbElement</tt> into the specified 
++     * Marshal the content tree rooted at <tt>jaxbElement</tt> into the specified
+      * <tt>javax.xml.transform.Result</tt>.
+-     * 
++     *
+      * <p>
+      * All JAXB Providers must at least support
+      * {@link javax.xml.transform.dom.DOMResult},
+      * {@link javax.xml.transform.sax.SAXResult}, and
+-     * {@link javax.xml.transform.stream.StreamResult}. It can 
++     * {@link javax.xml.transform.stream.StreamResult}. It can
+      * support other derived classes of <tt>Result</tt> as well.
+-     * 
++     *
+      * @param jaxbElement
+-     *      The root of content tree to be marshalled. 
++     *      The root of content tree to be marshalled.
+      * @param result
+      *      XML will be sent to this Result
+-     * 
++     *
+      * @throws JAXBException
+      *      If any unexpected problem occurs during the marshalling.
+      * @throws MarshalException
+      *      If the {@link ValidationEventHandler ValidationEventHandler}
+-     *      returns false from its <tt>handleEvent</tt> method or the 
+-     *      <tt>Marshaller</tt> is unable to marshal <tt>obj</tt> (or any 
++     *      returns false from its <tt>handleEvent</tt> method or the
++     *      <tt>Marshaller</tt> is unable to marshal <tt>obj</tt> (or any
+      *      object reachable from <tt>obj</tt>).  See <a href="#elementMarshalling">
+      *      Marshalling a JAXB element</a>.
+      * @throws IllegalArgumentException
+@@ -386,18 +386,18 @@
+ 
+     /**
+      * Marshal the content tree rooted at <tt>jaxbElement</tt> into an output stream.
+-     * 
++     *
+      * @param jaxbElement
+-     *      The root of content tree to be marshalled. 
++     *      The root of content tree to be marshalled.
+      * @param os
+      *      XML will be added to this stream.
+-     * 
++     *
+      * @throws JAXBException
+      *      If any unexpected problem occurs during the marshalling.
+      * @throws MarshalException
+      *      If the {@link ValidationEventHandler ValidationEventHandler}
+-     *      returns false from its <tt>handleEvent</tt> method or the 
+-     *      <tt>Marshaller</tt> is unable to marshal <tt>obj</tt> (or any 
++     *      returns false from its <tt>handleEvent</tt> method or the
++     *      <tt>Marshaller</tt> is unable to marshal <tt>obj</tt> (or any
+      *      object reachable from <tt>obj</tt>).  See <a href="#elementMarshalling">
+      *      Marshalling a JAXB element</a>.
+      * @throws IllegalArgumentException
+@@ -431,18 +431,18 @@
+ 
+     /**
+      * Marshal the content tree rooted at <tt>jaxbElement</tt> into a Writer.
+-     * 
++     *
+      * @param jaxbElement
+-     *      The root of content tree to be marshalled. 
++     *      The root of content tree to be marshalled.
+      * @param writer
+      *      XML will be sent to this writer.
+-     * 
++     *
+      * @throws JAXBException
+      *      If any unexpected problem occurs during the marshalling.
+      * @throws MarshalException
+      *      If the {@link ValidationEventHandler ValidationEventHandler}
+-     *      returns false from its <tt>handleEvent</tt> method or the 
+-     *      <tt>Marshaller</tt> is unable to marshal <tt>obj</tt> (or any 
++     *      returns false from its <tt>handleEvent</tt> method or the
++     *      <tt>Marshaller</tt> is unable to marshal <tt>obj</tt> (or any
+      *      object reachable from <tt>obj</tt>).  See <a href="#elementMarshalling">
+      *      Marshalling a JAXB element</a>.
+      * @throws IllegalArgumentException
+@@ -453,18 +453,18 @@
+ 
+     /**
+      * Marshal the content tree rooted at <tt>jaxbElement</tt> into SAX2 events.
+-     * 
++     *
+      * @param jaxbElement
+-     *      The root of content tree to be marshalled. 
++     *      The root of content tree to be marshalled.
+      * @param handler
+      *      XML will be sent to this handler as SAX2 events.
+-     * 
++     *
+      * @throws JAXBException
+      *      If any unexpected problem occurs during the marshalling.
+      * @throws MarshalException
+      *      If the {@link ValidationEventHandler ValidationEventHandler}
+-     *      returns false from its <tt>handleEvent</tt> method or the 
+-     *      <tt>Marshaller</tt> is unable to marshal <tt>obj</tt> (or any 
++     *      returns false from its <tt>handleEvent</tt> method or the
++     *      <tt>Marshaller</tt> is unable to marshal <tt>obj</tt> (or any
+      *      object reachable from <tt>obj</tt>).  See <a href="#elementMarshalling">
+      *      Marshalling a JAXB element</a>.
+      * @throws IllegalArgumentException
+@@ -475,9 +475,9 @@
+ 
+     /**
+      * Marshal the content tree rooted at <tt>jaxbElement</tt> into a DOM tree.
+-     * 
++     *
+      * @param jaxbElement
+-     *      The content tree to be marshalled. 
++     *      The content tree to be marshalled.
+      * @param node
+      *      DOM nodes will be added as children of this node.
+      *      This parameter must be a Node that accepts children
+@@ -484,13 +484,13 @@
+      *      ({@link org.w3c.dom.Document},
+      *      {@link  org.w3c.dom.DocumentFragment}, or
+      *      {@link  org.w3c.dom.Element})
+-     * 
++     *
+      * @throws JAXBException
+      *      If any unexpected problem occurs during the marshalling.
+      * @throws MarshalException
+      *      If the {@link ValidationEventHandler ValidationEventHandler}
+-     *      returns false from its <tt>handleEvent</tt> method or the 
+-     *      <tt>Marshaller</tt> is unable to marshal <tt>jaxbElement</tt> (or any 
++     *      returns false from its <tt>handleEvent</tt> method or the
++     *      <tt>Marshaller</tt> is unable to marshal <tt>jaxbElement</tt> (or any
+      *      object reachable from <tt>jaxbElement</tt>).  See <a href="#elementMarshalling">
+      *      Marshalling a JAXB element</a>.
+      * @throws IllegalArgumentException
+@@ -502,18 +502,18 @@
+     /**
+      * Marshal the content tree rooted at <tt>jaxbElement</tt> into a
+      * {@link javax.xml.stream.XMLStreamWriter}.
+-     * 
++     *
+      * @param jaxbElement
+-     *      The content tree to be marshalled. 
++     *      The content tree to be marshalled.
+      * @param writer
+      *      XML will be sent to this writer.
+-     * 
++     *
+      * @throws JAXBException
+      *      If any unexpected problem occurs during the marshalling.
+      * @throws MarshalException
+      *      If the {@link ValidationEventHandler ValidationEventHandler}
+-     *      returns false from its <tt>handleEvent</tt> method or the 
+-     *      <tt>Marshaller</tt> is unable to marshal <tt>obj</tt> (or any 
++     *      returns false from its <tt>handleEvent</tt> method or the
++     *      <tt>Marshaller</tt> is unable to marshal <tt>obj</tt> (or any
+      *      object reachable from <tt>obj</tt>).  See <a href="#elementMarshalling">
+      *      Marshalling a JAXB element</a>.
+      * @throws IllegalArgumentException
+@@ -526,18 +526,18 @@
+     /**
+      * Marshal the content tree rooted at <tt>jaxbElement</tt> into a
+      * {@link javax.xml.stream.XMLEventWriter}.
+-     * 
++     *
+      * @param jaxbElement
+-     *      The content tree rooted at jaxbElement to be marshalled. 
++     *      The content tree rooted at jaxbElement to be marshalled.
+      * @param writer
+      *      XML will be sent to this writer.
+-     * 
++     *
+      * @throws JAXBException
+      *      If any unexpected problem occurs during the marshalling.
+      * @throws MarshalException
+      *      If the {@link ValidationEventHandler ValidationEventHandler}
+-     *      returns false from its <tt>handleEvent</tt> method or the 
+-     *      <tt>Marshaller</tt> is unable to marshal <tt>obj</tt> (or any 
++     *      returns false from its <tt>handleEvent</tt> method or the
++     *      <tt>Marshaller</tt> is unable to marshal <tt>obj</tt> (or any
+      *      object reachable from <tt>obj</tt>).  See <a href="#elementMarshalling">
+      *      Marshalling a JAXB element</a>.
+      * @throws IllegalArgumentException
+@@ -549,20 +549,20 @@
+ 
+     /**
+      * Get a DOM tree view of the content tree(Optional).
+-     * 
+-     * If the returned DOM tree is updated, these changes are also 
+-     * visible in the content tree. 
++     *
++     * If the returned DOM tree is updated, these changes are also
++     * visible in the content tree.
+      * Use {@link #marshal(Object, org.w3c.dom.Node)} to force
+      * a deep copy of the content tree to a DOM representation.
+-     * 
++     *
+      * @param contentTree - JAXB Java representation of XML content
+-     * 
++     *
+      * @return the DOM tree view of the contentTree
+-     * 
++     *
+      * @throws UnsupportedOperationException
+      *      If the JAXB provider implementation does not support a
+      *      DOM view of the content tree
+-     * 
++     *
+      * @throws IllegalArgumentException
+      *      If any of the method parameters are null
+      *
+@@ -574,7 +574,7 @@
+         throws JAXBException;
+ 
+     /**
+-     * Set the particular property in the underlying implementation of 
++     * Set the particular property in the underlying implementation of
+      * <tt>Marshaller</tt>.  This method can only be used to set one of
+      * the standard JAXB defined properties above or a provider specific
+      * property.  Attempting to set an undefined property will result in
+@@ -582,7 +582,7 @@
+      * Supported Properties</a>.
+      *
+      * @param name the name of the property to be set. This value can either
+-     *              be specified using one of the constant fields or a user 
++     *              be specified using one of the constant fields or a user
+      *              supplied string.
+      * @param value the value of the property to be set
+      *
+@@ -595,7 +595,7 @@
+         throws PropertyException;
+ 
+     /**
+-     * Get the particular property in the underlying implementation of 
++     * Get the particular property in the underlying implementation of
+      * <tt>Marshaller</tt>.  This method can only be used to get one of
+      * the standard JAXB defined properties above or a provider specific
+      * property.  Attempting to get an undefined property will result in
+@@ -618,14 +618,14 @@
+      * <p>
+      * The validation event handler will be called by the JAXB Provider if any
+      * validation errors are encountered during calls to any of the marshal
+-     * API's.  If the client application does not register a validation event 
+-     * handler before invoking one of the marshal methods, then validation 
+-     * events will be handled by the default event handler which will terminate 
++     * API's.  If the client application does not register a validation event
++     * handler before invoking one of the marshal methods, then validation
++     * events will be handled by the default event handler which will terminate
+      * the marshal operation after the first error or fatal error is encountered.
+      * <p>
+      * Calling this method with a null parameter will cause the Marshaller
+      * to revert back to the default default event handler.
+-     * 
++     *
+      * @param handler the validation event handler
+      * @throws JAXBException if an error was encountered while setting the
+      *         event handler
+@@ -639,7 +639,7 @@
+      *
+      * @return the current ValidationEventHandler or the default event handler
+      *         if it hasn't been set
+-     * @throws JAXBException if an error was encountered while getting the 
++     * @throws JAXBException if an error was encountered while getting the
+      *         current event handler
+      */
+     public ValidationEventHandler getEventHandler()
+@@ -804,7 +804,7 @@
+     /**
+      * <p>
+      * Register marshal event callback {@link Listener} with this {@link Marshaller}.
+-     * 
++     *
+      * <p>
+      * There is only one Listener per Marshaller. Setting a Listener replaces the previous set Listener.
+      * One can unregister current Listener by setting listener to <tt>null</tt>.
+@@ -816,13 +816,9 @@
+ 
+     /**
+      * <p>Return {@link Listener} registered with this {@link Marshaller}.
+-     * 
++     *
+      * @return registered {@link Listener} or <code>null</code> if no Listener is registered with this Marshaller.
+      * @since JAXB2.0
+      */
+     public Listener getListener();
+ }
+-
+-
+-
+-
+--- old/src/share/classes/javax/xml/bind/Messages.java	Thu Jul 30 18:48:16 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/bind/Messages.java	Thu Jul 30 18:48:16 2009
+@@ -36,27 +36,27 @@
+     static String format( String property ) {
+         return format( property, null );
+     }
+-    
++
+     static String format( String property, Object arg1 ) {
+         return format( property, new Object[]{arg1} );
+     }
+-    
++
+     static String format( String property, Object arg1, Object arg2 ) {
+         return format( property, new Object[]{arg1,arg2} );
+     }
+-    
++
+     static String format( String property, Object arg1, Object arg2, Object arg3 ) {
+         return format( property, new Object[]{arg1,arg2,arg3} );
+     }
+-    
++
+     // add more if necessary.
+-    
++
+     /** Loads a string resource and formats it with specified arguments. */
+     static String format( String property, Object[] args ) {
+         String text = ResourceBundle.getBundle(Messages.class.getName()).getString(property);
+         return MessageFormat.format(text,args);
+     }
+-    
++
+ //
+ //
+ // Message resources
+@@ -67,13 +67,13 @@
+ 
+     static final String COULD_NOT_INSTANTIATE = // 2 args
+         "ContextFinder.CouldNotInstantiate";
+-        
++
+     static final String CANT_FIND_PROPERTIES_FILE = // 1 arg
+         "ContextFinder.CantFindPropertiesFile";
+-        
++
+     static final String CANT_MIX_PROVIDERS = // 0 args
+         "ContextFinder.CantMixProviders";
+-        
++
+     static final String MISSING_PROPERTY = // 2 args
+         "ContextFinder.MissingProperty";
+ 
+@@ -82,7 +82,7 @@
+ 
+     static final String NAME_VALUE = // 2 args
+         "PropertyException.NameValue";
+-        
++
+     static final String CONVERTER_MUST_NOT_BE_NULL = // 0 args
+         "DatatypeConverter.ConverterMustNotBeNull";
+ 
+--- old/src/share/classes/javax/xml/bind/Messages.properties	Thu Jul 30 18:48:20 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/bind/Messages.properties	Thu Jul 30 18:48:19 2009
+@@ -24,28 +24,28 @@
+ #
+ 
+ ContextFinder.ProviderNotFound = \
+-	Provider {0} not found
+-	
++        Provider {0} not found
++
+ ContextFinder.CouldNotInstantiate = \
+-	Provider {0} could not be instantiated: {1}	
++        Provider {0} could not be instantiated: {1}
+ 
+ ContextFinder.CantFindPropertiesFile = \
+-	Unable to locate jaxb.properties for package {0}
+-	
++        Unable to locate jaxb.properties for package {0}
++
+ ContextFinder.CantMixProviders = \
+-	You may not mix JAXB Providers on the context path
+-	
++        You may not mix JAXB Providers on the context path
++
+ ContextFinder.MissingProperty = \
+-	jaxb.properties in package {0} does not contain the {1} property.
++        jaxb.properties in package {0} does not contain the {1} property.
+ 
+ ContextFinder.NoPackageInContextPath = \
+     No package name is given
+ 
+ PropertyException.NameValue = \
+-	name: {0} value: {1}
+-	
++        name: {0} value: {1}
++
+ DatatypeConverter.ConverterMustNotBeNull = \
+-	The DatatypeConverterInterface parameter must not be null
+-	
++        The DatatypeConverterInterface parameter must not be null
++
+ JAXBContext.IllegalCast = \
+- 
++    ClassCastException: attempting to cast {0} to {1}.  Please make sure that you are specifying the proper ClassLoader.
+--- old/src/share/classes/javax/xml/bind/NotIdentifiableEvent.java	Thu Jul 30 18:48:23 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/bind/NotIdentifiableEvent.java	Thu Jul 30 18:48:22 2009
+@@ -27,10 +27,10 @@
+ 
+ /**
+  * This event indicates that a problem was encountered resolving an ID/IDREF.
+- * 
+- * 
+- * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul> 
+- * @version $Revision: 1.2 $
++ *
++ *
++ * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul>
++ * @version $Revision: 1.1 $
+  * @see Validator
+  * @see ValidationEventHandler
+  * @since JAXB1.0
+--- old/src/share/classes/javax/xml/bind/ParseConversionEvent.java	Thu Jul 30 18:48:26 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/bind/ParseConversionEvent.java	Thu Jul 30 18:48:26 2009
+@@ -28,9 +28,9 @@
+ /**
+  * This event indicates that a problem was encountered while converting a
+  * string from the XML data into a value of the target Java data type.
+- * 
+- * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul> 
+- * @version $Revision: 1.2 $
++ *
++ * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul>
++ * @version $Revision: 1.1 $
+  * @see ValidationEvent
+  * @see ValidationEventHandler
+  * @see Unmarshaller
+--- old/src/share/classes/javax/xml/bind/PrintConversionEvent.java	Thu Jul 30 18:48:30 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/bind/PrintConversionEvent.java	Thu Jul 30 18:48:29 2009
+@@ -28,9 +28,9 @@
+ /**
+  * This event indicates that a problem was encountered while converting data
+  * from the Java content tree into its lexical representation.
+- * 
+- * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul> 
+- * @version $Revision: 1.2 $
++ *
++ * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul>
++ * @version $Revision: 1.1 $
+  * @see ValidationEvent
+  * @see ValidationEventHandler
+  * @see Marshaller
+--- old/src/share/classes/javax/xml/bind/PropertyException.java	Thu Jul 30 18:48:33 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/bind/PropertyException.java	Thu Jul 30 18:48:33 2009
+@@ -30,9 +30,9 @@
+ /**
+  * This exception indicates that an error was encountered while getting or
+  * setting a property.
+- * 
++ *
+  * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul>
+- * @version $Revision: 1.2 $ $Date: 2004/06/14 21:23:04 $
++ * @version $Revision: 1.1 $ $Date: 2004/12/14 21:50:40 $
+  * @see JAXBContext
+  * @see Validator
+  * @see Unmarshaller
+@@ -39,19 +39,19 @@
+  * @since JAXB1.0
+  */
+ public class PropertyException extends JAXBException {
+-    
+-    /** 
+-     * Construct a PropertyException with the specified detail message.  The 
++
++    /**
++     * Construct a PropertyException with the specified detail message.  The
+      * errorCode and linkedException will default to null.
+      *
+      * @param message a description of the exception
+      */
+     public PropertyException(String message) {
+-    	super(message);
++        super(message);
+     }
+-    
+-    /** 
+-     * Construct a PropertyException with the specified detail message and 
++
++    /**
++     * Construct a PropertyException with the specified detail message and
+      * vendor specific errorCode.  The linkedException will default to null.
+      *
+      * @param message a description of the exception
+@@ -58,21 +58,21 @@
+      * @param errorCode a string specifying the vendor specific error code
+      */
+     public PropertyException(String message, String errorCode) {
+-    	super(message, errorCode);
++        super(message, errorCode);
+     }
+-    
+-    /** 
+-     * Construct a PropertyException with a linkedException.  The detail 
++
++    /**
++     * Construct a PropertyException with a linkedException.  The detail
+      * message and vendor specific errorCode will default to null.
+      *
+      * @param exception the linked exception
+      */
+     public PropertyException(Throwable exception) {
+-    	super(exception);
++        super(exception);
+     }
+-    
+-    /** 
+-     * Construct a PropertyException with the specified detail message and 
++
++    /**
++     * Construct a PropertyException with the specified detail message and
+      * linkedException.  The errorCode will default to null.
+      *
+      * @param message a description of the exception
+@@ -79,11 +79,11 @@
+      * @param exception the linked exception
+      */
+     public PropertyException(String message, Throwable exception) {
+-    	super(message, exception);
++        super(message, exception);
+     }
+-    
+-    /** 
+-     * Construct a PropertyException with the specified detail message, vendor 
++
++    /**
++     * Construct a PropertyException with the specified detail message, vendor
+      * specific errorCode, and linkedException.
+      *
+      * @param message a description of the exception
+@@ -91,24 +91,24 @@
+      * @param exception the linked exception
+      */
+     public PropertyException(
+-    	String message,
+-    	String errorCode,
+-    	Throwable exception) {
+-    	super(message, errorCode, exception);
++        String message,
++        String errorCode,
++        Throwable exception) {
++        super(message, errorCode, exception);
+     }
+-    
++
+     /**
+-     * Construct a PropertyException whose message field is set based on the 
+-     * name of the property and value.toString(). 
+-     * 
++     * Construct a PropertyException whose message field is set based on the
++     * name of the property and value.toString().
++     *
+      * @param name the name of the property related to this exception
+      * @param value the value of the property related to this exception
+      */
+     public PropertyException(String name, Object value) {
+-    	super( Messages.format( Messages.NAME_VALUE, 
+-                                        name, 
++        super( Messages.format( Messages.NAME_VALUE,
++                                        name,
+                                         value.toString() ) );
+     }
+-    
+-    
++
++
+ }
+--- old/src/share/classes/javax/xml/bind/UnmarshalException.java	Thu Jul 30 18:48:40 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/bind/UnmarshalException.java	Thu Jul 30 18:48:39 2009
+@@ -29,15 +29,15 @@
+  * This exception indicates that an error has occurred while performing
+  * an unmarshal operation that prevents the JAXB Provider from completing
+  * the operation.
+- * 
++ *
+  * <p>
+  * The <tt>ValidationEventHandler</tt> can cause this exception to be thrown
+- * during the unmarshal operations.  See 
++ * during the unmarshal operations.  See
+  * {@link ValidationEventHandler#handleEvent(ValidationEvent)
+  * ValidationEventHandler.handleEvent(ValidationEvent)}.
+- * 
++ *
+  * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li></ul>
+- * @version $Revision: 1.2 $
++ * @version $Revision: 1.1 $
+  * @see JAXBException
+  * @see Unmarshaller
+  * @see ValidationEventHandler
+@@ -45,8 +45,8 @@
+  */
+ public class UnmarshalException extends JAXBException {
+ 
+-    /** 
+-     * Construct an UnmarshalException with the specified detail message.  The 
++    /**
++     * Construct an UnmarshalException with the specified detail message.  The
+      * errorCode and linkedException will default to null.
+      *
+      * @param message a description of the exception
+@@ -55,8 +55,8 @@
+         this( message, null, null );
+     }
+ 
+-    /** 
+-     * Construct an UnmarshalException with the specified detail message and vendor 
++    /**
++     * Construct an UnmarshalException with the specified detail message and vendor
+      * specific errorCode.  The linkedException will default to null.
+      *
+      * @param message a description of the exception
+@@ -66,7 +66,7 @@
+         this( message, errorCode, null );
+     }
+ 
+-    /** 
++    /**
+      * Construct an UnmarshalException with a linkedException.  The detail message and
+      * vendor specific errorCode will default to null.
+      *
+@@ -75,9 +75,9 @@
+     public UnmarshalException( Throwable exception ) {
+         this( null, null, exception );
+     }
+-    
+-    /** 
+-     * Construct an UnmarshalException with the specified detail message and 
++
++    /**
++     * Construct an UnmarshalException with the specified detail message and
+      * linkedException.  The errorCode will default to null.
+      *
+      * @param message a description of the exception
+@@ -86,9 +86,9 @@
+     public UnmarshalException( String message, Throwable exception ) {
+         this( message, null, exception );
+     }
+-    
+-    /** 
+-     * Construct an UnmarshalException with the specified detail message, vendor 
++
++    /**
++     * Construct an UnmarshalException with the specified detail message, vendor
+      * specific errorCode, and linkedException.
+      *
+      * @param message a description of the exception
+@@ -100,5 +100,3 @@
+     }
+ 
+ }
+-
+-
+--- old/src/share/classes/javax/xml/bind/Unmarshaller.java	Thu Jul 30 18:48:44 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/bind/Unmarshaller.java	Thu Jul 30 18:48:43 2009
+@@ -31,11 +31,11 @@
+ import java.io.Reader;
+ 
+ /**
+- * The <tt>Unmarshaller</tt> class governs the process of deserializing XML 
+- * data into newly created Java content trees, optionally validating the XML 
++ * The <tt>Unmarshaller</tt> class governs the process of deserializing XML
++ * data into newly created Java content trees, optionally validating the XML
+  * data as it is unmarshalled.  It provides an overloading of unmarshal methods
+  * for many different input kinds.
+- *    
++ *
+  * <p>
+  * Unmarshalling from a File:
+  * <blockquote>
+@@ -46,7 +46,7 @@
+  *    </pre>
+  * </blockquote>
+  *
+- *  
++ *
+  * <p>
+  * Unmarshalling from an InputStream:
+  * <blockquote>
+@@ -70,7 +70,7 @@
+  * </blockquote>
+  *
+  * <p>
+- * Unmarshalling from a StringBuffer using a 
++ * Unmarshalling from a StringBuffer using a
+  * <tt>javax.xml.transform.stream.StreamSource</tt>:
+  * <blockquote>
+  *    <pre>
+@@ -87,7 +87,7 @@
+  *    <pre>
+  *       JAXBContext jc = JAXBContext.newInstance( "com.acme.foo" );
+  *       Unmarshaller u = jc.createUnmarshaller();
+- * 
++ *
+  *       DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+  *       dbf.setNamespaceAware(true);
+  *       DocumentBuilder db = dbf.newDocumentBuilder();
+@@ -96,7 +96,7 @@
+  *       Object o = u.unmarshal( doc );
+  *    </pre>
+  * </blockquote>
+- * 
++ *
+  * <p>
+  * Unmarshalling from a <tt>javax.xml.transform.sax.SAXSource</tt> using a
+  * client specified validating SAX2.0 parser:
+@@ -117,7 +117,7 @@
+  *       spf.setNamespaceAware(true);
+  *       spf.setValidating(true);
+  *       SAXParser saxParser = spf.newSAXParser();
+- *       
++ *
+  *       try {
+  *           saxParser.setProperty(JAXP_SCHEMA_LANGUAGE, W3C_XML_SCHEMA);
+  *           saxParser.setProperty(JAXP_SCHEMA_LOCATION, "http://....");
+@@ -126,7 +126,7 @@
+  *       }
+  *
+  *       XMLReader xmlReader = saxParser.getXMLReader();
+- *       SAXSource source = 
++ *       SAXSource source =
+  *           new SAXSource( xmlReader, new InputSource( "http://..." ) );
+  *
+  *       // Setup JAXB to unmarshal
+@@ -134,8 +134,8 @@
+  *       Unmarshaller u = jc.createUnmarshaller();
+  *       ValidationEventCollector vec = new ValidationEventCollector();
+  *       u.setEventHandler( vec );
+- *       
+- *       // turn off the JAXB provider's default validation mechanism to 
++ *
++ *       // turn off the JAXB provider's default validation mechanism to
+  *       // avoid duplicate validation
+  *       u.setValidating( false )
+  *
+@@ -155,10 +155,10 @@
+  *    <pre>
+  *       JAXBContext jc = JAXBContext.newInstance( "com.acme.foo" );
+  *       Unmarshaller u = jc.createUnmarshaller();
+- * 
+- *       javax.xml.stream.XMLStreamReader xmlStreamReader = 
++ *
++ *       javax.xml.stream.XMLStreamReader xmlStreamReader =
+  *           javax.xml.stream.XMLInputFactory().newInstance().createXMLStreamReader( ... );
+- * 
++ *
+  *       Object o = u.unmarshal( xmlStreamReader );
+  *    </pre>
+  * </blockquote>
+@@ -169,10 +169,10 @@
+  *    <pre>
+  *       JAXBContext jc = JAXBContext.newInstance( "com.acme.foo" );
+  *       Unmarshaller u = jc.createUnmarshaller();
+- * 
+- *       javax.xml.stream.XMLEventReader xmlEventReader = 
++ *
++ *       javax.xml.stream.XMLEventReader xmlEventReader =
+  *           javax.xml.stream.XMLInputFactory().newInstance().createXMLEventReader( ... );
+- * 
++ *
+  *       Object o = u.unmarshal( xmlEventReader );
+  *    </pre>
+  * </blockquote>
+@@ -181,20 +181,20 @@
+  * <a name="unmarshalEx"></a>
+  * <b>Unmarshalling XML Data</b><br>
+  * <blockquote>
+- * Unmarshalling can deserialize XML data that represents either an entire XML document 
++ * Unmarshalling can deserialize XML data that represents either an entire XML document
+  * or a subtree of an XML document. Typically, it is sufficient to use the
+- * unmarshalling methods described by  
++ * unmarshalling methods described by
+  * <a href="#unmarshalGlobal">Unmarshal root element that is declared globally</a>.
+  * These unmarshal methods utilize {@link JAXBContext}'s mapping of global XML element
+- * declarations and type definitions to JAXB mapped classes to initiate the 
+- * unmarshalling of the root element of  XML data.  When the {@link JAXBContext}'s 
+- * mappings are not sufficient to unmarshal the root element of XML data, 
+- * the application can assist the unmarshalling process by using the 
++ * declarations and type definitions to JAXB mapped classes to initiate the
++ * unmarshalling of the root element of  XML data.  When the {@link JAXBContext}'s
++ * mappings are not sufficient to unmarshal the root element of XML data,
++ * the application can assist the unmarshalling process by using the
+  * <a href="#unmarshalByDeclaredType">unmarshal by declaredType methods</a>.
+  * These methods are useful for unmarshalling XML data where
+  * the root element corresponds to a local element declaration in the schema.
+  * </blockquote>
+- * 
++ *
+  * <blockquote>
+  * An unmarshal method never returns null. If the unmarshal process is unable to unmarshal
+  * the root of XML content to a JAXB mapped object, a fatal error is reported that
+@@ -205,10 +205,10 @@
+  * <a name="unmarshalGlobal"></a>
+  * <b>Unmarshal a root element that is globally declared</b><br>
+  * <blockquote>
+- * The unmarshal methods that do not have an <tt>declaredType</tt> parameter use 
+- * {@link JAXBContext} to unmarshal the root element of an XML data. The {@link JAXBContext} 
+- * instance is the one that was used to create this <tt>Unmarshaller</tt>. The {@link JAXBContext} 
+- * instance maintains a mapping of globally declared XML element and type definition names to 
++ * The unmarshal methods that do not have an <tt>declaredType</tt> parameter use
++ * {@link JAXBContext} to unmarshal the root element of an XML data. The {@link JAXBContext}
++ * instance is the one that was used to create this <tt>Unmarshaller</tt>. The {@link JAXBContext}
++ * instance maintains a mapping of globally declared XML element and type definition names to
+  * JAXB mapped classes. The unmarshal method checks if {@link JAXBContext} has a mapping
+  * from the root element's XML name and/or <tt>@xsi:type</tt> to a JAXB mapped class.  If it does, it umarshalls the
+  * XML data using the appropriate JAXB mapped class. Note that when the root element name is unknown and the root
+@@ -215,31 +215,31 @@
+  * element has an <tt>@xsi:type</tt>, the XML data is unmarshalled
+  * using that JAXB mapped class as the value of a {@link JAXBElement}.
+  * When the {@link JAXBContext} object does not have a mapping for the root element's name
+- * nor its <tt>@xsi:type</tt>, if it exists, 
+- * then the unmarshal operation will abort immediately by throwing a {@link UnmarshalException 
+- * UnmarshalException}. This exception scenario can be worked around by using the unmarshal by 
++ * nor its <tt>@xsi:type</tt>, if it exists,
++ * then the unmarshal operation will abort immediately by throwing a {@link UnmarshalException
++ * UnmarshalException}. This exception scenario can be worked around by using the unmarshal by
+  * declaredType methods described in the next subsection.
+  * </blockquote>
+- * 
++ *
+  * <p>
+  * <a name="unmarshalByDeclaredType"></a>
+  * <b>Unmarshal by Declared Type</b><br>
+  * <blockquote>
+- * The unmarshal methods with a <code>declaredType</code> parameter enable an 
++ * The unmarshal methods with a <code>declaredType</code> parameter enable an
+  * application to deserialize a root element of XML data, even when
+  * there is no mapping in {@link JAXBContext} of the root element's XML name.
+  * The unmarshaller unmarshals the root element using the application provided
+- * mapping specified as the <tt>declaredType</tt> parameter. 
+- * Note that even when the root element's element name is mapped by {@link JAXBContext}, 
+- * the <code>declaredType</code> parameter overrides that mapping for 
+- * deserializing the root element when using these unmarshal methods. 
+- * Additionally, when the root element of XML data has an <tt>xsi:type</tt> attribute and 
+- * that attribute's value references a type definition that is mapped 
+- * to a JAXB mapped class by {@link JAXBContext}, that the root 
++ * mapping specified as the <tt>declaredType</tt> parameter.
++ * Note that even when the root element's element name is mapped by {@link JAXBContext},
++ * the <code>declaredType</code> parameter overrides that mapping for
++ * deserializing the root element when using these unmarshal methods.
++ * Additionally, when the root element of XML data has an <tt>xsi:type</tt> attribute and
++ * that attribute's value references a type definition that is mapped
++ * to a JAXB mapped class by {@link JAXBContext}, that the root
+  * element's <tt>xsi:type</tt> attribute takes
+- * precedence over the unmarshal methods <tt>declaredType</tt> parameter. 
+- * These methods always return a <tt>JAXBElement&lt;declaredType></tt> 
+- * instance. The table below shows how the properties of the returned JAXBElement 
++ * precedence over the unmarshal methods <tt>declaredType</tt> parameter.
++ * These methods always return a <tt>JAXBElement&lt;declaredType></tt>
++ * instance. The table below shows how the properties of the returned JAXBElement
+  * instance are set.
+  *
+  * <a name="unmarshalDeclaredTypeReturn"></a>
+@@ -248,7 +248,7 @@
+  *   <thead>
+  *     <tr>
+  *       <th align="center" colspan="2">
+- *       Unmarshal By Declared Type returned JAXBElement 
++ *       Unmarshal By Declared Type returned JAXBElement
+  *       </tr>
+  *     <tr>
+  *       <th>JAXBElement Property</th>
+@@ -278,7 +278,7 @@
+  * </blockquote>
+  *
+  * <p>
+- * The following is an example of 
++ * The following is an example of
+  * <a href="#unmarshalByDeclaredType">unmarshal by declaredType method</a>.
+  * <p>
+  * Unmarshal by declaredType from a <tt>org.w3c.dom.Node</tt>:
+@@ -301,19 +301,19 @@
+  *
+  *       JAXBContext jc = JAXBContext.newInstance( "com.acme.foo" );
+  *       Unmarshaller u = jc.createUnmarshaller();
+- * 
++ *
+  *       DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+  *       dbf.setNamespaceAware(true);
+  *       DocumentBuilder db = dbf.newDocumentBuilder();
+  *       Document doc = db.parse(new File( "nosferatu.xml"));
+- *       Element  fooSubtree = ...; // traverse DOM till reach xml element foo, constrained by a 
++ *       Element  fooSubtree = ...; // traverse DOM till reach xml element foo, constrained by a
+  *                                  // local element declaration in schema.
+- * 
++ *
+  *       // FooType is the JAXB mapping of the type of local element declaration foo.
+  *       JAXBElement&lt;FooType> foo = u.unmarshal( fooSubtree, FooType.class);
+  *    </pre>
+  * </blockquote>
+- * 
++ *
+  * <p>
+  * <b>Support for SAX2.0 Compliant Parsers</b><br>
+  * <blockquote>
+@@ -323,7 +323,7 @@
+  * is not required to be SAX2.0 compliant, all providers are required to allow
+  * a client application to specify their own SAX2.0 parser.  Some providers may
+  * require the client application to specify the SAX2.0 parser at schema compile
+- * time. See {@link #unmarshal(javax.xml.transform.Source) unmarshal(Source)} 
++ * time. See {@link #unmarshal(javax.xml.transform.Source) unmarshal(Source)}
+  * for more detail.
+  * </blockquote>
+  *
+@@ -332,23 +332,23 @@
+  * <blockquote>
+  * <p>
+  * A client application can enable or disable JAXP 1.3 validation
+- * mechanism via the <tt>setSchema(javax.xml.validation.Schema)</tt> API.  
+- * Sophisticated clients can specify their own validating SAX 2.0 compliant 
+- * parser and bypass the JAXP 1.3 validation mechanism using the 
++ * mechanism via the <tt>setSchema(javax.xml.validation.Schema)</tt> API.
++ * Sophisticated clients can specify their own validating SAX 2.0 compliant
++ * parser and bypass the JAXP 1.3 validation mechanism using the
+  * {@link #unmarshal(javax.xml.transform.Source) unmarshal(Source)}  API.
+- * 
++ *
+  * <p>
+- * Since unmarshalling invalid XML content is defined in JAXB 2.0, 
++ * Since unmarshalling invalid XML content is defined in JAXB 2.0,
+  * the Unmarshaller default validation event handler was made more lenient
+  * than in JAXB 1.0.  When schema-derived code generated
+- * by JAXB 1.0 binding compiler is registered with {@link JAXBContext}, 
+- * the default unmarshal validation handler is 
++ * by JAXB 1.0 binding compiler is registered with {@link JAXBContext},
++ * the default unmarshal validation handler is
+  * {@link javax.xml.bind.helpers.DefaultValidationEventHandler} and it
+- * terminates the marshal  operation after encountering either a fatal error or an error. 
++ * terminates the marshal  operation after encountering either a fatal error or an error.
+  * For a JAXB 2.0 client application, there is no explicitly defined default
+- * validation handler and the default event handling only 
++ * validation handler and the default event handling only
+  * terminates the marshal operation after encountering a fatal error.
+- * 
++ *
+  * </blockquote>
+  *
+  * <p>
+@@ -356,11 +356,11 @@
+  * <b>Supported Properties</b><br>
+  * <blockquote>
+  * <p>
+- * There currently are not any properties required to be supported by all 
+- * JAXB Providers on Unmarshaller.  However, some providers may support 
++ * There currently are not any properties required to be supported by all
++ * JAXB Providers on Unmarshaller.  However, some providers may support
+  * their own set of provider specific properties.
+  * </blockquote>
+- * 
++ *
+  * <p>
+  * <a name="unmarshalEventCallback"></a>
+  * <b>Unmarshal Event Callbacks</b><br>
+@@ -372,37 +372,37 @@
+  * unmarshalling.  'External listeners' allow for centralized processing
+  * of unmarshal events in one callback method rather than by type event callbacks.
+  * <p>
+- * 'Class defined' event callback methods allow any JAXB mapped class to specify 
++ * 'Class defined' event callback methods allow any JAXB mapped class to specify
+  * its own specific callback methods by defining methods with the following method signature:
+  * <blockquote>
+  * <pre>
+- *   // This method is called immediately after the object is created and before the unmarshalling of this 
++ *   // This method is called immediately after the object is created and before the unmarshalling of this
+  *   // object begins. The callback provides an opportunity to initialize JavaBean properties prior to unmarshalling.
+  *   void beforeUnmarshal(Unmarshaller, Object parent);
+- * 
+- *   //This method is called after all the properties (except IDREF) are unmarshalled for this object, 
++ *
++ *   //This method is called after all the properties (except IDREF) are unmarshalled for this object,
+  *   //but before this object is set to the parent object.
+  *   void afterUnmarshal(Unmarshaller, Object parent);
+  * </pre>
+  * </blockquote>
+  * The class defined callback methods should be used when the callback method requires
+- * access to non-public methods and/or fields of the class. 
++ * access to non-public methods and/or fields of the class.
+  * <p>
+- * The external listener callback mechanism enables the registration of a {@link Listener} 
+- * instance with an {@link Unmarshaller#setListener(Listener)}. The external listener receives all callback events, 
+- * allowing for more centralized processing than per class defined callback methods.  The external listener 
++ * The external listener callback mechanism enables the registration of a {@link Listener}
++ * instance with an {@link Unmarshaller#setListener(Listener)}. The external listener receives all callback events,
++ * allowing for more centralized processing than per class defined callback methods.  The external listener
+  * receives events when unmarshalling proces is marshalling to a JAXB element or to JAXB mapped class.
+  * <p>
+  * The 'class defined' and external listener event callback methods are independent of each other,
+  * both can be called for one event.  The invocation ordering when both listener callback methods exist is
+- * defined in {@link Listener#beforeUnmarshal(Object, Object)} and {@link Listener#afterUnmarshal(Object, Object)}. 
++ * defined in {@link Listener#beforeUnmarshal(Object, Object)} and {@link Listener#afterUnmarshal(Object, Object)}.
+ * <p>
+  * An event callback method throwing an exception terminates the current unmarshal process.
+- * 
++ *
+  * </blockquote>
+- * 
++ *
+  * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul>
+- * @version $Revision: 1.31 $ $Date: 2005/08/15 20:54:42 $
++ * @version $Revision: 1.32 $ $Date: 2005/08/18 15:18:26 $
+  * @see JAXBContext
+  * @see Marshaller
+  * @see Validator
+@@ -409,7 +409,7 @@
+  * @since JAXB1.0
+  */
+ public interface Unmarshaller {
+-    
++
+     /**
+      * Unmarshal XML data from the specified file and return the resulting
+      * content tree.
+@@ -416,15 +416,15 @@
+      *
+      * <p>
+      * Implements <a href="#unmarshalGlobal">Unmarshal Global Root Element</a>.
+-     * 
++     *
+      * @param f the file to unmarshal XML data from
+-     * @return the newly created root object of the java content tree 
++     * @return the newly created root object of the java content tree
+      *
+-     * @throws JAXBException 
++     * @throws JAXBException
+      *     If any unexpected errors occur while unmarshalling
+      * @throws UnmarshalException
+      *     If the {@link ValidationEventHandler ValidationEventHandler}
+-     *     returns false from its <tt>handleEvent</tt> method or the 
++     *     returns false from its <tt>handleEvent</tt> method or the
+      *     <tt>Unmarshaller</tt> is unable to perform the XML to Java
+      *     binding.  See <a href="#unmarshalEx">Unmarshalling XML Data</a>
+      * @throws IllegalArgumentException
+@@ -431,23 +431,23 @@
+      *      If the file parameter is null
+      */
+     public Object unmarshal( java.io.File f ) throws JAXBException;
+-    
++
+     /**
+-     * Unmarshal XML data from the specified InputStream and return the 
++     * Unmarshal XML data from the specified InputStream and return the
+      * resulting content tree.  Validation event location information may
+      * be incomplete when using this form of the unmarshal API.
+      *
+      * <p>
+      * Implements <a href="#unmarshalGlobal">Unmarshal Global Root Element</a>.
+-     * 
++     *
+      * @param is the InputStream to unmarshal XML data from
+-     * @return the newly created root object of the java content tree 
++     * @return the newly created root object of the java content tree
+      *
+-     * @throws JAXBException 
++     * @throws JAXBException
+      *     If any unexpected errors occur while unmarshalling
+      * @throws UnmarshalException
+      *     If the {@link ValidationEventHandler ValidationEventHandler}
+-     *     returns false from its <tt>handleEvent</tt> method or the 
++     *     returns false from its <tt>handleEvent</tt> method or the
+      *     <tt>Unmarshaller</tt> is unable to perform the XML to Java
+      *     binding.  See <a href="#unmarshalEx">Unmarshalling XML Data</a>
+      * @throws IllegalArgumentException
+@@ -463,7 +463,7 @@
+      *
+      * <p>
+      * Implements <a href="#unmarshalGlobal">Unmarshal Global Root Element</a>.
+-     * 
++     *
+      * @param reader the Reader to unmarshal XML data from
+      * @return the newly created root object of the java content tree
+      *
+@@ -488,13 +488,13 @@
+      * Implements <a href="#unmarshalGlobal">Unmarshal Global Root Element</a>.
+      *
+      * @param url the url to unmarshal XML data from
+-     * @return the newly created root object of the java content tree 
++     * @return the newly created root object of the java content tree
+      *
+-     * @throws JAXBException 
++     * @throws JAXBException
+      *     If any unexpected errors occur while unmarshalling
+      * @throws UnmarshalException
+      *     If the {@link ValidationEventHandler ValidationEventHandler}
+-     *     returns false from its <tt>handleEvent</tt> method or the 
++     *     returns false from its <tt>handleEvent</tt> method or the
+      *     <tt>Unmarshaller</tt> is unable to perform the XML to Java
+      *     binding.  See <a href="#unmarshalEx">Unmarshalling XML Data</a>
+      * @throws IllegalArgumentException
+@@ -501,7 +501,7 @@
+      *      If the URL parameter is null
+      */
+     public Object unmarshal( java.net.URL url ) throws JAXBException;
+-    
++
+     /**
+      * Unmarshal XML data from the specified SAX InputSource and return the
+      * resulting content tree.
+@@ -510,13 +510,13 @@
+      * Implements <a href="#unmarshalGlobal">Unmarshal Global Root Element</a>.
+      *
+      * @param source the input source to unmarshal XML data from
+-     * @return the newly created root object of the java content tree 
++     * @return the newly created root object of the java content tree
+      *
+-     * @throws JAXBException 
++     * @throws JAXBException
+      *     If any unexpected errors occur while unmarshalling
+      * @throws UnmarshalException
+      *     If the {@link ValidationEventHandler ValidationEventHandler}
+-     *     returns false from its <tt>handleEvent</tt> method or the 
++     *     returns false from its <tt>handleEvent</tt> method or the
+      *     <tt>Unmarshaller</tt> is unable to perform the XML to Java
+      *     binding.  See <a href="#unmarshalEx">Unmarshalling XML Data</a>
+      * @throws IllegalArgumentException
+@@ -523,7 +523,7 @@
+      *      If the InputSource parameter is null
+      */
+     public Object unmarshal( org.xml.sax.InputSource source ) throws JAXBException;
+-    
++
+     /**
+      * Unmarshal global XML data from the specified DOM tree and return the resulting
+      * content tree.
+@@ -534,13 +534,13 @@
+      * @param node
+      *      the document/element to unmarshal XML data from.
+      *      The caller must support at least Document and Element.
+-     * @return the newly created root object of the java content tree 
++     * @return the newly created root object of the java content tree
+      *
+-     * @throws JAXBException 
++     * @throws JAXBException
+      *     If any unexpected errors occur while unmarshalling
+      * @throws UnmarshalException
+      *     If the {@link ValidationEventHandler ValidationEventHandler}
+-     *     returns false from its <tt>handleEvent</tt> method or the 
++     *     returns false from its <tt>handleEvent</tt> method or the
+      *     <tt>Unmarshaller</tt> is unable to perform the XML to Java
+      *     binding.  See <a href="#unmarshalEx">Unmarshalling XML Data</a>
+      * @throws IllegalArgumentException
+@@ -561,14 +561,14 @@
+      *      The caller must support at least Document and Element.
+      * @param declaredType
+      *      appropriate JAXB mapped class to hold <tt>node</tt>'s XML data.
+-     * 
++     *
+      * @return <a href="#unmarshalDeclaredTypeReturn">JAXB Element</a> representation of <tt>node</tt>
+-     * 
+-     * @throws JAXBException 
++     *
++     * @throws JAXBException
+      *     If any unexpected errors occur while unmarshalling
+      * @throws UnmarshalException
+      *     If the {@link ValidationEventHandler ValidationEventHandler}
+-     *     returns false from its <tt>handleEvent</tt> method or the 
++     *     returns false from its <tt>handleEvent</tt> method or the
+      *     <tt>Unmarshaller</tt> is unable to perform the XML to Java
+      *     binding.  See <a href="#unmarshalEx">Unmarshalling XML Data</a>
+      * @throws IllegalArgumentException
+@@ -576,10 +576,10 @@
+      * @since JAXB2.0
+      */
+     public <T> JAXBElement<T> unmarshal( org.w3c.dom.Node node, Class<T> declaredType ) throws JAXBException;
+-    
++
+     /**
+-     * Unmarshal XML data from the specified XML Source and return the 
+-     * resulting content tree.  
++     * Unmarshal XML data from the specified XML Source and return the
++     * resulting content tree.
+      *
+      * <p>
+      * Implements <a href="#unmarshalGlobal">Unmarshal Global Root Element</a>.
+@@ -591,31 +591,31 @@
+      * A client application can choose not to use the default parser mechanism
+      * supplied with their JAXB provider.  Any SAX 2.0 compliant parser can be
+      * substituted for the JAXB provider's default mechanism.  To do so, the
+-     * client application must properly configure a <tt>SAXSource</tt> containing 
++     * client application must properly configure a <tt>SAXSource</tt> containing
+      * an <tt>XMLReader</tt> implemented by the SAX 2.0 parser provider.  If the
+      * <tt>XMLReader</tt> has an <tt>org.xml.sax.ErrorHandler</tt> registered
+      * on it, it will be replaced by the JAXB Provider so that validation errors
+      * can be reported via the <tt>ValidationEventHandler</tt> mechanism of
+-     * JAXB.  If the <tt>SAXSource</tt> does not contain an <tt>XMLReader</tt>, 
++     * JAXB.  If the <tt>SAXSource</tt> does not contain an <tt>XMLReader</tt>,
+      * then the JAXB provider's default parser mechanism will be used.
+      * <p>
+      * This parser replacement mechanism can also be used to replace the JAXB
+-     * provider's unmarshal-time validation engine.  The client application 
++     * provider's unmarshal-time validation engine.  The client application
+      * must properly configure their SAX 2.0 compliant parser to perform
+      * validation (as shown in the example above).  Any <tt>SAXParserExceptions
+-     * </tt> encountered by the parser during the unmarshal operation will be 
+-     * processed by the JAXB provider and converted into JAXB 
+-     * <tt>ValidationEvent</tt> objects which will be reported back to the 
+-     * client via the <tt>ValidationEventHandler</tt> registered with the 
+-     * <tt>Unmarshaller</tt>.  <i>Note:</i> specifying a substitute validating 
+-     * SAX 2.0 parser for unmarshalling does not necessarily replace the 
+-     * validation engine used by the JAXB provider for performing on-demand 
++     * </tt> encountered by the parser during the unmarshal operation will be
++     * processed by the JAXB provider and converted into JAXB
++     * <tt>ValidationEvent</tt> objects which will be reported back to the
++     * client via the <tt>ValidationEventHandler</tt> registered with the
++     * <tt>Unmarshaller</tt>.  <i>Note:</i> specifying a substitute validating
++     * SAX 2.0 parser for unmarshalling does not necessarily replace the
++     * validation engine used by the JAXB provider for performing on-demand
+      * validation.
+      * <p>
+      * The only way for a client application to specify an alternate parser
+-     * mechanism to be used during unmarshal is via the 
+-     * <tt>unmarshal(SAXSource)</tt> API.  All other forms of the unmarshal 
+-     * method (File, URL, Node, etc) will use the JAXB provider's default 
++     * mechanism to be used during unmarshal is via the
++     * <tt>unmarshal(SAXSource)</tt> API.  All other forms of the unmarshal
++     * method (File, URL, Node, etc) will use the JAXB provider's default
+      * parser and validator mechanisms.
+      *
+      * @param source the XML Source to unmarshal XML data from (providers are
+@@ -622,11 +622,11 @@
+      *        only required to support SAXSource, DOMSource, and StreamSource)
+      * @return the newly created root object of the java content tree
+      *
+-     * @throws JAXBException 
++     * @throws JAXBException
+      *     If any unexpected errors occur while unmarshalling
+      * @throws UnmarshalException
+      *     If the {@link ValidationEventHandler ValidationEventHandler}
+-     *     returns false from its <tt>handleEvent</tt> method or the 
++     *     returns false from its <tt>handleEvent</tt> method or the
+      *     <tt>Unmarshaller</tt> is unable to perform the XML to Java
+      *     binding.  See <a href="#unmarshalEx">Unmarshalling XML Data</a>
+      * @throws IllegalArgumentException
+@@ -638,8 +638,8 @@
+ 
+ 
+     /**
+-     * Unmarshal XML data from the specified XML Source by <tt>declaredType</tt> and return the 
+-     * resulting content tree.  
++     * Unmarshal XML data from the specified XML Source by <tt>declaredType</tt> and return the
++     * resulting content tree.
+      *
+      * <p>
+      * Implements <a href="#unmarshalByDeclaredType">Unmarshal by Declared Type</a>
+@@ -649,15 +649,15 @@
+      *
+      * @param source the XML Source to unmarshal XML data from (providers are
+      *        only required to support SAXSource, DOMSource, and StreamSource)
+-     * @param declaredType 
++     * @param declaredType
+      *      appropriate JAXB mapped class to hold <tt>source</tt>'s xml root element
+      * @return Java content rooted by <a href="#unmarshalDeclaredTypeReturn">JAXB Element</a>
+      *
+-     * @throws JAXBException 
++     * @throws JAXBException
+      *     If any unexpected errors occur while unmarshalling
+      * @throws UnmarshalException
+      *     If the {@link ValidationEventHandler ValidationEventHandler}
+-     *     returns false from its <tt>handleEvent</tt> method or the 
++     *     returns false from its <tt>handleEvent</tt> method or the
+      *     <tt>Unmarshaller</tt> is unable to perform the XML to Java
+      *     binding.  See <a href="#unmarshalEx">Unmarshalling XML Data</a>
+      * @throws IllegalArgumentException
+@@ -666,7 +666,7 @@
+      */
+     public <T> JAXBElement<T> unmarshal( javax.xml.transform.Source source, Class<T> declaredType )
+         throws JAXBException;
+-    
++
+     /**
+      * Unmarshal XML data from the specified pull parser and return the
+      * resulting content tree.
+@@ -673,24 +673,24 @@
+      *
+      * <p>
+      * Implements <a href="#unmarshalGlobal">Unmarshal Global Root Element</a>.
+-     * 
++     *
+      * <p>
+      * This method assumes that the parser is on a START_DOCUMENT or
+-     * START_ELEMENT event.  Unmarshalling will be done from this 
+-     * start event to the corresponding end event.  If this method 
+-     * returns successfully, the <tt>reader</tt> will be pointing at 
++     * START_ELEMENT event.  Unmarshalling will be done from this
++     * start event to the corresponding end event.  If this method
++     * returns successfully, the <tt>reader</tt> will be pointing at
+      * the token right after the end event.
+-     * 
++     *
+      * @param reader
+      *      The parser to be read.
+      * @return
+      *      the newly created root object of the java content tree.
+      *
+-     * @throws JAXBException 
++     * @throws JAXBException
+      *     If any unexpected errors occur while unmarshalling
+      * @throws UnmarshalException
+      *     If the {@link ValidationEventHandler ValidationEventHandler}
+-     *     returns false from its <tt>handleEvent</tt> method or the 
++     *     returns false from its <tt>handleEvent</tt> method or the
+      *     <tt>Unmarshaller</tt> is unable to perform the XML to Java
+      *     binding.  See <a href="#unmarshalEx">Unmarshalling XML Data</a>
+      * @throws IllegalArgumentException
+@@ -703,32 +703,32 @@
+      */
+     public Object unmarshal( javax.xml.stream.XMLStreamReader reader )
+         throws JAXBException;
+-    
++
+     /**
+      * Unmarshal root element to JAXB mapped <tt>declaredType</tt>
+      * and return the resulting content tree.
+-     * 
++     *
+      * <p>
+      * This method implements <a href="unmarshalByDeclaredType">unmarshal by declaredType</a>.
+      * <p>
+      * This method assumes that the parser is on a START_DOCUMENT or
+-     * START_ELEMENT event. Unmarshalling will be done from this 
+-     * start event to the corresponding end event.  If this method 
+-     * returns successfully, the <tt>reader</tt> will be pointing at 
++     * START_ELEMENT event. Unmarshalling will be done from this
++     * start event to the corresponding end event.  If this method
++     * returns successfully, the <tt>reader</tt> will be pointing at
+      * the token right after the end event.
+      *
+      * @param reader
+-     *      The parser to be read. 
++     *      The parser to be read.
+      * @param declaredType
+      *      appropriate JAXB mapped class to hold <tt>reader</tt>'s START_ELEMENT XML data.
+-     * 
++     *
+      * @return   content tree rooted by <a href="#unmarshalDeclaredTypeReturn">JAXB Element representation</a>
+-     * 
+-     * @throws JAXBException 
++     *
++     * @throws JAXBException
+      *     If any unexpected errors occur while unmarshalling
+      * @throws UnmarshalException
+      *     If the {@link ValidationEventHandler ValidationEventHandler}
+-     *     returns false from its <tt>handleEvent</tt> method or the 
++     *     returns false from its <tt>handleEvent</tt> method or the
+      *     <tt>Unmarshaller</tt> is unable to perform the XML to Java
+      *     binding.  See <a href="#unmarshalEx">Unmarshalling XML Data</a>
+      * @throws IllegalArgumentException
+@@ -746,21 +746,21 @@
+      *
+      * <p>
+      * This method assumes that the parser is on a START_DOCUMENT or
+-     * START_ELEMENT event.  Unmarshalling will be done from this 
+-     * start event to the corresponding end event.  If this method 
+-     * returns successfully, the <tt>reader</tt> will be pointing at 
+-     * the token right after the end event. 
+-     * 
++     * START_ELEMENT event.  Unmarshalling will be done from this
++     * start event to the corresponding end event.  If this method
++     * returns successfully, the <tt>reader</tt> will be pointing at
++     * the token right after the end event.
++     *
+      * @param reader
+      *      The parser to be read.
+      * @return
+      *      the newly created root object of the java content tree.
+      *
+-     * @throws JAXBException 
++     * @throws JAXBException
+      *     If any unexpected errors occur while unmarshalling
+      * @throws UnmarshalException
+      *     If the {@link ValidationEventHandler ValidationEventHandler}
+-     *     returns false from its <tt>handleEvent</tt> method or the 
++     *     returns false from its <tt>handleEvent</tt> method or the
+      *     <tt>Unmarshaller</tt> is unable to perform the XML to Java
+      *     binding.  See <a href="#unmarshalEx">Unmarshalling XML Data</a>
+      * @throws IllegalArgumentException
+@@ -773,33 +773,33 @@
+      */
+     public Object unmarshal( javax.xml.stream.XMLEventReader reader )
+         throws JAXBException;
+-    
++
+     /**
+      * Unmarshal root element to JAXB mapped <tt>declaredType</tt>
+      * and return the resulting content tree.
+-     * 
++     *
+      * <p>
+      * This method implements <a href="unmarshalByDeclaredType">unmarshal by declaredType</a>.
+      *
+      * <p>
+      * This method assumes that the parser is on a START_DOCUMENT or
+-     * START_ELEMENT event. Unmarshalling will be done from this 
+-     * start event to the corresponding end event.  If this method 
+-     * returns successfully, the <tt>reader</tt> will be pointing at 
++     * START_ELEMENT event. Unmarshalling will be done from this
++     * start event to the corresponding end event.  If this method
++     * returns successfully, the <tt>reader</tt> will be pointing at
+      * the token right after the end event.
+      *
+      * @param reader
+-     *      The parser to be read. 
++     *      The parser to be read.
+      * @param declaredType
+      *      appropriate JAXB mapped class to hold <tt>reader</tt>'s START_ELEMENT XML data.
+-     * 
++     *
+      * @return   content tree rooted by <a href="#unmarshalDeclaredTypeReturn">JAXB Element representation</a>
+-     * 
+-     * @throws JAXBException 
++     *
++     * @throws JAXBException
+      *     If any unexpected errors occur while unmarshalling
+      * @throws UnmarshalException
+      *     If the {@link ValidationEventHandler ValidationEventHandler}
+-     *     returns false from its <tt>handleEvent</tt> method or the 
++     *     returns false from its <tt>handleEvent</tt> method or the
+      *     <tt>Unmarshaller</tt> is unable to perform the XML to Java
+      *     binding.  See <a href="#unmarshalEx">Unmarshalling XML Data</a>
+      * @throws IllegalArgumentException
+@@ -811,12 +811,12 @@
+     /**
+      * Get an unmarshaller handler object that can be used as a component in
+      * an XML pipeline.
+-     * 
++     *
+      * <p>
+-     * The JAXB Provider can return the same handler object for multiple 
+-     * invocations of this method. In other words, this method does not 
+-     * necessarily create a new instance of <tt>UnmarshallerHandler</tt>. If the 
+-     * application needs to use more than one <tt>UnmarshallerHandler</tt>, it 
++     * The JAXB Provider can return the same handler object for multiple
++     * invocations of this method. In other words, this method does not
++     * necessarily create a new instance of <tt>UnmarshallerHandler</tt>. If the
++     * application needs to use more than one <tt>UnmarshallerHandler</tt>, it
+      * should create more than one <tt>Unmarshaller</tt>.
+      *
+      * @return the unmarshaller handler object
+@@ -823,10 +823,10 @@
+      * @see UnmarshallerHandler
+      */
+     public UnmarshallerHandler getUnmarshallerHandler();
+-    
++
+     /**
+      * Specifies whether or not the default validation mechanism of the
+-     * <tt>Unmarshaller</tt> should validate during unmarshal operations.  
++     * <tt>Unmarshaller</tt> should validate during unmarshal operations.
+      * By default, the <tt>Unmarshaller</tt> does not validate.
+      * <p>
+      * This method may only be invoked before or after calling one of the
+@@ -833,7 +833,7 @@
+      * unmarshal methods.
+      * <p>
+      * This method only controls the JAXB Provider's default unmarshal-time
+-     * validation mechanism - it has no impact on clients that specify their 
++     * validation mechanism - it has no impact on clients that specify their
+      * own validating SAX 2.0 compliant parser.  Clients that specify their
+      * own unmarshal-time validation mechanism may wish to turn off the JAXB
+      * Provider's default validation mechanism via this API to avoid "double
+@@ -842,7 +842,7 @@
+      * This method is deprecated as of JAXB 2.0 - please use the new
+      * {@link #setSchema(javax.xml.validation.Schema)} API.
+      *
+-     * @param validating true if the Unmarshaller should validate during 
++     * @param validating true if the Unmarshaller should validate during
+      *        unmarshal, false otherwise
+      * @throws JAXBException if an error occurred while enabling or disabling
+      *         validation at unmarshal time
+@@ -851,20 +851,20 @@
+      *         JAXB 2.0 mapped classes
+      * @deprecated since JAXB2.0, please see {@link #setSchema(javax.xml.validation.Schema)}
+      */
+-    public void setValidating( boolean validating ) 
++    public void setValidating( boolean validating )
+         throws JAXBException;
+-    
++
+     /**
+-     * Indicates whether or not the <tt>Unmarshaller</tt> is configured to 
++     * Indicates whether or not the <tt>Unmarshaller</tt> is configured to
+      * validate during unmarshal operations.
+      * <p>
+      * This API returns the state of the JAXB Provider's default unmarshal-time
+-     * validation mechanism. 
++     * validation mechanism.
+      * <p>
+      * This method is deprecated as of JAXB 2.0 - please use the new
+      * {@link #getSchema()} API.
+      *
+-     * @return true if the Unmarshaller is configured to validate during 
++     * @return true if the Unmarshaller is configured to validate during
+      *         unmarshal operations, false otherwise
+      * @throws JAXBException if an error occurs while retrieving the validating
+      *         flag
+@@ -873,18 +873,18 @@
+      *         JAXB 2.0 mapped classes
+      * @deprecated since JAXB2.0, please see {@link #getSchema()}
+      */
+-    public boolean isValidating() 
++    public boolean isValidating()
+         throws JAXBException;
+-    
++
+     /**
+      * Allow an application to register a <tt>ValidationEventHandler</tt>.
+      * <p>
+-     * The <tt>ValidationEventHandler</tt> will be called by the JAXB Provider 
+-     * if any validation errors are encountered during calls to any of the 
+-     * unmarshal methods.  If the client application does not register a 
+-     * <tt>ValidationEventHandler</tt> before invoking the unmarshal methods, 
+-     * then <tt>ValidationEvents</tt> will be handled by the default event 
+-     * handler which will terminate the unmarshal operation after the first 
++     * The <tt>ValidationEventHandler</tt> will be called by the JAXB Provider
++     * if any validation errors are encountered during calls to any of the
++     * unmarshal methods.  If the client application does not register a
++     * <tt>ValidationEventHandler</tt> before invoking the unmarshal methods,
++     * then <tt>ValidationEvents</tt> will be handled by the default event
++     * handler which will terminate the unmarshal operation after the first
+      * error or fatal error is encountered.
+      * <p>
+      * Calling this method with a null parameter will cause the Unmarshaller
+@@ -903,7 +903,7 @@
+      *
+      * @return the current ValidationEventHandler or the default event handler
+      *         if it hasn't been set
+-     * @throws JAXBException if an error was encountered while getting the 
++     * @throws JAXBException if an error was encountered while getting the
+      *         current event handler
+      */
+     public ValidationEventHandler getEventHandler()
+@@ -910,7 +910,7 @@
+         throws JAXBException;
+ 
+     /**
+-     * Set the particular property in the underlying implementation of 
++     * Set the particular property in the underlying implementation of
+      * <tt>Unmarshaller</tt>.  This method can only be used to set one of
+      * the standard JAXB defined properties above or a provider specific
+      * property.  Attempting to set an undefined property will result in
+@@ -918,7 +918,7 @@
+      * Supported Properties</a>.
+      *
+      * @param name the name of the property to be set. This value can either
+-     *              be specified using one of the constant fields or a user 
++     *              be specified using one of the constant fields or a user
+      *              supplied string.
+      * @param value the value of the property to be set
+      *
+@@ -927,11 +927,11 @@
+      * @throws IllegalArgumentException
+      *      If the name parameter is null
+      */
+-    public void setProperty( String name, Object value ) 
++    public void setProperty( String name, Object value )
+         throws PropertyException;
+-    
++
+     /**
+-     * Get the particular property in the underlying implementation of 
++     * Get the particular property in the underlying implementation of
+      * <tt>Unmarshaller</tt>.  This method can only be used to get one of
+      * the standard JAXB defined properties above or a provider specific
+      * property.  Attempting to get an undefined property will result in
+@@ -982,7 +982,7 @@
+      * <code>
+      *   boolean isValidating = u.getSchema()!=null;
+      * </code>
+-     * 
++     *
+      * @return the Schema object being used to perform unmarshal-time
+      *      validation or null if not present
+      * @throws UnsupportedOperationException could be thrown if this method is
+@@ -1124,11 +1124,11 @@
+     /**
+      * <p>
+      * Register unmarshal event callback {@link Listener} with this {@link Unmarshaller}.
+-     * 
++     *
+      * <p>
+      * There is only one Listener per Unmarshaller. Setting a Listener replaces the previous set Listener.
+      * One can unregister current Listener by setting listener to <tt>null</tt>.
+-     * 
++     *
+      * @param listener  provides unmarshal event callbacks for this {@link Unmarshaller}
+      * @since JAXB2.0
+      */
+--- old/src/share/classes/javax/xml/bind/UnmarshallerHandler.java	Thu Jul 30 18:48:47 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/bind/UnmarshallerHandler.java	Thu Jul 30 18:48:47 2009
+@@ -28,34 +28,34 @@
+ 
+ /**
+  * Unmarshaller implemented as SAX ContentHandler.
+- * 
++ *
+  * <p>
+- * Applications can use this interface to use their JAXB provider as a component 
++ * Applications can use this interface to use their JAXB provider as a component
+  * in an XML pipeline.  For example:
+- * 
++ *
+  * <pre>
+  *       JAXBContext context = JAXBContext.newInstance( "org.acme.foo" );
+  *
+  *       Unmarshaller unmarshaller = context.createUnmarshaller();
+- * 
++ *
+  *       UnmarshallerHandler unmarshallerHandler = unmarshaller.getUnmarshallerHandler();
+  *
+  *       SAXParserFactory spf = SAXParserFactory.newInstance();
+  *       spf.setNamespaceAware( true );
+- * 
++ *
+  *       XMLReader xmlReader = spf.newSAXParser().getXMLReader();
+  *       xmlReader.setContentHandler( unmarshallerHandler );
+  *       xmlReader.parse(new InputSource( new FileInputStream( XML_FILE ) ) );
+  *
+- *       MyObject myObject= (MyObject)unmarshallerHandler.getResult();                          
++ *       MyObject myObject= (MyObject)unmarshallerHandler.getResult();
+  * </pre>
+- * 
++ *
+  * <p>
+  * This interface is reusable: even if the user fails to unmarshal
+  * an object, s/he can still start a new round of unmarshalling.
+- * 
++ *
+  * @author <ul><li>Kohsuke KAWAGUCHI, Sun Microsystems, Inc.</li></ul>
+- * @version $Revision: 1.1 $ $Date: 2004/12/14 21:50:41 $
++ * @version $Revision: 1.2 $ $Date: 2006/03/08 16:55:17 $
+  * @see Unmarshaller#getUnmarshallerHandler()
+  * @since JAXB1.0
+  */
+@@ -63,19 +63,19 @@
+ {
+     /**
+      * Obtains the unmarshalled result.
+-     * 
++     *
+      * This method can be called only after this handler
+      * receives the endDocument SAX event.
+-     * 
++     *
+      * @exception IllegalStateException
+      *      if this method is called before this handler
+      *      receives the endDocument event.
+-     * 
++     *
+      * @exception JAXBException
+      *      if there is any unmarshalling error.
+      *      Note that the implementation is allowed to throw SAXException
+      *      during the parsing when it finds an error.
+-     * 
++     *
+      * @return
+      *      always return a non-null valid object which was unmarshalled.
+      */
+--- old/src/share/classes/javax/xml/bind/ValidationEvent.java	Thu Jul 30 18:48:51 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/bind/ValidationEvent.java	Thu Jul 30 18:48:50 2009
+@@ -26,48 +26,48 @@
+ package javax.xml.bind;
+ 
+ /**
+- * This event indicates that a problem was encountered while validating the    
+- * incoming XML data during an unmarshal operation, while performing 
++ * This event indicates that a problem was encountered while validating the
++ * incoming XML data during an unmarshal operation, while performing
+  * on-demand validation of the Java content tree, or while marshalling the
+  * Java content tree back to XML data.
+- * 
+- * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul> 
+- * @version $Revision: 1.2 $
++ *
++ * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul>
++ * @version $Revision: 1.1 $
+  * @see Validator
+  * @see ValidationEventHandler
+  * @since JAXB1.0
+  */
+ public interface ValidationEvent {
+-    
+-    /** 
+-     * Conditions that are not errors or fatal errors as defined by the 
+-     * XML 1.0 recommendation 
++
++    /**
++     * Conditions that are not errors or fatal errors as defined by the
++     * XML 1.0 recommendation
+      */
+     public static final int WARNING     = 0;
+-    
++
+     /**
+-     * Conditions that correspond to the definition of "error" in section 
++     * Conditions that correspond to the definition of "error" in section
+      * 1.2 of the W3C XML 1.0 Recommendation
+      */
+     public static final int ERROR       = 1;
+-    
++
+     /**
+-     * Conditions that correspond to the definition of "fatal error" in section 
++     * Conditions that correspond to the definition of "fatal error" in section
+      * 1.2 of the W3C XML 1.0 Recommendation
+      */
+     public static final int FATAL_ERROR = 2;
+ 
+     /**
+-     * Retrieve the severity code for this warning/error. 
++     * Retrieve the severity code for this warning/error.
+      *
+      * <p>
+-     * Must be one of <tt>ValidationError.WARNING</tt>, 
++     * Must be one of <tt>ValidationError.WARNING</tt>,
+      * <tt>ValidationError.ERROR</tt>, or <tt>ValidationError.FATAL_ERROR</tt>.
+      *
+      * @return the severity code for this warning/error
+      */
+     public int getSeverity();
+-    
++
+     /**
+      * Retrieve the text message for this warning/error.
+      *
+@@ -74,7 +74,7 @@
+      * @return the text message for this warning/error or null if one wasn't set
+      */
+     public String getMessage();
+-    
++
+     /**
+      * Retrieve the linked exception for this warning/error.
+      *
+@@ -82,7 +82,7 @@
+      *         wasn't set
+      */
+     public Throwable getLinkedException();
+-    
++
+     /**
+      * Retrieve the locator for this warning/error.
+      *
+@@ -89,5 +89,5 @@
+      * @return the locator that indicates where the warning/error occurred
+      */
+     public ValidationEventLocator getLocator();
+-    
++
+ }
+--- old/src/share/classes/javax/xml/bind/ValidationEventHandler.java	Thu Jul 30 18:48:54 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/bind/ValidationEventHandler.java	Thu Jul 30 18:48:54 2009
+@@ -30,27 +30,27 @@
+  *
+  * <p>
+  * If an application needs to implement customized event handling, it must
+- * implement this interface and then register it with either the 
+- * {@link Unmarshaller#setEventHandler(ValidationEventHandler) Unmarshaller}, 
+- * the {@link Validator#setEventHandler(ValidationEventHandler) Validator}, or 
+- * the {@link Marshaller#setEventHandler(ValidationEventHandler) Marshaller}.  
++ * implement this interface and then register it with either the
++ * {@link Unmarshaller#setEventHandler(ValidationEventHandler) Unmarshaller},
++ * the {@link Validator#setEventHandler(ValidationEventHandler) Validator}, or
++ * the {@link Marshaller#setEventHandler(ValidationEventHandler) Marshaller}.
+  * The JAXB Provider will then report validation errors and warnings encountered
+- * during the unmarshal, marshal, and validate operations to these event 
++ * during the unmarshal, marshal, and validate operations to these event
+  * handlers.
+  *
+  * <p>
+  * If the <tt>handleEvent</tt> method throws an unchecked runtime exception,
+  * the JAXB Provider must treat that as if the method returned false, effectively
+- * terminating whatever operation was in progress at the time (unmarshal, 
++ * terminating whatever operation was in progress at the time (unmarshal,
+  * validate, or marshal).
+- * 
++ *
+  * <p>
+  * Modifying the Java content tree within your event handler is undefined
+  * by the specification and may result in unexpected behaviour.
+  *
+  * <p>
+- * Failing to return false from the <tt>handleEvent</tt> method after 
+- * encountering a fatal error is undefined by the specification and may result 
++ * Failing to return false from the <tt>handleEvent</tt> method after
++ * encountering a fatal error is undefined by the specification and may result
+  * in unexpected behavior.
+  *
+  * <p>
+@@ -59,8 +59,8 @@
+  *    See: <a href="Validator.html#defaulthandler">Validator javadocs</a>
+  * </blockquote>
+  *
+- * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul> 
+- * @version $Revision: 1.2 $
++ * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul>
++ * @version $Revision: 1.1 $
+  * @see Unmarshaller
+  * @see Validator
+  * @see Marshaller
+@@ -70,10 +70,10 @@
+  */
+ public interface ValidationEventHandler {
+     /**
+-     * Receive notification of a validation warning or error.  
+-     * 
+-     * The ValidationEvent will have a 
+-     * {@link ValidationEventLocator ValidationEventLocator} embedded in it that 
++     * Receive notification of a validation warning or error.
++     *
++     * The ValidationEvent will have a
++     * {@link ValidationEventLocator ValidationEventLocator} embedded in it that
+      * indicates where the error or warning occurred.
+      *
+      * <p>
+@@ -80,17 +80,16 @@
+      * If an unchecked runtime exception is thrown from this method, the JAXB
+      * provider will treat it as if the method returned false and interrupt
+      * the current unmarshal, validate, or marshal operation.
+-     * 
+-     * @param event the encapsulated validation event information.  It is a 
++     *
++     * @param event the encapsulated validation event information.  It is a
+      * provider error if this parameter is null.
+      * @return true if the JAXB Provider should attempt to continue the current
+-     *         unmarshal, validate, or marshal operation after handling this 
+-     *         warning/error, false if the provider should terminate the current 
+-     *         operation with the appropriate <tt>UnmarshalException</tt>, 
++     *         unmarshal, validate, or marshal operation after handling this
++     *         warning/error, false if the provider should terminate the current
++     *         operation with the appropriate <tt>UnmarshalException</tt>,
+      *         <tt>ValidationException</tt>, or <tt>MarshalException</tt>.
+      * @throws IllegalArgumentException if the event object is null.
+      */
+     public boolean handleEvent( ValidationEvent event );
+-    
+-}
+ 
++}
+--- old/src/share/classes/javax/xml/bind/ValidationEventLocator.java	Thu Jul 30 18:48:58 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/bind/ValidationEventLocator.java	Thu Jul 30 18:48:57 2009
+@@ -30,15 +30,15 @@
+  *
+  * <p>
+  * The <tt>ValidationEventLocator</tt> indicates where the <tt>ValidationEvent
+- * </tt> occurred.  Different fields will be set depending on the type of 
+- * validation that was being performed when the error or warning was detected.  
+- * For example, on-demand validation would produce locators that contained 
+- * references to objects in the Java content tree while unmarshal-time 
+- * validation would produce locators containing information appropriate to the 
++ * </tt> occurred.  Different fields will be set depending on the type of
++ * validation that was being performed when the error or warning was detected.
++ * For example, on-demand validation would produce locators that contained
++ * references to objects in the Java content tree while unmarshal-time
++ * validation would produce locators containing information appropriate to the
+  * source of the XML data (file, url, Node, etc).
+  *
+- * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul> 
+- * @version $Revision: 1.2 $
++ * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul>
++ * @version $Revision: 1.1 $
+  * @see Validator
+  * @see ValidationEvent
+  * @since JAXB1.0
+@@ -51,7 +51,7 @@
+      * @return the name of the XML source as a URL or null if unavailable
+      */
+     public java.net.URL getURL();
+-    
++
+     /**
+      * Return the byte offset if available
+      *
+@@ -58,14 +58,14 @@
+      * @return the byte offset into the input source or -1 if unavailable
+      */
+     public int getOffset();
+-    
++
+     /**
+      * Return the line number if available
+      *
+-     * @return the line number or -1 if unavailable 
++     * @return the line number or -1 if unavailable
+      */
+     public int getLineNumber();
+-    
++
+     /**
+      * Return the column number if available
+      *
+@@ -72,7 +72,7 @@
+      * @return the column number or -1 if unavailable
+      */
+     public int getColumnNumber();
+-    
++
+     /**
+      * Return a reference to the object in the Java content tree if available
+      *
+@@ -80,12 +80,12 @@
+      *         unavailable
+      */
+     public java.lang.Object getObject();
+-    
++
+     /**
+      * Return a reference to the DOM Node if available
+      *
+-     * @return a reference to the DOM Node or null if unavailable 
++     * @return a reference to the DOM Node or null if unavailable
+      */
+     public org.w3c.dom.Node getNode();
+-    
++
+ }
+--- old/src/share/classes/javax/xml/bind/ValidationException.java	Thu Jul 30 18:49:01 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/bind/ValidationException.java	Thu Jul 30 18:49:01 2009
+@@ -28,15 +28,15 @@
+ /**
+  * This exception indicates that an error has occurred while performing
+  * a validate operation.
+- * 
++ *
+  * <p>
+  * The <tt>ValidationEventHandler</tt> can cause this exception to be thrown
+- * during the validate operations.  See 
++ * during the validate operations.  See
+  * {@link ValidationEventHandler#handleEvent(ValidationEvent)
+  * ValidationEventHandler.handleEvent(ValidationEvent)}.
+  *
+  * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li></ul>
+- * @version $Revision: 1.2 $
++ * @version $Revision: 1.1 $
+  * @see JAXBException
+  * @see Validator
+  * @since JAXB1.0
+@@ -43,8 +43,8 @@
+  */
+ public class ValidationException extends JAXBException {
+ 
+-    /** 
+-     * Construct an ValidationException with the specified detail message.  The 
++    /**
++     * Construct an ValidationException with the specified detail message.  The
+      * errorCode and linkedException will default to null.
+      *
+      * @param message a description of the exception
+@@ -53,8 +53,8 @@
+         this( message, null, null );
+     }
+ 
+-    /** 
+-     * Construct an ValidationException with the specified detail message and vendor 
++    /**
++     * Construct an ValidationException with the specified detail message and vendor
+      * specific errorCode.  The linkedException will default to null.
+      *
+      * @param message a description of the exception
+@@ -64,7 +64,7 @@
+         this( message, errorCode, null );
+     }
+ 
+-    /** 
++    /**
+      * Construct an ValidationException with a linkedException.  The detail message and
+      * vendor specific errorCode will default to null.
+      *
+@@ -74,8 +74,8 @@
+         this( null, null, exception );
+     }
+ 
+-    /** 
+-     * Construct an ValidationException with the specified detail message and 
++    /**
++     * Construct an ValidationException with the specified detail message and
+      * linkedException.  The errorCode will default to null.
+      *
+      * @param message a description of the exception
+@@ -85,8 +85,8 @@
+         this( message, null, exception );
+     }
+ 
+-    /** 
+-     * Construct an ValidationException with the specified detail message, vendor 
++    /**
++     * Construct an ValidationException with the specified detail message, vendor
+      * specific errorCode, and linkedException.
+      *
+      * @param message a description of the exception
+--- old/src/share/classes/javax/xml/bind/Validator.java	Thu Jul 30 18:49:05 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/bind/Validator.java	Thu Jul 30 18:49:04 2009
+@@ -37,18 +37,18 @@
+  * <blockquote>
+  *    <dl>
+  *        <dt><b>Unmarshal-Time Validation</b></dt>
+- *        <dd>This form of validation enables a client application to receive 
++ *        <dd>This form of validation enables a client application to receive
+  *            information about validation errors and warnings detected while
+- *            unmarshalling XML data into a Java content tree and is completely 
+- *            orthogonal to the other types of validation.  To enable or disable 
+- *            it, see the javadoc for 
++ *            unmarshalling XML data into a Java content tree and is completely
++ *            orthogonal to the other types of validation.  To enable or disable
++ *            it, see the javadoc for
+  *            {@link Unmarshaller#setValidating(boolean) Unmarshaller.setValidating}.
+  *            All JAXB 1.0 Providers are required to support this operation.
+  *        </dd>
+  *
+  *        <dt><b>On-Demand Validation</b></dt>
+- *        <dd> This form of validation enables a client application to receive 
+- *             information about validation errors and warnings detected in the 
++ *        <dd> This form of validation enables a client application to receive
++ *             information about validation errors and warnings detected in the
+  *             Java content tree.  At any point, client applications can call
+  *             the {@link Validator#validate(Object) Validator.validate} method
+  *             on the Java content tree (or any sub-tree of it).  All JAXB 1.0
+@@ -56,9 +56,9 @@
+  *        </dd>
+  *
+  *        <dt><b>Fail-Fast Validation</b></dt>
+- *        <dd> This form of validation enables a client application to receive 
+- *             immediate feedback about modifications to the Java content tree 
+- *             that violate type constraints on Java Properties as defined in 
++ *        <dd> This form of validation enables a client application to receive
++ *             immediate feedback about modifications to the Java content tree
++ *             that violate type constraints on Java Properties as defined in
+  *             the specification.  JAXB Providers are not required support
+  *             this type of validation.  Of the JAXB Providers that do support
+  *             this type of validation, some may require you to decide at schema
+@@ -69,11 +69,11 @@
+  * </blockquote>
+  *
+  * <p>
+- * The <tt>Validator</tt> class is responsible for managing On-Demand Validation.  
+- * The <tt>Unmarshaller</tt> class is responsible for managing Unmarshal-Time 
++ * The <tt>Validator</tt> class is responsible for managing On-Demand Validation.
++ * The <tt>Unmarshaller</tt> class is responsible for managing Unmarshal-Time
+  * Validation during the unmarshal operations.  Although there is no formal
+- * method of enabling validation during the marshal operations, the 
+- * <tt>Marshaller</tt> may detect errors, which will be reported to the 
++ * method of enabling validation during the marshal operations, the
++ * <tt>Marshaller</tt> may detect errors, which will be reported to the
+  * <tt>ValidationEventHandler</tt> registered on it.
+  *
+  * <p>
+@@ -80,12 +80,12 @@
+  * <a name="defaulthandler"></a>
+  * <b>Using the Default EventHandler</b><br>
+  * <blockquote>
+- *   If the client application does not set an event handler on their 
+- *   <tt>Validator</tt>, <tt>Unmarshaller</tt>, or <tt>Marshaller</tt> prior to 
+- *   calling the validate, unmarshal, or marshal methods, then a default event 
+- *   handler will receive notification of any errors or warnings encountered.  
+- *   The default event handler will cause the current operation to halt after 
+- *   encountering the first error or fatal error (but will attempt to continue 
++ *   If the client application does not set an event handler on their
++ *   <tt>Validator</tt>, <tt>Unmarshaller</tt>, or <tt>Marshaller</tt> prior to
++ *   calling the validate, unmarshal, or marshal methods, then a default event
++ *   handler will receive notification of any errors or warnings encountered.
++ *   The default event handler will cause the current operation to halt after
++ *   encountering the first error or fatal error (but will attempt to continue
+  *   after receiving warnings).
+  * </blockquote>
+  *
+@@ -98,23 +98,23 @@
+  *    <dl>
+  *        <dt>Use the default event handler</dt>
+  *        <dd>The default event handler will be used if you do not specify one
+- *            via the <tt>setEventHandler</tt> API's on <tt>Validator</tt>, 
++ *            via the <tt>setEventHandler</tt> API's on <tt>Validator</tt>,
+  *            <tt>Unmarshaller</tt>, or <tt>Marshaller</tt>.
+  *        </dd>
+- * 
++ *
+  *        <dt>Implement and register a custom event handler</dt>
+  *        <dd>Client applications that require sophisticated event processing
+- *            can implement the <tt>ValidationEventHandler</tt> interface and 
+- *            register it with the <tt>Unmarshaller</tt> and/or 
++ *            can implement the <tt>ValidationEventHandler</tt> interface and
++ *            register it with the <tt>Unmarshaller</tt> and/or
+  *            <tt>Validator</tt>.
+  *        </dd>
+  *
+- *        <dt>Use the {@link javax.xml.bind.util.ValidationEventCollector ValidationEventCollector} 
++ *        <dt>Use the {@link javax.xml.bind.util.ValidationEventCollector ValidationEventCollector}
+  *            utility</dt>
+  *        <dd>For convenience, a specialized event handler is provided that
+- *            simply collects any <tt>ValidationEvent</tt> objects created 
+- *            during the unmarshal, validate, and marshal operations and 
+- *            returns them to the client application as a 
++ *            simply collects any <tt>ValidationEvent</tt> objects created
++ *            during the unmarshal, validate, and marshal operations and
++ *            returns them to the client application as a
+  *            <tt>java.util.Collection</tt>.
+  *        </dd>
+  *    </dl>
+@@ -124,15 +124,15 @@
+  * <b>Validation and Well-Formedness</b><br>
+  * <blockquote>
+  * <p>
+- * Validation events are handled differently depending on how the client 
++ * Validation events are handled differently depending on how the client
+  * application is configured to process them as described in the previous
+  * section.  However, there are certain cases where a JAXB Provider indicates
+  * that it is no longer able to reliably detect and report errors.  In these
+  * cases, the JAXB Provider will set the severity of the ValidationEvent to
+- * FATAL_ERROR to indicate that the unmarshal, validate, or marshal operations 
+- * should be terminated.  The default event handler and 
+- * <tt>ValidationEventCollector</tt> utility class must terminate processing 
+- * after being notified of a fatal error.  Client applications that supply their 
++ * FATAL_ERROR to indicate that the unmarshal, validate, or marshal operations
++ * should be terminated.  The default event handler and
++ * <tt>ValidationEventCollector</tt> utility class must terminate processing
++ * after being notified of a fatal error.  Client applications that supply their
+  * own <tt>ValidationEventHandler</tt> should also terminate processing after
+  * being notified of a fatal error.  If not, unexpected behaviour may occur.
+  * </blockquote>
+@@ -142,14 +142,14 @@
+  * <b>Supported Properties</b><br>
+  * <blockquote>
+  * <p>
+- * There currently are not any properties required to be supported by all 
+- * JAXB Providers on Validator.  However, some providers may support 
++ * There currently are not any properties required to be supported by all
++ * JAXB Providers on Validator.  However, some providers may support
+  * their own set of provider specific properties.
+  * </blockquote>
+- * 
+- * 
+- * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul> 
+- * @version $Revision: 1.3 $ $Date: 2005/06/06 15:04:03 $
++ *
++ *
++ * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul>
++ * @version $Revision: 1.4 $ $Date: 2005/07/29 20:56:02 $
+  * @see JAXBContext
+  * @see Unmarshaller
+  * @see ValidationEventHandler
+@@ -164,9 +164,9 @@
+      * Allow an application to register a validation event handler.
+      * <p>
+      * The validation event handler will be called by the JAXB Provider if any
+-     * validation errors are encountered during calls to 
+-     * {@link #validate(Object) validate}.  If the client application does not 
+-     * register a validation event handler before invoking the validate method, 
++     * validation errors are encountered during calls to
++     * {@link #validate(Object) validate}.  If the client application does not
++     * register a validation event handler before invoking the validate method,
+      * then validation events will be handled by the default event handler which
+      * will terminate the validate operation after the first error or fatal error
+      * is encountered.
+@@ -188,13 +188,13 @@
+      *
+      * @return the current ValidationEventHandler or the default event handler
+      *         if it hasn't been set
+-     * @throws JAXBException if an error was encountered while getting the 
++     * @throws JAXBException if an error was encountered while getting the
+      *         current event handler
+      * @deprecated since JAXB2.0
+      */
+     public ValidationEventHandler getEventHandler()
+         throws JAXBException;
+-        
++
+     /**
+      * Validate the Java content tree starting at <tt>subrootObj</tt>.
+      * <p>
+@@ -205,10 +205,10 @@
+      *
+      * @param subrootObj the obj to begin validation at
+      * @throws JAXBException if any unexpected problem occurs during validation
+-     * @throws ValidationException 
++     * @throws ValidationException
+      *     If the {@link ValidationEventHandler ValidationEventHandler}
+-     *     returns false from its <tt>handleEvent</tt> method or the 
+-     *     <tt>Validator</tt> is unable to validate the content tree rooted 
++     *     returns false from its <tt>handleEvent</tt> method or the
++     *     <tt>Validator</tt> is unable to validate the content tree rooted
+      *     at <tt>subrootObj</tt>
+      * @throws IllegalArgumentException
+      *      If the subrootObj parameter is null
+@@ -217,21 +217,21 @@
+      * @deprecated since JAXB2.0
+      */
+     public boolean validate( Object subrootObj ) throws JAXBException;
+-    
++
+     /**
+      * Validate the Java content tree rooted at <tt>rootObj</tt>.
+      * <p>
+      * Client applications can use this method to validate Java content trees
+      * on-demand at runtime.  This method is used to validate an entire Java
+-     * content tree.  Global constraint checking <b>will</b> be performed as 
++     * content tree.  Global constraint checking <b>will</b> be performed as
+      * part of this operation (i.e. ID/IDREF constraints).
+      *
+      * @param rootObj the root obj to begin validation at
+      * @throws JAXBException if any unexpected problem occurs during validation
+-     * @throws ValidationException 
++     * @throws ValidationException
+      *     If the {@link ValidationEventHandler ValidationEventHandler}
+-     *     returns false from its <tt>handleEvent</tt> method or the 
+-     *     <tt>Validator</tt> is unable to validate the content tree rooted 
++     *     returns false from its <tt>handleEvent</tt> method or the
++     *     <tt>Validator</tt> is unable to validate the content tree rooted
+      *     at <tt>rootObj</tt>
+      * @throws IllegalArgumentException
+      *      If the rootObj parameter is null
+@@ -242,7 +242,7 @@
+     public boolean validateRoot( Object rootObj ) throws JAXBException;
+ 
+     /**
+-     * Set the particular property in the underlying implementation of 
++     * Set the particular property in the underlying implementation of
+      * <tt>Validator</tt>.  This method can only be used to set one of
+      * the standard JAXB defined properties above or a provider specific
+      * property.  Attempting to set an undefined property will result in
+@@ -250,7 +250,7 @@
+      * Supported Properties</a>.
+      *
+      * @param name the name of the property to be set. This value can either
+-     *              be specified using one of the constant fields or a user 
++     *              be specified using one of the constant fields or a user
+      *              supplied string.
+      * @param value the value of the property to be set
+      *
+@@ -260,11 +260,11 @@
+      *      If the name parameter is null
+      * @deprecated since JAXB2.0
+      */
+-    public void setProperty( String name, Object value ) 
++    public void setProperty( String name, Object value )
+         throws PropertyException;
+-    
++
+     /**
+-     * Get the particular property in the underlying implementation of 
++     * Get the particular property in the underlying implementation of
+      * <tt>Validator</tt>.  This method can only be used to get one of
+      * the standard JAXB defined properties above or a provider specific
+      * property.  Attempting to get an undefined property will result in
+@@ -282,5 +282,5 @@
+      * @deprecated since JAXB2.0
+      */
+     public Object getProperty( String name ) throws PropertyException;
+-    
++
+ }
+--- old/src/share/classes/javax/xml/bind/annotation/XmlAccessOrder.java	Thu Jul 30 18:49:08 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/bind/annotation/XmlAccessOrder.java	Thu Jul 30 18:49:07 2009
+@@ -31,13 +31,13 @@
+  *
+  * @author Sekhar Vajjhala, Sun Microsystems, Inc.
+  * @since JAXB2.0
+- * @version $Revision: 1.3 $
++ * @version $Revision: 1.1 $
+  * @see XmlAccessorOrder
+  */
+ 
+-public enum XmlAccessOrder { 
++public enum XmlAccessOrder {
+     /**
+-     * The ordering of fields and properties in a class is undefined. 
++     * The ordering of fields and properties in a class is undefined.
+      */
+     UNDEFINED,
+     /**
+@@ -47,4 +47,3 @@
+      */
+     ALPHABETICAL
+ }
+-
+--- old/src/share/classes/javax/xml/bind/annotation/XmlAccessType.java	Thu Jul 30 18:49:11 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/bind/annotation/XmlAccessType.java	Thu Jul 30 18:49:11 2009
+@@ -29,11 +29,11 @@
+ 
+ /**
+  * Used by XmlAccessorType to control serialization of fields or
+- * properties. 
++ * properties.
+  *
+  * @author Sekhar Vajjhala, Sun Microsystems, Inc.
+  * @since JAXB2.0
+- * @version $Revision: 1.10 $
++ * @version $Revision: 1.1 $
+  * @see XmlAccessorType
+  */
+ 
+@@ -58,7 +58,7 @@
+      * Every public getter/setter pair and every public field will be
+      * automatically bound to XML, unless annotated by {@link XmlTransient}.
+      *
+-     * Fields or getter/setter pairs that are private, protected, or 
++     * Fields or getter/setter pairs that are private, protected, or
+      * defaulted to package-only access are bound to XML only when they are
+      * explicitly annotated by the appropriate JAXB annotations.
+      */
+@@ -69,4 +69,3 @@
+      */
+     NONE
+ }
+-
+--- old/src/share/classes/javax/xml/bind/annotation/XmlAccessorOrder.java	Thu Jul 30 18:49:15 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/bind/annotation/XmlAccessorOrder.java	Thu Jul 30 18:49:14 2009
+@@ -39,9 +39,9 @@
+  * <h3>Usage </h3>
+  *
+  * <p> <tt> @XmlAccessorOrder </tt> annotation can be used with the following
+- * program elements:</p> 
+- * 
+- * <ul> 
++ * program elements:</p>
++ *
++ * <ul>
+  *   <li> package</li>
+  *   <li> a top level class </li>
+  * </ul>
+@@ -64,18 +64,18 @@
+  * </ul>
+  *
+  * <p>This annotation can be used with the following annotations:
+- *    {@link XmlType}, {@link XmlRootElement}, {@link XmlAccessorType}, 
+- *    {@link XmlSchema}, {@link XmlSchemaType}, {@link XmlSchemaTypes}, 
++ *    {@link XmlType}, {@link XmlRootElement}, {@link XmlAccessorType},
++ *    {@link XmlSchema}, {@link XmlSchemaType}, {@link XmlSchemaTypes},
+  *    , {@link XmlJavaTypeAdapter}. It can also be used with the
+  *    following annotations at the package level: {@link XmlJavaTypeAdapter}.
+  *
+  * @author Sekhar Vajjhala, Sun Microsystems, Inc.
+  * @since JAXB2.0
+- * @version  $Revision: 1.11 $
++ * @version  $Revision: 1.12 $
+  * @see XmlAccessOrder
+  */
+ 
+ @Inherited @Retention(RUNTIME) @Target({PACKAGE, TYPE})
+ public @interface XmlAccessorOrder {
+-	XmlAccessOrder value() default XmlAccessOrder.UNDEFINED;
++        XmlAccessOrder value() default XmlAccessOrder.UNDEFINED;
+ }
+--- old/src/share/classes/javax/xml/bind/annotation/XmlAccessorType.java	Thu Jul 30 18:49:18 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/bind/annotation/XmlAccessorType.java	Thu Jul 30 18:49:18 2009
+@@ -35,12 +35,12 @@
+ 
+ /**
+  * <p> Controls whether fields or Javabean properties are serialized by default. </p>
+- * 
++ *
+  * <p> <b> Usage </b> </p>
+  *
+  * <p> <tt>@XmlAccessorType</tt> annotation can be used with the following program elements:</p>
+- * 
+- * <ul> 
++ *
++ * <ul>
+  *   <li> package</li>
+  *   <li> a top level class </li>
+  * </ul>
+@@ -50,7 +50,7 @@
+  *
+  * <p>This annotation provides control over the default serialization
+  * of properties and fields in a class.
+- * 
++ *
+  * <p>The annotation <tt> @XmlAccessorType </tt> on a package applies to
+  * all classes in the package. The following inheritance
+  * semantics apply:
+@@ -57,7 +57,7 @@
+  *
+  * <ul>
+  *   <li> If there is a <tt>@XmlAccessorType</tt> on a class, then it
+- *        is used. </li>  
++ *        is used. </li>
+  *   <li> Otherwise, if a <tt>@XmlAccessorType</tt> exists on one of
+  *        its super classes, then it is inherited.
+  *   <li> Otherwise, the <tt>@XmlAccessorType </tt> on a package is
+@@ -77,9 +77,9 @@
+  * <pre>
+  *   &#64;XmlAccessorType(XmlAccessType.PUBLIC_MEMBER)
+  * </pre>
+- * <p>This annotation can be used with the following annotations: 
+- *    {@link XmlType}, {@link XmlRootElement}, {@link XmlAccessorOrder}, 
+- *    {@link XmlSchema}, {@link XmlSchemaType}, {@link XmlSchemaTypes}, 
++ * <p>This annotation can be used with the following annotations:
++ *    {@link XmlType}, {@link XmlRootElement}, {@link XmlAccessorOrder},
++ *    {@link XmlSchema}, {@link XmlSchemaType}, {@link XmlSchemaTypes},
+  *    , {@link XmlJavaTypeAdapter}. It can also be used with the
+  *    following annotations at the package level: {@link XmlJavaTypeAdapter}.
+  *
+@@ -86,7 +86,7 @@
+  * @author Sekhar Vajjhala, Sun Microsystems, Inc.
+  * @since JAXB2.0
+  * @see XmlAccessType
+- * @version  $Revision: 1.8 $
++ * @version  $Revision: 1.9 $
+  */
+ 
+ @Inherited @Retention(RUNTIME) @Target({PACKAGE, TYPE})
+@@ -93,8 +93,8 @@
+ public @interface XmlAccessorType {
+ 
+     /**
+-     * Specifies whether fields or properties are serialized. 
+-     * 
++     * Specifies whether fields or properties are serialized.
++     *
+      * @see XmlAccessType
+      */
+     XmlAccessType value() default XmlAccessType.PUBLIC_MEMBER;
+--- old/src/share/classes/javax/xml/bind/annotation/XmlAnyAttribute.java	Thu Jul 30 18:49:22 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/bind/annotation/XmlAnyAttribute.java	Thu Jul 30 18:49:21 2009
+@@ -41,8 +41,8 @@
+  * <p> <b>Usage</b> </p>
+  * <p>
+  * The <tt>&#64;XmlAnyAttribute</tt> annotation can be used with the
+- * following program elements: 
+- * <ul> 
++ * following program elements:
++ * <ul>
+  *   <li> JavaBean property </li>
+  *   <li> non static, non transient field </li>
+  * </ul>
+@@ -49,9 +49,9 @@
+  *
+  * <p>See "Package Specification" in javax.xml.bind.package javadoc for
+  * additional common information.</p>
+- * 
++ *
+  * The usage is subject to the following constraints:
+- * <ul> 
++ * <ul>
+  *   <li> At most one field or property in a class can be annotated
+  *        with <tt>&#64;XmlAnyAttribute</tt>.  </li>
+  *   <li> The type of the property or the field must <tt>java.util.Map</tt> </li>
+@@ -59,9 +59,9 @@
+  *
+  * <p>
+  * While processing attributes to be unmarshalled into a value class,
+- * each attribute that is not statically associated with another 
+- * JavaBean property, via {@link XmlAttribute}, is entered into the 
+- * wildcard attribute map represented by 
++ * each attribute that is not statically associated with another
++ * JavaBean property, via {@link XmlAttribute}, is entered into the
++ * wildcard attribute map represented by
+  * {@link Map}&lt;{@link QName},{@link Object}>. The attribute QName is the
+  * map's key. The key's value is the String value of the attribute.
+  *
+--- old/src/share/classes/javax/xml/bind/annotation/XmlAnyElement.java	Thu Jul 30 18:49:25 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/bind/annotation/XmlAnyElement.java	Thu Jul 30 18:49:25 2009
+@@ -43,12 +43,12 @@
+  * Maps a JavaBean property to XML infoset representation and/or JAXB element.
+  *
+  * <p>
+- * This annotation serves as a "catch-all" property while unmarshalling 
++ * This annotation serves as a "catch-all" property while unmarshalling
+  * xml content into a instance of a JAXB annotated class. It typically
+  * annotates a multi-valued JavaBean property, but it can occur on
+- * single value JavaBean property. During unmarshalling, each xml element 
+- * that does not match a static &#64;XmlElement or &#64;XmlElementRef 
+- * annotation for the other JavaBean properties on the class, is added to this 
++ * single value JavaBean property. During unmarshalling, each xml element
++ * that does not match a static &#64;XmlElement or &#64;XmlElementRef
++ * annotation for the other JavaBean properties on the class, is added to this
+  * "catch-all" property.
+  *
+  * <p>
+@@ -56,7 +56,7 @@
+  * <pre>
+  * &#64;XmlAnyElement
+  * public {@link Element}[] others;
+- * 
++ *
+  * // Collection of {@link Element} or JAXB elements.
+  * &#64;XmlAnyElement(lax="true")
+  * public {@link Object}[] others;
+@@ -81,7 +81,7 @@
+  * <h2>Relationship to other annotations</h2>
+  * <p>
+  * This annotation can be used with {@link XmlJavaTypeAdapter}, so that users
+- * can map their own data structure to DOM, which in turn can be composed 
++ * can map their own data structure to DOM, which in turn can be composed
+  * into XML.
+  *
+  * <p>
+@@ -270,7 +270,7 @@
+      * instead of unmarshalling it to DOM. Additionally, if the element is
+      * unknown but it has a known xsi:type, the unmarshaller eagerly unmarshals
+      * the element to a {@link JAXBElement}, with the unknown element name and
+-     * the JAXBElement value is set to an instance of the JAXB mapping of the 
++     * the JAXBElement value is set to an instance of the JAXB mapping of the
+      * known xsi:type.
+      *
+      * <p>
+--- old/src/share/classes/javax/xml/bind/annotation/XmlAttribute.java	Thu Jul 30 18:49:29 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/bind/annotation/XmlAttribute.java	Thu Jul 30 18:49:28 2009
+@@ -33,13 +33,13 @@
+ 
+ /**
+  * <p>
+- * Maps a JavaBean property to a XML attribute. 
++ * Maps a JavaBean property to a XML attribute.
+  *
+  * <p> <b>Usage</b> </p>
+  * <p>
+  * The <tt>@XmlAttribute</tt> annotation can be used with the
+- * following program elements: 
+- * <ul> 
++ * following program elements:
++ * <ul>
+  *   <li> JavaBean property </li>
+  *   <li> field </li>
+  * </ul>
+@@ -58,7 +58,7 @@
+  *     // Examples
+  *     &#64;XmlAttribute List&lt;Integer> items; //legal
+  *     &#64;XmlAttribute List&lt;Bar> foo; // illegal if Bar does not map to a schema simple type
+- * </pre> 
++ * </pre>
+  *   </li>
+  *   <li> If the type of the field or the property is a non
+  *         collection type, then the type of the property or field
+@@ -70,7 +70,7 @@
+  * </pre>
+  *   </li>
+  *   <li> This annotation can be used with the following annotations:
+- *            {@link XmlID}, 
++ *            {@link XmlID},
+  *            {@link XmlIDREF},
+  *            {@link XmlList},
+  *            {@link XmlSchemaType},
+@@ -85,7 +85,7 @@
+  * <p> <b>Example 1: </b>Map a JavaBean property to an XML attribute.</p>
+  * <pre>
+  *     //Example: Code fragment
+- *     public class USPrice { 
++ *     public class USPrice {
+  *         &#64;XmlAttribute
+  *         public java.math.BigDecimal getPrice() {...} ;
+  *         public void setPrice(java.math.BigDecimal ) {...};
+@@ -108,11 +108,11 @@
+  *     class Foo {
+  *         ...
+  *         &#64;XmlAttribute List&lt;Integer> items;
+- *     } 
++ *     }
+  *
+  *     &lt;!-- Example: XML Schema fragment -->
+  *     &lt;xs:complexType name="foo">
+- *     	 ...
++ *       ...
+  *       &lt;xs:attribute name="items">
+  *         &lt;xs:simpleType>
+  *           &lt;xs:list itemType="xs:int"/>
+@@ -121,7 +121,7 @@
+  *
+  * </pre>
+  * @author Sekhar Vajjhala, Sun Microsystems, Inc.
+- * @version $Revision: 1.13 $
++ * @version $Revision: 1.14 $
+  * @see XmlType
+  * @since JAXB2.0
+  */
+@@ -134,7 +134,7 @@
+      *
+      */
+     String name() default "##default";
+- 
++
+     /**
+      * Specifies if the XML Schema attribute is optional or
+      * required. If true, then the JavaBean property is mapped to a
+@@ -147,7 +147,7 @@
+     /**
+      * Specifies the XML target namespace of the XML Schema
+      * attribute.
+-     * 
++     *
+      */
+     String namespace() default "##default" ;
+ }
+--- old/src/share/classes/javax/xml/bind/annotation/XmlElement.java	Thu Jul 30 18:49:32 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/bind/annotation/XmlElement.java	Thu Jul 30 18:49:32 2009
+@@ -38,8 +38,8 @@
+  * <p> <b>Usage</b> </p>
+  * <p>
+  * </tt>@XmlElement</tt> annotation can be used with the following program
+- * elements: 
+- * <ul> 
++ * elements:
++ * <ul>
+  *   <li> a JavaBean property </li>
+  *   <li> non static, non transient field </li>
+  *   <li> within {@link XmlElements}
+@@ -46,11 +46,11 @@
+  * <p>
+  *
+  * </ul>
+- * 
++ *
+  * The usage is subject to the following constraints:
+- * <ul> 
++ * <ul>
+  *   <li> This annotation can be used with following annotations:
+- *            {@link XmlID}, 
++ *            {@link XmlID},
+  *            {@link XmlIDREF},
+  *            {@link XmlList},
+  *            {@link XmlSchemaType},
+@@ -134,7 +134,7 @@
+  * <p>
+  * @author Sekhar Vajjhala, Sun Microsystems, Inc.
+  * @since JAXB2.0
+- * @version $Revision: 1.18 $
++ * @version $Revision: 1.19 $
+  */
+ 
+ @Retention(RUNTIME) @Target({FIELD, METHOD})
+@@ -142,14 +142,14 @@
+     /**
+      * Name of the XML Schema element.
+      * <p> If the value is "##default", then element name is derived from the
+-     * JavaBean property name. 
++     * JavaBean property name.
+      */
+     String name() default "##default";
+- 
++
+     /**
+-     * Customize the element declaration to be nillable. 
++     * Customize the element declaration to be nillable.
+      * <p>If nillable() is true, then the JavaBean property is
+-     * mapped to a XML Schema nillable element declaration. 
++     * mapped to a XML Schema nillable element declaration.
+      */
+     boolean nillable() default false;
+ 
+@@ -156,7 +156,7 @@
+     /**
+      * Customize the element declaration to be required.
+      * <p>If required() is true, then Javabean property is mapped to
+-     * an XML schema element declaration with minOccurs="1". 
++     * an XML schema element declaration with minOccurs="1".
+      * maxOccurs is "1" for a single valued property and "unbounded"
+      * for a multivalued property.
+      * <p>If required() is false, then the Javabean property is mapped
+@@ -192,7 +192,7 @@
+      * <p>
+      * The '\u0000' value specified as a default of this annotation element
+      * is used as a poor-man's substitute for null to allow implementations
+-     * to recognize the 'no default value' state.  
++     * to recognize the 'no default value' state.
+      */
+     String defaultValue() default "\u0000";
+ 
+@@ -208,5 +208,3 @@
+      */
+     static final class DEFAULT {}
+ }
+-
+-
+--- old/src/share/classes/javax/xml/bind/annotation/XmlElementDecl.java	Thu Jul 30 18:49:36 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/bind/annotation/XmlElementDecl.java	Thu Jul 30 18:49:35 2009
+@@ -42,18 +42,18 @@
+  * declaration. Typically, the element factory method is generated
+  * (and annotated) from a schema into the ObjectFactory class in a
+  * Java package that represents the binding of the element
+- * declaration's target namespace. Thus, while the annotation syntax 
++ * declaration's target namespace. Thus, while the annotation syntax
+  * allows &#64;XmlElementDecl to be used on any method, semantically
+- * its use is restricted to annotation of element factory method. 
++ * its use is restricted to annotation of element factory method.
+  *
+  * The usage is subject to the following constraints:
+- * 
++ *
+  * <ul>
+  *   <li> The class containing the element factory method annotated
+  *        with &#64;XmlElementDecl must be marked with {@link
+- *        XmlRegistry}. </li> 
++ *        XmlRegistry}. </li>
+  *   <li> The element factory method must take one parameter
+- *        assignable to {@link Object}.</li> 
++ *        assignable to {@link Object}.</li>
+  * </ul>
+  *
+  * <p><b>Example 1: </b>Annotation on a factory method
+@@ -65,7 +65,7 @@
+  *         JAXBElement&lt;String> createFoo(String s) { ... }
+  *     }
+  * </pre>
+- * <pre><xmp> 
++ * <pre><xmp>
+  *     <!-- XML input -->
+  *       <foo>string</foo>
+  *
+@@ -85,11 +85,11 @@
+  * <p>
+  * The following example illustrates the use of scope annotation
+  * parameter in binding of element declaration in schema derived
+- * code. 
++ * code.
+  * <p>
+  * The following example may be replaced in a future revision of
+  * this javadoc.
+- * 
++ *
+  * <pre><xmp>
+  *     <!-- Example: XML schema definition -->
+  *     <xs:schema>
+@@ -98,10 +98,10 @@
+  *           <xs:element name="foo" type="xs:string"/>
+  *           <xs:element name="bar" type="xs:string"/>
+  *         </xs:choice>
+- *       </xs:complexType> 
++ *       </xs:complexType>
+  *       <xs:element name="foo" type="xs:int"/>
+  *     </xs:schema>
+- * </xmp></pre> 
++ * </xmp></pre>
+  * <pre>
+  *     // Example: expected default binding
+  *     class Pea {
+@@ -111,23 +111,23 @@
+  *         })
+  *         List&lt;JAXBElement&lt;String>> fooOrBar;
+  *     }
+- * 
++ *
+  *     &#64;XmlRegistry
+  *     class ObjectFactory {
+  *         &#64;XmlElementDecl(scope=Pea.class,name="foo")
+  *         JAXBElement<String> createPeaFoo(String s);
+- * 
++ *
+  *         &#64;XmlElementDecl(scope=Pea.class,name="bar")
+  *         JAXBElement<String> createPeaBar(String s);
+- * 
++ *
+  *         &#64;XmlElementDecl(name="foo")
+  *         JAXBElement<Integer> createFoo(Integer i);
+  *     }
+- * 
++ *
+  * </pre>
+  * Without scope createFoo and createPeaFoo would become ambiguous
+  * since both of them map to a XML schema element with the same local
+- * name "foo". 
++ * name "foo".
+  *
+  * @see XmlRegistry
+  * @since JAXB 2.0
+@@ -170,7 +170,7 @@
+      * <p>
+      * This specifies the namespace name of the XML element whose local
+      * name is specified by <tt>substitutionHeadName()</tt>.
+-     * <p> 
++     * <p>
+      * If <tt>susbtitutionHeadName()</tt> is "", then this
+      * value can only be "##default". But the value is ignored since
+      * since this element is not part of susbtitution group when the
+@@ -177,7 +177,7 @@
+      * value of <tt>susbstitutionHeadName()</tt> is "".
+      * <p>
+      * If <tt>susbtitutionHeadName()</tt> is not "" and the value is
+-     * "##default", then the namespace name is the namespace name to 
++     * "##default", then the namespace name is the namespace name to
+      * which the package of the containing class, marked with {@link
+      * XmlRegistry }, is mapped.
+      * <p>
+@@ -207,7 +207,7 @@
+      * to recognize the 'no default value' state.
+      */
+     String defaultValue() default "\u0000";
+-    
++
+     /**
+      * Used in {@link XmlElementDecl#scope()} to
+      * signal that the declaration is in the global scope.
+--- old/src/share/classes/javax/xml/bind/annotation/XmlElementRef.java	Thu Jul 30 18:49:39 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/bind/annotation/XmlElementRef.java	Thu Jul 30 18:49:39 2009
+@@ -33,13 +33,13 @@
+ import static java.lang.annotation.ElementType.FIELD;
+ import static java.lang.annotation.ElementType.METHOD;
+ 
+-/** 
++/**
+  * <p>
+  * Maps a JavaBean property to a XML element derived from property's type.
+  * <p>
+  * <b>Usage</b>
+  * <p>
+- * <tt>&#64;XmlElementRef</tt> annotation can be used with a 
++ * <tt>&#64;XmlElementRef</tt> annotation can be used with a
+  * JavaBean property or from within {@link XmlElementRefs}
+  * <p>
+  * This annotation dynamically associates an XML element name with the JavaBean
+@@ -52,7 +52,7 @@
+  * <h3> XML Schema substitution group support </h3>
+  * XML Schema allows a XML document author to use XML element names
+  * that were not statically specified in the content model of a
+- * schema using substitution groups. Schema derived code provides 
++ * schema using substitution groups. Schema derived code provides
+  * support for substitution groups using an <i>element property</i>,
+  * (section 5.5.5, "Element Property" of JAXB 2.0 specification). An
+  * element property method signature is of the form:
+@@ -67,7 +67,7 @@
+  * element property indicates that the element name from <tt>JAXBElement</tt>
+  * instance be used instead of deriving an XML element name from the
+  * JavaBean property name.
+- * 
++ *
+  * <p>
+  * The usage is subject to the following constraints:
+  * <ul>
+@@ -103,8 +103,8 @@
+  *     &#64;XmlRootElement(name="target")
+  *     class Target {
+  *         // The presence of &#64;XmlElementRef indicates that the XML
+- *         // element name will be derived from the &#64;XmlRootElement 
+- *         // annotation on the type (for e.g. "jar" for JarTask). 
++ *         // element name will be derived from the &#64;XmlRootElement
++ *         // annotation on the type (for e.g. "jar" for JarTask).
+  *         &#64;XmlElementRef
+  *         List&lt;Task> tasks;
+  *     }
+@@ -162,15 +162,15 @@
+  * <p> The following example shows the annotations for XML Schema
+  * substitution groups.  The annotations and the ObjectFactory are
+  * derived from the schema.
+- * 
++ *
+  * <pre>
+  *     &#64;XmlElement
+  *     class Math {
+- *         //  The value of {@link #type()}is 
++ *         //  The value of {@link #type()}is
+  *         //  JAXBElement.class , which indicates the XML
+  *         //  element name ObjectFactory - in general a class marked
+  *         //  with &#64;XmlRegistry. (See ObjectFactory below)
+- *         //  
++ *         //
+  *         //  The {@link #name()} is "operator", a pointer to a
+  *         // factory method annotated with a
+  *         //  {@link XmlElementDecl} with the name "operator". Since
+@@ -180,7 +180,7 @@
+  *         //  elements "add" or "sub". At runtime, JAXBElement
+  *         //  instance contains the element name that has been
+  *         //  substituted in the XML document.
+- *         // 
++ *         //
+  *         &#64;XmlElementRef(type=JAXBElement.class,name="operator")
+  *         JAXBElement&lt;? extends Operator> term;
+  *     }
+@@ -213,7 +213,7 @@
+  *     &lt;/math>
+  * </pre>
+  *
+- * 
++ *
+  * @author <ul><li>Kohsuke Kawaguchi, Sun Microsystems,Inc. </li><li>Sekhar Vajjhala, Sun Microsystems, Inc.</li></ul>
+  * @see XmlElementRefs
+  * @since JAXB2.0
+@@ -233,7 +233,7 @@
+      * This parameter and {@link #name()} are used to determine the
+      * XML element for the JavaBean property.
+      *
+-     * <p> If <tt>type()</tt> is <tt>JAXBElement.class</tt> , then 
++     * <p> If <tt>type()</tt> is <tt>JAXBElement.class</tt> , then
+      * <tt>namespace()</tt> and <tt>name()</tt>
+      * point to a factory method with {@link XmlElementDecl}. The XML
+      * element name is the element name from the factory method's
+@@ -249,7 +249,7 @@
+      * an {@link XmlElementDecl}, then it is an error.
+      *
+      * <p> If <tt>type()</tt> is not <tt>JAXBElement.class</tt>, then
+-     * this value must be "". 
++     * this value must be "".
+      *
+      */
+     String namespace() default "";
+--- old/src/share/classes/javax/xml/bind/annotation/XmlElementRefs.java	Thu Jul 30 18:49:43 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/bind/annotation/XmlElementRefs.java	Thu Jul 30 18:49:42 2009
+@@ -43,7 +43,7 @@
+  * the same tag name with @xsi:type, whereas a reference property produces
+  * a different tag name (the tag name that's on the the sub-class.)
+  *
+- * <p> This annotation can be used with the following annotations: 
++ * <p> This annotation can be used with the following annotations:
+  * {@link XmlJavaTypeAdapter}, {@link XmlElementWrapper}.
+  *
+  * @author <ul><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Sekhar Vajjhala, Sun Microsystems, Inc.</li></ul>
+--- old/src/share/classes/javax/xml/bind/annotation/XmlElementWrapper.java	Thu Jul 30 18:49:46 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/bind/annotation/XmlElementWrapper.java	Thu Jul 30 18:49:46 2009
+@@ -36,7 +36,7 @@
+  *
+  * This is primarily intended to be used to produce a wrapper
+  * XML element around collections. The annotation therefore supports
+- * two forms of serialization shown below. 
++ * two forms of serialization shown below.
+  *
+  * <pre>
+  *    //Example: code fragment
+@@ -45,7 +45,7 @@
+  *    // XML Serialization Form 1 (Unwrapped collection)
+  *    &lt;names> ... &lt;/names>
+  *    &lt;names> ... &lt;/names>
+- * 
++ *
+  *    // XML Serialization Form 2 ( Wrapped collection )
+  *    &lt;wrapperElement>
+  *       &lt;names> value-of-item &lt;/names>
+@@ -57,12 +57,12 @@
+  * <p> The two serialized XML forms allow a null collection to be
+  * represented either by absence or presence of an element with a
+  * nillable attribute.
+- * 
++ *
+  * <p> <b>Usage</b> </p>
+  * <p>
+  * The <tt>@XmlElementWrapper</tt> annotation can be used with the
+- * following program elements: 
+- * <ul> 
++ * following program elements:
++ * <ul>
+  *   <li> JavaBean property </li>
+  *   <li> non static, non transient field </li>
+  * </ul>
+@@ -71,7 +71,7 @@
+  * <ul>
+  *   <li> The property must be a collection property </li>
+  *   <li> This annotation can be used with the following annotations:
+- *            {@link XmlElement}, 
++ *            {@link XmlElement},
+  *            {@link XmlElements},
+  *            {@link XmlElementRef},
+  *            {@link XmlElementRefs},
+@@ -82,7 +82,7 @@
+  * additional common information.</p>
+  *
+  * @author <ul><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Sekhar Vajjhala, Sun Microsystems, Inc.</li></ul>
+- * @see XmlElement 
++ * @see XmlElement
+  * @see XmlElements
+  * @see XmlElementRef
+  * @see XmlElementRefs
+--- old/src/share/classes/javax/xml/bind/annotation/XmlElements.java	Thu Jul 30 18:49:50 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/bind/annotation/XmlElements.java	Thu Jul 30 18:49:49 2009
+@@ -52,7 +52,7 @@
+  * </ul>
+  *
+  * This annotation is intended for annotation a JavaBean collection
+- * property (e.g. List). 
++ * property (e.g. List).
+  *
+  * <p><b>Usage</b></p>
+  *
+@@ -69,10 +69,10 @@
+  * additional common information.</p>
+  *
+  * <hr>
+- * 
++ *
+  * <p><b>Example 1:</b> Map to a list of elements</p>
+  * <pre>
+- *    
++ *
+  *    // Mapped code fragment
+  *    public class Foo {
+  *        &#64;XmlElements(
+@@ -82,7 +82,7 @@
+  *         public List items;
+  *    }
+  *
+- *    &lt;!-- XML Representation for a List of {1,2.5} 
++ *    &lt;!-- XML Representation for a List of {1,2.5}
+  *            XML output is not wrapped using another element -->
+  *    ...
+  *    <A> 1 </A>
+@@ -104,7 +104,7 @@
+  * <p><b>Example 2:</b> Map to a list of elements wrapped with another element
+  * </p>
+  * <pre>
+- * 
++ *
+  *    // Mapped code fragment
+  *    public class Foo {
+  *        &#64;XmlElementWrapper(name="bar")
+@@ -130,7 +130,7 @@
+  *    &lt;/xs:complexType>
+  * </pre>
+  *
+- * <p><b>Example 3:</b> Change element name based on type using an adapter. 
++ * <p><b>Example 3:</b> Change element name based on type using an adapter.
+  * </p>
+  * <pre>
+  *    class Foo {
+@@ -141,7 +141,7 @@
+  *       })
+  *       Q bar;
+  *    }
+- * 
++ *
+  *    &#64;XmlType abstract class P {...}
+  *    &#64;XmlType(name="PX") class PX extends P {...}
+  *    &#64;XmlType(name="PY") class PY extends P {...}
+@@ -160,9 +160,9 @@
+  *      &lt;/xs:sequence>
+  *    &lt;/xs:complexType>
+  * </pre>
+- * 
++ *
+  * @author <ul><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Sekhar Vajjhala, Sun Microsystems, Inc.</li></ul>
+- * @see XmlElement 
++ * @see XmlElement
+  * @see XmlElementRef
+  * @see XmlElementRefs
+  * @see XmlJavaTypeAdapter
+--- old/src/share/classes/javax/xml/bind/annotation/XmlEnum.java	Thu Jul 30 18:49:53 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/bind/annotation/XmlEnum.java	Thu Jul 30 18:49:53 2009
+@@ -40,14 +40,14 @@
+  * <p> <b>Usage</b> </p>
+  * <p>
+  * The <tt>@XmlEnum</tt> annotation can be used with the
+- * following program elements: 
+- * <ul> 
++ * following program elements:
++ * <ul>
+  *   <li>enum type</li>
+  * </ul>
+  *
+  * <p> The usage is subject to the following constraints:
+- * <ul> 
+- *   <li> This annotation can be used the following other annotations: 
++ * <ul>
++ *   <li> This annotation can be used the following other annotations:
+  *         {@link XmlType},
+  *         {@link XmlRootElement} </li>
+  * </ul>
+@@ -55,9 +55,9 @@
+  * additional common information </p>
+  *
+  * <p>An enum type is mapped to a schema simple type with enumeration
+- * facets. The schema type is derived from the Java type to which 
++ * facets. The schema type is derived from the Java type to which
+  * <tt>@XmlEnum.value()</tt>. Each enum constant <tt>@XmlEnumValue</tt>
+- * must have a valid lexical representation for the type 
++ * must have a valid lexical representation for the type
+  * <tt>@XmlEnum.value()</tt> .
+  *
+  * <p><b>Examples:</b> See examples in {@link XmlEnumValue}
+--- old/src/share/classes/javax/xml/bind/annotation/XmlEnumValue.java	Thu Jul 30 18:50:00 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/bind/annotation/XmlEnumValue.java	Thu Jul 30 18:50:00 2009
+@@ -31,13 +31,13 @@
+ import static java.lang.annotation.ElementType.FIELD;
+ 
+ /**
+- * Maps an enum constant in {@link Enum} type to XML representation.  
+- * 
++ * Maps an enum constant in {@link Enum} type to XML representation.
++ *
+  * <p> <b>Usage</b> </p>
+  *
+  * <p> The <tt>@XmlEnumValue</tt> annotation can be used with the
+- *     following program elements:  
+- * <ul> 
++ *     following program elements:
++ * <ul>
+  *   <li>enum constant</li>
+  * </ul>
+  *
+@@ -51,7 +51,7 @@
+  * facets. The schema type is derived from the Java type specified in
+  * <tt>@XmlEnum.value()</tt>. Each enum constant <tt>@XmlEnumValue</tt>
+  * must have a valid lexical representation for the type
+- * <tt>@XmlEnum.value()</tt> 
++ * <tt>@XmlEnum.value()</tt>
+  *
+  * <p> In the absence of this annotation, {@link Enum#name()} is used
+  * as the XML representation.
+@@ -77,7 +77,7 @@
+  *     //Example: code fragment
+  *     &#64;XmlType
+  *     &#64;XmlEnum(Integer.class)
+- *     public enum Coin { 
++ *     public enum Coin {
+  *         &#64;XmlEnumValue("1") PENNY(1),
+  *         &#64;XmlEnumValue("5") NICKEL(5),
+  *         &#64;XmlEnumValue("10") DIME(10),
+@@ -95,7 +95,7 @@
+  * </pre>
+  *
+  * <p><b>Example 3: </b>Map enum constant name -> enumeration facet </p>
+- * 
++ *
+  * <pre>
+  *     //Code fragment
+  *     &#64;XmlType
+@@ -104,7 +104,7 @@
+  *         &#64;XmlEnumValue("1") ONE,
+  *         &#64;XmlEnumValue("2") TWO;
+  *     }
+- * 
++ *
+  *     &lt;!-- Example: XML Schema fragment -->
+  *     &lt;xs:simpleType name="Code">
+  *       &lt;xs:restriction base="xs:int">
+--- old/src/share/classes/javax/xml/bind/annotation/XmlID.java	Thu Jul 30 18:50:04 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/bind/annotation/XmlID.java	Thu Jul 30 18:50:03 2009
+@@ -40,29 +40,29 @@
+  * reference to be marshalled by reference or containment
+  * appropriately. Annotations <tt>&#64;XmlID</tt> and <tt>&#64;XmlIDREF</tt>
+  * together allow a customized mapping of a JavaBean property's
+- * type by containment or reference. 
++ * type by containment or reference.
+  *
+  * <p><b>Usage</b> </p>
+  * The <tt>&#64;XmlID</tt> annotation can be used with the following
+- * program elements: 
+- * <ul> 
++ * program elements:
++ * <ul>
+  *   <li> a JavaBean property </li>
+  *   <li> non static, non transient field </li>
+  * </ul>
+- * 
++ *
+  * <p>See "Package Specification" in javax.xml.bind.package javadoc for
+  * additional common information.</p>
+  *
+  * The usage is subject to the following constraints:
+- * <ul> 
++ * <ul>
+  *   <li> At most one field or property in a class can be annotated
+  *        with <tt>&#64;XmlID</tt>.  </li>
+  *   <li> The JavaBean property's type must be <tt>java.lang.String</tt>.</li>
+  *   <li> The only other mapping annotations that can be used
+  *        with <tt>&#64;XmlID</tt>
+- *        are:<tt>&#64;XmlElement</tt> and <tt>&#64;XmlAttribute</tt>.</li>  
++ *        are:<tt>&#64;XmlElement</tt> and <tt>&#64;XmlAttribute</tt>.</li>
+  * </ul>
+- * 
++ *
+  * <p><b>Example</b>: Map a JavaBean property's type to <tt>xs:ID</tt></p>
+  * <pre>
+  *    // Example: code fragment
+@@ -71,7 +71,7 @@
+  *        &#64;XmlID
+  *        public String getCustomerID();
+  *        public void setCustomerID(String id);
+- *        .... other properties not shown 
++ *        .... other properties not shown
+  *    }
+  *
+  *    &lt;!-- Example: XML Schema fragment -->
+@@ -88,11 +88,8 @@
+  * @author Sekhar Vajjhala, Sun Microsystems, Inc.
+  * @see XmlIDREF
+  * @since JAXB2.0
+- * @version $Revision: 1.4 $
++ * @version $Revision: 1.5 $
+  */
+ 
+ @Retention(RUNTIME) @Target({FIELD, METHOD})
+ public @interface XmlID { }
+-
+-
+-
+--- old/src/share/classes/javax/xml/bind/annotation/XmlIDREF.java	Thu Jul 30 18:50:07 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/bind/annotation/XmlIDREF.java	Thu Jul 30 18:50:07 2009
+@@ -33,7 +33,7 @@
+ /**
+  * <p>
+  * Maps a JavaBean property to XML IDREF.
+- * 
++ *
+  * <p>
+  * To preserve referential integrity of an object graph across XML
+  * serialization followed by a XML deserialization, requires an object
+@@ -40,16 +40,16 @@
+  * reference to be marshalled by reference or containment
+  * appropriately. Annotations <tt>&#64;XmlID</tt> and <tt>&#64;XmlIDREF</tt>
+  * together allow a customized mapping of a JavaBean property's
+- * type by containment or reference. 
++ * type by containment or reference.
+  *
+  * <p><b>Usage</b> </p>
+  * The <tt>&#64;XmlIDREF</tt> annotation can be used with the following
+- * program elements: 
+- * <ul> 
++ * program elements:
++ * <ul>
+  *   <li> a JavaBean property </li>
+  *   <li> non static, non transient field </li>
+  * </ul>
+- * 
++ *
+  * <p>See "Package Specification" in javax.xml.bind.package javadoc for
+  * additional common information.</p>
+  *
+@@ -58,7 +58,7 @@
+  *
+  *   <li> If the type of the field or property is a collection type,
+  *        then the collection item type must contain a property or
+- *        field annotated with <tt>&#64;XmlID</tt>.  </li> 
++ *        field annotated with <tt>&#64;XmlID</tt>.  </li>
+  *   <li> If the field or property is single valued, then the type of
+  *        the property or field must contain a property or field
+  *        annotated with <tt>&#64;XmlID</tt>.
+@@ -65,11 +65,11 @@
+  *        <p>Note: If the collection item type or the type of the
+  *        property (for non collection type) is java.lang.Object, then
+  *        the instance must contain a property/field annotated with
+- *        <tt>&#64;XmlID</tt> attribute.  
++ *        <tt>&#64;XmlID</tt> attribute.
+  *        </li>
+  *   <li> This annotation can be used with the following annotations:
+- *        {@link XmlElement}, {@link XmlAttribute}, {@link XmlList}, 
+- *        and {@link XmlElements}.</li>  
++ *        {@link XmlElement}, {@link XmlAttribute}, {@link XmlList},
++ *        and {@link XmlElements}.</li>
+  *
+  * </ul>
+  * <p><b>Example:</b> Map a JavaBean property to <tt>xs:IDREF</tt>
+@@ -98,24 +98,24 @@
+  *
+  * <p><b>Example 2: </b> The following is a complete example of
+  * containment versus reference.
+- * 
++ *
+  * <pre>
+  *    // By default, Customer maps to complex type <tt>xs:Customer</tt>
+  *    public class Customer {
+- *        
++ *
+  *        // map JavaBean property type to <tt>xs:ID</tt>
+  *        &#64;XmlID public String getCustomerID();
+  *        public void setCustomerID(String id);
+  *
+- *        // .... other properties not shown 
++ *        // .... other properties not shown
+  *    }
+  *
+  *
+- *   // By default, Invoice maps to a complex type <tt>xs:Invoice</tt> 
++ *   // By default, Invoice maps to a complex type <tt>xs:Invoice</tt>
+  *   public class Invoice {
+- *    
++ *
+  *       // map by reference
+- *       &#64;XmlIDREF public Customer getCustomer();       
++ *       &#64;XmlIDREF public Customer getCustomer();
+  *       public void setCustomer(Customer customer);
+  *
+  *      // .... other properties not shown here
+@@ -125,7 +125,7 @@
+  *   public class Shipping {
+  *
+  *       // map by reference
+- *       &#64;XmlIDREF public Customer getCustomer();       
++ *       &#64;XmlIDREF public Customer getCustomer();
+  *       public void setCustomer(Customer customer);
+  *   }
+  *
+@@ -136,11 +136,11 @@
+  *       // map reference to Customer by containment by default.
+  *       public Customer getCustomer();
+  *
+- *       // maps reference to Shipping by containment by default. 
+- *       public Shipping getShipping();     
++ *       // maps reference to Shipping by containment by default.
++ *       public Shipping getShipping();
+  *
+- *       // maps reference to Invoice by containment by default. 
+- *       public Invoice getInvoice();     
++ *       // maps reference to Invoice by containment by default.
++ *       public Invoice getInvoice();
+  *   }
+  *
+  *   &lt;!-- XML Schema mapping for above code frament -->
+@@ -193,7 +193,7 @@
+  *       &lt;shipping customer="Alice">
+  *           ....
+  *       &lt;/shipping>
+- *         
++ *
+  *       &lt;invoice customer="Alice">
+  *           ....
+  *       &lt;/invoice>
+@@ -217,7 +217,7 @@
+  *           &lt;xs:element name="Alice" type="xs:IDREF"/>
+  *         &lt;/xs:choice>
+  *       &lt;/xs:sequence>
+- *     &lt;/xs:complexType> 
++ *     &lt;/xs:complexType>
+  * </pre>
+  *
+  * <p><b>Example 4: </b> Mapping a List to a list of elements of type IDREF.
+@@ -239,12 +239,12 @@
+  *           &lt;xs:element name="John" type="xs:IDREF"/>
+  *         &lt;/xs:choice>
+  *       &lt;/xs:sequence>
+- *     &lt;/xs:complexType> 
++ *     &lt;/xs:complexType>
+  * </pre>
+- * @author Sekhar Vajjhala, Sun Microsystems, Inc. 
++ * @author Sekhar Vajjhala, Sun Microsystems, Inc.
+  * @see XmlID
+  * @since JAXB2.0
+- * @version $Revision: 1.11 $
++ * @version $Revision: 1.12 $
+  */
+ 
+ @Retention(RUNTIME) @Target({FIELD, METHOD})
+--- old/src/share/classes/javax/xml/bind/annotation/XmlInlineBinaryData.java	Thu Jul 30 18:50:11 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/bind/annotation/XmlInlineBinaryData.java	Thu Jul 30 18:50:10 2009
+@@ -38,17 +38,17 @@
+ import javax.activation.DataHandler;
+ 
+ /**
+- * Disable consideration of XOP encoding for datatypes that are bound to 
++ * Disable consideration of XOP encoding for datatypes that are bound to
+  * base64-encoded binary data in XML.
+  *
+  * <p>
+- * When XOP encoding is enabled as described in {@link AttachmentMarshaller#isXOPPackage()}, this annotation disables datatypes such as {@link Image} or {@link Source} or <tt>byte[]</tt> that are bound to base64-encoded binary from being considered for 
++ * When XOP encoding is enabled as described in {@link AttachmentMarshaller#isXOPPackage()}, this annotation disables datatypes such as {@link Image} or {@link Source} or <tt>byte[]</tt> that are bound to base64-encoded binary from being considered for
+  * XOP encoding. If a JAXB property is annotated with this annotation or if
+- * the JAXB property's base type is annotated with this annotation, 
+- * neither 
++ * the JAXB property's base type is annotated with this annotation,
++ * neither
+  * {@link AttachmentMarshaller#addMtomAttachment(DataHandler, String, String)}
+- * nor 
+- * {@link AttachmentMarshaller#addMtomAttachment(byte[], int, int, String, String, String)} is 
++ * nor
++ * {@link AttachmentMarshaller#addMtomAttachment(byte[], int, int, String, String, String)} is
+  * ever called for the property. The binary data will always be inlined.
+  *
+  * @author Joseph Fialli
+--- old/src/share/classes/javax/xml/bind/annotation/XmlList.java	Thu Jul 30 18:50:15 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/bind/annotation/XmlList.java	Thu Jul 30 18:50:14 2009
+@@ -37,8 +37,8 @@
+  * <p><b>Usage</b> </p>
+  * <p>
+  * The <tt>@XmlList</tt> annotation can be used with the
+- * following program elements: 
+- * <ul> 
++ * following program elements:
++ * <ul>
+  *   <li> JavaBean property </li>
+  *   <li> field </li>
+  * </ul>
+@@ -65,7 +65,7 @@
+  * </foo>
+  * </xmp></pre>
+  *
+- * &#64;XmlList annotation, on the other hand, allows multiple values to be 
++ * &#64;XmlList annotation, on the other hand, allows multiple values to be
+  * represented as whitespace-separated tokens in a single element. For example,
+  *
+  * <pre>
+@@ -86,7 +86,7 @@
+  * </xmp></pre>
+  *
+  * <p>This annotation can be used with the following annotations:
+- *        {@link XmlElement}, 
++ *        {@link XmlElement},
+  *        {@link XmlAttribute},
+  *        {@link XmlValue},
+  *        {@link XmlIDREF}.
+@@ -94,12 +94,12 @@
+  *    <li> The use of <tt>@XmlList</tt> with {@link XmlValue} while
+  *         allowed, is redundant since  {@link XmlList} maps a
+  *         collection type to a simple schema type that derives by
+- *         list just as {@link XmlValue} would. </li> 
++ *         list just as {@link XmlValue} would. </li>
+  *
+  *    <li> The use of <tt>@XmlList</tt> with {@link XmlAttribute} while
+  *         allowed, is redundant since  {@link XmlList} maps a
+  *         collection type to a simple schema type that derives by
+- *         list just as {@link XmlAttribute} would. </li> 
++ *         list just as {@link XmlAttribute} would. </li>
+  *  </ul>
+  *
+  * @author <ul><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Sekhar Vajjhala, Sun Microsystems, Inc.</li></ul>
+--- old/src/share/classes/javax/xml/bind/annotation/XmlMimeType.java	Thu Jul 30 18:50:18 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/bind/annotation/XmlMimeType.java	Thu Jul 30 18:50:17 2009
+@@ -45,7 +45,7 @@
+  * <p>
+  * If a property that has this annotation has a sibling property bound to
+  * the xmime:contentType attribute, and if in the instance the property has a value,
+- * the value of the attribute takes precedence and that will control the marshalling. 
++ * the value of the attribute takes precedence and that will control the marshalling.
+  *
+  * @author Kohsuke Kawaguchi
+  * @since JAXB2.0
+--- old/src/share/classes/javax/xml/bind/annotation/XmlMixed.java	Thu Jul 30 18:50:22 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/bind/annotation/XmlMixed.java	Thu Jul 30 18:50:21 2009
+@@ -60,39 +60,39 @@
+  *  <!-- schema fragment having  mixed content -->
+  *  <xs:complexType name="letterBody" mixed="true">
+  *    <xs:sequence>
+- *	<xs:element name="name" type="xs:string"/>
+- *	<xs:element name="quantity" type="xs:positiveInteger"/>
+- *	<xs:element name="productName" type="xs:string"/>
+- *	<!-- etc. -->
++ *      <xs:element name="name" type="xs:string"/>
++ *      <xs:element name="quantity" type="xs:positiveInteger"/>
++ *      <xs:element name="productName" type="xs:string"/>
++ *      <!-- etc. -->
+  *    </xs:sequence>
+  *  </xs:complexType>
+  *  <xs:element name="letterBody" type="letterBody"/>
+- * 
+- * // Schema-derived Java code: 
+- * // (Only annotations relevant to mixed content are shown below, 
++ *
++ * // Schema-derived Java code:
++ * // (Only annotations relevant to mixed content are shown below,
+  * //  others are ommitted.)
+  * import java.math.BigInteger;
+  * public class ObjectFactory {
+- * 	// element instance factories
+- * 	JAXBElement<LetterBody> createLetterBody(LetterBody value);
+- * 	JAXBElement<String>     createLetterBodyName(String value);
+- * 	JAXBElement<BigInteger> createLetterBodyQuantity(BigInteger value);
+- * 	JAXBElement<String>     createLetterBodyProductName(String value);
++ *      // element instance factories
++ *      JAXBElement<LetterBody> createLetterBody(LetterBody value);
++ *      JAXBElement<String>     createLetterBodyName(String value);
++ *      JAXBElement<BigInteger> createLetterBodyQuantity(BigInteger value);
++ *      JAXBElement<String>     createLetterBodyProductName(String value);
+  *      // type instance factory
+- * 	LetterBody> createLetterBody();
++ *      LetterBody> createLetterBody();
+  * }
+  * </xmp></pre>
+  * <pre>
+  * public class LetterBody {
+- * 	// Mixed content can contain instances of Element classes
+- * 	// Name, Quantity and ProductName. Text data is represented as
+- *	// java.util.String for text.
+- *	&#64;XmlMixed 
+- * 	&#64;XmlElementRefs({
+- *		&#64;XmlElementRef(name="productName", type=JAXBElement.class),
+- *		&#64;XmlElementRef(name="quantity", type=JAXBElement.class),
+- *		&#64;XmlElementRef(name="name", type=JAXBElement.class)})
+- *	List getContent(){...}
++ *      // Mixed content can contain instances of Element classes
++ *      // Name, Quantity and ProductName. Text data is represented as
++ *      // java.util.String for text.
++ *      &#64;XmlMixed
++ *      &#64;XmlElementRefs({
++ *              &#64;XmlElementRef(name="productName", type=JAXBElement.class),
++ *              &#64;XmlElementRef(name="quantity", type=JAXBElement.class),
++ *              &#64;XmlElementRef(name="name", type=JAXBElement.class)})
++ *      List getContent(){...}
+  * }
+  * </pre>
+  * The following is an XML instance document with mixed content
+@@ -109,14 +109,14 @@
+  * JAXBElement<LetterBody> lbe = ObjectFactory.createLetterBody(lb);
+  * List gcl = lb.getContent();  //add mixed content to general content property.
+  * gcl.add("Dear Mr.");  // add text information item as a String.
+- * 
++ *
+  * // add child element information item
+  * gcl.add(ObjectFactory.createLetterBodyName("Robert Smith"));
+  * gcl.add("Your order of "); // add text information item as a String
+- * 
++ *
+  * // add children element information items
+  * gcl.add(ObjectFactory.
+- * 	 		createLetterBodyQuantity(new BigInteger("1")));
++ *                      createLetterBodyQuantity(new BigInteger("1")));
+  * gcl.add(ObjectFactory.createLetterBodyProductName("Baby Monitor"));
+  * gcl.add("shipped from our warehouse");  // add text information item
+  * </xmp></pre>
+--- old/src/share/classes/javax/xml/bind/annotation/XmlNs.java	Thu Jul 30 18:50:25 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/bind/annotation/XmlNs.java	Thu Jul 30 18:50:25 2009
+@@ -34,7 +34,7 @@
+  * Associates a namespace prefix with a XML namespace URI.
+  *
+  * <p><b>Usage</b></p>
+- * <p><tt>@XmlNs</tt> annotation is intended for use from other 
++ * <p><tt>@XmlNs</tt> annotation is intended for use from other
+  * program annotations.
+  *
+  * <p>See "Package Specification" in javax.xml.bind.package javadoc for
+@@ -43,7 +43,7 @@
+  * <p><b>Example:</b>See <tt>XmlSchema</tt> annotation type for an example.
+  * @author Sekhar Vajjhala, Sun Microsystems, Inc.
+  * @since JAXB2.0
+- * @version $Revision: 1.2 $
++ * @version $Revision: 1.3 $
+  */
+ 
+ @Retention(RUNTIME) @Target({})
+@@ -56,7 +56,5 @@
+     /**
+      * Namespace URI
+      */
+-    String namespaceURI(); 
++    String namespaceURI();
+ }
+-
+-
+--- old/src/share/classes/javax/xml/bind/annotation/XmlNsForm.java	Thu Jul 30 18:50:29 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/bind/annotation/XmlNsForm.java	Thu Jul 30 18:50:28 2009
+@@ -26,12 +26,12 @@
+ package javax.xml.bind.annotation;
+ 
+ /**
+- * Enumeration of XML Schema namespace qualifications. 
++ * Enumeration of XML Schema namespace qualifications.
+  *
+  * <p>See "Package Specification" in javax.xml.bind.package javadoc for
+  * additional common information.</p>
+  *
+- * <p><b>Usage</b>  
++ * <p><b>Usage</b>
+  * <p>
+  * The namespace qualification values are used in the annotations
+  * defined in this packge. The enumeration values are mapped as follows:
+@@ -43,7 +43,7 @@
+  *       <td><b>Enum Value<b></td>
+  *       <td><b>XML Schema Value<b></td>
+  *     </tr>
+- * 
++ *
+  *     <tr valign="top">
+  *       <td>UNQUALIFIED</td>
+  *       <td>unqualified</td>
+@@ -59,12 +59,9 @@
+  *     </tr>
+  *   </tbody>
+  * </table>
+- * 
++ *
+  * @author Sekhar Vajjhala, Sun Microsystems, Inc.
+  * @since JAXB2.0
+- * @version $Revision: 1.1 $
++ * @version $Revision: 1.2 $
+  */
+ public enum XmlNsForm {UNQUALIFIED, QUALIFIED, UNSET}
+-
+-
+-
+--- old/src/share/classes/javax/xml/bind/annotation/XmlRootElement.java	Thu Jul 30 18:50:32 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/bind/annotation/XmlRootElement.java	Thu Jul 30 18:50:32 2009
+@@ -37,8 +37,8 @@
+  * <p> <b>Usage</b> </p>
+  * <p>
+  * The &#64;XmlRootElement annotation can be used with the following program
+- * elements: 
+- * <ul> 
++ * elements:
++ * <ul>
+  *   <li> a top level class </li>
+  *   <li> an enum type </li>
+  * </ul>
+@@ -45,14 +45,14 @@
+  *
+  * <p>See "Package Specification" in javax.xml.bind.package javadoc for
+  * additional common information.</p>
+- * 
++ *
+  * <p>
+- * When a top level class or an enum type is annotated with the 
+- * &#64;XmlRootElement annotation, then its value is represented 
++ * When a top level class or an enum type is annotated with the
++ * &#64;XmlRootElement annotation, then its value is represented
+  * as XML element in an XML document.
+  *
+  * <p> This annotation can be used with the following annotations:
+- * {@link XmlType}, {@link XmlEnum}, {@link XmlAccessorType}, 
++ * {@link XmlType}, {@link XmlEnum}, {@link XmlAccessorType},
+  * {@link XmlAccessorOrder}.
+  * <p>
+ 
+@@ -99,7 +99,7 @@
+  * <p>
+  *
+  * <b>Example 2: Orthogonality to type inheritance </b>
+- * 
++ *
+  * <p>
+  * An element declaration annotated on a type is not inherited by its
+  * derived types. The following example shows this.
+@@ -111,7 +111,7 @@
+  *         Point3D(int _x,int _y,int _z) {super(_x,_y);z=_z;}
+  *     }
+  *
+- *     //Example: Code fragment corresponding to XML output * 
++ *     //Example: Code fragment corresponding to XML output *
+  *     marshal( new Point3D(3,5,0), System.out );
+  *
+  *     &lt;!-- Example: XML output -->
+@@ -174,7 +174,7 @@
+      * local name of the XML element.
+      * <p>
+      * If the value is "##default", then the name is derived from the
+-     * class name. 
++     * class name.
+      *
+      */
+     String name() default "##default";
+--- old/src/share/classes/javax/xml/bind/annotation/XmlSchema.java	Thu Jul 30 18:50:36 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/bind/annotation/XmlSchema.java	Thu Jul 30 18:50:36 2009
+@@ -38,7 +38,7 @@
+  * <p>
+  * The XmlSchema annotation can be used with the following program
+  * elements:
+- * <ul> 
++ * <ul>
+  *   <li>package</li>
+  * </ul>
+  *
+@@ -57,7 +57,7 @@
+  * </ul>
+  * <p>
+  *
+- * <p><b>Example 1:</b> Customize name of XML namespace to which 
++ * <p><b>Example 1:</b> Customize name of XML namespace to which
+  * package is mapped.</p>
+  *
+  * <pre>
+@@ -64,7 +64,7 @@
+  *    &#64;javax.xml.bind.annotation.XmlSchema (
+  *      namespace = "http://www.example.com/MYPO1"
+  *    )
+- *    
++ *
+  *    &lt;!-- XML Schema fragment -->
+  *    &lt;schema
+  *      xmlns=...
+@@ -81,8 +81,8 @@
+  * <pre>
+  *    // Package level annotation
+  *    &#64;javax.xml.bind.annotation.XmlSchema (
+- *      xmlns = { 
+- *        &#64;javax.xml.bind.annotation.XmlNs(prefix = "po", 
++ *      xmlns = {
++ *        &#64;javax.xml.bind.annotation.XmlNs(prefix = "po",
+  *                   namespaceURI="http://www.example.com/myPO1"),
+  *
+  *        &#64;javax.xml.bind.annotation.XmlNs(prefix="xs",
+@@ -89,13 +89,13 @@
+  *                   namespaceURI="http://www.w3.org/2001/XMLSchema")
+  *      )
+  *    )
+- * 
++ *
+  *    &lt;!-- XML Schema fragment -->
+  *    &lt;schema
+  *        xmlns:xs="http://www.w3.org/2001/XMLSchema"
+  *        xmlns:po="http://www.example.com/PO1"
+  *        targetNamespace="http://www.example.com/PO1">
+- * 
++ *
+  * </pre>
+  *
+  * <p><b>Example 3:</b> Customize elementFormDefault</p>
+@@ -104,18 +104,18 @@
+  *      elementFormDefault=XmlNsForm.UNQUALIFIED
+  *      ...
+  *    )
+- * 
++ *
+  *    &lt;!-- XML Schema fragment -->
+  *    &lt;schema
+  *        xmlns="http://www.w3.org/2001/XMLSchema"
+  *        xmlns:po="http://www.example.com/PO1"
+  *        elementFormDefault="unqualified">
+- * 
++ *
+  * </pre>
+ 
+  * @author Sekhar Vajjhala, Sun Microsystems, Inc.
+  * @since JAXB2.0
+- * @version $Revision: 1.9 $
++ * @version $Revision: 1.10 $
+  */
+ 
+ @Retention(RUNTIME) @Target(PACKAGE)
+@@ -134,7 +134,7 @@
+     String namespace() default "";
+ 
+     /**
+-     * Namespace qualification for elements. By default, element 
++     * Namespace qualification for elements. By default, element
+      * default attribute will be absent from the XML Schema fragment.
+      */
+     XmlNsForm elementFormDefault() default XmlNsForm.UNSET;
+--- old/src/share/classes/javax/xml/bind/annotation/XmlSchemaType.java	Thu Jul 30 18:50:40 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/bind/annotation/XmlSchemaType.java	Thu Jul 30 18:50:39 2009
+@@ -38,8 +38,8 @@
+  * <p> <b>Usage</b> </p>
+  * <p>
+  * <tt>@XmlSchemaType</tt> annotation can be used with the following program
+- * elements: 
+- * <ul> 
++ * elements:
++ * <ul>
+  *   <li> a JavaBean property </li>
+  *   <li> field </li>
+  *   <li> package</li>
+@@ -46,7 +46,7 @@
+  * </ul>
+  *
+  * <p> <tt>@XmlSchemaType</tt> annotation defined for Java type
+- * applies to all references to the Java type from a property/field. 
++ * applies to all references to the Java type from a property/field.
+  * A <tt>@XmlSchemaType</tt> annotation specified on the
+  * property/field overrides the <tt>@XmlSchemaType</tt> annotation
+  * specified at the package level.
+@@ -56,7 +56,7 @@
+  * <p>
+  * <b>Example 1: </b> Customize mapping of XMLGregorianCalendar on the
+  *  field.
+- * 
++ *
+  * <pre>
+  *     //Example: Code fragment
+  *     public class USPrice {
+@@ -64,7 +64,7 @@
+  *         &#64;XmlSchemaType(name="date")
+  *         public XMLGregorianCalendar date;
+  *     }
+- * 
++ *
+  *     &lt;!-- Example: Local XML Schema element -->
+  *     &lt;xs:complexType name="USPrice"/>
+  *       &lt;xs:sequence>
+@@ -81,11 +81,11 @@
+  *          name="date", type=javax.xml.datatype.XMLGregorianCalendar.class)
+  *     }
+  * </pre>
+- * 
++ *
+  * @since JAXB2.0
+  */
+ 
+-@Retention(RUNTIME) @Target({FIELD,METHOD,PACKAGE})        
++@Retention(RUNTIME) @Target({FIELD,METHOD,PACKAGE})
+ public @interface XmlSchemaType {
+     String name();
+     String namespace() default "http://www.w3.org/2001/XMLSchema";
+@@ -105,6 +105,3 @@
+     static final class DEFAULT {}
+ 
+ }
+-
+-
+-
+--- old/src/share/classes/javax/xml/bind/annotation/XmlTransient.java	Thu Jul 30 18:50:47 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/bind/annotation/XmlTransient.java	Thu Jul 30 18:50:46 2009
+@@ -41,7 +41,7 @@
+  * name are the same. If the JavaBean property refers to the field,
+  * then the name collision can be resolved by preventing the
+  * mapping of either the field or the JavaBean property using the
+- * <tt>@XmlTransient</tt> annotation. 
++ * <tt>@XmlTransient</tt> annotation.
+  *
+  * <p>
+  * When placed on a class, it indicates that the class shouldn't be mapped
+@@ -50,8 +50,8 @@
+  *
+  * <p><b>Usage</b></p>
+  * <p> The <tt>@XmlTransient</tt> annotation can be used with the following
+- *     program elements: 
+- * <ul> 
++ *     program elements:
++ * <ul>
+  *   <li> a JavaBean property </li>
+  *   <li> field </li>
+  *   <li> class </li>
+@@ -59,18 +59,18 @@
+  *
+  * <p><tt>@XmlTransient</tt>is mutually exclusive with all other
+  * JAXB defined annotations. </p>
+- * 
++ *
+  * <p>See "Package Specification" in javax.xml.bind.package javadoc for
+  * additional common information.</p>
+  *
+  * <p><b>Example:</b> Resolve name collision between JavaBean property and
+  *     field name </p>
+- * 
++ *
+  * <pre>
+  *   // Example: Code fragment
+  *   public class USAddress {
+  *
+- *       // The field name "name" collides with the property name 
++ *       // The field name "name" collides with the property name
+  *       // obtained by bean decapitalization of getName() below
+  *       &#64;XmlTransient public String name;
+  *
+@@ -78,7 +78,7 @@
+  *       String setName() {..};
+  *   }
+  *
+- *    
++ *
+  *   &lt;!-- Example: XML Schema fragment -->
+  *   &lt;xs:complexType name="USAddress">
+  *     &lt;xs:sequence>
+@@ -89,9 +89,8 @@
+  *
+  * @author Sekhar Vajjhala, Sun Microsystems, Inc.
+  * @since JAXB2.0
+- * @version $Revision$
++ * @version $Revision: 1.10 $
+  */
+ 
+ @Retention(RUNTIME) @Target({FIELD, METHOD, TYPE})
+ public @interface XmlTransient {}
+-   
+--- old/src/share/classes/javax/xml/bind/annotation/XmlType.java	Thu Jul 30 18:50:50 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/bind/annotation/XmlType.java	Thu Jul 30 18:50:50 2009
+@@ -45,7 +45,7 @@
+  * <p>See "Package Specification" in javax.xml.bind.package javadoc for
+  * additional common information.</p>
+  *
+- * <h3> Mapping a Class </h3> 
++ * <h3> Mapping a Class </h3>
+  * <p>
+  * A class maps to a XML Schema type. A class is a data container for
+  * values represented by properties and fields. A schema type is a
+@@ -60,11 +60,11 @@
+  * factory method overrides the no-arg constructor.
+  * <p>
+  * A class maps to either a XML Schema complex type or a XML Schema simple
+- * type. The XML Schema type is derived based on the 
++ * type. The XML Schema type is derived based on the
+  * mapping of JavaBean properties and fields contained within the
+  * class. The schema type to which the class is mapped can either be
+  * named or anonymous. A class can be mapped to an anonymous schema
+- * type by annotating the class with <tt>&#64XmlType(name="")</tt>. 
++ * type by annotating the class with <tt>&#64XmlType(name="")</tt>.
+  * <p>
+  * Either a global element, local element or a local attribute can be
+  * associated with an anonymous type as follows:
+@@ -71,12 +71,12 @@
+  * <ul>
+  *   <li><b>global element: </b> A global element of an anonymous
+  *      type can be derived by annotating the class with @{@link
+- *      XmlRootElement}. See Example 3 below. </li> 
++ *      XmlRootElement}. See Example 3 below. </li>
+  *
+  *   <li><b>local element: </b> A JavaBean property that references
+  *      a class annotated with @XmlType(name="") and is mapped to the
+  *      element associated with the anonymous type. See Example 4
+- *      below.</li> 
++ *      below.</li>
+  *
+  *   <li><b>attribute: </b> A JavaBean property that references
+  *      a class annotated with @XmlType(name="") and is mapped to the
+@@ -87,13 +87,13 @@
+  *   <li>If class is annotated with <tt>@XmlType(name="") </tt>, it
+  *   is mapped to an anonymous type otherwise, the class name maps
+  *   to a complex type name. The <tt>XmlName()</tt> annotation element
+- *   can be used to customize the name.</li>  
++ *   can be used to customize the name.</li>
+  *
+  *   <li> Properties and fields that are mapped to elements are mapped to a
+  *   content model within a complex type. The annotation element
+  *   <tt>propOrder()</tt> can be used to customize the content model to be
+  *   <tt>xs:all</tt> or <tt>xs:sequence</tt>.  It is used for specifying
+- *   the order of XML elements in <tt>xs:sequence</tt>. </li> 
++ *   the order of XML elements in <tt>xs:sequence</tt>. </li>
+  *
+  *   <li> Properties and fields can be mapped to attributes within the
+  *        complex type.  </li>
+@@ -128,7 +128,7 @@
+  *         <td><b>ComplexType</b></td>
+  *         <td><b>SimpleType</b></td>
+  *       </tr>
+- * 
++ *
+  *       <tr valign="top">
+  *         <td>Class</td>
+  *         <td>{}</td>
+@@ -136,7 +136,7 @@
+  *         <td>complexcontent<br>xs:all</td>
+  *         <td> </td>
+  *       </tr>
+- * 
++ *
+  *       <tr valign="top">
+  *         <td>Class</td>
+  *         <td>non empty</td>
+@@ -144,7 +144,7 @@
+  *         <td>complexcontent<br>xs:sequence</td>
+  *         <td> </td>
+  *       </tr>
+- * 
++ *
+  *       <tr valign="top">
+  *         <td>Class</td>
+  *         <td>X</td>
+@@ -152,21 +152,21 @@
+  *         <td>complexcontent<br>empty sequence</td>
+  *         <td> </td>
+  *       </tr>
+- * 
++ *
+  *       <tr valign="top">
+  *         <td>Class</td>
+  *         <td>X</td>
+  *         <td>1 [ <tt>@XmlValue</tt> property] && <br> [property]+
+- *             ->attributes</td> 
++ *             ->attributes</td>
+  *         <td>simplecontent</td>
+  *         <td> </td>
+  *       </tr>
+- * 
++ *
+  *       <tr valign="top">
+  *         <td>Class</td>
+  *         <td>X</td>
+  *         <td>1 [ <tt>@XmlValue</tt> property ]&& <br> no properties
+- *         -> attribute</td> 
++ *         -> attribute</td>
+  *         <td> </td>
+  *         <td>simpletype</td>
+  *         <td> </td>
+@@ -174,23 +174,23 @@
+  *     </tbody>
+  *   </table>
+  * </blockquote>
+- * 
++ *
+  * <h3> Mapping an enum type </h3>
+- * 
++ *
+  * An enum type maps to a XML schema simple type with enumeration
+  * facets. The following annotation elements are ignored since they
+- * are not meaningful: <tt>propOrder()</tt> , <tt>factoryMethod()</tt> , 
++ * are not meaningful: <tt>propOrder()</tt> , <tt>factoryMethod()</tt> ,
+  * <tt>factoryClass()</tt> .
+  *
+  *  <h3> Usage with other annotations </h3>
+- * <p> This annotation can be used with the following annotations: 
++ * <p> This annotation can be used with the following annotations:
+  * {@link XmlRootElement}, {@link XmlAccessorOrder}, {@link XmlAccessorType},
+  * {@link XmlEnum}. However, {@link
+  * XmlAccessorOrder} and {@link XmlAccessorType} are ignored when this
+  * annotation is used on an enum type.
+- * 
++ *
+  * <p> <b> Example 1: </b> Map a class to a complex type with
+- *   xs:sequence with a customized ordering of JavaBean properties. 
++ *   xs:sequence with a customized ordering of JavaBean properties.
+  * </p>
+  *
+  * <pre>
+@@ -198,13 +198,13 @@
+  *   public class USAddress {
+  *     String getName() {..};
+  *     void setName(String) {..};
+- * 
++ *
+  *     String getStreet() {..};
+  *     void setStreet(String) {..};
+  *
+- *     String getCity() {..}; 
++ *     String getCity() {..};
+  *     void setCity(String) {..};
+- * 
++ *
+  *     String getState() {..};
+  *     void setState(String) {..};
+  *
+@@ -221,7 +221,7 @@
+  *       &lt;xs:element name="zip" type="xs:decimal"/>
+  *       &lt;xs:element name="name" type="xs:string"/>
+  *     &lt;/xs:all>
+- *   &lt;/xs:complexType> 
++ *   &lt;/xs:complexType>
+  * </pre>
+  * <p> <b> Example 2: </b> Map a class to a complex type with
+  *     xs:all </p>
+@@ -228,7 +228,7 @@
+  * <pre>
+  * &#64;XmlType(propOrder={})
+  * public class USAddress { ...}
+- * 
++ *
+  * &lt;!-- XML Schema mapping for USAddress -->
+  * &lt;xs:complexType name="USAddress">
+  *   &lt;xs:all>
+@@ -241,7 +241,7 @@
+  * &lt;/xs:complexType>
+  *</pre>
+  * <p> <b> Example 3: </b> Map a class to a global element with an
+- * anonymous type. 
++ * anonymous type.
+  * </p>
+  * <pre>
+  *   &#64;XmlRootElement
+@@ -263,7 +263,7 @@
+  * </pre>
+  *
+  * <p> <b> Example 4: </b> Map a property to a local element with
+- * anonmyous type. 
++ * anonmyous type.
+  * <pre>
+  *   //Example: Code fragment
+  *   public class Invoice {
+@@ -273,7 +273,7 @@
+  *
+  *   &#64;XmlType(name="")
+  *   public class USAddress { ... }
+- *   } 
++ *   }
+  *
+  *   &lt;!-- XML Schema mapping for USAddress -->
+  *   &lt;xs:complexType name="Invoice">
+@@ -288,24 +288,24 @@
+  *         &lt;/xs:complexType>
+  *       ...
+  *     &lt;/xs:sequence>
+- *   &lt;/xs:complexType> 
++ *   &lt;/xs:complexType>
+  * </pre>
+  *
+  * <p> <b> Example 5: </b> Map a property to an attribute with
+  * anonymous type.
+- * 
++ *
+  * <pre>
+  *
+  *     //Example: Code fragment
+  *     public class Item {
+  *         public String name;
+- *         &#64;XmlAttribute 
++ *         &#64;XmlAttribute
+  *         public USPrice price;
+  *     }
+- *    
+- *     // map class to anonymous simple type. 
++ *
++ *     // map class to anonymous simple type.
+  *     &#64;XmlType(name="")
+- *     public class USPrice { 
++ *     public class USPrice {
+  *         &#64;XmlValue
+  *         public java.math.BigDecimal price;
+  *     }
+@@ -325,7 +325,7 @@
+  *
+  *  <p> <b> Example 6: </b> Define a factoryClass and factoryMethod
+  *
+- * <pre> 
++ * <pre>
+  *      &#64;XmlType(name="USAddressType", factoryClass=USAddressFactory.class,
+  *      factoryMethod="getUSAddress")
+  *      public class USAddress {
+@@ -336,7 +336,7 @@
+  *          private String street;
+  *          private int    zip;
+  *
+- *      public USAddress(String name, String street, String city, 
++ *      public USAddress(String name, String street, String city,
+  *          String state, int zip) {
+  *          this.name = name;
+  *          this.street = street;
+@@ -348,7 +348,7 @@
+  *
+  *  public class USAddressFactory {
+  *      public static USAddress getUSAddress(){
+- *       return new USAddress("Mark Baker", "23 Elm St", 
++ *       return new USAddress("Mark Baker", "23 Elm St",
+  *          "Dayton", "OH", 90952);
+  *  }
+  *
+@@ -355,7 +355,7 @@
+  * </pre>
+  *
+  *  <p> <b> Example 7: </b> Define factoryMethod and use the default factoryClass
+- * 
++ *
+  * <pre>
+  *      &#64;XmlType(name="USAddressType", factoryMethod="getNewInstance")
+  *      public class USAddress {
+@@ -380,7 +380,7 @@
+  * @see XmlValue
+  * @see XmlSchema
+  * @since JAXB2.0
+- * @version $Revision: 1.19 $
++ * @version $Revision: 1.20 $
+  */
+ 
+ @Retention(RUNTIME) @Target({TYPE})
+@@ -389,14 +389,14 @@
+      * Name of the XML Schema type which the class is mapped.
+      */
+     String name() default "##default" ;
+- 
++
+     /**
+      * Specifies the order for XML Schema elements when class is
+      * mapped to a XML Schema complex type.
+-     * 
++     *
+      * <p> Refer to the table for how the propOrder affects the
+      * mapping of class </p>
+-     * 
++     *
+      * <p> The propOrder is a list of names of JavaBean properties in
+      *     the class. Each name in the list is the name of a Java
+      *     identifier of the JavaBean property. The order in which
+@@ -403,11 +403,11 @@
+      *     JavaBean properties are listed is the order of XML Schema
+      *     elements to which the JavaBean properties are mapped. </p>
+      * <p> All of the JavaBean properties being mapped to XML Schema elements
+-     *     must be listed. 
++     *     must be listed.
+      * <p> A JavaBean property or field listed in propOrder must not
+      *     be transient or annotated with <tt>@XmlTransient</tt>.
+      * <p> The default ordering of JavaBean properties is determined
+-     *     by @{@link XmlAccessorOrder}. 
++     *     by @{@link XmlAccessorOrder}.
+      */
+     String[] propOrder() default {""};
+ 
+@@ -417,21 +417,21 @@
+      * containing the class is mapped.
+      */
+     String namespace() default "##default" ;
+-   
++
+     /**
+      * Class containing a no-arg factory method for creating an
+      * instance of this class. The default is this class.
+-     * 
+-     * <p>If <tt>factoryClass</tt> is DEFAULT.class and 
++     *
++     * <p>If <tt>factoryClass</tt> is DEFAULT.class and
+      * <tt>factoryMethod</tt> is "", then there is no static factory
+      * method.
+-     * 
++     *
+      * <p>If <tt>factoryClass</tt> is DEFAULT.class and
+-     * <tt>factoryMethod</tt> is not "", then 
++     * <tt>factoryMethod</tt> is not "", then
+      * <tt>factoryMethod</tt> is the name of a static factory method
+-     * in this class. 
++     * in this class.
+      *
+-     * <p>If <tt>factoryClass</tt> is not DEFAULT.class, then 
++     * <p>If <tt>factoryClass</tt> is not DEFAULT.class, then
+      * <tt>factoryMethod</tt> must not be "" and must be the name of
+      * a static factory method specified in <tt>factoryClass</tt>.
+      */
+@@ -440,16 +440,14 @@
+     /**
+      * Used in {@link XmlType#factoryClass()} to
+      * signal that either factory mehod is not used or
+-     * that it's in the class with this {@link XmlType} itself. 
++     * that it's in the class with this {@link XmlType} itself.
+      */
+     static final class DEFAULT {}
+ 
+     /**
+      * Name of a no-arg factory method in the class specified in
+-     * <tt>factoryClass</tt> factoryClass(). 
+-     * 
++     * <tt>factoryClass</tt> factoryClass().
++     *
+      */
+     String factoryMethod() default "";
+ }
+-
+-
+--- old/src/share/classes/javax/xml/bind/annotation/XmlValue.java	Thu Jul 30 18:50:54 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/bind/annotation/XmlValue.java	Thu Jul 30 18:50:53 2009
+@@ -33,7 +33,7 @@
+ /**
+  * <p>
+  * Enables mapping a class to a  XML Schema complex type with a
+- * simpleContent or a XML Schema simple type. 
++ * simpleContent or a XML Schema simple type.
+  * </p>
+  *
+  * <p>
+@@ -40,12 +40,12 @@
+  * <b> Usage: </b>
+  * <p>
+  * The <tt>@XmlValue</tt> annotation can be used with the following program
+- * elements: 
+- * <ul> 
++ * elements:
++ * <ul>
+  *   <li> a JavaBean property.</li>
+  *   <li> non static, non transient field.</li>
+  * </ul>
+- * 
++ *
+  * <p>See "Package Specification" in javax.xml.bind.package javadoc for
+  * additional common information.</p>
+  *
+@@ -52,7 +52,7 @@
+  * The usage is subject to the following usage constraints:
+  * <ul>
+  *   <li>At most one field or property can be annotated with the
+- *       <tt>@XmlValue</tt> annotation. </li> 
++ *       <tt>@XmlValue</tt> annotation. </li>
+  *
+  *   <li><tt>@XmlValue</tt> can be used with the following
+  *   annotations: {@link XmlList}. However this is redundant since
+@@ -62,7 +62,7 @@
+  *   <li>If the type of the field or property is a collection type,
+  *       then the collection item type must map to a simple schema
+  *       type.  </li>
+- * 
++ *
+  *   <li>If the type of the field or property is not a collection
+  *       type, then the type must map to a XML Schema simple type. </li>
+  *
+@@ -71,7 +71,7 @@
+  * <p>
+  * If the annotated JavaBean property is the sole class member being
+  * mapped to XML Schema construct, then the class is mapped to a
+- * simple type. 
++ * simple type.
+  *
+  * If there are additional JavaBean properties (other than the
+  * JavaBean property annotated with <tt>@XmlValue</tt> annotation)
+@@ -82,13 +82,13 @@
+  * <p> <b> Example 1: </b> Map a class to XML Schema simpleType</p>
+  *
+  *   <pre>
+- * 
++ *
+  *     // Example 1: Code fragment
+  *     public class USPrice {
+  *         &#64;XmlValue
+  *         public java.math.BigDecimal price;
+  *     }
+- *  
++ *
+  *     &lt;!-- Example 1: XML Schema fragment -->
+  *     &lt;xs:simpleType name="USPrice">
+  *       &lt;xs:restriction base="xs:decimal"/>
+@@ -95,10 +95,10 @@
+  *     &lt;/xs:simpleType>
+  *
+  *   </pre>
+- * 
++ *
+  * <p><b> Example 2: </b> Map a class to XML Schema complexType with
+  *        with simpleContent.</p>
+- * 
++ *
+  *   <pre>
+  *
+  *   // Example 2: Code fragment
+@@ -105,11 +105,11 @@
+  *   public class InternationalPrice {
+  *       &#64;XmlValue
+  *       public java.math.BigDecimal price;
+- * 
++ *
+  *       &#64;XmlAttribute
+  *       public String currency;
+  *   }
+- *  
++ *
+  *   &lt;!-- Example 2: XML Schema fragment -->
+  *   &lt;xs:complexType name="InternationalPrice">
+  *     &lt;xs:simpleContent>
+@@ -117,7 +117,7 @@
+  *         &lt;xs:attribute name="currency" type="xs:string"/>
+  *       &lt;/xs:extension>
+  *     &lt;/xs:simpleContent>
+- *   &lt;/xs:complexType> 
++ *   &lt;/xs:complexType>
+  *
+  *   </pre>
+  * </p>
+@@ -125,7 +125,7 @@
+  * @author Sekhar Vajjhala, Sun Microsystems, Inc.
+  * @see XmlType
+  * @since JAXB2.0
+- * @version $Revision: 1.5 $
++ * @version $Revision: 1.6 $
+  */
+ 
+ @Retention(RUNTIME) @Target({FIELD, METHOD})
+--- old/src/share/classes/javax/xml/bind/annotation/adapters/XmlAdapter.java	Thu Jul 30 18:50:58 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/bind/annotation/adapters/XmlAdapter.java	Thu Jul 30 18:50:57 2009
+@@ -41,7 +41,7 @@
+  * MyXmlGregorianCalendar, for example. In both cases, there is a
+  * mismatch between <i> bound type </i>, used by an application to
+  * access XML content and the <i> value type</i>, that is mapped to an
+- * XML representation.  
++ * XML representation.
+  *
+  * <p>
+  * This abstract class defines methods for adapting a bound type to a value
+@@ -51,17 +51,17 @@
+  * <ul>
+  *   <li> <b> XmlAdapter.marshal(...): </b> During marshalling, JAXB
+  *        binding framework invokes XmlAdapter.marshal(..) to adapt a
+- *        bound type to value type, which is then marshaled to XML 
+- *        representation. </li> 
++ *        bound type to value type, which is then marshaled to XML
++ *        representation. </li>
+  *
+  *   <li> <b> XmlAdapter.unmarshal(...): </b> During unmarshalling,
+  *        JAXB binding framework first unmarshals XML representation
+  *        to a value type and then invokes XmlAdapter.unmarshal(..) to
+- *        adapt the value type to a bound type. </li> 
++ *        adapt the value type to a bound type. </li>
+  * </ul>
+  *
+  * Writing an adapter therefore involves the following steps:
+- * 
++ *
+  * <ul>
+  *   <li> Write an adapter that implements this abstract class. </li>
+  *   <li> Install the adapter using the annotation {@link
+@@ -69,7 +69,7 @@
+  * </ul>
+  *
+  * <p><b>Example:</b> Customized mapping of </tt>HashMap</tt></p>
+- * <p> The following example illustrates the use of 
++ * <p> The following example illustrates the use of
+  * <tt>&#64;XmlAdapter</tt> and <tt>&#64;XmlJavaTypeAdapter</tt> to
+  * customize the mapping of a <tt>HashMap</tt>.
+  *
+@@ -80,7 +80,7 @@
+  *         &lt;entry key="id123">this is a value&lt;/entry>
+  *         &lt;entry key="id312">this is another value&lt;/entry>
+  *         ...
+- *       &lt;/hashmap>  
++ *       &lt;/hashmap>
+  * </pre>
+  *
+  * <p> <b> Step 2: </b> Determine the schema definition that the
+@@ -87,7 +87,7 @@
+  * desired XML representation shown above should follow.
+  *
+  * <pre>
+- *     
++ *
+  *     &lt;xs:complexType name="myHashMapType">
+  *       &lt;xs:sequence>
+  *         &lt;xs:element name="entry" type="myHashMapEntryType"
+@@ -115,13 +115,13 @@
+  *
+  *     public class MyHashMapEntryType {
+  *         &#64;XmlAttribute
+- *         public Integer key; 
++ *         public Integer key;
+  *
+  *         &#64;XmlValue
+  *         public String value;
+  *     }
+  * </pre>
+- * 
++ *
+  * <p> <b> Step 4: </b> Write the adapter that adapts the value type,
+  * MyHashMapType to a bound type, HashMap, used by the application.
+  *
+@@ -128,7 +128,7 @@
+  * <pre>
+  *     public final class MyHashMapAdapter extends
+  *                        XmlAdapter&lt;MyHashMapType,HashMap> { ... }
+- *      
++ *
+  * </pre>
+  *
+  * <p> <b> Step 5: </b> Use the adapter.
+@@ -142,7 +142,7 @@
+  * </pre>
+  *
+  * The above code fragment will map to the following schema:
+- * 
++ *
+  * <pre>
+  *     &lt;xs:complexType name="Foo">
+  *       &lt;xs:sequence>
+--- old/src/share/classes/javax/xml/bind/annotation/adapters/XmlJavaTypeAdapter.java	Thu Jul 30 18:51:01 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/bind/annotation/adapters/XmlJavaTypeAdapter.java	Thu Jul 30 18:51:01 2009
+@@ -51,8 +51,8 @@
+  * <p> <b> Usage: </b> </p>
+  *
+  * <p> The <tt>@XmlJavaTypeAdapter</tt> annotation can be used with the
+- * following program elements:  
+- * <ul> 
++ * following program elements:
++ * <ul>
+  *   <li> a JavaBean property </li>
+  *   <li> field </li>
+  *   <li> parameter </li>
+@@ -71,7 +71,7 @@
+  * <p> A <tt>@XmlJavaTypeAdapter</tt> annotation on a field, property
+  * or parameter overrides the <tt>@XmlJavaTypeAdapter</tt> annotation
+  * associated with the class being referenced by the field, property
+- * or parameter.  
++ * or parameter.
+  * <p> A <tt>@XmlJavaTypeAdapter</tt> annotation on a class overrides
+  * the <tt>@XmlJavaTypeAdapter</tt> annotation specified at the
+  * package level for that class.
+@@ -81,17 +81,17 @@
+  * {@link XmlElementRefs}, {@link XmlAnyElement}. This can also be
+  * used at the package level with the following annotations:
+  * {@link XmlAccessorType}, {@link XmlSchema}, {@link XmlSchemaType},
+- * {@link XmlSchemaTypes}. 
+- * 
++ * {@link XmlSchemaTypes}.
++ *
+  * <p><b> Example: </b> See example in {@link XmlAdapter}
+  *
+  * @author <ul><li>Sekhar Vajjhala, Sun Microsystems Inc.</li> <li> Kohsuke Kawaguchi, Sun Microsystems Inc.</li></ul>
+  * @since JAXB2.0
+  * @see XmlAdapter
+- * @version $Revision: 1.9 $
++ * @version $Revision: 1.10 $
+  */
+ 
+-@Retention(RUNTIME) @Target({PACKAGE,FIELD,METHOD,TYPE,PARAMETER})        
++@Retention(RUNTIME) @Target({PACKAGE,FIELD,METHOD,TYPE,PARAMETER})
+ public @interface XmlJavaTypeAdapter {
+     /**
+      * Points to the clsss that converts a value type to a bound type or vice versa.
+@@ -113,5 +113,5 @@
+      */
+ 
+     static final class DEFAULT {}
+-    
++
+ }
+--- old/src/share/classes/javax/xml/bind/annotation/adapters/package.html	Thu Jul 30 18:51:05 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/bind/annotation/adapters/package.html	Thu Jul 30 18:51:04 2009
+@@ -25,7 +25,7 @@
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+ <html>
+     <head>
+-        
++
+     </head>
+ 
+     <body>
+@@ -53,5 +53,3 @@
+ 
+     </body>
+ </html>
+-
+-
+--- old/src/share/classes/javax/xml/bind/annotation/package.html	Thu Jul 30 18:51:08 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/bind/annotation/package.html	Thu Jul 30 18:51:08 2009
+@@ -25,7 +25,7 @@
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+ <html>
+     <head>
+-        
++
+     </head>
+ 
+     <body bgcolor="white">
+@@ -37,7 +37,7 @@
+         <p>The following table shows the JAXB mapping annotations
+            that can be associated with each program element. </p>
+ 
+-        <table border="1" cellpadding="4" cellspacing="3"> 
++        <table border="1" cellpadding="4" cellspacing="3">
+           <tbody>
+             <tr>
+               <td><b>Program Element</td>
+@@ -75,7 +75,7 @@
+             <tr valign="top">
+               <td><b>Class</td>
+               <td>
+-                <table> 
++                <table>
+                   <tr valign="top">
+                     <td><b><a HREF="../../../../javax/xml/bind/annotation/XmlAccessorOrder.html">XmlAccessorOrder</b></td>
+                   </tr>
+@@ -101,7 +101,7 @@
+             <tr valign="top">
+               <td><b>Enum type</td>
+               <td>
+-                <table> 
++                <table>
+                   <tr valign="top">
+                     <td><b><a HREF="../../../../javax/xml/bind/annotation/XmlEnum.html">XmlEnum</b></td>
+                   </tr>
+@@ -124,7 +124,7 @@
+             <tr valign="top">
+               <td><b>JavaBean Property/field</td>
+               <td>
+-                <table> 
++                <table>
+                   <tr valign="top">
+                     <td><b><a HREF="../../../../javax/xml/bind/annotation/XmlElement.html">XmlElement</b></td>
+                   </tr>
+@@ -189,7 +189,7 @@
+             <tr valign="top">
+               <td><b>Parameter</td>
+               <td>
+-                <table> 
++                <table>
+                   <tr valign="top">
+                     <td><b><a HREF="../../../../javax/xml/bind/annotation/XmlList.html">XmlList</b></td>
+                   </tr>
+@@ -208,7 +208,7 @@
+ 
+           </tbody>
+         </table>
+-        <h3>Terminology</h3> 
++        <h3>Terminology</h3>
+           <p>
+           <b>JavaBean property and field:</b> For the purposes of
+           mapping, there is no semantic difference between a field and
+@@ -237,19 +237,19 @@
+           <ul>
+             <li> For a property, a given annotation can be applied to
+                  either read or write property but not both. </li>
+-    
++
+             <li> A property name must be different from any other
+                  property name in any of the super classes of the
+                  class being mapped. </li>
+- 
++
+             <li> A mapped field name or the decapitalized name of a
+                  mapped property must be unique within a class. </li>
+           </ul>
+          <h3>Notations</h3>
+-         <b>Namespace prefixes</b> 
++         <b>Namespace prefixes</b>
+          <p>The following namespace prefixes are used in the XML Schema
+            fragments in this package.<p>
+-    
++
+         <table border="1" cellpadding="4" cellspacing="3">
+           <tbody>
+             <tr>
+@@ -257,7 +257,7 @@
+               <td><b>Namespace</b></td>
+               <td><b>Notes</b></td>
+            </tr>
+- 
++
+            <tr valign="top">
+              <td>xs</td>
+              <td>http://www.w3.org/2001/XMLSchema</td>
+@@ -280,5 +280,3 @@
+         @since JAXB 2.0
+     </body>
+ </html>
+-
+-
+--- old/src/share/classes/javax/xml/bind/attachment/AttachmentMarshaller.java	Thu Jul 30 18:51:12 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/bind/attachment/AttachmentMarshaller.java	Thu Jul 30 18:51:11 2009
+@@ -29,30 +29,30 @@
+ 
+ /**
+  * <p>Enable JAXB marshalling to optimize storage of binary data.</p>
+- * 
++ *
+  * <p>This API enables an efficient cooperative creation of optimized
+  * binary data formats between a JAXB marshalling process and a MIME-based package
+- * processor. A JAXB implementation marshals the root body of a MIME-based package, 
+- * delegating the creation of referenceable MIME parts to 
++ * processor. A JAXB implementation marshals the root body of a MIME-based package,
++ * delegating the creation of referenceable MIME parts to
+  * the MIME-based package processor that implements this abstraction.</p>
+  *
+  * <p>XOP processing is enabled when {@link #isXOPPackage()} is true.
+  *    See {@link #addMtomAttachment(DataHandler, String, String)} for details.
+  * </p>
+- * 
+- * <p>WS-I Attachment Profile 1.0 is supported by 
+- * {@link #addSwaRefAttachment(DataHandler)} being called by the 
+- * marshaller for each JAXB property related to 
++ *
++ * <p>WS-I Attachment Profile 1.0 is supported by
++ * {@link #addSwaRefAttachment(DataHandler)} being called by the
++ * marshaller for each JAXB property related to
+  * {http://ws-i.org/profiles/basic/1.1/xsd}swaRef.</p>
+- * 
+  *
++ *
+  * @author Marc Hadley
+  * @author Kohsuke Kawaguchi
+  * @author Joseph Fialli
+  * @since JAXB 2.0
+- * 
++ *
+  * @see Marshaller#setAttachmentMarshaller(AttachmentMarshaller)
+- * 
++ *
+  * @see <a href="http://www.w3.org/TR/2005/REC-xop10-20050125/">XML-binary Optimized Packaging</a>
+  * @see <a href="http://www.ws-i.org/Profiles/AttachmentsProfile-1.0-2004-08-24.html">WS-I Attachments Profile Version 1.0.</a>
+  */
+@@ -62,17 +62,17 @@
+      * <p>Consider MIME content <code>data</code> for optimized binary storage as an attachment.
+      *
+      * <p>
+-     * This method is called by JAXB marshal process when {@link #isXOPPackage()} is 
+-     * <code>true</code>, for each element whose datatype is "base64Binary", as described in 
+-     * Step 3 in 
+-     * <a href="http://www.w3.org/TR/2005/REC-xop10-20050125/#creating_xop_packages">Creating XOP Packages</a>. 
++     * This method is called by JAXB marshal process when {@link #isXOPPackage()} is
++     * <code>true</code>, for each element whose datatype is "base64Binary", as described in
++     * Step 3 in
++     * <a href="http://www.w3.org/TR/2005/REC-xop10-20050125/#creating_xop_packages">Creating XOP Packages</a>.
+      *
+      * <p>
+-     * The method implementor determines whether <code>data</code> shall be attached separately 
+-     * or inlined as base64Binary data. If the implementation chooses to optimize the storage 
+-     * of the binary data as a MIME part, it is responsible for attaching <code>data</code> to the 
++     * The method implementor determines whether <code>data</code> shall be attached separately
++     * or inlined as base64Binary data. If the implementation chooses to optimize the storage
++     * of the binary data as a MIME part, it is responsible for attaching <code>data</code> to the
+      * MIME-based package, and then assigning an unique content-id, cid, that identifies
+-     * the MIME part within the MIME message. This method returns the cid, 
++     * the MIME part within the MIME message. This method returns the cid,
+      * which enables the JAXB marshaller to marshal a XOP element that refers to that cid in place
+      * of marshalling the binary data. When the method returns null, the JAXB marshaller
+      * inlines <code>data</code> as base64binary data.
+@@ -79,9 +79,9 @@
+      *
+      * <p>
+      * The caller of this method is required to meet the following constraint.
+-     * If the element infoset item containing <code>data</code> has the attribute 
+-     * <code>xmime:contentType</code> or if the JAXB property/field representing 
+-     * <code>data</code>is annotated with a known MIME type, 
++     * If the element infoset item containing <code>data</code> has the attribute
++     * <code>xmime:contentType</code> or if the JAXB property/field representing
++     * <code>data</code>is annotated with a known MIME type,
+      * <code>data.getContentType()</code> should be set to that MIME type.
+      *
+      * <p>
+@@ -95,14 +95,14 @@
+      *       represents the data to be attached. Must be non-null.
+      * @param elementNamespace
+      *      the namespace URI of the element that encloses the base64Binary data.
+-     *      Can be empty but never null. 
++     *      Can be empty but never null.
+      * @param elementLocalName
+      *      The local name of the element. Always a non-null valid string.
+-     *        
++     *
+      * @return
+-     *     a valid content-id URI (see <a href="http://www.w3.org/TR/xop10/#RFC2387">RFC 2387</a>) that identifies the attachment containing <code>data</code>.     
++     *     a valid content-id URI (see <a href="http://www.w3.org/TR/xop10/#RFC2387">RFC 2387</a>) that identifies the attachment containing <code>data</code>.
+      *     Otherwise, null if the attachment was not added and should instead be inlined in the message.
+-     *  
++     *
+      * @see <a href="http://www.w3.org/TR/2005/REC-xop10-20050125/">XML-binary Optimized Packaging</a>
+      * @see <a href="http://www.w3.org/TR/xml-media-types/">Describing Media Content of Binary Data in XML</a>
+      */
+@@ -125,11 +125,11 @@
+      *      specified by <tt>(data,offset,length)</tt> tuple.
+      *
+      * @param offset
+-     *       The offset within the array of the first byte to be read; 
++     *       The offset within the array of the first byte to be read;
+      *       must be non-negative and no larger than array.length
+-     * 
++     *
+      * @param length
+-     *       The number of bytes to be read from the given array; 
++     *       The number of bytes to be read from the given array;
+      *       must be non-negative and no larger than array.length
+      *
+      * @param mimeType
+@@ -136,15 +136,15 @@
+      *      If the data has an associated MIME type known to JAXB, that is passed
+      *      as this parameter. If none is known, "application/octet-stream".
+      *      This parameter may never be null.
+-     * 
++     *
+      * @param elementNamespace
+      *      the namespace URI of the element that encloses the base64Binary data.
+      *      Can be empty but never null.
+-     * 
++     *
+      * @param elementLocalName
+      *      The local name of the element. Always a non-null valid string.
+-     * 
+-     * @return content-id URI, cid, to the attachment containing  
++     *
++     * @return content-id URI, cid, to the attachment containing
+      *         <code>data</code> or null if data should be inlined.
+      *
+      * @see #addMtomAttachment(DataHandler, String, String)
+@@ -159,17 +159,17 @@
+      * is invoked when the appropriate binary datatypes are encountered by
+      * the marshal process.</p>
+      *
+-     * <p>Marshaller.marshal() must throw IllegalStateException if this value is <code>true</code> 
+-     * and the XML content to be marshalled violates Step 1 in 
++     * <p>Marshaller.marshal() must throw IllegalStateException if this value is <code>true</code>
++     * and the XML content to be marshalled violates Step 1 in
+      * <a ref="http://www.w3.org/TR/2005/REC-xop10-20050125/#creating_xop_packages">Creating XOP Pacakges</a>
+-     * http://www.w3.org/TR/2005/REC-xop10-20050125/#creating_xop_packages. 
+-     * <i>"Ensure the Original XML Infoset contains no element information item with a 
++     * http://www.w3.org/TR/2005/REC-xop10-20050125/#creating_xop_packages.
++     * <i>"Ensure the Original XML Infoset contains no element information item with a
+      * [namespace name] of "http://www.w3.org/2004/08/xop/include" and a [local name] of Include"</i>
+      *
+      * <p>When this method returns true and during the marshal process
+-     * at least one call to <code>addMtomAttachment(...)</code> returns 
++     * at least one call to <code>addMtomAttachment(...)</code> returns
+      * a content-id, the MIME-based package processor must label the
+-     * root part with the application/xop+xml media type as described in 
++     * root part with the application/xop+xml media type as described in
+      * Step 5 of
+      * <a ref="http://www.w3.org/TR/2005/REC-xop10-20050125/#creating_xop_packages">Creating XOP Pacakges</a>.<p>
+      *
+@@ -179,18 +179,18 @@
+ 
+    /**
+     * <p>Add MIME <code>data</code> as an attachment and return attachment's content-id, cid.</p>
+-    * 
++    *
+     * <p>
+-    * This method is called by JAXB marshal process for each element/attribute typed as 
++    * This method is called by JAXB marshal process for each element/attribute typed as
+     * {http://ws-i.org/profiles/basic/1.1/xsd}swaRef. The MIME-based package processor
+-    * implementing this method is responsible for attaching the specified data to a 
+-    * MIME attachment, and generating a content-id, cid, that uniquely identifies the attachment 
++    * implementing this method is responsible for attaching the specified data to a
++    * MIME attachment, and generating a content-id, cid, that uniquely identifies the attachment
+     * within the MIME-based package.
+     *
+     * <p>Caller inserts the returned content-id, cid, into the XML content being marshalled.</p>
+     *
+     * @param data
+-    *       represents the data to be attached. Must be non-null. 
++    *       represents the data to be attached. Must be non-null.
+     * @return
+     *       must be a valid URI used as cid. Must satisfy Conformance Requirement R2928 from
+     *       <a href="http://www.ws-i.org/Profiles/AttachmentsProfile-1.0-2004-08-24.html#Referencing_Attachments_from_the_SOAP_Envelope">WS-I Attachments Profile Version 1.0.</a>
+@@ -197,4 +197,3 @@
+     */
+     public abstract String addSwaRefAttachment(DataHandler data);
+ }
+-
+--- old/src/share/classes/javax/xml/bind/attachment/AttachmentUnmarshaller.java	Thu Jul 30 18:51:15 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/bind/attachment/AttachmentUnmarshaller.java	Thu Jul 30 18:51:15 2009
+@@ -31,8 +31,8 @@
+  *
+  * <p>This API enables an efficient cooperative processing of optimized
+  * binary data formats between a JAXB 2.0 implementation and MIME-based package
+- * processor (MTOM/XOP and WS-I AP 1.0). JAXB unmarshals the body of a package, delegating the 
+- * understanding of the packaging format being used to a MIME-based 
++ * processor (MTOM/XOP and WS-I AP 1.0). JAXB unmarshals the body of a package, delegating the
++ * understanding of the packaging format being used to a MIME-based
+  * package processor that implements this abstract class.</p>
+  *
+  * <p>This abstract class identifies if a package requires XOP processing, {@link #isXOPPackage()} and provides retrieval of binary content stored as attachments by content-id.</p>
+@@ -40,23 +40,23 @@
+  * <h2>Identifying the content-id, cid, to pass to <code>getAttachment*(String cid)</code></h2>
+  * <ul>
+  * <li>
+- * For XOP processing, the infoset representation of the cid is described 
+- * in step 2a in 
++ * For XOP processing, the infoset representation of the cid is described
++ * in step 2a in
+  * <a href="http://www.w3.org/TR/2005/REC-xop10-20050125/#interpreting_xop_packages">Section 3.2 Interpreting XOP Packages</a>
+  * </li>
+  * <li>
+- * For WS-I AP 1.0, the cid is identified as an element or attribute of 
+- * type <code>ref:swaRef </code> specified in 
++ * For WS-I AP 1.0, the cid is identified as an element or attribute of
++ * type <code>ref:swaRef </code> specified in
+  * <a href="http://www.ws-i.org/Profiles/AttachmentsProfile-1.0-2004-08-24.html#Referencing_Attachments_from_the_SOAP_Envelope">Section 4.4 Referencing Attachments from the SOAP Envelope</a>
+  * </li>
+  * </ul>
+- * 
++ *
+  * @author Marc Hadley
+  * @author Kohsuke Kawaguchi
+  * @author Joseph Fialli
+- * 
++ *
+  * @since JAXB 2.0
+- * 
++ *
+  * @see javax.xml.bind.Unmarshaller#setAttachmentUnmarshaller(AttachmentUnmarshaller)
+  *
+  * @see <a href="http://www.w3.org/TR/2005/REC-xop10-20050125/">XML-binary Optimized Packaging</a>
+@@ -66,9 +66,9 @@
+ public abstract class AttachmentUnmarshaller {
+    /**
+     * <p>Lookup MIME content by content-id, <code>cid</code>, and return as a {@link DataHandler}.</p>
+-    * 
++    *
+     * <p>The returned <code>DataHandler</code> instance must be configured
+-    * to meet the following required mapping constaint. 
++    * to meet the following required mapping constaint.
+     * <table border="2" rules="all" cellpadding="4">
+     *   <thead>
+     *     <tr>
+@@ -101,11 +101,11 @@
+     *   </tbody>
+     *  </table>
+     * Note that it is allowable to support additional mappings.</p>
+-    * 
+-    * @param cid It is expected to be a valid lexical form of the XML Schema 
++    *
++    * @param cid It is expected to be a valid lexical form of the XML Schema
+     * <code>xs:anyURI</code> datatype. If <code>{@link #isXOPPackage()}
+     * ==true</code>, it must be a valid URI per the <code>cid:</code> URI scheme (see <a href="http://www.ietf.org/rfc/rfc2387.txt">RFC 2387</a>)
+-    * 
++    *
+     * @return
+     *       a {@link DataHandler} that represents the MIME attachment.
+     *
+@@ -116,12 +116,12 @@
+     /**
+      * <p>Retrieve the attachment identified by content-id, <code>cid</code>,  as a <tt>byte[]</tt></p>.
+      *
+-     * @param cid It is expected to be a valid lexical form of the XML Schema 
++     * @param cid It is expected to be a valid lexical form of the XML Schema
+      * <code>xs:anyURI</code> datatype. If <code>{@link #isXOPPackage()}
+      * ==true</code>, it must be a valid URI per the <code>cid:</code> URI scheme (see <a href="http://www.ietf.org/rfc/rfc2387.txt">RFC 2387</a>)
+      *
+      * @return byte[] representation of attachment identified by cid.
+-     * 
++     *
+     * @throws IllegalArgumentException if the attachment for the given cid is not found.
+      */
+     public abstract byte[] getAttachmentAsByteArray(String cid);
+@@ -135,7 +135,5 @@
+      *
+      * @return true when MIME context is a XOP Document.
+      */
+-    public boolean isXOPPackage() { return false; } 
++    public boolean isXOPPackage() { return false; }
+ }
+-
+-
+--- old/src/share/classes/javax/xml/bind/attachment/package.html	Thu Jul 30 18:51:19 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/bind/attachment/package.html	Thu Jul 30 18:51:18 2009
+@@ -25,27 +25,27 @@
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+ <html>
+     <head>
+-        
++
+     </head>
+ 
+     <body bgcolor="white">
+ 
+         <p>
+-	This package is implemented by a MIME-based package processor that 
+-        enables the interpretation and creation of optimized binary data 
++        This package is implemented by a MIME-based package processor that
++        enables the interpretation and creation of optimized binary data
+         within an MIME-based package format.
+ 
+         <p>
+-        Soap MTOM[1], XOP([2][3]) and WS-I AP[4] standardize approaches to 
++        Soap MTOM[1], XOP([2][3]) and WS-I AP[4] standardize approaches to
+         optimized transmission of binary datatypes as an attachment.
+-        To optimally support these standards within a message passing 
+-        environment, this package enables an integrated solution between 
++        To optimally support these standards within a message passing
++        environment, this package enables an integrated solution between
+         a MIME-based package processor and JAXB unmarshall/marshal processes.
+ 
+         <h2>Package Specification</h2>
+ 
+         <ul>
+-            <li><a href="http://java.sun.com/xml/downloads/jaxb.html">JAXB 
++            <li><a href="http://java.sun.com/xml/downloads/jaxb.html">JAXB
+                 Specification</a>
+         </ul>
+ 
+@@ -52,7 +52,7 @@
+         <h2>Related Standards</h2>
+ 
+         <ul>
+-	  <li><a href="http://www.w3.org/TR/2004/WD-soap12-mtom-20040608/">[1]SOAP Message Transmission Optimization Mechanism</a> </li>
++          <li><a href="http://www.w3.org/TR/2004/WD-soap12-mtom-20040608/">[1]SOAP Message Transmission Optimization Mechanism</a> </li>
+           <li><a href="http://www.w3.org/TR/2005/REC-xop10-20050125/">[2]XML-binary Optimized Packaging</a></li>
+           <li><a href="http://www.ws-i.org/Profiles/AttachmentsProfile-1.0-2004-08-24.html">[3]WS-I Attachments Profile Version 1.0.</a></li>
+            <li><a href="http://www.w3.org/TR/xml-media-types/">[4]Describing Media Content of Binary Data in XML</a></li>
+@@ -62,5 +62,3 @@
+         @since JAXB 2.0
+     </body>
+ </html>
+-
+-
+--- old/src/share/classes/javax/xml/bind/helpers/AbstractMarshallerImpl.java	Thu Jul 30 18:51:23 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/bind/helpers/AbstractMarshallerImpl.java	Thu Jul 30 18:51:22 2009
+@@ -48,11 +48,11 @@
+ 
+ /**
+  * Partial default <tt>Marshaller</tt> implementation.
+- * 
++ *
+  * <p>
+  * This class provides a partial default implementation for the
+  * {@link javax.xml.bind.Marshaller} interface.
+- * 
++ *
+  * <p>
+  * The only methods that a JAXB Provider has to implement are
+  * {@link Marshaller#marshal(Object, javax.xml.transform.Result) marshal(Object, javax.xml.transform.Result)},
+@@ -60,7 +60,7 @@
+  * {@link Marshaller#marshal(Object, javax.xml.transform.Result) marshal(Object, javax.xml.stream.XMLEventWriter)}.
+  *
+  * @author <ul><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li></ul>
+- * @version $Revision$ $Date$
++ * @version $Revision: 1.8 $ $Date: 2006/08/28 17:56:38 $
+  * @see javax.xml.bind.Marshaller
+  * @since JAXB1.0
+  */
+@@ -67,21 +67,21 @@
+ public abstract class AbstractMarshallerImpl implements Marshaller
+ {
+     /** handler that will be used to process errors and warnings during marshal */
+-    private ValidationEventHandler eventHandler = 
++    private ValidationEventHandler eventHandler =
+         new DefaultValidationEventHandler();
+-    
++
+     //J2SE1.4 feature
+     //private Charset encoding = null;
+-    
++
+     /** store the value of the encoding property. */
+     private String encoding = "UTF-8";
+-    
++
+     /** store the value of the schemaLocation property. */
+     private String schemaLocation = null;
+ 
+     /** store the value of the noNamespaceSchemaLocation property. */
+     private String noNSSchemaLocation = null;
+-    
++
+     /** store the value of the formattedOutput property. */
+     private boolean formattedOutput = false;
+ 
+@@ -90,7 +90,7 @@
+ 
+     public final void marshal( Object obj, java.io.OutputStream os )
+         throws JAXBException {
+-            
++
+         checkNotNull( obj, "obj", os, "os" );
+         marshal( obj, new StreamResult(os) );
+     }
+@@ -109,81 +109,81 @@
+         }
+     }
+ 
+-    public final void marshal( Object obj, java.io.Writer w ) 
++    public final void marshal( Object obj, java.io.Writer w )
+         throws JAXBException {
+-            
++
+         checkNotNull( obj, "obj", w, "writer" );
+         marshal( obj, new StreamResult(w) );
+     }
+-    
+-    public final void marshal( Object obj, org.xml.sax.ContentHandler handler ) 
++
++    public final void marshal( Object obj, org.xml.sax.ContentHandler handler )
+         throws JAXBException {
+-            
++
+         checkNotNull( obj, "obj", handler, "handler" );
+         marshal( obj, new SAXResult(handler) );
+     }
+-    
+-    public final void marshal( Object obj, org.w3c.dom.Node node ) 
++
++    public final void marshal( Object obj, org.w3c.dom.Node node )
+         throws JAXBException {
+-            
++
+         checkNotNull( obj, "obj", node, "node" );
+         marshal( obj, new DOMResult(node) );
+     }
+-    
++
+     /**
+      * By default, the getNode method is unsupported and throw
+      * an {@link java.lang.UnsupportedOperationException}.
+-     * 
++     *
+      * Implementations that choose to support this method must
+      * override this method.
+      */
+     public org.w3c.dom.Node getNode( Object obj ) throws JAXBException {
+-        
++
+         checkNotNull( obj, "obj", Boolean.TRUE, "foo" );
+-        
++
+         throw new UnsupportedOperationException();
+     }
+-    
++
+     /**
+      * Convenience method for getting the current output encoding.
+-     * 
++     *
+      * @return the current encoding or "UTF-8" if it hasn't been set.
+      */
+     protected String getEncoding() {
+         return encoding;
+     }
+-    
++
+     /**
+      * Convenience method for setting the output encoding.
+-     * 
+-     * @param encoding a valid encoding as specified in the Marshaller class 
++     *
++     * @param encoding a valid encoding as specified in the Marshaller class
+      * documentation
+      */
+     protected void setEncoding( String encoding ) {
+         this.encoding = encoding;
+     }
+-    
++
+     /**
+      * Convenience method for getting the current schemaLocation.
+-     * 
++     *
+      * @return the current schemaLocation or null if it hasn't been set
+      */
+     protected String getSchemaLocation() {
+         return schemaLocation;
+     }
+-    
++
+     /**
+      * Convenience method for setting the schemaLocation.
+-     * 
++     *
+      * @param location the schemaLocation value
+      */
+     protected void setSchemaLocation( String location ) {
+         schemaLocation = location;
+     }
+-    
++
+     /**
+      * Convenience method for getting the current noNamespaceSchemaLocation.
+-     * 
++     *
+      * @return the current noNamespaceSchemaLocation or null if it hasn't
+      * been set
+      */
+@@ -190,19 +190,19 @@
+     protected String getNoNSSchemaLocation() {
+         return noNSSchemaLocation;
+     }
+-    
++
+     /**
+      * Convenience method for setting the noNamespaceSchemaLocation.
+-     * 
++     *
+      * @param location the noNamespaceSchemaLocation value
+      */
+     protected void setNoNSSchemaLocation( String location ) {
+         noNSSchemaLocation = location;
+     }
+-    
++
+     /**
+      * Convenience method for getting the formatted output flag.
+-     * 
++     *
+      * @return the current value of the formatted output flag or false if
+      * it hasn't been set.
+      */
+@@ -209,17 +209,17 @@
+     protected boolean isFormattedOutput() {
+         return formattedOutput;
+     }
+-    
++
+     /**
+      * Convenience method for setting the formatted output flag.
+-     * 
++     *
+      * @param v value of the formatted output flag.
+      */
+     protected void setFormattedOutput( boolean v ) {
+         formattedOutput = v;
+     }
+-    
+-    
++
++
+     /**
+      * Convenience method for getting the fragment flag.
+      *
+@@ -247,46 +247,46 @@
+         "UTF-16LE", "UnicodeLittleUnmarked",
+         "US-ASCII", "ASCII",
+         "TIS-620", "TIS620",
+-        
++
+         // taken from the project-X parser
+         "ISO-10646-UCS-2", "Unicode",
+-    
++
+         "EBCDIC-CP-US", "cp037",
+         "EBCDIC-CP-CA", "cp037",
+         "EBCDIC-CP-NL", "cp037",
+         "EBCDIC-CP-WT", "cp037",
+-    
++
+         "EBCDIC-CP-DK", "cp277",
+         "EBCDIC-CP-NO", "cp277",
+         "EBCDIC-CP-FI", "cp278",
+         "EBCDIC-CP-SE", "cp278",
+-    
++
+         "EBCDIC-CP-IT", "cp280",
+         "EBCDIC-CP-ES", "cp284",
+         "EBCDIC-CP-GB", "cp285",
+         "EBCDIC-CP-FR", "cp297",
+-    
++
+         "EBCDIC-CP-AR1", "cp420",
+         "EBCDIC-CP-HE", "cp424",
+         "EBCDIC-CP-BE", "cp500",
+         "EBCDIC-CP-CH", "cp500",
+-    
++
+         "EBCDIC-CP-ROECE", "cp870",
+         "EBCDIC-CP-YU", "cp870",
+         "EBCDIC-CP-IS", "cp871",
+         "EBCDIC-CP-AR2", "cp918",
+-        
++
+         // IANA also defines two that JDK 1.2 doesn't handle:
+         //  EBCDIC-CP-GR        --> CP423
+         //  EBCDIC-CP-TR        --> CP905
+     };
+-    
++
+     /**
+      * Gets the corresponding Java encoding name from an IANA name.
+-     * 
++     *
+      * This method is a helper method for the derived class to convert
+      * encoding names.
+-     * 
++     *
+      * @exception UnsupportedEncodingException
+      *      If this implementation couldn't find the Java encoding name.
+      */
+@@ -302,7 +302,7 @@
+                     return aliases[i+1];
+                 }
+             }
+-            
++
+             throw new UnsupportedEncodingException(encoding);
+         }
+         /* J2SE1.4 feature
+@@ -313,21 +313,21 @@
+         }
+          */
+     }
+-    
++
+     /**
+      * Default implementation of the setProperty method handles
+-     * the four defined properties in Marshaller. If a provider 
+-     * needs to handle additional properties, it should override 
++     * the four defined properties in Marshaller. If a provider
++     * needs to handle additional properties, it should override
+      * this method in a derived class.
+      */
+     public void setProperty( String name, Object value )
+         throws PropertyException {
+-        
++
+         if( name == null ) {
+-            throw new IllegalArgumentException( 
++            throw new IllegalArgumentException(
+                 Messages.format( Messages.MUST_NOT_BE_NULL, "name" ) );
+         }
+-        
++
+         // recognize and handle four pre-defined properties.
+         if( JAXB_ENCODING.equals(name) ) {
+             checkString( name, value );
+@@ -335,7 +335,7 @@
+             return;
+         }
+         if( JAXB_FORMATTED_OUTPUT.equals(name) ) {
+-            checkBoolean( name, value );                    
++            checkBoolean( name, value );
+             setFormattedOutput((Boolean) value );
+             return;
+         }
+@@ -360,18 +360,18 @@
+ 
+     /**
+      * Default implementation of the getProperty method handles
+-     * the four defined properties in Marshaller.  If a provider 
+-     * needs to support additional provider specific properties, 
++     * the four defined properties in Marshaller.  If a provider
++     * needs to support additional provider specific properties,
+      * it should override this method in a derived class.
+      */
+     public Object getProperty( String name )
+         throws PropertyException {
+-            
++
+         if( name == null ) {
+-            throw new IllegalArgumentException( 
++            throw new IllegalArgumentException(
+                 Messages.format( Messages.MUST_NOT_BE_NULL, "name" ) );
+         }
+-        
++
+         // recognize and handle four pre-defined properties.
+         if( JAXB_ENCODING.equals(name) )
+             return getEncoding();
+@@ -398,7 +398,7 @@
+      */
+     public void setEventHandler(ValidationEventHandler handler)
+         throws JAXBException {
+-        
++
+         if( handler == null ) {
+             eventHandler = new DefaultValidationEventHandler();
+         } else {
+@@ -417,7 +417,7 @@
+             throw new PropertyException(
+                 Messages.format( Messages.MUST_BE_BOOLEAN, name ) );
+     }
+-    
++
+     /*
+      * assert that the given object is a String
+      */
+@@ -426,19 +426,19 @@
+             throw new PropertyException(
+                 Messages.format( Messages.MUST_BE_STRING, name ) );
+     }
+-    
++
+     /*
+      * assert that the parameters are not null
+      */
+     private void checkNotNull( Object o1, String o1Name,
+                                Object o2, String o2Name ) {
+-    
++
+         if( o1 == null ) {
+-            throw new IllegalArgumentException( 
++            throw new IllegalArgumentException(
+                 Messages.format( Messages.MUST_NOT_BE_NULL, o1Name ) );
+         }
+         if( o2 == null ) {
+-            throw new IllegalArgumentException( 
++            throw new IllegalArgumentException(
+                 Messages.format( Messages.MUST_NOT_BE_NULL, o2Name ) );
+         }
+     }
+@@ -445,13 +445,13 @@
+ 
+     public void marshal(Object obj, XMLEventWriter writer)
+         throws JAXBException {
+-        
++
+         throw new UnsupportedOperationException();
+     }
+ 
+     public void marshal(Object obj, XMLStreamWriter writer)
+         throws JAXBException {
+-        
++
+         throw new UnsupportedOperationException();
+     }
+ 
+--- old/src/share/classes/javax/xml/bind/helpers/AbstractUnmarshallerImpl.java	Thu Jul 30 18:51:26 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/bind/helpers/AbstractUnmarshallerImpl.java	Thu Jul 30 18:51:26 2009
+@@ -53,29 +53,29 @@
+ 
+ /**
+  * Partial default <tt>Unmarshaller</tt> implementation.
+- * 
++ *
+  * <p>
+  * This class provides a partial default implementation for the
+  * {@link javax.xml.bind.Unmarshaller}interface.
+- * 
++ *
+  * <p>
+  * A JAXB Provider has to implement five methods (getUnmarshallerHandler,
+  * unmarshal(Node), unmarshal(XMLReader,InputSource),
+  * unmarshal(XMLStreamReader), and unmarshal(XMLEventReader).
+- * 
++ *
+  * @author <ul>
+  *         <li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li>
+  *         </ul>
+- * @version $Revision: 1.13 $ $Date: 2005/07/28 22:18:12 $
++ * @version $Revision: 1.14 $ $Date: 2006/03/08 17:01:00 $
+  * @see javax.xml.bind.Unmarshaller
+  * @since JAXB1.0
+  */
+ public abstract class AbstractUnmarshallerImpl implements Unmarshaller
+-{    
++{
+     /** handler that will be used to process errors and warnings during unmarshal */
+-    private ValidationEventHandler eventHandler = 
++    private ValidationEventHandler eventHandler =
+         new DefaultValidationEventHandler();
+-    
++
+     /** whether or not the unmarshaller will validate */
+     protected boolean validating = false;
+ 
+@@ -86,10 +86,10 @@
+ 
+     /**
+      * 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.
+      */
+@@ -99,7 +99,7 @@
+                 SAXParserFactory parserFactory;
+                 parserFactory = SAXParserFactory.newInstance();
+                 parserFactory.setNamespaceAware(true);
+-                // there is no point in asking a validation because 
++                // 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);
+@@ -112,13 +112,13 @@
+         }
+         return reader;
+     }
+-    
++
+     public Object unmarshal( Source source ) throws JAXBException {
+         if( source == null ) {
+             throw new IllegalArgumentException(
+                 Messages.format( Messages.MUST_NOT_BE_NULL, "source" ) );
+         }
+-        
++
+         if(source instanceof SAXSource)
+             return unmarshal( (SAXSource)source );
+         if(source instanceof StreamSource)
+@@ -125,7 +125,7 @@
+             return unmarshal( streamSourceToInputSource((StreamSource)source));
+         if(source instanceof DOMSource)
+             return unmarshal( ((DOMSource)source).getNode() );
+-        
++
+         // we don't handle other types of Source
+         throw new IllegalArgumentException();
+     }
+@@ -132,22 +132,22 @@
+ 
+     // use the client specified XMLReader contained in the SAXSource.
+     private Object unmarshal( SAXSource source ) throws JAXBException {
+-        
++
+         XMLReader reader = source.getXMLReader();
+         if( reader == null )
+             reader = getXMLReader();
+-        
++
+         return unmarshal( reader, source.getInputSource() );
+     }
+ 
+     /**
+      * Unmarshals an object by using the specified XMLReader and the InputSource.
+-     * 
++     *
+      * The callee should call the setErrorHandler method of the XMLReader
+      * so that errors are passed to the client-specified ValidationEventHandler.
+      */
+     protected abstract Object unmarshal( XMLReader reader, InputSource source ) throws JAXBException;
+-    
++
+     public final Object unmarshal( InputSource source ) throws JAXBException {
+         if( source == null ) {
+             throw new IllegalArgumentException(
+@@ -156,12 +156,12 @@
+ 
+         return unmarshal( getXMLReader(), source );
+     }
+-        
+ 
++
+     private Object unmarshal( String url ) throws JAXBException {
+         return unmarshal( new InputSource(url) );
+     }
+-    
++
+     public final Object unmarshal( URL url ) throws JAXBException {
+         if( url == null ) {
+             throw new IllegalArgumentException(
+@@ -170,7 +170,7 @@
+ 
+         return unmarshal( url.toExternalForm() );
+     }
+-    
++
+     public final Object unmarshal( File f ) throws JAXBException {
+         if( f == null ) {
+             throw new IllegalArgumentException(
+@@ -179,22 +179,22 @@
+ 
+         try {
+             // copied from JAXP
+-	    String path = f.getAbsolutePath();
+-	    if (File.separatorChar != '/')
+-	    	path = path.replace(File.separatorChar, '/');
+-	    if (!path.startsWith("/"))
+-	    	path = "/" + path;
+-	    if (!path.endsWith("/") && f.isDirectory())
+-	    	path = path + "/";
+-	    return unmarshal(new URL("file", "", path));
++            String path = f.getAbsolutePath();
++            if (File.separatorChar != '/')
++                path = path.replace(File.separatorChar, '/');
++            if (!path.startsWith("/"))
++                path = "/" + path;
++            if (!path.endsWith("/") && f.isDirectory())
++                path = path + "/";
++            return unmarshal(new URL("file", "", path));
+         } catch( MalformedURLException e ) {
+             throw new IllegalArgumentException(e.getMessage());
+         }
+     }
+-    
+-    public final Object unmarshal( java.io.InputStream is ) 
++
++    public final Object unmarshal( java.io.InputStream is )
+         throws JAXBException {
+-            
++
+         if( is == null ) {
+             throw new IllegalArgumentException(
+                 Messages.format( Messages.MUST_NOT_BE_NULL, "is" ) );
+@@ -220,11 +220,11 @@
+         is.setSystemId( ss.getSystemId() );
+         is.setByteStream( ss.getInputStream() );
+         is.setCharacterStream( ss.getReader() );
+-        
++
+         return is;
+     }
+-    
+-    
++
++
+     /**
+      * Indicates whether or not the Unmarshaller is configured to validate
+      * during unmarshal operations.
+@@ -240,7 +240,7 @@
+     public boolean isValidating() throws JAXBException {
+         return validating;
+     }
+-    
++
+     /**
+      * Allow an application to register a validation event handler.
+      * <p>
+@@ -255,9 +255,9 @@
+      * @throws JAXBException if an error was encountered while setting the
+      *        event handler
+      */
+-    public void setEventHandler(ValidationEventHandler handler) 
++    public void setEventHandler(ValidationEventHandler handler)
+         throws JAXBException {
+-        
++
+         if( handler == null ) {
+             eventHandler = new DefaultValidationEventHandler();
+         } else {
+@@ -264,7 +264,7 @@
+             eventHandler = handler;
+         }
+     }
+-    
++
+     /**
+      * Specifies whether or not the Unmarshaller should validate during
+      * unmarshal operations.  By default, the <tt>Unmarshaller</tt> does
+@@ -281,7 +281,7 @@
+     public void setValidating(boolean validating) throws JAXBException {
+         this.validating = validating;
+     }
+-    
++
+     /**
+      * Return the current event handler or the default event handler if one
+      * hasn't been set.
+@@ -294,13 +294,13 @@
+     public ValidationEventHandler getEventHandler() throws JAXBException {
+         return eventHandler;
+     }
+-    
+-    
++
++
+     /**
+      * Creates an UnmarshalException from a SAXException.
+-     * 
++     *
+      * This is an utility method provided for the derived classes.
+-     * 
++     *
+      * <p>
+      * When a provider-implemented ContentHandler wants to throw a
+      * JAXBException, it needs to wrap the exception by a SAXException.
+@@ -308,11 +308,11 @@
+      * by JAXBException, such an exception will be a JAXBException
+      * wrapped by a SAXException wrapped by another JAXBException.
+      * This is silly.
+-     * 
++     *
+      * <p>
+      * This method checks the nested exception of SAXException
+      * and reduce those excessive wrapping.
+-     * 
++     *
+      * @return the resulting UnmarshalException
+      */
+     protected UnmarshalException createUnmarshalException( SAXException e ) {
+@@ -320,14 +320,14 @@
+         Exception nested = e.getException();
+         if(nested instanceof UnmarshalException)
+             return (UnmarshalException)nested;
+-        
++
+         if(nested instanceof RuntimeException)
+             // typically this is an unexpected exception,
+             // just throw it rather than wrap it, so that the full stack
+             // trace can be displayed.
+             throw (RuntimeException)nested;
+-                
+-        
++
++
+         // otherwise simply wrap it
+         if(nested!=null)
+             return new UnmarshalException(nested);
+@@ -334,11 +334,11 @@
+         else
+             return new UnmarshalException(e);
+     }
+-    
++
+     /**
+-     * Default implementation of the setProperty method always 
++     * Default implementation of the setProperty method always
+      * throws PropertyException since there are no required
+-     * properties. If a provider needs to handle additional 
++     * properties. If a provider needs to handle additional
+      * properties, it should override this method in a derived class.
+      */
+     public void setProperty( String name, Object value )
+@@ -351,16 +351,16 @@
+ 
+         throw new PropertyException(name, value);
+     }
+-    
++
+     /**
+-     * Default implementation of the getProperty method always 
++     * Default implementation of the getProperty method always
+      * throws PropertyException since there are no required
+-     * properties. If a provider needs to handle additional 
++     * properties. If a provider needs to handle additional
+      * properties, it should override this method in a derived class.
+      */
+     public Object getProperty( String name )
+         throws PropertyException {
+-            
++
+         if( name == null ) {
+             throw new IllegalArgumentException(
+                 Messages.format( Messages.MUST_NOT_BE_NULL, "name" ) );
+@@ -368,14 +368,14 @@
+ 
+         throw new PropertyException(name);
+     }
+-    
++
+     public Object unmarshal(XMLEventReader reader) throws JAXBException {
+-        
++
+         throw new UnsupportedOperationException();
+     }
+ 
+     public Object unmarshal(XMLStreamReader reader) throws JAXBException {
+-        
++
+         throw new UnsupportedOperationException();
+     }
+ 
+--- old/src/share/classes/javax/xml/bind/helpers/DefaultValidationEventHandler.java	Thu Jul 30 18:51:30 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/bind/helpers/DefaultValidationEventHandler.java	Thu Jul 30 18:51:29 2009
+@@ -33,22 +33,22 @@
+ 
+ /**
+  * <p>
+- * JAXB 1.0 only default validation event handler. This is the default 
++ * JAXB 1.0 only default validation event handler. This is the default
+  * handler for all objects created from a JAXBContext that is managing
+- * schema-derived code generated by a JAXB 1.0 binding compiler. 
++ * schema-derived code generated by a JAXB 1.0 binding compiler.
+  *
+  * <p>
+  * This handler causes the unmarshal and validate operations to fail on the first
+  * error or fatal error.
+- * 
++ *
+  * <p>
+- * This handler is not the default handler for JAXB mapped classes following 
+- * JAXB 2.0 or later versions. Default validation event handling has changed 
+- * and is specified in  {@link javax.xml.bind.Unmarshaller} and 
++ * This handler is not the default handler for JAXB mapped classes following
++ * JAXB 2.0 or later versions. Default validation event handling has changed
++ * and is specified in  {@link javax.xml.bind.Unmarshaller} and
+  * {@link javax.xml.bind.Marshaller}.
+  *
+  * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li></ul>
+- * @version $Revision: 1.4 $
++ * @version $Revision: 1.5 $
+  * @see javax.xml.bind.Unmarshaller
+  * @see javax.xml.bind.Validator
+  * @see javax.xml.bind.ValidationEventHandler
+@@ -55,14 +55,14 @@
+  * @since JAXB1.0
+  */
+ public class DefaultValidationEventHandler implements ValidationEventHandler {
+-    
++
+     public boolean handleEvent( ValidationEvent event ) {
+-        
++
+         if( event == null ) {
+             throw new IllegalArgumentException();
+         }
+ 
+-        // calculate the severity prefix and return value        
++        // calculate the severity prefix and return value
+         String severity = null;
+         boolean retVal = false;
+         switch ( event.getSeverity() ) {
+@@ -83,16 +83,16 @@
+                     Messages.format( Messages.UNRECOGNIZED_SEVERITY,
+                             event.getSeverity() );
+         }
+-        
++
+         // calculate the location message
+         String location = getLocation( event );
+-        
+-        System.out.println( 
++
++        System.out.println(
+             Messages.format( Messages.SEVERITY_MESSAGE,
+                              severity,
+                              event.getMessage(),
+                              location ) );
+-        
++
+         // fail on the first error or fatal error
+         return retVal;
+     }
+@@ -99,20 +99,20 @@
+ 
+     /**
+      * Calculate a location message for the event
+-     * 
++     *
+      */
+     private String getLocation(ValidationEvent event) {
+         StringBuffer msg = new StringBuffer();
+-        
++
+         ValidationEventLocator locator = event.getLocator();
+-        
++
+         if( locator != null ) {
+-            
++
+             URL url = locator.getURL();
+             Object obj = locator.getObject();
+             Node node = locator.getNode();
+             int line = locator.getLineNumber();
+-            
++
+             if( url!=null || line!=-1 ) {
+                 msg.append( "line " + line );
+                 if( url!=null )
+@@ -124,9 +124,8 @@
+             }
+         } else {
+             msg.append( Messages.format( Messages.LOCATION_UNAVAILABLE ) );
+-        } 
+-        
++        }
++
+         return msg.toString();
+     }
+ }
+-
+--- old/src/share/classes/javax/xml/bind/helpers/Messages.java	Thu Jul 30 18:51:33 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/bind/helpers/Messages.java	Thu Jul 30 18:51:33 2009
+@@ -36,27 +36,27 @@
+     static String format( String property ) {
+         return format( property, null );
+     }
+-    
++
+     static String format( String property, Object arg1 ) {
+         return format( property, new Object[]{arg1} );
+     }
+-    
++
+     static String format( String property, Object arg1, Object arg2 ) {
+         return format( property, new Object[]{arg1,arg2} );
+     }
+-    
++
+     static String format( String property, Object arg1, Object arg2, Object arg3 ) {
+         return format( property, new Object[]{arg1,arg2,arg3} );
+     }
+-    
++
+     // add more if necessary.
+-    
++
+     /** Loads a string resource and formats it with specified arguments. */
+     static String format( String property, Object[] args ) {
+         String text = ResourceBundle.getBundle(Messages.class.getName()).getString(property);
+         return MessageFormat.format(text,args);
+     }
+-    
++
+ //
+ //
+ // Message resources
+@@ -64,22 +64,22 @@
+ //
+     static final String INPUTSTREAM_NOT_NULL = // 0 args
+         "AbstractUnmarshallerImpl.ISNotNull";
+-        
++
+     static final String MUST_BE_BOOLEAN = // 1 arg
+         "AbstractMarshallerImpl.MustBeBoolean";
+-       
++
+     static final String MUST_BE_STRING = // 1 arg
+         "AbstractMarshallerImpl.MustBeString";
+-        
++
+     static final String SEVERITY_MESSAGE = // 3 args
+         "DefaultValidationEventHandler.SeverityMessage";
+ 
+     static final String LOCATION_UNAVAILABLE = // 0 args
+         "DefaultValidationEventHandler.LocationUnavailable";
+-        
++
+     static final String UNRECOGNIZED_SEVERITY = // 1 arg
+         "DefaultValidationEventHandler.UnrecognizedSeverity";
+-        
++
+     static final String WARNING = // 0 args
+         "DefaultValidationEventHandler.Warning";
+ 
+@@ -88,10 +88,10 @@
+ 
+     static final String FATAL_ERROR = // 0 args
+         "DefaultValidationEventHandler.FatalError";
+-        
++
+     static final String ILLEGAL_SEVERITY = // 0 args
+         "ValidationEventImpl.IllegalSeverity";
+-        
++
+     static final String MUST_NOT_BE_NULL = // 1 arg
+         "Shared.MustNotBeNull";
+ }
+--- old/src/share/classes/javax/xml/bind/helpers/Messages.properties	Thu Jul 30 18:51:37 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/bind/helpers/Messages.properties	Thu Jul 30 18:51:36 2009
+@@ -24,38 +24,36 @@
+ #
+ 
+ AbstractUnmarshallerImpl.ISNotNull = \
+-	InputStream can not be null
++        InputStream can not be null
+ 
+ AbstractMarshallerImpl.MustBeBoolean = \
+-	{0} must be boolean
+-	 
++        {0} must be boolean
++
+ AbstractMarshallerImpl.MustBeString = \
+-	{0} must be a String
+-	
++        {0} must be a String
+ 
++
+ DefaultValidationEventHandler.SeverityMessage = \
+-	DefaultValidationEventHandler: {0} {1} \n\
++        DefaultValidationEventHandler: {0} {1} \n\
+ \ \ \ \ \ Location: {2}
+ 
+ DefaultValidationEventHandler.LocationUnavailable = \
+-	unavailable
+-	
++        unavailable
++
+ DefaultValidationEventHandler.UnrecognizedSeverity = \
+-	Unrecognized event severity field "{0}"
++        Unrecognized event severity field "{0}"
+ 
+ DefaultValidationEventHandler.Warning = \
+-	[WARNING]:
++        [WARNING]:
+ 
+ DefaultValidationEventHandler.Error = \
+-	[ERROR]:
++        [ERROR]:
+ 
+ DefaultValidationEventHandler.FatalError = \
+-	[FATAL_ERROR]:
+-	
++        [FATAL_ERROR]:
++
+ ValidationEventImpl.IllegalSeverity = \
+-	Illegal severity
+-	
++        Illegal severity
++
+ Shared.MustNotBeNull = \
+-	{0} parameter must not be null
+-	
+- 
++        {0} parameter must not be null
+--- old/src/share/classes/javax/xml/bind/helpers/NotIdentifiableEventImpl.java	Thu Jul 30 18:51:40 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/bind/helpers/NotIdentifiableEventImpl.java	Thu Jul 30 18:51:40 2009
+@@ -29,14 +29,14 @@
+ 
+ /**
+  * Default implementation of the NotIdentifiableEvent interface.
+- * 
++ *
+  * <p>
+  * JAXB providers are allowed to use whatever class that implements
+  * the ValidationEvent interface. This class is just provided for a
+  * convenience.
+  *
+- * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li></ul> 
+- * @version $Revision: 1.2 $
++ * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li></ul>
++ * @version $Revision: 1.1 $
+  * @see javax.xml.bind.NotIdentifiableEvent
+  * @see javax.xml.bind.Validator
+  * @see javax.xml.bind.ValidationEventHandler
+@@ -50,9 +50,9 @@
+ 
+     /**
+      * Create a new NotIdentifiableEventImpl.
+-     * 
++     *
+      * @param _severity The severity value for this event.  Must be one of
+-     * ValidationEvent.WARNING, ValidationEvent.ERROR, or 
++     * ValidationEvent.WARNING, ValidationEvent.ERROR, or
+      * ValidationEvent.FATAL_ERROR
+      * @param _message The text message for this event - may be null.
+      * @param _locator The locator object for this event - may be null.
+@@ -60,15 +60,15 @@
+      */
+     public NotIdentifiableEventImpl( int _severity, String _message,
+                                       ValidationEventLocator _locator) {
+-            
++
+         super(_severity, _message, _locator);
+     }
+ 
+     /**
+      * Create a new NotIdentifiableEventImpl.
+-     * 
++     *
+      * @param _severity The severity value for this event.  Must be one of
+-     * ValidationEvent.WARNING, ValidationEvent.ERROR, or 
++     * ValidationEvent.WARNING, ValidationEvent.ERROR, or
+      * ValidationEvent.FATAL_ERROR
+      * @param _message The text message for this event - may be null.
+      * @param _locator The locator object for this event - may be null.
+@@ -79,7 +79,7 @@
+     public NotIdentifiableEventImpl( int _severity, String _message,
+                                       ValidationEventLocator _locator,
+                                       Throwable _linkedException) {
+-            
++
+         super(_severity, _message, _locator, _linkedException);
+     }
+ 
+--- old/src/share/classes/javax/xml/bind/helpers/ParseConversionEventImpl.java	Thu Jul 30 18:51:44 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/bind/helpers/ParseConversionEventImpl.java	Thu Jul 30 18:51:43 2009
+@@ -30,14 +30,14 @@
+ 
+ /**
+  * Default implementation of the ParseConversionEvent interface.
+- * 
++ *
+  * <p>
+  * JAXB providers are allowed to use whatever class that implements
+  * the ValidationEvent interface. This class is just provided for a
+  * convenience.
+  *
+- * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li></ul> 
+- * @version $Revision: 1.2 $
++ * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li></ul>
++ * @version $Revision: 1.1 $
+  * @see javax.xml.bind.ParseConversionEvent
+  * @see javax.xml.bind.Validator
+  * @see javax.xml.bind.ValidationEventHandler
+@@ -51,9 +51,9 @@
+ 
+     /**
+      * Create a new ParseConversionEventImpl.
+-     * 
++     *
+      * @param _severity The severity value for this event.  Must be one of
+-     * ValidationEvent.WARNING, ValidationEvent.ERROR, or 
++     * ValidationEvent.WARNING, ValidationEvent.ERROR, or
+      * ValidationEvent.FATAL_ERROR
+      * @param _message The text message for this event - may be null.
+      * @param _locator The locator object for this event - may be null.
+@@ -61,15 +61,15 @@
+      */
+     public ParseConversionEventImpl( int _severity, String _message,
+                                       ValidationEventLocator _locator) {
+-            
++
+         super(_severity, _message, _locator);
+     }
+ 
+     /**
+      * Create a new ParseConversionEventImpl.
+-     * 
++     *
+      * @param _severity The severity value for this event.  Must be one of
+-     * ValidationEvent.WARNING, ValidationEvent.ERROR, or 
++     * ValidationEvent.WARNING, ValidationEvent.ERROR, or
+      * ValidationEvent.FATAL_ERROR
+      * @param _message The text message for this event - may be null.
+      * @param _locator The locator object for this event - may be null.
+@@ -80,7 +80,7 @@
+     public ParseConversionEventImpl( int _severity, String _message,
+                                       ValidationEventLocator _locator,
+                                       Throwable _linkedException) {
+-            
++
+         super(_severity, _message, _locator, _linkedException);
+     }
+ 
+--- old/src/share/classes/javax/xml/bind/helpers/PrintConversionEventImpl.java	Thu Jul 30 18:51:47 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/bind/helpers/PrintConversionEventImpl.java	Thu Jul 30 18:51:47 2009
+@@ -30,14 +30,14 @@
+ 
+ /**
+  * Default implementation of the PrintConversionEvent interface.
+- * 
++ *
+  * <p>
+  * JAXB providers are allowed to use whatever class that implements
+  * the ValidationEvent interface. This class is just provided for a
+  * convenience.
+  *
+- * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li></ul> 
+- * @version $Revision: 1.2 $
++ * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li></ul>
++ * @version $Revision: 1.1 $
+  * @see javax.xml.bind.PrintConversionEvent
+  * @see javax.xml.bind.Validator
+  * @see javax.xml.bind.ValidationEventHandler
+@@ -51,9 +51,9 @@
+ 
+     /**
+      * Create a new PrintConversionEventImpl.
+-     * 
++     *
+      * @param _severity The severity value for this event.  Must be one of
+-     * ValidationEvent.WARNING, ValidationEvent.ERROR, or 
++     * ValidationEvent.WARNING, ValidationEvent.ERROR, or
+      * ValidationEvent.FATAL_ERROR
+      * @param _message The text message for this event - may be null.
+      * @param _locator The locator object for this event - may be null.
+@@ -61,15 +61,15 @@
+      */
+     public PrintConversionEventImpl( int _severity, String _message,
+                                       ValidationEventLocator _locator) {
+-            
++
+         super(_severity, _message, _locator);
+     }
+ 
+     /**
+      * Create a new PrintConversionEventImpl.
+-     * 
++     *
+      * @param _severity The severity value for this event.  Must be one of
+-     * ValidationEvent.WARNING, ValidationEvent.ERROR, or 
++     * ValidationEvent.WARNING, ValidationEvent.ERROR, or
+      * ValidationEvent.FATAL_ERROR
+      * @param _message The text message for this event - may be null.
+      * @param _locator The locator object for this event - may be null.
+@@ -80,7 +80,7 @@
+     public PrintConversionEventImpl( int _severity, String _message,
+                                       ValidationEventLocator _locator,
+                                       Throwable _linkedException) {
+-            
++
+         super(_severity, _message, _locator, _linkedException);
+     }
+ 
+--- old/src/share/classes/javax/xml/bind/helpers/ValidationEventImpl.java	Thu Jul 30 18:51:51 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/bind/helpers/ValidationEventImpl.java	Thu Jul 30 18:51:50 2009
+@@ -31,14 +31,14 @@
+ 
+ /**
+  * Default implementation of the ValidationEvent interface.
+- * 
++ *
+  * <p>
+  * JAXB providers are allowed to use whatever class that implements
+  * the ValidationEvent interface. This class is just provided for a
+  * convenience.
+  *
+- * @author <ul><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li></ul> 
+- * @version $Revision: 1.2 $
++ * @author <ul><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li></ul>
++ * @version $Revision: 1.1 $
+  * @see javax.xml.bind.Validator
+  * @see javax.xml.bind.ValidationEventHandler
+  * @see javax.xml.bind.ValidationEvent
+@@ -47,28 +47,28 @@
+  */
+ public class ValidationEventImpl implements ValidationEvent
+ {
+-    
++
+     /**
+      * Create a new ValidationEventImpl.
+-     * 
++     *
+      * @param _severity The severity value for this event.  Must be one of
+-     * ValidationEvent.WARNING, ValidationEvent.ERROR, or 
++     * ValidationEvent.WARNING, ValidationEvent.ERROR, or
+      * ValidationEvent.FATAL_ERROR
+      * @param _message The text message for this event - may be null.
+      * @param _locator The locator object for this event - may be null.
+      * @throws IllegalArgumentException if an illegal severity field is supplied
+      */
+-    public ValidationEventImpl( int _severity, String _message, 
++    public ValidationEventImpl( int _severity, String _message,
+                                  ValidationEventLocator _locator ) {
+-        
++
+         this(_severity,_message,_locator,null);
+     }
+ 
+     /**
+      * Create a new ValidationEventImpl.
+-     * 
++     *
+      * @param _severity The severity value for this event.  Must be one of
+-     * ValidationEvent.WARNING, ValidationEvent.ERROR, or 
++     * ValidationEvent.WARNING, ValidationEvent.ERROR, or
+      * ValidationEvent.FATAL_ERROR
+      * @param _message The text message for this event - may be null.
+      * @param _locator The locator object for this event - may be null.
+@@ -76,85 +76,85 @@
+      * additional information about the event - may be null.
+      * @throws IllegalArgumentException if an illegal severity field is supplied
+      */
+-    public ValidationEventImpl( int _severity, String _message, 
+-                                 ValidationEventLocator _locator, 
++    public ValidationEventImpl( int _severity, String _message,
++                                 ValidationEventLocator _locator,
+                                  Throwable _linkedException ) {
+-    
++
+         setSeverity( _severity );
+         this.message = _message;
+         this.locator = _locator;
+         this.linkedException = _linkedException;
+     }
+-    
++
+     private int severity;
+     private String message;
+     private Throwable linkedException;
+     private ValidationEventLocator locator;
+-    
++
+     public int getSeverity() {
+         return severity;
+     }
+-    
+-    
++
++
+     /**
+-     * Set the severity field of this event.  
+-     * 
+-     * @param _severity Must be one of ValidationEvent.WARNING, 
++     * Set the severity field of this event.
++     *
++     * @param _severity Must be one of ValidationEvent.WARNING,
+      * ValidationEvent.ERROR, or ValidationEvent.FATAL_ERROR.
+      * @throws IllegalArgumentException if an illegal severity field is supplied
+      */
+     public void setSeverity( int _severity ) {
+-        
+-        if( _severity != ValidationEvent.WARNING && 
+-            _severity != ValidationEvent.ERROR && 
++
++        if( _severity != ValidationEvent.WARNING &&
++            _severity != ValidationEvent.ERROR &&
+             _severity != ValidationEvent.FATAL_ERROR ) {
+-                throw new IllegalArgumentException( 
++                throw new IllegalArgumentException(
+                     Messages.format( Messages.ILLEGAL_SEVERITY ) );
+         }
+ 
+         this.severity = _severity;
+     }
+-    
++
+     public String getMessage() {
+         return message;
+     }
+     /**
+      * Set the message field of this event.
+-     * 
++     *
+      * @param _message String message - may be null.
+      */
+     public void setMessage( String _message ) {
+         this.message = _message;
+     }
+-    
++
+     public Throwable getLinkedException() {
+         return linkedException;
+     }
+     /**
+      * Set the linked exception field of this event.
+-     * 
++     *
+      * @param _linkedException Optional linked exception - may be null.
+      */
+     public void setLinkedException( Throwable _linkedException ) {
+         this.linkedException = _linkedException;
+     }
+-    
++
+     public ValidationEventLocator getLocator() {
+         return locator;
+     }
+     /**
+      * Set the locator object for this event.
+-     * 
++     *
+      * @param _locator The locator - may be null.
+      */
+     public void setLocator( ValidationEventLocator _locator ) {
+         this.locator = _locator;
+     }
+-    
++
+     /**
+      * Returns a string representation of this object in a format
+      * helpful to debugging.
+-     * 
++     *
+      * @see Object#equals(Object)
+      */
+     public String toString() {
+--- old/src/share/classes/javax/xml/bind/helpers/ValidationEventLocatorImpl.java	Thu Jul 30 18:51:55 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/bind/helpers/ValidationEventLocatorImpl.java	Thu Jul 30 18:51:54 2009
+@@ -35,14 +35,14 @@
+ 
+ /**
+  * Default implementation of the ValidationEventLocator interface.
+- * 
++ *
+  * <p>
+  * JAXB providers are allowed to use whatever class that implements
+  * the ValidationEventLocator interface. This class is just provided for a
+  * convenience.
+  *
+- * @author <ul><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li></ul> 
+- * @version $Revision: 1.1 $
++ * @author <ul><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li></ul>
++ * @version $Revision: 1.2 $
+  * @see javax.xml.bind.Validator
+  * @see javax.xml.bind.ValidationEventHandler
+  * @see javax.xml.bind.ValidationEvent
+@@ -57,14 +57,14 @@
+     public ValidationEventLocatorImpl() {
+     }
+ 
+-    /** 
+-     * Constructs an object from an org.xml.sax.Locator. 
+-     * 
+-     * The object's ColumnNumber, LineNumber, and URL become available from the 
++    /**
++     * Constructs an object from an org.xml.sax.Locator.
++     *
++     * The object's ColumnNumber, LineNumber, and URL become available from the
+      * values returned by the locator's getColumnNumber(), getLineNumber(), and
+-     * getSystemId() methods respectively. Node, Object, and Offset are not 
+-     * available. 
+-     * 
++     * getSystemId() methods respectively. Node, Object, and Offset are not
++     * available.
++     *
+      * @param loc the SAX Locator object that will be used to populate this
+      * event locator.
+      * @throws IllegalArgumentException if the Locator is null
+@@ -80,14 +80,14 @@
+         this.lineNumber = loc.getLineNumber();
+     }
+ 
+-    /** 
+-     * Constructs an object from the location information of a SAXParseException. 
+-     * 
+-     * The object's ColumnNumber, LineNumber, and URL become available from the 
++    /**
++     * Constructs an object from the location information of a SAXParseException.
++     *
++     * The object's ColumnNumber, LineNumber, and URL become available from the
+      * values returned by the locator's getColumnNumber(), getLineNumber(), and
+-     * getSystemId() methods respectively. Node, Object, and Offset are not 
+-     * available. 
+-     * 
++     * getSystemId() methods respectively. Node, Object, and Offset are not
++     * available.
++     *
+      * @param e the SAXParseException object that will be used to populate this
+      * event locator.
+      * @throws IllegalArgumentException if the SAXParseException is null
+@@ -103,12 +103,12 @@
+         this.lineNumber = e.getLineNumber();
+     }
+ 
+-    /** 
+-     * Constructs an object that points to a DOM Node. 
+-     * 
+-     * The object's Node becomes available.  ColumnNumber, LineNumber, Object, 
++    /**
++     * Constructs an object that points to a DOM Node.
++     *
++     * The object's Node becomes available.  ColumnNumber, LineNumber, Object,
+      * Offset, and URL are not available.
+-     * 
++     *
+      * @param _node the DOM Node object that will be used to populate this
+      * event locator.
+      * @throws IllegalArgumentException if the Node is null
+@@ -122,12 +122,12 @@
+         this.node = _node;
+     }
+ 
+-    /** 
+-     * Constructs an object that points to a JAXB content object. 
+-     * 
+-     * The object's Object becomes available. ColumnNumber, LineNumber, Node, 
++    /**
++     * Constructs an object that points to a JAXB content object.
++     *
++     * The object's Object becomes available. ColumnNumber, LineNumber, Node,
+      * Offset, and URL are not available.
+-     * 
++     *
+      * @param _object the Object that will be used to populate this
+      * event locator.
+      * @throws IllegalArgumentException if the Object is null
+@@ -140,7 +140,7 @@
+ 
+         this.object = _object;
+     }
+-    
++
+     /** Converts a system ID to an URL object. */
+     private static URL toURL( String systemId ) {
+         try {
+@@ -150,7 +150,7 @@
+             return null;    // for now
+         }
+     }
+-    
++
+     private URL url = null;
+     private int offset = -1;
+     private int lineNumber = -1;
+@@ -157,24 +157,24 @@
+     private int columnNumber = -1;
+     private Object object = null;
+     private Node node = null;
+-    
+-    
++
++
+     /**
+      * @see javax.xml.bind.ValidationEventLocator#getURL()
+      */
+     public URL getURL() {
+         return url;
+-    }    
+-    
++    }
++
+     /**
+      * Set the URL field on this event locator.  Null values are allowed.
+-     * 
++     *
+      * @param _url the url
+      */
+     public void setURL( URL _url ) {
+         this.url = _url;
+-    }    
+-    
++    }
++
+     /**
+      * @see javax.xml.bind.ValidationEventLocator#getOffset()
+      */
+@@ -181,16 +181,16 @@
+     public int getOffset() {
+         return offset;
+     }
+-    
++
+     /**
+-     * Set the offset field on this event locator.  
+-     * 
++     * Set the offset field on this event locator.
++     *
+      * @param _offset the offset
+      */
+     public void setOffset( int _offset ) {
+         this.offset = _offset;
+     }
+-    
++
+     /**
+      * @see javax.xml.bind.ValidationEventLocator#getLineNumber()
+      */
+@@ -197,16 +197,16 @@
+     public int getLineNumber() {
+         return lineNumber;
+     }
+-    
++
+     /**
+      * Set the lineNumber field on this event locator.
+-     * 
++     *
+      * @param _lineNumber the line number
+      */
+     public void setLineNumber( int _lineNumber ) {
+         this.lineNumber = _lineNumber;
+     }
+-    
++
+     /**
+      * @see javax.xml.bind.ValidationEventLocator#getColumnNumber()
+      */
+@@ -213,16 +213,16 @@
+     public int getColumnNumber() {
+         return columnNumber;
+     }
+-    
++
+     /**
+      * Set the columnNumber field on this event locator.
+-     * 
++     *
+      * @param _columnNumber the column number
+      */
+     public void setColumnNumber( int _columnNumber ) {
+         this.columnNumber = _columnNumber;
+     }
+-    
++
+     /**
+      * @see javax.xml.bind.ValidationEventLocator#getObject()
+      */
+@@ -229,16 +229,16 @@
+     public Object getObject() {
+         return object;
+     }
+-    
++
+     /**
+      * Set the Object field on this event locator.  Null values are allowed.
+-     * 
++     *
+      * @param _object the java content object
+      */
+     public void setObject( Object _object ) {
+         this.object = _object;
+     }
+-    
++
+     /**
+      * @see javax.xml.bind.ValidationEventLocator#getNode()
+      */
+@@ -245,20 +245,20 @@
+     public Node getNode() {
+         return node;
+     }
+-    
++
+     /**
+      * Set the Node field on this event locator.  Null values are allowed.
+-     * 
++     *
+      * @param _node the Node
+      */
+     public void setNode( Node _node ) {
+         this.node = _node;
+     }
+-    
++
+     /**
+      * Returns a string representation of this object in a format
+      * helpful to debugging.
+-     * 
++     *
+      * @see Object#equals(Object)
+      */
+     public String toString() {
+--- old/src/share/classes/javax/xml/bind/helpers/package.html	Thu Jul 30 18:51:58 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/bind/helpers/package.html	Thu Jul 30 18:51:57 2009
+@@ -25,32 +25,32 @@
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+ <html>
+     <head>
+-        
++
+     </head>
+ 
+     <body bgcolor="white">
+ 
+         <p>
+-        <B>JAXB Provider Use Only:</b> Provides partial default implementations for 
++        <B>JAXB Provider Use Only:</b> Provides partial default implementations for
+         some of the <tt>javax.xml.bind</tt> interfaces.
+ 
+         <p>
+-        JAXB Providers can extend these classes and implement the abstract 
++        JAXB Providers can extend these classes and implement the abstract
+         methods.
+- 
++
+         <h2>Package Specification</h2>
+ 
+         <ul>
+-            <li><a href="http://java.sun.com/xml/downloads/jaxb.html">JAXB 
++            <li><a href="http://java.sun.com/xml/downloads/jaxb.html">JAXB
+                 Specification</a>
+         </ul>
+ 
+         <h2>Related Documentation</h2>
+ 
+-        For overviews, tutorials, examples, guides, and tool documentation, 
++        For overviews, tutorials, examples, guides, and tool documentation,
+         please see:
+         <ul>
+-            <li>The <a href="http://java.sun.com/xml/jaxb/index.html">JAXB 
++            <li>The <a href="http://java.sun.com/xml/jaxb/index.html">JAXB
+             Website</a>
+         </ul>
+ 
+@@ -58,5 +58,3 @@
+ 
+     </body>
+ </html>
+-
+-
+--- old/src/share/classes/javax/xml/bind/package.html	Thu Jul 30 18:52:02 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/bind/package.html	Thu Jul 30 18:52:01 2009
+@@ -25,7 +25,7 @@
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+ <html>
+     <head>
+-        
++
+     </head>
+ 
+     <body bgcolor="white">
+@@ -42,16 +42,16 @@
+         <h2>Package Specification</h2>
+ 
+         <ul>
+-            <li><a href="http://java.sun.com/xml/downloads/jaxb.html">JAXB 
++            <li><a href="http://java.sun.com/xml/downloads/jaxb.html">JAXB
+                 Specification</a>
+         </ul>
+ 
+         <h2>Related Documentation</h2>
+ 
+-        For overviews, tutorials, examples, guides, and tool documentation, 
++        For overviews, tutorials, examples, guides, and tool documentation,
+         please see:
+         <ul>
+-            <li>The <a href="http://java.sun.com/xml/jaxb/index.html">JAXB 
++            <li>The <a href="http://java.sun.com/xml/jaxb/index.html">JAXB
+             Website</a>
+         </ul>
+ 
+@@ -59,5 +59,3 @@
+ 
+     </body>
+ </html>
+-
+-
+--- old/src/share/classes/javax/xml/bind/util/JAXBResult.java	Thu Jul 30 18:52:05 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/bind/util/JAXBResult.java	Thu Jul 30 18:52:05 2009
+@@ -33,43 +33,43 @@
+ /**
+  * JAXP {@link javax.xml.transform.Result} implementation
+  * that unmarshals a JAXB object.
+- * 
++ *
+  * <p>
+  * This utility class is useful to combine JAXB with
+  * other Java/XML technologies.
+- * 
++ *
+  * <p>
+  * The following example shows how to use JAXB to unmarshal a document
+  * resulting from an XSLT transformation.
+- * 
++ *
+  * <blockquote>
+  *    <pre>
+  *       JAXBResult result = new JAXBResult(
+  *         JAXBContext.newInstance("org.acme.foo") );
+- *       
++ *
+  *       // set up XSLT transformation
+  *       TransformerFactory tf = TransformerFactory.newInstance();
+  *       Transformer t = tf.newTransformer(new StreamSource("test.xsl"));
+- *       
++ *
+  *       // run transformation
+  *       t.transform(new StreamSource("document.xml"),result);
+- * 
++ *
+  *       // obtain the unmarshalled content tree
+  *       Object o = result.getResult();
+  *    </pre>
+  * </blockquote>
+- * 
++ *
+  * <p>
+  * The fact that JAXBResult derives from SAXResult is an implementation
+  * detail. Thus in general applications are strongly discouraged from
+  * accessing methods defined on SAXResult.
+- * 
++ *
+  * <p>
+- * In particular it shall never attempt to call the setHandler, 
++ * In particular it shall never attempt to call the setHandler,
+  * setLexicalHandler, and setSystemId methods.
+- * 
++ *
+  * @author
+- * 	Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
++ *      Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+ public class JAXBResult extends SAXResult {
+ 
+@@ -76,7 +76,7 @@
+     /**
+      * Creates a new instance that uses the specified
+      * JAXBContext to unmarshal.
+-     * 
++     *
+      * @param context The JAXBContext that will be used to create the
+      * necessary Unmarshaller.  This parameter must not be null.
+      * @exception JAXBException if an error is encountered while creating the
+@@ -85,22 +85,22 @@
+     public JAXBResult( JAXBContext context ) throws JAXBException {
+         this( ( context == null ) ? assertionFailed() : context.createUnmarshaller() );
+     }
+-    
++
+     /**
+      * Creates a new instance that uses the specified
+      * Unmarshaller to unmarshal an object.
+-     * 
++     *
+      * <p>
+      * This JAXBResult object will use the specified Unmarshaller
+      * instance. It is the caller's responsibility not to use the
+      * same Unmarshaller for other purposes while it is being
+      * used by this object.
+-     * 
++     *
+      * <p>
+      * The primary purpose of this method is to allow the client
+      * to configure Unmarshaller. Unless you know what you are doing,
+      * it's easier and safer to pass a JAXBContext.
+-     * 
++     *
+      * @param _unmarshaller the unmarshaller.  This parameter must not be null.
+      * @throws JAXBException if an error is encountered while creating the
+      * JAXBResult or the Unmarshaller parameter is null.
+@@ -107,14 +107,14 @@
+      */
+     public JAXBResult( Unmarshaller _unmarshaller ) throws JAXBException {
+         if( _unmarshaller == null )
+-            throw new JAXBException( 
++            throw new JAXBException(
+                 Messages.format( Messages.RESULT_NULL_UNMARSHALLER ) );
+-            
++
+         this.unmarshallerHandler = _unmarshaller.getUnmarshallerHandler();
+-        
++
+         super.setHandler(unmarshallerHandler);
+     }
+-    
++
+     /**
+      * Unmarshaller that will be used to unmarshal
+      * the input documents.
+@@ -123,13 +123,13 @@
+ 
+     /**
+      * Gets the unmarshalled object created by the transformation.
+-     * 
++     *
+      * @return
+      *      Always return a non-null object.
+-     * 
++     *
+      * @exception IllegalStateException
+-     * 	if this method is called before an object is unmarshalled.
+-     * 
++     *  if this method is called before an object is unmarshalled.
++     *
+      * @exception JAXBException
+      *      if there is any unmarshalling error.
+      *      Note that the implementation is allowed to throw SAXException
+@@ -138,7 +138,7 @@
+     public Object getResult() throws JAXBException {
+         return unmarshallerHandler.getResult();
+     }
+-    
++
+     /**
+      * Hook to throw exception from the middle of a contructor chained call
+      * to this
+--- old/src/share/classes/javax/xml/bind/util/JAXBSource.java	Thu Jul 30 18:52:09 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/bind/util/JAXBSource.java	Thu Jul 30 18:52:08 2009
+@@ -44,31 +44,31 @@
+ /**
+  * JAXP {@link javax.xml.transform.Source} implementation
+  * that marshals a JAXB-generated object.
+- * 
++ *
+  * <p>
+  * This utility class is useful to combine JAXB with
+  * other Java/XML technologies.
+- * 
++ *
+  * <p>
+  * The following example shows how to use JAXB to marshal a document
+  * for transformation by XSLT.
+- * 
++ *
+  * <blockquote>
+  *    <pre>
+  *       MyObject o = // get JAXB content tree
+- *       
++ *
+  *       // jaxbContext is a JAXBContext object from which 'o' is created.
+  *       JAXBSource source = new JAXBSource( jaxbContext, o );
+- *       
++ *
+  *       // set up XSLT transformation
+  *       TransformerFactory tf = TransformerFactory.newInstance();
+  *       Transformer t = tf.newTransformer(new StreamSource("test.xsl"));
+- *       
++ *
+  *       // run transformation
+  *       t.transform(source,new StreamResult(System.out));
+  *    </pre>
+  * </blockquote>
+- * 
++ *
+  * <p>
+  * The fact that JAXBSource derives from SAXSource is an implementation
+  * detail. Thus in general applications are strongly discouraged from
+@@ -77,7 +77,7 @@
+  * The XMLReader object obtained by the getXMLReader method shall
+  * be used only for parsing the InputSource object returned by
+  * the getInputSource method.
+- * 
++ *
+  * <p>
+  * Similarly the InputSource object obtained by the getInputSource
+  * method shall be used only for being parsed by the XMLReader object
+@@ -84,13 +84,13 @@
+  * returned by the getXMLReader.
+  *
+  * @author
+- * 	Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
++ *      Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+  */
+ public class JAXBSource extends SAXSource {
+ 
+     /**
+      * Creates a new {@link javax.xml.transform.Source} for the given content object.
+-     * 
++     *
+      * @param   context
+      *      JAXBContext that was used to create
+      *      <code>contentObject</code>. This context is used
+@@ -102,22 +102,22 @@
+      * @throws JAXBException if an error is encountered while creating the
+      * JAXBSource or if either of the parameters are null.
+      */
+-    public JAXBSource( JAXBContext context, Object contentObject ) 
++    public JAXBSource( JAXBContext context, Object contentObject )
+         throws JAXBException {
+-            
+-        this( 
+-            ( context == null ) ? 
+-                assertionFailed( Messages.format( Messages.SOURCE_NULL_CONTEXT ) ) : 
++
++        this(
++            ( context == null ) ?
++                assertionFailed( Messages.format( Messages.SOURCE_NULL_CONTEXT ) ) :
+                 context.createMarshaller(),
+-                
+-            ( contentObject == null ) ? 
+-                assertionFailed( Messages.format( Messages.SOURCE_NULL_CONTENT ) ) : 
++
++            ( contentObject == null ) ?
++                assertionFailed( Messages.format( Messages.SOURCE_NULL_CONTENT ) ) :
+                 contentObject);
+     }
+-    
++
+     /**
+      * Creates a new {@link javax.xml.transform.Source} for the given content object.
+-     * 
++     *
+      * @param   marshaller
+      *      A marshaller instance that will be used to marshal
+      *      <code>contentObject</code> into XML. This must be
+@@ -130,28 +130,28 @@
+      * @throws JAXBException if an error is encountered while creating the
+      * JAXBSource or if either of the parameters are null.
+      */
+-    public JAXBSource( Marshaller marshaller, Object contentObject ) 
++    public JAXBSource( Marshaller marshaller, Object contentObject )
+         throws JAXBException {
+-            
++
+         if( marshaller == null )
+-            throw new JAXBException( 
++            throw new JAXBException(
+                 Messages.format( Messages.SOURCE_NULL_MARSHALLER ) );
+-                
++
+         if( contentObject == null )
+-            throw new JAXBException( 
++            throw new JAXBException(
+                 Messages.format( Messages.SOURCE_NULL_CONTENT ) );
+-            
++
+         this.marshaller = marshaller;
+         this.contentObject = contentObject;
+-        
++
+         super.setXMLReader(pseudoParser);
+         // pass a dummy InputSource. We don't care
+         super.setInputSource(new InputSource());
+     }
+-    
++
+     private final Marshaller marshaller;
+     private final Object contentObject;
+-    
++
+     // this object will pretend as an XMLReader.
+     // no matter what parameter is specified to the parse method,
+     // it just parse the contentObject.
+@@ -262,9 +262,9 @@
+      * Hook to throw exception from the middle of a contructor chained call
+      * to this
+      */
+-    private static Marshaller assertionFailed( String message ) 
++    private static Marshaller assertionFailed( String message )
+         throws JAXBException {
+-            
++
+         throw new JAXBException( message );
+     }
+ }
+--- old/src/share/classes/javax/xml/bind/util/Messages.java	Thu Jul 30 18:52:12 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/bind/util/Messages.java	Thu Jul 30 18:52:12 2009
+@@ -36,27 +36,27 @@
+     static String format( String property ) {
+         return format( property, null );
+     }
+-    
++
+     static String format( String property, Object arg1 ) {
+         return format( property, new Object[]{arg1} );
+     }
+-    
++
+     static String format( String property, Object arg1, Object arg2 ) {
+         return format( property, new Object[]{arg1,arg2} );
+     }
+-    
++
+     static String format( String property, Object arg1, Object arg2, Object arg3 ) {
+         return format( property, new Object[]{arg1,arg2,arg3} );
+     }
+-    
++
+     // add more if necessary.
+-    
++
+     /** Loads a string resource and formats it with specified arguments. */
+     static String format( String property, Object[] args ) {
+         String text = ResourceBundle.getBundle(Messages.class.getName()).getString(property);
+         return MessageFormat.format(text,args);
+     }
+-    
++
+ //
+ //
+ // Message resources
+@@ -70,14 +70,14 @@
+ 
+     static final String RESULT_NULL_UNMARSHALLER = // 0 arg
+         "JAXBResult.NullUnmarshaller";
+-        
++
+     static final String SOURCE_NULL_CONTEXT = // 0 args
+         "JAXBSource.NullContext";
+ 
+     static final String SOURCE_NULL_CONTENT = // 0 arg
+         "JAXBSource.NullContent";
+-        
++
+     static final String SOURCE_NULL_MARSHALLER = // 0 arg
+         "JAXBSource.NullMarshaller";
+-        
++
+ }
+--- old/src/share/classes/javax/xml/bind/util/Messages.properties	Thu Jul 30 18:52:16 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/bind/util/Messages.properties	Thu Jul 30 18:52:15 2009
+@@ -24,20 +24,19 @@
+ #
+ 
+ ValidationEventCollector.UnrecognizedSeverity = \
+-	Unrecognized event severity field "{0}"
+-	
++        Unrecognized event severity field "{0}"
++
+ JAXBResult.NullContext = \
+-	JAXBContext can not be null
+-	
++        JAXBContext can not be null
++
+ JAXBResult.NullUnmarshaller = \
+-	Unmarshaller can not be null
+-	
++        Unmarshaller can not be null
++
+ JAXBSource.NullContext = \
+-	JAXBContext can not be null
+-	
++        JAXBContext can not be null
++
+ JAXBSource.NullContent = \
+-	Content object can not be null
+-	
++        Content object can not be null
++
+ JAXBSource.NullMarshaller = \
+-	Marshaller can not be null
+- 
++        Marshaller can not be null
+--- old/src/share/classes/javax/xml/bind/util/ValidationEventCollector.java	Thu Jul 30 18:52:19 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/bind/util/ValidationEventCollector.java	Thu Jul 30 18:52:19 2009
+@@ -30,17 +30,17 @@
+ import java.util.List;
+ 
+ /**
+- * {@link javax.xml.bind.ValidationEventHandler ValidationEventHandler} 
++ * {@link javax.xml.bind.ValidationEventHandler ValidationEventHandler}
+  * implementation that collects all events.
+- * 
++ *
+  * <p>
+  * To use this class, create a new instance and pass it to the setEventHandler
+- * method of the Validator, Unmarshaller, Marshaller class.  After the call to 
+- * validate or unmarshal completes, call the getEvents method to retrieve all 
++ * method of the Validator, Unmarshaller, Marshaller class.  After the call to
++ * validate or unmarshal completes, call the getEvents method to retrieve all
+  * the reported errors and warnings.
+  *
+- * @author <ul><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul> 
+- * @version $Revision$
++ * @author <ul><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul>
++ * @version $Revision: 1.3 $
+  * @see javax.xml.bind.Validator
+  * @see javax.xml.bind.ValidationEventHandler
+  * @see javax.xml.bind.ValidationEvent
+@@ -50,11 +50,11 @@
+ public class ValidationEventCollector implements ValidationEventHandler
+ {
+     private final List<ValidationEvent> events = new ArrayList<ValidationEvent>();
+-     
++
+     /**
+-     * Return an array of ValidationEvent objects containing a copy of each of 
++     * Return an array of ValidationEvent objects containing a copy of each of
+      * the collected errors and warnings.
+-     * 
++     *
+      * @return
+      *      a copy of all the collected errors and warnings or an empty array
+      *      if there weren't any
+@@ -62,7 +62,7 @@
+     public ValidationEvent[] getEvents() {
+         return events.toArray(new ValidationEvent[events.size()]);
+     }
+-    
++
+     /**
+      * Clear all collected errors and warnings.
+      */
+@@ -69,19 +69,19 @@
+     public void reset() {
+         events.clear();
+     }
+-    
++
+     /**
+-     * Returns true if this event collector contains at least one 
++     * Returns true if this event collector contains at least one
+      * ValidationEvent.
+      *
+-     * @return true if this event collector contains at least one 
++     * @return true if this event collector contains at least one
+      *         ValidationEvent, false otherwise
+      */
+     public boolean hasEvents() {
+         return !events.isEmpty();
+     }
+-    
+-    public boolean handleEvent( ValidationEvent event ) {        
++
++    public boolean handleEvent( ValidationEvent event ) {
+         events.add(event);
+ 
+         boolean retVal = true;
+@@ -96,12 +96,12 @@
+                 retVal = false; // halt validation
+                 break;
+             default:
+-                _assert( false, 
++                _assert( false,
+                          Messages.format( Messages.UNRECOGNIZED_SEVERITY,
+                                  event.getSeverity() ) );
+                 break;
+         }
+-        
++
+         return retVal;
+     }
+ 
+--- old/src/share/classes/javax/xml/bind/util/package.html	Thu Jul 30 18:52:23 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/bind/util/package.html	Thu Jul 30 18:52:22 2009
+@@ -25,7 +25,7 @@
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+ <html>
+     <head>
+-        
++
+     </head>
+ 
+     <body bgcolor="white">
+@@ -36,16 +36,16 @@
+         <h2>Package Specification</h2>
+ 
+         <ul>
+-            <li><a href="http://java.sun.com/xml/downloads/jaxb.html">JAXB 
++            <li><a href="http://java.sun.com/xml/downloads/jaxb.html">JAXB
+                 Specification</a>
+         </ul>
+ 
+         <h2>Related Documentation</h2>
+ 
+-        For overviews, tutorials, examples, guides, and tool documentation, 
++        For overviews, tutorials, examples, guides, and tool documentation,
+         please see:
+         <ul>
+-            <li>The <a href="http://java.sun.com/xml/jaxb/index.html">JAXB 
++            <li>The <a href="http://java.sun.com/xml/jaxb/index.html">JAXB
+             Website</a>
+         </ul>
+ 
+@@ -53,5 +53,3 @@
+ 
+     </body>
+ </html>
+-
+-
+--- old/src/share/classes/javax/xml/soap/AttachmentPart.java	Thu Jul 30 18:52:26 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/soap/AttachmentPart.java	Thu Jul 30 18:52:26 2009
+@@ -23,9 +23,9 @@
+  * have any questions.
+  */
+ /*
+- * $Id: AttachmentPart.java,v 1.12 2005/09/08 14:19:50 vj135062 Exp $
+- * $Revision: 1.12 $
+- * $Date: 2005/09/08 14:19:50 $
++ * $Id: AttachmentPart.java,v 1.13 2006/03/30 00:59:38 ofung Exp $
++ * $Revision: 1.13 $
++ * $Date: 2006/03/30 00:59:38 $
+  */
+ 
+ 
+@@ -60,7 +60,7 @@
+  *       Content-Type:  application/xml
+  *       </PRE>
+  *       The following line of code, in which <code>ap</code> is an
+- *       <code>AttachmentPart</code> object, sets the header shown in 
++ *       <code>AttachmentPart</code> object, sets the header shown in
+  *       the previous example.
+  *       <PRE>
+  *       ap.setMimeHeader("Content-Type", "application/xml");
+@@ -83,9 +83,9 @@
+  * The following code fragment, in which <code>m</code> is a
+  * <code>SOAPMessage</code> object and <code>contentStringl</code> is a
+  * <code>String</code>, creates an instance of <code>AttachmentPart</code>,
+- * sets the <code>AttachmentPart</code> object with some content and 
+- * header information, and adds the <code>AttachmentPart</code> object to 
+- * the <code>SOAPMessage</code> object. 
++ * sets the <code>AttachmentPart</code> object with some content and
++ * header information, and adds the <code>AttachmentPart</code> object to
++ * the <code>SOAPMessage</code> object.
+  * <PRE>
+  *     AttachmentPart ap1 = m.createAttachmentPart();
+  *     ap1.setContent(contentString1, "text/plain");
+@@ -94,8 +94,8 @@
+  *
+  *
+  * <p>
+- * The following code fragment creates and adds a second 
+- * <code>AttachmentPart</code> instance to the same message. <code>jpegData</code> 
++ * The following code fragment creates and adds a second
++ * <code>AttachmentPart</code> instance to the same message. <code>jpegData</code>
+  * is a binary byte buffer representing the jpeg file.
+  * <PRE>
+  *     AttachmentPart ap2 = m.createAttachmentPart();
+@@ -104,7 +104,7 @@
+  *     m.addAttachmentPart(ap2);
+  * </PRE>
+  * <p>
+- * The <code>getContent</code> method retrieves the contents and header from 
++ * The <code>getContent</code> method retrieves the contents and header from
+  * an <code>AttachmentPart</code> object. Depending on the
+  * <code>DataContentHandler</code> objects present, the returned
+  * <code>Object</code> can either be a typed Java object corresponding
+@@ -148,9 +148,9 @@
+      * and (2) the <code>Content-Type</code> given in the header.
+      * <p>
+      * For the MIME content types "text/plain", "text/html" and "text/xml", the
+-     * <code>DataContentHandler</code> object does the conversions to and 
++     * <code>DataContentHandler</code> object does the conversions to and
+      * from the Java types corresponding to the MIME types.
+-     * For other MIME types,the <code>DataContentHandler</code> object 
++     * For other MIME types,the <code>DataContentHandler</code> object
+      * can return an <code>InputStream</code> object that contains the content data
+      * as raw bytes.
+      * <p>
+@@ -163,10 +163,10 @@
+      * <code>text/xml</code>, a <code>java.awt.Image</code> object
+      * corresponding to a content stream with a
+      * <code>Content-Type</code> value of <code>image/gif</code> or
+-     * <code>image/jpeg</code>.  For those content types that an 
++     * <code>image/jpeg</code>.  For those content types that an
+      * installed <code>DataContentHandler</code> object does not understand, the
+      * <code>DataContentHandler</code> object is required to return a
+-     * <code>java.io.InputStream</code> object with the raw bytes. 
++     * <code>java.io.InputStream</code> object with the raw bytes.
+      *
+      * @return a Java object with the content of this <code>AttachmentPart</code>
+      *         object
+@@ -176,26 +176,26 @@
+      *            transformation error
+      */
+     public abstract Object getContent() throws SOAPException;
+-    
++
+     /**
+-     * Gets the content of this <code>AttachmentPart</code> object as an 
++     * Gets the content of this <code>AttachmentPart</code> object as an
+      * InputStream as if a call had been made to <code>getContent</code> and no
+-     * <code>DataContentHandler</code> had been registered for the 
++     * <code>DataContentHandler</code> had been registered for the
+      * <code>content-type</code> of this <code>AttachmentPart</code>.
+      *<p>
+-     * Note that reading from the returned InputStream would result in consuming 
++     * Note that reading from the returned InputStream would result in consuming
+      * the data in the stream. It is the responsibility of the caller to reset
+      * the InputStream appropriately before calling a Subsequent API. If a copy
+-     * of the raw attachment content is required then the {@link #getRawContentBytes} API 
++     * of the raw attachment content is required then the {@link #getRawContentBytes} API
+      * should be used instead.
+-     *  
++     *
+      * @return an <code>InputStream</code> from which the raw data contained by
+      *      the <code>AttachmentPart</code> can be accessed.
+-     * 
+-     * @throws SOAPException if there is no content set into this 
+-     *      <code>AttachmentPart</code> object or if there was a data 
++     *
++     * @throws SOAPException if there is no content set into this
++     *      <code>AttachmentPart</code> object or if there was a data
+      *      transformation error.
+-     * 
++     *
+      * @since SAAJ 1.3
+      * @see #getRawContentBytes
+      */
+@@ -202,54 +202,54 @@
+     public abstract InputStream getRawContent() throws SOAPException;
+ 
+     /**
+-     * Gets the content of this <code>AttachmentPart</code> object as a 
++     * Gets the content of this <code>AttachmentPart</code> object as a
+      * byte[] array as if a call had been made to <code>getContent</code> and no
+-     * <code>DataContentHandler</code> had been registered for the 
++     * <code>DataContentHandler</code> had been registered for the
+      * <code>content-type</code> of this <code>AttachmentPart</code>.
+-     *  
+-     * @return a <code>byte[]</code> array containing the raw data of the 
++     *
++     * @return a <code>byte[]</code> array containing the raw data of the
+      *      <code>AttachmentPart</code>.
+-     * 
+-     * @throws SOAPException if there is no content set into this 
+-     *      <code>AttachmentPart</code> object or if there was a data 
++     *
++     * @throws SOAPException if there is no content set into this
++     *      <code>AttachmentPart</code> object or if there was a data
+      *      transformation error.
+-     * 
++     *
+      * @since SAAJ 1.3
+      */
+     public abstract byte[] getRawContentBytes() throws SOAPException;
+ 
+     /**
+-     * Returns an <code>InputStream</code> which can be used to obtain the 
+-     * content of <code>AttachmentPart</code>  as Base64 encoded 
+-     * character data, this method would base64 encode the raw bytes 
++     * Returns an <code>InputStream</code> which can be used to obtain the
++     * content of <code>AttachmentPart</code>  as Base64 encoded
++     * character data, this method would base64 encode the raw bytes
+      * of the attachment and return.
+-     *  
++     *
+      * @return an <code>InputStream</code> from which the Base64 encoded
+      *       <code>AttachmentPart</code> can be read.
+-     * 
+-     * @throws SOAPException if there is no content set into this 
+-     *      <code>AttachmentPart</code> object or if there was a data 
++     *
++     * @throws SOAPException if there is no content set into this
++     *      <code>AttachmentPart</code> object or if there was a data
+      *      transformation error.
+-     * 
++     *
+      * @since SAAJ 1.3
+      */
+     public abstract InputStream getBase64Content() throws SOAPException;
+ 
+     /**
+-     * Sets the content of this attachment part to that of the given 
++     * Sets the content of this attachment part to that of the given
+      * <code>Object</code> and sets the value of the <code>Content-Type</code>
+      * header to the given type. The type of the
+      * <code>Object</code> should correspond to the value given for the
+      * <code>Content-Type</code>. This depends on the particular
+-     * set of <code>DataContentHandler</code> objects in use. 
++     * set of <code>DataContentHandler</code> objects in use.
+      *
+      *
+      * @param object the Java object that makes up the content for
+      *               this attachment part
+      * @param contentType the MIME string that specifies the type of
+-     *                  the content 
++     *                  the content
+      *
+-     * @exception IllegalArgumentException may be thrown if the contentType 
++     * @exception IllegalArgumentException may be thrown if the contentType
+      *            does not match the type of the content object, or if there
+      *            was no <code>DataContentHandler</code> object for this
+      *            content object
+@@ -261,17 +261,17 @@
+     /**
+      * Sets the content of this attachment part to that contained by the
+      * <code>InputStream</code> <code>content</code> and sets the value of the
+-     * <code>Content-Type</code> header to the value contained in 
++     * <code>Content-Type</code> header to the value contained in
+      * <code>contentType</code>.
+      * <P>
+-     *  A subsequent call to getSize() may not be an exact measure 
++     *  A subsequent call to getSize() may not be an exact measure
+      *  of the content size.
+-     * 
++     *
+      * @param content the raw data to add to the attachment part
+-     * @param contentType the value to set into the <code>Content-Type</code> 
++     * @param contentType the value to set into the <code>Content-Type</code>
+      * header
+-     * 
+-     * @exception SOAPException if an there is an error in setting the content 
++     *
++     * @exception SOAPException if an there is an error in setting the content
+      * @exception NullPointerException if <code>content</code> is null
+      * @since SAAJ 1.3
+      */
+@@ -280,21 +280,21 @@
+     /**
+      * Sets the content of this attachment part to that contained by the
+      * <code>byte[]</code> array <code>content</code> and sets the value of the
+-     * <code>Content-Type</code> header to the value contained in 
++     * <code>Content-Type</code> header to the value contained in
+      * <code>contentType</code>.
+-     * 
++     *
+      * @param content the raw data to add to the attachment part
+-     * @param contentType the value to set into the <code>Content-Type</code> 
++     * @param contentType the value to set into the <code>Content-Type</code>
+      * header
+      * @param offset the offset in the byte array of the content
+      * @param len the number of bytes that form the content
+-     * 
+-     * @exception SOAPException if an there is an error in setting the content 
++     *
++     * @exception SOAPException if an there is an error in setting the content
+      * or content is null
+      * @since SAAJ 1.3
+      */
+     public abstract void setRawContentBytes(
+-        byte[] content, int offset, int len,  String contentType) 
++        byte[] content, int offset, int len,  String contentType)
+         throws SOAPException;
+ 
+ 
+@@ -301,20 +301,20 @@
+     /**
+      * Sets the content of this attachment part from the Base64 source
+      * <code>InputStream</code>  and sets the value of the
+-     * <code>Content-Type</code> header to the value contained in 
+-     * <code>contentType</code>, This method would first decode the base64 
+-     * input and write the resulting raw bytes to the attachment. 
++     * <code>Content-Type</code> header to the value contained in
++     * <code>contentType</code>, This method would first decode the base64
++     * input and write the resulting raw bytes to the attachment.
+      * <P>
+-     *  A subsequent call to getSize() may not be an exact measure 
++     *  A subsequent call to getSize() may not be an exact measure
+      *  of the content size.
+-     * 
++     *
+      * @param content the base64 encoded data to add to the attachment part
+-     * @param contentType the value to set into the <code>Content-Type</code> 
++     * @param contentType the value to set into the <code>Content-Type</code>
+      * header
+-     * 
++     *
+      * @exception SOAPException if an there is an error in setting the content
+      * @exception NullPointerException if <code>content</code> is null
+-     * 
++     *
+      * @since SAAJ 1.3
+      */
+     public abstract void setBase64Content(
+@@ -348,10 +348,10 @@
+      *            the specified <code>DataHandler</code> object
+      */
+     public abstract void setDataHandler(DataHandler dataHandler);
+-    
+ 
++
+     /**
+-     * Gets the value of the MIME header whose name is "Content-ID". 
++     * Gets the value of the MIME header whose name is "Content-ID".
+      *
+      * @return a <code>String</code> giving the value of the
+      *          "Content-ID" header or <code>null</code> if there
+@@ -364,9 +364,9 @@
+             return values[0];
+         return null;
+     }
+-    
++
+     /**
+-     * Gets the value of the MIME header whose name is "Content-Location". 
++     * Gets the value of the MIME header whose name is "Content-Location".
+      *
+      * @return a <code>String</code> giving the value of the
+      *          "Content-Location" header or <code>null</code> if there
+@@ -378,9 +378,9 @@
+             return values[0];
+         return null;
+     }
+-    
++
+     /**
+-     * Gets the value of the MIME header whose name is "Content-Type". 
++     * Gets the value of the MIME header whose name is "Content-Type".
+      *
+      * @return a <code>String</code> giving the value of the
+      *          "Content-Type" header or <code>null</code> if there
+@@ -392,33 +392,33 @@
+             return values[0];
+         return null;
+     }
+-    
++
+     /**
+      * Sets the MIME header whose name is "Content-ID" with the given value.
+      *
+      * @param contentId a <code>String</code> giving the value of the
+-     *          "Content-ID" header 
++     *          "Content-ID" header
+      *
+      * @exception IllegalArgumentException if there was a problem with
+      *            the specified <code>contentId</code> value
+      * @see #getContentId
+      */
+-    public void setContentId(String contentId) 
++    public void setContentId(String contentId)
+     {
+         setMimeHeader("Content-ID", contentId);
+     }
+-    
+-    
++
++
+     /**
+      * Sets the MIME header whose name is "Content-Location" with the given value.
+      *
+      *
+      * @param contentLocation a <code>String</code> giving the value of the
+-     *          "Content-Location" header 
++     *          "Content-Location" header
+      * @exception IllegalArgumentException if there was a problem with
+      *            the specified content location
+      */
+-    public void setContentLocation(String contentLocation) 
++    public void setContentLocation(String contentLocation)
+     {
+         setMimeHeader("Content-Location", contentLocation);
+     }
+@@ -427,12 +427,12 @@
+      * Sets the MIME header whose name is "Content-Type" with the given value.
+      *
+      * @param contentType a <code>String</code> giving the value of the
+-     *          "Content-Type" header 
++     *          "Content-Type" header
+      *
+      * @exception IllegalArgumentException if there was a problem with
+      *            the specified content type
+      */
+-    public void setContentType(String contentType) 
++    public void setContentType(String contentType)
+     {
+         setMimeHeader("Content-Type", contentType);
+     }
+@@ -441,7 +441,7 @@
+      * Removes all MIME headers that match the given name.
+      *
+      * @param header the string name of the MIME header/s to
+-     *               be removed  
++     *               be removed
+      */
+     public abstract void removeMimeHeader(String header);
+ 
+@@ -449,8 +449,8 @@
+      * Removes all the MIME header entries.
+      */
+     public abstract void removeAllMimeHeaders();
+-    
+ 
++
+     /**
+      * Gets all the values of the header identified by the given
+      * <code>String</code>.
+@@ -461,8 +461,8 @@
+      * @see #setMimeHeader
+      */
+     public abstract String[] getMimeHeader(String name);
+-    
+ 
++
+     /**
+      * Changes the first header entry that matches the given name
+      * to the given value, adding a new header if no existing header
+@@ -470,9 +470,9 @@
+      *
+      * Note that RFC822 headers can only contain US-ASCII characters.
+      *
+-     * @param	name	a <code>String</code> giving the name of the header 
++     * @param   name    a <code>String</code> giving the name of the header
+      *                  for which to search
+-     * @param	value	a <code>String</code> giving the value to be set for
++     * @param   value   a <code>String</code> giving the value to be set for
+      *                  the header whose name matches the given name
+      *
+      * @exception IllegalArgumentException if there was a problem with
+@@ -479,8 +479,8 @@
+      *            the specified mime header name or value
+      */
+     public abstract void setMimeHeader(String name, String value);
+-    
+ 
++
+     /**
+      * Adds a MIME header with the specified name and value to this
+      * <code>AttachmentPart</code> object.
+@@ -487,14 +487,14 @@
+      * <p>
+      * Note that RFC822 headers can contain only US-ASCII characters.
+      *
+-     * @param	name	a <code>String</code> giving the name of the header 
++     * @param   name    a <code>String</code> giving the name of the header
+      *                  to be added
+-     * @param	value	a <code>String</code> giving the value of the header 
++     * @param   value   a <code>String</code> giving the value of the header
+      *                  to be added
+      *
+      * @exception IllegalArgumentException if there was a problem with
+      *            the specified mime header name or value
+-     */ 
++     */
+     public abstract void addMimeHeader(String name, String value);
+ 
+     /**
+@@ -501,7 +501,7 @@
+      * Retrieves all the headers for this <code>AttachmentPart</code> object
+      * as an iterator over the <code>MimeHeader</code> objects.
+      *
+-     * @return	an <code>Iterator</code> object with all of the Mime
++     * @return  an <code>Iterator</code> object with all of the Mime
+      *          headers for this <code>AttachmentPart</code> object
+      */
+     public abstract Iterator getAllMimeHeaders();
+@@ -512,11 +512,11 @@
+      *
+      * @param names a <code>String</code> array with the name(s) of the
+      *        MIME headers to be returned
+-     * @return	all of the MIME headers that match one of the names in the
++     * @return  all of the MIME headers that match one of the names in the
+      *           given array as an <code>Iterator</code> object
+      */
+     public abstract Iterator getMatchingMimeHeaders(String[] names);
+-    
++
+     /**
+      * Retrieves all <code>MimeHeader</code> objects whose name does
+      * not match a name in the given array.
+@@ -523,9 +523,9 @@
+      *
+      * @param names a <code>String</code> array with the name(s) of the
+      *        MIME headers not to be returned
+-     * @return	all of the MIME headers in this <code>AttachmentPart</code> object
++     * @return  all of the MIME headers in this <code>AttachmentPart</code> object
+      *          except those that match one of the names in the
+-     *           given array.  The nonmatching MIME headers are returned as an 
++     *           given array.  The nonmatching MIME headers are returned as an
+      *           <code>Iterator</code> object.
+      */
+     public abstract Iterator getNonMatchingMimeHeaders(String[] names);
+--- old/src/share/classes/javax/xml/soap/Detail.java	Thu Jul 30 18:52:30 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/soap/Detail.java	Thu Jul 30 18:52:29 2009
+@@ -23,9 +23,9 @@
+  * have any questions.
+  */
+ /*
+- * $Id: Detail.java,v 1.8 2005/04/05 20:34:16 mk125090 Exp $
+- * $Revision: 1.8 $
+- * $Date: 2005/04/05 20:34:16 $
++ * $Id: Detail.java,v 1.9 2006/03/30 00:59:38 ofung Exp $
++ * $Revision: 1.9 $
++ * $Date: 2006/03/30 00:59:38 $
+  */
+ 
+ 
+--- old/src/share/classes/javax/xml/soap/DetailEntry.java	Thu Jul 30 18:52:34 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/soap/DetailEntry.java	Thu Jul 30 18:52:33 2009
+@@ -23,9 +23,9 @@
+  * have any questions.
+  */
+ /*
+- * $Id: DetailEntry.java,v 1.3 2005/04/05 20:34:16 mk125090 Exp $
+- * $Revision: 1.3 $
+- * $Date: 2005/04/05 20:34:16 $
++ * $Id: DetailEntry.java,v 1.4 2006/03/30 00:59:38 ofung Exp $
++ * $Revision: 1.4 $
++ * $Date: 2006/03/30 00:59:38 $
+  */
+ 
+ 
+--- old/src/share/classes/javax/xml/soap/FactoryFinder.java	Thu Jul 30 18:52:37 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/soap/FactoryFinder.java	Thu Jul 30 18:52:36 2009
+@@ -23,9 +23,9 @@
+  * have any questions.
+  */
+ /*
+- * $Id: FactoryFinder.java,v 1.6 2005/04/05 22:28:12 mk125090 Exp $
+- * $Revision: 1.6 $
+- * $Date: 2005/04/05 22:28:12 $
++ * $Id: FactoryFinder.java,v 1.7 2006/03/30 00:59:38 ofung Exp $
++ * $Revision: 1.7 $
++ * $Date: 2006/03/30 00:59:38 $
+  */
+ 
+ 
+@@ -39,7 +39,7 @@
+ class FactoryFinder {
+ 
+     /**
+-     * Creates an instance of the specified class using the specified 
++     * Creates an instance of the specified class using the specified
+      * <code>ClassLoader</code> object.
+      *
+      * @exception SOAPException if the given class could not be found
+@@ -124,11 +124,11 @@
+             } else {
+                 is=classLoader.getResourceAsStream(serviceId);
+             }
+-        
++
+             if( is!=null ) {
+                 BufferedReader rd =
+                     new BufferedReader(new InputStreamReader(is, "UTF-8"));
+-        
++
+                 String factoryClassName = rd.readLine();
+                 rd.close();
+ 
+--- old/src/share/classes/javax/xml/soap/MessageFactory.java	Thu Jul 30 18:52:41 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/soap/MessageFactory.java	Thu Jul 30 18:52:40 2009
+@@ -23,9 +23,9 @@
+  * have any questions.
+  */
+ /*
+- * $Id: MessageFactory.java,v 1.10 2005/04/05 22:28:13 mk125090 Exp $
+- * $Revision: 1.10 $
+- * $Date: 2005/04/05 22:28:13 $
++ * $Id: MessageFactory.java,v 1.11 2006/03/30 00:59:38 ofung Exp $
++ * $Revision: 1.11 $
++ * $Date: 2006/03/30 00:59:38 $
+  */
+ 
+ 
+@@ -55,9 +55,9 @@
+  *  <LI>A <code>SOAPBody</code> object
+  *  <LI>A <code>SOAPHeader</code> object
+  * </UL>
+- * In some cases, specialized MessageFactory objects may be obtained that produce messages 
+- * prepopulated with additional entries in the <code>SOAPHeader</code> object and the  
+- * <code>SOAPBody</code> object. 
++ * In some cases, specialized MessageFactory objects may be obtained that produce messages
++ * prepopulated with additional entries in the <code>SOAPHeader</code> object and the
++ * <code>SOAPBody</code> object.
+  * The content of a new <code>SOAPMessage</code> object depends on which of the two
+  * <code>MessageFactory</code> methods is used to create it.
+  * <UL>
+@@ -101,7 +101,7 @@
+      *            <code>MessageFactory</code>.
+      * @see SAAJMetaFactory
+      */
+-     
++
+     public static MessageFactory newInstance()
+         throws SOAPException {
+         try {
+@@ -127,9 +127,9 @@
+      * message factory creates messages based on the MIME headers specified
+      * as arguments to the <code>createMessage</code> method.
+      *
+-     * This method uses the SAAJMetaFactory to locate the implementation class 
++     * This method uses the SAAJMetaFactory to locate the implementation class
+      * and create the MessageFactory instance.
+-     * 
++     *
+      * @return a new instance of a <code>MessageFactory</code>
+      *
+      * @param protocol  a string constant representing the class of the
+@@ -165,7 +165,7 @@
+      * @return a new <code>SOAPMessage</code> object
+      * @exception SOAPException if a SOAP error occurs
+      * @exception UnsupportedOperationException if the protocol of this
+-     *      <code>MessageFactory</code> instance is <code>DYNAMIC_SOAP_PROTOCOL</code> 
++     *      <code>MessageFactory</code> instance is <code>DYNAMIC_SOAP_PROTOCOL</code>
+      */
+     public abstract SOAPMessage createMessage()
+         throws SOAPException;
+@@ -187,14 +187,14 @@
+      *            the input stream
+      *
+      * @exception SOAPException may be thrown if the message is invalid
+-     * 
++     *
+      * @exception IllegalArgumentException if the <code>MessageFactory</code>
+-     *      requires one or more MIME headers to be present in the 
+-     *      <code>headers</code> parameter and they are missing. 
++     *      requires one or more MIME headers to be present in the
++     *      <code>headers</code> parameter and they are missing.
+      *      <code>MessageFactory</code> implementations for
+-     *      <code>SOAP_1_1_PROTOCOL</code> or 
+-     *      <code>SOAP_1_2_PROTOCOL</code> must not throw 
+-     *      <code>IllegalArgumentException</code> for this reason.   
++     *      <code>SOAP_1_1_PROTOCOL</code> or
++     *      <code>SOAP_1_2_PROTOCOL</code> must not throw
++     *      <code>IllegalArgumentException</code> for this reason.
+      */
+     public abstract SOAPMessage createMessage(MimeHeaders headers,
+                                               InputStream in)
+--- old/src/share/classes/javax/xml/soap/MimeHeader.java	Thu Jul 30 18:52:44 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/soap/MimeHeader.java	Thu Jul 30 18:52:44 2009
+@@ -23,9 +23,9 @@
+  * have any questions.
+  */
+ /*
+- * $Id: MimeHeader.java,v 1.3 2005/04/05 20:49:48 mk125090 Exp $
+- * $Revision: 1.3 $
+- * $Date: 2005/04/05 20:49:48 $
++ * $Id: MimeHeader.java,v 1.4 2006/03/30 00:59:38 ofung Exp $
++ * $Revision: 1.4 $
++ * $Date: 2006/03/30 00:59:38 $
+  */
+ 
+ 
+@@ -35,7 +35,7 @@
+ /**
+  * An object that stores a MIME header name and its value. One or more
+  * <code>MimeHeader</code> objects may be contained in a <code>MimeHeaders</code>
+- * object.  
++ * object.
+  *
+  * @see MimeHeaders
+  */
+@@ -52,8 +52,8 @@
+     * @param value a <code>String</code> giving the value of the header
+     */
+     public MimeHeader(String name, String value) {
+-	this.name = name;
+-	this.value = value;
++        this.name = name;
++        this.value = value;
+     }
+ 
+     /**
+@@ -62,15 +62,15 @@
+      * @return the name of the header as a <code>String</code>
+      */
+     public String getName() {
+-	return name;
++        return name;
+     }
+ 
+     /**
+      * Returns the value of this <code>MimeHeader</code> object.
+      *
+-     * @return 	the value of the header as a <code>String</code>
++     * @return  the value of the header as a <code>String</code>
+      */
+     public String getValue() {
+-	return value;
++        return value;
+     }
+ }
+--- old/src/share/classes/javax/xml/soap/MimeHeaders.java	Thu Jul 30 18:52:48 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/soap/MimeHeaders.java	Thu Jul 30 18:52:47 2009
+@@ -23,9 +23,9 @@
+  * have any questions.
+  */
+ /*
+- * $Id: MimeHeaders.java,v 1.5 2005/04/05 20:49:49 mk125090 Exp $
+- * $Revision: 1.5 $
+- * $Date: 2005/04/05 20:49:49 $
++ * $Id: MimeHeaders.java,v 1.6 2006/03/30 00:59:38 ofung Exp $
++ * $Revision: 1.6 $
++ * $Date: 2006/03/30 00:59:38 $
+  */
+ 
+ 
+--- old/src/share/classes/javax/xml/soap/Name.java	Thu Jul 30 18:52:51 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/soap/Name.java	Thu Jul 30 18:52:51 2009
+@@ -23,9 +23,9 @@
+  * have any questions.
+  */
+ /*
+- * $Id: Name.java,v 1.4 2005/04/05 20:49:49 mk125090 Exp $
+- * $Revision: 1.4 $
+- * $Date: 2005/04/05 20:49:49 $
++ * $Id: Name.java,v 1.5 2006/03/30 00:59:39 ofung Exp $
++ * $Revision: 1.5 $
++ * $Date: 2006/03/30 00:59:39 $
+  */
+ 
+ 
+@@ -34,7 +34,7 @@
+ /**
+  * A representation of an XML name.  This interface provides methods for
+  * getting the local and namespace-qualified names and also for getting the
+- * prefix associated with the namespace for the name. It is also possible 
++ * prefix associated with the namespace for the name. It is also possible
+  * to get the URI of the namespace.
+  * <P>
+  * The following is an example of a namespace declaration in an element.
+@@ -42,7 +42,7 @@
+  *   &lt;wombat:GetLastTradePrice xmlns:wombat="http://www.wombat.org/trader"&gt;
+  * </PRE>
+  * ("xmlns" stands for "XML namespace".)
+- * The following 
++ * The following
+  * shows what the methods in the <code>Name</code> interface will return.
+  * <UL>
+  *  <LI><code>getQualifiedName</code> will return "prefix:LocalName" =
+@@ -58,8 +58,8 @@
+  * <code>Name</code> objects are created using the method
+  * <code>SOAPEnvelope.createName</code>, which has two versions.
+  * One method creates <code>Name</code> objects with
+- * a local name, a namespace prefix, and a namespace URI. 
+- *  and the second creates <code>Name</code> objects with just a local name.  
++ * a local name, a namespace prefix, and a namespace URI.
++ *  and the second creates <code>Name</code> objects with just a local name.
+  * The following line of
+  * code, in which <i>se</i> is a <code>SOAPEnvelope</code> object, creates a new
+  * <code>Name</code> object with all three.
+@@ -83,7 +83,7 @@
+ public interface Name {
+     /**
+      * Gets the local name part of the XML name that this <code>Name</code>
+-     * object represents. 
++     * object represents.
+      *
+      * @return a string giving the local name
+      */
+@@ -90,8 +90,8 @@
+     String getLocalName();
+ 
+     /**
+-     * Gets the namespace-qualified name of the XML name that this 
+-     * <code>Name</code> object represents. 
++     * Gets the namespace-qualified name of the XML name that this
++     * <code>Name</code> object represents.
+      *
+      * @return the namespace-qualified name as a string
+      */
+@@ -100,7 +100,7 @@
+     /**
+      * Returns the prefix that was specified when this <code>Name</code> object
+      * was initialized. This prefix is associated with the namespace for the XML
+-     * name that this <code>Name</code> object represents. 
++     * name that this <code>Name</code> object represents.
+      *
+      * @return the prefix as a string
+      */
+@@ -108,7 +108,7 @@
+ 
+     /**
+      * Returns the URI of the namespace for the XML
+-     * name that this <code>Name</code> object represents. 
++     * name that this <code>Name</code> object represents.
+      *
+      * @return the URI as a string
+      */
+--- old/src/share/classes/javax/xml/soap/Node.java	Thu Jul 30 18:52:55 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/soap/Node.java	Thu Jul 30 18:52:54 2009
+@@ -23,9 +23,9 @@
+  * have any questions.
+  */
+ /*
+- * $Id: Node.java,v 1.13 2005/04/05 20:49:49 mk125090 Exp $
+- * $Revision: 1.13 $
+- * $Date: 2005/04/05 20:49:49 $
++ * $Id: Node.java,v 1.14 2006/03/30 00:59:39 ofung Exp $
++ * $Revision: 1.14 $
++ * $Date: 2006/03/30 00:59:39 $
+  */
+ 
+ 
+@@ -33,40 +33,40 @@
+ 
+ /**
+  * A representation of a node (element) in an XML document.
+- * This interface extnends the standard DOM Node interface with methods for 
++ * This interface extnends the standard DOM Node interface with methods for
+  * getting and setting the value of a node, for
+  * getting and setting the parent of a node, and for removing a node.
+  */
+-public interface Node extends org.w3c.dom.Node {    
++public interface Node extends org.w3c.dom.Node {
+     /**
+      * Returns the value of this node if this is a <code>Text</code> node or the
+      * value of the immediate child of this node otherwise.
+-     * If there is an immediate child of this <code>Node</code> that it is a 
++     * If there is an immediate child of this <code>Node</code> that it is a
+      * <code>Text</code> node then it's value will be returned. If there is
+-     * more than one <code>Text</code> node then the value of the first 
++     * more than one <code>Text</code> node then the value of the first
+      * <code>Text</code> Node will be returned.
+      * Otherwise <code>null</code> is returned.
+      *
+      * @return a <code>String</code> with the text of this node if this is a
+-     *          <code>Text</code> node or the text contained by the first 
+-     *          immediate child of this <code>Node</code> object that is a 
++     *          <code>Text</code> node or the text contained by the first
++     *          immediate child of this <code>Node</code> object that is a
+      *          <code>Text</code> object if such a child exists;
+      *          <code>null</code> otherwise.
+      */
+     public String getValue();
+-    
++
+     /**
+-     * If this is a Text node then this method will set its value, 
++     * If this is a Text node then this method will set its value,
+      * otherwise it sets the value of  the immediate (Text) child of this node.
+      * The value of the immediate child of this node can be set only if, there is
+      * one child node and that node is a <code>Text</code> node, or if
+-     * there are no children in which case a child <code>Text</code> node will be 
++     * there are no children in which case a child <code>Text</code> node will be
+      * created.
+-     * 
++     *
+      * @exception IllegalStateException if the node is not a <code>Text</code>
+-     *              node and either has more than one child node or has a child 
++     *              node and either has more than one child node or has a child
+      *              node that is not a <code>Text</code> node.
+-     * 
++     *
+      * @since SAAJ 1.2
+      */
+     public void setValue(String value);
+--- old/src/share/classes/javax/xml/soap/SAAJMetaFactory.java	Thu Jul 30 18:52:58 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/soap/SAAJMetaFactory.java	Thu Jul 30 18:52:58 2009
+@@ -23,9 +23,9 @@
+  * have any questions.
+  */
+ /*
+- * $Id: SAAJMetaFactory.java,v 1.4 2006/03/30 00:59:39 ofung Exp $
+- * $Revision: 1.4 $
+- * $Date: 2006/03/30 00:59:39 $
++ * $Id: SAAJMetaFactory.java,v 1.5 2007/07/05 06:49:47 vj135062 Exp $
++ * $Revision: 1.5 $
++ * $Date: 2007/07/05 06:49:47 $
+  */
+ 
+ 
+@@ -33,12 +33,12 @@
+ 
+ /**
+ * The access point for the implementation classes of the factories defined in the
+-* SAAJ API. All of the <code>newInstance</code> methods defined on factories in 
+-* SAAJ 1.3 defer to instances of this class to do the actual object creation. 
++* SAAJ API. All of the <code>newInstance</code> methods defined on factories in
++* SAAJ 1.3 defer to instances of this class to do the actual object creation.
+ * The implementations of <code>newInstance()</code> methods (in SOAPFactory and MessageFactory)
+ * that existed in SAAJ 1.2 have been updated to also delegate to the SAAJMetaFactory when the SAAJ 1.2
+-* defined lookup fails to locate the Factory implementation class name. 
+-* 
++* defined lookup fails to locate the Factory implementation class name.
++*
+ * <p>
+ * SAAJMetaFactory is a service provider interface. There are no public methods on this
+ * class.
+@@ -54,19 +54,19 @@
+         "com.sun.xml.internal.messaging.saaj.soap.SAAJMetaFactoryImpl";
+ 
+     /**
+-     * Creates a new instance of a concrete <code>SAAJMetaFactory</code> object. 
+-     * The SAAJMetaFactory is an SPI, it pulls the creation of the other factories together into a 
+-     * single place. Changing out the SAAJMetaFactory has the effect of changing out the entire SAAJ 
++     * Creates a new instance of a concrete <code>SAAJMetaFactory</code> object.
++     * The SAAJMetaFactory is an SPI, it pulls the creation of the other factories together into a
++     * single place. Changing out the SAAJMetaFactory has the effect of changing out the entire SAAJ
+      * implementation. Service providers provide the name of their <code>SAAJMetaFactory</code>
+-     * implementation. 
++     * implementation.
+      *
+      * This method uses the following ordered lookup procedure to determine the SAAJMetaFactory implementation class to load:
+      * <UL>
+      *  <LI> Use the javax.xml.soap.MetaFactory system property.
+-     *  <LI> Use the properties file "lib/jaxm.properties" in the JRE directory. This configuration file is in standard 
+-     * java.util.Properties format and contains the fully qualified name of the implementation class with the key being the 
+-     * system property defined above. 
+-     *  <LI> Use the Services API (as detailed in the JAR specification), if available, to determine the classname. The Services API 
++     *  <LI> Use the properties file "lib/jaxm.properties" in the JRE directory. This configuration file is in standard
++     * java.util.Properties format and contains the fully qualified name of the implementation class with the key being the
++     * system property defined above.
++     *  <LI> Use the Services API (as detailed in the JAR specification), if available, to determine the classname. The Services API
+      * will look for a classname in the file META-INF/services/javax.xml.soap.MetaFactory in jars available to the runtime.
+      *  <LI> Default to com.sun.xml.internal.messaging.saaj.soap.SAAJMetaFactoryImpl.
+      * </UL>
+@@ -90,8 +90,8 @@
+     protected SAAJMetaFactory() { }
+ 
+      /**
+-      * Creates a <code>MessageFactory</code> object for 
+-      * the given <code>String</code> protocol. 
++      * Creates a <code>MessageFactory</code> object for
++      * the given <code>String</code> protocol.
+       *
+       * @param protocol a <code>String</code> indicating the protocol
+       * @exception SOAPException if there is an error in creating the
+@@ -104,8 +104,8 @@
+         throws SOAPException;
+ 
+      /**
+-      * Creates a <code>SOAPFactory</code> object for 
+-      * the given <code>String</code> protocol. 
++      * Creates a <code>SOAPFactory</code> object for
++      * the given <code>String</code> protocol.
+       *
+       * @param protocol a <code>String</code> indicating the protocol
+       * @exception SOAPException if there is an error in creating the
+--- old/src/share/classes/javax/xml/soap/SAAJResult.java	Thu Jul 30 18:53:02 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/soap/SAAJResult.java	Thu Jul 30 18:53:01 2009
+@@ -23,7 +23,7 @@
+  * have any questions.
+  */
+ /*
+- * $Id: SAAJResult.java,v 1.4 2006/03/24 13:05:43 vj135062 Exp $
++ * $Id: SAAJResult.java,v 1.5 2006/03/30 00:59:39 ofung Exp $
+  */
+ 
+ 
+@@ -33,101 +33,101 @@
+ import javax.xml.transform.dom.DOMResult;
+ 
+ /**
+- * Acts as a holder for the results of a JAXP transformation or a JAXB 
++ * Acts as a holder for the results of a JAXP transformation or a JAXB
+  * marshalling, in the form of a SAAJ tree. These results should be accessed
+  * by using the {@link #getResult()} method. The {@link DOMResult#getNode()}
+- * method should be avoided in almost all cases. 
++ * method should be avoided in almost all cases.
+  *
+  * @author XWS-Security Development Team
+- * 
++ *
+  * @since SAAJ 1.3
+  */
+ public class SAAJResult extends DOMResult {
+-    
++
+     /**
+      * Creates a <code>SAAJResult</code> that will present results in the form
+-     * of a SAAJ tree that supports the default (SOAP 1.1) protocol. 
++     * of a SAAJ tree that supports the default (SOAP 1.1) protocol.
+      * <p>
+-     * This kind of <code>SAAJResult</code> is meant for use in situations where the 
+-     * results will be used as a parameter to a method that takes a parameter 
+-     * whose type, such as <code>SOAPElement</code>, is drawn from the SAAJ 
+-     * API. When used in a transformation, the results are populated into the 
++     * This kind of <code>SAAJResult</code> is meant for use in situations where the
++     * results will be used as a parameter to a method that takes a parameter
++     * whose type, such as <code>SOAPElement</code>, is drawn from the SAAJ
++     * API. When used in a transformation, the results are populated into the
+      * <code>SOAPPart</code> of a <code>SOAPMessage</code> that is created internally.
+-     * The <code>SOAPPart</code> returned by {@link DOMResult#getNode()} 
++     * The <code>SOAPPart</code> returned by {@link DOMResult#getNode()}
+      * is not guaranteed to be well-formed.
+-     * 
++     *
+      * @throws SOAPException if there is a problem creating a <code>SOAPMessage</code>
+-     * 
++     *
+      * @since SAAJ 1.3
+      */
+     public SAAJResult() throws SOAPException {
+         this(MessageFactory.newInstance().createMessage());
+     }
+-    
++
+     /**
+      * Creates a <code>SAAJResult</code> that will present results in the form
+-     * of a SAAJ tree that supports the specified protocol. The 
++     * of a SAAJ tree that supports the specified protocol. The
+      * <code>DYNAMIC_SOAP_PROTOCOL</code> is ambiguous in this context and will
+-     * cause this constructor to throw an <code>UnsupportedOperationException</code>. 
++     * cause this constructor to throw an <code>UnsupportedOperationException</code>.
+      * <p>
+-     * This kind of <code>SAAJResult</code> is meant for use in situations where the 
+-     * results will be used as a parameter to a method that takes a parameter 
+-     * whose type, such as <code>SOAPElement</code>, is drawn from the SAAJ 
+-     * API. When used in a transformation the results are populated into the 
+-     * <code>SOAPPart</code> of a <code>SOAPMessage</code> that is created 
+-     * internally. The <code>SOAPPart</code> returned by {@link DOMResult#getNode()} 
++     * This kind of <code>SAAJResult</code> is meant for use in situations where the
++     * results will be used as a parameter to a method that takes a parameter
++     * whose type, such as <code>SOAPElement</code>, is drawn from the SAAJ
++     * API. When used in a transformation the results are populated into the
++     * <code>SOAPPart</code> of a <code>SOAPMessage</code> that is created
++     * internally. The <code>SOAPPart</code> returned by {@link DOMResult#getNode()}
+      * is not guaranteed to be well-formed.
+-     * 
+-     * @param protocol - the name of the SOAP protocol that the resulting SAAJ 
++     *
++     * @param protocol - the name of the SOAP protocol that the resulting SAAJ
+      *                      tree should support
+-     *  
+-     * @throws SOAPException if a <code>SOAPMessage</code> supporting the 
++     *
++     * @throws SOAPException if a <code>SOAPMessage</code> supporting the
+      *             specified protocol cannot be created
+-     * 
++     *
+      * @since SAAJ 1.3
+      */
+     public SAAJResult(String protocol) throws SOAPException {
+         this(MessageFactory.newInstance(protocol).createMessage());
+     }
+-    
++
+     /**
+      * Creates a <code>SAAJResult</code> that will write the results into the
+-     * <code>SOAPPart</code> of the supplied <code>SOAPMessage</code>. 
+-     * In the normal case these results will be written using DOM APIs and, 
+-     * as a result, the finished <code>SOAPPart</code> will not be guaranteed 
+-     * to be well-formed unless the data used to create it is also well formed. 
+-     * When used in a transformation the validity of the <code>SOAPMessage</code> 
+-     * after the transformation can be guaranteed only by means outside SAAJ 
++     * <code>SOAPPart</code> of the supplied <code>SOAPMessage</code>.
++     * In the normal case these results will be written using DOM APIs and,
++     * as a result, the finished <code>SOAPPart</code> will not be guaranteed
++     * to be well-formed unless the data used to create it is also well formed.
++     * When used in a transformation the validity of the <code>SOAPMessage</code>
++     * after the transformation can be guaranteed only by means outside SAAJ
+      * specification.
+      *
+-     * @param message - the message whose <code>SOAPPart</code> will be 
+-     *                  populated as a result of some transformation or 
++     * @param message - the message whose <code>SOAPPart</code> will be
++     *                  populated as a result of some transformation or
+      *                  marshalling operation
+-     * 
++     *
+      * @since SAAJ 1.3
+      */
+     public SAAJResult(SOAPMessage message) {
+         super(message.getSOAPPart());
+     }
+-    
++
+     /**
+-     * Creates a <code>SAAJResult</code> that will write the results as a 
++     * Creates a <code>SAAJResult</code> that will write the results as a
+      * child node of the <code>SOAPElement</code> specified. In the normal
+      * case these results will be written using DOM APIs and as a result may
+-     * invalidate the structure of the SAAJ tree. This kind of 
++     * invalidate the structure of the SAAJ tree. This kind of
+      * <code>SAAJResult</code> should only be used when the validity of the
+-     * incoming data can be guaranteed by means outside of the SAAJ 
++     * incoming data can be guaranteed by means outside of the SAAJ
+      * specification.
+-     * 
++     *
+      * @param rootNode - the root to which the results will be appended
+-     * 
++     *
+      * @since SAAJ 1.3
+      */
+     public SAAJResult(SOAPElement rootNode) {
+         super(rootNode);
+     }
+-    
+-  
++
++
+     /**
+      * @return the resulting Tree that was created under the specified root Node.
+      * @since SAAJ 1.3
+@@ -134,5 +134,5 @@
+      */
+     public javax.xml.soap.Node getResult() {
+         return (javax.xml.soap.Node)super.getNode().getFirstChild();
+-     } 
++     }
+ }
+--- old/src/share/classes/javax/xml/soap/SOAPBody.java	Thu Jul 30 18:53:05 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/soap/SOAPBody.java	Thu Jul 30 18:53:05 2009
+@@ -23,9 +23,9 @@
+  * have any questions.
+  */
+ /*
+- * $Id: SOAPBody.java,v 1.17 2005/06/22 10:24:11 vj135062 Exp $
+- * $Revision: 1.17 $
+- * $Date: 2005/06/22 10:24:11 $
++ * $Id: SOAPBody.java,v 1.18 2006/03/30 00:59:39 ofung Exp $
++ * $Revision: 1.18 $
++ * $Date: 2006/03/30 00:59:39 $
+  */
+ 
+ 
+@@ -54,10 +54,10 @@
+     /**
+      * Creates a new <code>SOAPFault</code> object and adds it to
+      * this <code>SOAPBody</code> object. The new <code>SOAPFault</code> will
+-     * have default values set for the mandatory child elements. The type of 
+-     * the <code>SOAPFault</code> will be a SOAP 1.1 or a SOAP 1.2 <code>SOAPFault</code> 
+-     * depending on the <code>protocol</code> specified while creating the 
+-     * <code>MessageFactory</code> instance. 
++     * have default values set for the mandatory child elements. The type of
++     * the <code>SOAPFault</code> will be a SOAP 1.1 or a SOAP 1.2 <code>SOAPFault</code>
++     * depending on the <code>protocol</code> specified while creating the
++     * <code>MessageFactory</code> instance.
+      * <p>
+      * A <code>SOAPBody</code> may contain at most one <code>SOAPFault</code>
+      * child element.
+@@ -70,28 +70,28 @@
+ 
+     /**
+      * Creates a new <code>SOAPFault</code> object and adds it to
+-     * this <code>SOAPBody</code> object. The type of the 
+-     * <code>SOAPFault</code> will be a SOAP 1.1  or a SOAP 1.2 
++     * this <code>SOAPBody</code> object. The type of the
++     * <code>SOAPFault</code> will be a SOAP 1.1  or a SOAP 1.2
+      * <code>SOAPFault</code> depending on the <code>protocol</code>
+      * specified while creating the <code>MessageFactory</code> instance.
+      * <p>
+-     * For SOAP 1.2 the <code>faultCode</code> parameter is the value of the 
+-     * <i>Fault/Code/Value</i> element  and the <code>faultString</code> parameter 
+-     * is the value of the <i>Fault/Reason/Text</i> element. For SOAP 1.1 
+-     * the <code>faultCode</code> parameter is the value of the <code>faultcode</code> 
+-     * element and the <code>faultString</code> parameter is the value of the <code>faultstring</code> 
+-     * element. 
++     * For SOAP 1.2 the <code>faultCode</code> parameter is the value of the
++     * <i>Fault/Code/Value</i> element  and the <code>faultString</code> parameter
++     * is the value of the <i>Fault/Reason/Text</i> element. For SOAP 1.1
++     * the <code>faultCode</code> parameter is the value of the <code>faultcode</code>
++     * element and the <code>faultString</code> parameter is the value of the <code>faultstring</code>
++     * element.
+      * <p>
+      * A <code>SOAPBody</code> may contain at most one <code>SOAPFault</code>
+-     * child element. 
++     * child element.
+      *
+      * @param faultCode a <code>Name</code> object giving the fault
+-     *         code to be set; must be one of the fault codes defined in the Version 
++     *         code to be set; must be one of the fault codes defined in the Version
+      *         of SOAP specification in use
+      * @param faultString a <code>String</code> giving an explanation of
+      *         the fault
+      * @param locale a {@link java.util.Locale} object indicating
+-     *         the native language of the <code>faultString</code> 
++     *         the native language of the <code>faultString</code>
+      * @return the new <code>SOAPFault</code> object
+      * @exception SOAPException if there is a SOAP error
+      * @see SOAPFault#setFaultCode
+@@ -101,22 +101,22 @@
+     public SOAPFault addFault(Name faultCode, String faultString, Locale locale) throws SOAPException;
+ 
+     /**
+-     * Creates a new <code>SOAPFault</code> object and adds it to this 
+-     * <code>SOAPBody</code> object. The type of the <code>SOAPFault</code> 
+-     * will be a SOAP 1.1 or a SOAP 1.2 <code>SOAPFault</code> depending on 
+-     * the <code>protocol</code> specified while creating the <code>MessageFactory</code> 
++     * Creates a new <code>SOAPFault</code> object and adds it to this
++     * <code>SOAPBody</code> object. The type of the <code>SOAPFault</code>
++     * will be a SOAP 1.1 or a SOAP 1.2 <code>SOAPFault</code> depending on
++     * the <code>protocol</code> specified while creating the <code>MessageFactory</code>
+      * instance.
+      * <p>
+-     * For SOAP 1.2 the <code>faultCode</code> parameter is the value of the 
+-     * <i>Fault/Code/Value</i> element  and the <code>faultString</code> parameter 
+-     * is the value of the <i>Fault/Reason/Text</i> element. For SOAP 1.1 
+-     * the <code>faultCode</code> parameter is the value of the <code>faultcode</code> 
+-     * element and the <code>faultString</code> parameter is the value of the <code>faultstring</code> 
+-     * element. 
++     * For SOAP 1.2 the <code>faultCode</code> parameter is the value of the
++     * <i>Fault/Code/Value</i> element  and the <code>faultString</code> parameter
++     * is the value of the <i>Fault/Reason/Text</i> element. For SOAP 1.1
++     * the <code>faultCode</code> parameter is the value of the <code>faultcode</code>
++     * element and the <code>faultString</code> parameter is the value of the <code>faultstring</code>
++     * element.
+      * <p>
+      * A <code>SOAPBody</code> may contain at most one <code>SOAPFault</code>
+      * child element.
+-     * 
++     *
+      * @param faultCode
+      *            a <code>QName</code> object giving the fault code to be
+      *            set; must be one of the fault codes defined in the version
+@@ -132,7 +132,7 @@
+      * @see SOAPFault#setFaultCode
+      * @see SOAPFault#setFaultString
+      * @see SOAPBody#addFault(Name faultCode, String faultString, Locale locale)
+-     * 
++     *
+      * @since SAAJ 1.3
+      */
+     public SOAPFault addFault(QName faultCode, String faultString, Locale locale)
+@@ -139,26 +139,26 @@
+         throws SOAPException;
+ 
+     /**
+-     * Creates a new  <code>SOAPFault</code> object and adds it to this 
++     * Creates a new  <code>SOAPFault</code> object and adds it to this
+      * <code>SOAPBody</code> object. The type of the <code>SOAPFault</code>
+      * will be a SOAP 1.1 or a SOAP 1.2 <code>SOAPFault</code> depending on
+      * the <code>protocol</code> specified while creating the <code>MessageFactory</code>
+      * instance.
+      * <p>
+-     * For SOAP 1.2 the <code>faultCode</code> parameter is the value of the 
+-     * <i>Fault/Code/Value</i> element  and the <code>faultString</code> parameter 
+-     * is the value of the <i>Fault/Reason/Text</i> element. For SOAP 1.1 
+-     * the <code>faultCode</code> parameter is the value of the <i>faultcode</i> 
+-     * element and the <code>faultString</code> parameter is the value of the <i>faultstring</i> 
+-     * element. 
++     * For SOAP 1.2 the <code>faultCode</code> parameter is the value of the
++     * <i>Fault/Code/Value</i> element  and the <code>faultString</code> parameter
++     * is the value of the <i>Fault/Reason/Text</i> element. For SOAP 1.1
++     * the <code>faultCode</code> parameter is the value of the <i>faultcode</i>
++     * element and the <code>faultString</code> parameter is the value of the <i>faultstring</i>
++     * element.
+      * <p>
+-     * In case of a SOAP 1.2 fault, the default value for the mandatory <code>xml:lang</code> 
++     * In case of a SOAP 1.2 fault, the default value for the mandatory <code>xml:lang</code>
+      * attribute on the <i>Fault/Reason/Text</i> element will be set to
+      * <code>java.util.Locale.getDefault()</code>
+      * <p>
+      * A <code>SOAPBody</code> may contain at most one <code>SOAPFault</code>
+      * child element.
+-     * 
++     *
+      * @param faultCode
+      *            a <code>Name</code> object giving the fault code to be set;
+      *            must be one of the fault codes defined in the version of SOAP
+@@ -182,23 +182,23 @@
+      * the <code>protocol</code> specified while creating the <code>MessageFactory</code>
+      * instance.
+      * <p>
+-     * For SOAP 1.2 the <code>faultCode</code> parameter is the value of the 
+-     * <i>Fault/Code/Value</i> element  and the <code>faultString</code> parameter 
+-     * is the value of the <i>Fault/Reason/Text</i> element. For SOAP 1.1 
+-     * the <code>faultCode</code> parameter is the value of the <i>faultcode</i> 
+-     * element and the <code>faultString</code> parameter is the value of the <i>faultstring</i> 
+-     * element. 
++     * For SOAP 1.2 the <code>faultCode</code> parameter is the value of the
++     * <i>Fault/Code/Value</i> element  and the <code>faultString</code> parameter
++     * is the value of the <i>Fault/Reason/Text</i> element. For SOAP 1.1
++     * the <code>faultCode</code> parameter is the value of the <i>faultcode</i>
++     * element and the <code>faultString</code> parameter is the value of the <i>faultstring</i>
++     * element.
+      * <p>
+-     * In case of a SOAP 1.2 fault, the default value for the mandatory <code>xml:lang</code> 
++     * In case of a SOAP 1.2 fault, the default value for the mandatory <code>xml:lang</code>
+      * attribute on the <i>Fault/Reason/Text</i> element will be set to
+      * <code>java.util.Locale.getDefault()</code>
+      * <p>
+      * A <code>SOAPBody</code> may contain at most one <code>SOAPFault</code>
+      * child element
+-     * 
++     *
+      * @param faultCode
+      *            a <code>QName</code> object giving the fault code to be
+-     *            set; must be one of the fault codes defined in the version 
++     *            set; must be one of the fault codes defined in the version
+      *            of  SOAP specification in use
+      * @param faultString
+      *            a <code>String</code> giving an explanation of the fault
+@@ -216,7 +216,7 @@
+     /**
+      * Indicates whether a <code>SOAPFault</code> object exists in this
+      * <code>SOAPBody</code> object.
+-     * 
++     *
+      * @return <code>true</code> if a <code>SOAPFault</code> object exists
+      *         in this <code>SOAPBody</code> object; <code>false</code>
+      *         otherwise
+@@ -226,7 +226,7 @@
+     /**
+      * Returns the <code>SOAPFault</code> object in this <code>SOAPBody</code>
+      * object.
+-     * 
++     *
+      * @return the <code>SOAPFault</code> object in this <code>SOAPBody</code>
+      *         object if present, null otherwise.
+      */
+@@ -235,7 +235,7 @@
+     /**
+      * Creates a new <code>SOAPBodyElement</code> object with the specified
+      * name and adds it to this <code>SOAPBody</code> object.
+-     * 
++     *
+      * @param name
+      *            a <code>Name</code> object with the name for the new <code>SOAPBodyElement</code>
+      *            object
+@@ -250,7 +250,7 @@
+     /**
+      * Creates a new <code>SOAPBodyElement</code> object with the specified
+      * QName and adds it to this <code>SOAPBody</code> object.
+-     * 
++     *
+      * @param qname
+      *            a <code>QName</code> object with the qname for the new
+      *            <code>SOAPBodyElement</code> object
+@@ -270,7 +270,7 @@
+      * The client application should discard all references to this <code>Document</code>
+      * and its contents upon calling <code>addDocument</code>. The behavior
+      * of an application that continues to use such references is undefined.
+-     * 
++     *
+      * @param document
+      *            the <code>Document</code> object whose root node will be
+      *            added to this <code>SOAPBody</code>.
+@@ -288,14 +288,14 @@
+      * the first child of this <code>SOAPBody</code> as it's document
+      * element. The child <code>SOAPElement</code> is removed as part of the
+      * process.
+-     * 
++     *
+      * @return the <code>{@link org.w3c.dom.Document}</code> representation
+      *         of the <code>SOAPBody</code> content.
+-     * 
++     *
+      * @exception SOAPException
+      *                if there is not exactly one child <code>SOAPElement</code> of the <code>
+      *              <code>SOAPBody</code>.
+-     * 
++     *
+      * @since SAAJ 1.3
+      */
+     public org.w3c.dom.Document extractContentAsDocument()
+--- old/src/share/classes/javax/xml/soap/SOAPBodyElement.java	Thu Jul 30 18:53:09 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/soap/SOAPBodyElement.java	Thu Jul 30 18:53:08 2009
+@@ -23,9 +23,9 @@
+  * have any questions.
+  */
+ /*
+- * $Id: SOAPBodyElement.java,v 1.3 2005/04/05 22:28:13 mk125090 Exp $
+- * $Revision: 1.3 $
+- * $Date: 2005/04/05 22:28:13 $
++ * $Id: SOAPBodyElement.java,v 1.4 2006/03/30 00:59:40 ofung Exp $
++ * $Revision: 1.4 $
++ * $Date: 2006/03/30 00:59:40 $
+  */
+ 
+ 
+@@ -32,7 +32,7 @@
+ package javax.xml.soap;
+ 
+ /**
+- * A <code>SOAPBodyElement</code> object represents the contents in 
++ * A <code>SOAPBodyElement</code> object represents the contents in
+  * a <code>SOAPBody</code> object.  The <code>SOAPFault</code> interface
+  * is a <code>SOAPBodyElement</code> object that has been defined.
+  * <P>
+@@ -39,7 +39,7 @@
+  * A new <code>SOAPBodyElement</code> object can be created and added
+  * to a <code>SOAPBody</code> object with the <code>SOAPBody</code>
+  * method <code>addBodyElement</code>. In the following line of code,
+- * <code>sb</code> is a <code>SOAPBody</code> object, and 
++ * <code>sb</code> is a <code>SOAPBody</code> object, and
+  * <code>myName</code> is a <code>Name</code> object.
+  * <PRE>
+  *    SOAPBodyElement sbe = sb.addBodyElement(myName);
+--- old/src/share/classes/javax/xml/soap/SOAPConnection.java	Thu Jul 30 18:53:13 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/soap/SOAPConnection.java	Thu Jul 30 18:53:12 2009
+@@ -23,9 +23,9 @@
+  * have any questions.
+  */
+ /*
+- * $Id: SOAPConnection.java,v 1.12 2005/04/05 21:03:23 mk125090 Exp $
+- * $Revision: 1.12 $
+- * $Date: 2005/04/05 21:03:23 $
++ * $Id: SOAPConnection.java,v 1.13 2006/03/30 00:59:40 ofung Exp $
++ * $Revision: 1.13 $
++ * $Date: 2006/03/30 00:59:40 $
+  */
+ 
+ 
+@@ -90,12 +90,12 @@
+                                 throws SOAPException {
+         throw new UnsupportedOperationException("All subclasses of SOAPConnection must override get()");
+     }
+-    
++
+     /**
+      * Closes this <code>SOAPConnection</code> object.
+      *
+      * @throws SOAPException if there is a SOAP error
+      */
+-    public abstract void close() 
+-        throws SOAPException; 
++    public abstract void close()
++        throws SOAPException;
+ }
+--- old/src/share/classes/javax/xml/soap/SOAPConnectionFactory.java	Thu Jul 30 18:53:16 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/soap/SOAPConnectionFactory.java	Thu Jul 30 18:53:16 2009
+@@ -23,9 +23,9 @@
+  * have any questions.
+  */
+ /*
+- * $Id: SOAPConnectionFactory.java,v 1.5 2005/04/05 21:03:23 mk125090 Exp $
+- * $Revision: 1.5 $
+- * $Date: 2005/04/05 21:03:23 $
++ * $Id: SOAPConnectionFactory.java,v 1.6 2006/03/30 00:59:40 ofung Exp $
++ * $Revision: 1.6 $
++ * $Date: 2006/03/30 00:59:40 $
+  */
+ 
+ 
+@@ -33,7 +33,7 @@
+ 
+ /**
+  * A factory for creating <code>SOAPConnection</code> objects. Implementation of this class
+- * is optional. If <code>SOAPConnectionFactory.newInstance()</code> throws an 
++ * is optional. If <code>SOAPConnectionFactory.newInstance()</code> throws an
+  * UnsupportedOperationException then the implementation does not support the
+  * SAAJ communication infrastructure. Otherwise {@link SOAPConnection} objects
+  * can be created by calling <code>createConnection()</code> on the newly
+@@ -90,4 +90,3 @@
+     public abstract SOAPConnection createConnection()
+         throws SOAPException;
+ }
+-
+--- old/src/share/classes/javax/xml/soap/SOAPConstants.java	Thu Jul 30 18:53:20 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/soap/SOAPConstants.java	Thu Jul 30 18:53:19 2009
+@@ -22,10 +22,10 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-/* 
+- * $Id: SOAPConstants.java,v 1.12 2005/04/05 22:28:13 mk125090 Exp $
+- * $Revision: 1.12 $
+- * $Date: 2005/04/05 22:28:13 $
++/*
++ * $Id: SOAPConstants.java,v 1.13 2006/03/30 00:59:40 ofung Exp $
++ * $Revision: 1.13 $
++ * $Date: 2006/03/30 00:59:40 $
+  */
+ 
+ 
+@@ -34,7 +34,7 @@
+ import javax.xml.namespace.QName;
+ 
+ /**
+- * The definition of constants pertaining to the SOAP protocol. 
++ * The definition of constants pertaining to the SOAP protocol.
+  */
+ public interface SOAPConstants {
+     /**
+@@ -80,16 +80,16 @@
+      * @since SAAJ 1.3
+      */
+     public static final String
+-		URI_NS_SOAP_1_1_ENVELOPE = "http://schemas.xmlsoap.org/soap/envelope/";
++                URI_NS_SOAP_1_1_ENVELOPE = "http://schemas.xmlsoap.org/soap/envelope/";
+     /**
+      * The namespace identifier for the SOAP 1.2 envelope.
+      * @since SAAJ 1.3
+      */
+     public static final String
+-		URI_NS_SOAP_1_2_ENVELOPE = "http://www.w3.org/2003/05/soap-envelope";
++                URI_NS_SOAP_1_2_ENVELOPE = "http://www.w3.org/2003/05/soap-envelope";
+ 
+     /**
+-     * The namespace identifier for the SOAP 1.1 envelope, All SOAPElements in this 
++     * The namespace identifier for the SOAP 1.1 envelope, All SOAPElements in this
+      * namespace are defined by the SOAP 1.1 specification.
+      */
+     public static final String
+@@ -175,7 +175,7 @@
+      */
+     public static final QName SOAP_VERSIONMISMATCH_FAULT =
+          new QName(URI_NS_SOAP_1_2_ENVELOPE, "VersionMismatch", SOAP_ENV_PREFIX);
+-                                                                                                                  
++
+     /**
+      * SOAP 1.2 MustUnderstand Fault
+      * @since SAAJ 1.3
+@@ -182,7 +182,7 @@
+      */
+     public static final QName SOAP_MUSTUNDERSTAND_FAULT =
+          new QName(URI_NS_SOAP_1_2_ENVELOPE, "MustUnderstand", SOAP_ENV_PREFIX);
+-                                                                                                                  
++
+     /**
+      * SOAP 1.2 DataEncodingUnknown Fault
+      * @since SAAJ 1.3
+@@ -189,7 +189,7 @@
+      */
+     public static final QName SOAP_DATAENCODINGUNKNOWN_FAULT =
+          new QName(URI_NS_SOAP_1_2_ENVELOPE, "DataEncodingUnknown", SOAP_ENV_PREFIX);
+-                                                                                                                  
++
+     /**
+      * SOAP 1.2 Sender Fault
+      * @since SAAJ 1.3
+@@ -196,7 +196,7 @@
+      */
+     public static final QName SOAP_SENDER_FAULT =
+          new QName(URI_NS_SOAP_1_2_ENVELOPE, "Sender", SOAP_ENV_PREFIX);
+-                                                                                                                  
++
+     /**
+      * SOAP 1.2 Receiver Fault
+      * @since SAAJ 1.3
+@@ -203,5 +203,5 @@
+      */
+     public static final QName SOAP_RECEIVER_FAULT =
+          new QName(URI_NS_SOAP_1_2_ENVELOPE, "Receiver", SOAP_ENV_PREFIX);
+-                                                                                                                  
++
+ }
+--- old/src/share/classes/javax/xml/soap/SOAPElement.java	Thu Jul 30 18:53:23 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/soap/SOAPElement.java	Thu Jul 30 18:53:23 2009
+@@ -23,9 +23,9 @@
+  * have any questions.
+  */
+ /*
+- * $Id: SOAPElement.java,v 1.19 2005/12/13 09:20:25 vj135062 Exp $
+- * $Revision: 1.19 $
+- * $Date: 2005/12/13 09:20:25 $
++ * $Id: SOAPElement.java,v 1.20 2006/03/30 00:59:40 ofung Exp $
++ * $Revision: 1.20 $
++ * $Date: 2006/03/30 00:59:40 $
+  */
+ 
+ 
+@@ -43,7 +43,7 @@
+  * <p>
+  * Methods in this interface that are required to return SAAJ specific objects
+  * may "silently" replace nodes in the tree as required to successfully return
+- * objects of the correct type. See {@link #getChildElements()} and 
++ * objects of the correct type. See {@link #getChildElements()} and
+  * {@link <a HREF="package-summary.html#package_description">javax.xml.soap<a>}
+  * for details.
+  */
+@@ -54,7 +54,7 @@
+      * given <code>Name</code> object and adds the new element to this
+      * <code>SOAPElement</code> object.
+      * <P>
+-     * This method may be deprecated in a future release of SAAJ in favor of 
++     * This method may be deprecated in a future release of SAAJ in favor of
+      * addChildElement(javax.xml.namespace.QName)
+      *
+      * @param name a <code>Name</code> object with the XML name for the
+@@ -68,11 +68,11 @@
+     public SOAPElement addChildElement(Name name) throws SOAPException;
+ 
+     /**
+-     * Creates a new <code>SOAPElement</code> object initialized with the given 
++     * Creates a new <code>SOAPElement</code> object initialized with the given
+      * <code>QName</code> object and adds the new element to this <code>SOAPElement</code>
+-     *  object. The  <i>namespace</i>, <i>localname</i> and <i>prefix</i> of the new 
++     *  object. The  <i>namespace</i>, <i>localname</i> and <i>prefix</i> of the new
+      * <code>SOAPElement</code> are all taken  from the <code>qname</code> argument.
+-     * 
++     *
+      * @param qname a <code>QName</code> object with the XML name for the
+      *        new element
+      *
+@@ -87,7 +87,7 @@
+     /**
+      * Creates a new <code>SOAPElement</code> object initialized with the
+      * specified local name and adds the new element to this
+-     * <code>SOAPElement</code> object.  
++     * <code>SOAPElement</code> object.
+      * The new  <code>SOAPElement</code> inherits any in-scope default namespace.
+      *
+      * @param localName a <code>String</code> giving the local name for
+@@ -102,7 +102,7 @@
+      * Creates a new <code>SOAPElement</code> object initialized with the
+      * specified local name and prefix and adds the new element to this
+      * <code>SOAPElement</code> object.
+-     * 
++     *
+      * @param localName a <code>String</code> giving the local name for
+      *        the new element
+      * @param prefix a <code>String</code> giving the namespace prefix for
+@@ -173,12 +173,12 @@
+     /**
+      * Detaches all children of this <code>SOAPElement</code>.
+      * <p>
+-     * This method is useful for rolling back the construction of partially 
+-     * completed <code>SOAPHeaders</code> and <code>SOAPBodys</code> in 
+-     * preparation for sending a fault when an error condition is detected. It 
+-     * is also useful for recycling portions of a document within a SOAP 
++     * This method is useful for rolling back the construction of partially
++     * completed <code>SOAPHeaders</code> and <code>SOAPBodys</code> in
++     * preparation for sending a fault when an error condition is detected. It
++     * is also useful for recycling portions of a document within a SOAP
+      * message.
+-     * 
++     *
+      * @since SAAJ 1.2
+      */
+     public abstract void removeContents();
+@@ -193,7 +193,7 @@
+      *         the new <code>Text</code> object was inserted
+      * @exception SOAPException if there is an error in creating the
+      *                    new <code>Text</code> object or if it is not legal to
+-     *                      attach it as a child to this 
++     *                      attach it as a child to this
+      *                      <code>SOAPElement</code>
+      */
+     public SOAPElement addTextNode(String text) throws SOAPException;
+@@ -208,8 +208,8 @@
+      *         inserted
+      *
+      * @exception SOAPException if there is an error in creating the
+-     *                          Attribute, or it is invalid to set 
+-                                an attribute with <code>Name</code> 
++     *                          Attribute, or it is invalid to set
++                                an attribute with <code>Name</code>
+                                  <code>name</code> on this SOAPElement.
+      * @see SOAPElement#addAttribute(javax.xml.namespace.QName, String)
+      */
+@@ -227,7 +227,7 @@
+      *
+      * @exception SOAPException if there is an error in creating the
+      *                          Attribute, or it is invalid to set
+-                                an attribute with <code>QName</code> 
++                                an attribute with <code>QName</code>
+                                 <code>qname</code> on this SOAPElement.
+      * @see SOAPElement#addAttribute(Name, String)
+      * @since SAAJ 1.3
+@@ -259,7 +259,7 @@
+      * @see SOAPElement#getAttributeValue(javax.xml.namespace.QName)
+      */
+     public String getAttributeValue(Name name);
+-    
++
+     /**
+      * Returns the value of the attribute with the specified qname.
+      *
+@@ -272,7 +272,7 @@
+     public String getAttributeValue(QName qname);
+ 
+     /**
+-     * Returns an <code>Iterator</code> over all of the attribute 
++     * Returns an <code>Iterator</code> over all of the attribute
+      * <code>Name</code> objects in this
+      * <code>SOAPElement</code> object. The iterator can be used to get
+      * the attribute names, which can then be passed to the method
+@@ -286,9 +286,9 @@
+ 
+     /**
+      * Returns an <code>Iterator</code> over all of the attributes
+-     * in this <code>SOAPElement</code>  as <code>QName</code> objects. 
+-     * The iterator can be used to get the attribute QName, which can then 
+-     * be passed to the method <code>getAttributeValue</code> to retrieve 
++     * in this <code>SOAPElement</code>  as <code>QName</code> objects.
++     * The iterator can be used to get the attribute QName, which can then
++     * be passed to the method <code>getAttributeValue</code> to retrieve
+      * the value of each attribute.
+      *
+      * @return an iterator over the QNames of the attributes
+@@ -297,12 +297,12 @@
+      */
+     public Iterator getAllAttributesAsQNames();
+ 
+-    
++
+     /**
+      * Returns the URI of the namespace that has the given prefix.
+      *
+      * @param prefix a <code>String</code> giving the prefix of the namespace
+-     *        for which to search 
++     *        for which to search
+      * @return a <code>String</code> with the uri of the namespace that has
+      *        the given prefix
+      */
+@@ -327,34 +327,34 @@
+      *
+      * @return an iterator over the namespace prefixes are within scope of this
+      *         <code>SOAPElement</code> object
+-     * 
++     *
+      * @since SAAJ 1.2
+      */
+     public Iterator getVisibleNamespacePrefixes();
+-    
++
+     /**
+      * Creates a <code>QName</code> whose namespace URI is the one associated
+      * with the parameter, <code>prefix</code>, in the context of this
+-     * <code>SOAPElement</code>. The remaining elements of the new 
+-     * <code>QName</code> are taken directly from the parameters, 
+-     * <code>localName</code> and <code>prefix</code>. 
+-     * 
++     * <code>SOAPElement</code>. The remaining elements of the new
++     * <code>QName</code> are taken directly from the parameters,
++     * <code>localName</code> and <code>prefix</code>.
++     *
+      * @param localName
+      *          a <code>String</code> containing the local part of the name.
+      * @param prefix
+      *          a <code>String</code> containing the prefix for the name.
+-     * 
++     *
+      * @return a <code>QName</code> with the specified <code>localName</code>
+      *          and <code>prefix</code>, and with a namespace that is associated
+-     *          with the <code>prefix</code> in the context of this 
++     *          with the <code>prefix</code> in the context of this
+      *          <code>SOAPElement</code>. This namespace will be the same as
+-     *          the one that would be returned by 
+-     *          <code>{@link #getNamespaceURI(String)}</code> if it were given 
++     *          the one that would be returned by
++     *          <code>{@link #getNamespaceURI(String)}</code> if it were given
+      *          <code>prefix</code> as it's parameter.
+-     * 
++     *
+      * @exception SOAPException if the <code>QName</code> cannot be created.
+-     * 
+-     * @since SAAJ 1.3 
++     *
++     * @since SAAJ 1.3
+      */
+     public QName createQName(String localName, String prefix)
+         throws SOAPException;
+@@ -365,7 +365,7 @@
+      *         <code>SOAPElement</code> object
+      */
+     public Name getElementName();
+-    
++
+     /**
+      * Returns the qname of this <code>SOAPElement</code> object.
+      *
+@@ -377,25 +377,25 @@
+     public QName getElementQName();
+ 
+     /**
+-    * Changes the name of this <code>Element</code> to <code>newName</code> if 
+-    * possible. SOAP Defined elements such as SOAPEnvelope, SOAPHeader, SOAPBody 
+-    * etc. cannot have their names changed using this method. Any attempt to do 
++    * Changes the name of this <code>Element</code> to <code>newName</code> if
++    * possible. SOAP Defined elements such as SOAPEnvelope, SOAPHeader, SOAPBody
++    * etc. cannot have their names changed using this method. Any attempt to do
+     * so will result in a  SOAPException being thrown.
+     *<P>
+-    * Callers should not rely on the element instance being renamed as is. 
+-    * Implementations could end up copying the content of the 
++    * Callers should not rely on the element instance being renamed as is.
++    * Implementations could end up copying the content of the
+     * <code>SOAPElement</code> to a renamed instance.
+-    * 
++    *
+     * @param newName the new name for the <code>Element</code>.
+-    * 
++    *
+     * @exception SOAPException if changing the name of this <code>Element</code>
+     *                          is not allowed.
+     * @return The renamed Node
+-    * 
++    *
+     * @since SAAJ 1.3
+     */
+    public SOAPElement setElementQName(QName newName) throws SOAPException;
+-    
++
+    /**
+      * Removes the attribute with the specified name.
+      *
+@@ -434,14 +434,14 @@
+      * {@link Node}s of this element. This includes <code>javax.xml.soap.Text</code>
+      * objects as well as <code>SOAPElement</code> objects.
+      * <p>
+-     * Calling this method may cause child <code>Element</code>, 
+-     * <code>SOAPElement</code> and <code>org.w3c.dom.Text</code> nodes to be 
+-     * replaced by <code>SOAPElement</code>, <code>SOAPHeaderElement</code>, 
++     * Calling this method may cause child <code>Element</code>,
++     * <code>SOAPElement</code> and <code>org.w3c.dom.Text</code> nodes to be
++     * replaced by <code>SOAPElement</code>, <code>SOAPHeaderElement</code>,
+      * <code>SOAPBodyElement</code> or <code>javax.xml.soap.Text</code> nodes as
+-     * appropriate for the type of this parent node. As a result the calling 
+-     * application must treat any existing references to these child nodes that 
++     * appropriate for the type of this parent node. As a result the calling
++     * application must treat any existing references to these child nodes that
+      * have been obtained through DOM APIs as invalid and either discard them or
+-     * refresh them with the values returned by this <code>Iterator</code>. This 
++     * refresh them with the values returned by this <code>Iterator</code>. This
+      * behavior can be avoided by calling the equivalent DOM APIs. See
+      * {@link <a HREF="package-summary.html#package_description">javax.xml.soap<a>}
+      * for more details.
+@@ -453,21 +453,21 @@
+ 
+     /**
+      * Returns an <code>Iterator</code> over all the immediate child
+-     * {@link Node}s of this element with the specified name. All of these 
++     * {@link Node}s of this element with the specified name. All of these
+      * children will be <code>SOAPElement</code> nodes.
+      * <p>
+-     * Calling this method may cause child <code>Element</code>, 
+-     * <code>SOAPElement</code> and <code>org.w3c.dom.Text</code> nodes to be 
+-     * replaced by <code>SOAPElement</code>, <code>SOAPHeaderElement</code>, 
++     * Calling this method may cause child <code>Element</code>,
++     * <code>SOAPElement</code> and <code>org.w3c.dom.Text</code> nodes to be
++     * replaced by <code>SOAPElement</code>, <code>SOAPHeaderElement</code>,
+      * <code>SOAPBodyElement</code> or <code>javax.xml.soap.Text</code> nodes as
+-     * appropriate for the type of this parent node. As a result the calling 
+-     * application must treat any existing references to these child nodes that 
++     * appropriate for the type of this parent node. As a result the calling
++     * application must treat any existing references to these child nodes that
+      * have been obtained through DOM APIs as invalid and either discard them or
+-     * refresh them with the values returned by this <code>Iterator</code>. This 
++     * refresh them with the values returned by this <code>Iterator</code>. This
+      * behavior can be avoided by calling the equivalent DOM APIs. See
+      * {@link <a HREF="package-summary.html#package_description">javax.xml.soap<a>}
+      * for more details.
+-     * 
++     *
+      * @param name a <code>Name</code> object with the name of the child
+      *        elements to be returned
+      *
+@@ -480,21 +480,21 @@
+ 
+     /**
+      * Returns an <code>Iterator</code> over all the immediate child
+-     * {@link Node}s of this element with the specified qname. All of these 
++     * {@link Node}s of this element with the specified qname. All of these
+      * children will be <code>SOAPElement</code> nodes.
+      * <p>
+-     * Calling this method may cause child <code>Element</code>, 
+-     * <code>SOAPElement</code> and <code>org.w3c.dom.Text</code> nodes to be 
+-     * replaced by <code>SOAPElement</code>, <code>SOAPHeaderElement</code>, 
++     * Calling this method may cause child <code>Element</code>,
++     * <code>SOAPElement</code> and <code>org.w3c.dom.Text</code> nodes to be
++     * replaced by <code>SOAPElement</code>, <code>SOAPHeaderElement</code>,
+      * <code>SOAPBodyElement</code> or <code>javax.xml.soap.Text</code> nodes as
+-     * appropriate for the type of this parent node. As a result the calling 
+-     * application must treat any existing references to these child nodes that 
++     * appropriate for the type of this parent node. As a result the calling
++     * application must treat any existing references to these child nodes that
+      * have been obtained through DOM APIs as invalid and either discard them or
+-     * refresh them with the values returned by this <code>Iterator</code>. This 
++     * refresh them with the values returned by this <code>Iterator</code>. This
+      * behavior can be avoided by calling the equivalent DOM APIs. See
+      * {@link <a HREF="package-summary.html#package_description">javax.xml.soap<a>}
+      * for more details.
+-     * 
++     *
+      * @param qname a <code>QName</code> object with the qname of the child
+      *        elements to be returned
+      *
+@@ -502,7 +502,7 @@
+      *         in this <code>SOAPElement</code> object with the
+      *         specified qname
+      * @see SOAPElement#getChildElements(Name)
+-     * @since SAAJ 1.3     
++     * @since SAAJ 1.3
+      */
+     public Iterator getChildElements(QName qname);
+ 
+--- old/src/share/classes/javax/xml/soap/SOAPElementFactory.java	Thu Jul 30 18:53:27 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/soap/SOAPElementFactory.java	Thu Jul 30 18:53:26 2009
+@@ -23,9 +23,9 @@
+  * have any questions.
+  */
+ /*
+- * $Id: SOAPElementFactory.java,v 1.11 2005/04/05 22:42:05 mk125090 Exp $
+- * $Revision: 1.11 $
+- * $Date: 2005/04/05 22:42:05 $
++ * $Id: SOAPElementFactory.java,v 1.12 2006/03/30 00:59:41 ofung Exp $
++ * $Revision: 1.12 $
++ * $Date: 2006/03/30 00:59:41 $
+  */
+ 
+ 
+--- old/src/share/classes/javax/xml/soap/SOAPEnvelope.java	Thu Jul 30 18:53:30 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/soap/SOAPEnvelope.java	Thu Jul 30 18:53:30 2009
+@@ -23,9 +23,9 @@
+  * have any questions.
+  */
+ /*
+- * $Id: SOAPEnvelope.java,v 1.6 2005/04/05 22:42:05 mk125090 Exp $
+- * $Revision: 1.6 $
+- * $Date: 2005/04/05 22:42:05 $
++ * $Id: SOAPEnvelope.java,v 1.7 2006/03/30 00:59:41 ofung Exp $
++ * $Revision: 1.7 $
++ * $Date: 2006/03/30 00:59:41 $
+  */
+ 
+ 
+--- old/src/share/classes/javax/xml/soap/SOAPException.java	Thu Jul 30 18:53:34 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/soap/SOAPException.java	Thu Jul 30 18:53:33 2009
+@@ -23,9 +23,9 @@
+  * have any questions.
+  */
+ /*
+- * $Id: SOAPException.java,v 1.6 2005/04/05 21:03:23 mk125090 Exp $
+- * $Revision: 1.6 $
+- * $Date: 2005/04/05 21:03:23 $
++ * $Id: SOAPException.java,v 1.7 2006/03/30 00:59:41 ofung Exp $
++ * $Revision: 1.7 $
++ * $Date: 2006/03/30 00:59:41 $
+  */
+ 
+ 
+--- old/src/share/classes/javax/xml/soap/SOAPFactory.java	Thu Jul 30 18:53:38 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/soap/SOAPFactory.java	Thu Jul 30 18:53:37 2009
+@@ -23,8 +23,8 @@
+  * have any questions.
+  */
+ /*
+- * $Id: SOAPFactory.java,v 1.13 2005/06/22 10:24:11 vj135062 Exp $
+- * $Revision: 1.13 $
++ * $Id: SOAPFactory.java,v 1.14 2006/03/30 00:59:41 ofung Exp $
++ * $Revision: 1.14 $
+  * $Datae$
+  */
+ 
+@@ -61,35 +61,35 @@
+         "javax.xml.soap.SOAPFactory";
+ 
+     /**
+-     * Creates a <code>SOAPElement</code> object from an existing DOM 
++     * Creates a <code>SOAPElement</code> object from an existing DOM
+      * <code>Element</code>. If the DOM <code>Element</code> that is passed in
+-     * as an argument is already a <code>SOAPElement</code> then this method 
++     * as an argument is already a <code>SOAPElement</code> then this method
+      * must return it unmodified without any further work. Otherwise, a new
+-     * <code>SOAPElement</code> is created and a deep copy is made of the 
++     * <code>SOAPElement</code> is created and a deep copy is made of the
+      * <code>domElement</code> argument. The concrete type of the return value
+      * will depend on the name of the <code>domElement</code> argument. If any
+-     * part of the tree rooted in <code>domElement</code> violates SOAP rules, a 
++     * part of the tree rooted in <code>domElement</code> violates SOAP rules, a
+      * <code>SOAPException</code> will be thrown.
+-     * 
++     *
+      * @param domElement - the <code>Element</code> to be copied.
+-     * 
++     *
+      * @return a new <code>SOAPElement</code> that is a copy of <code>domElement</code>.
+-     * 
++     *
+      * @exception SOAPException if there is an error in creating the
+      *            <code>SOAPElement</code> object
+-     * 
++     *
+      * @since SAAJ 1.3
+      */
+     public SOAPElement createElement(Element domElement) throws SOAPException {
+         throw new UnsupportedOperationException("createElement(org.w3c.dom.Element) must be overridden by all subclasses of SOAPFactory.");
+     }
+-    
++
+     /**
+      * Creates a <code>SOAPElement</code> object initialized with the
+      * given <code>Name</code> object. The concrete type of the return value
+-     * will depend on the name given to the new <code>SOAPElement</code>. For 
+-     * instance, a new <code>SOAPElement</code> with the name 
+-     * "{http://www.w3.org/2003/05/soap-envelope}Envelope" would cause a 
++     * will depend on the name given to the new <code>SOAPElement</code>. For
++     * instance, a new <code>SOAPElement</code> with the name
++     * "{http://www.w3.org/2003/05/soap-envelope}Envelope" would cause a
+      * <code>SOAPEnvelope</code> that supports SOAP 1.2 behavior to be created.
+      *
+      * @param name a <code>Name</code> object with the XML name for
+@@ -107,9 +107,9 @@
+     /**
+      * Creates a <code>SOAPElement</code> object initialized with the
+      * given <code>QName</code> object. The concrete type of the return value
+-     * will depend on the name given to the new <code>SOAPElement</code>. For 
+-     * instance, a new <code>SOAPElement</code> with the name 
+-     * "{http://www.w3.org/2003/05/soap-envelope}Envelope" would cause a 
++     * will depend on the name given to the new <code>SOAPElement</code>. For
++     * instance, a new <code>SOAPElement</code> with the name
++     * "{http://www.w3.org/2003/05/soap-envelope}Envelope" would cause a
+      * <code>SOAPEnvelope</code> that supports SOAP 1.2 behavior to be created.
+      *
+      * @param qname a <code>QName</code> object with the XML name for
+@@ -129,7 +129,7 @@
+ 
+     /**
+      * Creates a <code>SOAPElement</code> object initialized with the
+-     * given local name. 
++     * given local name.
+      *
+      * @param localName a <code>String</code> giving the local name for
+      *             the new element
+@@ -142,14 +142,14 @@
+      */
+     public abstract SOAPElement createElement(String localName)
+         throws SOAPException;
+-    
+ 
++
+     /**
+      * Creates a new <code>SOAPElement</code> object with the given
+      * local name, prefix and uri. The concrete type of the return value
+-     * will depend on the name given to the new <code>SOAPElement</code>. For 
+-     * instance, a new <code>SOAPElement</code> with the name 
+-     * "{http://www.w3.org/2003/05/soap-envelope}Envelope" would cause a 
++     * will depend on the name given to the new <code>SOAPElement</code>. For
++     * instance, a new <code>SOAPElement</code> with the name
++     * "{http://www.w3.org/2003/05/soap-envelope}Envelope" would cause a
+      * <code>SOAPEnvelope</code> that supports SOAP 1.2 behavior to be created.
+      *
+      * @param localName a <code>String</code> giving the local name
+@@ -176,8 +176,8 @@
+      * abstraction.
+      *
+      * @return a <code>Detail</code> object
+-     * @throws SOAPException if there is a SOAP error 
+-     * @throws UnsupportedOperationException if the protocol specified 
++     * @throws SOAPException if there is a SOAP error
++     * @throws UnsupportedOperationException if the protocol specified
+      *         for the SOAPFactory was <code>DYNAMIC_SOAP_PROTOCOL</code>
+      */
+     public abstract Detail createDetail() throws SOAPException;
+@@ -194,7 +194,7 @@
+     public abstract SOAPFault createFault(String reasonText, QName faultCode) throws SOAPException;
+ 
+     /**
+-     *Creates a new default <code>SOAPFault</code> object 
++     *Creates a new default <code>SOAPFault</code> object
+      *@return a <code>SOAPFault</code> object
+      *@throws SOAPException if there is a SOAP error
+      *@since SAAJ 1.3
+@@ -228,7 +228,7 @@
+      * <P>
+      * This factory method creates <code>Name</code> objects for use in
+      * situations where it is not practical to use the <code>SOAPEnvelope</code>
+-     * abstraction. 
++     * abstraction.
+      *
+      * @param localName a <code>String</code> giving the local name
+      * @return a <code>Name</code> object initialized with the given
+@@ -275,7 +275,7 @@
+ 
+     /**
+      * Creates a new <code>SOAPFactory</code> object that is an instance of
+-     * the specified implementation, this method uses the SAAJMetaFactory to 
++     * the specified implementation, this method uses the SAAJMetaFactory to
+      * locate the implementation class and create the SOAPFactory instance.
+      *
+      * @return a new instance of a <code>SOAPFactory</code>
+--- old/src/share/classes/javax/xml/soap/SOAPFault.java	Thu Jul 30 18:53:41 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/soap/SOAPFault.java	Thu Jul 30 18:53:41 2009
+@@ -23,9 +23,9 @@
+  * have any questions.
+  */
+ /*
+- * $Id: SOAPFault.java,v 1.20 2006/02/14 04:40:57 vj135062 Exp $
+- * $Revision: 1.20 $
+- * $Date: 2006/02/14 04:40:57 $
++ * $Id: SOAPFault.java,v 1.21 2006/03/30 00:59:41 ofung Exp $
++ * $Revision: 1.21 $
++ * $Date: 2006/03/30 00:59:41 $
+  */
+ 
+ 
+@@ -45,8 +45,8 @@
+  * processing, such as the inability to communicate with an upstream
+  * server.
+  * <P>
+- * Depending on the <code>protocol</code> specified while creating the 
+- * <code>MessageFactory</code> instance,  a <code>SOAPFault</code> has 
++ * Depending on the <code>protocol</code> specified while creating the
++ * <code>MessageFactory</code> instance,  a <code>SOAPFault</code> has
+  * sub-elements as defined in the SOAP 1.1/SOAP 1.2 specification.
+  */
+ public interface SOAPFault extends SOAPBodyElement {
+@@ -96,7 +96,7 @@
+      *
+      * @see #setFaultCode(Name)
+      * @see #getFaultCodeAsQName()
+-     * 
++     *
+      * @since SAAJ 1.3
+      */
+     public void setFaultCode(QName faultCodeQName) throws SOAPException;
+@@ -133,70 +133,70 @@
+      *
+      * @return a <code>Name</code> representing the faultcode
+      * @see #setFaultCode(Name)
+-     * 
++     *
+      * @since SAAJ 1.2
+      */
+     public Name getFaultCodeAsName();
+-    
+-    
++
++
+     /**
+      * Gets the fault code for this
+      * <code>SOAPFault</code> object as a <code>QName</code> object.
+      *
+      * @return a <code>QName</code> representing the faultcode
+-     * 
++     *
+      * @see #setFaultCode(QName)
+-     * 
++     *
+      * @since SAAJ 1.3
+      */
+     public QName getFaultCodeAsQName();
+ 
+     /**
+-     * Gets the Subcodes for this <code>SOAPFault</code> as an iterator over 
+-     * <code>QNames</code>. 
++     * Gets the Subcodes for this <code>SOAPFault</code> as an iterator over
++     * <code>QNames</code>.
+      *
+-     * @return an <code>Iterator</code> that accesses a sequence of 
++     * @return an <code>Iterator</code> that accesses a sequence of
+      *      <code>QNames</code>. This <code>Iterator</code> should not support
+-     *      the optional <code>remove</code> method. The order in which the 
+-     *      Subcodes are returned reflects the hierarchy of Subcodes present 
++     *      the optional <code>remove</code> method. The order in which the
++     *      Subcodes are returned reflects the hierarchy of Subcodes present
+      *      in the fault from top to bottom.
+-     * 
+-     * @exception UnsupportedOperationException if this message does not 
+-     *      support the SOAP 1.2 concept of Subcode. 
+-     * 
+-     * @since SAAJ 1.3 
++     *
++     * @exception UnsupportedOperationException if this message does not
++     *      support the SOAP 1.2 concept of Subcode.
++     *
++     * @since SAAJ 1.3
+      */
+     public Iterator getFaultSubcodes();
+-    
++
+     /**
+-     * Removes any Subcodes that may be contained by this 
+-     * <code>SOAPFault</code>. Subsequent calls to 
++     * Removes any Subcodes that may be contained by this
++     * <code>SOAPFault</code>. Subsequent calls to
+      * <code>getFaultSubcodes</code> will return an empty iterator until a call
+      * to <code>appendFaultSubcode</code> is made.
+      *
+-     * @exception UnsupportedOperationException if this message does not 
+-     *      support the SOAP 1.2 concept of Subcode. 
+-     * 
++     * @exception UnsupportedOperationException if this message does not
++     *      support the SOAP 1.2 concept of Subcode.
++     *
+      * @since SAAJ 1.3
+      */
+     public void removeAllFaultSubcodes();
+-    
++
+     /**
+      * Adds a Subcode to the end of the sequence of Subcodes contained by this
+-     * <code>SOAPFault</code>. Subcodes, which were introduced in SOAP 1.2, are 
++     * <code>SOAPFault</code>. Subcodes, which were introduced in SOAP 1.2, are
+      * represented by a recursive sequence of subelements rooted in the
+-     * mandatory Code subelement of a SOAP Fault. 
+-     *  
++     * mandatory Code subelement of a SOAP Fault.
++     *
+      * @param subcode a QName containing the Value of the Subcode.
+-     * 
++     *
+      * @exception SOAPException if there was an error in setting the Subcode
+-     * @exception UnsupportedOperationException if this message does not 
+-     *      support the SOAP 1.2 concept of Subcode. 
+-     * 
++     * @exception UnsupportedOperationException if this message does not
++     *      support the SOAP 1.2 concept of Subcode.
++     *
+      * @since SAAJ 1.3
+      */
+     public void appendFaultSubcode(QName subcode) throws SOAPException;
+-    
++
+     /**
+      * Gets the fault code for this <code>SOAPFault</code> object.
+      *
+@@ -242,7 +242,7 @@
+      * <P>
+      * If this
+      * <code>SOAPFault</code> is part of a message that supports SOAP 1.2 then
+-     * this call is equivalent to: 
++     * this call is equivalent to:
+      * <pre>
+      *      addFaultReasonText(faultString, Locale.getDefault());
+      * </pre>
+@@ -262,7 +262,7 @@
+      * <P>
+      * If this
+      * <code>SOAPFault</code> is part of a message that supports SOAP 1.2 then
+-     * this call is equivalent to: 
++     * this call is equivalent to:
+      * <pre>
+      *      addFaultReasonText(faultString, locale);
+      * </pre>
+@@ -270,12 +270,12 @@
+      * @param faultString a <code>String</code> giving an explanation of
+      *         the fault
+      * @param locale a {@link java.util.Locale Locale} object indicating
+-     *         the native language of the <code>faultString</code> 
++     *         the native language of the <code>faultString</code>
+      * @see #getFaultString
+      *
+      * @exception SOAPException if there was an error in adding the
+      *            <code>faultString</code> to the underlying XML tree.
+-     * 
++     *
+      * @since SAAJ 1.2
+      */
+     public void setFaultString(String faultString, Locale locale)
+@@ -282,11 +282,11 @@
+         throws SOAPException;
+ 
+     /**
+-     * Gets the fault string for this <code>SOAPFault</code> object. 
++     * Gets the fault string for this <code>SOAPFault</code> object.
+      * <P>
+      * If this
+      * <code>SOAPFault</code> is part of a message that supports SOAP 1.2 then
+-     * this call is equivalent to: 
++     * this call is equivalent to:
+      * <pre>
+      *    String reason = null;
+      *    try {
+@@ -303,12 +303,12 @@
+     public String getFaultString();
+ 
+     /**
+-     * Gets the locale of the fault string for this <code>SOAPFault</code> 
+-     * object. 
++     * Gets the locale of the fault string for this <code>SOAPFault</code>
++     * object.
+      * <P>
+      * If this
+      * <code>SOAPFault</code> is part of a message that supports SOAP 1.2 then
+-     * this call is equivalent to: 
++     * this call is equivalent to:
+      * <pre>
+      *    Locale locale = null;
+      *    try {
+@@ -316,11 +316,11 @@
+      *    } catch (SOAPException e) {}
+      *    return locale;
+      * </pre>
+-     * 
++     *
+      * @return a <code>Locale</code> object indicating the native language of
+      *          the fault string or <code>null</code> if no locale was specified
+      * @see #setFaultString(String, Locale)
+-     * 
++     *
+      * @since SAAJ 1.2
+      */
+     public Locale getFaultStringLocale();
+@@ -327,24 +327,24 @@
+ 
+     /**
+      * Returns true if this <code>SOAPFault</code> has a <code>Detail</code>
+-     * subelement and false otherwise. Equivalent to 
++     * subelement and false otherwise. Equivalent to
+      * <code>(getDetail()!=null)</code>.
+-     * 
++     *
+      * @return true if this <code>SOAPFault</code> has a <code>Detail</code>
+      * subelement and false otherwise.
+-     * 
++     *
+      * @since SAAJ 1.3
+      */
+     public boolean hasDetail();
+-    
++
+     /**
+      * Returns the optional detail element for this <code>SOAPFault</code>
+      * object.
+      * <P>
+      * A <code>Detail</code> object carries application-specific error
+-     * information, the scope of the error information is restricted to 
+-     * faults in the <code>SOAPBodyElement</code> objects if this is a 
+-     * SOAP 1.1 Fault. 
++     * information, the scope of the error information is restricted to
++     * faults in the <code>SOAPBodyElement</code> objects if this is a
++     * SOAP 1.1 Fault.
+      *
+      * @return a <code>Detail</code> object with application-specific
+      *         error information if present, null otherwise
+@@ -369,67 +369,67 @@
+     public Detail addDetail() throws SOAPException;
+ 
+     /**
+-     * Returns an <code>Iterator</code> over a distinct sequence of 
+-     * <code>Locale</code>s for which there are associated Reason Text items. 
+-     * Any of these <code>Locale</code>s can be used in a call to 
++     * Returns an <code>Iterator</code> over a distinct sequence of
++     * <code>Locale</code>s for which there are associated Reason Text items.
++     * Any of these <code>Locale</code>s can be used in a call to
+      * <code>getFaultReasonText</code> in order to obtain a localized version
+      * of the Reason Text string.
+-     * 
++     *
+      * @return an <code>Iterator</code> over a sequence of <code>Locale</code>
+      *      objects for which there are associated Reason Text items.
+-     * 
+-     * @exception SOAPException if there was an error in retrieving 
++     *
++     * @exception SOAPException if there was an error in retrieving
+      * the  fault Reason locales.
+-     * @exception UnsupportedOperationException if this message does not 
+-     *      support the SOAP 1.2 concept of Fault Reason. 
+-     * 
++     * @exception UnsupportedOperationException if this message does not
++     *      support the SOAP 1.2 concept of Fault Reason.
++     *
+      * @since SAAJ 1.3
+      */
+     public Iterator getFaultReasonLocales() throws SOAPException;
+-    
++
+     /**
+-     * Returns an <code>Iterator</code> over a sequence of 
++     * Returns an <code>Iterator</code> over a sequence of
+      * <code>String</code> objects containing all of the Reason Text items for
+-     * this <code>SOAPFault</code>. 
++     * this <code>SOAPFault</code>.
+      *
+-     * @return an <code>Iterator</code> over env:Fault/env:Reason/env:Text items. 
+-     * 
+-     * @exception SOAPException if there was an error in retrieving 
+-     * the  fault Reason texts. 
+-     * @exception UnsupportedOperationException if this message does not 
+-     *      support the SOAP 1.2 concept of Fault Reason. 
+-     * 
++     * @return an <code>Iterator</code> over env:Fault/env:Reason/env:Text items.
++     *
++     * @exception SOAPException if there was an error in retrieving
++     * the  fault Reason texts.
++     * @exception UnsupportedOperationException if this message does not
++     *      support the SOAP 1.2 concept of Fault Reason.
++     *
+      * @since SAAJ 1.3
+      */
+     public Iterator getFaultReasonTexts() throws SOAPException;
+ 
+     /**
+-     * Returns the Reason Text associated with the given <code>Locale</code>. 
+-     * If more than one such Reason Text exists the first matching Text is 
++     * Returns the Reason Text associated with the given <code>Locale</code>.
++     * If more than one such Reason Text exists the first matching Text is
+      * returned
+-     * 
+-     * @param locale -- the <code>Locale</code> for which a localized 
++     *
++     * @param locale -- the <code>Locale</code> for which a localized
+      *      Reason Text is desired
+-     * 
++     *
+      * @return the Reason Text associated with <code>locale</code>
+-     * 
++     *
+      * @see #getFaultString
+-     * 
+-     * @exception SOAPException if there was an error in retrieving 
+-     * the  fault Reason text for the specified locale . 
+-     * @exception UnsupportedOperationException if this message does not 
+-     *      support the SOAP 1.2 concept of Fault Reason. 
+-     * 
++     *
++     * @exception SOAPException if there was an error in retrieving
++     * the  fault Reason text for the specified locale .
++     * @exception UnsupportedOperationException if this message does not
++     *      support the SOAP 1.2 concept of Fault Reason.
++     *
+      * @since SAAJ 1.3
+      */
+     public String getFaultReasonText(Locale locale) throws SOAPException;
+-    
++
+     /**
+      * Appends or replaces a Reason Text item containing the specified
+-     * text message and an <i>xml:lang</i> derived from 
+-     * <code>locale</code>. If a Reason Text item with this 
++     * text message and an <i>xml:lang</i> derived from
++     * <code>locale</code>. If a Reason Text item with this
+      * <i>xml:lang</i> already exists its text value will be replaced
+-     * with <code>text</code>. 
++     * with <code>text</code>.
+      * The <code>locale</code> parameter should not be <code>null</code>
+      * <P>
+      * Code sample:
+@@ -444,9 +444,9 @@
+      *
+      * @exception SOAPException if there was an error in adding the Reason text
+      * or the <code>locale</code> passed was <code>null</code>.
+-     * @exception UnsupportedOperationException if this message does not 
+-     *      support the SOAP 1.2 concept of Fault Reason. 
+-     * 
++     * @exception UnsupportedOperationException if this message does not
++     *      support the SOAP 1.2 concept of Fault Reason.
++     *
+      * @since SAAJ 1.3
+      */
+     public void addFaultReasonText(String text, java.util.Locale locale)
+@@ -459,10 +459,10 @@
+      *
+      * @return Content of the env:Fault/env:Node element as a String
+      * or <code>null</code> if none
+-     * 
+-     * @exception UnsupportedOperationException if this message does not 
+-     *      support the SOAP 1.2 concept of Fault Node. 
+-     * 
++     *
++     * @exception UnsupportedOperationException if this message does not
++     *      support the SOAP 1.2 concept of Fault Node.
++     *
+      * @since SAAJ 1.3
+      */
+     public String getFaultNode();
+@@ -474,10 +474,10 @@
+      *
+      * @exception SOAPException  if there was an error in setting the
+      *            Node for this  <code>SOAPFault</code> object.
+-     * @exception UnsupportedOperationException if this message does not 
+-     *      support the SOAP 1.2 concept of Fault Node. 
+-     * 
+-     * 
++     * @exception UnsupportedOperationException if this message does not
++     *      support the SOAP 1.2 concept of Fault Node.
++     *
++     *
+      * @since SAAJ 1.3
+      */
+     public void setFaultNode(String uri) throws SOAPException;
+@@ -489,10 +489,10 @@
+      *
+      * @return Content of the env:Fault/env:Role element as a String
+      * or <code>null</code> if none
+-     * 
+-     * @exception UnsupportedOperationException if this message does not 
+-     *      support the SOAP 1.2 concept of Fault Role. 
+-     * 
++     *
++     * @exception UnsupportedOperationException if this message does not
++     *      support the SOAP 1.2 concept of Fault Role.
++     *
+      * @since SAAJ 1.3
+      */
+     public String getFaultRole();
+@@ -503,13 +503,13 @@
+      * is optional in SOAP 1.2.
+      *
+      * @param uri - the URI of the Role
+-     * 
++     *
+      * @exception SOAPException  if there was an error in setting the
+      *            Role for this  <code>SOAPFault</code> object.
+-     * 
+-     * @exception UnsupportedOperationException if this message does not 
+-     *      support the SOAP 1.2 concept of Fault Role. 
+-     * 
++     *
++     * @exception UnsupportedOperationException if this message does not
++     *      support the SOAP 1.2 concept of Fault Role.
++     *
+      * @since SAAJ 1.3
+      */
+     public void setFaultRole(String uri) throws SOAPException;
+--- old/src/share/classes/javax/xml/soap/SOAPFaultElement.java	Thu Jul 30 18:53:45 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/soap/SOAPFaultElement.java	Thu Jul 30 18:53:44 2009
+@@ -23,9 +23,9 @@
+  * have any questions.
+  */
+ /*
+- * $Id: SOAPFaultElement.java,v 1.4 2005/04/05 20:53:20 mk125090 Exp $
+- * $Revision: 1.4 $
+- * $Date: 2005/04/05 20:53:20 $
++ * $Id: SOAPFaultElement.java,v 1.5 2006/03/30 00:59:41 ofung Exp $
++ * $Revision: 1.5 $
++ * $Date: 2006/03/30 00:59:41 $
+  */
+ 
+ 
+@@ -32,7 +32,7 @@
+ package javax.xml.soap;
+ 
+ /**
+- * A representation of the contents in 
++ * A representation of the contents in
+  * a <code>SOAPFault</code> object.  The <code>Detail</code> interface
+  * is a <code>SOAPFaultElement</code>.
+  * <P>
+--- old/src/share/classes/javax/xml/soap/SOAPHeader.java	Thu Jul 30 18:53:49 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/soap/SOAPHeader.java	Thu Jul 30 18:53:48 2009
+@@ -23,9 +23,9 @@
+  * have any questions.
+  */
+ /*
+- * $Id: SOAPHeader.java,v 1.14 2005/04/05 22:46:27 mk125090 Exp $
+- * $Revision: 1.14 $
+- * $Date: 2005/04/05 22:46:27 $
++ * $Id: SOAPHeader.java,v 1.15 2006/03/30 00:59:41 ofung Exp $
++ * $Revision: 1.15 $
++ * $Date: 2006/03/30 00:59:41 $
+  */
+ 
+ 
+@@ -109,7 +109,7 @@
+      * that have the specified <i>actor</i> and that have a MustUnderstand attribute
+      * whose value is equivalent to <code>true</code>.
+      * <p>
+-     * In SOAP 1.2 the <i>env:actor</i> attribute is replaced by the <i>env:role</i> 
++     * In SOAP 1.2 the <i>env:actor</i> attribute is replaced by the <i>env:role</i>
+      * attribute, but with essentially the same semantics.
+      *
+      * @param actor a <code>String</code> giving the URI of the <code>actor</code> / <code>role</code>
+@@ -138,7 +138,7 @@
+      * <code>SOAPHeader</code> object, it is sent to the ultimate receiver
+      * along with the message body.
+      * <p>
+-     * In SOAP 1.2 the <i>env:actor</i> attribute is replaced by the <i>env:role</i> 
++     * In SOAP 1.2 the <i>env:actor</i> attribute is replaced by the <i>env:role</i>
+      * attribute, but with essentially the same semantics.
+      *
+      * @param actor a <code>String</code> giving the URI of the <code>actor</code> / <code>role</code>
+@@ -161,7 +161,7 @@
+      * <code>SOAPHeader</code> object that apply to it and to remove
+      * them before passing the message on to the next actor.
+      * <p>
+-     * In SOAP 1.2 the <i>env:actor</i> attribute is replaced by the <i>env:role</i> 
++     * In SOAP 1.2 the <i>env:actor</i> attribute is replaced by the <i>env:role</i>
+      * attribute, but with essentially the same semantics.
+      *
+      * @param actor a <code>String</code> giving the URI of the <code>actor</code> / <code>role</code>
+@@ -266,5 +266,3 @@
+     public Iterator extractAllHeaderElements();
+ 
+ }
+-
+-
+--- old/src/share/classes/javax/xml/soap/SOAPHeaderElement.java	Thu Jul 30 18:53:52 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/soap/SOAPHeaderElement.java	Thu Jul 30 18:53:51 2009
+@@ -23,9 +23,9 @@
+  * have any questions.
+  */
+ /*
+- * $Id: SOAPHeaderElement.java,v 1.9 2005/04/05 22:46:27 mk125090 Exp $
+- * $Revision: 1.9 $
+- * $Date: 2005/04/05 22:46:27 $
++ * $Id: SOAPHeaderElement.java,v 1.10 2006/03/30 00:59:42 ofung Exp $
++ * $Revision: 1.10 $
++ * $Date: 2006/03/30 00:59:42 $
+  */
+ 
+ 
+@@ -49,7 +49,7 @@
+      * <P>
+      * If this <code>SOAPHeaderElement</code> supports SOAP 1.2 then this call is
+      * equivalent to {@link #setRole(String)}
+-     * 
++     *
+      * @param  actorURI a <code>String</code> giving the URI of the actor
+      *           to set
+      *
+@@ -65,12 +65,12 @@
+      * object to the specified <code>Role</code>.
+      *
+      * @param uri - the URI of the <code>Role</code>
+-     * 
++     *
+      * @throws SOAPException if there is an error in setting the role
+-     * 
+-     * @exception UnsupportedOperationException if this message does not 
+-     *      support the SOAP 1.2 concept of Fault Role. 
+-     * 
++     *
++     * @exception UnsupportedOperationException if this message does not
++     *      support the SOAP 1.2 concept of Fault Role.
++     *
+      * @since SAAJ 1.3
+      */
+     public void setRole(String uri) throws SOAPException;
+@@ -91,10 +91,10 @@
+      * <code>SOAPHeaderElement</code>.
+      *
+      * @return a <code>String</code> giving the URI of the <code>Role</code>
+-     * 
+-     * @exception UnsupportedOperationException if this message does not 
+-     *      support the SOAP 1.2 concept of Fault Role. 
+-     * 
++     *
++     * @exception UnsupportedOperationException if this message does not
++     *      support the SOAP 1.2 concept of Fault Role.
++     *
+      * @since SAAJ 1.3
+      */
+     public String getRole();
+@@ -113,7 +113,7 @@
+      *
+      * @exception IllegalArgumentException if there is a problem in
+      * setting the mustUnderstand attribute
+-     * @see #getMustUnderstand 
++     * @see #getMustUnderstand
+      * @see #setRelay
+      */
+     public void setMustUnderstand(boolean mustUnderstand);
+@@ -127,46 +127,46 @@
+      *         otherwise
+      */
+     public boolean getMustUnderstand();
+-    
++
+     /**
+-     * Sets the <i>relay</i> attribute for this <code>SOAPHeaderElement</code> to be 
++     * Sets the <i>relay</i> attribute for this <code>SOAPHeaderElement</code> to be
+      * either true or false.
+      * <P>
+-     * The SOAP relay attribute is set to true to indicate that the SOAP header 
+-     * block must be relayed by any node that is targeted by the header block 
++     * The SOAP relay attribute is set to true to indicate that the SOAP header
++     * block must be relayed by any node that is targeted by the header block
+      * but not actually process it. This attribute is ignored on header blocks
+-     * whose mustUnderstand attribute is set to true or that are targeted at 
+-     * the ultimate reciever (which is the default). The default value of this 
++     * whose mustUnderstand attribute is set to true or that are targeted at
++     * the ultimate reciever (which is the default). The default value of this
+      * attribute is <code>false</code>.
+-     * 
++     *
+      * @param relay the new value of the <i>relay</i> attribute
+-     * 
+-     * @exception SOAPException if there is a problem in setting the 
+-     * relay attribute. 
+-     * @exception UnsupportedOperationException if this message does not 
++     *
++     * @exception SOAPException if there is a problem in setting the
++     * relay attribute.
++     * @exception UnsupportedOperationException if this message does not
+      *      support the SOAP 1.2 concept of Relay attribute.
+-     * 
+-     * @see #setMustUnderstand 
++     *
++     * @see #setMustUnderstand
+      * @see #getRelay
+-     * 
++     *
+      * @since SAAJ 1.3
+      */
+     public void setRelay(boolean relay) throws SOAPException;
+ 
+     /**
+-     * Returns the boolean value of the <i>relay</i> attribute for this 
++     * Returns the boolean value of the <i>relay</i> attribute for this
+      * <code>SOAPHeaderElement</code>
+-     * 
+-     * @return <code>true</code> if the relay attribute is turned on; 
++     *
++     * @return <code>true</code> if the relay attribute is turned on;
+      * <code>false</code> otherwise
+      *
+-     * @exception UnsupportedOperationException if this message does not 
+-     *      support the SOAP 1.2 concept of Relay attribute. 
+-     * 
+-     * @see #getMustUnderstand 
++     * @exception UnsupportedOperationException if this message does not
++     *      support the SOAP 1.2 concept of Relay attribute.
++     *
++     * @see #getMustUnderstand
+      * @see #setRelay
+-     * 
++     *
+      * @since SAAJ 1.3
+      */
+-    public boolean getRelay();    
++    public boolean getRelay();
+ }
+--- old/src/share/classes/javax/xml/soap/SOAPMessage.java	Thu Jul 30 18:53:56 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/soap/SOAPMessage.java	Thu Jul 30 18:53:55 2009
+@@ -23,9 +23,9 @@
+  * have any questions.
+  */
+ /*
+- * $Id: SOAPMessage.java,v 1.22 2005/08/17 08:13:01 vj135062 Exp $
+- * $Revision: 1.22 $
+- * $Date: 2005/08/17 08:13:01 $
++ * $Id: SOAPMessage.java,v 1.23 2006/03/30 00:59:42 ofung Exp $
++ * $Revision: 1.23 $
++ * $Date: 2006/03/30 00:59:42 $
+  */
+ 
+ 
+@@ -109,13 +109,13 @@
+  */
+ public abstract class SOAPMessage {
+     /**
+-	 * Specifies the character type encoding for the SOAP Message. Valid values
+-	 * include "utf-8" and "utf-16". See vendor documentation for additional
+-	 * supported values. The default is "utf-8".
+-	 *
+-	 * @see SOAPMessage#setProperty(String, Object) SOAPMessage.setProperty
+-	 * @since SAAJ 1.2
+-	 */
++         * Specifies the character type encoding for the SOAP Message. Valid values
++         * include "utf-8" and "utf-16". See vendor documentation for additional
++         * supported values. The default is "utf-8".
++         *
++         * @see SOAPMessage#setProperty(String, Object) SOAPMessage.setProperty
++         * @since SAAJ 1.2
++         */
+     public static final String CHARACTER_SET_ENCODING =
+         "javax.xml.soap.character-set-encoding";
+ 
+@@ -151,81 +151,81 @@
+     public abstract String getContentDescription();
+ 
+     /**
+-	 * Gets the SOAP part of this <code>SOAPMessage</code> object.
+-	 * <P>
+-	 * <code>SOAPMessage</code> object contains one or more attachments, the
+-	 * SOAP Part must be the first MIME body part in the message.
+-	 *
+-	 * @return the <code>SOAPPart</code> object for this <code>SOAPMessage</code>
+-	 *         object
+-	 */
++         * Gets the SOAP part of this <code>SOAPMessage</code> object.
++         * <P>
++         * <code>SOAPMessage</code> object contains one or more attachments, the
++         * SOAP Part must be the first MIME body part in the message.
++         *
++         * @return the <code>SOAPPart</code> object for this <code>SOAPMessage</code>
++         *         object
++         */
+     public abstract SOAPPart getSOAPPart();
+ 
+     /**
+-	 * Gets the SOAP Body contained in this <code>SOAPMessage</code> object.
+-	 * <p>
+-	 *
+-	 * @return the <code>SOAPBody</code> object contained by this <code>SOAPMessage</code>
+-	 *         object
+-	 * @exception SOAPException
+-	 *               if the SOAP Body does not exist or cannot be retrieved
+-	 * @since SAAJ 1.2
+-	 */
++         * Gets the SOAP Body contained in this <code>SOAPMessage</code> object.
++         * <p>
++         *
++         * @return the <code>SOAPBody</code> object contained by this <code>SOAPMessage</code>
++         *         object
++         * @exception SOAPException
++         *               if the SOAP Body does not exist or cannot be retrieved
++         * @since SAAJ 1.2
++         */
+     public SOAPBody getSOAPBody() throws SOAPException {
+         throw new UnsupportedOperationException("getSOAPBody must be overridden by all subclasses of SOAPMessage");
+     }
+ 
+     /**
+-	 * Gets the SOAP Header contained in this <code>SOAPMessage</code>
+-	 * object.
+-	 * <p>
+-	 *
+-	 * @return the <code>SOAPHeader</code> object contained by this <code>SOAPMessage</code>
+-	 *         object
+-	 * @exception SOAPException
+-	 *               if the SOAP Header does not exist or cannot be retrieved
+-	 * @since SAAJ 1.2
+-	 */
++         * Gets the SOAP Header contained in this <code>SOAPMessage</code>
++         * object.
++         * <p>
++         *
++         * @return the <code>SOAPHeader</code> object contained by this <code>SOAPMessage</code>
++         *         object
++         * @exception SOAPException
++         *               if the SOAP Header does not exist or cannot be retrieved
++         * @since SAAJ 1.2
++         */
+     public SOAPHeader getSOAPHeader() throws SOAPException {
+         throw new UnsupportedOperationException("getSOAPHeader must be overridden by all subclasses of SOAPMessage");
+     }
+ 
+     /**
+-	 * Removes all <code>AttachmentPart</code> objects that have been added
+-	 * to this <code>SOAPMessage</code> object.
+-	 * <P>
+-	 * This method does not touch the SOAP part.
+-	 */
++         * Removes all <code>AttachmentPart</code> objects that have been added
++         * to this <code>SOAPMessage</code> object.
++         * <P>
++         * This method does not touch the SOAP part.
++         */
+     public abstract void removeAllAttachments();
+ 
+     /**
+-	 * Gets a count of the number of attachments in this message. This count
+-	 * does not include the SOAP part.
+-	 *
+-	 * @return the number of <code>AttachmentPart</code> objects that are
+-	 *         part of this <code>SOAPMessage</code> object
+-	 */
++         * Gets a count of the number of attachments in this message. This count
++         * does not include the SOAP part.
++         *
++         * @return the number of <code>AttachmentPart</code> objects that are
++         *         part of this <code>SOAPMessage</code> object
++         */
+     public abstract int countAttachments();
+ 
+     /**
+-	 * Retrieves all the <code>AttachmentPart</code> objects that are part of
+-	 * this <code>SOAPMessage</code> object.
+-	 *
+-	 * @return an iterator over all the attachments in this message
+-	 */
++         * Retrieves all the <code>AttachmentPart</code> objects that are part of
++         * this <code>SOAPMessage</code> object.
++         *
++         * @return an iterator over all the attachments in this message
++         */
+     public abstract Iterator getAttachments();
+ 
+     /**
+-	 * Retrieves all the <code>AttachmentPart</code> objects that have header
+-	 * entries that match the specified headers. Note that a returned
+-	 * attachment could have headers in addition to those specified.
+-	 *
+-	 * @param headers
+-	 *           a <code>MimeHeaders</code> object containing the MIME
+-	 *           headers for which to search
+-	 * @return an iterator over all attachments that have a header that matches
+-	 *         one of the given headers
+-	 */
++         * Retrieves all the <code>AttachmentPart</code> objects that have header
++         * entries that match the specified headers. Note that a returned
++         * attachment could have headers in addition to those specified.
++         *
++         * @param headers
++         *           a <code>MimeHeaders</code> object containing the MIME
++         *           headers for which to search
++         * @return an iterator over all attachments that have a header that matches
++         *         one of the given headers
++         */
+     public abstract Iterator getAttachments(MimeHeaders headers);
+ 
+     /**
+@@ -338,9 +338,9 @@
+      * @return a new <code>AttachmentPart</code> object that contains the
+      *         given data
+      * @exception IllegalArgumentException
+-     *               may be thrown if the contentType does not match the type 
+-     *               of the content object, or if there was no 
+-     *               <code>DataContentHandler</code> object for the given 
++     *               may be thrown if the contentType does not match the type
++     *               of the content object, or if there was no
++     *               <code>DataContentHandler</code> object for the given
+      *               content object
+      * @see javax.activation.DataHandler
+      * @see javax.activation.DataContentHandler
+@@ -393,7 +393,7 @@
+      * those messages that have attachments, <code>writeTo</code> writes a
+      * MIME-encoded byte stream.
+      * <P>
+-     * Note that this method does not write the transport-specific MIME Headers 
++     * Note that this method does not write the transport-specific MIME Headers
+      * of the Message
+      *
+      * @param out
+--- old/src/share/classes/javax/xml/soap/SOAPPart.java	Thu Jul 30 18:53:59 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/soap/SOAPPart.java	Thu Jul 30 18:53:59 2009
+@@ -23,9 +23,9 @@
+  * have any questions.
+  */
+ /*
+- * $Id: SOAPPart.java,v 1.9 2005/06/21 17:32:45 mk125090 Exp $
+- * $Revision: 1.9 $
+- * $Date: 2005/06/21 17:32:45 $
++ * $Id: SOAPPart.java,v 1.10 2006/03/30 00:59:42 ofung Exp $
++ * $Revision: 1.10 $
++ * $Date: 2006/03/30 00:59:42 $
+  */
+ 
+ 
+@@ -155,7 +155,7 @@
+      * <code>SOAPEnvelope</code> object.
+      */
+     public abstract void removeAllMimeHeaders();
+-    
++
+     /**
+      * Gets all the values of the <code>MimeHeader</code> object
+      * in this <code>SOAPPart</code> object that
+@@ -167,7 +167,7 @@
+      * @see #setMimeHeader
+      */
+     public abstract String[] getMimeHeader(String name);
+-    
++
+     /**
+      * Changes the first header entry that matches the given header name
+      * so that its value is the given value, adding a new header with the
+@@ -245,8 +245,8 @@
+     public abstract Iterator getNonMatchingMimeHeaders(String[] names);
+ 
+     /**
+-     * Sets the content of the <code>SOAPEnvelope</code> object with the data 
+-     * from the given <code>Source</code> object. This <code>Source</code> 
++     * Sets the content of the <code>SOAPEnvelope</code> object with the data
++     * from the given <code>Source</code> object. This <code>Source</code>
+      * must contain a valid SOAP document.
+      *
+      * @param source the <code>javax.xml.transform.Source</code> object with the
+--- old/src/share/classes/javax/xml/soap/Text.java	Thu Jul 30 18:54:03 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/soap/Text.java	Thu Jul 30 18:54:02 2009
+@@ -23,9 +23,9 @@
+  * have any questions.
+  */
+ /*
+- * $Id: Text.java,v 1.3 2005/04/05 20:34:16 mk125090 Exp $
+- * $Revision: 1.3 $
+- * $Date: 2005/04/05 20:34:16 $
++ * $Id: Text.java,v 1.4 2006/03/30 00:59:42 ofung Exp $
++ * $Revision: 1.4 $
++ * $Date: 2006/03/30 00:59:42 $
+  */
+ 
+ 
+--- old/src/share/classes/javax/xml/soap/package.html	Thu Jul 30 18:54:06 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/soap/package.html	Thu Jul 30 18:54:06 2009
+@@ -25,7 +25,7 @@
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+ <html>
+ <head>
+-   
++
+   <title></title>
+ 
+ </head>
+@@ -53,11 +53,11 @@
+ <p>   <!-- <h2>Package Specification</h2> -->  <!-- The SAAJ 1.1 specification gives an overview of the  -->
+  <!-- <code>javax.xml.soap</code> package and --> <!-- explains how its classes and interfaces work. -->
+  <!-- <ul> --> <!--   <li><a href="http://java.sun.com/xml/downloads/jaxm.html"> -->
+- <!-- 	SAAJ 1.1 Specification</a> --> <!-- </ul> -->  <!-- <h2>Related Documentation</h2> -->
+- <!-- 	For overviews, tutorials, examples, guides, and tool documentation, please see: -->
+- <!-- 	<ul> --> <!-- 	  <li><a href="../../../../tutorial/doc/JAXM.html">JAXM Tutorial</a> -->
+- <!-- 	  <li><a href="../../../../jaxm/index.html">JAXM Reference Implementation (RI) -->
+- <!-- 			  Documentation</a> --> <!-- 	</ul> -->  </p>
++ <!--   SAAJ 1.1 Specification</a> --> <!-- </ul> -->  <!-- <h2>Related Documentation</h2> -->
++ <!--   For overviews, tutorials, examples, guides, and tool documentation, please see: -->
++ <!--   <ul> --> <!--     <li><a href="../../../../tutorial/doc/JAXM.html">JAXM Tutorial</a> -->
++ <!--     <li><a href="../../../../jaxm/index.html">JAXM Reference Implementation (RI) -->
++ <!--                     Documentation</a> --> <!--    </ul> -->  </p>
+ In addition the APIs in the <code>javax.xml.soap</code> package extend
+ their  counterparts in the <code>org.w3c.dom</code> package. This means that
+ the  <code>SOAPPart</code> of a <code>SOAPMessage</code> is also a DOM Level
+--- old/src/share/classes/javax/xml/ws/Action.java	Thu Jul 30 18:54:10 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/ws/Action.java	Thu Jul 30 18:54:09 2009
+@@ -35,16 +35,16 @@
+ 
+ /**
+ 
+- * The <code>Action</code> annotation allows explicit association of a 
+- * WS-Addressing <code>Action</code> message addressing property with 
+- * <code>input</code>, <code>output</code>, and 
+- * <code>fault</code> messages of the mapped WSDL operation. 
++ * The <code>Action</code> annotation allows explicit association of a
++ * WS-Addressing <code>Action</code> message addressing property with
++ * <code>input</code>, <code>output</code>, and
++ * <code>fault</code> messages of the mapped WSDL operation.
+  * <p>
+- * In this version of JAX-WS there is no standard way to specify 
+- * <code>Action</code> values in a WSDL and there is no standard default value.  It is intended that, 
++ * In this version of JAX-WS there is no standard way to specify
++ * <code>Action</code> values in a WSDL and there is no standard default value.  It is intended that,
+  * after the W3C WG on WS-Addressing has defined these items in a recommendation,
+  * a future version of JAX-WS will require the new standards.
+- * 
++ *
+  * @see Addressing
+  * @see FaultAction
+  *
+@@ -57,20 +57,20 @@
+ public @interface Action {
+     /**
+      * Explicit value of the WS-Addressing <code>Action</code> message addressing property for the <code>input</code>
+-     * message of the operation. 
++     * message of the operation.
+      */
+     String input() default "";
+ 
+     /**
+      * Explicit value of the WS-Addressing <code>Action</code> message addressing property for the <code>output</code>
+-     * message of the operation. 
++     * message of the operation.
+      */
+     String output() default "";
+-    
++
+     /**
+      * Explicit value of the WS-Addressing <code>Action</code> message addressing property for the <code>fault</code>
+      * message(s) of the operation. Each exception that is mapped to a fault and requires an explicit WS-Addressing
+-     * <code>Action</code> message addressing property, needs to be specified as a value in this property 
++     * <code>Action</code> message addressing property, needs to be specified as a value in this property
+      * using {@link FaultAction} annotation.
+      */
+     FaultAction[] fault() default { };
+--- old/src/share/classes/javax/xml/ws/Binding.java	Thu Jul 30 18:54:14 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/ws/Binding.java	Thu Jul 30 18:54:13 2009
+@@ -33,7 +33,7 @@
+ **/
+ public interface Binding {
+ 
+-   /** 
++   /**
+     * Gets a copy of the handler chain for a protocol binding instance.
+     * If the returned chain is modified a call to <code>setHandlerChain</code>
+     * is required to configure the binding instance with the new chain.
+@@ -42,7 +42,7 @@
+     */
+     public java.util.List<javax.xml.ws.handler.Handler> getHandlerChain();
+ 
+-   /** 
++   /**
+     * Sets the handler chain for the protocol binding instance.
+     *
+     *  @param chain    A List of handler configuration entries
+@@ -55,8 +55,8 @@
+     */
+     public void setHandlerChain(java.util.List<javax.xml.ws.handler.Handler> chain);
+ 
+-    /** 
+-     * Get the URI for this binding instance. 
++    /**
++     * Get the URI for this binding instance.
+      *
+      * @return String The binding identifier for the port.
+      *    Never returns <code>null</code>
+@@ -63,5 +63,5 @@
+      *
+      * @since JAX-WS 2.1
+      */
+-    String getBindingID();      
++    String getBindingID();
+ }
+--- old/src/share/classes/javax/xml/ws/BindingProvider.java	Thu Jul 30 18:54:17 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/ws/BindingProvider.java	Thu Jul 30 18:54:16 2009
+@@ -29,7 +29,7 @@
+ import javax.xml.ws.wsaddressing.W3CEndpointReference;
+ import org.w3c.dom.Element;
+ 
+-/** 
++/**
+  * The <code>BindingProvider</code> interface provides access to the
+  * protocol binding and associated context objects for request and
+  * response message processing.
+@@ -39,21 +39,21 @@
+  * @see javax.xml.ws.Binding
+  **/
+ public interface BindingProvider {
+-    /** 
++    /**
+      * Standard property: User name for authentication.
+      * <p>Type: <code>java.lang.String</code>
+      **/
+     public static final String USERNAME_PROPERTY =
+             "javax.xml.ws.security.auth.username";
+-    
+-    /** 
++
++    /**
+      * Standard property: Password for authentication.
+      * <p>Type: <code>java.lang.String</code>
+      **/
+     public static final String PASSWORD_PROPERTY =
+             "javax.xml.ws.security.auth.password";
+-    
+-    /** 
++
++    /**
+      * Standard property: Target service endpoint address. The
+      * URI scheme for the endpoint address specification MUST
+      * correspond to the protocol/transport binding for the
+@@ -62,8 +62,8 @@
+      **/
+     public static final String ENDPOINT_ADDRESS_PROPERTY =
+             "javax.xml.ws.service.endpoint.address";
+-    
+-    /** 
++
++    /**
+      * Standard property: This boolean property is used by a service
+      * client to indicate whether or not it wants to participate in
+      * a session with a service endpoint. If this property is set to
+@@ -74,30 +74,30 @@
+      **/
+     public static final String SESSION_MAINTAIN_PROPERTY =
+             "javax.xml.ws.session.maintain";
+-    
+-    /** 
+-     * Standard property for SOAPAction. This boolean property  
+-     * indicates whether or not the value of the 
+-     * <code>javax.xml.ws.soap.http.soapaction.uri</code> property 
+-     * is used for the value of the SOAPAction. The  
+-     * default value of this property is <code>false</code> indicating 
+-     * that the 
++
++    /**
++     * Standard property for SOAPAction. This boolean property
++     * indicates whether or not the value of the
+      * <code>javax.xml.ws.soap.http.soapaction.uri</code> property
+-     * is not used for the value of the SOAPAction, however, 
+-     * if WS-Addressing is enabled, the default value is 
++     * is used for the value of the SOAPAction. The
++     * default value of this property is <code>false</code> indicating
++     * that the
++     * <code>javax.xml.ws.soap.http.soapaction.uri</code> property
++     * is not used for the value of the SOAPAction, however,
++     * if WS-Addressing is enabled, the default value is
+      * <code>true</code>.
+-     * 
++     *
+      * <p>Type: <code>java.lang.Boolean</code>
+      **/
+     public static final String SOAPACTION_USE_PROPERTY =
+             "javax.xml.ws.soap.http.soapaction.use";
+-    
++
+     /**
+-     * Standard property for SOAPAction. Indicates the SOAPAction  
+-     * URI if the <code>javax.xml.ws.soap.http.soapaction.use</code>  
+-     * property is set to <code>true</code>. If WS-Addressing  
+-     * is enabled, this value will also be used for the value of the  
+-     * WS-Addressing Action header.  If this property is not set, 
++     * Standard property for SOAPAction. Indicates the SOAPAction
++     * URI if the <code>javax.xml.ws.soap.http.soapaction.use</code>
++     * property is set to <code>true</code>. If WS-Addressing
++     * is enabled, this value will also be used for the value of the
++     * WS-Addressing Action header.  If this property is not set,
+      * the default SOAPAction and WS-Addressing Action will be sent.
+      *
+      * <p>Type: <code>java.lang.String</code>
+@@ -104,8 +104,8 @@
+      **/
+     public static final String SOAPACTION_URI_PROPERTY =
+             "javax.xml.ws.soap.http.soapaction.uri";
+-    
+-    /** 
++
++    /**
+      * Get the context that is used to initialize the message context
+      * for request messages.
+      *
+@@ -116,8 +116,8 @@
+      * @return The context that is used in processing request messages.
+      **/
+     Map<String, Object> getRequestContext();
+-    
+-    /** 
++
++    /**
+      * Get the context that resulted from processing a response message.
+      *
+      * The returned context is for the most recently completed synchronous
+@@ -129,16 +129,16 @@
+      * response messages.
+      **/
+     Map<String, Object> getResponseContext();
+-    
+-    /** 
++
++    /**
+      * Get the Binding for this binding provider.
+      *
+      * @return The Binding for this binding provider.
+      **/
+     Binding getBinding();
+-    
+-   
+-    
++
++
++
+     /**
+      * Returns the <code>EndpointReference</code> associated with
+      * this <code>BindingProvider</code> instance.
+@@ -150,7 +150,7 @@
+      * @return EndpointReference of the target endpoint associated with this
+      * <code>BindingProvider</code> instance.
+      *
+-     * @throws java.lang.UnsupportedOperationException If this 
++     * @throws java.lang.UnsupportedOperationException If this
+      * <code>BindingProvider</code> uses the XML/HTTP binding.
+      *
+      * @see W3CEndpointReference
+@@ -158,8 +158,8 @@
+      * @since JAX-WS 2.1
+      */
+     public EndpointReference getEndpointReference();
+-    
+-    
++
++
+     /**
+      * Returns the <code>EndpointReference</code> associated with
+      * this <code>BindingProvider</code> instance.  The instance
+@@ -174,10 +174,10 @@
+ 
+      * @throws WebServiceException If the Class <code>clazz</code>
+      * is not supported by this implementation.
+-     * @throws java.lang.UnsupportedOperationException If this 
++     * @throws java.lang.UnsupportedOperationException If this
+      * <code>BindingProvider</code> uses the XML/HTTP binding.
+      *
+      * @since JAX-WS 2.1
+      */
+-    public <T extends EndpointReference> T getEndpointReference(Class<T> clazz);  
++    public <T extends EndpointReference> T getEndpointReference(Class<T> clazz);
+ }
+--- old/src/share/classes/javax/xml/ws/Dispatch.java	Thu Jul 30 18:54:21 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/ws/Dispatch.java	Thu Jul 30 18:54:20 2009
+@@ -27,7 +27,7 @@
+ 
+ import java.util.concurrent.Future;
+ 
+-/** The <code>Dispatch</code> interface provides support 
++/** The <code>Dispatch</code> interface provides support
+  *  for the dynamic invocation of a service endpoint operations. The
+  *  <code>javax.xml.ws.Service</code>
+  *  interface acts as a factory for the creation of <code>Dispatch</code>
+@@ -38,7 +38,7 @@
+ public interface Dispatch<T> extends BindingProvider {
+ 
+     /** Invoke a service operation synchronously.
+-     * 
++     *
+      * The client is responsible for ensuring that the <code>msg</code> object
+      * when marshalled is formed according to the requirements of the protocol
+      * binding in use.
+@@ -59,10 +59,10 @@
+      *  invocation, the results of the operation are obtained by polling the
+      *  returned <code>Response</code>.
+      * <p>
+-     * The client is responsible for ensuring that the <code>msg</code> object 
++     * The client is responsible for ensuring that the <code>msg</code> object
+      * when marshalled is formed according to the requirements of the protocol
+      * binding in use.
+-     * 
++     *
+      * @param msg An object that will form the message or payload of
+      *     the message used to invoke the operation.
+      * @return The response message or message payload to the
+@@ -77,7 +77,7 @@
+      *  invocation, the results of the operation are communicated to the client
+      *  via the passed in <code>handler</code>.
+      * <p>
+-     * The client is responsible for ensuring that the <code>msg</code> object 
++     * The client is responsible for ensuring that the <code>msg</code> object
+      * when marshalled is formed according to the requirements of the protocol
+      * binding in use.
+      *
+@@ -102,7 +102,7 @@
+      *  the protocol in use is SOAP/HTTP, this method MUST block until
+      *  an HTTP response code has been received or an error occurs.
+      * <p>
+-     * The client is responsible for ensuring that the <code>msg</code> object 
++     * The client is responsible for ensuring that the <code>msg</code> object
+      * when marshalled is formed according to the requirements of the protocol
+      * binding in use.
+      *
+--- old/src/share/classes/javax/xml/ws/Endpoint.java	Thu Jul 30 18:54:24 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/ws/Endpoint.java	Thu Jul 30 18:54:23 2009
+@@ -69,18 +69,18 @@
+  *
+  **/
+ public abstract class Endpoint {
+-    
++
+     /** Standard property: name of WSDL service.
+      *  <p>Type: javax.xml.namespace.QName
+      **/
+     public static final String WSDL_SERVICE = "javax.xml.ws.wsdl.service";
+-    
++
+     /** Standard property: name of WSDL port.
+      *  <p>Type: javax.xml.namespace.QName
+      **/
+     public static final String WSDL_PORT = "javax.xml.ws.wsdl.port";
+-    
+-    
++
++
+     /**
+      * Creates an endpoint with the specified implementor object. If there is
+      * a binding specified via a BindingType annotation then it MUST be used else
+@@ -99,7 +99,7 @@
+     public static Endpoint create(Object implementor) {
+         return create(null, implementor);
+     }
+-    
++
+     /**
+      * Creates an endpoint with the specified binding type and
+      * implementor object.
+@@ -120,8 +120,8 @@
+     public static Endpoint create(String bindingId, Object implementor) {
+         return Provider.provider().createEndpoint(bindingId, implementor);
+     }
+-    
+-    
++
++
+     /**
+      * Returns the binding for this endpoint.
+      *
+@@ -128,7 +128,7 @@
+      * @return The binding for this endpoint
+      **/
+     public abstract Binding getBinding();
+-    
++
+     /**
+      * Returns the implementation object for this endpoint.
+      *
+@@ -135,7 +135,7 @@
+      * @return The implementor for this endpoint
+      **/
+     public abstract Object getImplementor();
+-    
++
+     /**
+      * Publishes this endpoint at the given address.
+      * The necessary server infrastructure will be created and
+@@ -147,20 +147,20 @@
+      *        MUST be compatible with the binding specified at the
+      *        time the endpoint was created.
+      *
+-     * @throws java.lang.IllegalArgumentException 
++     * @throws java.lang.IllegalArgumentException
+      *          If the provided address URI is not usable
+      *          in conjunction with the endpoint's binding.
+      *
+-     * @throws java.lang.IllegalStateException 
++     * @throws java.lang.IllegalStateException
+      *          If the endpoint has been published already or it has been stopped.
+      *
+-     * @throws java.lang.SecurityException 
++     * @throws java.lang.SecurityException
+      *          If a <code>java.lang.SecurityManger</code>
+      *          is being used and the application doesn't have the
+      *          <code>WebServicePermission("publishEndpoint")</code> permission.
+      **/
+     public abstract void publish(String address);
+-    
++
+     /**
+      * Creates and publishes an endpoint for the specified implementor
+      * object at the given address.
+@@ -180,7 +180,7 @@
+      *
+      * @return The newly created endpoint.
+      *
+-     * @throws java.lang.SecurityException 
++     * @throws java.lang.SecurityException
+      *          If a <code>java.lang.SecurityManger</code>
+      *          is being used and the application doesn't have the
+      *          <code>WebServicePermission("publishEndpoint")</code> permission.
+@@ -189,7 +189,7 @@
+     public static Endpoint publish(String address, Object implementor) {
+         return Provider.provider().createAndPublishEndpoint(address, implementor);
+     }
+-    
++
+     /**
+      * Publishes this endpoint at the provided server context.
+      * A server context encapsulates the server infrastructure
+@@ -201,22 +201,22 @@
+      * @param serverContext An object representing a server
+      *           context to be used for publishing the endpoint.
+      *
+-     * @throws java.lang.IllegalArgumentException 
++     * @throws java.lang.IllegalArgumentException
+      *              If the provided server context is not
+      *              supported by the implementation or turns
+      *              out to be unusable in conjunction with the
+      *              endpoint's binding.
+      *
+-     * @throws java.lang.IllegalStateException 
++     * @throws java.lang.IllegalStateException
+      *         If the endpoint has been published already or it has been stopped.
+      *
+-     * @throws java.lang.SecurityException 
++     * @throws java.lang.SecurityException
+      *          If a <code>java.lang.SecurityManger</code>
+      *          is being used and the application doesn't have the
+      *          <code>WebServicePermission("publishEndpoint")</code> permission.
+      **/
+     public abstract void publish(Object serverContext);
+-    
++
+     /**
+      * Stops publishing this endpoint.
+      *
+@@ -225,7 +225,7 @@
+      *
+      **/
+     public abstract void stop();
+-    
++
+     /**
+      * Returns true if the endpoint is in the published state.
+      *
+@@ -232,7 +232,7 @@
+      * @return <code>true</code> if the endpoint is in the published state.
+      **/
+     public abstract boolean isPublished();
+-    
++
+     /**
+      * Returns a list of metadata documents for the service.
+      *
+@@ -239,7 +239,7 @@
+      * @return <code>List&lt;javax.xml.transform.Source&gt;</code> A list of metadata documents for the service
+      **/
+     public abstract List<javax.xml.transform.Source> getMetadata();
+-    
++
+     /**
+      * Sets the metadata for this endpoint.
+      *
+@@ -251,7 +251,7 @@
+      *         has already been published.
+      **/
+     public abstract void setMetadata(List<javax.xml.transform.Source> metadata);
+-    
++
+     /**
+      * Returns the executor for this <code>Endpoint</code>instance.
+      *
+@@ -264,7 +264,7 @@
+      * @see java.util.concurrent.Executor
+      **/
+     public abstract java.util.concurrent.Executor getExecutor();
+-    
++
+     /**
+      * Sets the executor for this <code>Endpoint</code> instance.
+      *
+@@ -286,8 +286,8 @@
+      * @see java.util.concurrent.Executor
+      **/
+     public abstract void setExecutor(java.util.concurrent.Executor executor);
+-    
+-    
++
++
+     /**
+      * Returns the property bag for this <code>Endpoint</code> instance.
+      *
+@@ -295,7 +295,7 @@
+      *         associated with this instance.
+      **/
+     public abstract Map<String,Object> getProperties();
+-    
++
+     /**
+      * Sets the property bag for this <code>Endpoint</code> instance.
+      *
+@@ -303,7 +303,7 @@
+      *        this instance.
+      **/
+     public abstract void setProperties(Map<String,Object> properties);
+-    
++
+     /**
+      * Returns the <code>EndpointReference</code> associated with
+      * this <code>Endpoint</code> instance.
+@@ -320,7 +320,7 @@
+      * the specified <code>referenceParameters</code>.
+ 
+      * @throws WebServiceException If any error in the creation of
+-     * the <code>EndpointReference</code> or if the <code>Endpoint</code> is 
++     * the <code>EndpointReference</code> or if the <code>Endpoint</code> is
+      * not in the published state.
+      * @throws UnsupportedOperationException If this <code>BindingProvider</code>
+      * uses the XML/HTTP binding.
+@@ -330,8 +330,8 @@
+      * @since JAX-WS 2.1
+      **/
+     public abstract EndpointReference getEndpointReference(Element... referenceParameters);
+-    
+-    
++
++
+     /**
+      * Returns the <code>EndpointReference</code> associated with
+      * this <code>Endpoint</code> instance.
+@@ -339,7 +339,7 @@
+      * @param clazz Specifies the type of EndpointReference  that MUST be returned.
+      * @param referenceParameters Reference parameters to be associated with the
+      * returned <code>EndpointReference</code> instance.
+-     * @return EndpointReference of type <code>clazz</code> of this 
++     * @return EndpointReference of type <code>clazz</code> of this
+      * <code>Endpoint<code> instance.
+      * If the returned <code>EndpointReference</code> is of type
+      * <code>W3CEndpointReference</code> then it MUST contain the
+@@ -346,7 +346,7 @@
+      * the specified <code>referenceParameters</code>.
+ 
+      * @throws WebServiceException If any error in the creation of
+-     * the <code>EndpointReference</code> or if the <code>Endpoint</code> is 
++     * the <code>EndpointReference</code> or if the <code>Endpoint</code> is
+      * not in the published state or if the <code>clazz</code> is not a supported
+      * <code>EndpointReference</code> type.
+      * @throws UnsupportedOperationException If this <code>BindingProvider</code>
+--- old/src/share/classes/javax/xml/ws/EndpointReference.java	Thu Jul 30 18:54:28 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/ws/EndpointReference.java	Thu Jul 30 18:54:27 2009
+@@ -35,27 +35,27 @@
+ 
+ /**
+  * This class represents an WS-Addressing EndpointReference
+- * which is a remote reference to a web service endpoint. 
++ * which is a remote reference to a web service endpoint.
+  * See <a href="http://www.w3.org/TR/2006/REC-ws-addr-core-20060509/">
+- * Web Services Addressing 1.0 - Core</a> 
++ * Web Services Addressing 1.0 - Core</a>
+  * for more information on WS-Addressing EndpointReferences.
+- * <p>  
++ * <p>
+  * This class is immutable as the typical web service developer
+  * need not be concerned with its contents.  The web service
+- * developer should use this class strictly as a mechanism to 
+- * reference a remote web service endpoint. See the {@link Service} APIs 
+- * that clients can use to that utilize an <code>EndpointReference</code>. 
+- * See the {@link javax.xml.ws.Endpoint}, and 
+- * {@link javax.xml.ws.BindingProvider} APIs on how 
+- * <code>EndpointReferences</code> can be created for published 
++ * developer should use this class strictly as a mechanism to
++ * reference a remote web service endpoint. See the {@link Service} APIs
++ * that clients can use to that utilize an <code>EndpointReference</code>.
++ * See the {@link javax.xml.ws.Endpoint}, and
++ * {@link javax.xml.ws.BindingProvider} APIs on how
++ * <code>EndpointReferences</code> can be created for published
+  * endpoints.
+  * <p>
+  * Concrete implementations of this class will represent
+  * an <code>EndpointReference</code> for a particular version of Addressing.
+  * For example the {@link W3CEndpointReference} is for use
+- * with W3C Web Services Addressing 1.0 - Core Recommendation. 
++ * with W3C Web Services Addressing 1.0 - Core Recommendation.
+  * If JAX-WS implementors need to support different versions
+- * of addressing, they should write their own 
++ * of addressing, they should write their own
+  * <code>EndpointReference</code> subclass for that version.
+  * This will allow a JAX-WS implementation to create
+  * vendor specific <code>EndpointReferences</code> that that
+@@ -62,16 +62,16 @@
+  * vendor can use to flag a different version of
+  * addressing.
+  * <p>
+- * Web service developers that wish to pass or return 
++ * Web service developers that wish to pass or return
+  * <code>EndpointReferences</code> in Java methods in an
+  * SEI should use
+  * concrete instances of an <code>EndpointReference</code> such
+- * as the <code>W3CEndpointReference</code>.  This way the 
++ * as the <code>W3CEndpointReference</code>.  This way the
+  * schema mapped from the SEI will be more descriptive of the
+  * type of endpoint reference being passed.
+  * <p>
+  * JAX-WS implementors are expected to extract the XML infoset
+- * from an <CODE>EndpointReferece</CODE> using the 
++ * from an <CODE>EndpointReferece</CODE> using the
+  * <code>{@link EndpointReference#writeTo}</code>
+  * method.
+  * <p>
+@@ -123,7 +123,7 @@
+ 
+     /**
+      * The <code>getPort</code> method returns a proxy. If there
+-     * are any reference parameters in the 
++     * are any reference parameters in the
+      * <code>EndpointReference</code> instance, then those reference
+      * parameters MUST appear as SOAP headers, indicating them to be
+      * reference parameters, on all messages sent to the endpoint.
+@@ -141,15 +141,15 @@
+      * <code>EndpointReference</code> instance MUST contain an implementation understood
+      * <code>serviceName</code> metadata.
+      * <p>
+-     * Because this port is not created from a <code>Service</code> object, handlers 
+-     * will not automatically be configured, and the <code>HandlerResolver</code> 
+-     * and <code>Executor</code> cannot be get or set for this port. The 
++     * Because this port is not created from a <code>Service</code> object, handlers
++     * will not automatically be configured, and the <code>HandlerResolver</code>
++     * and <code>Executor</code> cannot be get or set for this port. The
+      * <code>BindingProvider().getBinding().setHandlerChain()</code>
+      * method can be used to manually configure handlers for this port.
+      *
+      *
+      * @param serviceEndpointInterface Service endpoint interface
+-     * @param features  An array of <code>WebServiceFeatures</code> to configure on the 
++     * @param features  An array of <code>WebServiceFeatures</code> to configure on the
+      *                proxy.  Supported features not in the <code>features
+      *                </code> parameter will have their default values.
+      * @return Object Proxy instance that supports the
+@@ -159,7 +159,7 @@
+      *                  <LI>If there is an error during creation
+      *                      of the proxy
+      *                  <LI>If there is any missing WSDL metadata
+-     *                      as required by this method 
++     *                      as required by this method
+      *                  <LI>If this
+      *                      <code>endpointReference</code>
+      *                      is invalid
+@@ -166,7 +166,7 @@
+      *                  <LI>If an illegal
+      *                      <code>serviceEndpointInterface</code>
+      *                      is specified
+-     *                  <LI>If a feature is enabled that is not compatible with 
++     *                  <LI>If a feature is enabled that is not compatible with
+      *                      this port or is unsupported.
+      *                   </UL>
+      *
+--- old/src/share/classes/javax/xml/ws/FaultAction.java	Thu Jul 30 18:54:31 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/ws/FaultAction.java	Thu Jul 30 18:54:31 2009
+@@ -33,15 +33,15 @@
+ 
+ /**
+  * The <code>FaultAction</code> annotation is used inside an {@link Action}
+- * annotation to allow an explicit association of a WS-Addressing 
+- * <code>Action</code> message addressing property with the <code>fault</code> 
++ * annotation to allow an explicit association of a WS-Addressing
++ * <code>Action</code> message addressing property with the <code>fault</code>
+  * messages of the WSDL operation mapped from the exception class.
+  * <p>
+- * In this version of JAX-WS there is no standard way to specify 
+- * <code>Action</code> values in a WSDL and there is no standard default value.  It is intended that, 
++ * In this version of JAX-WS there is no standard way to specify
++ * <code>Action</code> values in a WSDL and there is no standard default value.  It is intended that,
+  * after the W3C WG on WS-Addressing has defined these items in a recommendation,
+  * a future version of JAX-WS will require the new standards.
+- * 
++ *
+  * @see Action
+  *
+  * @since JAX-WS 2.1
+--- old/src/share/classes/javax/xml/ws/Holder.java	Thu Jul 30 18:54:35 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/ws/Holder.java	Thu Jul 30 18:54:34 2009
+@@ -25,7 +25,7 @@
+ 
+ package javax.xml.ws;
+ 
+-/** 
++/**
+  *  Holds a value of type <code>T</code>.
+  *
+  *  @since JAX-WS 2.0
+@@ -36,7 +36,7 @@
+    * The value contained in the holder.
+    **/
+   public T value;
+-    
++
+   /**
+    * Creates a new holder with a <code>null</code> value.
+    **/
+--- old/src/share/classes/javax/xml/ws/LogicalMessage.java	Thu Jul 30 18:54:38 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/ws/LogicalMessage.java	Thu Jul 30 18:54:38 2009
+@@ -41,7 +41,7 @@
+    *  returns a new <code>Source</code> that may be used to retrieve the entire
+    *  message payload.
+    *
+-   *  <p>If the returned <code>Source</code> is an instance of 
++   *  <p>If the returned <code>Source</code> is an instance of
+    *  <code>DOMSource</code>, then
+    *  modifications to the encapsulated DOM tree change the message
+    *  payload in-place, there is no need to susequently call
+@@ -48,7 +48,7 @@
+    *  <code>setPayload</code>. Other types of <code>Source</code> provide only
+    *  read access to the message payload.
+    *
+-   *  @return The contained message payload; returns <code>null</code> if no 
++   *  @return The contained message payload; returns <code>null</code> if no
+    *          payload is present in this message.
+   **/
+   public Source getPayload();
+@@ -69,7 +69,7 @@
+    *
+    *  @param  context The JAXBContext that should be used to unmarshall
+    *          the message payload
+-   *  @return The contained message payload; returns <code>null</code> if no 
++   *  @return The contained message payload; returns <code>null</code> if no
+    *          payload is present in this message
+    *  @throws WebServiceException If an error occurs when using a supplied
+    *     JAXBContext to unmarshall the payload. The cause of
+@@ -80,7 +80,7 @@
+   /** Sets the message payload
+    *
+    *  @param  payload message payload
+-   *  @param  context The JAXBContext that should be used to marshall 
++   *  @param  context The JAXBContext that should be used to marshall
+    *          the payload
+    *  @throws java.lang.UnsupportedOperationException If this
+    *          operation is not supported
+--- old/src/share/classes/javax/xml/ws/RequestWrapper.java	Thu Jul 30 18:54:42 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/ws/RequestWrapper.java	Thu Jul 30 18:54:41 2009
+@@ -31,16 +31,16 @@
+ import java.lang.annotation.ElementType;
+ import java.lang.annotation.RetentionPolicy;
+ 
+-/** 
++/**
+ 
+- * Used to annotate methods in the Service Endpoint Interface with the request 
+- * wrapper bean to be used at runtime. The default value of the <code>localName</code> is 
++ * Used to annotate methods in the Service Endpoint Interface with the request
++ * wrapper bean to be used at runtime. The default value of the <code>localName</code> is
+  * the <code>operationName</code>, as defined in <code>WebMethod</code> annotation and the
+  * <code>targetNamespace</code> is the target namespace of the SEI.
+  * <p> When starting from Java this annotation is used resolve
+  * overloading conflicts in document literal mode. Only the <code>className</code>
+  * is required in this case.
+- * 
++ *
+  *  @since JAX-WS 2.0
+  **/
+ 
+@@ -64,4 +64,3 @@
+   public String className() default "";
+ 
+ }
+-
+--- old/src/share/classes/javax/xml/ws/RespectBinding.java	Thu Jul 30 18:54:45 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/ws/RespectBinding.java	Thu Jul 30 18:54:45 2009
+@@ -52,9 +52,9 @@
+  *  <li> ENABLED: In this Mode, a JAX-WS runtime MUST assure that all
+  *  required <code>wsdl:binding</code> extensions are either understood
+  *  and used by the runtime, or explicitly disabled by the web service
+- *  application.  A web service application can disable a particular 
+- *  extension that has a known WebServiceFeature using either the appropriate 
+- *  annotation associated with that WebServiceFeature on the server, or one of 
++ *  application.  A web service application can disable a particular
++ *  extension that has a known WebServiceFeature using either the appropriate
++ *  annotation associated with that WebServiceFeature on the server, or one of
+  *  the following methods on the client:
+  *    <ul>
+  *      <li>{@link Service#getPort(QName,Class,WebServiceFeature...)}
+--- old/src/share/classes/javax/xml/ws/RespectBindingFeature.java	Thu Jul 30 18:54:49 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/ws/RespectBindingFeature.java	Thu Jul 30 18:54:48 2009
+@@ -48,9 +48,9 @@
+  *  <li> ENABLED: In this Mode, a JAX-WS runtime MUST assure that all
+  *  required <code>wsdl:binding</code> extensions are either understood
+     and used by the runtime, or explicitly disabled by the web service
+- *  application.  A web service application can disable a particular 
+- *  extension that has a known WebServiceFeature using either the appropriate 
+- *  annotation associated with that WebServiceFeature on the server, or one of 
++ *  application.  A web service application can disable a particular
++ *  extension that has a known WebServiceFeature using either the appropriate
++ *  annotation associated with that WebServiceFeature on the server, or one of
+  *  the following methods on the client:
+  *    <ul>
+  *      <li>{@link Service#getPort(QName,Class,WebServiceFeature...)}
+@@ -64,19 +64,19 @@
+  *      <li>One of the <code>getXXXPort(WebServiceFeatures...)</code> methods on a
+  *          generated <code>Service</code>.
+  *    </ul>
+- *  The runtime MUST also make sure that binding of 
++ *  The runtime MUST also make sure that binding of
+  *  SEI parameters/return values respect the <code>wsdl:binding</code>.
+  *  With this feature enabled, if a required (<code>wsdl:required="true"</code>)
+  *  <code>wsdl:binding</code> extension is in the WSDL and it is not
+- *  supported by a JAX-WS runtime and it has not 
++ *  supported by a JAX-WS runtime and it has not
+  *  been explicitly turned off by the web service developer, then
+- *  that JAX-WS runtime MUST behave appropriately based on whether it is 
++ *  that JAX-WS runtime MUST behave appropriately based on whether it is
+  *  on the client or server:
+  *  <UL>
+- *    <li>Client: runtime MUST throw a 
++ *    <li>Client: runtime MUST throw a
+  *  <code>WebServiceException</code> no sooner than when one of the methods
+  *  above is invoked but no later than the first invocation of an endpoint
+- *  operation. 
++ *  operation.
+  *    <li>Server: throw a WebServiceException and the endpoint MUST fail to deploy
+  *  </ul>
+  *  <li> DISABLED: In this Mode, an implementation may choose whether
+@@ -83,7 +83,7 @@
+  *  to inspect the <code>wsdl:binding<code> or not and to what degree
+  *  the <code>wsdl:binding</code> will be inspected.  For example,
+  *  one implementation may choose to behave as if this feature is enabled,
+- *  another implementation may only choose to verify the SEI's 
++ *  another implementation may only choose to verify the SEI's
+  *  parameter/return type bindings.
+  * </ul>
+  *
+@@ -93,12 +93,12 @@
+  */
+ public final class RespectBindingFeature extends WebServiceFeature {
+     /**
+-     * 
++     *
+      * Constant value identifying the RespectBindingFeature
+      */
+     public static final String ID = "javax.xml.ws.RespectBindingFeature";
+-    
+-    
++
++
+     /**
+      * Creates an <code>RespectBindingFeature</code>.
+      * The instance created will be enabled.
+@@ -109,7 +109,7 @@
+ 
+     /**
+      * Creates an RespectBindingFeature
+-     * 
++     *
+      * @param enabled specifies whether this feature should
+      * be enabled or not.
+      */
+@@ -116,7 +116,7 @@
+     public RespectBindingFeature(boolean enabled) {
+         this.enabled = enabled;
+     }
+-    
++
+     /**
+      * {@inheritDoc}
+      */
+--- old/src/share/classes/javax/xml/ws/Response.java	Thu Jul 30 18:54:52 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/ws/Response.java	Thu Jul 30 18:54:52 2009
+@@ -28,7 +28,7 @@
+ import java.util.Map;
+ import java.util.concurrent.Future;
+ 
+-/** The <code>Response</code> interface provides methods used to obtain the  
++/** The <code>Response</code> interface provides methods used to obtain the
+  *  payload and context of a message sent in response to an operation
+  *  invocation.
+  *
+@@ -35,7 +35,7 @@
+  *  <p>For asynchronous operation invocations it provides additional methods
+  *  to check the status of the request. The <code>get(...)</code> methods may
+  *  throw the standard
+- *  set of exceptions and their cause may be a <code>RemoteException</code> or a  
++ *  set of exceptions and their cause may be a <code>RemoteException</code> or a
+  *  {@link WebServiceException} that represents the error that occured during the
+  *  asynchronous method invocation.</p>
+  *
+--- old/src/share/classes/javax/xml/ws/ResponseWrapper.java	Thu Jul 30 18:54:56 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/ws/ResponseWrapper.java	Thu Jul 30 18:54:55 2009
+@@ -29,15 +29,15 @@
+ import java.lang.annotation.Retention;
+ import java.lang.annotation.ElementType;
+ import java.lang.annotation.RetentionPolicy;
+-/** 
+- * Used to annotate methods in the Service Endpoint Interface with the response 
+- * wrapper bean to be used at runtime. The default value of the <code>localName</code> is 
++/**
++ * Used to annotate methods in the Service Endpoint Interface with the response
++ * wrapper bean to be used at runtime. The default value of the <code>localName</code> is
+  * the <code>operationName</code> as defined in <code>WebMethod</code> annotation appended with
+  * <code>Response</code> and the <code>targetNamespace</code> is the target namespace of the SEI.
+  * <p> When starting from Java this annotation is used resolve
+  * overloading conflicts in document literal mode. Only the <code>className</code>
+  * is required in this case.
+- * 
++ *
+  *  @since JAX-WS 2.0
+ **/
+ 
+@@ -75,4 +75,3 @@
+   public String className() default "";
+ 
+ }
+-
+--- old/src/share/classes/javax/xml/ws/Service.java	Thu Jul 30 18:54:59 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/ws/Service.java	Thu Jul 30 18:54:59 2009
+@@ -63,7 +63,7 @@
+  * @see java.util.concurrent.Executor
+  **/
+ public class Service {
+-    
++
+     private ServiceDelegate delegate;
+     /**
+      * The orientation of a dynamic client or service. <code>MESSAGE</code> provides
+@@ -71,15 +71,15 @@
+      * payload only.
+      **/
+     public enum Mode { MESSAGE, PAYLOAD };
+-    
++
+     protected Service(java.net.URL wsdlDocumentLocation, QName serviceName) {
+         delegate = Provider.provider().createServiceDelegate(wsdlDocumentLocation,
+                 serviceName,
+                 this.getClass());
+     }
+-    
+-    
+-    /** 
++
++
++    /**
+      * The <code>getPort</code> method returns a proxy. A service client
+      * uses this proxy to invoke operations on the target
+      * service endpoint. The <code>serviceEndpointInterface</code>
+@@ -111,8 +111,8 @@
+             Class<T> serviceEndpointInterface) {
+         return delegate.getPort(portName, serviceEndpointInterface);
+     }
+-    
+-    /** 
++
++    /**
+      * The <code>getPort</code> method returns a proxy. A service client
+      * uses this proxy to invoke operations on the target
+      * service endpoint. The <code>serviceEndpointInterface</code>
+@@ -123,7 +123,7 @@
+      *                  the WSDL service description.
+      * @param serviceEndpointInterface Service endpoint interface
+      *                  supported by the dynamic proxy instance.
+-     * @param features  A list of WebServiceFeatures to configure on the 
++     * @param features  A list of WebServiceFeatures to configure on the
+      *                proxy.  Supported features not in the <code>features
+      *                </code> parameter will have their default values.
+      * @return Object Proxy instance that
+@@ -145,16 +145,16 @@
+      * @see java.lang.reflect.Proxy
+      * @see java.lang.reflect.InvocationHandler
+      * @see WebServiceFeature
+-     * 
++     *
+      * @since JAX-WS 2.1
+      **/
+     public <T> T getPort(QName portName,
+             Class<T> serviceEndpointInterface, WebServiceFeature... features) {
+         return delegate.getPort(portName, serviceEndpointInterface, features);
+-    }       
+-    
+-    
+-    /** 
++    }
++
++
++    /**
+      * The <code>getPort</code> method returns a proxy. The parameter
+      * <code>serviceEndpointInterface</code> specifies the service
+      * endpoint interface that is supported by the returned proxy.
+@@ -180,8 +180,8 @@
+     public <T> T getPort(Class<T> serviceEndpointInterface) {
+         return delegate.getPort(serviceEndpointInterface);
+     }
+-       
+-    
++
++
+     /**
+      * The <code>getPort</code> method returns a proxy. The parameter
+      * <code>serviceEndpointInterface</code> specifies the service
+@@ -192,7 +192,7 @@
+      * The returned proxy should not be reconfigured by the client.
+      *
+      * @param serviceEndpointInterface Service endpoint interface.
+-     * @param features  A list of WebServiceFeatures to configure on the 
++     * @param features  A list of WebServiceFeatures to configure on the
+      *                proxy.  Supported features not in the <code>features
+      *                </code> parameter will have their default values.
+      * @return Object instance that supports the
+@@ -214,17 +214,17 @@
+      *
+      * @since JAX-WS 2.1
+      **/
+-    public <T> T getPort(Class<T> serviceEndpointInterface, 
++    public <T> T getPort(Class<T> serviceEndpointInterface,
+             WebServiceFeature... features) {
+         return delegate.getPort(serviceEndpointInterface, features);
+     }
+ 
+-    
+-    /** 
++
++    /**
+      * The <code>getPort</code> method returns a proxy.
+      * The parameter <code>endpointReference</code> specifies the
+      * endpoint that will be invoked by the returned proxy.  If there
+-     * are any reference parameters in the 
++     * are any reference parameters in the
+      * <code>endpointReference</code>, then those reference
+      * parameters MUST appear as SOAP headers, indicating them to be
+      * reference parameters, on all messages sent to the endpoint.
+@@ -231,7 +231,7 @@
+      * The <code>endpointReference's</code> address MUST be used
+      * for invocations on the endpoint.
+      * The parameter <code>serviceEndpointInterface</code> specifies
+-     * the service endpoint interface that is supported by the 
++     * the service endpoint interface that is supported by the
+      * returned proxy.
+      * In the implementation of this method, the JAX-WS
+      * runtime system takes the responsibility of selecting a protocol
+@@ -238,15 +238,15 @@
+      * binding (and a port) and configuring the proxy accordingly from
+      * the WSDL associated with this <code>Service</code> instance or
+      * from the metadata from the <code>endpointReference</code>.
+-     * If this <code>Service</code> instance has a WSDL and 
+-     * the <code>endpointReference</code> metadata 
++     * If this <code>Service</code> instance has a WSDL and
++     * the <code>endpointReference</code> metadata
+      * also has a WSDL, then the WSDL from this instance MUST be used.
+      * If this <code>Service</code> instance does not have a WSDL and
+-     * the <code>endpointReference</code> does have a WSDL, then the 
++     * the <code>endpointReference</code> does have a WSDL, then the
+      * WSDL from the <code>endpointReference</code> MAY be used.
+      * The returned proxy should not be reconfigured by the client.
+-     * If this <code>Service</code> instance has a known proxy 
+-     * port that matches the information contained in 
++     * If this <code>Service</code> instance has a known proxy
++     * port that matches the information contained in
+      * the WSDL,
+      * then that proxy is returned, otherwise a WebServiceException
+      * is thrown.
+@@ -255,8 +255,8 @@
+      * <pre>
+      * <code>port = service.getPort(portName, serviceEndpointInterface);</code>
+      * </pre>
+-     * where the <code>portName</code> is retrieved from the 
+-     * metadata of the <code>endpointReference</code> or from the 
++     * where the <code>portName</code> is retrieved from the
++     * metadata of the <code>endpointReference</code> or from the
+      * <code>serviceEndpointInterface</code> and the WSDL
+      * associated with this <code>Service</code> instance.
+      *
+@@ -264,7 +264,7 @@
+      * for the target service endpoint that will be invoked by the
+      * returned proxy.
+      * @param serviceEndpointInterface Service endpoint interface.
+-     * @param features  A list of <code>WebServiceFeatures</code> to configure on the 
++     * @param features  A list of <code>WebServiceFeatures</code> to configure on the
+      *                proxy.  Supported features not in the <code>features
+      *                </code> parameter will have their default values.
+      * @return Object Proxy instance that supports the
+@@ -295,9 +295,9 @@
+     public <T> T getPort(EndpointReference endpointReference,
+            Class<T> serviceEndpointInterface, WebServiceFeature... features) {
+         return delegate.getPort(endpointReference, serviceEndpointInterface, features);
+-    }      
+-    
+-    /** 
++    }
++
++    /**
+      * Creates a new port for the service. Ports created in this way contain
+      * no WSDL port type information and can only be used for creating
+      * <code>Dispatch</code>instances.
+@@ -315,9 +315,9 @@
+     public void addPort(QName portName, String bindingId, String endpointAddress) {
+         delegate.addPort(portName, bindingId, endpointAddress);
+     }
+-    
+-        
+-    /** 
++
++
++    /**
+      * Creates a <code>Dispatch</code> instance for use with objects of
+      * the user's choosing.
+      *
+@@ -344,9 +344,9 @@
+     public <T> Dispatch<T> createDispatch(QName portName, Class<T> type, Mode mode) {
+         return delegate.createDispatch(portName, type, mode);
+     }
+-    
+-    
+-    /** 
++
++
++    /**
+      * Creates a <code>Dispatch</code> instance for use with objects of
+      * the user's choosing.
+      *
+@@ -360,14 +360,14 @@
+      * protocol, this parameter controls whether the user will work with
+      * SOAP messages or the contents of a SOAP body. Mode MUST be <code>MESSAGE</code>
+      * when type is <code>SOAPMessage</code>.
+-     * @param features  A list of <code>WebServiceFeatures</code> to configure on the 
++     * @param features  A list of <code>WebServiceFeatures</code> to configure on the
+      *                proxy.  Supported features not in the <code>features
+      *                </code> parameter will have their default values.
+      *
+      * @return Dispatch instance.
+      * @throws WebServiceException If any error in the creation of
+-     *                  the <code>Dispatch</code> object or if a 
+-     *                  feature is enabled that is not compatible with 
++     *                  the <code>Dispatch</code> object or if a
++     *                  feature is enabled that is not compatible with
+      *                  this port or is unsupported.
+      *
+      * @see javax.xml.transform.Source
+@@ -376,16 +376,16 @@
+      *
+      * @since JAX-WS 2.1
+      **/
+-    public <T> Dispatch<T> createDispatch(QName portName, Class<T> type, 
++    public <T> Dispatch<T> createDispatch(QName portName, Class<T> type,
+             Service.Mode mode, WebServiceFeature... features) {
+         return delegate.createDispatch(portName, type, mode, features);
+-    }     
+-    
+-    
+-    /** 
++    }
++
++
++    /**
+      * Creates a <code>Dispatch</code> instance for use with objects of
+      * the user's choosing. If there
+-     * are any reference parameters in the 
++     * are any reference parameters in the
+      * <code>endpointReference</code>, then those reference
+      * parameters MUST appear as SOAP headers, indicating them to be
+      * reference parameters, on all messages sent to the endpoint.
+@@ -396,12 +396,12 @@
+      * binding (and a port) and configuring the dispatch accordingly from
+      * the WSDL associated with this <code>Service</code> instance or
+      * from the metadata from the <code>endpointReference</code>.
+-     * If this <code>Service</code> instance has a WSDL and 
++     * If this <code>Service</code> instance has a WSDL and
+      * the <code>endpointReference</code>
+      * also has a WSDL in its metadata, then the WSDL from this instance MUST be used.
+      * If this <code>Service</code> instance does not have a WSDL and
+-     * the <code>endpointReference</code> does have a WSDL, then the 
+-     * WSDL from the <code>endpointReference</code> MAY be used.     
++     * the <code>endpointReference</code> does have a WSDL, then the
++     * WSDL from the <code>endpointReference</code> MAY be used.
+      * An implementation MUST be able to retrieve the <code>portName</code> from the
+      * <code>endpointReference</code> metadata.
+      * <p>
+@@ -409,7 +409,7 @@
+      * <pre>
+      * <code>dispatch = service.createDispatch(portName, type, mode, features);</code>
+      * </pre>
+-     * where the <code>portName</code> is retrieved from the 
++     * where the <code>portName</code> is retrieved from the
+      * WSDL or <code>EndpointReference</code> metadata.
+      *
+      * @param endpointReference  The <code>EndpointReference</code>
+@@ -424,12 +424,12 @@
+      * protocol, this parameter controls whether the user will work with
+      * SOAP messages or the contents of a SOAP body. Mode MUST be <code>MESSAGE</code>
+      * when type is <code>SOAPMessage</code>.
+-     * @param features  An array of <code>WebServiceFeatures</code> to configure on the 
++     * @param features  An array of <code>WebServiceFeatures</code> to configure on the
+      *                proxy.  Supported features not in the <code>features
+      *                </code> parameter will have their default values.
+      *
+      * @return Dispatch instance
+-     * @throws WebServiceException 
++     * @throws WebServiceException
+      *                  <UL>
+      *                    <LI>If there is any missing WSDL metadata
+      *                      as required by this method.
+@@ -441,7 +441,7 @@
+      *                    from the <code>EndpointReference</code> metadata.
+      *                    <li>If any error in the creation of
+      *                     the <code>Dispatch</code> object.
+-     *                    <li>If a feature is enabled that is not 
++     *                    <li>If a feature is enabled that is not
+      *                    compatible with this port or is unsupported.
+      *                  </UL>
+      *
+@@ -452,12 +452,12 @@
+      * @since JAX-WS 2.1
+      **/
+     public <T> Dispatch<T> createDispatch(EndpointReference endpointReference,
+-            Class<T> type, Service.Mode mode, 
++            Class<T> type, Service.Mode mode,
+             WebServiceFeature... features) {
+         return delegate.createDispatch(endpointReference, type, mode, features);
+-    }     
+-    
+-    /** 
++    }
++
++    /**
+      * Creates a <code>Dispatch</code> instance for use with JAXB
+      * generated objects.
+      *
+@@ -480,9 +480,9 @@
+             Mode mode) {
+         return delegate.createDispatch(portName, context,  mode);
+     }
+-        
+-    
+-    /** 
++
++
++    /**
+      * Creates a <code>Dispatch</code> instance for use with JAXB
+      * generated objects.
+      *
+@@ -494,14 +494,14 @@
+      * protocol messages or message payloads. E.g. when using the SOAP
+      * protocol, this parameter controls whether the user will work with
+      * SOAP messages or the contents of a SOAP body.
+-     * @param features  A list of <code>WebServiceFeatures</code> to configure on the 
++     * @param features  A list of <code>WebServiceFeatures</code> to configure on the
+      *                proxy.  Supported features not in the <code>features
+      *                </code> parameter will have their default values.
+      *
+      * @return Dispatch instance.
+      * @throws WebServiceException If any error in the creation of
+-     *                  the <code>Dispatch</code> object or if a 
+-     *                  feature is enabled that is not compatible with 
++     *                  the <code>Dispatch</code> object or if a
++     *                  feature is enabled that is not compatible with
+      *                  this port or is unsupported.
+      *
+      * @see javax.xml.bind.JAXBContext
+@@ -512,13 +512,13 @@
+     public Dispatch<Object> createDispatch(QName portName,
+             JAXBContext context, Service.Mode mode, WebServiceFeature... features) {
+         return delegate.createDispatch(portName, context, mode, features);
+-    }      
+-    
+-    
+-    /** 
++    }
++
++
++    /**
+      * Creates a <code>Dispatch</code> instance for use with JAXB
+      * generated objects. If there
+-     * are any reference parameters in the 
++     * are any reference parameters in the
+      * <code>endpointReference</code>, then those reference
+      * parameters MUST appear as SOAP headers, indicating them to be
+      * reference parameters, on all messages sent to the endpoint.
+@@ -529,21 +529,21 @@
+      * binding (and a port) and configuring the dispatch accordingly from
+      * the WSDL associated with this <code>Service</code> instance or
+      * from the metadata from the <code>endpointReference</code>.
+-     * If this <code>Service</code> instance has a WSDL and 
++     * If this <code>Service</code> instance has a WSDL and
+      * the <code>endpointReference</code>
+      * also has a WSDL in its metadata, then the WSDL from this instance
+      * MUST be used.
+      * If this <code>Service</code> instance does not have a WSDL and
+-     * the <code>endpointReference</code> does have a WSDL, then the 
+-     * WSDL from the <code>endpointReference</code> MAY be used.      
++     * the <code>endpointReference</code> does have a WSDL, then the
++     * WSDL from the <code>endpointReference</code> MAY be used.
+      * An implementation MUST be able to retrieve the <code>portName</code> from the
+-     * <code>endpointReference</code> metadata. 
++     * <code>endpointReference</code> metadata.
+      * <p>
+      * This method behavies the same as calling
+      * <pre>
+      * <code>dispatch = service.createDispatch(portName, context, mode, features);</code>
+      * </pre>
+-     * where the <code>portName</code> is retrieved from the 
++     * where the <code>portName</code> is retrieved from the
+      * WSDL or <code>endpointReference</code> metadata.
+      *
+      * @param endpointReference  The <code>EndpointReference</code>
+@@ -556,12 +556,12 @@
+      * protocol messages or message payloads. E.g. when using the SOAP
+      * protocol, this parameter controls whether the user will work with
+      * SOAP messages or the contents of a SOAP body.
+-     * @param features  An array of <code>WebServiceFeatures</code> to configure on the 
++     * @param features  An array of <code>WebServiceFeatures</code> to configure on the
+      *                proxy.  Supported features not in the <code>features
+      *                </code> parameter will have their default values.
+      *
+      * @return Dispatch instance
+-     * @throws WebServiceException 
++     * @throws WebServiceException
+      *                  <UL>
+      *                    <li>If there is any missing WSDL metadata
+      *                      as required by this method.
+@@ -573,7 +573,7 @@
+      *                    from the <code>EndpointReference</code> metadata.
+      *                    <li>If any error in the creation of
+      *                    the <code>Dispatch</code> object.
+-     *                    <li>if a feature is enabled that is not 
++     *                    <li>if a feature is enabled that is not
+      *                    compatible with this port or is unsupported.
+      *                  </UL>
+      *
+@@ -586,9 +586,9 @@
+             JAXBContext context, Service.Mode mode,
+             WebServiceFeature... features) {
+         return delegate.createDispatch(endpointReference, context, mode, features);
+-    }    
+-    
+-    /** 
++    }
++
++    /**
+      * Gets the name of this service.
+      * @return Qualified name of this service
+      **/
+@@ -595,8 +595,8 @@
+     public QName getServiceName() {
+         return delegate.getServiceName();
+     }
+-    
+-    /** 
++
++    /**
+      * Returns an <code>Iterator</code> for the list of
+      * <code>QName</code>s of service endpoints grouped by this
+      * service
+@@ -609,8 +609,8 @@
+     public Iterator<javax.xml.namespace.QName> getPorts() {
+         return delegate.getPorts();
+     }
+-    
+-    /** 
++
++    /**
+      * Gets the location of the WSDL document for this Service.
+      *
+      * @return URL for the location of the WSDL document for
+@@ -619,7 +619,7 @@
+     public java.net.URL getWSDLDocumentLocation() {
+         return delegate.getWSDLDocumentLocation();
+     }
+-    
++
+     /**
+      * Returns the configured handler resolver.
+      *
+@@ -630,7 +630,7 @@
+     public HandlerResolver getHandlerResolver() {
+         return delegate.getHandlerResolver();
+     }
+-    
++
+     /**
+      * Sets the <code>HandlerResolver</code> for this <code>Service</code>
+      * instance.
+@@ -647,7 +647,7 @@
+     public void setHandlerResolver(HandlerResolver handlerResolver) {
+         delegate.setHandlerResolver(handlerResolver);
+     }
+-    
++
+     /**
+      * Returns the executor for this <code>Service</code>instance.
+      *
+@@ -662,7 +662,7 @@
+     public java.util.concurrent.Executor getExecutor() {
+         return delegate.getExecutor();
+     }
+-    
++
+     /**
+      * Sets the executor for this <code>Service</code> instance.
+      *
+@@ -681,7 +681,7 @@
+     public void setExecutor(java.util.concurrent.Executor executor) {
+         delegate.setExecutor(executor);
+     }
+-    
++
+     /**
+      * Creates a <code>Service</code> instance.
+      *
+@@ -699,7 +699,7 @@
+             QName serviceName) {
+         return new Service(wsdlDocumentLocation, serviceName);
+     }
+-    
++
+     /**
+      * Creates a <code>Service</code> instance.
+      *
+@@ -711,6 +711,3 @@
+         return new Service(null, serviceName);
+     }
+ }
+-
+-
+-
+--- old/src/share/classes/javax/xml/ws/ServiceMode.java	Thu Jul 30 18:55:03 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/ws/ServiceMode.java	Thu Jul 30 18:55:03 2009
+@@ -32,7 +32,7 @@
+ import java.lang.annotation.RetentionPolicy;
+ import java.lang.annotation.Inherited;
+ 
+-/** 
++/**
+  * Used to indicate whether a {@link Provider} implementation wishes to work
+  * with entire protocol messages or just with protocol message payloads.
+  *
+--- old/src/share/classes/javax/xml/ws/WebEndpoint.java	Thu Jul 30 18:55:07 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/ws/WebEndpoint.java	Thu Jul 30 18:55:06 2009
+@@ -31,7 +31,7 @@
+ import java.lang.annotation.ElementType;
+ import java.lang.annotation.RetentionPolicy;
+ 
+-/** 
++/**
+  *  Used to annotate the <code>get<em>PortName</em>()</code>
+  *  methods of a generated service interface.
+  *
+--- old/src/share/classes/javax/xml/ws/WebFault.java	Thu Jul 30 18:55:10 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/ws/WebFault.java	Thu Jul 30 18:55:10 2009
+@@ -31,8 +31,8 @@
+ import java.lang.annotation.ElementType;
+ import java.lang.annotation.RetentionPolicy;
+ 
+-/** 
+- * Used to annotate service specific exception classes to customize 
++/**
++ * Used to annotate service specific exception classes to customize
+  * to the local and namespace name of the fault element and the name
+  * of the fault bean.
+  *
+--- old/src/share/classes/javax/xml/ws/WebServiceClient.java	Thu Jul 30 18:55:14 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/ws/WebServiceClient.java	Thu Jul 30 18:55:13 2009
+@@ -31,7 +31,7 @@
+ import java.lang.annotation.ElementType;
+ import java.lang.annotation.RetentionPolicy;
+ 
+-/** 
++/**
+  *  Used to annotate a generated service interface.
+  *
+  *  <p>The information specified in this annotation is sufficient
+--- old/src/share/classes/javax/xml/ws/WebServiceContext.java	Thu Jul 30 18:55:17 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/ws/WebServiceContext.java	Thu Jul 30 18:55:17 2009
+@@ -46,7 +46,7 @@
+  *  @see javax.annotation.Resource
+  **/
+ public interface WebServiceContext {
+-    
++
+     /**
+      * Returns the <code>MessageContext</code> for the request being served
+      * at the time this method is called. Only properties with
+@@ -63,7 +63,7 @@
+      * @see java.lang.IllegalStateException
+      **/
+     public MessageContext getMessageContext();
+-    
++
+     /**
+      * Returns the Principal that identifies the sender
+      * of the request currently being serviced. If the
+@@ -80,7 +80,7 @@
+      * @see java.lang.IllegalStateException
+      **/
+     public Principal getUserPrincipal();
+-    
++
+     /**
+      * Returns a boolean indicating whether the
+      * authenticated user is included in the specified
+@@ -97,7 +97,7 @@
+      *         being serviced.
+      **/
+     public boolean isUserInRole(String role);
+-    
++
+     /**
+      * Returns the <code>EndpointReference</code> for this
+      * endpoint.
+@@ -109,7 +109,7 @@
+      * @param referenceParameters Reference parameters to be associated with the
+      * returned <code>EndpointReference</code> instance.
+      * @return EndpointReference of the endpoint associated with this
+-     * <code>WebServiceContext</code>.   
++     * <code>WebServiceContext</code>.
+      * If the returned <code>EndpointReference</code> is of type
+      * <code>W3CEndpointReference</code> then it MUST contain the
+      * the specified <code>referenceParameters</code>.
+@@ -140,7 +140,7 @@
+      *
+      * @throws IllegalStateException This exception is thrown
+      *         if the method is called while no request is
+-     *         being serviced.     
++     *         being serviced.
+      * @throws WebServiceException If the <code>clazz</code> type of
+      * <code>EndpointReference</code> is not supported.
+      *
+--- old/src/share/classes/javax/xml/ws/WebServiceException.java	Thu Jul 30 18:55:21 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/ws/WebServiceException.java	Thu Jul 30 18:55:20 2009
+@@ -25,7 +25,7 @@
+ 
+ package javax.xml.ws;
+ 
+-/** The <code>WebServiceException</code> class is the base 
++/** The <code>WebServiceException</code> class is the base
+  *  exception class for all JAX-WS API runtime exceptions.
+  *
+  *  @since JAX-WS 2.0
+@@ -32,17 +32,17 @@
+ **/
+ 
+ public class WebServiceException extends java.lang.RuntimeException {
+-  
+-  /** Constructs a new exception with <code>null</code> as its 
++
++  /** Constructs a new exception with <code>null</code> as its
+    *  detail message. The cause is not initialized.
+   **/
+-  public WebServiceException() { 
++  public WebServiceException() {
+     super();
+   }
+ 
+-  /** Constructs a new exception with the specified detail 
++  /** Constructs a new exception with the specified detail
+    *  message.  The cause is not initialized.
+-   *  @param message The detail message which is later 
++   *  @param message The detail message which is later
+    *                 retrieved using the getMessage method
+   **/
+   public WebServiceException(String message) {
+@@ -49,21 +49,21 @@
+     super(message);
+   }
+ 
+-  /** Constructs a new exception with the specified detail 
++  /** Constructs a new exception with the specified detail
+    *  message and cause.
+    *
+    *  @param message The detail message which is later retrieved
+    *                 using the getMessage method
+    *  @param cause   The cause which is saved for the later
+-   *                 retrieval throw by the getCause method 
+-  **/ 
++   *                 retrieval throw by the getCause method
++  **/
+   public WebServiceException(String message, Throwable cause) {
+     super(message,cause);
+   }
+ 
+   /** Constructs a new WebServiceException with the specified cause
+-   *  and a detail message of <tt>(cause==null ? null : 
+-   *  cause.toString())</tt> (which typically contains the 
++   *  and a detail message of <tt>(cause==null ? null :
++   *  cause.toString())</tt> (which typically contains the
+    *  class and detail message of <tt>cause</tt>).
+    *
+    *  @param cause   The cause which is saved for the later
+@@ -71,7 +71,7 @@
+    *                 (A <tt>null</tt> value is permitted, and
+    *                 indicates that the cause is nonexistent or
+      *               unknown.)
+-  **/ 
++  **/
+   public WebServiceException(Throwable cause) {
+     super(cause);
+   }
+--- old/src/share/classes/javax/xml/ws/WebServiceFeature.java	Thu Jul 30 18:55:24 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/ws/WebServiceFeature.java	Thu Jul 30 18:55:24 2009
+@@ -27,49 +27,49 @@
+ 
+ 
+ /**
+- * A WebServiceFeature is used to represent a feature that can be 
+- * enabled or disabled for a web service.  
++ * A WebServiceFeature is used to represent a feature that can be
++ * enabled or disabled for a web service.
+  * <p>
+  * The JAX-WS specification will define some standard features and
+  * JAX-WS implementors are free to define additional features if
+- * necessary.  Vendor specific features may not be portable so 
+- * caution should be used when using them. Each Feature definition 
+- * MUST define a <code>public static final String ID</code> 
+- * that can be used in the Feature annotation to refer 
++ * necessary.  Vendor specific features may not be portable so
++ * caution should be used when using them. Each Feature definition
++ * MUST define a <code>public static final String ID</code>
++ * that can be used in the Feature annotation to refer
+  * to the feature. This ID MUST be unique across all features
+  * of all vendors.  When defining a vendor specific feature ID,
+- * use a vendor specific namespace in the ID string. 
++ * use a vendor specific namespace in the ID string.
+  *
+  * @see javax.xml.ws.RespectBindingFeature
+  * @see javax.xml.ws.soap.AddressingFeature
+  * @see javax.xml.ws.soap.MTOMFeature
+- * 
++ *
+  * @since 2.1
+  */
+ public abstract class WebServiceFeature {
+    /**
+-    * Each Feature definition MUST define a public static final 
+-    * String ID that can be used in the Feature annotation to refer 
++    * Each Feature definition MUST define a public static final
++    * String ID that can be used in the Feature annotation to refer
+     * to the feature.
+     */
+    // public static final String ID = "some unique feature Identifier";
+-    
++
+    /**
+     * Get the unique identifier for this WebServiceFeature.
+-    * 
++    *
+     * @return the unique identifier for this feature.
+     */
+-   public abstract String getID(); 
+-    
++   public abstract String getID();
++
+    /**
+     * Specifies if the feature is enabled or disabled
+-    */    
++    */
+    protected boolean enabled = false;
+-   
+-   
++
++
+    protected WebServiceFeature(){}
+-   
+ 
++
+    /**
+     * Returns <code>true</code> if this feature is enabled.
+     *
+--- old/src/share/classes/javax/xml/ws/WebServiceProvider.java	Thu Jul 30 18:55:28 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/ws/WebServiceProvider.java	Thu Jul 30 18:55:27 2009
+@@ -44,13 +44,13 @@
+     /**
+      * Location of the WSDL description for the service.
+      */
+-    String wsdlLocation() default "";    
+-    
++    String wsdlLocation() default "";
++
+     /**
+      * Service name.
+      */
+     String serviceName() default "";
+-    
++
+     /**
+      * Target namespace for the service
+      */
+--- old/src/share/classes/javax/xml/ws/WebServiceRef.java	Thu Jul 30 18:55:32 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/ws/WebServiceRef.java	Thu Jul 30 18:55:31 2009
+@@ -37,7 +37,7 @@
+  *  (optionally) an injection target for it.
+  *
+  *  Web service references are resources in the Java EE 5 sense.
+- * 
++ *
+  *  @see javax.annotation.Resource
+  *
+  *  @since JAX-WS 2.0
+--- old/src/share/classes/javax/xml/ws/handler/Handler.java	Thu Jul 30 18:55:35 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/ws/handler/Handler.java	Thu Jul 30 18:55:34 2009
+@@ -30,7 +30,7 @@
+ 
+ /** The <code>Handler</code> interface
+  *  is the base interface for JAX-WS handlers.
+- * 
++ *
+  *  @since JAX-WS 2.0
+ **/
+ public interface Handler<C extends MessageContext> {
+@@ -43,9 +43,9 @@
+    *  @return An indication of whether handler processing should continue for
+    *  the current message
+    *                 <ul>
+-   *                 <li>Return <code>true</code> to continue 
++   *                 <li>Return <code>true</code> to continue
+    *                     processing.</li>
+-   *                 <li>Return <code>false</code> to block 
++   *                 <li>Return <code>false</code> to block
+    *                     processing.</li>
+    *                  </ul>
+    *  @throws RuntimeException Causes the JAX-WS runtime to cease
+@@ -55,17 +55,17 @@
+   **/
+   public boolean handleMessage(C context);
+ 
+-  /** The <code>handleFault</code> method is invoked for fault message 
++  /** The <code>handleFault</code> method is invoked for fault message
+    *  processing.  Refer to the description of the handler
+    *  framework in the JAX-WS specification for full details.
+    *
+    *  @param context the message context
+-   *  @return An indication of whether handler fault processing should continue 
++   *  @return An indication of whether handler fault processing should continue
+    *  for the current message
+    *                 <ul>
+-   *                 <li>Return <code>true</code> to continue 
++   *                 <li>Return <code>true</code> to continue
+    *                     processing.</li>
+-   *                 <li>Return <code>false</code> to block 
++   *                 <li>Return <code>false</code> to block
+    *                     processing.</li>
+    *                  </ul>
+    *  @throws RuntimeException Causes the JAX-WS runtime to cease
+--- old/src/share/classes/javax/xml/ws/handler/HandlerResolver.java	Thu Jul 30 18:55:39 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/ws/handler/HandlerResolver.java	Thu Jul 30 18:55:38 2009
+@@ -25,7 +25,7 @@
+ 
+ package javax.xml.ws.handler;
+ 
+-/** 
++/**
+  *  <code>HandlerResolver</code> is an interface implemented
+  *  by an application to get control over the handler chain
+  *  set on proxy/dispatch objects at the time of their creation.
+@@ -43,7 +43,7 @@
+ **/
+ public interface HandlerResolver {
+ 
+-  /** 
++  /**
+    *  Gets the handler chain for the specified port.
+    *
+    *  @param portInfo Contains information about the port being accessed.
+--- old/src/share/classes/javax/xml/ws/handler/LogicalHandler.java	Thu Jul 30 18:55:42 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/ws/handler/LogicalHandler.java	Thu Jul 30 18:55:42 2009
+@@ -27,7 +27,7 @@
+ 
+ /** The <code>LogicalHandler</code> extends
+  *  Handler to provide typesafety for the message context parameter.
+- * 
++ *
+  *  @since JAX-WS 2.0
+ **/
+ public interface LogicalHandler<C extends LogicalMessageContext> extends Handler<C> {
+--- old/src/share/classes/javax/xml/ws/handler/LogicalMessageContext.java	Thu Jul 30 18:55:46 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/ws/handler/LogicalMessageContext.java	Thu Jul 30 18:55:45 2009
+@@ -27,19 +27,19 @@
+ 
+ import javax.xml.ws.LogicalMessage;
+ 
+-/** The <code>LogicalMessageContext</code> interface extends 
++/** The <code>LogicalMessageContext</code> interface extends
+  *  <code>MessageContext</code> to
+  *  provide access to a the contained message as a protocol neutral
+  *  LogicalMessage
+- * 
++ *
+  *  @since JAX-WS 2.0
+ **/
+-public interface LogicalMessageContext 
++public interface LogicalMessageContext
+                     extends MessageContext {
+ 
+   /** Gets the message from this message context
+    *
+-   *  @return The contained message; returns <code>null</code> if no 
++   *  @return The contained message; returns <code>null</code> if no
+    *          message is present in this message context
+   **/
+   public LogicalMessage getMessage();
+--- old/src/share/classes/javax/xml/ws/handler/MessageContext.java	Thu Jul 30 18:55:49 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/ws/handler/MessageContext.java	Thu Jul 30 18:55:49 2009
+@@ -39,7 +39,7 @@
+  * @since JAX-WS 2.0
+  */
+ public interface MessageContext extends Map<String, Object> {
+-    
++
+     /**
+      * Standard property: message direction, <code>true</code> for
+      * outbound messages, <code>false</code> for inbound.
+@@ -47,7 +47,7 @@
+      */
+     public static final String MESSAGE_OUTBOUND_PROPERTY =
+             "javax.xml.ws.handler.message.outbound";
+-    
++
+     /**
+      * Standard property: Map of attachments to a message for the inbound
+      * message, key is  the MIME Content-ID, value is a DataHandler.
+@@ -55,7 +55,7 @@
+      */
+     public static final String INBOUND_MESSAGE_ATTACHMENTS =
+             "javax.xml.ws.binding.attachments.inbound";
+-    
++
+     /**
+      * Standard property: Map of attachments to a message for the outbound
+      * message, key is the MIME Content-ID, value is a DataHandler.
+@@ -63,7 +63,7 @@
+      */
+     public static final String OUTBOUND_MESSAGE_ATTACHMENTS =
+             "javax.xml.ws.binding.attachments.outbound";
+-    
++
+     /**
+      * Standard property: input source for WSDL document.
+      * <p>Type: org.xml.sax.InputSource
+@@ -70,7 +70,7 @@
+      */
+     public static final String WSDL_DESCRIPTION =
+             "javax.xml.ws.wsdl.description";
+-    
++
+     /**
+      * Standard property: name of WSDL service.
+      * <p>Type: javax.xml.namespace.QName
+@@ -77,7 +77,7 @@
+      */
+     public static final String WSDL_SERVICE =
+             "javax.xml.ws.wsdl.service";
+-    
++
+     /**
+      * Standard property: name of WSDL port.
+      * <p>Type: javax.xml.namespace.QName
+@@ -84,7 +84,7 @@
+      */
+     public static final String WSDL_PORT =
+             "javax.xml.ws.wsdl.port";
+-    
++
+     /**
+      * Standard property: name of wsdl interface (2.0) or port type (1.1).
+      * <p>Type: javax.xml.namespace.QName
+@@ -91,7 +91,7 @@
+      */
+     public static final String WSDL_INTERFACE =
+             "javax.xml.ws.wsdl.interface";
+-    
++
+     /**
+      * Standard property: name of WSDL operation.
+      * <p>Type: javax.xml.namespace.QName
+@@ -98,7 +98,7 @@
+      */
+     public static final String WSDL_OPERATION =
+             "javax.xml.ws.wsdl.operation";
+-    
++
+     /**
+      * Standard property: HTTP response status code.
+      * <p>Type: java.lang.Integer
+@@ -105,7 +105,7 @@
+      */
+     public static final String HTTP_RESPONSE_CODE =
+             "javax.xml.ws.http.response.code";
+-    
++
+     /**
+      * Standard property: HTTP request headers.
+      * <p>Type: java.util.Map&lt;java.lang.String, java.util.List&lt;java.lang.String>>
+@@ -112,7 +112,7 @@
+      */
+     public static final String HTTP_REQUEST_HEADERS =
+             "javax.xml.ws.http.request.headers";
+-    
++
+     /**
+      * Standard property: HTTP response headers.
+      * <p>Type: java.util.Map&lt;java.lang.String, java.util.List&lt;java.lang.String>>
+@@ -119,7 +119,7 @@
+      */
+     public static final String HTTP_RESPONSE_HEADERS =
+             "javax.xml.ws.http.response.headers";
+-    
++
+     /**
+      * Standard property: HTTP request method.
+      * <p>Type: java.lang.String
+@@ -126,7 +126,7 @@
+      */
+     public static final String HTTP_REQUEST_METHOD =
+             "javax.xml.ws.http.request.method";
+-    
++
+     /**
+      * Standard property: servlet request object.
+      * <p>Type: javax.servlet.http.HttpServletRequest
+@@ -133,7 +133,7 @@
+      */
+     public static final String SERVLET_REQUEST =
+             "javax.xml.ws.servlet.request";
+-    
++
+     /**
+      * Standard property: servlet response object.
+      * <p>Type: javax.servlet.http.HttpServletResponse
+@@ -140,7 +140,7 @@
+      */
+     public static final String SERVLET_RESPONSE =
+             "javax.xml.ws.servlet.response";
+-    
++
+     /**
+      * Standard property: servlet context object.
+      * <p>Type: javax.servlet.ServletContext
+@@ -147,7 +147,7 @@
+      */
+     public static final String SERVLET_CONTEXT =
+             "javax.xml.ws.servlet.context";
+-    
++
+     /**
+      * Standard property: Query string for request.
+      * <p>Type: String
+@@ -154,7 +154,7 @@
+      **/
+     public static final String QUERY_STRING =
+             "javax.xml.ws.http.request.querystring";
+-    
++
+     /**
+      * Standard property: Request Path Info
+      * <p>Type: String
+@@ -161,7 +161,7 @@
+      */
+     public static final String PATH_INFO =
+             "javax.xml.ws.http.request.pathinfo";
+-    
++
+     /**
+      * Standard property: WS Addressing Reference Parameters.
+      * The list MUST include all SOAP headers marked with the
+@@ -172,7 +172,7 @@
+      */
+     public static final String REFERENCE_PARAMETERS =
+             "javax.xml.ws.reference.parameters";
+-    
++
+     /**
+      * Property scope. Properties scoped as <code>APPLICATION</code> are
+      * visible to handlers,
+@@ -181,8 +181,8 @@
+      * are only normally visible to handlers.
+      */
+     public enum Scope {APPLICATION, HANDLER};
+-    
+-    /** 
++
++    /**
+      * Sets the scope of a property.
+      *
+      * @param name Name of the property associated with the
+@@ -192,8 +192,8 @@
+      *             property name is specified
+      */
+     public void setScope(String name,  Scope scope);
+-    
+-    /** 
++
++    /**
+      * Gets the scope of a property.
+      *
+      * @param name Name of the property
+--- old/src/share/classes/javax/xml/ws/handler/PortInfo.java	Thu Jul 30 18:55:53 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/ws/handler/PortInfo.java	Thu Jul 30 18:55:52 2009
+@@ -27,7 +27,7 @@
+ 
+ import javax.xml.namespace.QName;
+ 
+-/** 
++/**
+  *  The <code>PortInfo</code> interface is used by a
+  *  <code>HandlerResolver</code> to query information about
+  *  the port it is being asked to create a handler chain for.
+@@ -39,7 +39,7 @@
+ **/
+ public interface PortInfo {
+ 
+-  /** 
++  /**
+    *  Gets the qualified name of the WSDL service name containing
+    *  the port being accessed.
+    *
+@@ -47,7 +47,7 @@
+   **/
+   public QName getServiceName();
+ 
+-  /** 
++  /**
+    *  Gets the qualified name of the WSDL port being accessed.
+    *
+    *  @return javax.xml.namespace.QName The qualified name of the WSDL port.
+@@ -54,7 +54,7 @@
+   **/
+   public QName getPortName();
+ 
+-  /** 
++  /**
+    *  Gets the URI identifying the binding used by the port being accessed.
+    *
+    *  @return String The binding identifier for the port.
+--- old/src/share/classes/javax/xml/ws/handler/soap/SOAPHandler.java	Thu Jul 30 18:55:57 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/ws/handler/soap/SOAPHandler.java	Thu Jul 30 18:55:56 2009
+@@ -32,7 +32,7 @@
+ /** The <code>SOAPHandler</code> class extends <code>Handler</code>
+  *  to provide typesafety for the message context parameter and add a method
+  *  to obtain access to the headers that may be processed by the handler.
+- * 
++ *
+  *  @since JAX-WS 2.0
+ **/
+ public interface SOAPHandler<T extends SOAPMessageContext>
+@@ -42,7 +42,7 @@
+    *  instance.
+    *
+    *  @return Set of <code>QNames</code> of header blocks processed by this
+-   *           handler instance. <code>QName</code> is the qualified 
++   *           handler instance. <code>QName</code> is the qualified
+    *           name of the outermost element of the Header block.
+   **/
+   Set<QName> getHeaders();
+--- old/src/share/classes/javax/xml/ws/handler/soap/SOAPMessageContext.java	Thu Jul 30 18:56:00 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/ws/handler/soap/SOAPMessageContext.java	Thu Jul 30 18:55:59 2009
+@@ -30,17 +30,17 @@
+ import javax.xml.namespace.QName;
+ import java.util.Set;
+ 
+-/** The interface <code>SOAPMessageContext</code> 
+- *  provides access to the SOAP message for either RPC request or 
++/** The interface <code>SOAPMessageContext</code>
++ *  provides access to the SOAP message for either RPC request or
+  *  response. The <code>javax.xml.soap.SOAPMessage</code> specifies
+  *  the standard Java API for the representation of a SOAP 1.1 message
+  *  with attachments.
+  *
+  *  @see javax.xml.soap.SOAPMessage
+- * 
++ *
+  *  @since JAX-WS 2.0
+ **/
+-public interface SOAPMessageContext 
++public interface SOAPMessageContext
+                     extends javax.xml.ws.handler.MessageContext {
+ 
+   /** Gets the <code>SOAPMessage<code> from this message context. Modifications
+@@ -47,7 +47,7 @@
+    *  to the returned <code>SOAPMessage</code> change the message in-place, there
+    *  is no need to susequently call <code>setMessage</code>.
+    *
+-   *  @return Returns the <code>SOAPMessage</code>; returns <code>null</code> if no 
++   *  @return Returns the <code>SOAPMessage</code>; returns <code>null</code> if no
+    *          <code>SOAPMessage</code> is present in this message context
+   **/
+   public SOAPMessage getMessage();
+@@ -67,13 +67,13 @@
+    *  with the same qualified name.
+    *
+    *  @param  header The XML qualified name of the SOAP header(s).
+-   *  @param  context The JAXBContext that should be used to unmarshall the 
++   *  @param  context The JAXBContext that should be used to unmarshall the
+    *          header
+    *  @param  allRoles If <code>true</code> then returns headers for all SOAP
+    *          roles, if <code>false</code> then only returns headers targetted
+    *          at the roles currently being played by this SOAP node, see
+    *          <code>getRoles</code>.
+-   *  @return An array of unmarshalled headers; returns an empty array if no 
++   *  @return An array of unmarshalled headers; returns an empty array if no
+    *          message is present in this message context or no headers match
+    *          the supplied qualified name.
+    *  @throws WebServiceException If an error occurs when using the supplied
+--- old/src/share/classes/javax/xml/ws/http/HTTPBinding.java	Thu Jul 30 18:56:04 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/ws/http/HTTPBinding.java	Thu Jul 30 18:56:03 2009
+@@ -28,9 +28,9 @@
+ 
+ import javax.xml.ws.Binding;
+ 
+-/** The <code>HTTPBinding</code> interface is an 
++/** The <code>HTTPBinding</code> interface is an
+  *  abstraction for the XML/HTTP binding.
+- * 
++ *
+  *  @since JAX-WS 2.0
+ **/
+ public interface HTTPBinding extends Binding {
+--- old/src/share/classes/javax/xml/ws/http/HTTPException.java	Thu Jul 30 18:56:07 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/ws/http/HTTPException.java	Thu Jul 30 18:56:07 2009
+@@ -26,22 +26,22 @@
+ package javax.xml.ws.http;
+ 
+ 
+-/** The <code>HTTPException</code> exception represents a 
++/** The <code>HTTPException</code> exception represents a
+  *  XML/HTTP fault.
+  *
+  *  <p>Since there is no standard format for faults or exceptions
+- *  in XML/HTTP messaging, only the HTTP status code is captured. 
+- * 
++ *  in XML/HTTP messaging, only the HTTP status code is captured.
++ *
+  *  @since JAX-WS 2.0
+ **/
+ public class HTTPException extends javax.xml.ws.ProtocolException  {
+-  
++
+   private int statusCode;
+ 
+   /** Constructor for the HTTPException
+    *  @param statusCode   <code>int</code> for the HTTP status code
+   **/
+-  public HTTPException(int statusCode) { 
++  public HTTPException(int statusCode) {
+     super();
+     this.statusCode = statusCode;
+   }
+--- old/src/share/classes/javax/xml/ws/soap/Addressing.java	Thu Jul 30 18:56:11 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/ws/soap/Addressing.java	Thu Jul 30 18:56:10 2009
+@@ -52,7 +52,7 @@
+  *       MUST be consumed by the receiver and produced by the
+  *       sender even if the WSDL declares otherwise. The
+  *       mustUnderstand="0" attribute MUST be used on the response WS-Addressing
+- *       headers. 
++ *       headers.
+  *  <li> DISABLED: In this Mode, WS-Addressing will be disabled
+  *       even if an associated WSDL specifies otherwise. At runtime,
+  *       WS-Addressing headers MUST NOT be used. WS-Addressing may be explicitly
+@@ -65,29 +65,29 @@
+  * The <code>required</code> property can be used to
+  * specify if WS-Addressing headers MUST
+  * be present on incoming messages.  By default the
+- * <code>required</code> property is <code>false</code>. 
++ * <code>required</code> property is <code>false</code>.
+  * <p>
+  * The definition of this annotation is incomplete in this release of JAX-WS as
+  * there is no standard way to convey the use of WS-Addressing via a WSDL and there is no
+- * standard definition for the default value of WS-Addressing <code>Action</code> headers; 
+- * however, the runtime behavior of this annotation is well-defined. 
+- * It is intended that a future version of 
++ * standard definition for the default value of WS-Addressing <code>Action</code> headers;
++ * however, the runtime behavior of this annotation is well-defined.
++ * It is intended that a future version of
+  * JAX-WS will require the use of the standard mechanism to convey the use
+  * of WS-Addressing via WSDL and default values for WS-Addressing <code>Action</code> headers
+- * as defined by the W3C WG on WS-Addressing.  
++ * as defined by the W3C WG on WS-Addressing.
+  * <p>
+  * To write a portable endpoint and its corresponding client with this version of JAX-WS,
+- * an endpoint MUST explicitly specify what WS-Addressing <code>Actions</code> are to be used 
+- * via the {@link Action} and {@link FaultAction} annotations.  The client MUST explicitly 
+- * enable addresssing via the {@link AddressingFeature}, and for each invocation, the client 
++ * an endpoint MUST explicitly specify what WS-Addressing <code>Actions</code> are to be used
++ * via the {@link Action} and {@link FaultAction} annotations.  The client MUST explicitly
++ * enable addresssing via the {@link AddressingFeature}, and for each invocation, the client
+  * MUST explicitly set the {@link BindingProvider#SOAPACTION_URI_PROPERTY}.
+  * After the W3C WG on WS-Addressing has specified how the use of WS-Addressing is specified in the WSDL,
+  * and what the default value must be for Action headers, a future version of JAX-WS will remove these requirements.
+  * <p>
+  * See <a href="http://www.w3.org/TR/2006/REC-ws-addr-core-20060509/">Web Services Addressing - Core</a>
+- * and <a href="http://www.w3.org/TR/2006/REC-ws-addr-soap-20060509/">Web Services Addressing 1.0 - SOAP Binding</a> 
++ * and <a href="http://www.w3.org/TR/2006/REC-ws-addr-soap-20060509/">Web Services Addressing 1.0 - SOAP Binding</a>
+  * for more information on WS-Addressing.
+- * 
++ *
+  * @since JAX-WS 2.1
+  */
+ @Target(ElementType.TYPE)
+@@ -99,7 +99,7 @@
+      * Specifies if this feature is enabled or disabled.
+      */
+     boolean enabled() default true;
+-    
++
+     /**
+      * Property to determine if WS-Addressing headers MUST
+      * be present on incoming messages.
+--- old/src/share/classes/javax/xml/ws/soap/AddressingFeature.java	Thu Jul 30 18:56:14 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/ws/soap/AddressingFeature.java	Thu Jul 30 18:56:14 2009
+@@ -43,28 +43,28 @@
+  * If the web service developer has not explicitly enabled this feature,
+  * it MAY be automatically enabled if the associated WSDL enables
+  * WS-Addressing with an implementation recognized WSDL extension element.
+- * However, in this version of JAX-WS, there is no standard WSDL 
++ * However, in this version of JAX-WS, there is no standard WSDL
+  * extension that a client can rely on to automatically enable WS-Addressing,
+- * nor is there a standard default value specified for WS-Addressing 
++ * nor is there a standard default value specified for WS-Addressing
+  * <code>Action</code> headers.
+  * <p>
+- * To write a portable endpoint and its corresponding client with this 
+- * version of JAX-WS, an endpoint MUST explicitly specify what WS-Addressing 
+- * <code>Actions</code> are to be used via the {@link Action} and 
+- * {@link FaultAction} annotations.  The client MUST explicitly enable 
+- * addresssing via this <code>AddressingFeature</code>, and for each invocation, 
++ * To write a portable endpoint and its corresponding client with this
++ * version of JAX-WS, an endpoint MUST explicitly specify what WS-Addressing
++ * <code>Actions</code> are to be used via the {@link Action} and
++ * {@link FaultAction} annotations.  The client MUST explicitly enable
++ * addresssing via this <code>AddressingFeature</code>, and for each invocation,
+  * the client MUST explicitly set the {@link BindingProvider#SOAPACTION_URI_PROPERTY}.
+- * After the W3C WG on WS-Addressing has specified how the use of WS-Addressing 
+- * is specified in the WSDL, and what the default value must be for Action headers, 
++ * After the W3C WG on WS-Addressing has specified how the use of WS-Addressing
++ * is specified in the WSDL, and what the default value must be for Action headers,
+  * a future version of JAX-WS will remove these requirements.
+  * <p>
+- * See {@link javax.xml.ws.RespectBindingFeature} for more information 
++ * See {@link javax.xml.ws.RespectBindingFeature} for more information
+  * on required WSDL extensions.
+  * <p>
+  * The following describes the effects of this feature with respect
+  * to be enabled or disabled:
+  * <ul>
+- *  <li> ENABLED: In this Mode, WS-Addressing will be enabled. 
++ *  <li> ENABLED: In this Mode, WS-Addressing will be enabled.
+  *       At runtime, WS-Addressing headers
+  *       MUST be consumed by the receiver and produced by the
+  *       sender even if the WSDL declares otherwise. The
+@@ -71,7 +71,7 @@
+  *       mustUnderstand="0" attribute MUST be used on the WS-Addressing
+  *       headers.
+  *  <li> DISABLED: In this Mode, WS-Addressing will be disabled
+- *       even if an associated WSDL specifies otherwise. At runtime, 
++ *       even if an associated WSDL specifies otherwise. At runtime,
+  *       WS-Addressing headers MUST NOT be used.  WS-Addressing may be explicitly
+  *       disabled to prevent a JAX-WS implementation from consuming and producing
+  *       WS-Addressing headers. If an application
+@@ -79,35 +79,35 @@
+ *        Not doing so may break compatibility with future versions of JAX-WS.
+  * </ul>
+  * <p>
+- * The {@link #required} property can be used to 
++ * The {@link #required} property can be used to
+  * specify if WS-Addressing headers MUST be present
+  * on incoming messages.  This property only has meaning when used on the
+- * endpoint and has no affect when used on the client.  
++ * endpoint and has no affect when used on the client.
+  * By default the
+  * <code>required</code> property is <code>false</code>.
+   <p>
+ 
+  * See <a href="http://www.w3.org/TR/2006/REC-ws-addr-core-20060509/">Web Services Addressing - Core</a>
+- * and <a href="http://www.w3.org/TR/2006/REC-ws-addr-soap-20060509/">Web Services Addressing 1.0 - SOAP Binding</a> 
++ * and <a href="http://www.w3.org/TR/2006/REC-ws-addr-soap-20060509/">Web Services Addressing 1.0 - SOAP Binding</a>
+  * for more information on WS-Addressing.
+  *
+  * @since JAX-WS 2.1
+  */
+ public final class AddressingFeature extends WebServiceFeature {
+-    /** 
++    /**
+      * Constant value identifying the AddressingFeature
+      */
+     public static final String ID = "http://www.w3.org/2005/08/addressing/module";
+-  
++
+     /**
+-     * Property for the <code>required</code> feature parameter. When WS-Addressing 
++     * Property for the <code>required</code> feature parameter. When WS-Addressing
+      * is enabled, the value of this property will be used
+-     * to specify if WS-Addressing headers MUST be present on incoming messages.  This 
++     * to specify if WS-Addressing headers MUST be present on incoming messages.  This
+      * property only has meaning on the endpoint and has no
+      * affect when used on the client.
+      */
+     protected boolean required = false;
+-    
++
+     /**
+      * Create an <code>AddressingFeature</code>.
+      * The instance created will be enabled.
+@@ -115,10 +115,10 @@
+     public AddressingFeature() {
+         this.enabled = true;
+     }
+-    
+-    /** 
++
++    /**
+      * Create an <code>AddressingFeature</code>
+-     * 
++     *
+      * @param enabled specifies whether this feature should
+      * be enabled or not.
+      */
+@@ -126,9 +126,9 @@
+         this.enabled = enabled;
+     }
+ 
+-    /** 
++    /**
+      * Create an <code>AddressingFeature</code>
+-     * 
++     *
+      * @param enabled specifies whether this feature should
+      * be enabled or not.
+      * @param required specifies whether
+@@ -139,8 +139,8 @@
+     public AddressingFeature(boolean enabled, boolean required) {
+         this.enabled = enabled;
+         this.required = required;
+-    }    
+-    
++    }
++
+     /**
+      * {@inheritDoc}
+      */
+@@ -147,7 +147,7 @@
+     public String getID() {
+         return ID;
+     }
+-    
++
+     /**
+      * Gets the boolean value used to determine if WS-Addressing
+      * headers MUST be present on incoming messages.  This property
+@@ -158,5 +158,5 @@
+      */
+     public boolean isRequired() {
+         return required;
+-    }    
++    }
+ }
+--- old/src/share/classes/javax/xml/ws/soap/MTOM.java	Thu Jul 30 18:56:18 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/ws/soap/MTOM.java	Thu Jul 30 18:56:17 2009
+@@ -34,7 +34,7 @@
+ import javax.xml.ws.spi.WebServiceFeatureAnnotation;
+ 
+ /**
+- * This feature represents the use of MTOM with a 
++ * This feature represents the use of MTOM with a
+  * web service.
+  *
+  * <p>
+@@ -45,11 +45,11 @@
+  *  <li> DISABLED: In this Mode, MTOM will be disabled
+  * </ul>
+  * <p>
+- * The {@link #threshold} property can be used to set the threshold 
++ * The {@link #threshold} property can be used to set the threshold
+  * value used to determine when binary data should be XOP encoded.
+  *
+  * @since JAX-WS 2.1
+- */   
++ */
+ @Target(ElementType.TYPE)
+ @Retention(RetentionPolicy.RUNTIME)
+ @Documented
+@@ -58,12 +58,12 @@
+     /**
+      * Specifies if this feature is enabled or disabled.
+      */
+-    boolean enabled() default true; 
+-     
++    boolean enabled() default true;
++
+     /**
+-     * Property for MTOM threshold value. When MTOM is enabled, binary data above this 
+-     * size in bytes will be XOP encoded or sent as attachment. The value of this property 
+-     * MUST always be >= 0. Default value is 0.      
+-     */         
++     * Property for MTOM threshold value. When MTOM is enabled, binary data above this
++     * size in bytes will be XOP encoded or sent as attachment. The value of this property
++     * MUST always be >= 0. Default value is 0.
++     */
+     int threshold() default 0;
+ }
+--- old/src/share/classes/javax/xml/ws/soap/MTOMFeature.java	Thu Jul 30 18:56:21 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/ws/soap/MTOMFeature.java	Thu Jul 30 18:56:21 2009
+@@ -33,7 +33,7 @@
+ 
+ 
+ /**
+- * This feature represents the use of MTOM with a 
++ * This feature represents the use of MTOM with a
+  * web service.
+  *
+  * <p>
+@@ -44,27 +44,27 @@
+  *  <li> DISABLED: In this Mode, MTOM will be disabled
+  * </ul>
+  * <p>
+- * The {@link #threshold} property can be used to set the threshold 
++ * The {@link #threshold} property can be used to set the threshold
+  * value used to determine when binary data should be XOP encoded.
+  *
+  * @since JAX-WS 2.1
+- */       
++ */
+ public final class MTOMFeature extends WebServiceFeature {
+-    /** 
++    /**
+      * Constant value identifying the MTOMFeature
+      */
+     public static final String ID = "http://www.w3.org/2004/08/soap/features/http-optimization";
+-  
+-   
++
++
+     /**
+-     * Property for MTOM threshold value. This property serves as a hint when 
+-     * MTOM is enabled, binary data above this size in bytes SHOULD be sent 
++     * Property for MTOM threshold value. This property serves as a hint when
++     * MTOM is enabled, binary data above this size in bytes SHOULD be sent
+      * as attachment.
+-     * The value of this property MUST always be >= 0. Default value is 0.      
++     * The value of this property MUST always be >= 0. Default value is 0.
+      */
+     protected int threshold = 0;
+-    
+ 
++
+     /**
+      * Create an <code>MTOMFeature</code>.
+      * The instance created will be enabled.
+@@ -71,11 +71,11 @@
+      */
+     public MTOMFeature() {
+         this.enabled = true;
+-    }    
+-    
++    }
++
+     /**
+      * Creates an <code>MTOMFeature</code>.
+-     * 
++     *
+      * @param enabled specifies if this feature should be enabled or not
+      */
+     public MTOMFeature(boolean enabled) {
+@@ -97,11 +97,11 @@
+             throw new WebServiceException("MTOMFeature.threshold must be >= 0, actual value: "+threshold);
+         this.enabled = true;
+         this.threshold = threshold;
+-    }    
+-    
++    }
++
+     /**
+      * Creates an <code>MTOMFeature</code>.
+-     * 
++     *
+      * @param enabled specifies if this feature should be enabled or not
+      * @param threshold the size in bytes that binary data SHOULD be before
+      * being sent as an attachment.
+@@ -113,8 +113,8 @@
+             throw new WebServiceException("MTOMFeature.threshold must be >= 0, actual value: "+threshold);
+         this.enabled = enabled;
+         this.threshold = threshold;
+-    }    
+-    
++    }
++
+     /**
+      * {@inheritDoc}
+      */
+@@ -121,9 +121,9 @@
+     public String getID() {
+         return ID;
+     }
+-    
++
+     /**
+-     * Gets the threshold value used to determine when binary data 
++     * Gets the threshold value used to determine when binary data
+      * should be sent as an attachment.
+      *
+      * @return the current threshold size in bytes
+--- old/src/share/classes/javax/xml/ws/soap/SOAPBinding.java	Thu Jul 30 18:56:25 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/ws/soap/SOAPBinding.java	Thu Jul 30 18:56:24 2009
+@@ -33,7 +33,7 @@
+ 
+ /** The <code>SOAPBinding</code> interface is an abstraction for
+  *  the SOAP binding.
+- * 
++ *
+  *  @since JAX-WS 2.0
+ **/
+ public interface SOAPBinding extends Binding {
+@@ -59,8 +59,8 @@
+    * with MTOM enabled by default.
+    */
+   public static final String SOAP12HTTP_MTOM_BINDING = "http://www.w3.org/2003/05/soap/bindings/HTTP/?mtom=true";
+-    
+-  
++
++
+   /** Gets the roles played by the SOAP binding instance.
+    *
+    *  @return Set<String> The set of roles played by the binding instance.
+@@ -80,9 +80,9 @@
+    *
+    * @return <code>true</code> if and only if the use of MTOM is enabled.
+   **/
+-  
++
+   public boolean isMTOMEnabled();
+-  
++
+   /**
+    * Enables or disables use of MTOM.
+    *
+@@ -90,10 +90,10 @@
+    *               be enabled or disabled.
+    * @throws WebServiceException If the specified setting is not supported
+    *                  by this binding instance.
+-   * 
++   *
+    **/
+   public void setMTOMEnabled(boolean flag);
+-  
++
+   /**
+    * Gets the SAAJ <code>SOAPFactory</code> instance used by this SOAP binding.
+    *
+@@ -100,7 +100,7 @@
+    * @return SOAPFactory instance used by this SOAP binding.
+   **/
+   public SOAPFactory getSOAPFactory();
+-  
++
+   /**
+    * Gets the SAAJ <code>MessageFactory</code> instance used by this SOAP binding.
+    *
+--- old/src/share/classes/javax/xml/ws/soap/SOAPFaultException.java	Thu Jul 30 18:56:28 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/ws/soap/SOAPFaultException.java	Thu Jul 30 18:56:28 2009
+@@ -51,9 +51,9 @@
+  *  @since JAX-WS 2.0
+  **/
+ public class SOAPFaultException extends javax.xml.ws.ProtocolException  {
+-    
++
+     private SOAPFault fault;
+-    
++
+     /** Constructor for SOAPFaultException
+      *  @param fault   <code>SOAPFault</code> representing the fault
+      *
+@@ -63,7 +63,7 @@
+         super(fault.getFaultString());
+         this.fault = fault;
+     }
+-    
++
+     /** Gets the embedded <code>SOAPFault</code> instance.
+      *
+      *  @return <code>javax.xml.soap.SOAPFault</code> SOAP
+--- old/src/share/classes/javax/xml/ws/spi/FactoryFinder.java	Thu Jul 30 18:56:32 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/ws/spi/FactoryFinder.java	Thu Jul 30 18:56:31 2009
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright 2005-2008 Sun Microsystems, Inc.  All Rights Reserved.
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+  * 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 @@
+ class FactoryFinder {
+ 
+     /**
+-     * Creates an instance of the specified class using the specified 
++     * Creates an instance of the specified class using the specified
+      * <code>ClassLoader</code> object.
+      *
+      * @exception WebServiceException if the given class could not be found
+@@ -97,11 +97,11 @@
+             } else {
+                 is=classLoader.getResourceAsStream(serviceId);
+             }
+-        
++
+             if( is!=null ) {
+                 BufferedReader rd =
+                     new BufferedReader(new InputStreamReader(is, "UTF-8"));
+-        
++
+                 String factoryClassName = rd.readLine();
+                 rd.close();
+ 
+@@ -112,8 +112,8 @@
+             }
+         } catch( Exception ex ) {
+         }
+-        
+ 
++
+         // try to read from $java.home/lib/jaxws.properties
+         try {
+             String javah=System.getProperty( "java.home" );
+@@ -148,7 +148,6 @@
+         return newInstance(fallbackClassName, classLoader);
+     }
+ 
+-
+     private static final String PLATFORM_DEFAULT_FACTORY_CLASS = "com.sun.xml.internal.ws.spi.ProviderImpl";
+ 
+     /**
+@@ -161,7 +160,7 @@
+             if (s != null) {
+                 int i = className.lastIndexOf('.');
+                 if (i != -1) {
+-                    s.checkPackageAccess(className.substring(0,i));
++                    s.checkPackageAccess(className.substring(0, i));
+                 }
+             }
+ 
+@@ -176,4 +175,5 @@
+             throw se;
+         }
+     }
++
+ }
+--- old/src/share/classes/javax/xml/ws/spi/Provider.java	Thu Jul 30 18:56:36 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/ws/spi/Provider.java	Thu Jul 30 18:56:35 2009
+@@ -44,7 +44,7 @@
+  * @since JAX-WS 2.0
+  */
+ public abstract class Provider {
+-    
++
+     /**
+      * A constant representing the property used to lookup the
+      * name of a <code>Provider</code> implementation
+@@ -52,7 +52,7 @@
+      */
+     static public final String JAXWSPROVIDER_PROPERTY
+             = "javax.xml.ws.spi.Provider";
+-    
++
+     /**
+      * A constant representing the name of the default
+      * <code>Provider</code> implementation class.
+@@ -59,14 +59,14 @@
+      **/
+     static private final String DEFAULT_JAXWSPROVIDER
+             = "com.sun.xml.internal.ws.spi.ProviderImpl";
+-    
+-    
++
++
+     /**
+      * Creates a new instance of Provider
+      */
+     protected Provider() {
+     }
+-    
++
+     /**
+      *
+      * Creates a new provider object.
+@@ -110,7 +110,7 @@
+                     loader = ClassLoader.getSystemClassLoader();
+                 }
+                 URL targetTypeURL  = loader.getResource(classnameAsResource);
+-                throw new LinkageError("ClassCastException: attempting to cast" + 
++                throw new LinkageError("ClassCastException: attempting to cast" +
+                        provider.getClass().getClassLoader().getResource(classnameAsResource) +
+                        "to" + targetTypeURL.toString() );
+             }
+@@ -119,9 +119,9 @@
+             throw ex;
+         } catch (Exception ex) {
+             throw new WebServiceException("Unable to createEndpointReference Provider", ex);
+-        } 
++        }
+     }
+-    
++
+     /**
+      * Creates a service delegate object.
+      * <p>
+@@ -135,8 +135,8 @@
+     public abstract ServiceDelegate createServiceDelegate(
+             java.net.URL wsdlDocumentLocation,
+             QName serviceName, Class serviceClass);
+-    
+-    
++
++
+     /**
+      *
+      * Creates an endpoint object with the provided binding and implementation
+@@ -151,8 +151,8 @@
+      */
+     public abstract Endpoint createEndpoint(String bindingId,
+             Object implementor);
+-    
+-    
++
++
+     /**
+      * Creates and publishes an endpoint object with the specified
+      * address and implementation object.
+@@ -185,8 +185,8 @@
+      * @since JAX-WS 2.1
+      **/
+     public abstract EndpointReference readEndpointReference(javax.xml.transform.Source eprInfoset);
+-     
+-    
++
++
+     /**
+      * The getPort method returns a proxy.  If there
+      * are any reference parameters in the
+@@ -202,11 +202,11 @@
+      * runtime system takes the responsibility of selecting a protocol
+      * binding (and a port) and configuring the proxy accordingly from
+      * the WSDL metadata of the
+-     * <code>serviceEndpointInterface</code> and the <code>EndpointReference</code>. 
++     * <code>serviceEndpointInterface</code> and the <code>EndpointReference</code>.
+      * For this method
+      * to successfully return a proxy, WSDL metadata MUST be available and the
+      * <code>endpointReference</code> MUST contain an implementation understood
+-     * <code>serviceName</code> metadata.  
++     * <code>serviceName</code> metadata.
+      *
+      *
+      * @param endpointReference the EndpointReference that will
+@@ -240,7 +240,7 @@
+     public abstract <T> T getPort(EndpointReference endpointReference,
+             Class<T> serviceEndpointInterface,
+             WebServiceFeature... features);
+-    
++
+     /**
+      * Factory method to create a <code>W3CEndpointReference</code>.
+      *
+@@ -251,12 +251,12 @@
+      * can also be used to create a <code>W3CEndpointReference</code> for
+      * an endpoint that is published by the same Java EE application.
+      * To do so the <code>address</code> property can be provided or this
+-     * method can automatically determine the <code>address</code> of 
++     * method can automatically determine the <code>address</code> of
+      * an endpoint that is published by the same Java EE application and is
+-     * identified by the <code>serviceName</code> and 
+-     * <code>portName</code> propeties.  If the <code>address</code> is 
+-     * <code>null</code> and the <code>serviceName</code> and 
+-     * <code>portName</code> do not identify an endpoint published by the 
++     * identified by the <code>serviceName</code> and
++     * <code>portName</code> propeties.  If the <code>address</code> is
++     * <code>null</code> and the <code>serviceName</code> and
++     * <code>portName</code> do not identify an endpoint published by the
+      * same Java EE application, a
+      * <code>javax.lang.IllegalStateException</code> MUST be thrown.
+      *
+@@ -263,17 +263,17 @@
+      * @param address Specifies the address of the target endpoint
+      * @param serviceName Qualified name of the service in the WSDL.
+      * @param portName Qualified name of the endpoint in the WSDL.
+-     * @param metadata A list of elements that should be added to the 
+-     * <code>W3CEndpointReference</code> instances <code>wsa:metadata</code> 
++     * @param metadata A list of elements that should be added to the
++     * <code>W3CEndpointReference</code> instances <code>wsa:metadata</code>
+      * element.
+-     * @param wsdlDocumentLocation URL for the WSDL document location for 
+-     * the service.  
+-     * @param referenceParameters Reference parameters to be associated 
++     * @param wsdlDocumentLocation URL for the WSDL document location for
++     * the service.
++     * @param referenceParameters Reference parameters to be associated
+      * with the returned <code>EndpointReference</code> instance.
+      *
+-     * @return the <code>W3CEndpointReference<code> created from 
++     * @return the <code>W3CEndpointReference<code> created from
+      *          <code>serviceName</code>, <code>portName</code>,
+-     *          <code>metadata</code>, <code>wsdlDocumentLocation</code> 
++     *          <code>metadata</code>, <code>wsdlDocumentLocation</code>
+      *          and <code>referenceParameters</code>. This method
+      *          never returns <code>null</code>.
+      *
+@@ -294,7 +294,7 @@
+      *        <li>If the <code>wsdlDocumentLocation</code> is NOT <code>null</code>
+      *            and does not represent a valid WSDL.
+      *     </ul>
+-     * @throws WebServiceException If an error occurs while creating the 
++     * @throws WebServiceException If an error occurs while creating the
+      *                             <code>W3CEndpointReference</code>.
+      *
+      * @since JAX-WS 2.1
+--- old/src/share/classes/javax/xml/ws/spi/ServiceDelegate.java	Thu Jul 30 18:56:39 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/ws/spi/ServiceDelegate.java	Thu Jul 30 18:56:39 2009
+@@ -50,11 +50,11 @@
+  * @since JAX-WS 2.0
+  */
+ public abstract class ServiceDelegate {
+-    
++
+     protected ServiceDelegate() {
+     }
+-    
+-    /** 
++
++    /**
+      * The <code>getPort</code> method returns a proxy. A service client
+      * uses this proxy to invoke operations on the target
+      * service endpoint. The <code>serviceEndpointInterface</code>
+@@ -84,8 +84,8 @@
+      **/
+     public abstract <T> T getPort(QName portName,
+             Class<T> serviceEndpointInterface);
+-    
+-    /** 
++
++    /**
+      * The <code>getPort</code> method returns a proxy. A service client
+      * uses this proxy to invoke operations on the target
+      * service endpoint. The <code>serviceEndpointInterface</code>
+@@ -96,7 +96,7 @@
+      *                  the WSDL service description
+      * @param serviceEndpointInterface Service endpoint interface
+      *                  supported by the dynamic proxy or instance
+-     * @param features  A list of WebServiceFeatures to configure on the 
++     * @param features  A list of WebServiceFeatures to configure on the
+      *                proxy.  Supported features not in the <code>features
+      *                </code> parameter will have their default values.
+      * @return Object Proxy instance that
+@@ -118,17 +118,17 @@
+      * @see java.lang.reflect.Proxy
+      * @see java.lang.reflect.InvocationHandler
+      * @see WebServiceFeature
+-     * 
++     *
+      * @since JAX-WS 2.1
+      **/
+     public abstract <T> T getPort(QName portName,
+-            Class<T> serviceEndpointInterface, WebServiceFeature... features);    
+-    
+-    /** 
++            Class<T> serviceEndpointInterface, WebServiceFeature... features);
++
++    /**
+      * The <code>getPort</code> method returns a proxy.
+      * The parameter <code>endpointReference</code> specifies the
+      * endpoint that will be invoked by the returned proxy.  If there
+-     * are any reference parameters in the 
++     * are any reference parameters in the
+      * <code>endpointReference</code>, then those reference
+      * parameters MUST appear as SOAP headers, indicating them to be
+      * reference parameters, on all messages sent to the endpoint.
+@@ -135,7 +135,7 @@
+      * The <code>endpointReference's</code> address MUST be used
+      * for invocations on the endpoint.
+      * The parameter <code>serviceEndpointInterface</code> specifies
+-     * the service endpoint interface that is supported by the 
++     * the service endpoint interface that is supported by the
+      * returned proxy.
+      * In the implementation of this method, the JAX-WS
+      * runtime system takes the responsibility of selecting a protocol
+@@ -142,15 +142,15 @@
+      * binding (and a port) and configuring the proxy accordingly from
+      * the WSDL associated with this <code>Service</code> instance or
+      * from the metadata from the <code>endpointReference</code>.
+-     * If this <code>Service</code> instance has a WSDL and 
+-     * the <code>endpointReference</code> metadata 
++     * If this <code>Service</code> instance has a WSDL and
++     * the <code>endpointReference</code> metadata
+      * also has a WSDL, then the WSDL from this instance MUST be used.
+      * If this <code>Service</code> instance does not have a WSDL and
+-     * the <code>endpointReference</code> does have a WSDL, then the 
++     * the <code>endpointReference</code> does have a WSDL, then the
+      * WSDL from the <code>endpointReference</code> MAY be used.
+      * The returned proxy should not be reconfigured by the client.
+-     * If this <code>Service</code> instance has a known proxy 
+-     * port that matches the information contained in 
++     * If this <code>Service</code> instance has a known proxy
++     * port that matches the information contained in
+      * the WSDL,
+      * then that proxy is returned, otherwise a WebServiceException
+      * is thrown.
+@@ -159,8 +159,8 @@
+      * <pre>
+      * <code>port = service.getPort(portName, serviceEndpointInterface);</code>
+      * </pre>
+-     * where the <code>portName</code> is retrieved from the  
+-     * metadata of the <code>endpointReference</code> or from the 
++     * where the <code>portName</code> is retrieved from the
++     * metadata of the <code>endpointReference</code> or from the
+      * <code>serviceEndpointInterface</code> and the WSDL
+      * associated with this <code>Service</code> instance.
+      *
+@@ -168,7 +168,7 @@
+      * for the target service endpoint that will be invoked by the
+      * returned proxy.
+      * @param serviceEndpointInterface Service endpoint interface.
+-     * @param features  A list of <code>WebServiceFeatures</code> to configure on the 
++     * @param features  A list of <code>WebServiceFeatures</code> to configure on the
+      *                proxy.  Supported features not in the <code>features
+      *                </code> parameter will have their default values.
+      * @return Object Proxy instance that supports the
+@@ -199,8 +199,8 @@
+     public abstract <T> T getPort(EndpointReference endpointReference,
+            Class<T> serviceEndpointInterface, WebServiceFeature... features);
+ 
+-    
+-    /** 
++
++    /**
+      * The <code>getPort</code> method returns a proxy. The parameter
+      * <code>serviceEndpointInterface</code> specifies the service
+      * endpoint interface that is supported by the returned proxy.
+@@ -225,7 +225,7 @@
+      **/
+     public abstract <T> T getPort(Class<T> serviceEndpointInterface);
+ 
+-    
++
+     /**
+      * The <code>getPort</code> method returns a proxy. The parameter
+      * <code>serviceEndpointInterface</code> specifies the service
+@@ -236,7 +236,7 @@
+      * The returned proxy should not be reconfigured by the client.
+      *
+      * @param serviceEndpointInterface Service endpoint interface
+-     * @param features  An array of <code>WebServiceFeatures</code> to configure on the 
++     * @param features  An array of <code>WebServiceFeatures</code> to configure on the
+      *                proxy.  Supported features not in the <code>features
+      *                </code> parameter will have their default values.
+      * @return Object instance that supports the
+@@ -258,11 +258,11 @@
+      *
+      * @since JAX-WS 2.1
+      **/
+-    public abstract <T> T getPort(Class<T> serviceEndpointInterface, 
++    public abstract <T> T getPort(Class<T> serviceEndpointInterface,
+             WebServiceFeature... features);
+-    
+-    
+-    /** 
++
++
++    /**
+      * Creates a new port for the service. Ports created in this way contain
+      * no WSDL port type information and can only be used for creating
+      * <code>Dispatch</code>instances.
+@@ -279,10 +279,10 @@
+      **/
+     public abstract void addPort(QName portName, String bindingId,
+             String endpointAddress);
+-    
+-   
+-    
+-    /** 
++
++
++
++    /**
+      * Creates a <code>Dispatch</code> instance for use with objects of
+      * the user's choosing.
+      *
+@@ -303,10 +303,10 @@
+      * @see javax.xml.transform.Source
+      * @see javax.xml.soap.SOAPMessage
+      **/
+-    public abstract <T> Dispatch<T> createDispatch(QName portName, Class<T> type, 
++    public abstract <T> Dispatch<T> createDispatch(QName portName, Class<T> type,
+             Service.Mode mode);
+-    
+-    /** 
++
++    /**
+      * Creates a <code>Dispatch</code> instance for use with objects of
+      * the user's choosing.
+      *
+@@ -320,14 +320,14 @@
+      * protocol, this parameter controls whether the user will work with
+      * SOAP messages or the contents of a SOAP body. Mode MUST be <code>MESSAGE</code>
+      * when type is <code>SOAPMessage</code>.
+-     * @param features  A list of <code>WebServiceFeatures</code> to configure on the 
++     * @param features  A list of <code>WebServiceFeatures</code> to configure on the
+      *                proxy.  Supported features not in the <code>features
+      *                </code> parameter will have their default values.
+      *
+      * @return Dispatch instance
+      * @throws WebServiceException If any error in the creation of
+-     *                  the <code>Dispatch</code> object or if a 
+-     *                  feature is enabled that is not compatible with 
++     *                  the <code>Dispatch</code> object or if a
++     *                  feature is enabled that is not compatible with
+      *                  this port or is unsupported.
+      *
+      * @see javax.xml.transform.Source
+@@ -336,13 +336,13 @@
+      *
+      * @since JAX-WS 2.1
+      **/
+-    public abstract <T> Dispatch<T> createDispatch(QName portName, Class<T> type, 
++    public abstract <T> Dispatch<T> createDispatch(QName portName, Class<T> type,
+             Service.Mode mode, WebServiceFeature... features);
+-    
+-    /** 
++
++    /**
+      * Creates a <code>Dispatch</code> instance for use with objects of
+      * the user's choosing. If there
+-     * are any reference parameters in the 
++     * are any reference parameters in the
+      * <code>endpointReference</code>, then those reference
+      * parameters MUST appear as SOAP headers, indicating them to be
+      * reference parameters, on all messages sent to the endpoint.
+@@ -353,20 +353,20 @@
+      * binding (and a port) and configuring the dispatch accordingly from
+      * the WSDL associated with this <code>Service</code> instance or
+      * from the metadata from the <code>endpointReference</code>.
+-     * If this <code>Service</code> instance has a WSDL and 
++     * If this <code>Service</code> instance has a WSDL and
+      * the <code>endpointReference</code>
+      * also has a WSDL in its metadata, then the WSDL from this instance MUST be used.
+      * If this <code>Service</code> instance does not have a WSDL and
+-     * the <code>endpointReference</code> does have a WSDL, then the 
+-     * WSDL from the <code>endpointReference</code> MAY be used. 
++     * the <code>endpointReference</code> does have a WSDL, then the
++     * WSDL from the <code>endpointReference</code> MAY be used.
+      * An implementation MUST be able to retrieve the <code>portName</code> from the
+-     * <code>endpointReference</code> metadata.  
++     * <code>endpointReference</code> metadata.
+      * <p>
+      * This method behaves the same as calling
+      * <pre>
+      * <code>dispatch = service.createDispatch(portName, type, mode, features);</code>
+      * </pre>
+-     * where the <code>portName</code> is retrieved from the 
++     * where the <code>portName</code> is retrieved from the
+      * WSDL or <code>EndpointReference</code> metadata.
+      *
+      * @param endpointReference  The <code>EndpointReference</code>
+@@ -381,12 +381,12 @@
+      * protocol, this parameter controls whether the user will work with
+      * SOAP messages or the contents of a SOAP body. Mode MUST be <code>MESSAGE</code>
+      * when type is <code>SOAPMessage</code>.
+-     * @param features  An array of <code>WebServiceFeatures</code> to configure on the 
++     * @param features  An array of <code>WebServiceFeatures</code> to configure on the
+      *                proxy.  Supported features not in the <code>features
+      *                </code> parameter will have their default values.
+      *
+      * @return Dispatch instance
+-     * @throws WebServiceException 
++     * @throws WebServiceException
+      *                  <UL>
+      *                    <LI>If there is any missing WSDL metadata
+      *                      as required by this method.
+@@ -398,7 +398,7 @@
+      *                    from the <code>EndpointReference</code> metadata.
+      *                    <li>If any error in the creation of
+      *                     the <code>Dispatch</code> object.
+-     *                    <li>If a feature is enabled that is not 
++     *                    <li>If a feature is enabled that is not
+      *                    compatible with this port or is unsupported.
+      *                  </UL>
+      *
+@@ -409,12 +409,12 @@
+      * @since JAX-WS 2.1
+      **/
+     public abstract <T> Dispatch<T> createDispatch(EndpointReference endpointReference,
+-            Class<T> type, Service.Mode mode, 
++            Class<T> type, Service.Mode mode,
+             WebServiceFeature... features);
+ 
+ 
+-    
+-    /** 
++
++    /**
+      * Creates a <code>Dispatch</code> instance for use with JAXB
+      * generated objects.
+      *
+@@ -435,9 +435,9 @@
+      **/
+     public abstract Dispatch<Object> createDispatch(QName portName,
+             JAXBContext context, Service.Mode mode);
+-    
+ 
+-    /** 
++
++    /**
+      * Creates a <code>Dispatch</code> instance for use with JAXB
+      * generated objects.
+      *
+@@ -449,14 +449,14 @@
+      * protocol messages or message payloads. E.g. when using the SOAP
+      * protocol, this parameter controls whether the user will work with
+      * SOAP messages or the contents of a SOAP body.
+-     * @param features  A list of <code>WebServiceFeatures</code> to configure on the 
++     * @param features  A list of <code>WebServiceFeatures</code> to configure on the
+      *                proxy.  Supported features not in the <code>features
+      *                </code> parameter will have their default values.
+      *
+      * @return Dispatch instance
+      * @throws WebServiceException If any error in the creation of
+-     *                  the <code>Dispatch</code> object or if a 
+-     *                  feature is enabled that is not compatible with 
++     *                  the <code>Dispatch</code> object or if a
++     *                  feature is enabled that is not compatible with
+      *                  this port or is unsupported.
+      *
+      * @see javax.xml.bind.JAXBContext
+@@ -466,11 +466,11 @@
+      **/
+     public abstract Dispatch<Object> createDispatch(QName portName,
+             JAXBContext context, Service.Mode mode, WebServiceFeature... features);
+-   
+-    /** 
++
++    /**
+      * Creates a <code>Dispatch</code> instance for use with JAXB
+      * generated objects. If there
+-     * are any reference parameters in the 
++     * are any reference parameters in the
+      * <code>endpointReference</code>, then those reference
+      * parameters MUST appear as SOAP headers, indicating them to be
+      * reference parameters, on all messages sent to the endpoint.
+@@ -481,21 +481,21 @@
+      * binding (and a port) and configuring the dispatch accordingly from
+      * the WSDL associated with this <code>Service</code> instance or
+      * from the metadata from the <code>endpointReference</code>.
+-     * If this <code>Service</code> instance has a WSDL and 
++     * If this <code>Service</code> instance has a WSDL and
+      * the <code>endpointReference</code>
+      * also has a WSDL in its metadata, then the WSDL from this instance
+      * MUST be used.
+      * If this <code>Service</code> instance does not have a WSDL and
+-     * the <code>endpointReference</code> does have a WSDL, then the 
+-     * WSDL from the <code>endpointReference</code> MAY be used.      
++     * the <code>endpointReference</code> does have a WSDL, then the
++     * WSDL from the <code>endpointReference</code> MAY be used.
+      * An implementation MUST be able to retrieve the <code>portName</code> from the
+-     * <code>endpointReference</code> metadata.  
++     * <code>endpointReference</code> metadata.
+      * <p>
+      * This method behavies the same as calling
+      * <pre>
+      * <code>dispatch = service.createDispatch(portName, context, mode, features);</code>
+      * </pre>
+-     * where the <code>portName</code> is retrieved from the 
++     * where the <code>portName</code> is retrieved from the
+      * WSDL or <code>endpointReference</code> metadata.
+      *
+      * @param endpointReference  The <code>EndpointReference</code>
+@@ -508,12 +508,12 @@
+      * protocol messages or message payloads. E.g. when using the SOAP
+      * protocol, this parameter controls whether the user will work with
+      * SOAP messages or the contents of a SOAP body.
+-     * @param features  An array of <code>WebServiceFeatures</code> to configure on the 
++     * @param features  An array of <code>WebServiceFeatures</code> to configure on the
+      *                proxy.  Supported features not in the <code>features
+      *                </code> parameter will have their default values.
+      *
+      * @return Dispatch instance
+-     * @throws WebServiceException 
++     * @throws WebServiceException
+      *                  <UL>
+      *                    <li>If there is any missing WSDL metadata
+      *                      as required by this method.
+@@ -525,7 +525,7 @@
+      *                    from the <code>EndpointReference</code> metadata.
+      *                    <li>If any error in the creation of
+      *                    the <code>Dispatch</code> object.
+-     *                    <li>if a feature is enabled that is not 
++     *                    <li>if a feature is enabled that is not
+      *                    compatible with this port or is unsupported.
+      *                  </UL>
+      *
+@@ -537,15 +537,15 @@
+     public abstract Dispatch<Object> createDispatch(EndpointReference endpointReference,
+             JAXBContext context, Service.Mode mode,
+             WebServiceFeature... features);
+-        
+-    
+-    /** 
++
++
++    /**
+      * Gets the name of this service.
+      * @return Qualified name of this service
+      **/
+     public abstract QName getServiceName();
+-    
+-    /** 
++
++    /**
+      * Returns an <code>Iterator</code> for the list of
+      * <code>QName</code>s of service endpoints grouped by this
+      * service
+@@ -556,8 +556,8 @@
+      *         have access to the required WSDL metadata
+      **/
+     public abstract Iterator<javax.xml.namespace.QName> getPorts();
+-    
+-    /** 
++
++    /**
+      * Gets the location of the WSDL document for this Service.
+      *
+      * @return URL for the location of the WSDL document for
+@@ -564,7 +564,7 @@
+      *         this service
+      **/
+     public abstract java.net.URL getWSDLDocumentLocation();
+-    
++
+     /**
+      * Returns the configured handler resolver.
+      *
+@@ -573,7 +573,7 @@
+      *         if there isn't one.
+      **/
+     public abstract HandlerResolver getHandlerResolver();
+-    
++
+     /**
+      * Sets the <code>HandlerResolver</code> for this <code>Service</code>
+      * instance.
+@@ -588,7 +588,7 @@
+      * @see javax.xml.ws.handler.HandlerResolver
+      **/
+     public abstract void setHandlerResolver(HandlerResolver handlerResolver);
+-    
++
+     /**
+      * Returns the executor for this <code>Service</code>instance.
+      *
+@@ -601,7 +601,7 @@
+      * @see java.util.concurrent.Executor
+      **/
+     public abstract java.util.concurrent.Executor getExecutor();
+-    
++
+     /**
+      * Sets the executor for this <code>Service</code> instance.
+      *
+@@ -618,5 +618,5 @@
+      * @see java.util.concurrent.Executor
+      **/
+     public abstract void setExecutor(java.util.concurrent.Executor executor);
+-    
++
+ }
+--- old/src/share/classes/javax/xml/ws/spi/WebServiceFeatureAnnotation.java	Thu Jul 30 18:56:43 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/ws/spi/WebServiceFeatureAnnotation.java	Thu Jul 30 18:56:42 2009
+@@ -37,11 +37,11 @@
+  * as a <code>WebServiceFeature</code>.
+  *
+  * Each <code>WebServiceFeature</code> annotation annotated with
+- * this annotation MUST contain an 
++ * this annotation MUST contain an
+  * <code>enabled</code> property of type
+- * <code>boolean</code> with a default value of <code>true</code>. 
++ * <code>boolean</code> with a default value of <code>true</code>.
+  * JAX-WS defines the following
+- * <code>WebServiceFeature</code> annotations (<code>Addressing</code>, 
++ * <code>WebServiceFeature</code> annotations (<code>Addressing</code>,
+  * <code>MTOM</code>, <code>RespectBinding</code>), however, an implementation
+  * may define vendors specific annotations for other features.
+  * If a JAX-WS implementation encounters an annotation annotated
+@@ -59,7 +59,7 @@
+ @Documented
+ public @interface WebServiceFeatureAnnotation {
+     /**
+-     * Unique identifier for the WebServiceFeature.  This 
++     * Unique identifier for the WebServiceFeature.  This
+      * identifier MUST be unique across all implementations
+      * of JAX-WS.
+      */
+--- old/src/share/classes/javax/xml/ws/wsaddressing/W3CEndpointReference.java	Thu Jul 30 18:56:47 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/ws/wsaddressing/W3CEndpointReference.java	Thu Jul 30 18:56:46 2009
+@@ -58,7 +58,7 @@
+  * JAXB will use the JAXB annotations and bind this class to XML infoset
+  * that is consistent with that defined by WS-Addressing.  See
+  * <a href="http://www.w3.org/TR/2006/REC-ws-addr-core-20060509/">
+- * WS-Addressing</a> 
++ * WS-Addressing</a>
+  * for more information on WS-Addressing EndpointReferences.
+  *
+  * @since JAX-WS 2.1
+@@ -68,12 +68,12 @@
+ @XmlRootElement(name="EndpointReference",namespace=W3CEndpointReference.NS)
+ @XmlType(name="EndpointReferenceType",namespace=W3CEndpointReference.NS)
+ public final class W3CEndpointReference extends EndpointReference {
+-    
++
+     private final static JAXBContext w3cjc = getW3CJaxbContext();
+ 
+     protected W3CEndpointReference() {
+     }
+-    
++
+     /**
+      * Creates an EPR from infoset representation
+      *
+@@ -81,10 +81,10 @@
+      * instance consistent with the W3C WS-Addressing Core
+      * recommendation.
+      *
+-     * @throws WebServiceException 
++     * @throws WebServiceException
+      *   If the source does NOT contain a valid W3C WS-Addressing
+      *   EndpointReference.
+-     * @throws NullPointerException 
++     * @throws NullPointerException
+      *   If the <code>null</code> <code>source</code> value is given
+      */
+     public W3CEndpointReference(Source source) {
+@@ -93,6 +93,8 @@
+             this.address = epr.address;
+             this.metadata = epr.metadata;
+             this.referenceParameters = epr.referenceParameters;
++            this.attributes = epr.attributes;
++            this.elements = epr.elements;
+         } catch (JAXBException e) {
+             throw new WebServiceException("Error unmarshalling W3CEndpointReference " ,e);
+         } catch (ClassCastException e) {
+@@ -99,7 +101,7 @@
+             throw new WebServiceException("Source did not contain W3CEndpointReference", e);
+         }
+     }
+-    
++
+     /**
+      * {@inheritDoc}
+      */
+@@ -106,13 +108,12 @@
+     public void writeTo(Result result){
+         try {
+             Marshaller marshaller = w3cjc.createMarshaller();
+-            marshaller.setProperty(Marshaller.JAXB_FRAGMENT, true);
+             marshaller.marshal(this, result);
+         } catch (JAXBException e) {
+             throw new WebServiceException("Error marshalling W3CEndpointReference. ", e);
+         }
+     }
+-    
++
+     private static JAXBContext getW3CJaxbContext() {
+         try {
+             return JAXBContext.newInstance(W3CEndpointReference.class);
+@@ -120,7 +121,7 @@
+             throw new WebServiceException("Error creating JAXBContext for W3CEndpointReference. ", e);
+         }
+     }
+-    
++
+     // private but necessary properties for databinding
+     @XmlElement(name="Address",namespace=NS)
+     private Address address;
+@@ -132,8 +133,8 @@
+     Map<QName,String> attributes;
+     @XmlAnyElement
+     List<Element> elements;
+-    
+-    
++
++
+     private static class Address {
+         protected Address() {}
+         @XmlValue
+@@ -141,8 +142,8 @@
+         @XmlAnyAttribute
+         Map<QName,String> attributes;
+     }
+-    
+-    
++
++
+     private static class Elements {
+         protected Elements() {}
+         @XmlAnyElement
+@@ -150,6 +151,6 @@
+         @XmlAnyAttribute
+         Map<QName,String> attributes;
+     }
+-    
++
+     protected static final String NS = "http://www.w3.org/2005/08/addressing";
+ }
+--- old/src/share/classes/javax/xml/ws/wsaddressing/W3CEndpointReferenceBuilder.java	Thu Jul 30 18:56:50 2009
++++ openjdk/jaxws/src/share/classes/javax/xml/ws/wsaddressing/W3CEndpointReferenceBuilder.java	Thu Jul 30 18:56:49 2009
+@@ -40,7 +40,7 @@
+  * instances. The intended use of this clsss is for
+  * an application component, for example a factory component,
+  * to create an <code>W3CEndpointReference</code> for a
+- * web service endpoint published by the same 
++ * web service endpoint published by the same
+  * Java EE application. It can also be used to create
+  * <code>W3CEndpointReferences</code> for an Java SE based
+  * endpoint by providing the <code>address</code> property.
+@@ -47,9 +47,9 @@
+  * <p>
+  * When creating a <code>W3CEndpointReference</code> for an
+  * endpoint that is not published by the same Java EE application,
+- * the <code>address</code> property MUST be specified.  
++ * the <code>address</code> property MUST be specified.
+  * <p>
+- * When creating a <code>W3CEndpointReference</code> for an endpoint 
++ * When creating a <code>W3CEndpointReference</code> for an endpoint
+  * published by the same Java EE application, the <code>address</code>
+  * property MAY be <code>null</code> but then the <code>serviceName</code>
+  * and <code>endpointName</code> MUST specify an endpoint published by
+@@ -57,7 +57,7 @@
+  * <p>
+  * When the <code>wsdlDocumentLocation</code> is specified it MUST refer
+  * to a valid WSDL document and the <code>serviceName</code> and
+- * <code>endpointName</code> (if specified) MUST match a service and port 
++ * <code>endpointName</code> (if specified) MUST match a service and port
+  * in the WSDL document.
+  *
+  * @since JAX-WS 2.1
+@@ -70,7 +70,7 @@
+         referenceParameters = new ArrayList<Element>();
+         metadata = new ArrayList<Element>();
+     }
+-    
++
+     /**
+      * Sets the <code>address</code> to the
+      * <code>W3CEndpointReference</code> instance's
+@@ -77,7 +77,7 @@
+      * <code>wsa:Address</code>.
+      * <p>
+      * The <code>address</code> MUST be set to a non-<code>null</code>
+-     * value when building a <code>W3CEndpointReference</code> for a 
++     * value when building a <code>W3CEndpointReference</code> for a
+      * web service endpoint that is not published by the same
+      * Java EE application or when running on Java SE.
+      *
+@@ -91,7 +91,7 @@
+         this.address = address;
+         return this;
+     }
+-    
++
+     /**
+      * Sets the <code>serviceName</code> of the endpoint to be targeted
+      *      by the returned <code>W3CEndpointReference</code>.
+@@ -98,8 +98,8 @@
+      *
+      * @param serviceName The service name of the endpoint to be targeted
+      *      by the returned <code>W3CEndpointReference<code>.  This property
+-     *      may also be used with the <code>endpointName</code> (portName) 
+-     *      property to lookup the <code>address</code> of a web service 
++     *      may also be used with the <code>endpointName</code> (portName)
++     *      property to lookup the <code>address</code> of a web service
+      *      endpoint that is published by the same Java EE application.
+      *
+      * @return A <code>W3CEndpointReferenceBuilder</code> instance with
+@@ -110,18 +110,18 @@
+         this.serviceName = serviceName;
+         return this;
+     }
+-    
++
+     /**
+      * Sets the <code>endpointName</code> of the endpoint to
+-     * be targeted by the returned <code>W3CEndpointRefernce</code>. 
++     * be targeted by the returned <code>W3CEndpointRefernce</code>.
+      * This method can only
+      * be called after the {@link #serviceName} method has been called.
+      *
+      * @param endpointName The name of the endpoint to be targeted
+-     *      by the returned <code>W3CEndpointReference<code>. The 
++     *      by the returned <code>W3CEndpointReference<code>. The
+      *      <code>endpointName</code> (portName) property may also be
+-     *      used with the <code>serviceName</code> property to lookup 
+-     *      the <code>address</code> of a web service 
++     *      used with the <code>serviceName</code> property to lookup
++     *      the <code>address</code> of a web service
+      *      endpoint published by the same Java EE application.
+      *
+      * @return A <code>W3CEndpointReferenceBuilder</code> instance with
+@@ -134,16 +134,16 @@
+         if (serviceName == null) {
+             throw new IllegalStateException("The W3CEndpointReferenceBuilder's serviceName must be set before setting the endpointName: "+endpointName);
+         }
+-        
++
+         this.endpointName = endpointName;
+         return this;
+     }
+-    
++
+     /**
+      * Sets the <code>wsdlDocumentLocation</code> associated with the targeted
+      * <code>W3CEndpointReference</code>.
+      *
+-     * @param wsdlDocumentLocation The location of the WSDL document associated 
++     * @param wsdlDocumentLocation The location of the WSDL document associated
+      * with the targeted <code>W3CEndpointReference</code>.
+      *
+      * @return A <code>W3CEndpointReferenceBuilder</code> instance with
+@@ -154,7 +154,7 @@
+         this.wsdlDocumentLocation = wsdlDocumentLocation;
+         return this;
+     }
+-    
++
+     /**
+      * Adds the <code>referenceParameter</code> to the
+      * <code>W3CEndpointReference</code> instance
+@@ -176,7 +176,7 @@
+         referenceParameters.add(referenceParameter);
+         return this;
+     }
+-    
++
+     /**
+      * Adds the <code>metadataElement</code> to the
+      * <code>W3CEndpointReference</code> instance's
+@@ -198,7 +198,7 @@
+         metadata.add(metadataElement);
+         return this;
+     }
+-    
++
+     /**
+      * Builds a <code>W3CEndpointReference</code> from the accumulated
+      * properties set on this <code>W3CEndpointReferenceBuilder</code>
+@@ -209,16 +209,16 @@
+      * with any other desired properties.  This method
+      * can also be used to create a <code>W3CEndpointReference</code> for
+      * an endpoint that is published by the same Java EE application.
+-     * This method can automatically determine the <code>address</code> of 
+-     * an endpoint published by the same Java EE application that is identified by the 
+-     * <code>serviceName</code> and 
+-     * <code>endpointName</code> properties.  If the <code>address</code> is 
+-     * <code>null</code> and the <code>serviceName</code> and 
+-     * <code>endpointName</code> 
+-     * do not identify an endpoint published by the same Java EE application, a 
++     * This method can automatically determine the <code>address</code> of
++     * an endpoint published by the same Java EE application that is identified by the
++     * <code>serviceName</code> and
++     * <code>endpointName</code> properties.  If the <code>address</code> is
++     * <code>null</code> and the <code>serviceName</code> and
++     * <code>endpointName</code>
++     * do not identify an endpoint published by the same Java EE application, a
+      * <code>java.lang.IllegalStateException</code> MUST be thrown.
+-     * 
+      *
++     *
+      * @return <code>W3CEndpointReference</code> from the accumulated
+      * properties set on this <code>W3CEndpointReferenceBuilder</code>
+      * instance. This method never returns <code>null</code>.
+@@ -240,9 +240,9 @@
+      *        <li>If the <code>wsdlDocumentLocation</code> is NOT <code>null</code>
+      *            and does not represent a valid WSDL.
+      *     </ul>
+-     * @throws WebServiceException If an error occurs while creating the 
++     * @throws WebServiceException If an error occurs while creating the
+      *                             <code>W3CEndpointReference</code>.
+-     *       
++     *
+      */
+     public W3CEndpointReference build() {
+         return Provider.provider().createW3CEndpointReference(address,
+@@ -249,7 +249,7 @@
+                 serviceName, endpointName, metadata, wsdlDocumentLocation,
+                 referenceParameters);
+     }
+-    
++
+     private String address;
+     private List<Element> referenceParameters;
+     private List<Element> metadata;
+--- old/src/share/classes/org/relaxng/datatype/Datatype.java	Thu Jul 30 18:56:54 2009
++++ openjdk/jaxws/src/share/classes/org/relaxng/datatype/Datatype.java	Thu Jul 30 18:56:53 2009
+@@ -22,7 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-
+ package org.relaxng.datatype;
+ 
+ /**
+--- old/src/share/classes/org/relaxng/datatype/DatatypeBuilder.java	Thu Jul 30 18:56:57 2009
++++ openjdk/jaxws/src/share/classes/org/relaxng/datatype/DatatypeBuilder.java	Thu Jul 30 18:56:57 2009
+@@ -22,7 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-
+ package org.relaxng.datatype;
+ 
+ /**
+--- old/src/share/classes/org/relaxng/datatype/DatatypeException.java	Thu Jul 30 18:57:01 2009
++++ openjdk/jaxws/src/share/classes/org/relaxng/datatype/DatatypeException.java	Thu Jul 30 18:57:00 2009
+@@ -22,7 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-
+ package org.relaxng.datatype;
+ 
+ /**
+--- old/src/share/classes/org/relaxng/datatype/DatatypeLibrary.java	Thu Jul 30 18:57:04 2009
++++ openjdk/jaxws/src/share/classes/org/relaxng/datatype/DatatypeLibrary.java	Thu Jul 30 18:57:04 2009
+@@ -22,7 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-
+ package org.relaxng.datatype;
+ 
+ /**
+--- old/src/share/classes/org/relaxng/datatype/DatatypeLibraryFactory.java	Thu Jul 30 18:57:08 2009
++++ openjdk/jaxws/src/share/classes/org/relaxng/datatype/DatatypeLibraryFactory.java	Thu Jul 30 18:57:07 2009
+@@ -22,7 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-
+ package org.relaxng.datatype;
+ 
+ /**
+--- old/src/share/classes/org/relaxng/datatype/DatatypeStreamingValidator.java	Thu Jul 30 18:57:11 2009
++++ openjdk/jaxws/src/share/classes/org/relaxng/datatype/DatatypeStreamingValidator.java	Thu Jul 30 18:57:11 2009
+@@ -22,7 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-
+ package org.relaxng.datatype;
+ 
+ /**
+--- old/src/share/classes/org/relaxng/datatype/ValidationContext.java	Thu Jul 30 18:57:15 2009
++++ openjdk/jaxws/src/share/classes/org/relaxng/datatype/ValidationContext.java	Thu Jul 30 18:57:14 2009
+@@ -22,7 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-
+ package org.relaxng.datatype;
+ 
+ /**
+--- old/src/share/classes/org/relaxng/datatype/helpers/DatatypeLibraryLoader.java	Thu Jul 30 18:57:19 2009
++++ openjdk/jaxws/src/share/classes/org/relaxng/datatype/helpers/DatatypeLibraryLoader.java	Thu Jul 30 18:57:18 2009
+@@ -148,8 +148,7 @@
+ 
+             Enumeration getResources(String resName) {
+               try {
+-                    return cl.getResources(resName);
+-
++                return cl.getResources(resName);
+               }
+               catch (IOException e) {
+                 return new Singleton(null);
+--- old/src/share/classes/org/relaxng/datatype/helpers/ParameterlessDatatypeBuilder.java	Thu Jul 30 18:57:22 2009
++++ openjdk/jaxws/src/share/classes/org/relaxng/datatype/helpers/ParameterlessDatatypeBuilder.java	Thu Jul 30 18:57:22 2009
+@@ -22,7 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-
+ package org.relaxng.datatype.helpers;
+ 
+ import org.relaxng.datatype.*;
+--- old/src/share/classes/org/relaxng/datatype/helpers/StreamingValidatorImpl.java	Thu Jul 30 18:57:26 2009
++++ openjdk/jaxws/src/share/classes/org/relaxng/datatype/helpers/StreamingValidatorImpl.java	Thu Jul 30 18:57:25 2009
+@@ -22,7 +22,6 @@
+  * CA 95054 USA or visit www.sun.com if you need additional information or
+  * have any questions.
+  */
+-
+ package org.relaxng.datatype.helpers;
+ 
+ import org.relaxng.datatype.*;
+--- /dev/null	Thu Jul 30 18:57:29 2009
++++ openjdk/jaxws/src/share/classes/com/sun/istack/internal/Builder.java	Thu Jul 30 18:57:29 2009
+@@ -0,0 +1,33 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++package com.sun.istack.internal;
++
++/**
++ *
++ * @author Martin Grebac
++ */
++public interface Builder<T> {
++    T build();
++}
+--- /dev/null	Thu Jul 30 18:57:33 2009
++++ openjdk/jaxws/src/share/classes/com/sun/istack/internal/localization/Localizable.java	Thu Jul 30 18:57:32 2009
+@@ -0,0 +1,63 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++
++package com.sun.istack.internal.localization;
++
++/**
++ * Localizable message.
++ *
++ * @author WS Development Team
++ */
++public interface Localizable {
++    /**
++     * Gets the key in the resource bundle.
++     *
++     * @return
++     *      if this method returns {@link #NOT_LOCALIZABLE},
++     *      that means the message is not localizable, and
++     *      the first item of {@link #getArguments()} array
++     *      holds a String.
++     */
++    public String getKey();
++
++    /**
++     * Returns the arguments for message formatting.
++     *
++     * @return
++     *      can be an array of length 0 but never be null.
++     */
++    public Object[] getArguments();
++    public String getResourceBundleName();
++
++
++    /**
++     * Special constant that represents a message that
++     * is not localizable.
++     *
++     * <p>
++     * Use of "new" is to create an unique instance.
++     */
++    public static final String NOT_LOCALIZABLE = new String("\u0000");
++}
+--- /dev/null	Thu Jul 30 18:57:36 2009
++++ openjdk/jaxws/src/share/classes/com/sun/istack/internal/localization/LocalizableMessage.java	Thu Jul 30 18:57:35 2009
+@@ -0,0 +1,56 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++
++package com.sun.istack.internal.localization;
++
++/**
++ * @author WS Development Team
++ */
++public final class LocalizableMessage implements Localizable {
++
++    private final String _bundlename;
++    private final String _key;
++    private final Object[] _args;
++
++    public LocalizableMessage(String bundlename, String key, Object... args) {
++        _bundlename = bundlename;
++        _key = key;
++        if(args==null)
++            args = new Object[0];
++        _args = args;
++    }
++
++    public String getKey() {
++        return _key;
++    }
++
++    public Object[] getArguments() {
++        return _args;
++    }
++
++    public String getResourceBundleName() {
++        return _bundlename;
++    }
++}
+--- /dev/null	Thu Jul 30 18:57:39 2009
++++ openjdk/jaxws/src/share/classes/com/sun/istack/internal/localization/LocalizableMessageFactory.java	Thu Jul 30 18:57:38 2009
+@@ -0,0 +1,43 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++
++package com.sun.istack.internal.localization;
++
++/**
++ * @author WS Development Team
++ */
++public class LocalizableMessageFactory {
++
++    private final String _bundlename;
++
++    public LocalizableMessageFactory(String bundlename) {
++        _bundlename = bundlename;
++    }
++
++    public Localizable getMessage(String key, Object... args) {
++        return new LocalizableMessage(_bundlename, key, args);
++    }
++
++}
+--- /dev/null	Thu Jul 30 18:57:42 2009
++++ openjdk/jaxws/src/share/classes/com/sun/istack/internal/localization/Localizer.java	Thu Jul 30 18:57:41 2009
+@@ -0,0 +1,149 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++
++package com.sun.istack.internal.localization;
++
++import java.text.MessageFormat;
++import java.util.HashMap;
++import java.util.Locale;
++import java.util.MissingResourceException;
++import java.util.ResourceBundle;
++
++/**
++ * Localizes the {@link Localizable} into a message
++ * by using a configured {@link Locale}.
++ *
++ * @author WS Development Team
++ */
++public class Localizer {
++
++    private final Locale _locale;
++    private final HashMap _resourceBundles;
++
++    public Localizer() {
++        this(Locale.getDefault());
++    }
++
++    public Localizer(Locale l) {
++        _locale = l;
++        _resourceBundles = new HashMap();
++    }
++
++    public Locale getLocale() {
++        return _locale;
++    }
++
++    public String localize(Localizable l) {
++        String key = l.getKey();
++        if (key == Localizable.NOT_LOCALIZABLE) {
++            // this message is not localizable
++            return (String) l.getArguments()[0];
++        }
++        String bundlename = l.getResourceBundleName();
++
++        try {
++            ResourceBundle bundle =
++                (ResourceBundle) _resourceBundles.get(bundlename);
++
++            if (bundle == null) {
++                try {
++                    bundle = ResourceBundle.getBundle(bundlename, _locale);
++                } catch (MissingResourceException e) {
++                    // work around a bug in the com.sun.enterprise.deployment.WebBundleArchivist:
++                    //   all files with an extension different from .class (hence all the .properties files)
++                    //   get copied to the top level directory instead of being in the package where they
++                    //   are defined
++                    // so, since we can't find the bundle under its proper name, we look for it under
++                    //   the top-level package
++
++                    int i = bundlename.lastIndexOf('.');
++                    if (i != -1) {
++                        String alternateBundleName =
++                            bundlename.substring(i + 1);
++                        try {
++                            bundle =
++                                ResourceBundle.getBundle(
++                                    alternateBundleName,
++                                    _locale);
++                        } catch (MissingResourceException e2) {
++                            // give up
++                            return getDefaultMessage(l);
++                        }
++                    }
++                }
++
++                _resourceBundles.put(bundlename, bundle);
++            }
++
++            if (bundle == null) {
++                return getDefaultMessage(l);
++            }
++
++            if (key == null)
++                key = "undefined";
++
++            String msg;
++            try {
++                msg = bundle.getString(key);
++            } catch (MissingResourceException e) {
++                // notice that this may throw a MissingResourceException of its own (caught below)
++                msg = bundle.getString("undefined");
++            }
++
++            // localize all arguments to the given localizable object
++            Object[] args = l.getArguments();
++            for (int i = 0; i < args.length; ++i) {
++                if (args[i] instanceof Localizable)
++                    args[i] = localize((Localizable) args[i]);
++            }
++
++            String message = MessageFormat.format(msg, args);
++            return message;
++
++        } catch (MissingResourceException e) {
++            return getDefaultMessage(l);
++        }
++
++    }
++
++    private String getDefaultMessage(Localizable l) {
++        String key = l.getKey();
++        Object[] args = l.getArguments();
++        StringBuilder sb = new StringBuilder();
++        sb.append("[failed to localize] ");
++        sb.append(key);
++        if (args != null) {
++            sb.append('(');
++            for (int i = 0; i < args.length; ++i) {
++                if (i != 0)
++                    sb.append(", ");
++                sb.append(String.valueOf(args[i]));
++            }
++            sb.append(')');
++        }
++        return sb.toString();
++    }
++
++}
+--- /dev/null	Thu Jul 30 18:57:45 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/jxc/SchemaGeneratorFacade.java	Thu Jul 30 18:57:45 2009
+@@ -0,0 +1,56 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++
++package com.sun.tools.internal.jxc;
++
++import java.lang.reflect.InvocationTargetException;
++import java.lang.reflect.Method;
++
++/**
++ * CLI entry point to schemagen that checks for JDK 5.0
++ * @author Kohsuke Kawaguchi
++ */
++public class SchemaGeneratorFacade {
++
++    public static void main(String[] args) throws Throwable {
++        try {
++            ClassLoader cl = SchemaGeneratorFacade.class.getClassLoader();
++            if(cl==null)    cl = ClassLoader.getSystemClassLoader();
++
++            Class driver = cl.loadClass("com.sun.tools.internal.jxc.SchemaGenerator");
++            Method mainMethod = driver.getDeclaredMethod("main", new Class[]{String[].class});
++            try {
++                mainMethod.invoke(null,new Object[]{args});
++            } catch (IllegalAccessException e) {
++                throw e;
++            } catch (InvocationTargetException e) {
++                if(e.getTargetException()!=null)
++                    throw e.getTargetException();
++            }
++        } catch (UnsupportedClassVersionError e) {
++            System.err.println("schemagen requires JDK 5.0 or later. Please download it from http://java.sun.com/j2se/1.5/");
++        }
++    }
++}
+--- /dev/null	Thu Jul 30 18:57:49 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/api/WsgenExtension.java	Thu Jul 30 18:57:48 2009
+@@ -0,0 +1,43 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++package com.sun.tools.internal.ws.api;
++
++/**
++ * Allows to customize wsgen behaviour using this extension.
++ * The extension implementations are found using service
++ * discovery mechanism i.e. JAX-WS tooltime locates
++ * {@link WsgenExtension}s through the
++ * <tt>META-INF/services/com.sun.tools.internal.ws.api.WsgenExtension</tt>
++ * files.
++ *
++ * {@link WsgenProtocol} annotation can be specified on the
++ * extensions to extend -wsdl[:protocol] behaviour.
++ *
++ * @author Jitendra Kotamraju
++ * @since JAX-WS RI 2.1.6
++ * @see WsgenProtocol
++ */
++public abstract class WsgenExtension {
++}
+--- /dev/null	Thu Jul 30 18:57:52 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/api/WsgenProtocol.java	Thu Jul 30 18:57:51 2009
+@@ -0,0 +1,52 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++package com.sun.tools.internal.ws.api;
++
++import java.lang.annotation.*;
++
++/**
++ * Allows to extend protocol for wsgen's wsdl[:protocol] switch.
++ * This annotation must be specified on {@link WsgenExtension}
++ * implementations.
++ *
++ * @author Jitendra Kotamraju
++ * @since JAX-WS RI 2.1.6
++ */
++@Target(ElementType.TYPE)
++@Retention(RetentionPolicy.RUNTIME)
++@Documented
++public @interface WsgenProtocol {
++    /**
++     * Token for wsgen -wsdl[:protocol]
++     * @return
++     */
++    String token();
++
++    /**
++     * The corresponding lexical string used to create BindingID
++     * @return
++     */
++    String lexical();
++}
+--- /dev/null	Thu Jul 30 18:57:55 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/wscompile/AuthInfo.java	Thu Jul 30 18:57:54 2009
+@@ -0,0 +1,64 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++package com.sun.tools.internal.ws.wscompile;
++
++import com.sun.istack.internal.NotNull;
++
++import java.net.URL;
++
++/**
++ * Represents authorization information needed by {@link com.sun.tools.internal.ws.wscompile.DefaultAuthenticator} to
++ * authenticate wsimport to access the wsdl.
++ *
++ * @author Vivek Pandey
++ */
++
++public final class AuthInfo {
++    private final String user;
++    private final String password;
++    private final URL url;
++
++    public AuthInfo(@NotNull URL url, @NotNull String user, @NotNull String password){
++        this.url = url;
++        this.user = user;
++        this.password = password;
++    }
++
++    public String getUser() {
++        return user;
++    }
++
++    public String getPassword() {
++        return password;
++    }
++
++    /**
++     * Returns if the requesting host and port are associated with this {@link AuthInfo}
++     */
++    public boolean matchingHost(@NotNull URL requestingURL) {
++        return requestingURL.equals(url);
++    }
++
++}
+--- /dev/null	Thu Jul 30 18:57:58 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/wscompile/DefaultAuthTester.java	Thu Jul 30 18:57:58 2009
+@@ -0,0 +1,66 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++package com.sun.tools.internal.ws.wscompile;
++
++import com.sun.istack.internal.NotNull;
++import com.sun.tools.internal.ws.processor.modeler.wsdl.ConsoleErrorReporter;
++
++import java.io.File;
++import java.net.MalformedURLException;
++import java.net.PasswordAuthentication;
++import java.net.URL;
++import java.util.Arrays;
++
++/**
++ * @author Vivek Pandey
++ */
++public class DefaultAuthTester {
++    public static void main(String[] args) throws BadCommandLineException {
++        DefaultAuthenticator da = new MyAuthenticator(new ConsoleErrorReporter(System.out), new File("c:\\Users\\vivekp\\.metro\\auth"));
++
++        PasswordAuthentication pa = da.getPasswordAuthentication();
++        if(pa!= null && pa.getUserName().equals("vivek") && Arrays.equals(pa.getPassword(), "test".toCharArray()))
++            System.out.println("Success!");
++        else
++            System.out.println("Failiure!");
++
++    }
++
++    private static class MyAuthenticator extends DefaultAuthenticator{
++
++        public MyAuthenticator(@NotNull ErrorReceiver receiver, @NotNull File authfile) throws BadCommandLineException {
++            super(receiver, authfile);
++        }
++
++        protected URL getRequestingURL() {
++            try {
++                return new URL("http://foo.com/myservice?wsdl");
++            } catch (MalformedURLException e) {
++                e.printStackTrace();
++            }
++            return null;
++        }
++    }
++}
+--- /dev/null	Thu Jul 30 18:58:02 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/wscompile/DefaultAuthenticator.java	Thu Jul 30 18:58:01 2009
+@@ -0,0 +1,154 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++package com.sun.tools.internal.ws.wscompile;
++
++import com.sun.istack.internal.NotNull;
++import com.sun.tools.internal.ws.resources.WscompileMessages;
++import org.xml.sax.SAXParseException;
++import org.xml.sax.helpers.LocatorImpl;
++
++import java.io.*;
++import java.net.Authenticator;
++import java.net.PasswordAuthentication;
++import java.net.URL;
++import java.util.ArrayList;
++import java.util.List;
++
++/**
++ * @author Vivek Pandey
++ */
++public class DefaultAuthenticator extends Authenticator {
++
++    private final List<AuthInfo> authInfo = new ArrayList<AuthInfo>();
++    private final ErrorReceiver errReceiver;
++    private final String proxyUser;
++    private final String proxyPasswd;
++
++    //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";
++    private File authFile = new File(defaultAuthfile);
++    private boolean giveError;
++
++    public DefaultAuthenticator(@NotNull ErrorReceiver receiver, @NotNull File authfile) throws BadCommandLineException {
++        this.errReceiver = receiver;
++        this.proxyUser = System.getProperty("http.proxyUser");
++        this.proxyPasswd = System.getProperty("http.proxyPassword");
++
++        if(authfile != null){
++            this.authFile = authfile;
++            this.giveError = true;
++        }
++
++        if(!authFile.exists()){
++            try {
++                error(new SAXParseException(WscompileMessages.WSIMPORT_AUTH_FILE_NOT_FOUND(authFile.getCanonicalPath(), defaultAuthfile), null));
++            } catch (IOException e) {
++                error(new SAXParseException(WscompileMessages.WSIMPORT_FAILED_TO_PARSE(authFile,e.getMessage()), null));
++            }
++            return;
++        }
++
++        if(!authFile.canRead()){
++            error(new SAXParseException("Authorization file: "+authFile + " does not have read permission!", null));
++            return;
++        }
++        parseAuth();
++    }
++
++    protected PasswordAuthentication getPasswordAuthentication() {
++        //If user sets proxy user and passwd and the RequestType is from proxy server then create
++        // PasswordAuthentication using proxyUser and proxyClass;
++        if((getRequestorType() == RequestorType.PROXY) && proxyUser != null && proxyPasswd != null){
++            return new PasswordAuthentication(proxyUser, proxyPasswd.toCharArray());
++        }
++        for(AuthInfo auth:authInfo){
++            if(auth.matchingHost(getRequestingURL())){
++                return new PasswordAuthentication(auth.getUser(), auth.getPassword().toCharArray());
++            }
++        }
++        return null;
++    }
++
++    private void parseAuth() {
++        errReceiver.info(new SAXParseException(WscompileMessages.WSIMPORT_READING_AUTH_FILE(authFile), null));
++
++        BufferedReader in;
++        try {
++            in = new BufferedReader(new InputStreamReader(new FileInputStream(authFile), "UTF-8"));
++        } catch (UnsupportedEncodingException e) {
++            error(new SAXParseException(e.getMessage(), null));
++            return;
++        } catch (FileNotFoundException e) {
++            error(new SAXParseException(WscompileMessages.WSIMPORT_AUTH_FILE_NOT_FOUND(authFile, defaultAuthfile), null, e));
++            return;
++        }
++        String text;
++        LocatorImpl locator = new LocatorImpl();
++        try {
++            int lineno = 1;
++
++            locator.setSystemId(authFile.getCanonicalPath());
++
++            while ((text = in.readLine()) != null) {
++                locator.setLineNumber(lineno++);
++                try {
++                    URL url = new URL(text);
++                    String authinfo = url.getUserInfo();
++
++                    if (authinfo != null) {
++                        int i = authinfo.indexOf(':');
++
++                        if (i >= 0) {
++                            String user = authinfo.substring(0, i);
++                            String password = authinfo.substring(i + 1);
++                            authInfo.add(new AuthInfo(new URL(text), user, password));
++                        } else {
++                            error(new SAXParseException(WscompileMessages.WSIMPORT_ILLEGAL_AUTH_INFO(url), locator));
++                        }
++                    } else {
++                        error(new SAXParseException(WscompileMessages.WSIMPORT_ILLEGAL_AUTH_INFO(url), locator));
++                    }
++
++                } catch (NumberFormatException e) {
++                    error(new SAXParseException(WscompileMessages.WSIMPORT_ILLEGAL_AUTH_INFO(text), locator));
++                }
++            }
++            in.close();
++        } catch (IOException e) {
++            error(new SAXParseException(WscompileMessages.WSIMPORT_FAILED_TO_PARSE(authFile,e.getMessage()), locator));
++        }
++    }
++
++    /**
++     * When user provides authfile explicitly using -Xauthfile we throw error otherwise show the mesage by default with -Xdebug flag
++     */
++    private void error(SAXParseException e){
++        if(giveError){
++            errReceiver.error(e);
++        } else{
++            errReceiver.debug(e);
++        }
++    }
++}
+--- /dev/null	Thu Jul 30 18:58:05 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/ws/wsdl/parser/DOMForestParser.java	Thu Jul 30 18:58:04 2009
+@@ -0,0 +1,94 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++package com.sun.tools.internal.ws.wsdl.parser;
++
++import org.w3c.dom.Document;
++import org.xml.sax.ContentHandler;
++import org.xml.sax.EntityResolver;
++import org.xml.sax.ErrorHandler;
++import org.xml.sax.InputSource;
++import org.xml.sax.SAXException;
++
++import java.io.IOException;
++
++import com.sun.xml.internal.xsom.parser.XMLParser;
++
++/**
++ * {@link XMLParser} implementation that
++ * parses XML from a DOM forest instead of parsing it from
++ * its original location.
++ *
++ * @author Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
++ * @author Vivek Pandey
++ */
++public class DOMForestParser implements XMLParser {
++
++    /**
++     * DOM forest to be "parsed".
++     */
++    private final DOMForest forest;
++
++    /**
++     * Scanner object will do the actual SAX events generation.
++     */
++    private final DOMForestScanner scanner;
++
++    private final XMLParser fallbackParser;
++
++    /**
++     * @param fallbackParser This parser will be used when DOMForestParser needs to parse
++     *                       documents that are not in the forest.
++     */
++    public DOMForestParser(DOMForest forest, XMLParser fallbackParser) {
++        this.forest = forest;
++        this.scanner = new DOMForestScanner(forest);
++        this.fallbackParser = fallbackParser;
++    }
++
++
++    public void parse(InputSource source, ContentHandler handler,  EntityResolver entityResolver, ErrorHandler errHandler) throws SAXException, IOException {
++
++    }
++
++    public void parse(InputSource source, ContentHandler handler, ErrorHandler errorHandler, EntityResolver entityResolver)
++
++            throws SAXException, IOException {
++        String systemId = source.getSystemId();
++        Document dom = forest.get(systemId);
++
++        if (dom == null) {
++            // if no DOM tree is built for it,
++            // let the fall back parser parse the original document.
++            //
++            // for example, XSOM parses datatypes.xsd (XML Schema part 2)
++            // but this will never be built into the forest.
++            fallbackParser.parse(source, handler, errorHandler, entityResolver);
++            return;
++        }
++
++        scanner.scan(dom, handler);
++
++    }
++}
+--- /dev/null	Thu Jul 30 18:58:08 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/ClassLoaderBuilder.java	Thu Jul 30 18:58:07 2009
+@@ -0,0 +1,122 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++
++package com.sun.tools.internal.xjc;
++
++import java.net.MalformedURLException;
++import java.net.URL;
++import java.net.URLClassLoader;
++import java.util.ArrayList;
++import java.util.Arrays;
++import java.util.List;
++
++import javax.xml.bind.JAXBContext;
++
++import com.sun.istack.internal.tools.MaskingClassLoader;
++import com.sun.istack.internal.tools.ParallelWorldClassLoader;
++
++/**
++ * Creates a class loader configured to run XJC 1.0/2.0 safely without
++ * interference with JAXB 2.0 API in Mustang.
++ *
++ * @author Kohsuke Kawaguchi
++ */
++class ClassLoaderBuilder {
++
++    /**
++     * Creates a new class loader that eventually delegates to the given {@link ClassLoader}
++     * such that XJC can be loaded by using this classloader.
++     *
++     * @param v
++     *      Either "1.0" or "2.0", indicating the version of the -source value.
++     */
++    protected static ClassLoader createProtectiveClassLoader(ClassLoader cl, String v) throws ClassNotFoundException, MalformedURLException {
++        if(noHack)  return cl;  // provide an escape hatch
++
++        boolean mustang = false;
++
++        if(JAXBContext.class.getClassLoader()==null) {
++            // JAXB API is loaded from the bootstrap. We need to override one with ours
++            mustang = true;
++
++            List mask = new ArrayList(Arrays.asList(maskedPackages));
++            mask.add("javax.xml.bind.");
++
++            cl = new MaskingClassLoader(cl,mask);
++
++            URL apiUrl = cl.getResource("javax/xml/bind/annotation/XmlSeeAlso.class");
++            if(apiUrl==null)
++                throw new ClassNotFoundException("There's no JAXB 2.1 API in the classpath");
++
++            cl = new URLClassLoader(new URL[]{ParallelWorldClassLoader.toJarUrl(apiUrl)},cl);
++        }
++
++        //Leave XJC2 in the publicly visible place
++        // and then isolate XJC1 in a child class loader,
++        // then use a MaskingClassLoader
++        // 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(!mustang)
++                // if we haven't used Masking ClassLoader, do so now.
++                cl = new MaskingClassLoader(cl,toolPackages);
++            cl = new ParallelWorldClassLoader(cl,"1.0/");
++        } else {
++            if(mustang)
++                // the whole RI needs to be loaded in a separate class loader
++                cl = new ParallelWorldClassLoader(cl,"");
++        }
++
++        return cl;
++    }
++
++
++    /**
++     * The list of package prefixes we want the
++     * {@link MaskingClassLoader} to prevent the parent
++     * classLoader from loading
++     */
++    private static String[] maskedPackages = new String[]{
++        // toolPackages + alpha
++        "com.sun.tools.",
++        "com.sun.codemodel.internal.",
++        "com.sun.relaxng.",
++        "com.sun.xml.internal.xsom.",
++        "com.sun.xml.internal.bind.",
++    };
++
++    private static String[] toolPackages = new String[]{
++        "com.sun.tools.",
++        "com.sun.codemodel.internal.",
++        "com.sun.relaxng.",
++        "com.sun.xml.internal.xsom."
++    };
++
++    /**
++     * Escape hatch in case this class loader hack breaks.
++     */
++    public static final boolean noHack = Boolean.getBoolean(XJCFacade.class.getName()+".nohack");
++}
+--- /dev/null	Thu Jul 30 18:58:17 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/XJCFacade.java	Thu Jul 30 18:58:16 2009
+@@ -0,0 +1,79 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++
++package com.sun.tools.internal.xjc;
++
++import java.lang.reflect.InvocationTargetException;
++import java.lang.reflect.Method;
++
++/**
++ * A shabby driver to invoke XJC1 or XJC2 depending on the command line switch.
++ *
++ * <p>
++ * 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 {
++
++    public static void main(String[] args) throws Throwable {
++        String v = "2.0";      // by default, we go 2.0
++
++        for( int i=0; i<args.length; i++ ) {
++            if(args[i].equals("-source")) {
++                if(i+1<args.length) {
++                    v = parseVersion(args[i+1]);
++                }
++            }
++        }
++
++        try {
++            ClassLoader cl = ClassLoaderBuilder.createProtectiveClassLoader(XJCFacade.class.getClassLoader(), v);
++
++            Class 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;
++            } catch (InvocationTargetException e) {
++                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/");
++        }
++    }
++
++    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.
++        return "2.0";
++    }
++}
+--- /dev/null	Thu Jul 30 18:58:20 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/annotation/ri/OverrideAnnotationOfWriter.java	Thu Jul 30 18:58:19 2009
+@@ -0,0 +1,37 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++package com.sun.tools.internal.xjc.generator.annotation.ri;
++
++import com.sun.codemodel.internal.JAnnotationWriter;
++import com.sun.xml.internal.bind.annotation.OverrideAnnotationOf;
++
++public interface OverrideAnnotationOfWriter
++    extends JAnnotationWriter<OverrideAnnotationOf>
++{
++
++
++    OverrideAnnotationOfWriter value(String value);
++
++}
+--- /dev/null	Thu Jul 30 18:58:23 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/ContentListField.java	Thu Jul 30 18:58:22 2009
+@@ -0,0 +1,176 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++package com.sun.tools.internal.xjc.generator.bean.field;
++
++import java.util.ArrayList;
++import java.util.List;
++
++import com.sun.codemodel.internal.JBlock;
++import com.sun.codemodel.internal.JClass;
++import com.sun.codemodel.internal.JExpr;
++import com.sun.codemodel.internal.JExpression;
++import com.sun.codemodel.internal.JMethod;
++import com.sun.codemodel.internal.JType;
++import com.sun.codemodel.internal.JVar;
++import com.sun.tools.internal.xjc.generator.bean.ClassOutlineImpl;
++import com.sun.tools.internal.xjc.generator.bean.MethodWriter;
++import com.sun.tools.internal.xjc.model.CPropertyInfo;
++import com.sun.tools.internal.xjc.outline.Aspect;
++import com.sun.xml.internal.bind.api.impl.NameConverter;
++import java.io.Serializable;
++
++/**
++ * Realizes a property as an untyped {@link List}.
++ *
++ * <pre>
++ * List getXXX();
++ * </pre>
++ *
++ * <h2>Default value handling</h2>
++ * <p>
++ * Since unmarshaller just adds new values into the storage,
++ * we can't fill the storage by default values at the time of
++ * instanciation. (or oherwise values found in the document will
++ * be appended to default values, where it should overwrite them.)
++ * <p>
++ * Therefore, when the object is created, the storage will be empty.
++ * When the getXXX method is called, we'll check if the storage is
++ * modified in anyway. If it is modified, it must mean that the values
++ * are found in the document, so we just return it.
++ *
++ * Otherwise we will fill in default values and return it to the user.
++ *
++ * <p>
++ * When a list has default values, its dirty flag is set to true.
++ * Marshaller will check this and treat it appropriately.
++ *
++ *
++ * @author
++ *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
++ */
++public class ContentListField extends AbstractListField {
++
++    /**
++     * A concrete class that implements the List interface.
++     * An instance of this class will be used to store data
++     * for this field.
++     */
++    private final JClass coreList;
++
++    /** List getFIELD() method. */
++    private JMethod $get;
++
++    /**
++     * @param coreList
++     *      A concrete class that implements the List interface.
++     *      An instance of this class will be used to store data
++     *      for this field.
++     */
++    protected ContentListField(ClassOutlineImpl context, CPropertyInfo prop, JClass coreList) {
++        // the JAXB runtime picks ArrayList if the signature is List,
++        // so don't do eager allocation if it's ArrayList.
++        // otherwise we need to do eager allocation so that the collection type specified by the user
++        // will be used.
++        super(context, prop, false);
++        this.coreList = coreList;
++        generate();
++    }
++
++    protected final JClass getCoreListType() {
++        return coreList;
++    }
++
++    @Override
++    public void generateAccessors() {
++        final MethodWriter writer = outline.createMethodWriter();
++        final Accessor acc = create(JExpr._this());
++
++        // [RESULT]
++        // List getXXX() {
++        //     return <ref>;
++        // }
++        $get = writer.declareMethod(listT,"get"+prop.getName(true));
++        writer.javadoc().append(prop.javadoc);
++        JBlock block = $get.body();
++        fixNullRef(block);  // avoid using an internal getter
++        block._return(acc.ref(true));
++
++        String pname = NameConverter.standard.toVariableName(prop.getName(true));
++        writer.javadoc().append(
++            "Gets the value of the "+pname+" property.\n\n"+
++            "<p>\n" +
++            "This accessor method returns a reference to the live list,\n" +
++            "not a snapshot. Therefore any modification you make to the\n" +
++            "returned list will be present inside the JAXB object.\n" +
++            "This is why there is not a <CODE>set</CODE> method for the " +pname+ " property.\n" +
++            "\n"+
++            "<p>\n" +
++            "For example, to add a new item, do as follows:\n"+
++            "<pre>\n"+
++            "   get"+prop.getName(true)+"().add(newItem);\n"+
++            "</pre>\n"+
++            "\n\n"
++        );
++
++        writer.javadoc().append(
++            "<p>\n" +
++            "Objects of the following type(s) are allowed in the list\n")
++            .append(listPossibleTypes(prop));
++    }
++
++    public Accessor create(JExpression targetObject) {
++        return new Accessor(targetObject);
++    }
++
++    class Accessor extends AbstractListField.Accessor {
++        protected Accessor( JExpression $target ) {
++            super($target);
++        }
++
++        public void toRawValue(JBlock block, JVar $var) {
++            // [RESULT]
++            // $<var>.addAll(bean.getLIST());
++            // list.toArray( array );
++            block.assign($var,JExpr._new(codeModel.ref(ArrayList.class).narrow(exposedType.boxify())).arg(
++                $target.invoke($get)
++            ));
++        }
++
++        public void fromRawValue(JBlock block, String uniqueName, JExpression $var) {
++            // [RESULT]
++            // bean.getLIST().addAll($<var>);
++            JVar $list = block.decl(listT,uniqueName+'l',$target.invoke($get));
++            block.invoke($list,"addAll").arg($var);
++        }
++    }
++
++    @Override
++    protected JType getType(final Aspect aspect) {
++        if (Aspect.IMPLEMENTATION.equals(aspect)) {
++            return super.getType(aspect);
++        }
++        return codeModel.ref(Serializable.class);
++    }
++}
+--- /dev/null	Thu Jul 30 18:58:26 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/DummyListField.java	Thu Jul 30 18:58:26 2009
+@@ -0,0 +1,152 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++package com.sun.tools.internal.xjc.generator.bean.field;
++
++import com.sun.codemodel.internal.JAnnotatable;
++import java.util.ArrayList;
++import java.util.List;
++
++import com.sun.codemodel.internal.JBlock;
++import com.sun.codemodel.internal.JClass;
++import com.sun.codemodel.internal.JExpr;
++import com.sun.codemodel.internal.JExpression;
++import com.sun.codemodel.internal.JMethod;
++import com.sun.codemodel.internal.JVar;
++import com.sun.tools.internal.xjc.generator.bean.ClassOutlineImpl;
++import com.sun.tools.internal.xjc.model.CPropertyInfo;
++import com.sun.tools.internal.xjc.model.CReferencePropertyInfo;
++import com.sun.xml.internal.bind.annotation.OverrideAnnotationOf;
++
++/**
++ * Realizes a property as an untyped {@link List}.
++ *
++ * <pre>
++ * List getXXX();
++ * </pre>
++ *
++ * <h2>Default value handling</h2>
++ * <p>
++ * Since unmarshaller just adds new values into the storage,
++ * we can't fill the storage by default values at the time of
++ * instanciation. (or oherwise values found in the document will
++ * be appended to default values, where it should overwrite them.)
++ * <p>
++ * Therefore, when the object is created, the storage will be empty.
++ * When the getXXX method is called, we'll check if the storage is
++ * modified in anyway. If it is modified, it must mean that the values
++ * are found in the document, so we just return it.
++ *
++ * Otherwise we will fill in default values and return it to the user.
++ *
++ * <p>
++ * When a list has default values, its dirty flag is set to true.
++ * Marshaller will check this and treat it appropriately.
++ *
++ *
++ * @author
++ *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
++ */
++public class DummyListField extends AbstractListField {
++
++    /**
++     * A concrete class that imp    lements the List interface.
++     * An instance of this class will be used to store data
++     * for this field.
++     */
++    private final JClass coreList;
++
++
++    /** List getFIELD() method. */
++    private JMethod $get;
++
++    /**
++     * @param coreList
++     *      A concrete class that implements the List interface.
++     *      An instance of this class will be used to store data
++     *      for this field.
++     */
++    protected DummyListField(ClassOutlineImpl context, CPropertyInfo prop, JClass coreList) {
++        // the JAXB runtime picks ArrayList if the signature is List,
++        // so don't do eager allocation if it's ArrayList.
++        // otherwise we need to do eager allocation so that the collection type specified by the user
++        // will be used.
++        super(context, prop, !coreList.fullName().equals("java.util.ArrayList"));
++        this.coreList = coreList.narrow(exposedType.boxify());
++        generate();
++    }
++
++    /**
++     * Annotate the field according to the recipes given as {@link CPropertyInfo}.
++     */
++    @Override
++    protected void annotate( JAnnotatable field ) {
++        super.annotate(field);
++
++        if (prop instanceof CReferencePropertyInfo) {
++            CReferencePropertyInfo pref = (CReferencePropertyInfo)prop;
++            if (pref.isDummy()) {
++                annotateDummy(field);
++            }
++        }
++
++    }
++
++    private void annotateDummy(JAnnotatable field) {
++        field.annotate(OverrideAnnotationOf.class);
++    }
++
++    protected final JClass getCoreListType() {
++        return coreList;
++    }
++
++    @Override
++    public void generateAccessors() { }
++
++    public Accessor create(JExpression targetObject) {
++        return new Accessor(targetObject);
++    }
++
++    class Accessor extends AbstractListField.Accessor {
++        protected Accessor( JExpression $target ) {
++            super($target);
++        }
++
++        public void toRawValue(JBlock block, JVar $var) {
++            // [RESULT]
++            // $<var>.addAll(bean.getLIST());
++            // list.toArray( array );
++            block.assign($var,JExpr._new(codeModel.ref(ArrayList.class).narrow(exposedType.boxify())).arg(
++                $target.invoke($get)
++            ));
++        }
++
++        public void fromRawValue(JBlock block, String uniqueName, JExpression $var) {
++            // [RESULT]
++            // bean.getLIST().addAll($<var>);
++            JVar $list = block.decl(listT,uniqueName+'l',$target.invoke($get));
++            block.invoke($list,"addAll").arg($var);
++        }
++    }
++}
+--- /dev/null	Thu Jul 30 18:58:30 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/generator/bean/field/NoExtendedContentField.java	Thu Jul 30 18:58:29 2009
+@@ -0,0 +1,187 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++package com.sun.tools.internal.xjc.generator.bean.field;
++
++import java.util.ArrayList;
++import java.util.List;
++
++import com.sun.codemodel.internal.JBlock;
++import com.sun.codemodel.internal.JClass;
++import com.sun.codemodel.internal.JExpr;
++import com.sun.codemodel.internal.JExpression;
++import com.sun.codemodel.internal.JMethod;
++import com.sun.codemodel.internal.JType;
++import com.sun.codemodel.internal.JVar;
++import com.sun.tools.internal.xjc.generator.bean.ClassOutlineImpl;
++import com.sun.tools.internal.xjc.generator.bean.MethodWriter;
++import com.sun.tools.internal.xjc.model.CElement;
++import com.sun.tools.internal.xjc.model.CPropertyInfo;
++import com.sun.tools.internal.xjc.model.CReferencePropertyInfo;
++import com.sun.tools.internal.xjc.outline.Aspect;
++import com.sun.xml.internal.bind.api.impl.NameConverter;
++import java.io.Serializable;
++import java.util.Set;
++
++/**
++ * Realizes a property as an untyped {@link List}.
++ *
++ * <pre>
++ * List getXXX();
++ * </pre>
++ *
++ * <h2>Default value handling</h2>
++ * <p>
++ * Since unmarshaller just adds new values into the storage,
++ * we can't fill the storage by default values at the time of
++ * instanciation. (or oherwise values found in the document will
++ * be appended to default values, where it should overwrite them.)
++ * <p>
++ * Therefore, when the object is created, the storage will be empty.
++ * When the getXXX method is called, we'll check if the storage is
++ * modified in anyway. If it is modified, it must mean that the values
++ * are found in the document, so we just return it.
++ *
++ * Otherwise we will fill in default values and return it to the user.
++ *
++ * <p>
++ * When a list has default values, its dirty flag is set to true.
++ * Marshaller will check this and treat it appropriately.
++ *
++ *
++ * @author
++ *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
++ */
++public class NoExtendedContentField extends AbstractListField {
++
++    /**
++     * A concrete class that implements the List interface.
++     * An instance of this class will be used to store data
++     * for this field.
++     */
++    private final JClass coreList;
++
++    /** List getFIELD() method. */
++    private JMethod $get;
++
++    /**
++     * @param coreList
++     *      A concrete class that implements the List interface.
++     *      An instance of this class will be used to store data
++     *      for this field.
++     */
++    protected NoExtendedContentField(ClassOutlineImpl context, CPropertyInfo prop, JClass coreList) {
++        // the JAXB runtime picks ArrayList if the signature is List,
++        // so don't do eager allocation if it's ArrayList.
++        // otherwise we need to do eager allocation so that the collection type specified by the user
++        // will be used.
++        super(context, prop, false);
++        this.coreList = coreList;
++        generate();
++    }
++
++    protected final JClass getCoreListType() {
++        return coreList;
++    }
++
++    @Override
++    public void generateAccessors() {
++        final MethodWriter writer = outline.createMethodWriter();
++        final Accessor acc = create(JExpr._this());
++
++        // [RESULT]
++        // List getXXX() {
++        //     return <ref>;
++        // }
++        $get = writer.declareMethod(listT,"get"+prop.getName(true));
++        writer.javadoc().append(prop.javadoc);
++        JBlock block = $get.body();
++        fixNullRef(block);  // avoid using an internal getter
++        block._return(acc.ref(true));
++
++        String pname = NameConverter.standard.toVariableName(prop.getName(true));
++        writer.javadoc().append(
++            "Gets the value of the "+pname+" property.\n\n"+
++            "<p>\n" +
++            "This accessor method returns a reference to the live list,\n" +
++            "not a snapshot. Therefore any modification you make to the\n" +
++            "returned list will be present inside the JAXB object.\n" +
++            "This is why there is not a <CODE>set</CODE> method for the " +pname+ " property.\n" +
++            "\n"+
++            "<p>\n" +
++            "For example, to add a new item, do as follows:\n"+
++            "<pre>\n"+
++            "   get"+prop.getName(true)+"().add(newItem);\n"+
++            "</pre>\n"+
++            "\n\n"
++        );
++
++        writer.javadoc().append(
++            "<p>\n" +
++            "Objects of the following type(s) are allowed in the list\n")
++            .append(listPossibleTypes(prop));
++    }
++
++    public Accessor create(JExpression targetObject) {
++        return new Accessor(targetObject);
++    }
++
++    class Accessor extends AbstractListField.Accessor {
++        protected Accessor( JExpression $target ) {
++            super($target);
++        }
++
++        public void toRawValue(JBlock block, JVar $var) {
++            // [RESULT]
++            // $<var>.addAll(bean.getLIST());
++            // list.toArray( array );
++            block.assign($var,JExpr._new(codeModel.ref(ArrayList.class).narrow(getType(Aspect.EXPOSED).boxify())).arg(
++                $target.invoke($get)
++            ));
++        }
++
++        public void fromRawValue(JBlock block, String uniqueName, JExpression $var) {
++            // [RESULT]
++            // bean.getLIST().addAll($<var>);
++            JVar $list = block.decl(listT,uniqueName+'l',$target.invoke($get));
++            block.invoke($list,"addAll").arg($var);
++        }
++    }
++
++    @Override
++    protected JType getType(final Aspect aspect) {
++        if (Aspect.IMPLEMENTATION.equals(aspect)) {
++            return super.getType(aspect);
++        }
++
++        if (prop instanceof CReferencePropertyInfo) {
++            Set<CElement> elements = ((CReferencePropertyInfo)prop).getElements();
++            if ((elements != null) && (elements.size() > 0)) {
++                return codeModel.ref(Serializable.class);
++            }
++        }
++
++        return codeModel.ref(String.class);
++    }
++}
+--- /dev/null	Thu Jul 30 18:58:35 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BIFactoryMethod.java	Thu Jul 30 18:58:34 2009
+@@ -0,0 +1,64 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++package com.sun.tools.internal.xjc.reader.xmlschema.bindinfo;
++
++import javax.xml.bind.annotation.XmlRootElement;
++import javax.xml.bind.annotation.XmlAttribute;
++import javax.xml.namespace.QName;
++
++import com.sun.xml.internal.xsom.XSComponent;
++import com.sun.tools.internal.xjc.model.CPropertyInfo;
++import com.sun.tools.internal.xjc.reader.Ring;
++import com.sun.tools.internal.xjc.reader.Const;
++import com.sun.tools.internal.xjc.reader.xmlschema.BGMBuilder;
++
++/**
++ * Controls the <tt>ObjectFactory</tt> method name.
++ *
++ * @author Kohsuke Kawaguchi
++ */
++@XmlRootElement(name="factoryMethod")
++public class BIFactoryMethod extends AbstractDeclarationImpl {
++    @XmlAttribute
++    public String name;
++
++    /**
++     * If the given component has {@link BIInlineBinaryData} customization,
++     * reflect that to the specified property.
++     */
++    public static void handle(XSComponent source, CPropertyInfo prop) {
++        BIInlineBinaryData inline = Ring.get(BGMBuilder.class).getBindInfo(source).get(BIInlineBinaryData.class);
++        if(inline!=null) {
++            prop.inlineBinaryData = true;
++            inline.markAsAcknowledged();
++        }
++    }
++
++
++    public final QName getName() { return NAME; }
++
++    /** Name of the declaration. */
++    public static final QName NAME = new QName(Const.JAXB_NSURI,"factoryMethod");
++}
+--- /dev/null	Thu Jul 30 18:58:40 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BIInlineBinaryData.java	Thu Jul 30 18:58:39 2009
+@@ -0,0 +1,62 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++package com.sun.tools.internal.xjc.reader.xmlschema.bindinfo;
++
++import javax.xml.bind.annotation.XmlRootElement;
++import javax.xml.bind.annotation.XmlInlineBinaryData;
++import javax.xml.namespace.QName;
++
++import com.sun.tools.internal.xjc.reader.Const;
++import com.sun.tools.internal.xjc.reader.Ring;
++import com.sun.tools.internal.xjc.reader.xmlschema.BGMBuilder;
++import com.sun.tools.internal.xjc.model.CPropertyInfo;
++import com.sun.xml.internal.xsom.XSComponent;
++
++/**
++ * Generates {@link @XmlInlineBinaryData}.
++ *
++ * @author Kohsuke Kawaguchi
++ */
++@XmlRootElement(name="inlineBinaryData")
++public class BIInlineBinaryData extends AbstractDeclarationImpl {
++
++    /**
++     * If the given component has {@link BIInlineBinaryData} customization,
++     * reflect that to the specified property.
++     */
++    public static void handle(XSComponent source, CPropertyInfo prop) {
++        BIInlineBinaryData inline = Ring.get(BGMBuilder.class).getBindInfo(source).get(BIInlineBinaryData.class);
++        if(inline!=null) {
++            prop.inlineBinaryData = true;
++            inline.markAsAcknowledged();
++        }
++    }
++
++
++    public final QName getName() { return NAME; }
++
++    /** Name of the declaration. */
++    public static final QName NAME = new QName(Const.JAXB_NSURI,"inlineBinaryData");
++}
+--- /dev/null	Thu Jul 30 18:58:44 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ct/AbstractExtendedComplexTypeBuilder.java	Thu Jul 30 18:58:43 2009
+@@ -0,0 +1,221 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++package com.sun.tools.internal.xjc.reader.xmlschema.ct;
++
++import java.util.HashMap;
++import java.util.Iterator;
++import java.util.Map;
++
++import com.sun.tools.internal.xjc.reader.xmlschema.WildcardNameClassBuilder;
++import com.sun.xml.internal.xsom.XSAttributeUse;
++import com.sun.xml.internal.xsom.XSComplexType;
++import com.sun.xml.internal.xsom.XSContentType;
++import com.sun.xml.internal.xsom.XSDeclaration;
++import com.sun.xml.internal.xsom.XSElementDecl;
++import com.sun.xml.internal.xsom.XSModelGroup;
++import com.sun.xml.internal.xsom.XSModelGroupDecl;
++import com.sun.xml.internal.xsom.XSParticle;
++import com.sun.xml.internal.xsom.XSType;
++import com.sun.xml.internal.xsom.XSWildcard;
++import com.sun.xml.internal.xsom.visitor.XSTermFunction;
++
++import com.sun.xml.internal.rngom.nc.ChoiceNameClass;
++import com.sun.xml.internal.rngom.nc.NameClass;
++import com.sun.xml.internal.rngom.nc.SimpleNameClass;
++
++/**
++ * Binds a complex type derived from another complex type by extension.
++ *
++ * @author
++ *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
++ */
++abstract class AbstractExtendedComplexTypeBuilder extends CTBuilder {
++
++    /**
++     * Map from {@link XSComplexType} to {@link NameClass}[2] that
++     * represents the names used in its child elements [0] and
++     * attributes [1].
++     */
++    protected final Map<XSComplexType, NameClass[]> characteristicNameClasses = new HashMap<XSComplexType, NameClass[]>();
++
++    /**
++     * Computes a name class that represents everything in a given content model.
++     */
++    protected final XSTermFunction<NameClass> contentModelNameClassBuilder = new XSTermFunction<NameClass>() {
++        public NameClass wildcard(XSWildcard wc) {
++            return WildcardNameClassBuilder.build(wc);
++        }
++
++        public NameClass modelGroupDecl(XSModelGroupDecl decl) {
++            return modelGroup(decl.getModelGroup());
++        }
++
++        public NameClass modelGroup(XSModelGroup group) {
++            NameClass nc = NameClass.NULL;
++            for( int i=0; i<group.getSize(); i++ )
++                nc = new ChoiceNameClass(nc, group.getChild(i).getTerm().apply(this));
++            return nc;
++        }
++
++        public NameClass elementDecl(XSElementDecl decl) {
++            return getNameClass(decl);
++        }
++    };
++
++    /**
++     * Checks if the particles/attributes defined in the type parameter
++     * collides with the name classes of anc/enc.
++     *
++     * @return true if there's a collision.
++     */
++    protected boolean checkCollision(NameClass anc, NameClass enc, XSComplexType type) {
++        NameClass[] chnc = characteristicNameClasses.get(type);
++        if (chnc == null) {
++            chnc = new NameClass[2];
++            chnc[0] = getNameClass(type.getContentType());
++
++            // build attribute name classes
++            NameClass nc = NameClass.NULL;
++            Iterator itr = type.iterateAttributeUses();
++            while( itr.hasNext() )
++                anc = new ChoiceNameClass(anc, getNameClass(((XSAttributeUse) itr.next()).getDecl()));
++            XSWildcard wc = type.getAttributeWildcard();
++            if(wc!=null)
++                nc = new ChoiceNameClass(nc, WildcardNameClassBuilder.build(wc));
++            chnc[1] = nc;
++
++            characteristicNameClasses.put(type, chnc);
++        }
++
++        return chnc[0].hasOverlapWith(enc) || chnc[1].hasOverlapWith(anc);
++    }
++
++    /**
++     * Looks for the derivation chain t_1 > t_2 > ... > t
++     * and find t_i such that t_i derives by restriction but
++     * for every j>i, t_j derives by extension.
++     *
++     * @return null
++     *      If there's no such t_i or if t_i is any type.
++     */
++    protected XSComplexType getLastRestrictedType(XSComplexType t) {
++        if (t.getBaseType() == schemas.getAnyType()) {
++            return null;   // we don't count the restriction from anyType
++        }
++        if (t.getDerivationMethod() == XSType.RESTRICTION) {
++            return t;
++        }
++
++        XSComplexType baseType = t.getBaseType().asComplexType();
++        if (baseType != null) {
++            return getLastRestrictedType(baseType);
++        } else {
++            return null;
++        }
++    }
++
++    /**
++     * Checks if this new extension is safe.
++     *
++     * UGLY.
++     * <p>
++     * If you have ctA extending ctB and ctB restricting ctC, our
++     * Java classes will look like CtAImpl extending CtBImpl
++     * extending CtCImpl.
++     *
++     * <p>
++     * Since a derived class unmarshaller uses the base class unmarshaller,
++     * this could potentially result in incorrect unmarshalling.
++     * We used to just reject such a case, but then we found that
++     * there are schemas that are using it.
++     *
++     * <p>
++     * One generalized observation that we reached is that if the extension
++     * is only adding new elements/attributes which has never been used
++     * in any of its base class (IOW, if none of the particle / attribute use /
++     * attribute wildcard can match the name of newly added elements/attributes)
++     * then it is safe to add them.
++     *
++     * <p>
++     * This function checks if the derivation chain to this type is
++     * not using restriction, and if it is, then checks if it is safe
++     * according to the above condition.
++     *
++     * @return false
++     *      If this complex type needs to be rejected.
++     */
++    protected boolean checkIfExtensionSafe(XSComplexType baseType, XSComplexType thisType) {
++        XSComplexType lastType = getLastRestrictedType(baseType);
++
++        if (lastType == null) {
++            return true;    // no restriction in derivation chain
++        }
++        NameClass anc = NameClass.NULL;
++        // build name class for attributes in new complex type
++        Iterator itr = thisType.iterateDeclaredAttributeUses();
++        while (itr.hasNext()) {
++            anc = new ChoiceNameClass(anc, getNameClass(((XSAttributeUse) itr.next()).getDecl()));
++        }
++        // TODO: attribute wildcard
++
++        NameClass enc = getNameClass(thisType.getExplicitContent());
++
++        // check against every base type ... except the root anyType
++        while (lastType != lastType.getBaseType()) {
++            if (checkCollision(anc, enc, lastType)) {
++                return false;
++            }
++
++            if (lastType.getBaseType().isSimpleType()) // if the base type is a simple type, there won't be
++            // any further name collision.
++            {
++                return true;
++            }
++
++            lastType = lastType.getBaseType().asComplexType();
++        }
++
++        return true;    // OK
++    }
++
++    /**
++     * Gets a {@link NameClass} that represents all the terms in the given content type.
++     * If t is not a particle, just return an empty name class.
++     */
++    private NameClass getNameClass(XSContentType t) {
++        if(t==null) return NameClass.NULL;
++        XSParticle p = t.asParticle();
++        if(p==null) return NameClass.NULL;
++        else        return p.getTerm().apply(contentModelNameClassBuilder);
++    }
++
++    /**
++     * Gets a {@link SimpleNameClass} from the name of a {@link XSDeclaration}.
++     */
++    private NameClass getNameClass(XSDeclaration decl) {
++        return new SimpleNameClass(decl.getTargetNamespace(), decl.getName());
++    }
++
++}
+--- /dev/null	Thu Jul 30 18:58:47 2009
++++ openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/ct/MixedExtendedComplexTypeBuilder.java	Thu Jul 30 18:58:46 2009
+@@ -0,0 +1,92 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++
++package com.sun.tools.internal.xjc.reader.xmlschema.ct;
++
++import com.sun.tools.internal.xjc.model.CClass;
++import com.sun.tools.internal.xjc.model.CPropertyInfo;
++import com.sun.tools.internal.xjc.reader.RawTypeSet;
++import com.sun.tools.internal.xjc.reader.xmlschema.RawTypeSetBuilder;
++import com.sun.tools.internal.xjc.reader.xmlschema.bindinfo.BIGlobalBinding;
++import com.sun.tools.internal.xjc.reader.xmlschema.bindinfo.BIProperty;
++import com.sun.xml.internal.xsom.XSComplexType;
++import com.sun.xml.internal.xsom.XSContentType;
++import com.sun.xml.internal.xsom.XSType;
++
++/**
++ * @author Kohsuke Kawaguchi
++ */
++final class MixedExtendedComplexTypeBuilder extends AbstractExtendedComplexTypeBuilder {
++
++    public boolean isApplicable(XSComplexType ct) {
++
++        if (!bgmBuilder.isGenerateMixedExtensions()) return false;
++
++        XSType bt = ct.getBaseType();
++        if (bt.isComplexType() &&
++            bt.asComplexType().isMixed() &&
++            ct.isMixed() &&
++            ct.getDerivationMethod()==XSType.EXTENSION &&
++            ct.getContentType().asParticle() != null &&
++            ct.getExplicitContent().asEmpty() == null
++            )  {
++                return true;
++        }
++
++        return false;
++    }
++
++    public void build(XSComplexType ct) {
++        XSComplexType baseType = ct.getBaseType().asComplexType();
++
++        // build the base class
++        CClass baseClass = selector.bindToType(baseType, ct, true);
++        assert baseClass != null;   // global complex type must map to a class
++
++        if (!checkIfExtensionSafe(baseType, ct)) {
++            // error. We can't handle any further extension
++            errorReceiver.error(ct.getLocator(),
++                    Messages.ERR_NO_FURTHER_EXTENSION.format(
++                    baseType.getName(), ct.getName() )
++            );
++            return;
++        }
++
++        selector.getCurrentBean().setBaseClass(baseClass);
++        builder.recordBindingMode(ct, ComplexTypeBindingMode.FALLBACK_EXTENSION);
++
++        BIProperty prop = BIProperty.getCustomization(ct);
++        CPropertyInfo p;
++
++        RawTypeSet ts = RawTypeSetBuilder.build(ct.getContentType().asParticle(), false);
++        p = prop.createDummyExtendedMixedReferenceProperty("contentOverrideFor" + ct.getName(), ct, ts);
++
++        selector.getCurrentBean().addProperty(p);
++
++        // adds attributes and we are through.
++        green.attContainer(ct);
++    }
++
++}
+--- /dev/null	Thu Jul 30 18:58:50 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/annotation/OverrideAnnotationOf.java	Thu Jul 30 18:58:49 2009
+@@ -0,0 +1,42 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++
++package com.sun.xml.internal.bind.annotation;
++
++import java.lang.annotation.Retention;
++import java.lang.annotation.Target;
++import static java.lang.annotation.ElementType.FIELD;
++import static java.lang.annotation.RetentionPolicy.RUNTIME;
++
++/**
++ * Designates an annotation from base class which shall be overriden by annotation placed together with this.
++ *
++ * @author Martin Grebac
++ */
++@Retention(RUNTIME)
++@Target({FIELD})
++public @interface OverrideAnnotationOf {
++    String value() default "content";
++}
+--- /dev/null	Thu Jul 30 18:58:53 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/api/Messages.java	Thu Jul 30 18:58:52 2009
+@@ -0,0 +1,53 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++
++
++package com.sun.xml.internal.bind.api;
++
++import java.text.MessageFormat;
++import java.util.ResourceBundle;
++
++/**
++ * Formats error messages.
++ *
++ * @since JAXB2.1.10
++ */
++
++enum Messages {
++    // TypeReference
++    ARGUMENT_CANT_BE_NULL
++    ;
++
++    private static final ResourceBundle rb = ResourceBundle.getBundle(Messages.class.getName());
++
++    @Override
++    public String toString() {
++        return format();
++    }
++
++    public String format( Object... args ) {
++        return MessageFormat.format( rb.getString(name()), args );
++    }
++}
+--- /dev/null	Thu Jul 30 18:58:56 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/api/Messages.properties	Thu Jul 30 18:58:56 2009
+@@ -0,0 +1,27 @@
++#
++# Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++#
++# This code is free software; you can redistribute it and/or modify it
++# under the terms of the GNU General Public License version 2 only, as
++# published by the Free Software Foundation.  Sun designates this
++# particular file as subject to the "Classpath" exception as provided
++# by Sun in the LICENSE file that accompanied this code.
++#
++# This code is distributed in the hope that it will be useful, but WITHOUT
++# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++# version 2 for more details (a copy is included in the LICENSE file that
++# accompanied this code).
++#
++# You should have received a copy of the GNU General Public License version
++# 2 along with this work; if not, write to the Free Software Foundation,
++# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++#
++# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++# CA 95054 USA or visit www.sun.com if you need additional information or
++# have any questions.
++#
++
++ARGUMENT_CANT_BE_NULL = \
++    Argument(s) "{0}" can''t be null.
+--- /dev/null	Thu Jul 30 18:59:00 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/annotation/XmlSchemaTypeQuick.java	Thu Jul 30 18:58:59 2009
+@@ -0,0 +1,66 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++package com.sun.xml.internal.bind.v2.model.annotation;
++
++import java.lang.annotation.Annotation;
++import javax.xml.bind.annotation.XmlSchemaType;
++
++final class XmlSchemaTypeQuick
++    extends Quick
++    implements XmlSchemaType
++{
++
++    private final XmlSchemaType core;
++
++    public XmlSchemaTypeQuick(Locatable upstream, XmlSchemaType core) {
++        super(upstream);
++        this.core = core;
++    }
++
++    protected Annotation getAnnotation() {
++        return core;
++    }
++
++    protected Quick newInstance(Locatable upstream, Annotation core) {
++        return new XmlSchemaTypeQuick(upstream, ((XmlSchemaType) core));
++    }
++
++    public Class<XmlSchemaType> annotationType() {
++        return XmlSchemaType.class;
++    }
++
++    public String name() {
++        return core.name();
++    }
++
++    public Class type() {
++        return core.type();
++    }
++
++    public String namespace() {
++        return core.namespace();
++    }
++
++}
+--- /dev/null	Thu Jul 30 18:59:03 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/model/impl/DummyPropertyInfo.java	Thu Jul 30 18:59:02 2009
+@@ -0,0 +1,35 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++
++package com.sun.xml.internal.bind.v2.model.impl;
++
++/**
++ * {@link PropertyInfo} that allows to add additional elements to the collection.
++ *
++ * @author Martin Grebac
++ */
++public interface DummyPropertyInfo<T, C, F, M> {
++    void addType(PropertyInfoImpl<T, C, F, M> info);
++}
+--- /dev/null	Thu Jul 30 18:59:06 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/AttributeAccessor.java	Thu Jul 30 18:59:05 2009
+@@ -0,0 +1,35 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++
++package com.sun.xml.internal.bind.v2.runtime;
++
++/**
++ *
++ * @author snajper
++ */
++public interface AttributeAccessor<BeanT> {
++
++    public boolean isNilIncluded();
++}
+--- /dev/null	Thu Jul 30 18:59:09 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/output/StAXExStreamWriterOutput.java	Thu Jul 30 18:59:08 2009
+@@ -0,0 +1,59 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++
++package com.sun.xml.internal.bind.v2.runtime.output;
++
++import javax.xml.stream.XMLStreamException;
++
++import com.sun.xml.internal.bind.v2.runtime.unmarshaller.Base64Data;
++
++import com.sun.xml.internal.org.jvnet.staxex.XMLStreamWriterEx;
++
++/**
++ * {@link XmlOutput} for {@link XMLStreamWriterEx}.
++ *
++ * @author Paul Sandoz.
++ */
++public final class StAXExStreamWriterOutput extends XMLStreamWriterOutput {
++    private final XMLStreamWriterEx out;
++
++    public StAXExStreamWriterOutput(XMLStreamWriterEx out) {
++        super(out);
++        this.out = out;
++    }
++
++    public void text(Pcdata value, boolean needsSeparatingWhitespace) throws XMLStreamException {
++        if(needsSeparatingWhitespace) {
++            out.writeCharacters(" ");
++        }
++
++        if (!(value instanceof Base64Data)) {
++            out.writeCharacters(value.toString());
++        } else {
++            Base64Data v = (Base64Data)value;
++            out.writeBinary(v.getDataHandler());
++        }
++    }
++}
+--- /dev/null	Thu Jul 30 18:59:12 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/StAXExConnector.java	Thu Jul 30 18:59:12 2009
+@@ -0,0 +1,72 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++
++package com.sun.xml.internal.bind.v2.runtime.unmarshaller;
++
++import javax.xml.stream.XMLStreamException;
++import javax.xml.stream.XMLStreamReader;
++
++import com.sun.xml.internal.org.jvnet.staxex.XMLStreamReaderEx;
++import org.xml.sax.SAXException;
++
++/**
++ * Reads XML from StAX {@link XMLStreamReader} and
++ * feeds events to {@link XmlVisitor}.
++ *
++ * @author Ryan.Shoemaker@Sun.COM
++ * @author Kohsuke Kawaguchi
++ * @version JAXB 2.0
++ */
++final class StAXExConnector extends StAXStreamConnector {
++
++    // StAX event source
++    private final XMLStreamReaderEx in;
++
++    public StAXExConnector(XMLStreamReaderEx in, XmlVisitor visitor) {
++        super(in,visitor);
++        this.in = in;
++    }
++
++    @Override
++    protected void handleCharacters() throws XMLStreamException, SAXException {
++        if( predictor.expectText() ) {
++            CharSequence pcdata = in.getPCDATA();
++            if(pcdata instanceof com.sun.xml.internal.org.jvnet.staxex.Base64Data) {
++                com.sun.xml.internal.org.jvnet.staxex.Base64Data bd = (com.sun.xml.internal.org.jvnet.staxex.Base64Data) pcdata;
++                Base64Data binary = new Base64Data();
++                if(!bd.hasData())
++                    binary.set(bd.getDataHandler());
++                else
++                    binary.set( bd.get(), bd.getDataLen(), bd.getMimeType() );
++                // we make an assumption here that the binary data shows up on its own
++                // not adjacent to other text. So it's OK to fire it off right now.
++                visitor.text(binary);
++                textReported = true;
++            } else {
++                buffer.append(pcdata);
++            }
++        }
++    }
++}
+--- /dev/null	Thu Jul 30 18:59:16 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/bind/v2/util/StackRecorder.java	Thu Jul 30 18:59:15 2009
+@@ -0,0 +1,33 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++package com.sun.xml.internal.bind.v2.util;
++
++/**
++ * Created to record the caller stack trace in logging.
++ *
++ * @author Kohsuke Kawaguchi
++ */
++public class StackRecorder extends Throwable {
++}
+--- /dev/null	Thu Jul 30 18:59:19 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/mimepull/Chunk.java	Thu Jul 30 18:59:18 2009
+@@ -0,0 +1,50 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++package com.sun.xml.internal.org.jvnet.mimepull;
++
++import java.nio.ByteBuffer;
++
++/**
++ * @author Kohsuke Kawaguchi
++ */
++final class Chunk {
++    volatile Chunk next;
++    volatile Data data;
++
++    public Chunk(Data data) {
++        this.data = data;
++    }
++
++    /**
++     * Creates a new chunk and adds to linked list.
++     *
++     * @param dataHead of the linked list
++     * @param buf MIME part partial data
++     * @return created chunk
++     */
++    public Chunk createNext(DataHead dataHead, ByteBuffer buf) {
++        return next = new Chunk(data.createNext(dataHead, buf));
++    }
++}
+--- /dev/null	Thu Jul 30 18:59:22 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/mimepull/ChunkInputStream.java	Thu Jul 30 18:59:21 2009
+@@ -0,0 +1,94 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++package com.sun.xml.internal.org.jvnet.mimepull;
++
++import java.io.InputStream;
++import java.io.IOException;
++
++/**
++ * Constructs a InputStream from a linked list of {@link Chunk}s.
++ *
++ * @author Kohsuke Kawaguchi
++ * @author Jitendra Kotamraju
++ */
++final class ChunkInputStream extends InputStream {
++    Chunk current;
++    int offset;
++    int len;
++    final MIMEMessage msg;
++    final MIMEPart part;
++    byte[] buf;
++
++    public ChunkInputStream(MIMEMessage msg, MIMEPart part, Chunk startPos) {
++        this.current = startPos;
++        len = current.data.size();
++        buf = current.data.read();
++        this.msg = msg;
++        this.part = part;
++    }
++
++    @Override
++    public int read(byte b[], int off, int sz) throws IOException {
++        if(!fetch())    return -1;
++
++        sz = Math.min(sz, len-offset);
++        System.arraycopy(buf,offset,b,off,sz);
++        return sz;
++    }
++
++    public int read() throws IOException {
++        if(!fetch()) return -1;
++        return (buf[offset++] & 0xff);
++    }
++
++    /**
++     * Gets to the next chunk if we are done with the current one.
++     * @return
++     */
++    private boolean fetch() {
++        if (current == null) {
++            throw new IllegalStateException("Stream already closed");
++        }
++        while(offset==len) {
++            while(!part.parsed && current.next == null) {
++                msg.makeProgress();
++            }
++            current = current.next;
++
++            if (current == null) {
++                return false;
++            }
++            this.offset = 0;
++            this.buf = current.data.read();
++            this.len = current.data.size();
++        }
++        return true;
++    }
++
++    public void close() throws IOException {
++        super.close();
++        current = null;
++    }
++}
+--- /dev/null	Thu Jul 30 18:59:25 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/mimepull/Data.java	Thu Jul 30 18:59:25 2009
+@@ -0,0 +1,70 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++package com.sun.xml.internal.org.jvnet.mimepull;
++
++import java.nio.ByteBuffer;
++
++/**
++ * @author Kohsuke Kawaguchi
++ * @author Jitendra Kotamraju
++ */
++interface Data {
++
++    /**
++     * size of the chunk given by the parser
++     *
++     * @return size of the chunk
++     */
++    int size();
++
++    /**
++     * TODO: should the return type be ByteBuffer ??
++     * Return part's partial data. The data is read only.
++     *
++     * @return a byte array which contains {#size()} bytes. The returned
++     *         array may be larger than {#size()} bytes and contains data
++     *         from offset 0.
++     */
++    byte[] read();
++
++    /**
++     * Write this partial data to a file
++     *
++     * @param file to which the data needs to be written
++     * @return file pointer before the write operation(at which the data is
++     *         written from)
++     */
++    long writeTo(DataFile file);
++
++    /**
++     * Factory method to create a Data. The implementation could
++     * be file based one or memory based one.
++     *
++     * @param dataHead start of the linked list of data objects
++     * @param buf contains partial content for a part
++     * @return Data
++     */
++    Data createNext(DataHead dataHead, ByteBuffer buf);
++}
+--- /dev/null	Thu Jul 30 18:59:28 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/mimepull/DataFile.java	Thu Jul 30 18:59:28 2009
+@@ -0,0 +1,83 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++package com.sun.xml.internal.org.jvnet.mimepull;
++
++import java.io.*;
++
++/**
++ * Use {@link RandomAccessFile} for concurrent access of read
++ * and write partial part's content.
++ *
++ * @author Kohsuke Kawaguchi
++ * @author Jitendra Kotamraju
++ */
++final class DataFile {
++    private WeakDataFile weak;
++    private long writePointer;
++
++    DataFile(File file) {
++        writePointer=0;
++        weak = new WeakDataFile(this, file);
++    }
++
++    /**
++     *
++     */
++    void close() {
++        weak.close();
++    }
++
++    /**
++     * Read data from the given file pointer position.
++     *
++     * @param pointer read position
++     * @param buf that needs to be filled
++     * @param offset the start offset of the data.
++     * @param length of data that needs to be read
++     */
++    synchronized void read(long pointer, byte[] buf, int offset, int length ) {
++        weak.read(pointer, buf, offset, length);
++    }
++
++    void renameTo(File f) {
++        weak.renameTo(f);
++    }
++
++    /**
++     * Write data to the file
++     *
++     * @param data that needs to written to a file
++     * @param offset start offset in the data
++     * @param length no bytes to write
++     * @return file pointer before the write operation(or at which the
++     *         data is written)
++     */
++    synchronized long writeTo(byte[] data, int offset, int length) {
++        long temp = writePointer;
++        writePointer = weak.writeTo(writePointer, data, offset, length);
++        return temp;
++    }
++
++}
+--- /dev/null	Thu Jul 30 18:59:32 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/mimepull/DataHead.java	Thu Jul 30 18:59:31 2009
+@@ -0,0 +1,258 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++package com.sun.xml.internal.org.jvnet.mimepull;
++
++import java.io.*;
++import java.nio.ByteBuffer;
++
++/**
++ * 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
++ * application developer need not worry about these details.
++ *
++ * @author Jitendra Kotamraju
++ */
++final class DataHead {
++
++    /**
++     * Linked list to keep the part's content
++     */
++    volatile Chunk head, tail;
++
++    /**
++     * If the part is stored in a file, non-null.
++     */
++    DataFile dataFile;
++
++    private final MIMEPart part;
++
++    boolean readOnce;
++    volatile long inMemory;
++
++    /**
++     * Used only for debugging. This records where readOnce() is called.
++     */
++    private Throwable consumedAt;
++
++    DataHead(MIMEPart part) {
++        this.part = part;
++    }
++
++    void addBody(ByteBuffer buf) {
++        synchronized(this) {
++            inMemory += buf.limit();
++        }
++        if (tail != null) {
++            tail = tail.createNext(this, buf);
++        } else {
++            head = tail = new Chunk(new MemoryData(buf, part.msg.config));
++        }
++    }
++
++    void doneParsing() {
++    }
++
++    void moveTo(File f) {
++        if (dataFile != null) {
++            dataFile.renameTo(f);
++        } 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);
++                }
++                os.close();
++            } catch(IOException ioe) {
++                throw new MIMEParsingException(ioe);
++            }
++        }
++    }
++
++    void close() {
++        if (dataFile != null) {
++            head = tail = null;
++            dataFile.close();
++        }
++    }
++
++
++    /**
++     * Can get the attachment part's content multiple times. That means
++     * the full content needs to be there in memory or on the file system.
++     * Calling this method would trigger parsing for the part's data. So
++     * do not call this unless it is required(otherwise, just wrap MIMEPart
++     * into a object that returns InputStream for e.g DataHandler)
++     *
++     * @return data for the part's content
++     */
++    public InputStream read() {
++        if (readOnce) {
++            throw new IllegalStateException("readOnce() is called before, read() cannot be called later.");
++        }
++
++        // Trigger parsing for the part
++        while(tail == null) {
++            if (!part.msg.makeProgress()) {
++                throw new IllegalStateException("No such MIME Part: "+part);
++            }
++        }
++
++        if (head == null) {
++            throw new IllegalStateException("Already read. Probably readOnce() is called before.");
++        }
++        return new ReadMultiStream();
++    }
++
++    /**
++     * Used for an assertion. Returns true when readOnce() is not already called.
++     * or otherwise throw an exception.
++     *
++     * <p>
++     * Calling this method also marks the stream as 'consumed'
++     *
++     * @return true if readOnce() is not called before
++     */
++    private boolean unconsumed() {
++        if (consumedAt != null) {
++            AssertionError error = new AssertionError("readOnce() is already called before. See the nested exception from where it's called.");
++            error.initCause(consumedAt);
++            throw error;
++        }
++        consumedAt = new Exception().fillInStackTrace();
++        return true;
++    }
++
++    /**
++     * Can get the attachment part's content only once. The content
++     * will be lost after the method. Content data is not be stored
++     * on the file system or is not kept in the memory for the
++     * following case:
++     *   - Attachement parts contents are accessed sequentially
++     *
++     * In general, take advantage of this when the data is used only
++     * once.
++     *
++     * @return data for the part's content
++     */
++    public InputStream readOnce() {
++        assert unconsumed();
++        if (readOnce) {
++            throw new IllegalStateException("readOnce() is called before. It can only be called once.");
++        }
++        readOnce = true;
++        // Trigger parsing for the part
++        while(tail == null) {
++            if (!part.msg.makeProgress() && tail == null) {
++                throw new IllegalStateException("No such Part: "+part);
++            }
++        }
++        InputStream in = new ReadOnceStream();
++        head = null;
++        return in;
++    }
++
++    class ReadMultiStream extends InputStream {
++        Chunk current;
++        int offset;
++        int len;
++        byte[] buf;
++
++        public ReadMultiStream() {
++            this.current = head;
++            len = current.data.size();
++            buf = current.data.read();
++        }
++
++        @Override
++        public int read(byte b[], int off, int sz) throws IOException {
++            if(!fetch())    return -1;
++
++            sz = Math.min(sz, len-offset);
++            System.arraycopy(buf,offset,b,off,sz);
++            offset += sz;
++            return sz;
++        }
++
++        public int read() throws IOException {
++            if (!fetch()) {
++                return -1;
++            }
++            return (buf[offset++] & 0xff);
++        }
++
++        void adjustInMemoryUsage() {
++            // Nothing to do in this case.
++        }
++
++        /**
++         * Gets to the next chunk if we are done with the current one.
++         * @return
++         */
++        private boolean fetch() {
++            if (current == null) {
++                throw new IllegalStateException("Stream already closed");
++            }
++            while(offset==len) {
++                while(!part.parsed && current.next == null) {
++                    part.msg.makeProgress();
++                }
++                current = current.next;
++
++                if (current == null) {
++                    return false;
++                }
++                adjustInMemoryUsage();
++                this.offset = 0;
++                this.buf = current.data.read();
++                this.len = current.data.size();
++            }
++            return true;
++        }
++
++        public void close() throws IOException {
++            super.close();
++            current = null;
++        }
++    }
++
++    final class ReadOnceStream extends ReadMultiStream {
++
++        @Override
++        void adjustInMemoryUsage() {
++            synchronized(DataHead.this) {
++                inMemory -= current.data.size();    // adjust current memory usage
++            }
++        }
++
++    }
++
++
++}
+--- /dev/null	Thu Jul 30 18:59:35 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/mimepull/FileData.java	Thu Jul 30 18:59:34 2009
+@@ -0,0 +1,73 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++package com.sun.xml.internal.org.jvnet.mimepull;
++
++import java.nio.ByteBuffer;
++
++/**
++ * Keeps the Part's partial content data in a file.
++ *
++ * @author Kohsuke Kawaguchi
++ * @author Jitendra Kotamraju
++ */
++final class FileData implements Data {
++    private final DataFile file;
++    private final long pointer;         // read position
++    private final int length;
++
++    FileData(DataFile file, ByteBuffer buf) {
++        this(file, file.writeTo(buf.array(), 0, buf.limit()), buf.limit());
++    }
++
++    FileData(DataFile file, long pointer, int length) {
++        this.file = file;
++        this.pointer = pointer;
++        this.length = length;
++    }
++
++    public byte[] read() {
++        byte[] buf = new byte[length];
++        file.read(pointer, buf, 0, length);
++        return buf;
++    }
++
++    /*
++     * This shouldn't be called
++     */
++    public long writeTo(DataFile file) {
++        throw new IllegalStateException();
++    }
++
++    public int size() {
++        return length;
++    }
++
++    /*
++     * Always create FileData
++     */
++    public Data createNext(DataHead dataHead, ByteBuffer buf) {
++        return new FileData(file, buf);
++    }
++}
+--- /dev/null	Thu Jul 30 18:59:38 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/mimepull/FinalArrayList.java	Thu Jul 30 18:59:37 2009
+@@ -0,0 +1,49 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++package com.sun.xml.internal.org.jvnet.mimepull;
++
++import java.util.ArrayList;
++import java.util.Collection;
++
++/**
++ * {@link java.util.ArrayList} with the final keyword.
++ *
++ * <p>
++ * This gives HotSpot a better hint that all methods can be inlined.
++ *
++ * @author Kohsuke Kawaguchi
++ */
++final class FinalArrayList<T> extends ArrayList<T> {
++    public FinalArrayList(int initialCapacity) {
++        super(initialCapacity);
++    }
++
++    public FinalArrayList() {
++    }
++
++    public FinalArrayList(Collection<? extends T> ts) {
++        super(ts);
++    }
++}
+--- /dev/null	Thu Jul 30 18:59:41 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/mimepull/Header.java	Thu Jul 30 18:59:41 2009
+@@ -0,0 +1,48 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++package com.sun.xml.internal.org.jvnet.mimepull;
++
++/**
++ * The Header class stores a name/value pair to represent headers.
++ *
++ * @author John Mani
++ */
++
++public interface Header {
++
++    /**
++     * Returns the name of this header.
++     *
++     * @return          name of the header
++     */
++    String getName();
++
++    /**
++     * Returns the value of this header.
++     *
++     * @return          value of the header
++     */
++    String getValue();
++}
+--- /dev/null	Thu Jul 30 18:59:44 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/mimepull/InternetHeaders.java	Thu Jul 30 18:59:44 2009
+@@ -0,0 +1,238 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++package com.sun.xml.internal.org.jvnet.mimepull;
++
++import java.io.IOException;
++import java.util.NoSuchElementException;
++import java.util.List;
++
++/**
++ * InternetHeaders is a utility class that manages RFC822 style
++ * headers. Given an RFC822 format message stream, it reads lines
++ * until the blank line that indicates end of header. The input stream
++ * is positioned at the start of the body. The lines are stored
++ * within the object and can be extracted as either Strings or
++ * {@link Header} objects. <p>
++ * <p/>
++ * This class is mostly intended for service providers. MimeMessage
++ * and MimeBody use this class for holding their headers. <p>
++ * <p/>
++ * <hr> <strong>A note on RFC822 and MIME headers</strong><p>
++ * <p/>
++ * RFC822 and MIME header fields <strong>must</strong> contain only
++ * US-ASCII characters. If a header contains non US-ASCII characters,
++ * it must be encoded as per the rules in RFC 2047. The MimeUtility
++ * class provided in this package can be used to to achieve this.
++ * Callers of the <code>setHeader</code>, <code>addHeader</code>, and
++ * <code>addHeaderLine</code> methods are responsible for enforcing
++ * the MIME requirements for the specified headers.  In addition, these
++ * header fields must be folded (wrapped) before being sent if they
++ * exceed the line length limitation for the transport (1000 bytes for
++ * SMTP).  Received headers may have been folded.  The application is
++ * responsible for folding and unfolding headers as appropriate. <p>
++ *
++ * @author John Mani
++ * @author Bill Shannon
++ */
++final class InternetHeaders {
++
++    private final FinalArrayList<hdr> headers = new FinalArrayList<hdr>();
++
++    /**
++     * Read and parse the given RFC822 message stream till the
++     * blank line separating the header from the body. Store the
++     * header lines inside this InternetHeaders object. <p>
++     * <p/>
++     * Note that the header lines are added into this InternetHeaders
++     * object, so any existing headers in this object will not be
++     * affected.
++     *
++     * @param   lis RFC822 input stream
++     */
++    InternetHeaders(MIMEParser.LineInputStream lis) {
++        // Read header lines until a blank line. It is valid
++        // to have BodyParts with no header lines.
++        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();
++
++        try {
++            //while ((line = lis.readLine()) != null) {
++            do {
++                line = lis.readLine();
++                if (line != null &&
++                        (line.startsWith(" ") || line.startsWith("\t"))) {
++                    // continuation of header
++                    if (prevline != null) {
++                        lineBuffer.append(prevline);
++                        prevline = null;
++                    }
++                    lineBuffer.append("\r\n");
++                    lineBuffer.append(line);
++                } else {
++                    // new header
++                    if (prevline != null)
++                        addHeaderLine(prevline);
++                    else if (lineBuffer.length() > 0) {
++                        // store previous header first
++                        addHeaderLine(lineBuffer.toString());
++                        lineBuffer.setLength(0);
++                    }
++                    prevline = line;
++                }
++            } while (line != null && line.length() > 0);
++        } catch (IOException ioex) {
++            throw new MIMEParsingException("Error in input stream", ioex);
++        }
++    }
++
++    /**
++     * Return all the values for the specified header. The
++     * values are String objects.  Returns <code>null</code>
++     * if no headers with the specified name exist.
++     *
++     * @param   name header name
++     * @return          array of header values, or null if none
++     */
++    List<String> getHeader(String name) {
++        // XXX - should we just step through in index order?
++        FinalArrayList<String> v = new FinalArrayList<String>(); // accumulate return values
++
++        int len = headers.size();
++        for( int i=0; i<len; i++ ) {
++            hdr h = (hdr) headers.get(i);
++            if (name.equalsIgnoreCase(h.name)) {
++                v.add(h.getValue());
++            }
++        }
++        return (v.size() == 0) ? null : v;
++    }
++
++    /**
++     * Return all the headers as an Enumeration of
++     * {@link Header} objects.
++     *
++     * @return  Header objects
++     */
++    FinalArrayList<? extends Header> getAllHeaders() {
++        return headers; // conceptually it should be read-only, but for performance reason I'm not wrapping it here
++    }
++
++    /**
++     * Add an RFC822 header line to the header store.
++     * If the line starts with a space or tab (a continuation line),
++     * add it to the last header line in the list. <p>
++     * <p/>
++     * Note that RFC822 headers can only contain US-ASCII characters
++     *
++     * @param   line    raw RFC822 header line
++     */
++    void addHeaderLine(String line) {
++        try {
++            char c = line.charAt(0);
++            if (c == ' ' || c == '\t') {
++                hdr h = (hdr) headers.get(headers.size() - 1);
++                h.line += "\r\n" + line;
++            } else
++                headers.add(new hdr(line));
++        } catch (StringIndexOutOfBoundsException e) {
++            // line is empty, ignore it
++            return;
++        } catch (NoSuchElementException e) {
++            // XXX - vector is empty?
++        }
++    }
++
++}
++
++/*
++ * A private utility class to represent an individual header.
++ */
++
++class hdr implements Header {
++
++    String name;    // the canonicalized (trimmed) name of this header
++    // XXX - should name be stored in lower case?
++    String line;    // the entire RFC822 header "line"
++
++    /*
++     * Constructor that takes a line and splits out
++     * the header name.
++     */
++    hdr(String l) {
++        int i = l.indexOf(':');
++        if (i < 0) {
++            // should never happen
++            name = l.trim();
++        } else {
++            name = l.substring(0, i).trim();
++        }
++        line = l;
++    }
++
++    /*
++     * Constructor that takes a header name and value.
++     */
++    hdr(String n, String v) {
++        name = n;
++        line = n + ": " + v;
++    }
++
++    /*
++     * Return the "name" part of the header line.
++     */
++    public String getName() {
++        return name;
++    }
++
++    /*
++     * Return the "value" part of the header line.
++     */
++    public String getValue() {
++        int i = line.indexOf(':');
++        if (i < 0)
++            return line;
++
++        int j;
++        if (name.equalsIgnoreCase("Content-Description")) {
++            // Content-Description should retain the folded whitespace after header unfolding -
++            // rf. RFC2822 section 2.2.3, rf. RFC2822 section 3.2.3
++            for (j = i + 1; j < line.length(); j++) {
++                char c = line.charAt(j);
++                if (!(/*c == ' ' ||*/c == '\t' || c == '\r' || c == '\n'))
++                    break;
++            }
++        } else {
++            // skip whitespace after ':'
++            for (j = i + 1; j < line.length(); j++) {
++                char c = line.charAt(j);
++                if (!(c == ' ' || c == '\t' || c == '\r' || c == '\n'))
++                    break;
++            }
++        }
++        return line.substring(j);
++    }
++}
+--- /dev/null	Thu Jul 30 18:59:48 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/mimepull/MIMEConfig.java	Thu Jul 30 18:59:47 2009
+@@ -0,0 +1,147 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++package com.sun.xml.internal.org.jvnet.mimepull;
++
++import java.io.File;
++import java.io.IOException;
++
++/**
++ * Configuration for MIME message parsing and storing.
++ *
++ * @author Jitendra Kotamraju
++ */
++public class MIMEConfig {
++
++    private static final int DEFAULT_CHUNK_SIZE = 8192;
++    private static final long DEFAULT_MEMORY_THRESHOLD = 1048576L;
++    private static final String DEFAULT_FILE_PREFIX = "MIME";
++
++    // Parses the entire message eagerly
++    boolean parseEagerly;
++
++    // Approximate Chunk size
++    int chunkSize;
++
++    // Maximum in-memory data per attachment
++    long memoryThreshold;
++
++    // Do not store to disk
++    boolean onlyMemory;
++
++    // temp Dir to store large files
++    File tempDir;
++    String prefix;
++    String suffix;
++
++
++    private MIMEConfig(boolean parseEagerly, int chunkSize,
++                       long inMemoryThreshold, String dir, String prefix, String suffix) {
++        this.parseEagerly = parseEagerly;
++        this.chunkSize = chunkSize;
++        this.memoryThreshold = inMemoryThreshold;
++        this.prefix = prefix;
++        this.suffix = suffix;
++        setDir(dir);
++    }
++
++    public MIMEConfig() {
++        this(false, DEFAULT_CHUNK_SIZE, DEFAULT_MEMORY_THRESHOLD, null,
++                DEFAULT_FILE_PREFIX, null);
++    }
++
++    boolean isParseEagerly() {
++        return parseEagerly;
++    }
++
++    public void setParseEagerly(boolean parseEagerly) {
++        this.parseEagerly = parseEagerly;
++    }
++
++    int getChunkSize() {
++        return chunkSize;
++    }
++
++    void setChunkSize(int chunkSize) {
++        this.chunkSize = chunkSize;
++    }
++
++    long getMemoryThreshold() {
++        return memoryThreshold;
++    }
++
++    /**
++     * If the attachment is greater than the threshold, it is
++     * written to the disk.
++     *
++     * @param memoryThreshold no of bytes per attachment
++     *        if -1, then the whole attachment is kept in memory
++     */
++    public void setMemoryThreshold(long memoryThreshold) {
++        this.memoryThreshold = memoryThreshold;
++    }
++
++    boolean isOnlyMemory() {
++        return memoryThreshold == -1L;
++    }
++
++    File getTempDir() {
++        return tempDir;
++    }
++
++    String getTempFilePrefix() {
++        return prefix;
++    }
++
++    String getTempFileSuffix() {
++        return suffix;
++    }
++
++    /**
++     * @param dir
++     */
++    public void setDir(String dir) {
++        if (tempDir == null && dir != null && !dir.equals("")) {
++            tempDir = new File(dir);
++        }
++    }
++
++    /**
++     * Validates if it can create temporary files. Otherwise, it stores
++     * attachment contents in memory.
++     */
++    public void validate() {
++        if (!isOnlyMemory()) {
++            try {
++                File tempFile = (tempDir == null)
++                        ? File.createTempFile(prefix, suffix)
++                        : File.createTempFile(prefix, suffix, tempDir);
++                tempFile.delete();
++            } catch(Exception ioe) {
++                memoryThreshold = -1L;      // whole attachment will be in-memory
++            }
++        }
++    }
++
++}
+--- /dev/null	Thu Jul 30 18:59:51 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/mimepull/MIMEEvent.java	Thu Jul 30 18:59:50 2009
+@@ -0,0 +1,116 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++package com.sun.xml.internal.org.jvnet.mimepull;
++
++import java.nio.ByteBuffer;
++
++/**
++ * @author Jitendra Kotamraju
++ */
++abstract class MIMEEvent {
++
++    enum EVENT_TYPE {START_MESSAGE, START_PART, HEADERS, CONTENT, END_PART, END_MESSAGE}
++
++    /**
++     * Returns a event for parser's current cursor location in the MIME message.
++     *
++     * <p>
++     * {@link EVENT_TYPE#START_MESSAGE} and {@link EVENT_TYPE#START_MESSAGE} events
++     * are generated only once.
++     *
++     * <p>
++     * {@link EVENT_TYPE#START_PART}, {@link EVENT_TYPE#END_PART}, {@link EVENT_TYPE#HEADERS}
++     * events are generated only once for each attachment part.
++     *
++     * <p>
++     * {@link EVENT_TYPE#CONTENT} event may be generated more than once for an attachment
++     * part.
++     *
++     * @return event type
++     */
++    abstract EVENT_TYPE getEventType();
++
++    static final StartMessage START_MESSAGE = new StartMessage();
++    static final StartPart START_PART = new StartPart();
++    static final EndPart END_PART = new EndPart();
++    static final EndMessage END_MESSAGE = new EndMessage();
++
++    static final class StartMessage extends MIMEEvent {
++        EVENT_TYPE getEventType() {
++            return EVENT_TYPE.START_MESSAGE;
++        }
++    }
++
++    static final class StartPart extends MIMEEvent {
++        EVENT_TYPE getEventType() {
++            return EVENT_TYPE.START_PART;
++        }
++    }
++
++    static final class EndPart extends MIMEEvent {
++        EVENT_TYPE getEventType () {
++            return EVENT_TYPE.END_PART;
++        }
++    }
++
++    static final class Headers extends MIMEEvent {
++        InternetHeaders ih;
++
++        Headers(InternetHeaders ih) {
++            this.ih = ih;
++        }
++
++        EVENT_TYPE getEventType() {
++            return EVENT_TYPE.HEADERS;
++        }
++
++        InternetHeaders getHeaders() {
++            return ih;
++        }
++    }
++
++    static final class Content extends MIMEEvent {
++        private final ByteBuffer buf;
++
++        Content(ByteBuffer buf) {
++            this.buf = buf;
++        }
++
++        EVENT_TYPE getEventType() {
++            return EVENT_TYPE.CONTENT;
++        }
++
++        ByteBuffer getData() {
++            return buf;
++        }
++    }
++
++    static final class EndMessage extends MIMEEvent {
++        EVENT_TYPE getEventType() {
++            return EVENT_TYPE.END_MESSAGE;
++        }
++    }
++
++}
+--- /dev/null	Thu Jul 30 18:59:54 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/mimepull/MIMEMessage.java	Thu Jul 30 18:59:53 2009
+@@ -0,0 +1,248 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++package com.sun.xml.internal.org.jvnet.mimepull;
++
++import java.io.IOException;
++import java.io.InputStream;
++import java.io.UnsupportedEncodingException;
++import java.net.URLDecoder;
++import java.nio.ByteBuffer;
++import java.util.*;
++import java.util.logging.Logger;
++
++/**
++ * Represents MIME message. MIME message parsing is done lazily using a
++ * pull parser.
++ *
++ * @author Jitendra Kotamraju
++ */
++public class MIMEMessage {
++    private static final Logger LOGGER = Logger.getLogger(MIMEMessage.class.getName());
++
++    MIMEConfig config;
++
++    private final InputStream in;
++    private final List<MIMEPart> partsList;
++    private final Map<String, MIMEPart> partsMap;
++    private final Iterator<MIMEEvent> it;
++    private boolean parsed;     // true when entire message is parsed
++    private MIMEPart currentPart;
++    private int currentIndex;
++
++    /**
++     * @see MIMEMessage(InputStream, String, MIMEConfig)
++     */
++    public MIMEMessage(InputStream in, String boundary) {
++        this(in, boundary, new MIMEConfig());
++    }
++
++    /**
++     * Creates a MIME message from the content's stream. The content stream
++     * is closed when EOF is reached.
++     *
++     * @param in MIME message stream
++     * @param boundary the separator for parts(pass it without --)
++     * @param config various configuration parameters
++     */
++    public MIMEMessage(InputStream in, String boundary, MIMEConfig config) {
++        this.in = in;
++        this.config = config;
++        MIMEParser parser = new MIMEParser(in, boundary, config);
++        it = parser.iterator();
++
++        partsList = new ArrayList<MIMEPart>();
++        partsMap = new HashMap<String, MIMEPart>();
++        if (config.isParseEagerly()) {
++            parseAll();
++        }
++    }
++
++    /**
++     * Gets all the attachments by parsing the entire MIME message. Avoid
++     * this if possible since it is an expensive operation.
++     *
++     * @return list of attachments.
++     */
++    public List<MIMEPart> getAttachments() {
++        if (!parsed) {
++            parseAll();
++        }
++        return partsList;
++    }
++
++    /**
++     * Creates nth attachment lazily. It doesn't validate
++     * if the message has so many attachments. To
++     * do the validation, the message needs to be parsed.
++     * The parsing of the message is done lazily and is done
++     * while reading the bytes of the part.
++     *
++     * @param index sequential order of the part. starts with zero.
++     * @return attachemnt part
++     */
++    public MIMEPart getPart(int index) {
++        LOGGER.fine("index="+index);
++        MIMEPart part = (index < partsList.size()) ? partsList.get(index) : null;
++        if (parsed && part == null) {
++            throw new MIMEParsingException("There is no "+index+" attachment part ");
++        }
++        if (part == null) {
++            // Parsing will done lazily and will be driven by reading the part
++            part = new MIMEPart(this);
++            partsList.add(index, part);
++        }
++        LOGGER.fine("Got attachment at index="+index+" attachment="+part);
++        return part;
++    }
++
++    /**
++     * Creates a lazy attachment for a given Content-ID. It doesn't validate
++     * if the message contains an attachment with the given Content-ID. To
++     * do the validation, the message needs to be parsed. The parsing of the
++     * message is done lazily and is done while reading the bytes of the part.
++     *
++     * @param contentId Content-ID of the part, expects Content-ID without <, >
++     * @return attachemnt part
++     */
++    public MIMEPart getPart(String contentId) {
++        LOGGER.fine("Content-ID="+contentId);
++        MIMEPart part = getDecodedCidPart(contentId);
++        if (parsed && part == null) {
++            throw new MIMEParsingException("There is no attachment part with Content-ID = "+contentId);
++        }
++        if (part == null) {
++            // Parsing is done lazily and is driven by reading the part
++            part = new MIMEPart(this, contentId);
++            partsMap.put(contentId, part);
++        }
++        LOGGER.fine("Got attachment for Content-ID="+contentId+" attachment="+part);
++        return part;
++    }
++
++    // this is required for Indigo interop, it writes content-id without escaping
++    private MIMEPart getDecodedCidPart(String cid) {
++        MIMEPart part = partsMap.get(cid);
++        if (part == null) {
++            if (cid.indexOf('%') != -1) {
++                try {
++                    String tempCid = URLDecoder.decode(cid, "utf-8");
++                    part = partsMap.get(tempCid);
++                } catch(UnsupportedEncodingException ue) {
++                    // Ignore it
++                }
++            }
++        }
++        return part;
++    }
++
++
++    /**
++     * Parses the whole MIME message eagerly
++     */
++    public void parseAll() {
++        while(makeProgress()) {
++            // Nothing to do
++        }
++    }
++
++
++    /**
++     * Parses the MIME message in a pull fashion.
++     *
++     * @return
++     *      false if the parsing is completed.
++     */
++    public synchronized boolean makeProgress() {
++        if (!it.hasNext()) {
++            return false;
++        }
++
++        MIMEEvent event = it.next();
++
++        switch(event.getEventType()) {
++            case START_MESSAGE :
++                LOGGER.fine("MIMEEvent="+MIMEEvent.EVENT_TYPE.START_MESSAGE);
++                break;
++
++            case START_PART :
++                LOGGER.fine("MIMEEvent="+MIMEEvent.EVENT_TYPE.START_PART);
++                break;
++
++            case HEADERS :
++                LOGGER.fine("MIMEEvent="+MIMEEvent.EVENT_TYPE.HEADERS);
++                MIMEEvent.Headers headers = (MIMEEvent.Headers)event;
++                InternetHeaders ih = headers.getHeaders();
++                List<String> cids = ih.getHeader("content-id");
++                String cid = (cids != null) ? cids.get(0) : currentIndex+"";
++                if (cid.length() > 2 && cid.charAt(0)=='<') {
++                    cid = cid.substring(1,cid.length()-1);
++                }
++                MIMEPart listPart = (currentIndex < partsList.size()) ? partsList.get(currentIndex) : null;
++                MIMEPart mapPart = getDecodedCidPart(cid);
++                if (listPart == null && mapPart == null) {
++                    currentPart = getPart(cid);
++                    partsList.add(currentIndex, currentPart);
++                } else if (listPart == null) {
++                    currentPart = mapPart;
++                    partsList.add(currentIndex, mapPart);
++                } else if (mapPart == null) {
++                    currentPart = listPart;
++                    currentPart.setContentId(cid);
++                    partsMap.put(cid, currentPart);
++                } else if (listPart != mapPart) {
++                    throw new MIMEParsingException("Created two different attachments using Content-ID and index");
++                }
++                currentPart.setHeaders(ih);
++                break;
++
++            case CONTENT :
++                LOGGER.finer("MIMEEvent="+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);
++                currentPart.doneParsing();
++                ++currentIndex;
++                break;
++
++            case END_MESSAGE :
++                LOGGER.fine("MIMEEvent="+MIMEEvent.EVENT_TYPE.END_MESSAGE);
++                parsed = true;
++                try {
++                    in.close();
++                } catch(IOException ioe) {
++                    throw new MIMEParsingException(ioe);
++                }
++                break;
++
++            default :
++                throw new MIMEParsingException("Unknown Parser state = "+event.getEventType());
++        }
++        return true;
++    }
++}
+--- /dev/null	Thu Jul 30 18:59:57 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/mimepull/MIMEParser.java	Thu Jul 30 18:59:56 2009
+@@ -0,0 +1,500 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++package com.sun.xml.internal.org.jvnet.mimepull;
++
++import java.io.InputStream;
++import java.io.IOException;
++import java.util.*;
++import java.util.logging.Logger;
++import java.nio.ByteBuffer;
++
++/**
++ * Pull parser for the MIME messages. Applications can use pull API to continue
++ * the parsing MIME messages lazily.
++ *
++ * <pre>
++ * for e.g.:
++ * <p>
++ *
++ * MIMEParser parser = ...
++ * Iterator<MIMEEvent> it = parser.iterator();
++ * while(it.hasNext()) {
++ *   MIMEEvent event = it.next();
++ *   ...
++ * }
++ * </pre>
++ *
++ * @author Jitendra Kotamraju
++ */
++class MIMEParser implements Iterable<MIMEEvent> {
++
++    private static final Logger LOGGER = Logger.getLogger(MIMEParser.class.getName());
++
++    // 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
++    private static final int NO_LWSP = 1000;
++    private enum STATE {START_MESSAGE, SKIP_PREAMBLE, START_PART, HEADERS, BODY, END_PART, END_MESSAGE}
++    private STATE state = STATE.START_MESSAGE;
++
++    private final InputStream in;
++    private final byte[] bndbytes;
++    private final int bl;
++    private final MIMEConfig config;
++    private final int[] bcs = new int[128]; // BnM algo: Bad Character Shift table
++    private final int[] gss;                // BnM algo : Good Suffix Shift table
++
++    /**
++     * Have we parsed the data from our InputStream yet?
++     */
++    private boolean parsed;
++
++    /*
++     * Read and process body partsList until we see the
++     * terminating boundary line (or EOF).
++     */
++    private boolean done = false;
++
++    private boolean eof;
++    private final int capacity;
++    private byte[] buf;
++    private int len;
++    private boolean bol;        // beginning of the line
++
++    /*
++     * Parses the MIME content. At the EOF, it also closes input stream
++     */
++    MIMEParser(InputStream in, String boundary, MIMEConfig config) {
++        this.in = in;
++        this.bndbytes = getBytes("--"+boundary);
++        bl = bndbytes.length;
++        this.config = config;
++        gss = new int[bl];
++        compileBoundaryPattern();
++
++        // \r\n + boundary + "--\r\n" + lots of LWSP
++        capacity = config.chunkSize+2+bl+4+NO_LWSP;
++        createBuf(capacity);
++    }
++
++    /**
++     * Returns iterator for the parsing events. Use the iterator to advance
++     * the parsing.
++     *
++     * @return iterator for parsing events
++     */
++    public Iterator<MIMEEvent> iterator() {
++        return new MIMEEventIterator();
++    }
++
++    class MIMEEventIterator implements Iterator<MIMEEvent> {
++
++        public boolean hasNext() {
++            return !parsed;
++        }
++
++        public MIMEEvent next() {
++            switch(state) {
++                case START_MESSAGE :
++                    LOGGER.finer("MIMEParser state="+STATE.START_MESSAGE);
++                    state = STATE.SKIP_PREAMBLE;
++                    return MIMEEvent.START_MESSAGE;
++
++                case SKIP_PREAMBLE :
++                    LOGGER.finer("MIMEParser state="+STATE.SKIP_PREAMBLE);
++                    skipPreamble();
++                    // fall through
++                case START_PART :
++                    LOGGER.finer("MIMEParser state="+STATE.START_PART);
++                    state = STATE.HEADERS;
++                    return MIMEEvent.START_PART;
++
++                case HEADERS :
++                    LOGGER.finer("MIMEParser state="+STATE.HEADERS);
++                    InternetHeaders ih = readHeaders();
++                    state = STATE.BODY;
++                    bol = true;
++                    return new MIMEEvent.Headers(ih);
++
++                case BODY :
++                    LOGGER.finer("MIMEParser state="+STATE.BODY);
++                    ByteBuffer buf = readBody();
++                    bol = false;
++                    return new MIMEEvent.Content(buf);
++
++                case END_PART :
++                    LOGGER.finer("MIMEParser state="+STATE.END_PART);
++                    if (done) {
++                        state = STATE.END_MESSAGE;
++                    } else {
++                        state = STATE.START_PART;
++                    }
++                    return MIMEEvent.END_PART;
++
++                case END_MESSAGE :
++                    LOGGER.finer("MIMEParser state="+STATE.END_MESSAGE);
++                    parsed = true;
++                    return MIMEEvent.END_MESSAGE;
++
++                default :
++                    throw new MIMEParsingException("Unknown Parser state = "+state);
++            }
++        }
++
++        public void remove() {
++            throw new UnsupportedOperationException();
++        }
++    }
++
++    /**
++     * Collects the headers for the current part by parsing mesage stream.
++     *
++     * @return headers for the current part
++     */
++    private InternetHeaders readHeaders() {
++        if (!eof) {
++            fillBuf();
++        }
++        return new InternetHeaders(new LineInputStream());
++    }
++
++    /**
++     * Reads and saves the part of the current attachment part's content.
++     * At the end of this method, buf should have the remaining data
++     * at index 0.
++     *
++     * @return a chunk of the part's content
++     *
++     */
++    private ByteBuffer readBody() {
++        if (!eof) {
++            fillBuf();
++        }
++        int start = match(buf, 0, len);     // matches boundary
++        if (start == -1) {
++            // No boundary is found
++            assert eof || len >= config.chunkSize;
++            int chunkSize = eof ? len : config.chunkSize;
++            if (eof) {
++                // Should we throw exception as there is no closing boundary ? But some impl
++                // like SAAJ do not throw excpetion.
++                // throw new MIMEParsingException("Reached EOF, but there is no closing MIME boundary.");
++                done = true;
++                state = STATE.END_PART;
++            }
++            return adjustBuf(chunkSize, len-chunkSize);
++        }
++        // Found boundary.
++        // Is it at the start of a line ?
++        int chunkLen = start;
++        if (bol && start == 0) {
++            // nothing to do
++        } else if (start > 0 && (buf[start-1] == '\n' || buf[start-1] =='\r')) {
++            --chunkLen;
++            if (buf[start-1] == '\n' && start >1 && buf[start-2] == '\r') {
++                --chunkLen;
++            }
++        } else {
++           return adjustBuf(start+1, len-start-1);  // boundary is not at beginning of a line
++        }
++
++        if (start+bl+1 < len && buf[start+bl] == '-' && buf[start+bl+1] == '-') {
++            state = STATE.END_PART;
++            done = true;
++            return adjustBuf(chunkLen, 0);
++        }
++
++        // Consider all the whitespace in boundary+whitespace+"\r\n"
++        int lwsp = 0;
++        for(int i=start+bl; i < len && (buf[i] == ' ' || buf[i] == '\t'); i++) {
++            ++lwsp;
++        }
++
++        // Check for \n or \r\n in boundary+whitespace+"\n" or boundary+whitespace+"\r\n"
++        if (start+bl+lwsp < len && buf[start+bl+lwsp] == '\n') {
++            state = STATE.END_PART;
++            return adjustBuf(chunkLen, len-start-bl-lwsp-1);
++        } else if (start+bl+lwsp+1 < len && buf[start+bl+lwsp] == '\r' && buf[start+bl+lwsp+1] == '\n') {
++            state = STATE.END_PART;
++            return adjustBuf(chunkLen, len-start-bl-lwsp-2);
++        } else if (start+bl+lwsp+1 < len) {
++            return adjustBuf(chunkLen+1, len-chunkLen-1);       // boundary string in a part data
++        } else if (eof) {
++            done = true;
++            state = STATE.END_PART;
++            return adjustBuf(chunkLen, 0);
++            // Should we throw exception as there is no closing boundary ? But some impl
++            // like SAAJ do not throw excpetion.
++            //throw new MIMEParsingException("Reached EOF, but there is no closing MIME boundary.");
++        }
++
++        // Some more data needed to determine if it is indeed a proper boundary
++        return adjustBuf(chunkLen, len-chunkLen);
++    }
++
++    /**
++     * Returns a chunk from the original buffer. A new buffer is
++     * created with the remaining bytes.
++     *
++     * @param chunkSize create a chunk with these many bytes
++     * @param remaining bytes from the end of the buffer that need to be copied to
++     *        the beginning of the new buffer
++     * @return chunk
++     */
++    private ByteBuffer adjustBuf(int chunkSize, int remaining) {
++        assert buf != null;
++        assert chunkSize >= 0;
++        assert remaining >= 0;
++
++        byte[] temp = buf;
++        // create a new buf and adjust it without this chunk
++        createBuf(remaining);
++        System.arraycopy(temp, len-remaining, buf, 0, remaining);
++        len = remaining;
++
++        return ByteBuffer.wrap(temp, 0, chunkSize);
++    }
++
++    private void createBuf(int min) {
++        buf = new byte[min < capacity ? capacity : min];
++    }
++
++    /**
++     * Skips the preamble to find the first attachment part
++     */
++    private void skipPreamble() {
++
++        while(true) {
++            if (!eof) {
++                fillBuf();
++            }
++            int start = match(buf, 0, len);     // matches boundary
++            if (start == -1) {
++                // No boundary is found
++                if (eof) {
++                    throw new MIMEParsingException("Missing start boundary");
++                } else {
++                    adjustBuf(len-bl+1, bl-1);
++                    continue;
++                }
++            }
++
++            if (start > config.chunkSize) {
++                adjustBuf(start, len-start);
++                continue;
++            }
++            // Consider all the whitespace boundary+whitespace+"\r\n"
++            int lwsp = 0;
++            for(int i=start+bl; i < len && (buf[i] == ' ' || buf[i] == '\t'); i++) {
++                ++lwsp;
++            }
++            // Check for \n or \r\n
++            if (start+bl+lwsp < len && (buf[start+bl+lwsp] == '\n' || buf[start+bl+lwsp] == '\r') ) {
++                if (buf[start+bl+lwsp] == '\n') {
++                    adjustBuf(start+bl+lwsp+1, len-start-bl-lwsp-1);
++                    break;
++                } else if (start+bl+lwsp+1 < len && buf[start+bl+lwsp+1] == '\n') {
++                    adjustBuf(start+bl+lwsp+2, len-start-bl-lwsp-2);
++                    break;
++                }
++            }
++            adjustBuf(start+1, len-start-1);
++        }
++        LOGGER.fine("Skipped the preamble. buffer len="+len);
++    }
++
++    private 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;
++    }
++
++        /**
++     * Boyer-Moore search method. Copied from java.util.regex.Pattern.java
++     *
++     * Pre calculates arrays needed to generate the bad character
++     * shift and the good suffix shift. Only the last seven bits
++     * are used to see if chars match; This keeps the tables small
++     * and covers the heavily used ASCII range, but occasionally
++     * results in an aliased match for the bad character shift.
++     */
++    private void compileBoundaryPattern() {
++        int i, j;
++
++        // Precalculate part of the bad character shift
++        // It is a table for where in the pattern each
++        // lower 7-bit value occurs
++        for (i = 0; i < bndbytes.length; i++) {
++            bcs[bndbytes[i]&0x7F] = i + 1;
++        }
++
++        // Precalculate the good suffix shift
++        // i is the shift amount being considered
++NEXT:   for (i = bndbytes.length; i > 0; i--) {
++            // j is the beginning index of suffix being considered
++            for (j = bndbytes.length - 1; j >= i; j--) {
++                // Testing for good suffix
++                if (bndbytes[j] == bndbytes[j-i]) {
++                    // src[j..len] is a good suffix
++                    gss[j-1] = i;
++                } else {
++                    // No match. The array has already been
++                    // filled up with correct values before.
++                    continue NEXT;
++                }
++            }
++            // This fills up the remaining of optoSft
++            // any suffix can not have larger shift amount
++            // then its sub-suffix. Why???
++            while (j > 0) {
++                gss[--j] = i;
++            }
++        }
++        // Set the guard value because of unicode compression
++        gss[bndbytes.length -1] = 1;
++    }
++
++    /**
++     * Finds the boundary in the given buffer using Boyer-Moore algo.
++     * Copied from java.util.regex.Pattern.java
++     *
++     * @param mybuf boundary to be searched in this mybuf
++     * @param off start index in mybuf
++     * @param len number of bytes in mybuf
++     *
++     * @return -1 if there is no match or index where the match starts
++     */
++    private int match(byte[] mybuf, int off, int len) {
++        int last = len - bndbytes.length;
++
++        // Loop over all possible match positions in text
++NEXT:   while (off <= last) {
++            // Loop over pattern from right to left
++            for (int j = bndbytes.length - 1; j >= 0; j--) {
++                byte ch = mybuf[off+j];
++                if (ch != bndbytes[j]) {
++                    // Shift search to the right by the maximum of the
++                    // bad character shift and the good suffix shift
++                    off += Math.max(j + 1 - bcs[ch&0x7F], gss[j]);
++                    continue NEXT;
++                }
++            }
++            // Entire pattern matched starting at off
++            return off;
++        }
++        return -1;
++    }
++
++    /**
++     * Fills the remaining buf to the full capacity
++     */
++    private void fillBuf() {
++        LOGGER.finer("Before fillBuf() buffer len="+len);
++        assert !eof;
++        while(len < buf.length) {
++            int read;
++            try {
++                read = in.read(buf, len, buf.length-len);
++            } catch(IOException ioe) {
++                throw new MIMEParsingException(ioe);
++            }
++            if (read == -1) {
++                eof = true;
++                try {
++                    LOGGER.fine("Closing the input stream.");
++                    in.close();
++                } catch(IOException ioe) {
++                    throw new MIMEParsingException(ioe);
++                }
++                break;
++            } else {
++                len += read;
++            }
++        }
++        LOGGER.finer("After fillBuf() buffer len="+len);
++    }
++
++    private void doubleBuf() {
++        byte[] temp = new byte[2*len];
++        System.arraycopy(buf, 0, temp, 0, len);
++        buf = temp;
++        if (!eof) {
++            fillBuf();
++        }
++    }
++
++    class LineInputStream {
++        private int offset;
++
++        /*
++         * Read a line containing only ASCII characters from the input
++         * stream. A line is terminated by a CR or NL or CR-NL sequence.
++         * A common error is a CR-CR-NL sequence, which will also terminate
++         * a line.
++         * The line terminator is not returned as part of the returned
++         * String. Returns null if no data is available. <p>
++         *
++         * This class is similar to the deprecated
++         * <code>DataInputStream.readLine()</code>
++         */
++        public String readLine() throws IOException {
++
++            int hdrLen = 0;
++            int lwsp = 0;
++            while(offset+hdrLen < len) {
++                if (buf[offset+hdrLen] == '\n') {
++                    lwsp = 1;
++                    break;
++                }
++                if (offset+hdrLen+1 == len) {
++                    doubleBuf();
++                }
++                if (offset+hdrLen+1 >= len) {   // No more data in the stream
++                    assert eof;
++                    return null;
++                }
++                if (buf[offset+hdrLen] == '\r' && buf[offset+hdrLen+1] == '\n') {
++                    lwsp = 2;
++                    break;
++                }
++                ++hdrLen;
++            }
++            if (hdrLen == 0) {
++                adjustBuf(offset+lwsp, len-offset-lwsp);
++                return null;
++            }
++
++            String hdr = new String(buf, offset, hdrLen);
++            offset += hdrLen+lwsp;
++            return hdr;
++        }
++
++    }
++
++}
+--- /dev/null	Thu Jul 30 19:00:00 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/mimepull/MIMEParsingException.java	Thu Jul 30 19:00:00 2009
+@@ -0,0 +1,87 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++package com.sun.xml.internal.org.jvnet.mimepull;
++
++/**
++ * @author Jitendra Kotamraju
++ */
++
++/**
++ * The <code>MIMEParsingException</code> class is the base
++ * exception class for all MIME message parsing exceptions.
++ *
++ */
++
++public class MIMEParsingException extends java.lang.RuntimeException {
++
++    /**
++     * Constructs a new exception with <code>null</code> as its
++     * detail message. The cause is not initialized.
++     */
++    public MIMEParsingException() {
++        super();
++    }
++
++    /**
++     * Constructs a new exception with the specified detail
++     * message.  The cause is not initialized.
++     *
++     * @param message The detail message which is later
++     *                retrieved using the getMessage method
++     */
++    public MIMEParsingException(String message) {
++        super(message);
++    }
++
++    /**
++     * Constructs a new exception with the specified detail
++     * message and cause.
++     *
++     * @param message The detail message which is later retrieved
++     *                using the getMessage method
++     * @param cause   The cause which is saved for the later
++     *                retrieval throw by the getCause method
++     */
++    public MIMEParsingException(String message, Throwable cause) {
++        super(message, cause);
++    }
++
++    /**
++     * Constructs a new WebServiceException with the specified cause
++     * and a detail message of <tt>(cause==null ? null :
++     * cause.toString())</tt> (which typically contains the
++     * class and detail message of <tt>cause</tt>).
++     *
++     * @param cause The cause which is saved for the later
++     *              retrieval throw by the getCause method.
++     *              (A <tt>null</tt> value is permitted, and
++     *              indicates that the cause is nonexistent or
++     *              unknown.)
++     */
++    public MIMEParsingException(Throwable cause) {
++        super(cause);
++    }
++
++}
+--- /dev/null	Thu Jul 30 19:00:04 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/mimepull/MIMEPart.java	Thu Jul 30 19:00:03 2009
+@@ -0,0 +1,206 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++package com.sun.xml.internal.org.jvnet.mimepull;
++
++import java.io.File;
++import java.io.InputStream;
++import java.nio.ByteBuffer;
++import java.util.List;
++
++/**
++ * 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
++ * application developer need not worry about these details.
++ *
++ * @author Jitendra Kotamraju
++ */
++public class MIMEPart {
++
++    private volatile InternetHeaders headers;
++    private volatile String contentId;
++    private String contentType;
++    volatile boolean parsed;    // part is parsed or not
++    final MIMEMessage msg;
++    private final DataHead dataHead;
++
++    MIMEPart(MIMEMessage msg) {
++        this.msg = msg;
++        this.dataHead = new DataHead(this);
++    }
++
++    MIMEPart(MIMEMessage msg, String contentId) {
++        this(msg);
++        this.contentId = contentId;
++    }
++
++    /**
++     * Can get the attachment part's content multiple times. That means
++     * the full content needs to be there in memory or on the file system.
++     * Calling this method would trigger parsing for the part's data. So
++     * do not call this unless it is required(otherwise, just wrap MIMEPart
++     * into a object that returns InputStream for e.g DataHandler)
++     *
++     * @return data for the part's content
++     */
++    public InputStream read() {
++        return dataHead.read();
++    }
++
++    /**
++     * Cleans up any resources that are held by this part (for e.g. deletes
++     * the temp file that is used to serve this part's content). After
++     * calling this, one shouldn't call {@link #read()} or {@link #readOnce()}
++     */
++    public void close() {
++        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
++     * on the file system or is not kept in the memory for the
++     * following case:
++     *   - Attachement parts contents are accessed sequentially
++     *
++     * In general, take advantage of this when the data is used only
++     * once.
++     *
++     * @return data for the part's content
++     */
++    public InputStream readOnce() {
++        return dataHead.readOnce();
++    }
++
++    public void moveTo(File f) {
++        dataHead.moveTo(f);
++    }
++
++    /**
++     * Returns Content-ID MIME header for this attachment part
++     *
++     * @return Content-ID of the part
++     */
++    public String getContentId() {
++        if (contentId == null) {
++            getHeaders();
++        }
++        return contentId;
++    }
++
++    /**
++     * Returns Content-Type MIME header for this attachment part
++     *
++     * @return Content-Type of the part
++     */
++    public String getContentType() {
++        if (contentType == null) {
++            getHeaders();
++        }
++        return contentType;
++    }
++
++    private void getHeaders() {
++        // Trigger parsing for the part headers
++        while(headers == null) {
++            if (!msg.makeProgress()) {
++                if (headers == null) {
++                    throw new IllegalStateException("Internal Error. Didn't get Headers even after complete parsing.");
++                }
++            }
++        }
++    }
++
++    /**
++     * Return all the values for the specified header.
++     * Returns <code>null</code> if no headers with the
++     * specified name exist.
++     *
++     * @param   name header name
++     * @return  list of header values, or null if none
++     */
++    public List<String> getHeader(String name) {
++        getHeaders();
++        assert headers != null;
++        return headers.getHeader(name);
++    }
++
++    /**
++     * Return all the headers
++     *
++     * @return list of Header objects
++     */
++    public List<? extends Header> getAllHeaders() {
++        getHeaders();
++        assert headers != null;
++        return headers.getAllHeaders();
++    }
++
++    /**
++     * Callback to set headers
++     *
++     * @param headers MIME headers for the part
++     */
++    void setHeaders(InternetHeaders headers) {
++        this.headers = headers;
++        List<String> ct = getHeader("Content-Type");
++        this.contentType = (ct == null) ? "application/octet-stream" : ct.get(0);
++    }
++
++    /**
++     * Callback to notify that there is a partial content for the part
++     *
++     * @param buf content data for the part
++     */
++    void addBody(ByteBuffer buf) {
++        dataHead.addBody(buf);
++    }
++
++    /**
++     * Callback to indicate that parsing is done for this part
++     * (no more update events for this part)
++     */
++    void doneParsing() {
++        parsed = true;
++        dataHead.doneParsing();
++    }
++
++    /**
++     * Callback to set Content-ID for this part
++     * @param cid Content-ID of the part
++     */
++    void setContentId(String cid) {
++        this.contentId = cid;
++    }
++
++    @Override
++    public String toString() {
++        return "Part="+contentId;
++    }
++
++}
+--- /dev/null	Thu Jul 30 19:00:07 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/mimepull/MemoryData.java	Thu Jul 30 19:00:06 2009
+@@ -0,0 +1,96 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++package com.sun.xml.internal.org.jvnet.mimepull;
++
++import java.nio.ByteBuffer;
++import java.io.File;
++import java.io.IOException;
++import java.util.logging.Logger;
++
++/**
++ * Keeps the Part's partial content data in memory.
++ *
++ * @author Kohsuke Kawaguchi
++ * @author Jitendra Kotamraju
++ */
++final class MemoryData implements Data {
++    private static final Logger LOGGER = Logger.getLogger(MemoryData.class.getName());
++
++    private final byte[] data;
++    private final int len;
++    private final MIMEConfig config;
++
++    MemoryData(ByteBuffer buf, MIMEConfig config) {
++        data = buf.array();
++        len = buf.limit();
++        this.config = config;
++    }
++
++    // size of the chunk given by the parser
++    public int size() {
++        return len;
++    }
++
++    public byte[] read() {
++        return data;
++    }
++
++    public long writeTo(DataFile file) {
++        return file.writeTo(data, 0, len);
++    }
++
++    /**
++     *
++     * @param dataHead
++     * @param buf
++     * @return
++     */
++    public Data createNext(DataHead dataHead, ByteBuffer buf) {
++        if (!config.isOnlyMemory() && dataHead.inMemory >= config.memoryThreshold) {
++            try {
++                String prefix = config.getTempFilePrefix();
++                String suffix = config.getTempFileSuffix();
++                File dir = config.getTempDir();
++                File tempFile = (dir == null)
++                        ? File.createTempFile(prefix, suffix)
++                        : File.createTempFile(prefix, suffix, dir);
++                LOGGER.fine("Created temp file = "+tempFile);
++                dataHead.dataFile = new DataFile(tempFile);
++            } catch(IOException ioe) {
++                throw new MIMEParsingException(ioe);
++            }
++
++            if (dataHead.head != null) {
++                for(Chunk c=dataHead.head; c != null; c=c.next) {
++                    long pointer = c.data.writeTo(dataHead.dataFile);
++                    c.data = new FileData(dataHead.dataFile, pointer, len);
++                }
++            }
++            return new FileData(dataHead.dataFile, buf);
++        } else {
++            return new MemoryData(buf, config);
++        }
++    }
++}
+--- /dev/null	Thu Jul 30 19:00:10 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/mimepull/WeakDataFile.java	Thu Jul 30 19:00:09 2009
+@@ -0,0 +1,116 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++package com.sun.xml.internal.org.jvnet.mimepull;
++
++import java.io.File;
++import java.io.IOException;
++import java.io.RandomAccessFile;
++import java.lang.ref.ReferenceQueue;
++import java.lang.ref.WeakReference;
++import java.util.ArrayList;
++import java.util.List;
++import java.util.logging.Logger;
++
++/**
++ * Removing files based on this
++ * <a href="http://java.sun.com/developer/technicalArticles/javase/finalization/">article</a>
++ *
++ * @author Jitendra Kotamraju
++ */
++final class WeakDataFile extends WeakReference<DataFile> {
++
++    private static final Logger LOGGER = Logger.getLogger(WeakDataFile.class.getName());
++    private static final int MAX_ITERATIONS = 2;
++    private static ReferenceQueue<DataFile> refQueue = new ReferenceQueue<DataFile>();
++    private static List<WeakDataFile> refList = new ArrayList<WeakDataFile>();
++    private final File file;
++    private final RandomAccessFile raf;
++
++    WeakDataFile(DataFile df, File file) {
++        super(df, refQueue);
++        refList.add(this);
++        this.file = file;
++        try {
++            raf = new RandomAccessFile(file, "rw");
++        } catch(IOException ioe) {
++            throw new MIMEParsingException(ioe);
++        }
++        drainRefQueueBounded();
++    }
++
++    synchronized void read(long pointer, byte[] buf, int offset, int length ) {
++        try {
++            raf.seek(pointer);
++            raf.readFully(buf, offset, length);
++        } catch(IOException ioe) {
++            throw new MIMEParsingException(ioe);
++        }
++    }
++
++    synchronized long writeTo(long pointer, byte[] data, int offset, int length) {
++        try {
++            raf.seek(pointer);
++            raf.write(data, offset, length);
++            return raf.getFilePointer();    // Update pointer for next write
++        } catch(IOException ioe) {
++            throw new MIMEParsingException(ioe);
++        }
++    }
++
++    void close() {
++        LOGGER.fine("Deleting file = "+file.getName());
++        refList.remove(this);
++        try {
++            raf.close();
++            file.delete();
++        } catch(IOException ioe) {
++            throw new MIMEParsingException(ioe);
++        }
++    }
++
++    void renameTo(File f) {
++        LOGGER.fine("Moving file="+file+" to="+f);
++        refList.remove(this);
++        try {
++            raf.close();
++            file.renameTo(f);
++        } catch(IOException ioe) {
++            throw new MIMEParsingException(ioe);
++        }
++
++    }
++
++    static void drainRefQueueBounded() {
++        int iterations = 0;
++        WeakDataFile weak = (WeakDataFile) refQueue.poll();
++        while (weak != null && iterations < MAX_ITERATIONS) {
++            LOGGER.fine("Cleaning file = "+weak.file+" from reference queue.");
++            weak.close();
++            ++iterations;
++            weak = (WeakDataFile) refQueue.poll();
++        }
++    }
++
++}
+--- /dev/null	Thu Jul 30 19:00:13 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/org/jvnet/staxex/StreamingDataHandler.java	Thu Jul 30 19:00:13 2009
+@@ -0,0 +1,143 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++package com.sun.xml.internal.org.jvnet.staxex;
++
++import javax.activation.DataHandler;
++import javax.activation.DataSource;
++import java.io.BufferedInputStream;
++import java.io.File;
++import java.io.IOException;
++import java.io.InputStream;
++import java.net.URL;
++
++/**
++ * {@link DataHandler} extended to offer better buffer management
++ * in a streaming environment.
++ *
++ * <p>
++ * {@link DataHandler} is used commonly as a data format across
++ * multiple systems (such as JAXB/WS.) Unfortunately, {@link DataHandler}
++ * has the semantics of "read as many times as you want", so this makes
++ * it difficult for involving parties to handle a BLOB in a streaming fashion.
++ *
++ * <p>
++ * {@link StreamingDataHandler} solves this problem by offering methods
++ * that enable faster bulk "consume once" read operation.
++ *
++ * @author Jitendra Kotamraju
++ */
++public abstract class StreamingDataHandler extends DataHandler {
++
++    public StreamingDataHandler(Object o, String s) {
++        super(o, s);
++    }
++
++    public StreamingDataHandler(URL url) {
++        super(url);
++    }
++
++    public StreamingDataHandler(DataSource dataSource) {
++        super(dataSource);
++    }
++
++    /**
++     * Works like {@link #getInputStream()} except that this method
++     * can be invoked only once.
++     *
++     * <p>
++     * This is used as a signal from the caller that there will
++     * be no further {@link #getInputStream()} invocation nor
++     * {@link #readOnce()} invocation on this object (which would
++     * result in {@link IOException}.)
++     *
++     * <p>
++     * When {@link DataHandler} is backed by a streaming BLOB
++     * (such as an attachment in a web service read from the network),
++     * this allows the callee to avoid unnecessary buffering.
++     *
++     * <p>
++     * Note that it is legal to call {@link #getInputStream()}
++     * multiple times and then call {@link #readOnce()} afterward.
++     * Streams created such a way can be read in any order &mdash;
++     * there's no requirement that streams created earlier must be read
++     * first.
++     *
++     * @return
++     *      always non-null. Represents the content of this BLOB.
++     *      The returned stream is generally not buffered, so for
++     *      better performance read in a big batch or wrap this into
++     *      {@link BufferedInputStream}.
++     * @throws IOException
++     *      if any i/o error
++     */
++    public abstract InputStream readOnce() throws IOException;
++
++    /**
++     * Obtains the BLOB into a specified file.
++     *
++     * <p>
++     * Semantically, this method is roughly equivalent to the following
++     * code, except that the actual implementation is likely to be a lot faster.
++     *
++     * <pre>
++     * InputStream i = getInputStream();
++     * OutputStream o = new FileOutputStream(dst);
++     * int ch;
++     * while((ch=i.read())!=-1)  o.write(ch);
++     * i.close();
++     * o.close();
++     * </pre>
++     *
++     * <p>
++     * The main motivation behind this method is that often
++     * {@link DataHandler} that reads data from a streaming source
++     * will use a temporary file as a data store to hold data
++     * (think of commons-fileupload.) In such case this method
++     * can be as fast as calling {@link File#renameTo(File)}.
++     *
++     * <p>
++     * This method shouldn't be called when there are any
++     * open streams.
++     *
++     * <p>
++     * After this method is invoked, {@link #readOnce()} and
++     * {@link #getInputStream()} will simply open the destination
++     * file you've specified as an argument. So if you further
++     * move the file or delete this file, those methods will
++     * behave in undefined fashion. For a simliar reason,
++     * calling this method multiple times will cause
++     * undefined behavior.
++     */
++    public abstract void moveTo(File dst) throws IOException;
++
++    /**
++     * Releases any resources associated with this DataHandler.
++     * (such as an attachment in a web service read from a temp
++     * file will be deleted.) After calling this method, it is
++     * illegal to call any other methods.
++     */
++    public abstract void close() throws IOException;
++
++}
+--- /dev/null	Thu Jul 30 19:00:17 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/txw2/output/TXWResult.java	Thu Jul 30 19:00:16 2009
+@@ -0,0 +1,65 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++package com.sun.xml.internal.txw2.output;
++
++import com.sun.xml.internal.txw2.TypedXmlWriter;
++
++import javax.xml.transform.Result;
++
++/**
++ * Allow you to wrap {@link TypedXmlWriter} into a {@link Result}
++ * so that it can be passed to {@link ResultFactory}.
++ *
++ * <p>
++ * This class doesn't extend from known {@link Result} type,
++ * so it won't work elsewhere.
++ *
++ * @author Kohsuke Kawaguchi
++ */
++public class TXWResult implements Result {
++    private String systemId;
++
++    private TypedXmlWriter writer;
++
++    public TXWResult(TypedXmlWriter writer) {
++        this.writer = writer;
++    }
++
++    public TypedXmlWriter getWriter() {
++        return writer;
++    }
++
++    public void setWriter(TypedXmlWriter writer) {
++        this.writer = writer;
++    }
++
++    public String getSystemId() {
++        return systemId;
++    }
++
++    public void setSystemId(String systemId) {
++        this.systemId = systemId;
++    }
++}
+--- /dev/null	Thu Jul 30 19:00:20 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/txw2/output/TXWSerializer.java	Thu Jul 30 19:00:19 2009
+@@ -0,0 +1,86 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++package com.sun.xml.internal.txw2.output;
++
++import com.sun.xml.internal.txw2.TypedXmlWriter;
++import com.sun.xml.internal.txw2.TXW;
++
++/**
++ * Dummpy implementation to pass through {@link TypedXmlWriter}
++ * to {@link TXW}
++ *
++ * @author Kohsuke Kawaguchi
++ */
++public final class TXWSerializer implements XmlSerializer {
++    public final TypedXmlWriter txw;
++
++    public TXWSerializer(TypedXmlWriter txw) {
++        this.txw = txw;
++    }
++
++    public void startDocument() {
++        throw new UnsupportedOperationException();
++    }
++
++    public void endDocument() {
++        throw new UnsupportedOperationException();
++    }
++
++    public void beginStartTag(String uri, String localName, String prefix) {
++        throw new UnsupportedOperationException();
++    }
++
++    public void writeAttribute(String uri, String localName, String prefix, StringBuilder value) {
++        throw new UnsupportedOperationException();
++    }
++
++    public void writeXmlns(String prefix, String uri) {
++        throw new UnsupportedOperationException();
++    }
++
++    public void endStartTag(String uri, String localName, String prefix) {
++        throw new UnsupportedOperationException();
++    }
++
++    public void endTag() {
++        throw new UnsupportedOperationException();
++    }
++
++    public void text(StringBuilder text) {
++        throw new UnsupportedOperationException();
++    }
++
++    public void cdata(StringBuilder text) {
++        throw new UnsupportedOperationException();
++    }
++
++    public void comment(StringBuilder comment) {
++        throw new UnsupportedOperationException();
++    }
++
++    public void flush() {
++        throw new UnsupportedOperationException();
++    }
++}
+--- /dev/null	Thu Jul 30 19:00:23 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/addressing/W3CWsaClientTube.java	Thu Jul 30 19:00:22 2009
+@@ -0,0 +1,69 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++
++package com.sun.xml.internal.ws.addressing;
++
++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.Packet;
++import com.sun.xml.internal.ws.api.pipe.Tube;
++import com.sun.xml.internal.ws.api.pipe.TubeCloner;
++import com.sun.xml.internal.ws.addressing.model.MissingAddressingHeaderException;
++
++/**
++ * @author Rama Pulavarthi
++ */
++public class W3CWsaClientTube extends WsaClientTube {
++    public W3CWsaClientTube(WSDLPort wsdlPort, WSBinding binding, Tube next) {
++        super(wsdlPort, binding, next);
++    }
++
++    public W3CWsaClientTube(WsaClientTube that, TubeCloner cloner) {
++        super(that, cloner);
++    }
++
++    public W3CWsaClientTube copy(TubeCloner cloner) {
++        return new W3CWsaClientTube(this, cloner);
++    }
++
++    @Override
++    protected void checkMandatoryHeaders(Packet packet, boolean foundAction, boolean foundTo, boolean foundReplyTo,
++                                         boolean foundFaultTo, boolean foundMessageID, boolean foundRelatesTo) {
++        super.checkMandatoryHeaders(packet, foundAction, foundTo, foundReplyTo, foundFaultTo, foundMessageID, foundRelatesTo);
++
++        // if it is not one-way, response must contain wsa:RelatesTo
++        // 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);
++            // 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())) {
++                throw new MissingAddressingHeaderException(addressingVersion.relatesToTag,packet);
++            }
++        }
++
++    }
++}
+--- /dev/null	Thu Jul 30 19:00:26 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/addressing/W3CWsaServerTube.java	Thu Jul 30 19:00:25 2009
+@@ -0,0 +1,76 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++package com.sun.xml.internal.ws.addressing;
++
++import com.sun.xml.internal.ws.api.server.WSEndpoint;
++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.WSBinding;
++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;
++import com.sun.xml.internal.ws.addressing.model.MissingAddressingHeaderException;
++import com.sun.istack.internal.NotNull;
++
++/**
++ * @author Rama Pulavarthi
++ */
++public class W3CWsaServerTube extends WsaServerTube{
++    public W3CWsaServerTube(WSEndpoint endpoint, @NotNull WSDLPort wsdlPort, WSBinding binding, Tube next) {
++        super(endpoint, wsdlPort, binding, next);
++    }
++
++    public W3CWsaServerTube(WsaServerTube that, TubeCloner cloner) {
++        super(that, cloner);
++    }
++
++    protected Packet validateInboundHeaders(Packet packet) {
++        return super.validateInboundHeaders(packet);
++    }
++
++    public W3CWsaServerTube copy(TubeCloner cloner) {
++        return new W3CWsaServerTube(this, cloner);
++    }
++
++    @Override
++    protected void checkMandatoryHeaders(
++            Packet packet, boolean foundAction, boolean foundTo, boolean foundReplyTo,
++            boolean foundFaultTo, boolean foundMessageId, boolean foundRelatesTo) {
++        super.checkMandatoryHeaders(packet, foundAction, foundTo, foundReplyTo,
++                foundFaultTo, foundMessageId, foundRelatesTo);
++
++        // find Req/Response or Oneway using WSDLModel(if it is availabe)
++        WSDLBoundOperation wbo = getWSDLBoundOperation(packet);
++        // Taking care of protocol messages as they do not have any corresponding operations
++        if (wbo != null) {
++            // if two-way and no wsa:MessageID is found
++            if (!wbo.getOperation().isOneWay() && !foundMessageId) {
++                throw new MissingAddressingHeaderException(addressingVersion.messageIDTag,packet);
++            }
++        }
++
++    }
++
++}
+--- /dev/null	Thu Jul 30 19:00:29 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/addressing/WsaPropertyBag.java	Thu Jul 30 19:00:28 2009
+@@ -0,0 +1,126 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++package com.sun.xml.internal.ws.addressing;
++
++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.Header;
++import com.sun.xml.internal.ws.api.message.Message;
++import com.sun.xml.internal.ws.api.message.Packet;
++import com.sun.xml.internal.ws.developer.JAXWSProperties;
++
++import javax.xml.namespace.QName;
++import javax.xml.stream.XMLStreamException;
++
++/**
++ * Provides access to the Addressing headers.
++ *
++ * @author Kohsuke Kawaguchi
++ * @author Rama Pulavarthi
++ * @since 2.1.3
++ */
++public class WsaPropertyBag extends PropertySet {
++    private final @NotNull AddressingVersion addressingVersion;
++    private final @NotNull SOAPVersion soapVersion;
++    /**
++     * We can't store {@link Message} here as those may get replaced as
++     * the packet travels through the pipeline.
++     */
++    private final @NotNull Packet packet;
++
++
++    WsaPropertyBag(AddressingVersion addressingVersion, SOAPVersion soapVersion, Packet packet) {
++        this.addressingVersion = addressingVersion;
++        this.soapVersion = soapVersion;
++        this.packet = packet;
++    }
++
++    /**
++     * Gets the <tt>wsa:To</tt> header.
++     *
++     * @return
++     *      null if the incoming SOAP message didn't have the header.
++     */
++    @Property(JAXWSProperties.ADDRESSING_TO)
++    public String getTo() throws XMLStreamException {
++        Header h = packet.getMessage().getHeaders().get(addressingVersion.toTag, false);
++        if (h == null) return null;
++        return h.getStringContent();
++    }
++
++    /**
++     * Gets the <tt>wsa:From</tt> header.
++     *
++     * @return
++     *      null if the incoming SOAP message didn't have the header.
++     */
++    @Property(JAXWSProperties.ADDRESSING_FROM)
++    public WSEndpointReference getFrom() throws XMLStreamException {
++        return getEPR(addressingVersion.fromTag);
++    }
++
++    /**
++     * Gets the <tt>wsa:Action</tt> header content as String.
++     *
++     * @return
++     *      null if the incoming SOAP message didn't have the header.
++     */
++    @Property(JAXWSProperties.ADDRESSING_ACTION)
++    public String getAction() {
++        Header h = packet.getMessage().getHeaders().get(addressingVersion.actionTag, false);
++        if(h==null) return null;
++        return h.getStringContent();
++    }
++
++    /**
++     * Gets the <tt>wsa:MessageID</tt> header content as String.
++     *
++     * @return
++     *      null if the incoming SOAP message didn't have the header.
++     */
++    // WsaServerTube.REQUEST_MESSAGE_ID is exposed for backward compatibility with 2.1
++    @Property({JAXWSProperties.ADDRESSING_MESSAGEID,WsaServerTube.REQUEST_MESSAGE_ID})
++    public String getMessageID() {
++        return packet.getMessage().getHeaders().getMessageID(addressingVersion,soapVersion);
++    }
++
++    private WSEndpointReference getEPR(QName tag) throws XMLStreamException {
++        Header h = packet.getMessage().getHeaders().get(tag, false);
++        if(h==null) return null;
++        return h.readAsEPR(addressingVersion);
++    }
++
++    protected PropertyMap getPropertyMap() {
++        return model;
++    }
++
++    private static final PropertyMap model;
++    static {
++        model = parse(WsaPropertyBag.class);
++    }
++}
+--- /dev/null	Thu Jul 30 19:00:33 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/addressing/model/InvalidAddressingHeaderException.java	Thu Jul 30 19:00:32 2009
+@@ -0,0 +1,64 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++
++package com.sun.xml.internal.ws.addressing.model;
++
++import com.sun.xml.internal.ws.resources.AddressingMessages;
++
++import javax.xml.ws.WebServiceException;
++import javax.xml.namespace.QName;
++
++/**
++ * This exception captures SOAP Fault information when a WS-Addressing 1.0 Message Addressing
++ * Property is invalid and cannot be processed.
++ *
++ * @author Rama Pulavarthi
++ */
++public class InvalidAddressingHeaderException extends WebServiceException {
++    private QName problemHeader;
++    private QName subsubcode;
++
++    /**
++     * Creates a InvalidAddressingHeader exception capturing information about the invalid
++     * Addressing Message Property and the reason in Subsubcode.
++     * @param problemHeader
++     *      represents the invalid Addressing Header.
++     * @param subsubcode
++     *      represents the reason why the Addressing header in question is invalid.
++     */
++    public InvalidAddressingHeaderException(QName problemHeader, QName subsubcode) {
++        super(AddressingMessages.INVALID_ADDRESSING_HEADER_EXCEPTION(problemHeader,subsubcode));
++        this.problemHeader = problemHeader;
++        this.subsubcode = subsubcode;
++    }
++
++    public QName getProblemHeader() {
++        return problemHeader;
++    }
++
++    public QName getSubsubcode() {
++        return subsubcode;
++    }
++}
+--- /dev/null	Thu Jul 30 19:00:36 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/addressing/model/MissingAddressingHeaderException.java	Thu Jul 30 19:00:35 2009
+@@ -0,0 +1,78 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++
++package com.sun.xml.internal.ws.addressing.model;
++
++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.resources.AddressingMessages;
++
++import javax.xml.ws.WebServiceException;
++import javax.xml.namespace.QName;
++
++/**
++ * This exception signals that a particular WS-Addressing header is missing in a SOAP message.
++ *
++ * @author Rama Pulavarthi
++ */
++public class MissingAddressingHeaderException extends WebServiceException {
++    private final QName name;
++    private final Packet packet;
++
++    /**
++     *
++     * @param name QName of the missing WS-Addressing Header
++     */
++    public MissingAddressingHeaderException(@NotNull QName name) {
++        this(name,null);
++    }
++
++    public MissingAddressingHeaderException(@NotNull QName name, @Nullable Packet p) {
++        super(AddressingMessages.MISSING_HEADER_EXCEPTION(name));
++        this.name = name;
++        this.packet = p;
++    }
++
++    /**
++     * Gets the QName of the missing WS-Addressing Header.
++     *
++     * @return
++     *      never null.
++     */
++    public QName getMissingHeaderQName() {
++        return name;
++    }
++
++    /**
++     * The {@link Packet} in which a header was missing.
++     *
++     * <p>
++     * This object can be used to deep-inspect the problematic SOAP message.
++     */
++    public Packet getPacket() {
++        return packet;
++    }
++}
+--- /dev/null	Thu Jul 30 19:00:39 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/addressing/v200408/MemberSubmissionWsaClientTube.java	Thu Jul 30 19:00:38 2009
+@@ -0,0 +1,84 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++
++package com.sun.xml.internal.ws.addressing.v200408;
++
++import com.sun.xml.internal.ws.addressing.WsaClientTube;
++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.Packet;
++import com.sun.xml.internal.ws.api.pipe.Tube;
++import com.sun.xml.internal.ws.api.pipe.TubeCloner;
++import com.sun.xml.internal.ws.developer.MemberSubmissionAddressing;
++import com.sun.xml.internal.ws.developer.MemberSubmissionAddressingFeature;
++
++/**
++ * @author Rama Pulavarthi
++ */
++public class MemberSubmissionWsaClientTube extends WsaClientTube {
++    private final MemberSubmissionAddressing.Validation validation;
++
++    public MemberSubmissionWsaClientTube(WSDLPort wsdlPort, WSBinding binding, Tube next) {
++        super(wsdlPort, binding, next);
++        validation = binding.getFeature(MemberSubmissionAddressingFeature.class).getValidation();
++
++    }
++
++    public MemberSubmissionWsaClientTube(MemberSubmissionWsaClientTube that, TubeCloner cloner) {
++        super(that, cloner);
++        this.validation = that.validation;
++
++    }
++    public MemberSubmissionWsaClientTube copy(TubeCloner cloner) {
++        return new MemberSubmissionWsaClientTube(this, cloner);
++    }
++
++    @Override
++    protected void checkMandatoryHeaders(Packet packet, boolean foundAction, boolean foundTo, boolean foundReplyTo,
++                                         boolean foundFaultTo, boolean foundMessageID, boolean foundRelatesTo) {
++        super.checkMandatoryHeaders(packet,foundAction,foundTo,foundReplyTo,foundFaultTo,foundMessageID,foundRelatesTo);
++
++        // if no wsa:To header is found
++        if (!foundTo) {
++            throw new MissingAddressingHeaderException(addressingVersion.toTag,packet);
++        }
++
++        if (!validation.equals(MemberSubmissionAddressing.Validation.LAX)) {
++
++            // if it is not one-way, response must contain wsa:RelatesTo
++            // 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);
++                // 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())) {
++                    throw new MissingAddressingHeaderException(addressingVersion.relatesToTag,packet);
++                }
++            }
++        }
++    }
++}
+--- /dev/null	Thu Jul 30 19:00:42 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/addressing/v200408/MemberSubmissionWsaServerTube.java	Thu Jul 30 19:00:41 2009
+@@ -0,0 +1,87 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++
++package com.sun.xml.internal.ws.addressing.v200408;
++
++import com.sun.istack.internal.NotNull;
++import com.sun.xml.internal.ws.addressing.WsaServerTube;
++import com.sun.xml.internal.ws.addressing.model.MissingAddressingHeaderException;
++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.wsdl.WSDLBoundOperation;
++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.pipe.TubeCloner;
++import com.sun.xml.internal.ws.api.server.WSEndpoint;
++import com.sun.xml.internal.ws.developer.MemberSubmissionAddressing;
++import com.sun.xml.internal.ws.developer.MemberSubmissionAddressingFeature;
++
++/**
++ * @author Rama Pulavarthi
++ */
++public class MemberSubmissionWsaServerTube extends WsaServerTube {
++    private final MemberSubmissionAddressing.Validation validation;
++    public MemberSubmissionWsaServerTube(WSEndpoint endpoint, @NotNull WSDLPort wsdlPort, WSBinding binding, Tube next) {
++        super(endpoint, wsdlPort, binding, next);
++        validation = binding.getFeature(MemberSubmissionAddressingFeature.class).getValidation();
++    }
++
++    public MemberSubmissionWsaServerTube(MemberSubmissionWsaServerTube that, TubeCloner cloner) {
++        super(that, cloner);
++        this.validation = that.validation;
++    }
++
++    public MemberSubmissionWsaServerTube copy(TubeCloner cloner) {
++        return new MemberSubmissionWsaServerTube(this, cloner);
++    }
++
++    @Override
++    protected void checkMandatoryHeaders(Packet packet, boolean foundAction, boolean foundTo, boolean foundReplyTo,
++            boolean foundFaultTo, boolean foundMessageId, boolean foundRelatesTo) {
++
++        super.checkMandatoryHeaders(packet, foundAction, foundTo, foundReplyTo,
++                foundFaultTo, foundMessageId, foundRelatesTo);
++
++        // if no wsa:To header is found
++        if (!foundTo)
++            throw new MissingAddressingHeaderException(addressingVersion.toTag,packet);
++
++        //we can find Req/Response or Oneway only with WSDLModel
++        if (wsdlPort != null) {
++            WSDLBoundOperation wbo = getWSDLBoundOperation(packet);
++            // if two-way, must contain wsa:ReplyTo
++            // Unlike W3C version, we cannot assume default value as anonymous if not present.
++            // For protocol messages, don't check as they do not have any corresponding wsdl operations
++            if (wbo != null && !wbo.getOperation().isOneWay() && !foundReplyTo) {
++                throw new MissingAddressingHeaderException(addressingVersion.replyToTag,packet);
++            }
++        }
++        if (!validation.equals(MemberSubmissionAddressing.Validation.LAX)) {
++            // wsa:MessageId is required if wsa:ReplyTo is present.
++            if ((foundReplyTo || foundFaultTo) && !foundMessageId)
++                throw new MissingAddressingHeaderException(addressingVersion.messageIDTag,packet);
++        }
++    }
++}
+--- /dev/null	Thu Jul 30 19:00:45 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/api/ResourceLoader.java	Thu Jul 30 19:00:45 2009
+@@ -0,0 +1,67 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++package com.sun.xml.internal.ws.api;
++
++import com.sun.xml.internal.ws.api.server.Container;
++
++import java.net.MalformedURLException;
++import java.net.URL;
++
++/**
++ * Used to locate resources for jax-ws extensions. Using this, extensions
++ * do not to have to write container specific code to locate resources.
++ *
++ * @author Jitendra Kotamraju
++ */
++public abstract class ResourceLoader {
++
++    /**
++     * Returns the actual location of the resource from the 'resource' arg
++     * that represents a virtual locaion of a file understood by a container.
++     * ResourceLoader impl for a Container knows how to map this
++     * virtual location to actual location.
++     * <p>
++     * Extensions can get hold of this object using {@link Container}.
++     * <p/>
++     * for e.g.:
++     * <pre>
++     * ResourceLoader loader = container.getSPI(ResourceLoader.class);
++     * URL catalog = loader.get("jax-ws-catalog.xml");
++     * </pre>
++     * A ResourceLoader for servlet environment, may do the following.
++     * <pre>
++     * URL getResource(String resource) {
++     *     return servletContext.getResource("/WEB-INF/"+resource);
++     * }
++     * </pre>
++     *
++     * @param resource Designates a path that is understood by the container. The
++     *             implementations must support "jax-ws-catalog.xml" resource.
++     * @return the actual location, if found, or null if not found.
++     * @throws MalformedURLException if there is an error in creating URL
++     */
++    public abstract URL getResource(String resource) throws MalformedURLException;
++
++}
+--- /dev/null	Thu Jul 30 19:00:49 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/api/handler/MessageHandler.java	Thu Jul 30 19:00:48 2009
+@@ -0,0 +1,54 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++package com.sun.xml.internal.ws.api.handler;
++
++import javax.xml.ws.handler.Handler;
++import javax.xml.namespace.QName;
++import java.util.Set;
++
++
++/**
++ * The <code>MessageHandler</code> class extends <code>Handler</code>
++ * to provide typesafety for the message context parameter and add a method
++ * to obtain access to the headers that may be processed by the handler.
++ * Its provides similar functionality as a SOAPHandler but provides RI's
++ * Message in the MessageContext.
++ *
++ * @author Rama Pulavarthi
++ * @since JAX-WS 2.1.3
++ */
++public interface MessageHandler<C extends MessageHandlerContext> extends Handler<C> {
++
++
++   /** Gets the header blocks that can be processed by this Handler
++   *  instance.
++   *
++   *  @return Set of <code>QNames</code> of header blocks processed by this
++   *           handler instance. <code>QName</code> is the qualified
++   *           name of the outermost element of the Header block.
++  **/
++  Set<QName> getHeaders();
++
++}
+--- /dev/null	Thu Jul 30 19:00:52 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/api/handler/MessageHandlerContext.java	Thu Jul 30 19:00:51 2009
+@@ -0,0 +1,88 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++package com.sun.xml.internal.ws.api.handler;
++
++import com.sun.istack.internal.Nullable;
++import com.sun.xml.internal.ws.api.WSBinding;
++import com.sun.xml.internal.ws.api.message.Message;
++import com.sun.xml.internal.ws.api.model.SEIModel;
++import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort;
++
++import javax.xml.ws.handler.MessageContext;
++import java.util.Set;
++
++/**
++ * The <code>MessageHandlerContext</code> interface extends
++ * <code>MessageContext</code> to provide easy access to the contained message.
++ *
++ * This context provides access to RI's <code>Message</code> model for efficient access
++ * to various things like accessing headers etc. It also provides access to
++ * binding information as <code>WSBinding</code>.
++ *
++ * @author Rama Pulavarthi
++ * @since JAX-WS 2.1.3
++ */
++public interface MessageHandlerContext extends MessageContext {
++    /**
++     * Gets the message from this message context
++     *
++     * @return The contained message; returns <code>null</code> if no
++     *         message is present in this message context
++     */
++    public Message getMessage();
++
++
++    /**
++     * Sets the message in this message context
++     */
++    public void setMessage(Message message);
++
++    /**
++     * @see javax.xml.ws.handler.soap.SOAPMessageContext#getRoles()
++     */
++     public Set<String> getRoles();
++
++
++    /**
++     * Provides access to <code>WSBinding</code> which can be used in various ways.
++     * for example: <code>WSBinding#getSOAPVersion</code> to get SOAP version of the binding.
++     *              <code>WSBinding#isFeatureEnabled(AddressingFeature)</code> to check if addressing is enabled
++     */
++    public WSBinding getWSBinding();
++
++    /**
++     * Provides access to <code>SEIModel</code>.
++     */
++    public @Nullable SEIModel getSEIModel();
++
++    /**
++     * Gets the {@link WSDLPort} that represents the port.
++     * @return
++     *      returns the WSDLModel of the port that the client/endpoint binds to.
++     *      null when the Service is not configured with WSDL information.
++     */
++    public @Nullable WSDLPort getPort();
++
++}
+--- /dev/null	Thu Jul 30 19:00:55 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/api/message/FilterMessageImpl.java	Thu Jul 30 19:00:54 2009
+@@ -0,0 +1,164 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++package com.sun.xml.internal.ws.api.message;
++
++import com.sun.istack.internal.NotNull;
++import com.sun.istack.internal.Nullable;
++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.addressing.AddressingVersion;
++import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort;
++import org.xml.sax.ContentHandler;
++import org.xml.sax.ErrorHandler;
++import org.xml.sax.SAXException;
++
++import javax.xml.bind.JAXBException;
++import javax.xml.bind.Unmarshaller;
++import javax.xml.namespace.QName;
++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;
++import javax.xml.transform.Source;
++
++/**
++ * A <code>FilterMessageImpl</code> contains some other Message, which it uses
++ * as its  basic source of message data, possibly transforming the data along
++ * the way or providing  additional functionality.
++ *
++ * <p>
++ * The class <code>FilterMessageImpl</code> itself simply overrides
++ * all the methods of <code>Message</code> and invokes them on
++ * contained Message delegate. Subclasses of <code>FilterMessageImpl</code>
++ * may further override some of  these methods and may also provide
++ * additional methods and fields.
++ *
++ * @author Jitendra Kotamraju
++ */
++public class FilterMessageImpl extends Message {
++    private final Message delegate;
++
++    protected FilterMessageImpl(Message delegate) {
++        this.delegate = delegate;
++    }
++
++    public boolean hasHeaders() {
++        return delegate.hasHeaders();
++    }
++
++    public @NotNull HeaderList getHeaders() {
++        return delegate.getHeaders();
++    }
++
++    public @NotNull AttachmentSet getAttachments() {
++        return delegate.getAttachments();
++    }
++
++    protected boolean hasAttachments() {
++        return delegate.hasAttachments();
++    }
++
++    public boolean isOneWay(@NotNull WSDLPort port) {
++        return delegate.isOneWay(port);
++    }
++
++    public @Nullable String getPayloadLocalPart() {
++        return delegate.getPayloadLocalPart();
++    }
++
++    public String getPayloadNamespaceURI() {
++        return delegate.getPayloadNamespaceURI();
++    }
++
++    public boolean hasPayload() {
++        return delegate.hasPayload();
++    }
++
++    public boolean isFault() {
++        return delegate.isFault();
++    }
++
++    public @Nullable QName getFirstDetailEntryName() {
++        return delegate.getFirstDetailEntryName();
++    }
++
++    public Source readEnvelopeAsSource() {
++        return delegate.readEnvelopeAsSource();
++    }
++
++    public Source readPayloadAsSource() {
++        return delegate.readPayloadAsSource();
++    }
++
++    public SOAPMessage readAsSOAPMessage() throws SOAPException {
++        return delegate.readAsSOAPMessage();
++    }
++
++    public SOAPMessage readAsSOAPMessage(Packet packet, boolean inbound) throws SOAPException {
++        return delegate.readAsSOAPMessage(packet, inbound);
++    }
++
++    public <T> T readPayloadAsJAXB(Unmarshaller unmarshaller) throws JAXBException {
++        return (T)delegate.readPayloadAsJAXB(unmarshaller);
++    }
++
++    public <T> T readPayloadAsJAXB(Bridge<T> bridge) throws JAXBException {
++        return delegate.readPayloadAsJAXB(bridge);
++    }
++
++    public XMLStreamReader readPayload() throws XMLStreamException {
++        return delegate.readPayload();
++    }
++
++    public void consume() {
++        delegate.consume();
++    }
++
++    public void writePayloadTo(XMLStreamWriter sw) throws XMLStreamException {
++        delegate.writePayloadTo(sw);
++    }
++
++    public void writeTo(XMLStreamWriter sw) throws XMLStreamException {
++        delegate.writeTo(sw);
++    }
++
++    public void writeTo(ContentHandler contentHandler, ErrorHandler errorHandler) throws SAXException {
++        delegate.writeTo(contentHandler, errorHandler);
++    }
++
++    public Message copy() {
++        return delegate.copy();
++    }
++
++    public @NotNull String getID(@NotNull WSBinding binding) {
++        return delegate.getID(binding);
++    }
++
++    public @NotNull String getID(AddressingVersion av, SOAPVersion sv) {
++        return delegate.getID(av, sv);
++    }
++}
+--- /dev/null	Thu Jul 30 19:00:58 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/api/model/wsdl/WSDLBoundFault.java	Thu Jul 30 19:00:57 2009
+@@ -0,0 +1,73 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++
++package com.sun.xml.internal.ws.api.model.wsdl;
++
++import com.sun.istack.internal.NotNull;
++import com.sun.istack.internal.Nullable;
++
++import javax.xml.namespace.QName;
++
++/**
++ * Abstracts wsdl:binding/wsdl:operation/wsdl:fault
++ *
++ * @author Vivek Pandey
++ */
++public interface WSDLBoundFault extends WSDLObject, WSDLExtensible {
++
++    /**
++     * Gives the wsdl:binding/wsdl:operation/wsdl:fault@name value
++     */
++    public
++    @NotNull
++    String getName();
++
++    /**
++     * Gives the qualified name associated with the fault. the namespace URI of the bounded fault
++     * will be the one derived from wsdl:portType namespace.
++     *
++     * Maybe null if this method is called before the model is completely build (frozen), if a binding fault has no
++     * corresponding fault in abstractwsdl:portType/wsdl:operation then the namespace URI of the fault will be that of
++     * the WSDBoundPortType.
++     */
++    public @Nullable QName getQName();
++
++    /**
++     * Gives the associated abstract fault from
++     * wsdl:portType/wsdl:operation/wsdl:fault. It is only available after
++     * the WSDL parsing is complete and the entire model is frozen.
++     * <p/>
++     * Maybe null if a binding fault has no corresponding fault in abstract
++     * wsdl:portType/wsdl:operation
++     */
++    public
++    @Nullable
++    WSDLFault getFault();
++
++    /**
++     * Gives the owner {@link WSDLBoundOperation}
++     */
++    @NotNull WSDLBoundOperation getBoundOperation();
++}
+--- /dev/null	Thu Jul 30 19:01:01 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/EndpointComponent.java	Thu Jul 30 19:01:01 2009
+@@ -0,0 +1,52 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++
++package com.sun.xml.internal.ws.api.server;
++
++import com.sun.istack.internal.NotNull;
++import com.sun.istack.internal.Nullable;
++
++/**
++ * Interface that allows components around {@link WSEndpoint} to hook up
++ * with each other.
++ *
++ * @author Kohsuke Kawaguchi
++ * @since 2.1.2
++ * @see WSEndpoint#getComponentRegistry()
++ */
++public interface EndpointComponent {
++    /**
++     * Gets the specified SPI.
++     *
++     * <p>
++     * This method works as a kind of directory service
++     * for SPIs, allowing various components to define private contract
++     * and talk to each other.
++     *
++     * @return
++     *      null if such an SPI is not provided by this object.
++     */
++    @Nullable <T> T getSPI(@NotNull Class<T> spiType);
++}
+--- /dev/null	Thu Jul 30 19:01:05 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/api/server/HttpEndpoint.java	Thu Jul 30 19:01:04 2009
+@@ -0,0 +1,62 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++package com.sun.xml.internal.ws.api.server;
++
++import com.sun.istack.internal.NotNull;
++
++/**
++ * Light-weight http server transport for {@link WSEndpoint}.
++ * It provides a way to start the transport at a local http address and
++ * to stop the transport.
++ *
++ * @author Jitendra Kotamraju
++ */
++public abstract class HttpEndpoint {
++
++    /**
++     * Factory to deploy {@link WSEndpoint} on light-weight
++     * http server container.
++     *
++     * @param endpoint that needs to be deployed at http server
++     * @return transport object for the endpoint
++     */
++    public static HttpEndpoint create(@NotNull WSEndpoint endpoint) {
++        return new com.sun.xml.internal.ws.transport.http.server.HttpEndpoint(endpoint, null);
++    }
++
++    /**
++     * Publishes this endpoint at a localhost's http address.
++     *
++     * @param address endpoint's http address
++     *        for e.g http://localhost:8080/ctxt/pattern
++     */
++    public abstract void publish(@NotNull String address);
++
++    /**
++     * Stops the published endpoint
++     */
++    public abstract void stop();
++
++}
+--- /dev/null	Thu Jul 30 19:01:08 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/client/ClientContainer.java	Thu Jul 30 19:01:07 2009
+@@ -0,0 +1,55 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++package com.sun.xml.internal.ws.client;
++
++import com.sun.xml.internal.ws.api.ResourceLoader;
++import com.sun.xml.internal.ws.api.server.Container;
++
++import java.net.MalformedURLException;
++import java.net.URL;
++
++/**
++ * @author Jitendra Kotamraju
++ */
++final class ClientContainer extends Container {
++
++    private final ResourceLoader loader = new ResourceLoader() {
++        public URL getResource(String resource) throws MalformedURLException {
++            ClassLoader cl = Thread.currentThread().getContextClassLoader();
++            if (cl == null) {
++                cl = this.getClass().getClassLoader();
++            }
++            return cl.getResource("META-INF/"+resource);
++        }
++    };
++
++    public <T> T getSPI(Class<T> spiType) {
++        if (spiType == ResourceLoader.class) {
++            return spiType.cast(loader);
++        }
++        return null;
++    }
++
++}
+--- /dev/null	Thu Jul 30 19:01:11 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/client/ClientSchemaValidationTube.java	Thu Jul 30 19:01:10 2009
+@@ -0,0 +1,163 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++package com.sun.xml.internal.ws.client;
++
++import com.sun.xml.internal.ws.api.WSBinding;
++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.pipe.TubeCloner;
++import com.sun.xml.internal.ws.api.pipe.helper.AbstractTubeImpl;
++import com.sun.xml.internal.ws.api.server.SDDocument;
++import com.sun.xml.internal.ws.api.server.SDDocumentSource;
++import com.sun.xml.internal.ws.util.MetadataUtil;
++import com.sun.xml.internal.ws.util.pipe.AbstractSchemaValidationTube;
++import com.sun.xml.internal.ws.util.xml.MetadataDocument;
++import org.w3c.dom.Document;
++import org.xml.sax.SAXException;
++
++import javax.xml.XMLConstants;
++import javax.xml.namespace.QName;
++import javax.xml.transform.Source;
++import javax.xml.transform.dom.DOMSource;
++import javax.xml.validation.Schema;
++import javax.xml.validation.SchemaFactory;
++import javax.xml.validation.Validator;
++import javax.xml.ws.WebServiceException;
++import java.net.MalformedURLException;
++import java.net.URL;
++import java.util.ArrayList;
++import java.util.HashMap;
++import java.util.List;
++import java.util.Map;
++import java.util.logging.Logger;
++
++/**
++ * {@link Tube} that does the schema validation on the client side.
++ *
++ * @author Jitendra Kotamraju
++ */
++public class ClientSchemaValidationTube extends AbstractSchemaValidationTube {
++
++    private static final Logger LOGGER = Logger.getLogger(ClientSchemaValidationTube.class.getName());
++
++    private final Schema schema;
++    private final Validator validator;
++    private final boolean noValidation;
++    private final WSDLPort port;
++
++    public ClientSchemaValidationTube(WSBinding binding, WSDLPort port, Tube next) {
++        super(binding, next);
++        this.port = port;
++        Source[] sources = null;
++        if (port != null) {
++            String primaryWsdl = port.getOwner().getParent().getLocation().getSystemId();
++            sources = getSchemaSources(primaryWsdl);
++            for(Source source : sources) {
++                LOGGER.fine("Constructing validation Schema from = "+source.getSystemId());
++                //printDOM((DOMSource)source);
++            }
++        }
++        if (sources != null) {
++            noValidation = false;
++            SchemaFactory sf = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
++            try {
++                schema = sf.newSchema(sources);
++            } catch(SAXException e) {
++                throw new WebServiceException(e);
++            }
++            validator = schema.newValidator();
++        } else {
++            noValidation = true;
++            schema = null;
++            validator = null;
++        }
++    }
++
++    private class MetadataResolverImpl implements MetadataUtil.MetadataResolver{
++
++        Map<String, SDDocument> docs = new HashMap<String, SDDocument>();
++
++        public SDDocument resolveEntity(String systemId) {
++            SDDocument sdi = docs.get(systemId);
++            if (sdi == null) {
++                SDDocumentSource sds;
++                try {
++                    sds = SDDocumentSource.create(new URL(systemId));
++                } catch(MalformedURLException e) {
++                    throw new WebServiceException(e);
++                }
++                sdi = MetadataDocument.create(sds, new QName(""), new QName(""));
++                docs.put(systemId, sdi);
++            }
++            return sdi;
++        }
++    }
++
++    private Source[] getSchemaSources(String primary) {
++
++        MetadataUtil.MetadataResolver mdresolver = new MetadataResolverImpl();
++        Map<String, SDDocument> docs = MetadataUtil.getMetadataClosure(primary, mdresolver, true);
++
++        List<Source> list = new ArrayList<Source>();
++        for(Map.Entry<String, SDDocument> entry : docs.entrySet()) {
++            SDDocument doc = entry.getValue();
++            // Add all xsd:schema fragments from all WSDLs. That should form a closure of schemas.
++            if (doc.isWSDL()) {
++                Document dom = createDOM(doc);
++                // Get xsd:schema node from WSDL's DOM
++                addSchemaFragmentSource(dom, doc.getURL().toExternalForm(), list);
++            } else if (doc.isSchema()) {
++                // If there are multiple schemas with the same targetnamespace,
++                // JAXP works only with the first one. Above, all schema fragments may have the same targetnamespace,
++                // and that means it will not include all the schemas. Since we have a list of schemas, just add them.
++                Document dom = createDOM(doc);
++                list.add(new DOMSource(dom, doc.getURL().toExternalForm()));
++            }
++        }
++        //addSchemaSource(list);
++        return list.toArray(new Source[list.size()]) ;
++    }
++
++    protected Validator getValidator() {
++        return validator;
++    }
++
++    protected boolean isNoValidation() {
++        return noValidation;
++    }
++
++    protected ClientSchemaValidationTube(ClientSchemaValidationTube that, TubeCloner cloner) {
++        super(that,cloner);
++        this.port = that.port;
++        this.schema = that.schema;
++        this.validator = schema.newValidator();
++        this.noValidation = that.noValidation;
++    }
++
++    public AbstractTubeImpl copy(TubeCloner cloner) {
++        return new ClientSchemaValidationTube(this,cloner);
++    }
++
++}
+--- /dev/null	Thu Jul 30 19:01:14 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/client/sei/SEIMethodHandler.java	Thu Jul 30 19:01:13 2009
+@@ -0,0 +1,214 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++package com.sun.xml.internal.ws.client.sei;
++
++import com.sun.xml.internal.ws.api.message.Message;
++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 javax.xml.namespace.QName;
++import java.util.ArrayList;
++import java.util.HashMap;
++import java.util.List;
++import java.util.Map;
++
++/**
++ * {@link com.sun.xml.internal.ws.client.sei.MethodHandler} that handles synchronous method invocations.
++ *
++ * <p>
++ * This class mainly performs the following two tasks:
++ * <ol>
++ *  <li>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.
++ *  <li>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.)
++ * </ol>
++ *
++ * <h2>Creating {@link com.sun.xml.internal.ws.message.jaxb.JAXBMessage }</h2>
++ * <p>
++ * At the construction time, we prepare {@link com.sun.xml.internal.ws.client.sei.BodyBuilder} and {@link com.sun.xml.internal.ws.client.sei.MessageFiller}s
++ * that know how to move arguments into a {@link com.sun.xml.internal.ws.api.message.Message }.
++ * Some arguments go to the payload, some go to headers, still others go to attachments.
++ *
++ * @author Kohsuke Kawaguchi
++ * @author Jitendra Kotamraju
++ */
++abstract class SEIMethodHandler extends MethodHandler {
++
++    // these objects together create a message from method parameters
++    private final BodyBuilder bodyBuilder;
++    private final MessageFiller[] inFillers;
++
++    protected final String soapAction;
++
++    protected final boolean isOneWay;
++
++    protected final JavaMethodImpl javaMethod;
++
++    protected final Map<QName, CheckedExceptionImpl> checkedExceptions;
++
++    SEIMethodHandler(SEIStub owner, JavaMethodImpl method) {
++        super(owner);
++
++        //keep all the CheckedException model for the detail qname
++        this.checkedExceptions = new HashMap<QName, CheckedExceptionImpl>();
++        for(CheckedExceptionImpl ce : method.getCheckedExceptions()){
++            checkedExceptions.put(ce.getBridge().getTypeReference().tagName, ce);
++        }
++        //If a non-"" soapAction is specified, wsa:action the SOAPAction
++        if(method.getInputAction() != null && !method.getBinding().getSOAPAction().equals("") ) {
++            this.soapAction = method.getInputAction();
++        } else {
++            this.soapAction = method.getBinding().getSOAPAction();
++        }
++        this.javaMethod = method;
++
++        {// prepare objects for creating messages
++            List<ParameterImpl> rp = method.getRequestParameters();
++
++            BodyBuilder bodyBuilder = null;
++            List<MessageFiller> fillers = new ArrayList<MessageFiller>();
++
++            for (ParameterImpl param : rp) {
++                ValueGetter getter = getValueGetterFactory().get(param);
++
++                switch(param.getInBinding().kind) {
++                case BODY:
++                    if(param.isWrapperStyle()) {
++                        if(param.getParent().getBinding().isRpcLit())
++                            bodyBuilder = new BodyBuilder.RpcLit((WrapperParameter)param, owner.soapVersion, getValueGetterFactory());
++                        else
++                            bodyBuilder = new BodyBuilder.DocLit((WrapperParameter)param, owner.soapVersion, getValueGetterFactory());
++                    } else {
++                        bodyBuilder = new BodyBuilder.Bare(param, owner.soapVersion, getter);
++                    }
++                    break;
++                case HEADER:
++                    fillers.add(new MessageFiller.Header(
++                        param.getIndex(),
++                        param.getBridge(),
++                        getter ));
++                    break;
++                case ATTACHMENT:
++                    fillers.add(MessageFiller.AttachmentFiller.createAttachmentFiller(param, getter));
++                    break;
++                case UNBOUND:
++                    break;
++                default:
++                    throw new AssertionError(); // impossible
++                }
++            }
++
++            if(bodyBuilder==null) {
++                // no parameter binds to body. we create an empty message
++                switch(owner.soapVersion) {
++                case SOAP_11:
++                    bodyBuilder = BodyBuilder.EMPTY_SOAP11;
++                    break;
++                case SOAP_12:
++                    bodyBuilder = BodyBuilder.EMPTY_SOAP12;
++                    break;
++                default:
++                    throw new AssertionError();
++                }
++            }
++
++            this.bodyBuilder = bodyBuilder;
++            this.inFillers = fillers.toArray(new MessageFiller[fillers.size()]);
++        }
++
++        this.isOneWay = method.getMEP().isOneWay();
++    }
++
++    ResponseBuilder buildResponseBuilder(JavaMethodImpl method, ValueSetterFactory setterFactory) {
++        // prepare objects for processing response
++        List<ParameterImpl> rp = method.getResponseParameters();
++        List<ResponseBuilder> builders = new ArrayList<ResponseBuilder>();
++
++        for( ParameterImpl param : rp ) {
++            ValueSetter setter;
++            switch(param.getOutBinding().kind) {
++            case BODY:
++                if(param.isWrapperStyle()) {
++                    if(param.getParent().getBinding().isRpcLit())
++                        builders.add(new ResponseBuilder.RpcLit((WrapperParameter)param, setterFactory));
++                    else
++                        builders.add(new ResponseBuilder.DocLit((WrapperParameter)param, setterFactory));
++                } else {
++                    setter = setterFactory.get(param);
++                    builders.add(new ResponseBuilder.Body(param.getBridge(),setter));
++                }
++                break;
++            case HEADER:
++                setter = setterFactory.get(param);
++                builders.add(new ResponseBuilder.Header(owner.soapVersion, param, setter));
++                break;
++            case ATTACHMENT:
++                setter = setterFactory.get(param);
++                builders.add(ResponseBuilder.AttachmentBuilder.createAttachmentBuilder(param, setter));
++                break;
++            case UNBOUND:
++                setter = setterFactory.get(param);
++                builders.add(new ResponseBuilder.NullSetter(setter,
++                    ResponseBuilder.getVMUninitializedValue(param.getTypeReference().type)));
++                break;
++            default:
++                throw new AssertionError();
++            }
++        }
++        ResponseBuilder rb;
++        switch(builders.size()) {
++        case 0:
++            rb = ResponseBuilder.NONE;
++            break;
++        case 1:
++            rb = builders.get(0);
++            break;
++        default:
++            rb = new ResponseBuilder.Composite(builders);
++        }
++        return rb;
++    }
++
++
++    /**
++     * Creates a request {@link com.sun.xml.internal.ws.message.jaxb.JAXBMessage} from method arguments.
++     * @param args proxy invocation arguments
++     * @return Message for the arguments
++     */
++    Message createRequestMessage(Object[] args) {
++        Message msg = bodyBuilder.createMessage(args);
++
++        for (MessageFiller filler : inFillers)
++            filler.fillIn(args,msg);
++
++        return msg;
++    }
++
++    abstract ValueGetterFactory getValueGetterFactory();
++
++}
+--- /dev/null	Thu Jul 30 19:01:17 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/client/sei/ValueGetterFactory.java	Thu Jul 30 19:01:17 2009
+@@ -0,0 +1,57 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++package com.sun.xml.internal.ws.client.sei;
++
++import com.sun.xml.internal.ws.model.ParameterImpl;
++
++import javax.jws.WebParam;
++
++/**
++ * {@link ValueGetterFactory} is used to create {@link ValueGetter} objects.
++ *
++ * @author Jitendra Kotamraju
++ */
++abstract class ValueGetterFactory {
++
++    abstract ValueGetter get(ParameterImpl p);
++
++    static final ValueGetterFactory SYNC = new ValueGetterFactory() {
++        ValueGetter get(ParameterImpl p) {
++            return (p.getMode()== WebParam.Mode.IN || p.getIndex() == -1)
++                    ? ValueGetter.PLAIN : ValueGetter.HOLDER;
++        }
++    };
++
++    /**
++     * In case of SEI async signatures, there are no holders. The OUT
++     * parameters go in async bean class
++     */
++    static final ValueGetterFactory ASYNC = new ValueGetterFactory() {
++        ValueGetter get(ParameterImpl p) {
++            return ValueGetter.PLAIN;
++        }
++    };
++
++}
+--- /dev/null	Thu Jul 30 19:01:21 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/client/sei/ValueSetterFactory.java	Thu Jul 30 19:01:20 2009
+@@ -0,0 +1,70 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++package com.sun.xml.internal.ws.client.sei;
++
++import com.sun.xml.internal.ws.model.ParameterImpl;
++
++import javax.xml.ws.WebServiceException;
++
++/**
++ * {@link ValueSetterFactory} is used to create {@link ValueSetter}.
++ *
++ * @author Jitendra Kotamraju
++ */
++abstract class ValueSetterFactory {
++
++    abstract ValueSetter get(ParameterImpl p);
++
++    static final ValueSetterFactory SYNC = new ValueSetterFactory() {
++        ValueSetter get(ParameterImpl p) {
++            return ValueSetter.getSync(p);
++        }
++    };
++
++    static final ValueSetterFactory NONE = new ValueSetterFactory() {
++        ValueSetter get(ParameterImpl p) {
++            throw new WebServiceException("This shouldn't happen. No response parameters.");
++        }
++    };
++
++    static final ValueSetterFactory SINGLE = new ValueSetterFactory() {
++        ValueSetter get(ParameterImpl p) {
++            return ValueSetter.SINGLE_VALUE;
++        }
++    };
++
++    static final class AsyncBeanValueSetterFactory extends ValueSetterFactory {
++        private Class asyncBean;
++
++        AsyncBeanValueSetterFactory(Class asyncBean) {
++            this.asyncBean = asyncBean;
++        }
++
++        ValueSetter get(ParameterImpl p) {
++            return new ValueSetter.AsyncBeanValueSetter(p, asyncBean);
++        }
++    }
++
++}
+--- /dev/null	Thu Jul 30 19:01:24 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/developer/BindingTypeFeature.java	Thu Jul 30 19:01:23 2009
+@@ -0,0 +1,55 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++package com.sun.xml.internal.ws.developer;
++
++import com.sun.xml.internal.ws.api.BindingID;
++
++import javax.xml.ws.WebServiceFeature;
++
++/**
++ * Using this feature, the application could override the binding used by
++ * the runtime(usually determined from WSDL).
++ *
++ * @author Jitendra Kotamraju
++ */
++public final class BindingTypeFeature extends WebServiceFeature {
++
++    public static final String ID = "http://jax-ws.dev.java.net/features/binding";
++
++    private final String bindingId;
++
++    public BindingTypeFeature(String bindingId) {
++        this.bindingId = bindingId;
++    }
++
++    public String getID() {
++        return ID;
++    }
++
++    public String getBindingId() {
++        return bindingId;
++    }
++
++}
+--- /dev/null	Thu Jul 30 19:01:27 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/developer/JAXBContextFactory.java	Thu Jul 30 19:01:26 2009
+@@ -0,0 +1,101 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++package com.sun.xml.internal.ws.developer;
++
++import com.sun.istack.internal.NotNull;
++import com.sun.xml.internal.bind.api.JAXBRIContext;
++import com.sun.xml.internal.bind.api.TypeReference;
++import com.sun.xml.internal.ws.api.model.SEIModel;
++
++import javax.xml.bind.JAXBContext;
++import javax.xml.bind.JAXBException;
++import java.util.List;
++
++/**
++ * Factory to create {@link JAXBContext}.
++ *
++ * <p>
++ * JAX-WS uses JAXB to perform databinding when you use the service endpoint interface, and normally
++ * the JAX-WS RI drives JAXB and creates a necessary {@link JAXBContext} automatically.
++ *
++ * <p>
++ * This annotation is a JAX-WS RI vendor-specific feature, which lets applications create {@link JAXBRIContext}
++ * (which is the JAXB RI's {@link JAXBContext} implementation.)
++ * Combined with the JAXB RI vendor extensions defined in {@link JAXBRIContext}, appliation can use this to
++ * fine-tune how the databinding happens, such as by adding more classes to the binding context,
++ * by controlling the namespace mappings, and so on.
++ *
++ * <p>
++ * Applications should either use {@link UsesJAXBContextFeature} or {@link UsesJAXBContext} to instruct
++ * the JAX-WS runtime to use a custom factory.
++ *
++ * @author Kohsuke Kawaguchi
++ * @since 2.1.5
++ */
++public interface JAXBContextFactory {
++    /**
++     * Called by the JAX-WS runtime to create a {@link JAXBRIContext} for the given SEI.
++     *
++     * @param sei
++     *      The {@link SEIModel} object being constructed. This object provides you access to
++     *      what SEI is being processed, and therefore useful if you are writing a generic
++     *      {@link JAXBContextFactory} that can work with arbitrary SEI classes.
++     *
++     * @param classesToBind
++     *      List of classes that needs to be bound by JAXB. This value is computed according to
++     *      the JAX-WS spec and given to you.
++     *
++     *      The calling JAX-WS runtime expects the returned {@link JAXBRIContext} to be capable of
++     *      handling all these classes, but you can add more (which is more common), or remove some
++     *      (if you know what you are doing.)
++     *
++     *      The callee is free to mutate this list.
++     *
++     * @param typeReferences
++     *      List of {@link TypeReference}s, which is also a part of the input to the JAXB RI to control
++     *      how the databinding happens. Most likely this will be just a pass-through to the
++     *      {@link JAXBRIContext#newInstance} method.
++     *
++     * @return
++     *      A non-null valid {@link JAXBRIContext} object.
++     *
++     * @throws JAXBException
++     *      If the callee encounters a fatal problem and wants to abort the JAX-WS runtime processing
++     *      of the given SEI, throw a {@link JAXBException}. This will cause the port instantiation
++     *      to fail (if on client), or the application deployment to fail (if on server.)
++     */
++    @NotNull JAXBRIContext createJAXBContext(@NotNull SEIModel sei, @NotNull List<Class> classesToBind, @NotNull List<TypeReference> typeReferences) throws JAXBException;
++
++    /**
++     * The default implementation that creates {@link JAXBRIContext} according to the standard behavior.
++     */
++    public static final JAXBContextFactory DEFAULT = new JAXBContextFactory() {
++        @NotNull
++        public JAXBRIContext createJAXBContext(@NotNull SEIModel sei, @NotNull List<Class> classesToBind, @NotNull List<TypeReference> typeReferences) throws JAXBException {
++            return JAXBRIContext.newInstance(classesToBind.toArray(new Class[classesToBind.size()]),
++                    typeReferences, null, sei.getTargetNamespace(), false, null);
++        }
++    };
++}
+--- /dev/null	Thu Jul 30 19:01:30 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/developer/SchemaValidation.java	Thu Jul 30 19:01:29 2009
+@@ -0,0 +1,92 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++package com.sun.xml.internal.ws.developer;
++
++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;
++import java.lang.annotation.Retention;
++import static java.lang.annotation.RetentionPolicy.RUNTIME;
++import java.lang.annotation.Target;
++
++/**
++ * Validates all request and response messages payload(SOAP:Body) for a {@link WebService}
++ * against the XML schema. To use this feature, annotate the endpoint class with
++ * this annotation.
++ *
++ * <pre>
++ * for e.g.:
++ *
++ * &#64;WebService
++ * &#64;SchemaValidation
++ * public class HelloImpl {
++ *   ...
++ * }
++ * </pre>
++ *
++ * At present, schema validation works for doc/lit web services only.
++ *
++ * @since JAX-WS 2.1.3
++ * @author Jitendra Kotamraju
++ * @see SchemaValidationFeature
++ */
++@Retention(RUNTIME)
++@Target(TYPE)
++@Documented
++@WebServiceFeatureAnnotation(id = SchemaValidationFeature.ID, bean = SchemaValidationFeature.class)
++public @interface SchemaValidation {
++
++    /**
++     * Configure the validation behaviour w.r.t error handling. The default handler
++     * just rejects any invalid schema intances. If the application want to change
++     * this default behaviour(say just log the errors), it can do so by providing
++     * a custom implementation of {@link ValidationErrorHandler}.
++     */
++    Class<? extends ValidationErrorHandler> handler() default DraconianValidationErrorHandler.class;
++
++    /**
++     * Does validation for bound headers in a SOAP message.
++     *
++    boolean headers() default false;
++     */
++
++    /**
++     * Additional schema documents that are used to create {@link Schema} object. Useful
++     * when the application adds additional SOAP headers to the message. This is a list
++     * of system-ids, that are used to create {@link Source} objects and used in creation
++     * of {@link Schema} object
++     *
++     * for e.g.:
++     * @SchemaValidation(schemaLocations={"http://bar.foo/b.xsd", "http://foo.bar/a.xsd"}
++     *
++    String[] schemaLocations() default {};
++     */
++
++}
+--- /dev/null	Thu Jul 30 19:01:33 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/developer/SchemaValidationFeature.java	Thu Jul 30 19:01:33 2009
+@@ -0,0 +1,74 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++package com.sun.xml.internal.ws.developer;
++
++import com.sun.xml.internal.ws.api.FeatureConstructor;
++import com.sun.xml.internal.ws.server.DraconianValidationErrorHandler;
++
++import javax.xml.ws.WebServiceFeature;
++
++
++/**
++ * {@link WebServiceFeature} for schema validation.
++ *
++ * @since JAX-WS 2.1.3
++ * @author Jitendra Kotamraju
++ * @see SchemaValidation
++ */
++public class SchemaValidationFeature extends WebServiceFeature {
++    /**
++     * Constant value identifying the SchemaValidationFeature
++     */
++    public static final String ID = "http://jax-ws.dev.java.net/features/schema-validation";
++
++    private Class<? extends ValidationErrorHandler> clazz;
++
++    public SchemaValidationFeature() {
++        this(DraconianValidationErrorHandler.class);
++    }
++
++    /**
++     * Create an <code>SchemaValidationFeature</code>.
++     * The instance created will be enabled.
++     */
++    @FeatureConstructor({"handler"})
++    public SchemaValidationFeature(Class<? extends ValidationErrorHandler> clazz) {
++        this.enabled = true;
++        this.clazz = clazz;
++    }
++
++    public String getID() {
++        return ID;
++    }
++
++    /**
++     * Invalid schema instances are rejected, a SOAP fault message is created
++     * for any invalid request and response message. If it is set to false, schema
++     * validation messages are just logged.
++     */
++    public Class<? extends ValidationErrorHandler> getErrorHandler() {
++        return clazz;
++    }
++}
+--- /dev/null	Thu Jul 30 19:01:36 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/developer/StreamingAttachment.java	Thu Jul 30 19:01:36 2009
+@@ -0,0 +1,76 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++package com.sun.xml.internal.ws.developer;
++
++import javax.xml.ws.spi.WebServiceFeatureAnnotation;
++import java.lang.annotation.*;
++import java.io.File;
++
++/**
++ * This feature represents the use of StreamingAttachment attachments with a
++ * web service.
++ *
++ * <p>
++ * for e.g.: To keep all MIME attachments in memory, do the following
++ *
++ * <pre>
++ * &#64;WebService
++ * &#64;MIME(memoryThreshold=-1L)
++ * public class HelloService {
++ * }
++ * </pre>
++ *
++ * @see StreamingAttachmentFeature
++ *
++ * @author Jitendra Kotamraju
++ */
++@Retention(RetentionPolicy.RUNTIME)
++@Target(ElementType.TYPE)
++@Documented
++@WebServiceFeatureAnnotation(id = StreamingAttachmentFeature.ID, bean = StreamingAttachmentFeature.class)
++public @interface StreamingAttachment {
++
++    /**
++     * Directory in which large attachments are stored. {@link File#createTempFile}
++     * methods are used to create temp files for storing attachments. This
++     * value is used in {@link File#createTempFile}, if specified. If a file
++     * cannot be created in this dir, then all the content is kept in memory.
++     */
++    String dir() default "";
++
++    /**
++     * MIME message is parsed eagerly.
++     */
++    boolean parseEagerly() default false;
++
++    /**
++     * After this threshold(no of bytes per attachment), large attachment is
++     * written to file system.
++     *
++     * If the value is -1, then all the attachment content is kept in memory.
++     */
++    long memoryThreshold() default 1048576L;
++
++}
+--- /dev/null	Thu Jul 30 19:01:40 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/developer/StreamingAttachmentFeature.java	Thu Jul 30 19:01:39 2009
+@@ -0,0 +1,117 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++package com.sun.xml.internal.ws.developer;
++
++import com.sun.xml.internal.ws.api.FeatureConstructor;
++import com.sun.istack.internal.Nullable;
++
++import javax.xml.ws.WebServiceFeature;
++
++import com.sun.xml.internal.org.jvnet.mimepull.MIMEConfig;
++
++/**
++ * Proxy needs to be created with this feature to configure StreamingAttachment
++ * attachments behaviour.
++ *
++ * <pre>
++ * for e.g.: To configure all StreamingAttachment attachments to be kept in memory
++ * <p>
++ *
++ * StreamingAttachmentFeature feature = new StreamingAttachmentFeature();
++ * feature.setAllMemory(true);
++ *
++ * proxy = HelloService().getHelloPort(feature);
++ *
++ * </pre>
++ *
++ * @author Jitendra Kotamraju
++ */
++public final class StreamingAttachmentFeature extends WebServiceFeature {
++    /**
++     * Constant value identifying the {@link @StreamingAttachment} feature.
++     */
++    public static final String ID = "http://jax-ws.dev.java.net/features/mime";
++
++    private MIMEConfig config;
++
++    private String dir;
++    private boolean parseEagerly;
++    private long memoryThreshold;
++
++    public StreamingAttachmentFeature() {
++    }
++
++    @FeatureConstructor({"dir","parseEagerly","memoryThreshold"})
++    public StreamingAttachmentFeature(@Nullable String dir, boolean parseEagerly, long memoryThreshold) {
++        this.enabled = true;
++        this.dir = dir;
++        this.parseEagerly = parseEagerly;
++        this.memoryThreshold = memoryThreshold;
++    }
++
++    public String getID() {
++        return ID;
++    }
++
++    /**
++     * Returns the configuration object. Once this is called, you cannot
++     * change the configuration.
++     *
++     * @return
++     */
++    public MIMEConfig getConfig() {
++        if (config == null) {
++            config = new MIMEConfig();
++            config.setDir(dir);
++            config.setParseEagerly(parseEagerly);
++            config.setMemoryThreshold(memoryThreshold);
++            config.validate();
++        }
++        return config;
++    }
++
++    /**
++     * Directory in which large attachments are stored
++     */
++    public void setDir(String dir) {
++        this.dir = dir;
++    }
++
++    /**
++     * StreamingAttachment message is parsed eagerly
++     */
++    public void setParseEagerly(boolean parseEagerly) {
++        this.parseEagerly = parseEagerly;
++    }
++
++    /**
++     * After this threshold(no of bytes), large attachments are
++     * written to file system
++     */
++    public void setMemoryThreshold(int memoryThreshold) {
++        this.memoryThreshold = memoryThreshold;
++    }
++
++}
+--- /dev/null	Thu Jul 30 19:01:43 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/developer/StreamingDataHandler.java	Thu Jul 30 19:01:42 2009
+@@ -0,0 +1,69 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++package com.sun.xml.internal.ws.developer;
++
++import com.sun.xml.internal.org.jvnet.mimepull.MIMEPart;
++
++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
++ * attachments efficiently. Applications can use the additional methods and decide
++ * on how to access the attachment data in JAX-WS applications.
++ *
++ * <p>
++ * for e.g.:
++ *
++ * DataHandler dh = proxy.getData();
++ * StreamingDataHandler sdh = (StreamingDataHandler)dh;
++ * // readOnce() doesn't store attachment on the disk in some cases
++ * // for e.g when only one huge attachment after soap envelope part in MIME message
++ * InputStream in = sdh.readOnce();
++ * ...
++ * in.close();
++ * sdh.close();
++ *
++ * @author Jitendra Kotamraju
++ */
++public abstract class StreamingDataHandler extends com.sun.xml.internal.org.jvnet.staxex.StreamingDataHandler {
++
++    public StreamingDataHandler(Object o, String s) {
++        super(o, s);
++    }
++
++    public StreamingDataHandler(URL url) {
++        super(url);
++    }
++
++    public StreamingDataHandler(DataSource dataSource) {
++        super(dataSource);
++    }
++
++}
+--- /dev/null	Thu Jul 30 19:01:46 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/developer/UsesJAXBContext.java	Thu Jul 30 19:01:45 2009
+@@ -0,0 +1,68 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++package com.sun.xml.internal.ws.developer;
++
++import javax.xml.ws.spi.WebServiceFeatureAnnotation;
++import javax.xml.bind.JAXBContext;
++import java.lang.annotation.Documented;
++import java.lang.annotation.ElementType;
++import java.lang.annotation.Retention;
++import java.lang.annotation.RetentionPolicy;
++import java.lang.annotation.Target;
++
++/**
++ * This feature instructs that the specified {@link JAXBContextFactory} be used for performing
++ * data-binding for the SEI.
++ *
++ * <p>
++ * For example,
++ * <pre>
++ * &#64;WebService
++ * &#64;UsesJAXBContext(MyJAXBContextFactory.class)
++ * public class HelloService {
++ *   ...
++ * }
++ * </pre>
++ *
++ * <p>
++ * If your {@link JAXBContextFactory} needs to carry some state from your calling application,
++ * you can use {@link UsesJAXBContextFeature} to pass in an instance of {@link JAXBContextFactory},
++ * instead of using this to specify the type.
++ *
++ * @author Kohsuke Kawaguchi
++ * @since 2.1.5
++ */
++@Target(ElementType.TYPE)
++@Retention(RetentionPolicy.RUNTIME)
++@Documented
++@WebServiceFeatureAnnotation(id=UsesJAXBContextFeature.ID,bean=UsesJAXBContextFeature.class)
++public @interface UsesJAXBContext {
++    /**
++     * Designates the {@link JAXBContextFactory} to be used to create the {@link JAXBContext} object,
++     * which in turn will be used by the JAX-WS runtime to marshal/unmarshal parameters and return
++     * values to/from XML.
++     */
++    Class<? extends JAXBContextFactory> value();
++}
+--- /dev/null	Thu Jul 30 19:01:49 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/developer/UsesJAXBContextFeature.java	Thu Jul 30 19:01:49 2009
+@@ -0,0 +1,124 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++package com.sun.xml.internal.ws.developer;
++
++import com.sun.xml.internal.ws.api.FeatureConstructor;
++import com.sun.xml.internal.ws.api.model.SEIModel;
++import com.sun.xml.internal.bind.api.JAXBRIContext;
++import com.sun.xml.internal.bind.api.TypeReference;
++import com.sun.istack.internal.NotNull;
++import com.sun.istack.internal.Nullable;
++
++import javax.xml.ws.WebServiceFeature;
++import javax.xml.bind.JAXBContext;
++import javax.xml.bind.JAXBException;
++import java.lang.reflect.InvocationTargetException;
++import java.util.List;
++
++/**
++ * A {@link WebServiceFeature} that instructs the JAX-WS runtime to use a specific {@link JAXBContextFactory}
++ * instance of creating {@link JAXBContext}.
++ *
++ * @see UsesJAXBContext
++ * @since 2.1.5
++ * @author Kohsuke Kawaguchi
++ */
++public class UsesJAXBContextFeature extends WebServiceFeature {
++    /**
++     * Constant value identifying the {@link UsesJAXBContext} feature.
++     */
++    public static final String ID = "http://jax-ws.dev.java.net/features/uses-jaxb-context";
++
++    private final JAXBContextFactory factory;
++
++    /**
++     * Creates {@link UsesJAXBContextFeature}.
++     *
++     * @param factoryClass
++     *      This class has to have a public no-arg constructor, which will be invoked to create
++     *      a new instance. {@link JAXBContextFactory#createJAXBContext(SEIModel, List, List)} will
++     *      be then called to create {@link JAXBContext}.
++     */
++    @FeatureConstructor("value")
++    public UsesJAXBContextFeature(@NotNull Class<? extends JAXBContextFactory> factoryClass) {
++        try {
++            factory = factoryClass.getConstructor().newInstance();
++        } catch (InstantiationException e) {
++            Error x = new InstantiationError(e.getMessage());
++            x.initCause(e);
++            throw x;
++        } catch (IllegalAccessException e) {
++            Error x = new IllegalAccessError(e.getMessage());
++            x.initCause(e);
++            throw x;
++        } catch (InvocationTargetException e) {
++            Error x = new InstantiationError(e.getMessage());
++            x.initCause(e);
++            throw x;
++        } catch (NoSuchMethodException e) {
++            Error x = new NoSuchMethodError(e.getMessage());
++            x.initCause(e);
++            throw x;
++        }
++    }
++
++    /**
++     * Creates {@link UsesJAXBContextFeature}.
++     * This version allows {@link JAXBContextFactory} to carry application specific state.
++     *
++     * @param factory
++     *      Uses a specific instance of {@link JAXBContextFactory} to create {@link JAXBContext}.
++     */
++    public UsesJAXBContextFeature(@Nullable JAXBContextFactory factory) {
++        this.factory = factory;
++    }
++
++    /**
++     * Creates {@link UsesJAXBContextFeature}.
++     * This version allows you to create {@link JAXBRIContext} upfront and uses it.
++     */
++    public UsesJAXBContextFeature(@Nullable final JAXBRIContext context) {
++        this.factory = new JAXBContextFactory() {
++            @NotNull
++            public JAXBRIContext createJAXBContext(@NotNull SEIModel sei, @NotNull List<Class> classesToBind, @NotNull List<TypeReference> typeReferences) throws JAXBException {
++                return context;
++            }
++        };
++    }
++
++    /**
++     * Gets the {@link JAXBContextFactory} instance to be used for creating {@link JAXBContext} for SEI.
++     *
++     * @return
++     *      null if the default {@link JAXBContext} shall be used.
++     */
++    public @Nullable JAXBContextFactory getFactory() {
++        return factory;
++    }
++
++    public String getID() {
++        return ID;
++    }
++}
+--- /dev/null	Thu Jul 30 19:01:52 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/developer/ValidationErrorHandler.java	Thu Jul 30 19:01:52 2009
+@@ -0,0 +1,58 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++package com.sun.xml.internal.ws.developer;
++
++import com.sun.xml.internal.ws.api.message.Packet;
++import org.xml.sax.ErrorHandler;
++
++import javax.xml.ws.handler.MessageContext;
++import javax.xml.validation.Validator;
++
++/**
++ * 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.
++ *
++ * @see SchemaValidation
++ * @author Jitendra Kotamraju
++ */
++public abstract class ValidationErrorHandler implements ErrorHandler {
++    protected Packet packet;
++
++    /**
++     * Use it to communicate validation errors with the application.
++     *
++     * For e.g validation exceptions can be stored in {@link Packet#invocationProperties}
++     * during request processing and can be accessed in the endpoint
++     * via {@link MessageContext}
++     *
++     * @param packet for request or response message
++     */
++    public void setPacket(Packet packet) {
++        this.packet = packet;
++    }
++
++}
+--- /dev/null	Thu Jul 30 19:01:56 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/ContentType.java	Thu Jul 30 19:01:55 2009
+@@ -0,0 +1,136 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++/*
++ * @(#)ContentType.java       1.7 02/03/27
++ */
++
++
++
++package com.sun.xml.internal.ws.encoding;
++
++import javax.xml.ws.WebServiceException;
++
++/**
++ * This class represents a MIME ContentType value. It provides
++ * methods to parse a ContentType string into individual components
++ * and to generate a MIME style ContentType string.
++ *
++ * @version 1.7, 02/03/27
++ * @author  John Mani
++ */
++public final class ContentType {
++
++    private String primaryType; // primary type
++    private String subType;     // subtype
++    private ParameterList list; // parameter list
++
++    /**
++     * Constructor that takes a Content-Type string. The String
++     * is parsed into its constituents: primaryType, subType
++     * and parameters. A ParseException is thrown if the parse fails.
++     *
++     * @param   s       the Content-Type string.
++     * @exception WebServiceException if the parse fails.
++     */
++    public ContentType(String s) throws WebServiceException {
++        HeaderTokenizer h = new HeaderTokenizer(s, HeaderTokenizer.MIME);
++        HeaderTokenizer.Token tk;
++
++        // First "type" ..
++        tk = h.next();
++        if (tk.getType() != HeaderTokenizer.Token.ATOM)
++            throw new WebServiceException();
++        primaryType = tk.getValue();
++
++        // The '/' separator ..
++        tk = h.next();
++        if ((char)tk.getType() != '/')
++            throw new WebServiceException();
++
++        // Then "subType" ..
++        tk = h.next();
++        if (tk.getType() != HeaderTokenizer.Token.ATOM)
++            throw new WebServiceException();
++        subType = tk.getValue();
++
++        // Finally parameters ..
++        String rem = h.getRemainder();
++        if (rem != null)
++            list = new ParameterList(rem);
++    }
++
++
++    /**
++     * Return the primary type.
++     * @return the primary type
++     */
++    public String getPrimaryType() {
++            return primaryType;
++    }
++
++    /**
++     * Return the subType.
++     * @return the subType
++     */
++    public String getSubType() {
++            return subType;
++    }
++
++    /**
++     * Return the MIME type string, without the parameters.
++     * The returned value is basically the concatenation of
++     * the primaryType, the '/' character and the secondaryType.
++     *
++     * @return the type
++     */
++    public String getBaseType() {
++            return primaryType + '/' + subType;
++    }
++
++    /**
++     * Return the specified parameter value. Returns <code>null</code>
++     * if this parameter is absent.
++     *
++     * @param name parameter name
++     * @return  parameter value
++     */
++    public String getParameter(String name) {
++        if (list == null)
++            return null;
++
++        return list.get(name);
++    }
++
++    /**
++     * Return a ParameterList object that holds all the available
++     * parameters. Returns null if no parameters are available.
++     *
++     * @return  ParameterList
++     */
++    public ParameterList getParameterList() {
++            return list;
++    }
++
++}
+--- /dev/null	Thu Jul 30 19:01:59 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/DataSourceStreamingDataHandler.java	Thu Jul 30 19:01:58 2009
+@@ -0,0 +1,63 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++package com.sun.xml.internal.ws.encoding;
++
++import com.sun.xml.internal.org.jvnet.mimepull.MIMEPart;
++
++import javax.activation.DataSource;
++import java.io.*;
++
++import com.sun.xml.internal.ws.developer.StreamingDataHandler;
++
++/**
++ * @author Jitendra Kotamraju
++ */
++public class DataSourceStreamingDataHandler extends StreamingDataHandler {
++
++    public DataSourceStreamingDataHandler(DataSource ds) {
++        super(ds);
++    }
++
++    public InputStream readOnce() throws IOException {
++        return getInputStream();
++    }
++
++    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);
++        }
++        in.close();
++        os.close();
++    }
++
++    public void close() throws IOException {
++        // nothing to do here
++    }
++
++}
+--- /dev/null	Thu Jul 30 19:02:02 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/HeaderTokenizer.java	Thu Jul 30 19:02:01 2009
+@@ -0,0 +1,382 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++/*
++ * @(#)HeaderTokenizer.java   1.9 02/03/27
++ */
++
++
++
++package com.sun.xml.internal.ws.encoding;
++
++import javax.xml.ws.WebServiceException;
++
++/**
++ * This class tokenizes RFC822 and MIME headers into the basic
++ * symbols specified by RFC822 and MIME. <p>
++ *
++ * This class handles folded headers (ie headers with embedded
++ * CRLF SPACE sequences). The folds are removed in the returned
++ * tokens.
++ *
++ * @version 1.9, 02/03/27
++ * @author  John Mani
++ */
++
++class HeaderTokenizer {
++
++    /**
++     * The Token class represents tokens returned by the
++     * HeaderTokenizer.
++     */
++    static class Token {
++
++        private int type;
++        private String value;
++
++        /**
++         * Token type indicating an ATOM.
++         */
++        public static final int ATOM            = -1;
++
++        /**
++         * Token type indicating a quoted string. The value
++         * field contains the string without the quotes.
++         */
++        public static final int QUOTEDSTRING    = -2;
++
++        /**
++         * Token type indicating a comment. The value field
++         * contains the comment string without the comment
++         * start and end symbols.
++         */
++        public static final int COMMENT         = -3;
++
++        /**
++         * Token type indicating end of input.
++         */
++        public static final int  EOF            = -4;
++
++        /**
++         * Constructor.
++         * @param       type    Token type
++         * @param       value   Token value
++         */
++        public Token(int type, String value) {
++             this.type = type;
++             this.value = value;
++        }
++
++        /**
++         * Return the type of the token. If the token represents a
++         * delimiter or a control character, the type is that character
++         * itself, converted to an integer. Otherwise, it's value is
++         * one of the following:
++         * <ul>
++         * <li><code>ATOM</code> A sequence of ASCII characters
++         *      delimited by either SPACE, CTL, "(", <"> or the
++         *      specified SPECIALS
++         * <li><code>QUOTEDSTRING</code> A sequence of ASCII characters
++         *      within quotes
++         * <li><code>COMMENT</code> A sequence of ASCII characters
++         *      within "(" and ")".
++         * <li><code>EOF</code> End of header
++         * </ul>
++         */
++        public int getType() {
++            return type;
++        }
++
++        /**
++         * Returns the value of the token just read. When the current
++         * token is a quoted string, this field contains the body of the
++         * string, without the quotes. When the current token is a comment,
++         * this field contains the body of the comment.
++         *
++         * @return      token value
++         */
++        public String getValue() {
++            return value;
++        }
++    }
++
++    private String string; // the string to be tokenized
++    private boolean skipComments; // should comments be skipped ?
++    private String delimiters; // delimiter string
++    private int currentPos; // current parse position
++    private int maxPos; // string length
++    private int nextPos; // track start of next Token for next()
++    private int peekPos; // track start of next Token for peek()
++
++    /**
++     * RFC822 specials
++     */
++    private final static String RFC822 = "()<>@,;:\\\"\t .[]";
++
++    /**
++     * MIME specials
++     */
++    final static String MIME = "()<>@,;:\\\"\t []/?=";
++
++    // The EOF Token
++    private final static Token EOFToken = new Token(Token.EOF, null);
++
++    /**
++     * Constructor that takes a rfc822 style header.
++     *
++     * @param   header  The rfc822 header to be tokenized
++     * @param   delimiters      Set of delimiter characters
++     *                          to be used to delimit ATOMS. These
++     *                          are usually <code>RFC822</code> or
++     *                          <code>MIME</code>
++     * @param   skipComments  If true, comments are skipped and
++     *                          not returned as tokens
++     */
++    HeaderTokenizer(String header, String delimiters,
++                           boolean skipComments) {
++        string = (header == null) ? "" : header; // paranoia ?!
++        this.skipComments = skipComments;
++        this.delimiters = delimiters;
++        currentPos = nextPos = peekPos = 0;
++        maxPos = string.length();
++    }
++
++    /**
++     * Constructor. Comments are ignored and not returned as tokens
++     *
++     * @param   header  The header that is tokenized
++     * @param   delimiters  The delimiters to be used
++     */
++    HeaderTokenizer(String header, String delimiters) {
++            this(header, delimiters, true);
++    }
++
++    /**
++     * Constructor. The RFC822 defined delimiters - RFC822 - are
++     * used to delimit ATOMS. Also comments are skipped and not
++     * returned as tokens
++     */
++    HeaderTokenizer(String header)  {
++            this(header, RFC822);
++    }
++
++    /**
++     * Parses the next token from this String. <p>
++     *
++     * Clients sit in a loop calling next() to parse successive
++     * tokens until an EOF Token is returned.
++     *
++     * @return          the next Token
++     * @exception WebServiceException if the parse fails
++     */
++    Token next() throws WebServiceException {
++        Token tk;
++
++        currentPos = nextPos; // setup currentPos
++        tk = getNext();
++        nextPos = peekPos = currentPos; // update currentPos and peekPos
++        return tk;
++    }
++
++    /**
++     * Peek at the next token, without actually removing the token
++     * from the parse stream. Invoking this method multiple times
++     * will return successive tokens, until <code>next()</code> is
++     * called. <p>
++     *
++     * @return          the next Token
++     * @exception       WebServiceException if the parse fails
++     */
++    Token peek() throws WebServiceException {
++        Token tk;
++
++        currentPos = peekPos; // setup currentPos
++        tk = getNext();
++        peekPos = currentPos; // update peekPos
++        return tk;
++    }
++
++    /**
++     * Return the rest of the Header.
++     *
++     * @return String   rest of header. null is returned if we are
++     *                  already at end of header
++     */
++    String getRemainder() {
++            return string.substring(nextPos);
++    }
++
++    /*
++     * Return the next token starting from 'currentPos'. After the
++     * parse, 'currentPos' is updated to point to the start of the
++     * next token.
++     */
++    private Token getNext() throws WebServiceException {
++        // If we're already at end of string, return EOF
++        if (currentPos >= maxPos)
++            return EOFToken;
++
++        // Skip white-space, position currentPos beyond the space
++        if (skipWhiteSpace() == Token.EOF)
++            return EOFToken;
++
++        char c;
++        int start;
++        boolean filter = false;
++
++        c = string.charAt(currentPos);
++
++        // Check or Skip comments and position currentPos
++        // beyond the comment
++        while (c == '(') {
++            // Parsing comment ..
++            int nesting;
++            for (start = ++currentPos, nesting = 1;
++             nesting > 0 && currentPos < maxPos;
++             currentPos++) {
++            c = string.charAt(currentPos);
++            if (c == '\\') {  // Escape sequence
++                currentPos++; // skip the escaped character
++                filter = true;
++            } else if (c == '\r')
++                filter = true;
++            else if (c == '(')
++                nesting++;
++            else if (c == ')')
++                nesting--;
++            }
++            if (nesting != 0)
++            throw new WebServiceException("Unbalanced comments");
++
++            if (!skipComments) {
++            // Return the comment, if we are asked to.
++            // Note that the comment start & end markers are ignored.
++            String s;
++            if (filter) // need to go thru the token again.
++                s = filterToken(string, start, currentPos-1);
++            else
++                s = string.substring(start,currentPos-1);
++
++            return new Token(Token.COMMENT, s);
++            }
++
++            // Skip any whitespace after the comment.
++            if (skipWhiteSpace() == Token.EOF)
++            return EOFToken;
++            c = string.charAt(currentPos);
++        }
++
++        // Check for quoted-string and position currentPos
++        //  beyond the terminating quote
++        if (c == '"') {
++            for (start = ++currentPos; currentPos < maxPos; currentPos++) {
++            c = string.charAt(currentPos);
++            if (c == '\\') { // Escape sequence
++                currentPos++;
++                filter = true;
++            } else if (c == '\r')
++                filter = true;
++            else if (c == '"') {
++                currentPos++;
++                String s;
++
++                if (filter)
++                s = filterToken(string, start, currentPos-1);
++                else
++                s = string.substring(start,currentPos-1);
++
++                return new Token(Token.QUOTEDSTRING, s);
++            }
++            }
++            throw new WebServiceException("Unbalanced quoted string");
++        }
++
++        // Check for SPECIAL or CTL
++        if (c < 040 || c >= 0177 || delimiters.indexOf(c) >= 0) {
++            currentPos++; // re-position currentPos
++            char ch[] = new char[1];
++            ch[0] = c;
++            return new Token((int)c, new String(ch));
++        }
++
++        // Check for ATOM
++        for (start = currentPos; currentPos < maxPos; currentPos++) {
++            c = string.charAt(currentPos);
++            // ATOM is delimited by either SPACE, CTL, "(", <">
++            // or the specified SPECIALS
++            if (c < 040 || c >= 0177 || c == '(' || c == ' ' ||
++            c == '"' || delimiters.indexOf(c) >= 0)
++            break;
++        }
++        return new Token(Token.ATOM, string.substring(start, currentPos));
++        }
++
++        // Skip SPACE, HT, CR and NL
++        private int skipWhiteSpace() {
++        char c;
++        for (; currentPos < maxPos; currentPos++)
++            if (((c = string.charAt(currentPos)) != ' ') &&
++            (c != '\t') && (c != '\r') && (c != '\n'))
++            return currentPos;
++        return Token.EOF;
++    }
++
++    /* Process escape sequences and embedded LWSPs from a comment or
++     * quoted string.
++     */
++    private static String filterToken(String s, int start, int end) {
++        StringBuffer sb = new StringBuffer();
++        char c;
++        boolean gotEscape = false;
++        boolean gotCR = false;
++
++        for (int i = start; i < end; i++) {
++            c = s.charAt(i);
++            if (c == '\n' && gotCR) {
++            // This LF is part of an unescaped
++            // CRLF sequence (i.e, LWSP). Skip it.
++            gotCR = false;
++            continue;
++            }
++
++            gotCR = false;
++            if (!gotEscape) {
++            // Previous character was NOT '\'
++            if (c == '\\') // skip this character
++                gotEscape = true;
++            else if (c == '\r') // skip this character
++                gotCR = true;
++            else // append this character
++                sb.append(c);
++            } else {
++            // Previous character was '\'. So no need to
++            // bother with any special processing, just
++            // append this character
++            sb.append(c);
++            gotEscape = false;
++            }
++        }
++        return sb.toString();
++    }
++}
+--- /dev/null	Thu Jul 30 19:02:05 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/ImageDataContentHandler.java	Thu Jul 30 19:02:05 2009
+@@ -0,0 +1,164 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++
++
++package com.sun.xml.internal.ws.encoding;
++
++import javax.activation.DataContentHandler;
++import javax.activation.ActivationDataFlavor;
++import javax.activation.DataSource;
++import javax.imageio.ImageIO;
++import javax.imageio.ImageWriter;
++import javax.imageio.stream.ImageOutputStream;
++import java.awt.*;
++import java.awt.image.BufferedImage;
++import java.awt.datatransfer.DataFlavor;
++import java.util.logging.Logger;
++import java.util.Iterator;
++import java.io.IOException;
++import java.io.BufferedInputStream;
++import java.io.OutputStream;
++
++/**
++ * @author Jitendra Kotamraju
++ */
++
++public class ImageDataContentHandler extends Component
++    implements DataContentHandler {
++
++    private static final Logger log = Logger.getLogger(ImageDataContentHandler.class.getName());
++    private final DataFlavor[] flavor;
++
++    public ImageDataContentHandler() {
++        String[] mimeTypes = ImageIO.getReaderMIMETypes();
++        flavor = new DataFlavor[mimeTypes.length];
++        for(int i=0; i < mimeTypes.length; i++) {
++            flavor[i] = new ActivationDataFlavor(Image.class, mimeTypes[i], "Image");
++        }
++    }
++
++    /**
++     * Returns an array of DataFlavor objects indicating the flavors the
++     * data can be provided in. The array should be ordered according to
++     * preference for providing the data (from most richly descriptive to
++     * least descriptive).
++     *
++     * @return The DataFlavors.
++     */
++    public DataFlavor[] getTransferDataFlavors() {
++        return flavor;
++    }
++
++    /**
++     * Returns an object which represents the data to be transferred.
++     * The class of the object returned is defined by the representation class
++     * of the flavor.
++     *
++     * @param df The DataFlavor representing the requested type.
++     * @param ds The DataSource representing the data to be converted.
++     * @return The constructed Object.
++     */
++    public Object getTransferData(DataFlavor df, DataSource ds)
++        throws IOException {
++        for (DataFlavor aFlavor : flavor) {
++            if (aFlavor.equals(df)) {
++                return getContent(ds);
++            }
++        }
++        return null;
++    }
++
++    /**
++     * Return an object representing the data in its most preferred form.
++     * Generally this will be the form described by the first DataFlavor
++     * returned by the <code>getTransferDataFlavors</code> method.
++     *
++     * @param ds The DataSource representing the data to be converted.
++     * @return The constructed Object.
++     */
++    public Object getContent(DataSource ds) throws IOException {
++        return ImageIO.read(new BufferedInputStream(ds.getInputStream()));
++    }
++
++    /**
++     * Convert the object to a byte stream of the specified MIME type
++     * and write it to the output stream.
++     *
++     * @param obj   The object to be converted.
++     * @param type  The requested MIME type of the resulting byte stream.
++     * @param os    The output stream into which to write the converted
++     *          byte stream.
++     */
++
++    public void writeTo(Object obj, String type, OutputStream os)
++        throws IOException {
++
++        try {
++            BufferedImage bufImage;
++            if (obj instanceof BufferedImage) {
++                bufImage = (BufferedImage)obj;
++            } else if (obj instanceof Image) {
++                bufImage = render((Image)obj);
++            } else {
++                throw new IOException(
++                    "ImageDataContentHandler requires Image object, "
++                    + "was given object of type "
++                    + obj.getClass().toString());
++            }
++            ImageWriter writer = null;
++            Iterator<ImageWriter> i = ImageIO.getImageWritersByMIMEType(type);
++            if (i.hasNext()) {
++                writer = i.next();
++            }
++            if (writer != null) {
++                ImageOutputStream stream = ImageIO.createImageOutputStream(os);
++                writer.setOutput(stream);
++                writer.write(bufImage);
++                writer.dispose();
++                stream.close();
++            } else {
++                throw new IOException("Unsupported mime type:"+ type);
++            }
++        } catch (Exception e) {
++            throw new IOException("Unable to encode the image to a stream "
++                + e.getMessage());
++        }
++    }
++
++
++    private BufferedImage render(Image img) throws InterruptedException {
++
++        MediaTracker tracker = new MediaTracker(this);
++        tracker.addImage(img, 0);
++        tracker.waitForAll();
++        BufferedImage bufImage = new BufferedImage(img.getWidth(null),
++            img.getHeight(null), BufferedImage.TYPE_INT_RGB);
++        Graphics g = bufImage.createGraphics();
++        g.drawImage(img, 0, 0, null);
++        g.dispose();
++        return bufImage;
++    }
++
++}
+--- /dev/null	Thu Jul 30 19:02:08 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/MIMEPartStreamingDataHandler.java	Thu Jul 30 19:02:08 2009
+@@ -0,0 +1,129 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++package com.sun.xml.internal.ws.encoding;
++
++import com.sun.xml.internal.org.jvnet.mimepull.MIMEPart;
++
++import javax.activation.DataSource;
++import java.io.InputStream;
++import java.io.IOException;
++import java.io.OutputStream;
++import java.io.File;
++
++import com.sun.xml.internal.ws.developer.StreamingDataHandler;
++
++/**
++ * Implementation of {@link StreamingDataHandler} to access MIME
++ * attachments efficiently. Applications can use the additional methods and decide
++ * on how to access the attachment data in JAX-WS applications.
++ *
++ * <p>
++ * for e.g.:
++ *
++ * DataHandler dh = proxy.getData();
++ * StreamingDataHandler sdh = (StreamingDataHandler)dh;
++ * // readOnce() doesn't store attachment on the disk in some cases
++ * // for e.g when only one huge attachment after soap envelope part in MIME message
++ * InputStream in = sdh.readOnce();
++ * ...
++ * in.close();
++ * sdh.close();
++ *
++ * @author Jitendra Kotamraju
++ */
++public class MIMEPartStreamingDataHandler extends StreamingDataHandler {
++    private final StreamingDataSource ds;
++
++    public MIMEPartStreamingDataHandler(MIMEPart part) {
++        super(new StreamingDataSource(part));
++        ds = (StreamingDataSource)getDataSource();
++    }
++
++    public InputStream readOnce() throws IOException {
++        return ds.readOnce();
++    }
++
++    public void moveTo(File file) throws IOException {
++        ds.moveTo(file);
++    }
++
++    public void close() throws IOException {
++        ds.close();
++    }
++
++    private static final class StreamingDataSource implements DataSource {
++        private final MIMEPart part;
++
++        StreamingDataSource(MIMEPart part) {
++            this.part = part;
++        }
++
++        public InputStream getInputStream() throws IOException {
++            return part.read();             //readOnce() ??
++        }
++
++        InputStream readOnce() throws IOException {
++            try {
++                return part.readOnce();
++            } catch(Exception e) {
++                throw new MyIOException(e);
++            }
++        }
++
++        void moveTo(File file) throws IOException {
++            part.moveTo(file);
++        }
++
++        public OutputStream getOutputStream() throws IOException {
++            return null;
++        }
++
++        public String getContentType() {
++            return part.getContentType();
++        }
++
++        public String getName() {
++            return "";
++        }
++
++        public void close() throws IOException {
++            part.close();
++        }
++    }
++
++    private static final class MyIOException extends IOException {
++        private final Exception linkedException;
++
++        MyIOException(Exception linkedException) {
++            this.linkedException = linkedException;
++        }
++
++        @Override
++        public Throwable getCause() {
++            return linkedException;
++        }
++    }
++
++}
+--- /dev/null	Thu Jul 30 19:02:12 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/ParameterList.java	Thu Jul 30 19:02:11 2009
+@@ -0,0 +1,138 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++package com.sun.xml.internal.ws.encoding;
++
++
++
++
++/*
++ * @(#)ParameterList.java     1.10 03/02/12
++ */
++
++
++import javax.xml.ws.WebServiceException;
++import java.util.HashMap;
++import java.util.Iterator;
++import java.util.Map;
++
++/**
++ * This class holds MIME parameters (attribute-value pairs).
++ *
++ * @version 1.10, 03/02/12
++ * @author  John Mani
++ */
++
++final class ParameterList {
++
++    private final Map<String, String> list;
++
++    /**
++     * Constructor that takes a parameter-list string. The String
++     * is parsed and the parameters are collected and stored internally.
++     * A ParseException is thrown if the parse fails.
++     * Note that an empty parameter-list string is valid and will be
++     * parsed into an empty ParameterList.
++     *
++     * @param   s       the parameter-list string.
++     * @exception WebServiceException if the parse fails.
++     */
++    ParameterList(String s) {
++        HeaderTokenizer h = new HeaderTokenizer(s, HeaderTokenizer.MIME);
++        HeaderTokenizer.Token tk;
++        int type;
++        String name;
++
++        list = new HashMap<String, String>();
++        while (true) {
++            tk = h.next();
++            type = tk.getType();
++
++            if (type == HeaderTokenizer.Token.EOF) // done
++            return;
++
++            if ((char)type == ';') {
++                // expect parameter name
++                tk = h.next();
++                // tolerate trailing semicolon, even though it violates the spec
++                if (tk.getType() == HeaderTokenizer.Token.EOF)
++                    return;
++                // parameter name must be a MIME Atom
++                if (tk.getType() != HeaderTokenizer.Token.ATOM)
++                    throw new WebServiceException();
++                name = tk.getValue().toLowerCase();
++
++                // expect '='
++                tk = h.next();
++                if ((char)tk.getType() != '=')
++                    throw new WebServiceException();
++
++                // expect parameter value
++                tk = h.next();
++                type = tk.getType();
++                // parameter value must be a MIME Atom or Quoted String
++                if (type != HeaderTokenizer.Token.ATOM &&
++                    type != HeaderTokenizer.Token.QUOTEDSTRING)
++                    throw new WebServiceException();
++
++                list.put(name, tk.getValue());
++            } else
++                throw new WebServiceException();
++        }
++    }
++
++    /**
++     * Return the number of parameters in this list.
++     *
++     * @return  number of parameters.
++     */
++    int size() {
++            return list.size();
++    }
++
++    /**
++     * Returns the value of the specified parameter. Note that
++     * parameter names are case-insensitive.
++     *
++     * @param name      parameter name.
++     * @return          Value of the parameter. Returns
++     *                  <code>null</code> if the parameter is not
++     *                  present.
++     */
++    String get(String name) {
++            return list.get(name.trim().toLowerCase());
++    }
++
++
++    /**
++     * Return an enumeration of the names of all parameters in this
++     * list.
++     *
++     * @return Enumeration of all parameter names in this list.
++     */
++    Iterator<String> getNames() {
++            return list.keySet().iterator();
++    }
++
++}
+--- /dev/null	Thu Jul 30 19:02:15 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/RootOnlyCodec.java	Thu Jul 30 19:02:14 2009
+@@ -0,0 +1,71 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++package com.sun.xml.internal.ws.encoding;
++
++import com.sun.istack.internal.NotNull;
++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.Codec;
++
++import java.io.IOException;
++import java.io.InputStream;
++import java.nio.channels.ReadableByteChannel;
++
++/**
++ * {@link Codec} that works only on the root part of the MIME/multipart.
++ * It doesn't work on the attachment parts, so it takes {@link AttachmentSet}
++ * as an argument and creates a corresponding {@link Message}. This enables
++ * attachments to be parsed lazily by wrapping the mimepull parser into an
++ * {@link AttachmentSet}
++ *
++ * @author Jitendra Kotamraju
++ */
++public interface RootOnlyCodec extends Codec {
++
++    /**
++     * Reads root part bytes from {@link InputStream} and constructs a {@link Message}
++     * along with the given attachments.
++     *
++     * @param in root part's data
++     *
++     * @param contentType root part's MIME content type (like "application/xml")
++     *
++     * @param packet the new created {@link Message} is set in this packet
++     *
++     * @param att attachments
++     *
++     * @throws IOException
++     *      if {@link InputStream} throws an exception.
++     */
++    void decode(@NotNull InputStream in, @NotNull String contentType, @NotNull Packet packet, @NotNull AttachmentSet att)
++            throws IOException;
++
++    /**
++     *
++     * @see #decode(InputStream, String, Packet, AttachmentSet)
++     */
++    void decode(@NotNull ReadableByteChannel in, @NotNull String contentType, @NotNull Packet packet, @NotNull AttachmentSet att);
++}
+--- /dev/null	Thu Jul 30 19:02:18 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/StringDataContentHandler.java	Thu Jul 30 19:02:17 2009
+@@ -0,0 +1,148 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++
++package com.sun.xml.internal.ws.encoding;
++
++import javax.activation.ActivationDataFlavor;
++import javax.activation.DataSource;
++import javax.activation.DataContentHandler;
++import java.awt.datatransfer.DataFlavor;
++import java.io.*;
++
++/**
++ * JAF data content handler for text/plain --> String
++ *
++ * @author Anil Vijendran
++ */
++public class StringDataContentHandler implements DataContentHandler {
++
++    /**
++     * return the DataFlavors for this <code>DataContentHandler</code>
++     * @return The DataFlavors.
++     */
++    public DataFlavor[] getTransferDataFlavors() { // throws Exception;
++        DataFlavor flavors[] = new DataFlavor[2];
++        flavors[0] =  new ActivationDataFlavor(String.class, "text/plain", "text string");
++        flavors[1] = new DataFlavor("text/plain", "Plain Text");
++        return flavors;
++    }
++
++    /**
++     * return the Transfer Data of type DataFlavor from InputStream
++     * @param df The DataFlavor.
++     * @param ds The InputStream corresponding to the data.
++     * @return The constructed Object.
++     */
++    public Object getTransferData(DataFlavor df, DataSource ds) {
++
++        // this is sort of hacky, but will work for the
++        // sake of testing...
++        if (df.getMimeType().startsWith("text/plain")) {
++            if (df
++                .getRepresentationClass()
++                .getName()
++                .equals("java.lang.String")) {
++                // spit out String
++                StringBuffer buf = new StringBuffer();
++                char data[] = new char[1024];
++                // InputStream is = null;
++                InputStreamReader isr = null;
++                int bytes_read = 0;
++                int total_bytes = 0;
++
++                try {
++                    isr = new InputStreamReader(ds.getInputStream());
++
++                    while (true) {
++                        bytes_read = isr.read(data);
++                        if (bytes_read > 0)
++                            buf.append(data, 0, bytes_read);
++                        else
++                            break;
++                        total_bytes += bytes_read;
++                    }
++                } catch (Exception e) {
++                }
++
++                return buf.toString();
++
++            } else if (
++                df.getRepresentationClass().getName().equals(
++                    "java.io.InputStream")) {
++                // spit out InputStream
++                try {
++                    return ds.getInputStream();
++                } catch (Exception e) {
++                }
++            }
++
++        }
++        return null;
++    }
++
++    /**
++     *
++     */
++    public Object getContent(DataSource ds) { // throws Exception;
++        StringBuffer buf = new StringBuffer();
++        char data[] = new char[1024];
++        // InputStream is = null;
++        InputStreamReader isr = null;
++        int bytes_read = 0;
++        int total_bytes = 0;
++
++        try {
++            isr = new InputStreamReader(ds.getInputStream());
++
++            while (true) {
++                bytes_read = isr.read(data);
++                if (bytes_read > 0)
++                    buf.append(data, 0, bytes_read);
++                else
++                    break;
++                total_bytes += bytes_read;
++            }
++        } catch (Exception e) {
++        }
++
++        return buf.toString();
++    }
++    /**
++     * construct an object from a byte stream
++     * (similar semantically to previous method, we are deciding
++     *  which one to support)
++     */
++    public void writeTo(Object obj, String mimeType, OutputStream os)
++        throws IOException {
++        if (!mimeType.startsWith("text/plain"))
++            throw new IOException(
++                "Invalid type \"" + mimeType + "\" on StringDCH");
++
++        Writer out = new OutputStreamWriter(os);
++        out.write((String) obj);
++        out.flush();
++    }
++
++}
+--- /dev/null	Thu Jul 30 19:02:21 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/XmlDataContentHandler.java	Thu Jul 30 19:02:20 2009
+@@ -0,0 +1,114 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++package com.sun.xml.internal.ws.encoding;
++
++import com.sun.xml.internal.ws.util.xml.XmlUtil;
++
++import javax.activation.ActivationDataFlavor;
++import javax.activation.DataContentHandler;
++import javax.activation.DataSource;
++import javax.xml.transform.Source;
++import javax.xml.transform.Transformer;
++import javax.xml.transform.stream.StreamResult;
++import javax.xml.transform.stream.StreamSource;
++import java.awt.datatransfer.DataFlavor;
++import java.io.IOException;
++import java.io.OutputStream;
++
++
++/**
++ * JAF data handler for XML content
++ *
++ * @author Anil Vijendran
++ */
++public class XmlDataContentHandler implements DataContentHandler {
++
++    private final DataFlavor[] flavors;
++
++    public XmlDataContentHandler() throws ClassNotFoundException {
++        flavors = new DataFlavor[2];
++        flavors[0] = new ActivationDataFlavor(StreamSource.class, "text/xml", "XML");
++        flavors[1] = new ActivationDataFlavor(StreamSource.class, "application/xml", "XML");
++    }
++
++    /**
++     * return the DataFlavors for this <code>DataContentHandler</code>
++     * @return The DataFlavors.
++     */
++    public DataFlavor[] getTransferDataFlavors() { // throws Exception;
++        return flavors;
++    }
++
++    /**
++     * return the Transfer Data of type DataFlavor from InputStream
++     * @param df The DataFlavor.
++     * @param ds The InputStream corresponding to the data.
++     * @return The constructed Object.
++     */
++    public Object getTransferData(DataFlavor df, DataSource ds)
++        throws IOException {
++
++        for (DataFlavor aFlavor : flavors) {
++            if (aFlavor.equals(df)) {
++                return getContent(ds);
++            }
++        }
++        return null;
++    }
++
++    /**
++     *
++     */
++    public Object getContent(DataSource dataSource) throws IOException {
++        return new StreamSource(dataSource.getInputStream());
++    }
++
++    /**
++     * construct an object from a byte stream
++     * (similar semantically to previous method, we are deciding
++     *  which one to support)
++     */
++    public void writeTo(Object obj, String mimeType, OutputStream os)
++        throws IOException {
++        if (!mimeType.equals("text/xml") && !mimeType.equals("application/xml"))
++            throw new IOException(
++                "Invalid content type \"" + mimeType + "\" for XmlDCH");
++
++        try {
++            Transformer transformer = XmlUtil.newTransformer();
++            StreamResult result = new StreamResult(os);
++            if (obj instanceof DataSource) {
++                // Streaming transform applies only to javax.xml.transform.StreamSource
++                transformer.transform((Source) getContent((DataSource)obj), result);
++            } else {
++                transformer.transform((Source) obj, result);
++            }
++        } catch (Exception ex) {
++            throw new IOException(
++                "Unable to run the JAXP transformer on a stream "
++                    + ex.getMessage());
++        }
++    }
++}
+--- /dev/null	Thu Jul 30 19:02:24 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/ClientMessageHandlerTube.java	Thu Jul 30 19:02:24 2009
+@@ -0,0 +1,150 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++package com.sun.xml.internal.ws.handler;
++
++import com.sun.istack.internal.Nullable;
++import com.sun.xml.internal.ws.api.WSBinding;
++import com.sun.xml.internal.ws.api.handler.MessageHandler;
++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.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.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.client.HandlerConfiguration;
++import com.sun.xml.internal.ws.message.DataHandlerAttachment;
++
++import javax.activation.DataHandler;
++import javax.xml.ws.WebServiceException;
++import javax.xml.ws.handler.MessageContext;
++import javax.xml.ws.handler.Handler;
++import java.util.*;
++
++/**
++ * @author Rama Pulavarthi
++ */
++public class ClientMessageHandlerTube extends HandlerTube {
++    private SEIModel seiModel;
++    private WSBinding binding;
++    private Set<String> roles;
++
++    /**
++     * Creates a new instance of MessageHandlerTube
++     */
++    public ClientMessageHandlerTube(@Nullable SEIModel seiModel, WSBinding binding, WSDLPort port, Tube next) {
++        super(next, port);
++        this.seiModel = seiModel;
++        this.binding = binding;
++    }
++
++    /**
++     * Copy constructor for {@link com.sun.xml.internal.ws.api.pipe.Tube#copy(com.sun.xml.internal.ws.api.pipe.TubeCloner)}.
++     */
++    private ClientMessageHandlerTube(ClientMessageHandlerTube that, TubeCloner cloner) {
++        super(that, cloner);
++        this.seiModel = that.seiModel;
++        this.binding = that.binding;
++    }
++
++    public AbstractFilterTubeImpl copy(TubeCloner cloner) {
++        return new ClientMessageHandlerTube(this, cloner);
++    }
++
++    void callHandlersOnResponse(MessageUpdatableContext context, boolean handleFault) {
++        try {
++            //CLIENT-SIDE
++            processor.callHandlersResponse(HandlerProcessor.Direction.INBOUND, context, handleFault);
++
++        } catch (WebServiceException wse) {
++            //no rewrapping
++            throw wse;
++        } catch (RuntimeException re) {
++            throw new WebServiceException(re);
++        }
++    }
++
++    boolean callHandlersOnRequest(MessageUpdatableContext context, boolean isOneWay) {
++        boolean handlerResult;
++
++        //Lets copy all the MessageContext.OUTBOUND_ATTACHMENT_PROPERTY to the message
++        Map<String, DataHandler> atts = (Map<String, DataHandler>) context.get(MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS);
++        AttachmentSet attSet = packet.getMessage().getAttachments();
++        for(String cid : atts.keySet()){
++            if (attSet.get(cid) == null) {  // Otherwise we would be adding attachments twice
++                Attachment att = new DataHandlerAttachment(cid, atts.get(cid));
++                attSet.add(att);
++            }
++        }
++
++        try {
++            //CLIENT-SIDE
++            handlerResult = processor.callHandlersRequest(HandlerProcessor.Direction.OUTBOUND, context, !isOneWay);
++        } catch (WebServiceException wse) {
++            remedyActionTaken = true;
++            //no rewrapping
++            throw wse;
++        } catch (RuntimeException re) {
++            remedyActionTaken = true;
++
++            throw new WebServiceException(re);
++
++        }
++        if (!handlerResult) {
++            remedyActionTaken = true;
++        }
++        return handlerResult;
++    }
++
++    void closeHandlers(MessageContext mc) {
++        closeClientsideHandlers(mc);
++
++    }
++
++    void setUpProcessor() {
++       // Take a snapshot, User may change chain after invocation, Same chain
++        // should be used for the entire MEP
++        handlers = new ArrayList<Handler>();
++        HandlerConfiguration handlerConfig = ((BindingImpl) binding).getHandlerConfig();
++        List<MessageHandler> msgHandlersSnapShot= handlerConfig.getMessageHandlers();
++        if (!msgHandlersSnapShot.isEmpty()) {
++            handlers.addAll(msgHandlersSnapShot);
++            roles = new HashSet<String>();
++            roles.addAll(handlerConfig.getRoles());
++            processor = new SOAPHandlerProcessor(true, this, binding, handlers);
++        }
++    }
++
++
++
++    MessageUpdatableContext getContext(Packet p) {
++        MessageHandlerContextImpl context = new MessageHandlerContextImpl(seiModel, binding, port, packet,roles);
++        return context;
++    }
++
++
++}
+--- /dev/null	Thu Jul 30 19:02:28 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/MessageHandlerContextImpl.java	Thu Jul 30 19:02:27 2009
+@@ -0,0 +1,84 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++package com.sun.xml.internal.ws.handler;
++
++import com.sun.istack.internal.Nullable;
++import com.sun.xml.internal.ws.api.WSBinding;
++import com.sun.xml.internal.ws.api.handler.MessageHandlerContext;
++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 java.util.Set;
++
++/**
++ * @author Rama Pulavarthi
++ */
++public class MessageHandlerContextImpl extends MessageUpdatableContext implements MessageHandlerContext {
++    private @Nullable SEIModel seiModel;
++    private Set<String> roles;
++    private WSBinding binding;
++    private @Nullable WSDLPort wsdlModel;
++
++    public MessageHandlerContextImpl(@Nullable SEIModel seiModel, WSBinding binding, @Nullable WSDLPort wsdlModel, Packet packet, Set<String> roles) {
++        super(packet);
++        this.seiModel = seiModel;
++        this.binding = binding;
++        this.wsdlModel = wsdlModel;
++        this.roles = roles;
++    }
++    public Message getMessage() {
++        return packet.getMessage();
++    }
++
++    public void setMessage(Message message) {
++        packet.setMessage(message);
++    }
++
++    public Set<String> getRoles() {
++        return roles;
++    }
++
++    public WSBinding getWSBinding() {
++        return binding;
++    }
++
++    public @Nullable SEIModel getSEIModel() {
++        return seiModel;
++    }
++
++    public @Nullable WSDLPort getPort() {
++        return wsdlModel;
++    }
++
++    void updateMessage() {
++       // Do Nothing
++    }
++
++    void setPacketMessage(Message newMessage) {
++        setMessage(newMessage);
++    }
++}
+--- /dev/null	Thu Jul 30 19:02:31 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/handler/ServerMessageHandlerTube.java	Thu Jul 30 19:02:30 2009
+@@ -0,0 +1,149 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++package com.sun.xml.internal.ws.handler;
++
++import com.sun.xml.internal.ws.api.WSBinding;
++import com.sun.xml.internal.ws.api.handler.MessageHandler;
++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.api.model.SEIModel;
++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.client.HandlerConfiguration;
++import com.sun.xml.internal.ws.message.DataHandlerAttachment;
++
++import javax.activation.DataHandler;
++import javax.xml.ws.WebServiceException;
++import javax.xml.ws.handler.MessageContext;
++import javax.xml.ws.handler.Handler;
++import java.util.*;
++
++/**
++ * @author Rama Pulavarthi
++ */
++public class ServerMessageHandlerTube extends HandlerTube{
++    private SEIModel seiModel;
++    private WSBinding binding;
++    private Set<String> roles;
++
++    public ServerMessageHandlerTube(SEIModel seiModel, WSBinding binding, Tube next, HandlerTube cousinTube) {
++        super(next, cousinTube);
++        this.seiModel = seiModel;
++        this.binding = binding;
++        setUpHandlersOnce();
++    }
++
++    /**
++     * Copy constructor for {@link com.sun.xml.internal.ws.api.pipe.Tube#copy(com.sun.xml.internal.ws.api.pipe.TubeCloner)}.
++     */
++    private ServerMessageHandlerTube(ServerMessageHandlerTube that, TubeCloner cloner) {
++        super(that, cloner);
++        this.seiModel = that.seiModel;
++        this.binding = that.binding;
++        this.handlers = that.handlers;
++        this.roles = that.roles;
++    }
++
++    private void setUpHandlersOnce() {
++        handlers = new ArrayList<Handler>();
++        HandlerConfiguration handlerConfig = ((BindingImpl) binding).getHandlerConfig();
++        List<MessageHandler> msgHandlersSnapShot= handlerConfig.getMessageHandlers();
++        if (!msgHandlersSnapShot.isEmpty()) {
++            handlers.addAll(msgHandlersSnapShot);
++            roles = new HashSet<String>();
++            roles.addAll(handlerConfig.getRoles());
++        }
++    }
++
++    void callHandlersOnResponse(MessageUpdatableContext context, boolean handleFault) {
++        //Lets copy all the MessageContext.OUTBOUND_ATTACHMENT_PROPERTY to the message
++        Map<String, DataHandler> atts = (Map<String, DataHandler>) context.get(MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS);
++        AttachmentSet attSet = packet.getMessage().getAttachments();
++        for(String cid : atts.keySet()){
++            if (attSet.get(cid) == null) { // Otherwise we would be adding attachments twice
++                Attachment att = new DataHandlerAttachment(cid, atts.get(cid));
++                attSet.add(att);
++            }
++        }
++
++        try {
++            //SERVER-SIDE
++            processor.callHandlersResponse(HandlerProcessor.Direction.OUTBOUND, context, handleFault);
++
++        } catch (WebServiceException wse) {
++            //no rewrapping
++            throw wse;
++        } catch (RuntimeException re) {
++            throw re;
++
++        }
++    }
++
++    boolean callHandlersOnRequest(MessageUpdatableContext context, boolean isOneWay) {
++        boolean handlerResult;
++        try {
++            //SERVER-SIDE
++            handlerResult = processor.callHandlersRequest(HandlerProcessor.Direction.INBOUND, context, !isOneWay);
++
++        } catch (RuntimeException re) {
++            remedyActionTaken = true;
++            throw re;
++
++        }
++        if (!handlerResult) {
++            remedyActionTaken = true;
++        }
++        return handlerResult;
++    }
++
++    void setUpProcessor() {
++        if(!handlers.isEmpty()) {
++            processor = new SOAPHandlerProcessor(false, this, binding, handlers);
++        }
++    }
++
++    void closeHandlers(MessageContext mc) {
++        closeServersideHandlers(mc);
++
++    }
++    MessageUpdatableContext getContext(Packet packet) {
++       MessageHandlerContextImpl context = new MessageHandlerContextImpl(seiModel, binding, port, packet, roles);
++       return context;
++    }
++
++    //should be overridden by DriverHandlerTubes
++    @Override
++    protected void initiateClosing(MessageContext mc) {
++      close(mc);
++      super.initiateClosing(mc);
++    }
++
++   public AbstractFilterTubeImpl copy(TubeCloner cloner) {
++        return new ServerMessageHandlerTube(this, cloner);
++    }
++}
+--- /dev/null	Thu Jul 30 19:02:34 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/message/FaultMessage.java	Thu Jul 30 19:02:33 2009
+@@ -0,0 +1,55 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++package com.sun.xml.internal.ws.message;
++
++import com.sun.istack.internal.Nullable;
++import com.sun.xml.internal.ws.api.message.Message;
++import com.sun.xml.internal.ws.api.message.FilterMessageImpl;
++import com.sun.xml.internal.ws.api.model.wsdl.WSDLFault;
++
++import javax.xml.namespace.QName;
++
++/**
++ * SOAP Fault message. It has optimized implementation to get
++ * first detail entry's name. This is useful to identify the
++ * corresponding {@link WSDLFault}
++ *
++ * @author Jitendra Kotamraju
++ */
++public class FaultMessage extends FilterMessageImpl {
++
++    private final @Nullable QName detailEntryName;
++
++    public FaultMessage(Message delegate, @Nullable QName detailEntryName) {
++        super(delegate);
++        this.detailEntryName = detailEntryName;
++    }
++
++    @Override
++    public @Nullable QName getFirstDetailEntryName() {
++        return detailEntryName;
++    }
++
++}
+--- /dev/null	Thu Jul 30 19:02:37 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/model/FieldSignature.java	Thu Jul 30 19:02:36 2009
+@@ -0,0 +1,100 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++package com.sun.xml.internal.ws.model;
++
++import java.util.*;
++import java.util.logging.Logger;
++import java.lang.reflect.*;
++
++/**
++ * Creates vm signature string from Type
++ *
++ * TypeSignature: Z | C | B | S | I | F | J | D | FieldTypeSignature
++ * FieldTypeSignature: ClassTypeSignature | [ TypeSignature | TypeVar
++ * ClassTypeSignature: L Id ( / Id )* TypeArgs? ( . Id TypeArgs? )* ;
++ * TypeArgs: < TypeArg+ >
++ * TypeArg: * | ( + | - )? FieldTypeSignature
++ * TypeVar: T Id ;
++ *
++ * @author Jitendra Kotamraju
++ */
++public class FieldSignature {
++
++    static String vms(Type t) {
++        if (t instanceof Class || t instanceof ParameterizedType) {
++            return "L"+fqcn(t)+";";
++        } else if (t instanceof GenericArrayType) {
++            return "["+vms(((GenericArrayType)t).getGenericComponentType());
++        } else if (t instanceof TypeVariable) {
++            // While creating wrapper bean fields, it doesn't create with TypeVariables
++            // Otherwise, the type variable need to be declared in the wrapper bean class
++            // return "T"+((TypeVariable)t).getName()+";";
++            return "Ljava/lang/Object;";        // TODO bounds ??
++        } else if (t instanceof WildcardType) {
++            WildcardType w = (WildcardType)t;
++            if (w.getLowerBounds().length > 0) {
++                return "-"+vms(w.getLowerBounds()[0]);
++            } else if (w.getUpperBounds().length > 0) {
++                Type wt = w.getUpperBounds()[0];
++                if (wt.equals(Object.class)) {
++                    return "*";
++                } else {
++                    return "+"+vms(wt);
++                }
++            }
++        }
++        throw new IllegalArgumentException("Illegal vms arg " + t);
++    }
++
++    private static String fqcn(Type t) {
++        if (t instanceof Class) {
++            Class c = (Class)t;
++            if (c.getDeclaringClass() == null) {
++                return c.getName().replace('.', '/');
++            } else {
++                return fqcn(c.getDeclaringClass())+"."+c.getSimpleName();
++            }
++        } else if (t instanceof ParameterizedType) {
++            ParameterizedType p = (ParameterizedType)t;
++            if (p.getOwnerType() == null) {
++                return fqcn(p.getRawType())+args(p);
++            } else {
++                assert p.getRawType() instanceof Class;
++                return fqcn(p.getOwnerType())+"."+
++                        ((Class)p.getRawType()).getSimpleName()+args(p);
++            }
++        }
++        throw new IllegalArgumentException("Illegal fqcn arg = "+t);
++    }
++
++    private static String args(ParameterizedType p) {
++        String sig = "<";
++        for(Type t : p.getActualTypeArguments()) {
++            sig += vms(t);
++        }
++        return sig+">";
++    }
++
++}
+--- /dev/null	Thu Jul 30 19:02:40 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/model/Injector.java	Thu Jul 30 19:02:40 2009
+@@ -0,0 +1,192 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++package com.sun.xml.internal.ws.model;
++
++import com.sun.xml.internal.bind.Util;
++import com.sun.xml.internal.bind.v2.runtime.reflect.Accessor;
++
++import java.lang.ref.WeakReference;
++import java.lang.reflect.Method;
++import java.lang.reflect.InvocationTargetException;
++import java.util.Map;
++import java.util.Collections;
++import java.util.WeakHashMap;
++import java.util.HashMap;
++import java.util.logging.Logger;
++import java.util.logging.Level;
++import java.security.AccessController;
++import java.security.PrivilegedAction;
++
++/**
++ * A {@link ClassLoader} used to "inject" optimized accessor classes
++ * into the VM.
++ *
++ * <p>
++ * Its parent class loader needs to be set to the one that can see the user
++ * class.
++ *
++ * @author Kohsuke Kawaguchi
++ */
++final class Injector {
++
++    /**
++     * {@link Injector}s keyed by their parent {@link ClassLoader}.
++     *
++     * We only need one injector per one user class loader.
++     */
++    private static final Map<ClassLoader,WeakReference<Injector>> injectors =
++        Collections.synchronizedMap(new WeakHashMap<ClassLoader,WeakReference<Injector>>());
++
++    private static final Logger logger = Util.getClassLogger();
++
++    /**
++     * Injects a new class into the given class loader.
++     *
++     * @return null
++     *      if it fails to inject.
++     */
++    static Class inject( ClassLoader cl, String className, byte[] image ) {
++        Injector injector = get(cl);
++        if(injector!=null)
++            return injector.inject(className,image);
++        else
++            return null;
++    }
++
++    /**
++     * Returns the already injected class, or null.
++     */
++    static Class find( ClassLoader cl, String className ) {
++        Injector injector = get(cl);
++        if(injector!=null)
++            return injector.find(className);
++        else
++            return null;
++    }
++
++    /**
++     * Gets or creates an {@link Injector} for the given class loader.
++     *
++     * @return null
++     *      if it fails.
++     */
++    private static Injector get(ClassLoader cl) {
++        Injector injector = null;
++        WeakReference<Injector> wr = injectors.get(cl);
++        if(wr!=null)
++            injector = wr.get();
++        if(injector==null)
++            try {
++                injectors.put(cl,new WeakReference<Injector>(injector = new Injector(cl)));
++            } catch (SecurityException e) {
++                logger.log(Level.FINE,"Unable to set up a back-door for the injector",e);
++                return null;
++            }
++        return injector;
++    }
++
++    /**
++     * Injected classes keyed by their names.
++     */
++    private final Map<String,Class> classes = new HashMap<String,Class>();
++
++    private final ClassLoader parent;
++
++    /**
++     * True if this injector is capable of injecting accessors.
++     * False otherwise, which happens if this classloader can't see {@link com.sun.xml.internal.bind.v2.runtime.reflect.Accessor}.
++     */
++    private final boolean loadable;
++
++    private static final Method defineClass;
++    private static final Method resolveClass;
++
++    static {
++        try {
++            defineClass = ClassLoader.class.getDeclaredMethod("defineClass",String.class,byte[].class,Integer.TYPE,Integer.TYPE);
++            resolveClass = ClassLoader.class.getDeclaredMethod("resolveClass",Class.class);
++        } catch (NoSuchMethodException e) {
++            // impossible
++            throw new NoSuchMethodError(e.getMessage());
++        }
++        AccessController.doPrivileged(new PrivilegedAction<Void>() {
++            public Void run() {
++                // TODO: check security implication
++                // do these setAccessible allow anyone to call these methods freely?s
++                defineClass.setAccessible(true);
++                resolveClass.setAccessible(true);
++                return null;
++            }
++        });
++    }
++
++    private Injector(ClassLoader parent) {
++        this.parent = parent;
++        assert parent!=null;
++
++        boolean loadable = false;
++
++        try {
++            loadable = parent.loadClass(Accessor.class.getName())==Accessor.class;
++        } catch (ClassNotFoundException e) {
++            ; // not loadable
++        }
++
++        this.loadable = loadable;
++    }
++
++
++    private synchronized Class inject(String className, byte[] image) {
++        if(!loadable)   // this injector cannot inject anything
++            return null;
++
++        Class c = classes.get(className);
++        if(c==null) {
++            // we need to inject a class into the
++            try {
++                c = (Class)defineClass.invoke(parent,className.replace('/','.'),image,0,image.length);
++                resolveClass.invoke(parent,c);
++            } catch (IllegalAccessException e) {
++                logger.log(Level.FINE,"Unable to inject "+className,e);
++                return null;
++            } catch (InvocationTargetException e) {
++                logger.log(Level.FINE,"Unable to inject "+className,e);
++                return null;
++            } catch (SecurityException e) {
++                logger.log(Level.FINE,"Unable to inject "+className,e);
++                return null;
++            } catch (LinkageError e) {
++                logger.log(Level.FINE,"Unable to inject "+className,e);
++                return null;
++            }
++            classes.put(className,c);
++        }
++        return c;
++    }
++
++    private synchronized Class find(String className) {
++        return classes.get(className);
++    }
++}
+--- /dev/null	Thu Jul 30 19:02:44 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/model/WrapperBeanGenerator.java	Thu Jul 30 19:02:43 2009
+@@ -0,0 +1,659 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++package com.sun.xml.internal.ws.model;
++
++import com.sun.istack.internal.NotNull;
++import com.sun.xml.internal.bind.api.JAXBRIContext;
++import com.sun.xml.internal.ws.util.StringUtils;
++import static com.sun.xml.internal.ws.org.objectweb.asm.Opcodes.*;
++import com.sun.xml.internal.ws.org.objectweb.asm.Type;
++import com.sun.xml.internal.ws.org.objectweb.asm.*;
++
++import javax.jws.WebParam;
++import javax.jws.WebResult;
++import javax.xml.bind.annotation.XmlAttachmentRef;
++import javax.xml.bind.annotation.XmlList;
++import javax.xml.bind.annotation.XmlMimeType;
++import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
++import javax.xml.ws.Holder;
++import javax.xml.ws.WebServiceException;
++import javax.xml.namespace.QName;
++import java.lang.annotation.Annotation;
++import java.lang.reflect.*;
++import java.util.*;
++import java.util.logging.Logger;
++import java.util.logging.Level;
++
++/**
++ * Byte code generator for request,response wrapper and exception beans
++ *
++ * @author Jitendra Kotamraju
++ */
++public class WrapperBeanGenerator {
++
++    private static final Logger LOGGER = Logger.getLogger(WrapperBeanGenerator.class.getName());
++
++    public static final String PD                           = ".";
++    public static final String JAXWS                        = "jaxws";
++    public static final String JAXWS_PACKAGE_PD             = JAXWS+PD;
++    public static final String PD_JAXWS_PACKAGE_PD          = PD+JAXWS+PD;
++
++    // Creates class's bytes
++    private static byte[] createBeanImage(String className,
++                               String rootName, String rootNS,
++                               String typeName, String typeNS, String[] propOrder,
++                               List<Field> fields) throws Exception {
++
++        ClassWriter cw = new ClassWriter(0);
++        //org.objectweb.asm.util.TraceClassVisitor cw = new org.objectweb.asm.util.TraceClassVisitor(actual, new java.io.PrintWriter(System.out));
++
++        cw.visit(V1_5, ACC_PUBLIC + ACC_SUPER, replaceDotWithSlash(className), null, "java/lang/Object", null);
++
++        AnnotationVisitor root = cw.visitAnnotation("Ljavax/xml/bind/annotation/XmlRootElement;", true);
++        root.visit("name", rootName);
++        root.visit("namespace", rootNS);
++        root.visitEnd();
++
++        AnnotationVisitor type = cw.visitAnnotation("Ljavax/xml/bind/annotation/XmlType;", true);
++        type.visit("name", typeName);
++        type.visit("namespace", typeNS);
++        if (propOrder.length > 1) {
++            AnnotationVisitor propVisitor = type.visitArray("propOrder");
++            for(String prop : propOrder) {
++                propVisitor.visit("propOrder", prop);
++            }
++            propVisitor.visitEnd();
++        }
++        type.visitEnd();
++
++        for(Field field : fields) {
++            FieldVisitor fv = cw.visitField(ACC_PUBLIC, field.fieldName, field.asmType.getDescriptor(), field.getSignature(), null);
++
++            if (!field.noXmlElem) { // Exception fields do not have any @XmlElement
++                AnnotationVisitor elem = fv.visitAnnotation("Ljavax/xml/bind/annotation/XmlElement;", true);
++                elem.visit("name", field.elementName);
++                elem.visit("namespace", field.elementNS);
++                if (field.reflectType instanceof GenericArrayType) {
++                    elem.visit("nillable", true);
++                }
++                elem.visitEnd();
++            }
++
++            for(Annotation ann : field.jaxbAnnotations) {
++                if (ann instanceof XmlMimeType) {
++                    AnnotationVisitor mime = fv.visitAnnotation("Ljavax/xml/bind/annotation/XmlMimeType;", true);
++                    mime.visit("value", ((XmlMimeType)ann).value());
++                    mime.visitEnd();
++                } else if (ann instanceof XmlJavaTypeAdapter) {
++                    AnnotationVisitor ada = fv.visitAnnotation("Ljavax/xml/bind/annotation/XmlJavaTypeAdapter;", true);
++                    ada.visit("value", ((XmlJavaTypeAdapter)ann).value());
++                    ada.visit("type", ((XmlJavaTypeAdapter)ann).type());
++                    ada.visitEnd();
++                } else if (ann instanceof XmlAttachmentRef) {
++                    AnnotationVisitor att = fv.visitAnnotation("Ljavax/xml/bind/annotation/XmlAttachmentRef;", true);
++                    att.visitEnd();
++                } else if (ann instanceof XmlList) {
++                    AnnotationVisitor list = fv.visitAnnotation("Ljavax/xml/bind/annotation/XmlList;", true);
++                    list.visitEnd();
++                } else {
++                    throw new WebServiceException("Unknown JAXB annotation " + ann);
++                }
++            }
++
++            fv.visitEnd();
++        }
++
++        MethodVisitor mv = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null);
++        mv.visitCode();
++        mv.visitVarInsn(ALOAD, 0);
++        mv.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "<init>", "()V");
++        mv.visitInsn(RETURN);
++        mv.visitMaxs(1, 1);
++        mv.visitEnd();
++
++        cw.visitEnd();
++
++        if (LOGGER.isLoggable(Level.INFO)) {
++            // Class's @XmlRootElement
++            StringBuilder sb = new StringBuilder();
++            sb.append("\n");
++            sb.append("@XmlRootElement(name=");
++            sb.append(rootName);
++            sb.append(", namespace=");
++            sb.append(rootNS);
++            sb.append(")");
++
++            // Class's @XmlType
++            sb.append("\n");
++            sb.append("@XmlType(name=");
++            sb.append(typeName);
++            sb.append(", namespace=");
++            sb.append(typeNS);
++            if (propOrder.length > 1) {
++                sb.append(", propOrder={");
++                for(int i=0; i < propOrder.length; i++) {
++                    if (i != 0) {
++                        sb.append(", ");
++                    }
++                    sb.append(propOrder[i]);
++                }
++                sb.append("}");
++            }
++            sb.append(")");
++
++            // class declaration
++            sb.append("\n");
++            sb.append("public class ");
++            sb.append(className);
++            sb.append(" {");
++
++            // fields declaration
++            for(Field field : fields) {
++                sb.append("\n");
++
++                // Field's @XmlRootElement decl
++                if (!field.noXmlElem) {
++                    sb.append("\n    ");
++                    sb.append("@XmlRootElement(name=");
++                    sb.append(field.elementName);
++                    sb.append(", namespace=");
++                    sb.append(field.elementNS);
++                    if (field.reflectType instanceof GenericArrayType) {
++                        sb.append("nillable=true");
++                    }
++                    sb.append(")");
++                }
++
++                // Field's other JAXB annotations
++                for(Annotation ann : field.jaxbAnnotations) {
++                    sb.append("\n    ");
++
++                    if (ann instanceof XmlMimeType) {
++                        sb.append("@XmlMimeType(value=");
++                        sb.append(((XmlMimeType)ann).value());
++                        sb.append(")");
++                    } else if (ann instanceof XmlJavaTypeAdapter) {
++                        sb.append("@XmlJavaTypeAdapter(value=");
++                        sb.append(((XmlMimeType)ann).value());
++                        sb.append(", type=");
++                        sb.append(((XmlJavaTypeAdapter)ann).type());
++                        sb.append(")");
++                    } else if (ann instanceof XmlAttachmentRef) {
++                        sb.append("@XmlAttachmentRef");
++                    } else if (ann instanceof XmlList) {
++                        sb.append("@XmlList");
++                    } else {
++                        throw new WebServiceException("Unknown JAXB annotation " + ann);
++                    }
++                }
++
++                // Field declaration
++                sb.append("\n    ");
++                sb.append("public ");
++                if (field.getSignature() == null) {
++                    sb.append(field.asmType.getDescriptor());
++                } else {
++                    sb.append(field.getSignature());
++                }
++                sb.append(" ");
++                sb.append(field.fieldName);
++            }
++
++            sb.append("\n\n}");
++            LOGGER.fine(sb.toString());
++        }
++
++        return cw.toByteArray();
++    }
++
++    private static String replaceDotWithSlash(String name) {
++        return name.replace('.', '/');
++    }
++
++    static Class createRequestWrapperBean(String className, Method method, QName reqElemName, ClassLoader cl) {
++
++        LOGGER.fine("Request Wrapper Class : "+className);
++
++        List<Field> fields = collectRequestWrapperMembers(method);
++
++        String[] propOrder = getPropOrder(fields);
++
++        byte[] image;
++        try {
++            image = createBeanImage(className, reqElemName.getLocalPart(), reqElemName.getNamespaceURI(),
++                reqElemName.getLocalPart(), reqElemName.getNamespaceURI(), propOrder,
++                fields);
++        } catch(Exception e) {
++            throw new WebServiceException(e);
++        }
++
++        return Injector.inject(cl, className, image);
++    }
++
++    static Class createResponseWrapperBean(String className, Method method, QName resElemName, ClassLoader cl) {
++
++        LOGGER.fine("Response Wrapper Class : "+className);
++
++        List<Field> fields = collectResponseWrapperMembers(method);
++
++        String[] propOrder = getPropOrder(fields);
++
++        byte[] image;
++        try {
++            image = createBeanImage(className, resElemName.getLocalPart(), resElemName.getNamespaceURI(),
++                resElemName.getLocalPart(), resElemName.getNamespaceURI(), propOrder,
++                fields);
++        } catch(Exception e) {
++            throw new WebServiceException(e);
++        }
++
++        return Injector.inject(cl, className, image);
++    }
++
++    private static String[] getPropOrder(List<Field> fields) {
++        String[] propOrder = new String[fields.size()];
++        for(int i=0; i < fields.size(); i++) {
++            propOrder[i] = fields.get(i).fieldName;
++        }
++        return propOrder;
++    }
++
++    private static List<Field> collectRequestWrapperMembers(Method method) {
++
++        List<Field> fields = new ArrayList<Field>();
++        Annotation[][] paramAnns = method.getParameterAnnotations();
++        java.lang.reflect.Type[] paramTypes = method.getGenericParameterTypes();
++        Type[] asmTypes = Type.getArgumentTypes(method);
++        for(int i=0; i < paramTypes.length; i++) {
++            WebParam webParam = findAnnotation(paramAnns[i], WebParam.class);
++            if (webParam != null && webParam.header()) {
++                continue;
++            }
++            List<Annotation> jaxb = collectJAXBAnnotations(paramAnns[i]);
++
++            java.lang.reflect.Type paramType =  getHolderValueType(paramTypes[i]);
++            Type asmType = isHolder(paramTypes[i]) ? getASMType(paramType) : asmTypes[i];
++
++            String paramNamespace = "";
++            String paramName =  "arg"+i;
++            WebParam.Mode mode = WebParam.Mode.IN;
++            if (webParam != null) {
++                mode = webParam.mode();
++                if (webParam.name().length() > 0)
++                    paramName = webParam.name();
++                if (webParam.targetNamespace().length() > 0)
++                    paramNamespace = webParam.targetNamespace();
++            }
++
++            String fieldName = JAXBRIContext.mangleNameToVariableName(paramName);
++            //We wont have to do this if JAXBRIContext.mangleNameToVariableName() takes
++            //care of mangling java reserved keywords
++            fieldName = getJavaReservedVarialbeName(fieldName);
++
++            Field memInfo = new Field(fieldName, paramType, asmType, paramName, paramNamespace, jaxb);
++
++            if (mode.equals(WebParam.Mode.IN) || mode.equals(WebParam.Mode.INOUT)) {
++                fields.add(memInfo);
++            }
++
++        }
++        return fields;
++    }
++
++    private static List<Field> collectResponseWrapperMembers(Method method) {
++
++        List<Field> fields = new ArrayList<Field>();
++
++        // Collect all OUT, INOUT parameters as fields
++        Annotation[][] paramAnns = method.getParameterAnnotations();
++        java.lang.reflect.Type[] paramTypes = method.getGenericParameterTypes();
++        Type[] asmTypes = Type.getArgumentTypes(method);
++        for(int i=0; i < paramTypes.length; i++) {
++            WebParam webParam = findAnnotation(paramAnns[i], WebParam.class);
++            if (webParam != null) {
++                if (webParam.header() || webParam.mode() == WebParam.Mode.IN) {
++                    continue;
++                }
++            }
++            if (!isHolder(paramTypes[i])) {
++                continue;
++            }
++
++            List<Annotation> jaxb = collectJAXBAnnotations(paramAnns[i]);
++
++            java.lang.reflect.Type paramType = getHolderValueType(paramTypes[i]);
++            Type asmType = getASMType(paramType);
++
++            String paramNamespace = "";
++            String paramName =  "arg"+i;
++
++            if (webParam != null) {
++                if (webParam.name().length() > 0)
++                    paramName = webParam.name();
++                if (webParam.targetNamespace().length() > 0)
++                    paramNamespace = webParam.targetNamespace();
++            }
++
++            String fieldName = JAXBRIContext.mangleNameToVariableName(paramName);
++            //We wont have to do this if JAXBRIContext.mangleNameToVariableName() takes
++            //care of mangling java reserved keywords
++            fieldName = getJavaReservedVarialbeName(fieldName);
++
++            fields.add(new Field(fieldName, paramType, asmType, paramName, paramNamespace, jaxb));
++        }
++
++        WebResult webResult = method.getAnnotation(WebResult.class);
++        java.lang.reflect.Type returnType = method.getGenericReturnType();
++        Type asmType = Type.getReturnType(method);
++        if (!((webResult != null && webResult.header()) || returnType == Void.TYPE)) {
++            String fieldElementName = "return";
++            String fieldName = "_return";
++            String fieldNamespace = "";
++
++            if (webResult != null) {
++                if (webResult.name().length() > 0) {
++                    fieldElementName = webResult.name();
++                    fieldName = JAXBRIContext.mangleNameToVariableName(webResult.name());
++                    //We wont have to do this if JAXBRIContext.mangleNameToVariableName() takes
++                    //care of mangling java identifiers
++                    fieldName = getJavaReservedVarialbeName(fieldName);
++                }
++                if (webResult.targetNamespace().length() > 1) {
++                    fieldNamespace = webResult.targetNamespace();
++                }
++            }
++
++            List<Annotation> jaxb = collectJAXBAnnotations(method.getAnnotations());
++
++            fields.add(new Field(fieldName, returnType, asmType, fieldElementName, fieldNamespace, jaxb));
++        }
++        return fields;
++    }
++
++    private static boolean isHolder(java.lang.reflect.Type type) {
++        if (type instanceof ParameterizedType) {
++            ParameterizedType p = (ParameterizedType)type;
++            if (p.getRawType().equals(Holder.class)) {
++                return true;
++            }
++        }
++        return false;
++    }
++
++    private static Type getASMType(java.lang.reflect.Type t) {
++        assert t!=null;
++
++        if (t instanceof Class) {
++            return Type.getType((Class)t);
++        }
++
++        if (t instanceof ParameterizedType) {
++            ParameterizedType pt = (ParameterizedType)t;
++            if (pt.getRawType() instanceof Class) {
++                return Type.getType((Class)pt.getRawType());
++            }
++        }
++        if (t instanceof GenericArrayType) {
++            // TODO
++        }
++
++        if (t instanceof WildcardType) {
++            // TODO
++        }
++        if (t instanceof TypeVariable) {
++            TypeVariable tv = (TypeVariable)t;
++            if (tv.getBounds()[0] instanceof Class) {
++                return Type.getType((Class)tv.getBounds()[0]);
++            }
++        }
++
++        // covered all the cases
++        assert false;
++        throw new IllegalArgumentException("Not creating ASM Type for type = "+t);
++    }
++
++    private static java.lang.reflect.Type getHolderValueType(java.lang.reflect.Type paramType) {
++        if (paramType instanceof ParameterizedType) {
++            ParameterizedType p = (ParameterizedType)paramType;
++            if (p.getRawType().equals(Holder.class)) {
++                return p.getActualTypeArguments()[0];
++            }
++        }
++        return paramType;
++    }
++
++    private static <T extends Annotation> T findAnnotation(Annotation[] anns, Class<T> annotationClass) {
++        for(Annotation a : anns) {
++            if (a.annotationType() == annotationClass) {
++                return (T)a;
++            }
++        }
++        return null;
++    }
++
++    static Class createExceptionBean(String className, Class exception, String typeNS, String elemName, String elemNS, ClassLoader cl) {
++
++        List<Field> fields = collectExceptionProperties(exception);
++        String[] propOrder = getPropOrder(fields);
++
++        byte[] image;
++        try {
++            image = createBeanImage(className, elemName, elemNS,
++                exception.getSimpleName(), typeNS, propOrder,
++                fields);
++        } catch(Exception e) {
++            throw new WebServiceException(e);
++        }
++
++        return Injector.inject(cl, className, image);
++    }
++
++    private static List<Field> collectExceptionProperties(Class exception) {
++        List<Field> fields = new ArrayList<Field>();
++
++        Method[] methods = exception.getMethods();
++        for (Method method : methods) {
++            int mod = method.getModifiers();
++            if (!Modifier.isPublic(mod)
++                || (Modifier.isFinal(mod) && Modifier.isStatic(mod))
++                || Modifier.isTransient(mod)) { // no final static, transient, non-public
++                continue;
++            }
++            String name = method.getName();
++            if (!(name.startsWith("get") || name.startsWith("is")) || skipProperties.contains(name) ||
++                name.equals("get") || name.equals("is")) {
++                // Don't bother with invalid propertyNames.
++                continue;
++            }
++
++            java.lang.reflect.Type[] paramTypes = method.getGenericParameterTypes();
++            java.lang.reflect.Type returnType = method.getGenericReturnType();
++            Type asmType = Type.getReturnType(method);
++            if (paramTypes.length == 0) {
++                if (name.startsWith("get")) {
++                    String fieldName = StringUtils.decapitalize(name.substring(3));
++                    Field field = new Field(fieldName, returnType, asmType, true, Collections.<Annotation>emptyList());
++                    fields.add(field);
++                } else {
++                    String fieldName = StringUtils.decapitalize(name.substring(2));
++                    Field field = new Field(fieldName, returnType, asmType, true, Collections.<Annotation>emptyList());
++                    fields.add(field);
++                }
++            }
++        }
++        Collections.sort(fields);
++        return fields;
++    }
++
++
++    private static List<Annotation> collectJAXBAnnotations(Annotation[] anns) {
++        Class[] known = { XmlAttachmentRef.class, XmlMimeType.class, XmlJavaTypeAdapter.class, XmlList.class };
++        List<Annotation> jaxbAnnotation = new ArrayList<Annotation>();
++        for(Class c : known) {
++            Annotation a = findAnnotation(anns, c);
++            if (a != null) {
++                jaxbAnnotation.add(a);
++            }
++        }
++        return jaxbAnnotation;
++    }
++
++
++    private List<Annotation> collectJAXBAnnotations(Method method) {
++        Class[] known = { XmlAttachmentRef.class, XmlMimeType.class, XmlJavaTypeAdapter.class, XmlList.class };
++        List<Annotation> jaxbAnnotation = new ArrayList<Annotation>();
++        for(Class c : known) {
++            Annotation ann = method.getAnnotation(c);
++            if(ann != null) {
++                jaxbAnnotation.add(ann);
++            }
++        }
++        return jaxbAnnotation;
++    }
++
++    private static class Field implements Comparable<Field> {
++        private final java.lang.reflect.Type reflectType;
++        private final Type asmType;
++        private final String fieldName;
++        private final String elementName;
++        private final String elementNS;
++        private final List<Annotation> jaxbAnnotations;
++        private final boolean noXmlElem;
++
++        Field(String paramName, java.lang.reflect.Type paramType, Type asmType, String elementName,
++              String elementNS, List<Annotation> jaxbAnnotations) {
++            this(paramName, paramType, asmType, false, elementName, elementNS, jaxbAnnotations);
++        }
++
++        Field(String paramName, java.lang.reflect.Type paramType, Type asmType, boolean noXmlElem,
++              List<Annotation> jaxbAnnotations) {
++            this(paramName, paramType, asmType, noXmlElem, null,null, jaxbAnnotations);
++        }
++
++        Field(String paramName, java.lang.reflect.Type paramType, Type asmType, boolean noXmlElem,
++              String elementName, String elementNS, List<Annotation> jaxbAnnotations) {
++            this.reflectType = paramType;
++            this.asmType = asmType;
++            this.fieldName = paramName;
++            this.noXmlElem = noXmlElem;
++            this.elementName = elementName;
++            this.elementNS = elementNS;
++            this.jaxbAnnotations = jaxbAnnotations;
++        }
++
++        String getSignature() {
++            if (reflectType instanceof Class) {
++                return null;
++            }
++            if (reflectType instanceof TypeVariable) {
++                return null;
++            }
++            return FieldSignature.vms(reflectType);
++        }
++
++        public int compareTo(Field o) {
++            return fieldName.compareTo(o.fieldName);
++        }
++
++    }
++
++    // TODO MOVE Names to runtime (instead of doing the following)
++
++    /**
++     * See if its a java keyword name, if so then mangle the name
++     */
++    private static @NotNull String getJavaReservedVarialbeName(@NotNull String name) {
++        String reservedName = reservedWords.get(name);
++        return reservedName == null ? name : reservedName;
++    }
++
++    private static final Map<String, String> reservedWords;
++
++    static {
++        reservedWords = new HashMap<String, String>();
++        reservedWords.put("abstract", "_abstract");
++        reservedWords.put("assert", "_assert");
++        reservedWords.put("boolean", "_boolean");
++        reservedWords.put("break", "_break");
++        reservedWords.put("byte", "_byte");
++        reservedWords.put("case", "_case");
++        reservedWords.put("catch", "_catch");
++        reservedWords.put("char", "_char");
++        reservedWords.put("class", "_class");
++        reservedWords.put("const", "_const");
++        reservedWords.put("continue", "_continue");
++        reservedWords.put("default", "_default");
++        reservedWords.put("do", "_do");
++        reservedWords.put("double", "_double");
++        reservedWords.put("else", "_else");
++        reservedWords.put("extends", "_extends");
++        reservedWords.put("false", "_false");
++        reservedWords.put("final", "_final");
++        reservedWords.put("finally", "_finally");
++        reservedWords.put("float", "_float");
++        reservedWords.put("for", "_for");
++        reservedWords.put("goto", "_goto");
++        reservedWords.put("if", "_if");
++        reservedWords.put("implements", "_implements");
++        reservedWords.put("import", "_import");
++        reservedWords.put("instanceof", "_instanceof");
++        reservedWords.put("int", "_int");
++        reservedWords.put("interface", "_interface");
++        reservedWords.put("long", "_long");
++        reservedWords.put("native", "_native");
++        reservedWords.put("new", "_new");
++        reservedWords.put("null", "_null");
++        reservedWords.put("package", "_package");
++        reservedWords.put("private", "_private");
++        reservedWords.put("protected", "_protected");
++        reservedWords.put("public", "_public");
++        reservedWords.put("return", "_return");
++        reservedWords.put("short", "_short");
++        reservedWords.put("static", "_static");
++        reservedWords.put("strictfp", "_strictfp");
++        reservedWords.put("super", "_super");
++        reservedWords.put("switch", "_switch");
++        reservedWords.put("synchronized", "_synchronized");
++        reservedWords.put("this", "_this");
++        reservedWords.put("throw", "_throw");
++        reservedWords.put("throws", "_throws");
++        reservedWords.put("transient", "_transient");
++        reservedWords.put("true", "_true");
++        reservedWords.put("try", "_try");
++        reservedWords.put("void", "_void");
++        reservedWords.put("volatile", "_volatile");
++        reservedWords.put("while", "_while");
++        reservedWords.put("enum", "_enum");
++    }
++
++    private static final Set<String> skipProperties = new HashSet<String>();
++    static{
++        skipProperties.add("getCause");
++        skipProperties.add("getLocalizedMessage");
++        skipProperties.add("getClass");
++        skipProperties.add("getStackTrace");
++    }
++
++}
+--- /dev/null	Thu Jul 30 19:02:47 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/model/wsdl/WSDLBoundFaultImpl.java	Thu Jul 30 19:02:46 2009
+@@ -0,0 +1,84 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++package com.sun.xml.internal.ws.model.wsdl;
++
++import com.sun.istack.internal.NotNull;
++import com.sun.xml.internal.ws.api.model.wsdl.WSDLBoundFault;
++import com.sun.xml.internal.ws.api.model.wsdl.WSDLFault;
++import com.sun.xml.internal.ws.api.model.wsdl.WSDLOperation;
++import com.sun.xml.internal.ws.api.model.wsdl.WSDLBoundOperation;
++
++import javax.xml.stream.XMLStreamReader;
++import javax.xml.namespace.QName;
++
++/**
++ * @author Vivek Pandey
++ */
++public class WSDLBoundFaultImpl extends AbstractExtensibleImpl implements WSDLBoundFault {
++    private final String name;
++    private WSDLFault fault;
++    private WSDLBoundOperationImpl owner;
++
++    public WSDLBoundFaultImpl(XMLStreamReader xsr, String name, WSDLBoundOperationImpl owner) {
++        super(xsr);
++        this.name = name;
++        this.owner = owner;
++    }
++
++    public
++    @NotNull
++    String getName() {
++        return name;
++    }
++
++    public QName getQName() {
++        if(owner.getOperation() != null){
++            return new QName(owner.getOperation().getName().getNamespaceURI(), name);
++        }
++        return null;
++    }
++
++    public WSDLFault getFault() {
++        return fault;
++    }
++
++    @NotNull
++    public WSDLBoundOperation getBoundOperation() {
++        return owner;
++    }
++
++    void freeze(WSDLBoundOperationImpl root) {
++        assert root != null;
++        WSDLOperation op = root.getOperation();
++        if (op != null) {
++            for (WSDLFault f : op.getFaults()) {
++                if (f.getName().equals(name)) {
++                    this.fault = f;
++                    break;
++                }
++            }
++        }
++    }
++}
+--- /dev/null	Thu Jul 30 19:02:50 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/org/objectweb/asm/AnnotationVisitor.java	Thu Jul 30 19:02:49 2009
+@@ -0,0 +1,127 @@
++/*
++ * Copyright 2005-2009 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++
++/*
++ * This file is available under and governed by the GNU General Public
++ * License version 2 only, as published by the Free Software Foundation.
++ * However, the following notice accompanied the original version of this
++ * file:
++ *
++ * ASM: a very small and fast Java bytecode manipulation framework
++ * Copyright (c) 2000-2007 INRIA, France Telecom
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ *    notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ *    notice, this list of conditions and the following disclaimer in the
++ *    documentation and/or other materials provided with the distribution.
++ * 3. Neither the name of the copyright holders nor the names of its
++ *    contributors may be used to endorse or promote products derived from
++ *    this software without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
++ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
++ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
++ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
++ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
++ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
++ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
++ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
++ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
++ * THE POSSIBILITY OF SUCH DAMAGE.
++ */
++package com.sun.xml.internal.ws.org.objectweb.asm;
++
++/**
++ * A visitor to visit a Java annotation. The methods of this interface must be
++ * called in the following order: (<tt>visit<tt> | <tt>visitEnum<tt> |
++ * <tt>visitAnnotation<tt> | <tt>visitArray<tt>)* <tt>visitEnd<tt>.
++ *
++ * @author Eric Bruneton
++ * @author Eugene Kuleshov
++ */
++public interface AnnotationVisitor {
++
++    /**
++     * Visits a primitive value of the annotation.
++     *
++     * @param name the value name.
++     * @param value the actual value, whose type must be {@link Byte},
++     *        {@link Boolean}, {@link Character}, {@link Short},
++     *        {@link Integer}, {@link Long}, {@link Float}, {@link Double},
++     *        {@link String} or {@link Type}. This value can also be an array
++     *        of byte, boolean, short, char, int, long, float or double values
++     *        (this is equivalent to using {@link #visitArray visitArray} and
++     *        visiting each array element in turn, but is more convenient).
++     */
++    void visit(String name, Object value);
++
++    /**
++     * Visits an enumeration value of the annotation.
++     *
++     * @param name the value name.
++     * @param desc the class descriptor of the enumeration class.
++     * @param value the actual enumeration value.
++     */
++    void visitEnum(String name, String desc, String value);
++
++    /**
++     * Visits a nested annotation value of the annotation.
++     *
++     * @param name the value name.
++     * @param desc the class descriptor of the nested annotation class.
++     * @return a visitor to visit the actual nested annotation value, or
++     *         <tt>null</tt> if this visitor is not interested in visiting
++     *         this nested annotation. <i>The nested annotation value must be
++     *         fully visited before calling other methods on this annotation
++     *         visitor</i>.
++     */
++    AnnotationVisitor visitAnnotation(String name, String desc);
++
++    /**
++     * Visits an array value of the annotation. Note that arrays of primitive
++     * types (such as byte, boolean, short, char, int, long, float or double)
++     * can be passed as value to {@link #visit visit}. This is what
++     * {@link ClassReader} does.
++     *
++     * @param name the value name.
++     * @return a visitor to visit the actual array value elements, or
++     *         <tt>null</tt> if this visitor is not interested in visiting
++     *         these values. The 'name' parameters passed to the methods of this
++     *         visitor are ignored. <i>All the array values must be visited
++     *         before calling other methods on this annotation visitor</i>.
++     */
++    AnnotationVisitor visitArray(String name);
++
++    /**
++     * Visits the end of the annotation.
++     */
++    void visitEnd();
++}
+--- /dev/null	Thu Jul 30 19:02:54 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/org/objectweb/asm/AnnotationWriter.java	Thu Jul 30 19:02:53 2009
+@@ -0,0 +1,346 @@
++/*
++ * Copyright 2005-2009 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++
++/*
++ * This file is available under and governed by the GNU General Public
++ * License version 2 only, as published by the Free Software Foundation.
++ * However, the following notice accompanied the original version of this
++ * file:
++ *
++ * ASM: a very small and fast Java bytecode manipulation framework
++ * Copyright (c) 2000-2007 INRIA, France Telecom
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ *    notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ *    notice, this list of conditions and the following disclaimer in the
++ *    documentation and/or other materials provided with the distribution.
++ * 3. Neither the name of the copyright holders nor the names of its
++ *    contributors may be used to endorse or promote products derived from
++ *    this software without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
++ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
++ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
++ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
++ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
++ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
++ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
++ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
++ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
++ * THE POSSIBILITY OF SUCH DAMAGE.
++ */
++package com.sun.xml.internal.ws.org.objectweb.asm;
++
++/**
++ * An {@link AnnotationVisitor} that generates annotations in bytecode form.
++ *
++ * @author Eric Bruneton
++ * @author Eugene Kuleshov
++ */
++final class AnnotationWriter implements AnnotationVisitor {
++
++    /**
++     * The class writer to which this annotation must be added.
++     */
++    private final ClassWriter cw;
++
++    /**
++     * The number of values in this annotation.
++     */
++    private int size;
++
++    /**
++     * <tt>true<tt> if values are named, <tt>false</tt> otherwise. Annotation
++     * writers used for annotation default and annotation arrays use unnamed
++     * values.
++     */
++    private final boolean named;
++
++    /**
++     * The annotation values in bytecode form. This byte vector only contains
++     * the values themselves, i.e. the number of values must be stored as a
++     * unsigned short just before these bytes.
++     */
++    private final ByteVector bv;
++
++    /**
++     * The byte vector to be used to store the number of values of this
++     * annotation. See {@link #bv}.
++     */
++    private final ByteVector parent;
++
++    /**
++     * Where the number of values of this annotation must be stored in
++     * {@link #parent}.
++     */
++    private final int offset;
++
++    /**
++     * Next annotation writer. This field is used to store annotation lists.
++     */
++    AnnotationWriter next;
++
++    /**
++     * Previous annotation writer. This field is used to store annotation lists.
++     */
++    AnnotationWriter prev;
++
++    // ------------------------------------------------------------------------
++    // Constructor
++    // ------------------------------------------------------------------------
++
++    /**
++     * Constructs a new {@link AnnotationWriter}.
++     *
++     * @param cw the class writer to which this annotation must be added.
++     * @param named <tt>true<tt> if values are named, <tt>false</tt> otherwise.
++     * @param bv where the annotation values must be stored.
++     * @param parent where the number of annotation values must be stored.
++     * @param offset where in <tt>parent</tt> the number of annotation values must
++     *      be stored.
++     */
++    AnnotationWriter(
++        final ClassWriter cw,
++        final boolean named,
++        final ByteVector bv,
++        final ByteVector parent,
++        final int offset)
++    {
++        this.cw = cw;
++        this.named = named;
++        this.bv = bv;
++        this.parent = parent;
++        this.offset = offset;
++    }
++
++    // ------------------------------------------------------------------------
++    // Implementation of the AnnotationVisitor interface
++    // ------------------------------------------------------------------------
++
++    public void visit(final String name, final Object value) {
++        ++size;
++        if (named) {
++            bv.putShort(cw.newUTF8(name));
++        }
++        if (value instanceof String) {
++            bv.put12('s', cw.newUTF8((String) value));
++        } else if (value instanceof Byte) {
++            bv.put12('B', cw.newInteger(((Byte) value).byteValue()).index);
++        } else if (value instanceof Boolean) {
++            int v = ((Boolean) value).booleanValue() ? 1 : 0;
++            bv.put12('Z', cw.newInteger(v).index);
++        } else if (value instanceof Character) {
++            bv.put12('C', cw.newInteger(((Character) value).charValue()).index);
++        } else if (value instanceof Short) {
++            bv.put12('S', cw.newInteger(((Short) value).shortValue()).index);
++        } else if (value instanceof Type) {
++            bv.put12('c', cw.newUTF8(((Type) value).getDescriptor()));
++        } else if (value instanceof byte[]) {
++            byte[] v = (byte[]) value;
++            bv.put12('[', v.length);
++            for (int i = 0; i < v.length; i++) {
++                bv.put12('B', cw.newInteger(v[i]).index);
++            }
++        } else if (value instanceof boolean[]) {
++            boolean[] v = (boolean[]) value;
++            bv.put12('[', v.length);
++            for (int i = 0; i < v.length; i++) {
++                bv.put12('Z', cw.newInteger(v[i] ? 1 : 0).index);
++            }
++        } else if (value instanceof short[]) {
++            short[] v = (short[]) value;
++            bv.put12('[', v.length);
++            for (int i = 0; i < v.length; i++) {
++                bv.put12('S', cw.newInteger(v[i]).index);
++            }
++        } else if (value instanceof char[]) {
++            char[] v = (char[]) value;
++            bv.put12('[', v.length);
++            for (int i = 0; i < v.length; i++) {
++                bv.put12('C', cw.newInteger(v[i]).index);
++            }
++        } else if (value instanceof int[]) {
++            int[] v = (int[]) value;
++            bv.put12('[', v.length);
++            for (int i = 0; i < v.length; i++) {
++                bv.put12('I', cw.newInteger(v[i]).index);
++            }
++        } else if (value instanceof long[]) {
++            long[] v = (long[]) value;
++            bv.put12('[', v.length);
++            for (int i = 0; i < v.length; i++) {
++                bv.put12('J', cw.newLong(v[i]).index);
++            }
++        } else if (value instanceof float[]) {
++            float[] v = (float[]) value;
++            bv.put12('[', v.length);
++            for (int i = 0; i < v.length; i++) {
++                bv.put12('F', cw.newFloat(v[i]).index);
++            }
++        } else if (value instanceof double[]) {
++            double[] v = (double[]) value;
++            bv.put12('[', v.length);
++            for (int i = 0; i < v.length; i++) {
++                bv.put12('D', cw.newDouble(v[i]).index);
++            }
++        } else {
++            Item i = cw.newConstItem(value);
++            bv.put12(".s.IFJDCS".charAt(i.type), i.index);
++        }
++    }
++
++    public void visitEnum(
++        final String name,
++        final String desc,
++        final String value)
++    {
++        ++size;
++        if (named) {
++            bv.putShort(cw.newUTF8(name));
++        }
++        bv.put12('e', cw.newUTF8(desc)).putShort(cw.newUTF8(value));
++    }
++
++    public AnnotationVisitor visitAnnotation(
++        final String name,
++        final String desc)
++    {
++        ++size;
++        if (named) {
++            bv.putShort(cw.newUTF8(name));
++        }
++        // write tag and type, and reserve space for values count
++        bv.put12('@', cw.newUTF8(desc)).putShort(0);
++        return new AnnotationWriter(cw, true, bv, bv, bv.length - 2);
++    }
++
++    public AnnotationVisitor visitArray(final String name) {
++        ++size;
++        if (named) {
++            bv.putShort(cw.newUTF8(name));
++        }
++        // write tag, and reserve space for array size
++        bv.put12('[', 0);
++        return new AnnotationWriter(cw, false, bv, bv, bv.length - 2);
++    }
++
++    public void visitEnd() {
++        if (parent != null) {
++            byte[] data = parent.data;
++            data[offset] = (byte) (size >>> 8);
++            data[offset + 1] = (byte) size;
++        }
++    }
++
++    // ------------------------------------------------------------------------
++    // Utility methods
++    // ------------------------------------------------------------------------
++
++    /**
++     * Returns the size of this annotation writer list.
++     *
++     * @return the size of this annotation writer list.
++     */
++    int getSize() {
++        int size = 0;
++        AnnotationWriter aw = this;
++        while (aw != null) {
++            size += aw.bv.length;
++            aw = aw.next;
++        }
++        return size;
++    }
++
++    /**
++     * Puts the annotations of this annotation writer list into the given byte
++     * vector.
++     *
++     * @param out where the annotations must be put.
++     */
++    void put(final ByteVector out) {
++        int n = 0;
++        int size = 2;
++        AnnotationWriter aw = this;
++        AnnotationWriter last = null;
++        while (aw != null) {
++            ++n;
++            size += aw.bv.length;
++            aw.visitEnd(); // in case user forgot to call visitEnd
++            aw.prev = last;
++            last = aw;
++            aw = aw.next;
++        }
++        out.putInt(size);
++        out.putShort(n);
++        aw = last;
++        while (aw != null) {
++            out.putByteArray(aw.bv.data, 0, aw.bv.length);
++            aw = aw.prev;
++        }
++    }
++
++    /**
++     * Puts the given annotation lists into the given byte vector.
++     *
++     * @param panns an array of annotation writer lists.
++     * @param off index of the first annotation to be written.
++     * @param out where the annotations must be put.
++     */
++    static void put(
++        final AnnotationWriter[] panns,
++        final int off,
++        final ByteVector out)
++    {
++        int size = 1 + 2 * (panns.length - off);
++        for (int i = off; i < panns.length; ++i) {
++            size += panns[i] == null ? 0 : panns[i].getSize();
++        }
++        out.putInt(size).putByte(panns.length - off);
++        for (int i = off; i < panns.length; ++i) {
++            AnnotationWriter aw = panns[i];
++            AnnotationWriter last = null;
++            int n = 0;
++            while (aw != null) {
++                ++n;
++                aw.visitEnd(); // in case user forgot to call visitEnd
++                aw.prev = last;
++                last = aw;
++                aw = aw.next;
++            }
++            out.putShort(n);
++            aw = last;
++            while (aw != null) {
++                out.putByteArray(aw.bv.data, 0, aw.bv.length);
++                aw = aw.prev;
++            }
++        }
++    }
++}
+--- /dev/null	Thu Jul 30 19:02:57 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/org/objectweb/asm/Attribute.java	Thu Jul 30 19:02:56 2009
+@@ -0,0 +1,284 @@
++/*
++ * Copyright 2005-2009 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++
++/*
++ * This file is available under and governed by the GNU General Public
++ * License version 2 only, as published by the Free Software Foundation.
++ * However, the following notice accompanied the original version of this
++ * file:
++ *
++ * ASM: a very small and fast Java bytecode manipulation framework
++ * Copyright (c) 2000-2007 INRIA, France Telecom
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ *    notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ *    notice, this list of conditions and the following disclaimer in the
++ *    documentation and/or other materials provided with the distribution.
++ * 3. Neither the name of the copyright holders nor the names of its
++ *    contributors may be used to endorse or promote products derived from
++ *    this software without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
++ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
++ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
++ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
++ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
++ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
++ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
++ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
++ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
++ * THE POSSIBILITY OF SUCH DAMAGE.
++ */
++package com.sun.xml.internal.ws.org.objectweb.asm;
++
++/**
++ * A non standard class, field, method or code attribute.
++ *
++ * @author Eric Bruneton
++ * @author Eugene Kuleshov
++ */
++public class Attribute {
++
++    /**
++     * The type of this attribute.
++     */
++    public final String type;
++
++    /**
++     * The raw value of this attribute, used only for unknown attributes.
++     */
++    byte[] value;
++
++    /**
++     * The next attribute in this attribute list. May be <tt>null</tt>.
++     */
++    Attribute next;
++
++    /**
++     * Constructs a new empty attribute.
++     *
++     * @param type the type of the attribute.
++     */
++    protected Attribute(final String type) {
++        this.type = type;
++    }
++
++    /**
++     * Returns <tt>true</tt> if this type of attribute is unknown. The default
++     * implementation of this method always returns <tt>true</tt>.
++     *
++     * @return <tt>true</tt> if this type of attribute is unknown.
++     */
++    public boolean isUnknown() {
++        return true;
++    }
++
++    /**
++     * Returns <tt>true</tt> if this type of attribute is a code attribute.
++     *
++     * @return <tt>true</tt> if this type of attribute is a code attribute.
++     */
++    public boolean isCodeAttribute() {
++        return false;
++    }
++
++    /**
++     * Returns the labels corresponding to this attribute.
++     *
++     * @return the labels corresponding to this attribute, or <tt>null</tt> if
++     *         this attribute is not a code attribute that contains labels.
++     */
++    protected Label[] getLabels() {
++        return null;
++    }
++
++    /**
++     * Reads a {@link #type type} attribute. This method must return a <i>new</i>
++     * {@link Attribute} object, of type {@link #type type}, corresponding to
++     * the <tt>len</tt> bytes starting at the given offset, in the given class
++     * reader.
++     *
++     * @param cr the class that contains the attribute to be read.
++     * @param off index of the first byte of the attribute's content in {@link
++     *        ClassReader#b cr.b}. The 6 attribute header bytes, containing the
++     *        type and the length of the attribute, are not taken into account
++     *        here.
++     * @param len the length of the attribute's content.
++     * @param buf buffer to be used to call
++     *        {@link ClassReader#readUTF8 readUTF8},
++     *        {@link ClassReader#readClass(int,char[]) readClass} or
++     *        {@link ClassReader#readConst readConst}.
++     * @param codeOff index of the first byte of code's attribute content in
++     *        {@link ClassReader#b cr.b}, or -1 if the attribute to be read is
++     *        not a code attribute. The 6 attribute header bytes, containing the
++     *        type and the length of the attribute, are not taken into account
++     *        here.
++     * @param labels the labels of the method's code, or <tt>null</tt> if the
++     *        attribute to be read is not a code attribute.
++     * @return a <i>new</i> {@link Attribute} object corresponding to the given
++     *         bytes.
++     */
++    protected Attribute read(
++        final ClassReader cr,
++        final int off,
++        final int len,
++        final char[] buf,
++        final int codeOff,
++        final Label[] labels)
++    {
++        Attribute attr = new Attribute(type);
++        attr.value = new byte[len];
++        System.arraycopy(cr.b, off, attr.value, 0, len);
++        return attr;
++    }
++
++    /**
++     * Returns the byte array form of this attribute.
++     *
++     * @param cw the class to which this attribute must be added. This parameter
++     *        can be used to add to the constant pool of this class the items
++     *        that corresponds to this attribute.
++     * @param code the bytecode of the method corresponding to this code
++     *        attribute, or <tt>null</tt> if this attribute is not a code
++     *        attributes.
++     * @param len the length of the bytecode of the method corresponding to this
++     *        code attribute, or <tt>null</tt> if this attribute is not a code
++     *        attribute.
++     * @param maxStack the maximum stack size of the method corresponding to
++     *        this code attribute, or -1 if this attribute is not a code
++     *        attribute.
++     * @param maxLocals the maximum number of local variables of the method
++     *        corresponding to this code attribute, or -1 if this attribute is
++     *        not a code attribute.
++     * @return the byte array form of this attribute.
++     */
++    protected ByteVector write(
++        final ClassWriter cw,
++        final byte[] code,
++        final int len,
++        final int maxStack,
++        final int maxLocals)
++    {
++        ByteVector v = new ByteVector();
++        v.data = value;
++        v.length = value.length;
++        return v;
++    }
++
++    /**
++     * Returns the length of the attribute list that begins with this attribute.
++     *
++     * @return the length of the attribute list that begins with this attribute.
++     */
++    final int getCount() {
++        int count = 0;
++        Attribute attr = this;
++        while (attr != null) {
++            count += 1;
++            attr = attr.next;
++        }
++        return count;
++    }
++
++    /**
++     * Returns the size of all the attributes in this attribute list.
++     *
++     * @param cw the class writer to be used to convert the attributes into byte
++     *        arrays, with the {@link #write write} method.
++     * @param code the bytecode of the method corresponding to these code
++     *        attributes, or <tt>null</tt> if these attributes are not code
++     *        attributes.
++     * @param len the length of the bytecode of the method corresponding to
++     *        these code attributes, or <tt>null</tt> if these attributes are
++     *        not code attributes.
++     * @param maxStack the maximum stack size of the method corresponding to
++     *        these code attributes, or -1 if these attributes are not code
++     *        attributes.
++     * @param maxLocals the maximum number of local variables of the method
++     *        corresponding to these code attributes, or -1 if these attributes
++     *        are not code attributes.
++     * @return the size of all the attributes in this attribute list. This size
++     *         includes the size of the attribute headers.
++     */
++    final int getSize(
++        final ClassWriter cw,
++        final byte[] code,
++        final int len,
++        final int maxStack,
++        final int maxLocals)
++    {
++        Attribute attr = this;
++        int size = 0;
++        while (attr != null) {
++            cw.newUTF8(attr.type);
++            size += attr.write(cw, code, len, maxStack, maxLocals).length + 6;
++            attr = attr.next;
++        }
++        return size;
++    }
++
++    /**
++     * Writes all the attributes of this attribute list in the given byte
++     * vector.
++     *
++     * @param cw the class writer to be used to convert the attributes into byte
++     *        arrays, with the {@link #write write} method.
++     * @param code the bytecode of the method corresponding to these code
++     *        attributes, or <tt>null</tt> if these attributes are not code
++     *        attributes.
++     * @param len the length of the bytecode of the method corresponding to
++     *        these code attributes, or <tt>null</tt> if these attributes are
++     *        not code attributes.
++     * @param maxStack the maximum stack size of the method corresponding to
++     *        these code attributes, or -1 if these attributes are not code
++     *        attributes.
++     * @param maxLocals the maximum number of local variables of the method
++     *        corresponding to these code attributes, or -1 if these attributes
++     *        are not code attributes.
++     * @param out where the attributes must be written.
++     */
++    final void put(
++        final ClassWriter cw,
++        final byte[] code,
++        final int len,
++        final int maxStack,
++        final int maxLocals,
++        final ByteVector out)
++    {
++        Attribute attr = this;
++        while (attr != null) {
++            ByteVector b = attr.write(cw, code, len, maxStack, maxLocals);
++            out.putShort(cw.newUTF8(attr.type)).putInt(b.length);
++            out.putByteArray(b.data, 0, b.length);
++            attr = attr.next;
++        }
++    }
++}
+--- /dev/null	Thu Jul 30 19:03:00 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/org/objectweb/asm/ByteVector.java	Thu Jul 30 19:02:59 2009
+@@ -0,0 +1,323 @@
++/*
++ * Copyright 2005-2009 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++
++/*
++ * This file is available under and governed by the GNU General Public
++ * License version 2 only, as published by the Free Software Foundation.
++ * However, the following notice accompanied the original version of this
++ * file:
++ *
++ * ASM: a very small and fast Java bytecode manipulation framework
++ * Copyright (c) 2000-2007 INRIA, France Telecom
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ *    notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ *    notice, this list of conditions and the following disclaimer in the
++ *    documentation and/or other materials provided with the distribution.
++ * 3. Neither the name of the copyright holders nor the names of its
++ *    contributors may be used to endorse or promote products derived from
++ *    this software without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
++ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
++ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
++ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
++ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
++ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
++ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
++ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
++ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
++ * THE POSSIBILITY OF SUCH DAMAGE.
++ */
++package com.sun.xml.internal.ws.org.objectweb.asm;
++
++/**
++ * A dynamically extensible vector of bytes. This class is roughly equivalent to
++ * a DataOutputStream on top of a ByteArrayOutputStream, but is more efficient.
++ *
++ * @author Eric Bruneton
++ */
++public class ByteVector {
++
++    /**
++     * The content of this vector.
++     */
++    byte[] data;
++
++    /**
++     * Actual number of bytes in this vector.
++     */
++    int length;
++
++    /**
++     * Constructs a new {@link ByteVector ByteVector} with a default initial
++     * size.
++     */
++    public ByteVector() {
++        data = new byte[64];
++    }
++
++    /**
++     * Constructs a new {@link ByteVector ByteVector} with the given initial
++     * size.
++     *
++     * @param initialSize the initial size of the byte vector to be constructed.
++     */
++    public ByteVector(final int initialSize) {
++        data = new byte[initialSize];
++    }
++
++    /**
++     * Puts a byte into this byte vector. The byte vector is automatically
++     * enlarged if necessary.
++     *
++     * @param b a byte.
++     * @return this byte vector.
++     */
++    public ByteVector putByte(final int b) {
++        int length = this.length;
++        if (length + 1 > data.length) {
++            enlarge(1);
++        }
++        data[length++] = (byte) b;
++        this.length = length;
++        return this;
++    }
++
++    /**
++     * Puts two bytes into this byte vector. The byte vector is automatically
++     * enlarged if necessary.
++     *
++     * @param b1 a byte.
++     * @param b2 another byte.
++     * @return this byte vector.
++     */
++    ByteVector put11(final int b1, final int b2) {
++        int length = this.length;
++        if (length + 2 > data.length) {
++            enlarge(2);
++        }
++        byte[] data = this.data;
++        data[length++] = (byte) b1;
++        data[length++] = (byte) b2;
++        this.length = length;
++        return this;
++    }
++
++    /**
++     * Puts a short into this byte vector. The byte vector is automatically
++     * enlarged if necessary.
++     *
++     * @param s a short.
++     * @return this byte vector.
++     */
++    public ByteVector putShort(final int s) {
++        int length = this.length;
++        if (length + 2 > data.length) {
++            enlarge(2);
++        }
++        byte[] data = this.data;
++        data[length++] = (byte) (s >>> 8);
++        data[length++] = (byte) s;
++        this.length = length;
++        return this;
++    }
++
++    /**
++     * Puts a byte and a short into this byte vector. The byte vector is
++     * automatically enlarged if necessary.
++     *
++     * @param b a byte.
++     * @param s a short.
++     * @return this byte vector.
++     */
++    ByteVector put12(final int b, final int s) {
++        int length = this.length;
++        if (length + 3 > data.length) {
++            enlarge(3);
++        }
++        byte[] data = this.data;
++        data[length++] = (byte) b;
++        data[length++] = (byte) (s >>> 8);
++        data[length++] = (byte) s;
++        this.length = length;
++        return this;
++    }
++
++    /**
++     * Puts an int into this byte vector. The byte vector is automatically
++     * enlarged if necessary.
++     *
++     * @param i an int.
++     * @return this byte vector.
++     */
++    public ByteVector putInt(final int i) {
++        int length = this.length;
++        if (length + 4 > data.length) {
++            enlarge(4);
++        }
++        byte[] data = this.data;
++        data[length++] = (byte) (i >>> 24);
++        data[length++] = (byte) (i >>> 16);
++        data[length++] = (byte) (i >>> 8);
++        data[length++] = (byte) i;
++        this.length = length;
++        return this;
++    }
++
++    /**
++     * Puts a long into this byte vector. The byte vector is automatically
++     * enlarged if necessary.
++     *
++     * @param l a long.
++     * @return this byte vector.
++     */
++    public ByteVector putLong(final long l) {
++        int length = this.length;
++        if (length + 8 > data.length) {
++            enlarge(8);
++        }
++        byte[] data = this.data;
++        int i = (int) (l >>> 32);
++        data[length++] = (byte) (i >>> 24);
++        data[length++] = (byte) (i >>> 16);
++        data[length++] = (byte) (i >>> 8);
++        data[length++] = (byte) i;
++        i = (int) l;
++        data[length++] = (byte) (i >>> 24);
++        data[length++] = (byte) (i >>> 16);
++        data[length++] = (byte) (i >>> 8);
++        data[length++] = (byte) i;
++        this.length = length;
++        return this;
++    }
++
++    /**
++     * Puts an UTF8 string into this byte vector. The byte vector is
++     * automatically enlarged if necessary.
++     *
++     * @param s a String.
++     * @return this byte vector.
++     */
++    public ByteVector putUTF8(final String s) {
++        int charLength = s.length();
++        if (length + 2 + charLength > data.length) {
++            enlarge(2 + charLength);
++        }
++        int len = length;
++        byte[] data = this.data;
++        // optimistic algorithm: instead of computing the byte length and then
++        // serializing the string (which requires two loops), we assume the byte
++        // length is equal to char length (which is the most frequent case), and
++        // we start serializing the string right away. During the serialization,
++        // if we find that this assumption is wrong, we continue with the
++        // general method.
++        data[len++] = (byte) (charLength >>> 8);
++        data[len++] = (byte) charLength;
++        for (int i = 0; i < charLength; ++i) {
++            char c = s.charAt(i);
++            if (c >= '\001' && c <= '\177') {
++                data[len++] = (byte) c;
++            } else {
++                int byteLength = i;
++                for (int j = i; j < charLength; ++j) {
++                    c = s.charAt(j);
++                    if (c >= '\001' && c <= '\177') {
++                        byteLength++;
++                    } else if (c > '\u07FF') {
++                        byteLength += 3;
++                    } else {
++                        byteLength += 2;
++                    }
++                }
++                data[length] = (byte) (byteLength >>> 8);
++                data[length + 1] = (byte) byteLength;
++                if (length + 2 + byteLength > data.length) {
++                    length = len;
++                    enlarge(2 + byteLength);
++                    data = this.data;
++                }
++                for (int j = i; j < charLength; ++j) {
++                    c = s.charAt(j);
++                    if (c >= '\001' && c <= '\177') {
++                        data[len++] = (byte) c;
++                    } else if (c > '\u07FF') {
++                        data[len++] = (byte) (0xE0 | c >> 12 & 0xF);
++                        data[len++] = (byte) (0x80 | c >> 6 & 0x3F);
++                        data[len++] = (byte) (0x80 | c & 0x3F);
++                    } else {
++                        data[len++] = (byte) (0xC0 | c >> 6 & 0x1F);
++                        data[len++] = (byte) (0x80 | c & 0x3F);
++                    }
++                }
++                break;
++            }
++        }
++        length = len;
++        return this;
++    }
++
++    /**
++     * Puts an array of bytes into this byte vector. The byte vector is
++     * automatically enlarged if necessary.
++     *
++     * @param b an array of bytes. May be <tt>null</tt> to put <tt>len</tt>
++     *        null bytes into this byte vector.
++     * @param off index of the fist byte of b that must be copied.
++     * @param len number of bytes of b that must be copied.
++     * @return this byte vector.
++     */
++    public ByteVector putByteArray(final byte[] b, final int off, final int len)
++    {
++        if (length + len > data.length) {
++            enlarge(len);
++        }
++        if (b != null) {
++            System.arraycopy(b, off, data, length, len);
++        }
++        length += len;
++        return this;
++    }
++
++    /**
++     * Enlarge this byte vector so that it can receive n more bytes.
++     *
++     * @param size number of additional bytes that this byte vector should be
++     *        able to receive.
++     */
++    private void enlarge(final int size) {
++        int length1 = 2 * data.length;
++        int length2 = length + size;
++        byte[] newData = new byte[length1 > length2 ? length1 : length2];
++        System.arraycopy(data, 0, newData, 0, length);
++        data = newData;
++    }
++}
+--- /dev/null	Thu Jul 30 19:03:03 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/org/objectweb/asm/ClassReader.java	Thu Jul 30 19:03:02 2009
+@@ -0,0 +1,2039 @@
++/*
++ * Copyright 2005-2009 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++
++/*
++ * This file is available under and governed by the GNU General Public
++ * License version 2 only, as published by the Free Software Foundation.
++ * However, the following notice accompanied the original version of this
++ * file:
++ *
++ * ASM: a very small and fast Java bytecode manipulation framework
++ * Copyright (c) 2000-2007 INRIA, France Telecom
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ *    notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ *    notice, this list of conditions and the following disclaimer in the
++ *    documentation and/or other materials provided with the distribution.
++ * 3. Neither the name of the copyright holders nor the names of its
++ *    contributors may be used to endorse or promote products derived from
++ *    this software without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
++ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
++ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
++ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
++ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
++ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
++ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
++ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
++ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
++ * THE POSSIBILITY OF SUCH DAMAGE.
++ */
++package com.sun.xml.internal.ws.org.objectweb.asm;
++
++import java.io.InputStream;
++import java.io.IOException;
++
++/**
++ * A Java class parser to make a {@link ClassVisitor} visit an existing class.
++ * This class parses a byte array conforming to the Java class file format and
++ * calls the appropriate visit methods of a given class visitor for each field,
++ * method and bytecode instruction encountered.
++ *
++ * @author Eric Bruneton
++ * @author Eugene Kuleshov
++ */
++public class ClassReader {
++
++    /**
++     * True to enable signatures support.
++     */
++    static final boolean SIGNATURES = true;
++
++    /**
++     * True to enable annotations support.
++     */
++    static final boolean ANNOTATIONS = true;
++
++    /**
++     * True to enable stack map frames support.
++     */
++    static final boolean FRAMES = true;
++
++    /**
++     * True to enable bytecode writing support.
++     */
++    static final boolean WRITER = true;
++
++    /**
++     * True to enable JSR_W and GOTO_W support.
++     */
++    static final boolean RESIZE = true;
++
++    /**
++     * Flag to skip method code. If this class is set <code>CODE</code>
++     * attribute won't be visited. This can be used, for example, to retrieve
++     * annotations for methods and method parameters.
++     */
++    public static final int SKIP_CODE = 1;
++
++    /**
++     * Flag to skip the debug information in the class. If this flag is set the
++     * debug information of the class is not visited, i.e. the
++     * {@link MethodVisitor#visitLocalVariable visitLocalVariable} and
++     * {@link MethodVisitor#visitLineNumber visitLineNumber} methods will not be
++     * called.
++     */
++    public static final int SKIP_DEBUG = 2;
++
++    /**
++     * Flag to skip the stack map frames in the class. If this flag is set the
++     * stack map frames of the class is not visited, i.e. the
++     * {@link MethodVisitor#visitFrame visitFrame} method will not be called.
++     * This flag is useful when the {@link ClassWriter#COMPUTE_FRAMES} option is
++     * used: it avoids visiting frames that will be ignored and recomputed from
++     * scratch in the class writer.
++     */
++    public static final int SKIP_FRAMES = 4;
++
++    /**
++     * Flag to expand the stack map frames. By default stack map frames are
++     * visited in their original format (i.e. "expanded" for classes whose
++     * version is less than V1_6, and "compressed" for the other classes). If
++     * this flag is set, stack map frames are always visited in expanded format
++     * (this option adds a decompression/recompression step in ClassReader and
++     * ClassWriter which degrades performances quite a lot).
++     */
++    public static final int EXPAND_FRAMES = 8;
++
++    /**
++     * The class to be parsed. <i>The content of this array must not be
++     * modified. This field is intended for {@link Attribute} sub classes, and
++     * is normally not needed by class generators or adapters.</i>
++     */
++    public final byte[] b;
++
++    /**
++     * The start index of each constant pool item in {@link #b b}, plus one.
++     * The one byte offset skips the constant pool item tag that indicates its
++     * type.
++     */
++    private final int[] items;
++
++    /**
++     * The String objects corresponding to the CONSTANT_Utf8 items. This cache
++     * avoids multiple parsing of a given CONSTANT_Utf8 constant pool item,
++     * which GREATLY improves performances (by a factor 2 to 3). This caching
++     * strategy could be extended to all constant pool items, but its benefit
++     * would not be so great for these items (because they are much less
++     * expensive to parse than CONSTANT_Utf8 items).
++     */
++    private final String[] strings;
++
++    /**
++     * Maximum length of the strings contained in the constant pool of the
++     * class.
++     */
++    private final int maxStringLength;
++
++    /**
++     * Start index of the class header information (access, name...) in
++     * {@link #b b}.
++     */
++    public final int header;
++
++    // ------------------------------------------------------------------------
++    // Constructors
++    // ------------------------------------------------------------------------
++
++    /**
++     * Constructs a new {@link ClassReader} object.
++     *
++     * @param b the bytecode of the class to be read.
++     */
++    public ClassReader(final byte[] b) {
++        this(b, 0, b.length);
++    }
++
++    /**
++     * Constructs a new {@link ClassReader} object.
++     *
++     * @param b the bytecode of the class to be read.
++     * @param off the start offset of the class data.
++     * @param len the length of the class data.
++     */
++    public ClassReader(final byte[] b, final int off, final int len) {
++        this.b = b;
++        // parses the constant pool
++        items = new int[readUnsignedShort(off + 8)];
++        int n = items.length;
++        strings = new String[n];
++        int max = 0;
++        int index = off + 10;
++        for (int i = 1; i < n; ++i) {
++            items[i] = index + 1;
++            int size;
++            switch (b[index]) {
++                case ClassWriter.FIELD:
++                case ClassWriter.METH:
++                case ClassWriter.IMETH:
++                case ClassWriter.INT:
++                case ClassWriter.FLOAT:
++                case ClassWriter.NAME_TYPE:
++                    size = 5;
++                    break;
++                case ClassWriter.LONG:
++                case ClassWriter.DOUBLE:
++                    size = 9;
++                    ++i;
++                    break;
++                case ClassWriter.UTF8:
++                    size = 3 + readUnsignedShort(index + 1);
++                    if (size > max) {
++                        max = size;
++                    }
++                    break;
++                // case ClassWriter.CLASS:
++                // case ClassWriter.STR:
++                default:
++                    size = 3;
++                    break;
++            }
++            index += size;
++        }
++        maxStringLength = max;
++        // the class header information starts just after the constant pool
++        header = index;
++    }
++
++    /**
++     * Returns the class's access flags (see {@link Opcodes}). This value may
++     * not reflect Deprecated and Synthetic flags when bytecode is before 1.5
++     * and those flags are represented by attributes.
++     *
++     * @return the class access flags
++     *
++     * @see ClassVisitor#visit(int, int, String, String, String, String[])
++     */
++    public int getAccess() {
++        return readUnsignedShort(header);
++    }
++
++    /**
++     * Returns the internal name of the class (see
++     * {@link Type#getInternalName() getInternalName}).
++     *
++     * @return the internal class name
++     *
++     * @see ClassVisitor#visit(int, int, String, String, String, String[])
++     */
++    public String getClassName() {
++        return readClass(header + 2, new char[maxStringLength]);
++    }
++
++    /**
++     * Returns the internal of name of the super class (see
++     * {@link Type#getInternalName() getInternalName}). For interfaces, the
++     * super class is {@link Object}.
++     *
++     * @return the internal name of super class, or <tt>null</tt> for
++     *         {@link Object} class.
++     *
++     * @see ClassVisitor#visit(int, int, String, String, String, String[])
++     */
++    public String getSuperName() {
++        int n = items[readUnsignedShort(header + 4)];
++        return n == 0 ? null : readUTF8(n, new char[maxStringLength]);
++    }
++
++    /**
++     * Returns the internal names of the class's interfaces (see
++     * {@link Type#getInternalName() getInternalName}).
++     *
++     * @return the array of internal names for all implemented interfaces or
++     *         <tt>null</tt>.
++     *
++     * @see ClassVisitor#visit(int, int, String, String, String, String[])
++     */
++    public String[] getInterfaces() {
++        int index = header + 6;
++        int n = readUnsignedShort(index);
++        String[] interfaces = new String[n];
++        if (n > 0) {
++            char[] buf = new char[maxStringLength];
++            for (int i = 0; i < n; ++i) {
++                index += 2;
++                interfaces[i] = readClass(index, buf);
++            }
++        }
++        return interfaces;
++    }
++
++    /**
++     * Copies the constant pool data into the given {@link ClassWriter}. Should
++     * be called before the {@link #accept(ClassVisitor,int)} method.
++     *
++     * @param classWriter the {@link ClassWriter} to copy constant pool into.
++     */
++    void copyPool(final ClassWriter classWriter) {
++        char[] buf = new char[maxStringLength];
++        int ll = items.length;
++        Item[] items2 = new Item[ll];
++        for (int i = 1; i < ll; i++) {
++            int index = items[i];
++            int tag = b[index - 1];
++            Item item = new Item(i);
++            int nameType;
++            switch (tag) {
++                case ClassWriter.FIELD:
++                case ClassWriter.METH:
++                case ClassWriter.IMETH:
++                    nameType = items[readUnsignedShort(index + 2)];
++                    item.set(tag,
++                            readClass(index, buf),
++                            readUTF8(nameType, buf),
++                            readUTF8(nameType + 2, buf));
++                    break;
++
++                case ClassWriter.INT:
++                    item.set(readInt(index));
++                    break;
++
++                case ClassWriter.FLOAT:
++                    item.set(Float.intBitsToFloat(readInt(index)));
++                    break;
++
++                case ClassWriter.NAME_TYPE:
++                    item.set(tag,
++                            readUTF8(index, buf),
++                            readUTF8(index + 2, buf),
++                            null);
++                    break;
++
++                case ClassWriter.LONG:
++                    item.set(readLong(index));
++                    ++i;
++                    break;
++
++                case ClassWriter.DOUBLE:
++                    item.set(Double.longBitsToDouble(readLong(index)));
++                    ++i;
++                    break;
++
++                case ClassWriter.UTF8: {
++                    String s = strings[i];
++                    if (s == null) {
++                        index = items[i];
++                        s = strings[i] = readUTF(index + 2,
++                                readUnsignedShort(index),
++                                buf);
++                    }
++                    item.set(tag, s, null, null);
++                }
++                    break;
++
++                // case ClassWriter.STR:
++                // case ClassWriter.CLASS:
++                default:
++                    item.set(tag, readUTF8(index, buf), null, null);
++                    break;
++            }
++
++            int index2 = item.hashCode % items2.length;
++            item.next = items2[index2];
++            items2[index2] = item;
++        }
++
++        int off = items[1] - 1;
++        classWriter.pool.putByteArray(b, off, header - off);
++        classWriter.items = items2;
++        classWriter.threshold = (int) (0.75d * ll);
++        classWriter.index = ll;
++    }
++
++    /**
++     * Constructs a new {@link ClassReader} object.
++     *
++     * @param is an input stream from which to read the class.
++     * @throws IOException if a problem occurs during reading.
++     */
++    public ClassReader(final InputStream is) throws IOException {
++        this(readClass(is));
++    }
++
++    /**
++     * Constructs a new {@link ClassReader} object.
++     *
++     * @param name the fully qualified name of the class to be read.
++     * @throws IOException if an exception occurs during reading.
++     */
++    public ClassReader(final String name) throws IOException {
++        this(ClassLoader.getSystemResourceAsStream(name.replace('.', '/')
++                + ".class"));
++    }
++
++    /**
++     * Reads the bytecode of a class.
++     *
++     * @param is an input stream from which to read the class.
++     * @return the bytecode read from the given input stream.
++     * @throws IOException if a problem occurs during reading.
++     */
++    private static byte[] readClass(final InputStream is) throws IOException {
++        if (is == null) {
++            throw new IOException("Class not found");
++        }
++        byte[] b = new byte[is.available()];
++        int len = 0;
++        while (true) {
++            int n = is.read(b, len, b.length - len);
++            if (n == -1) {
++                if (len < b.length) {
++                    byte[] c = new byte[len];
++                    System.arraycopy(b, 0, c, 0, len);
++                    b = c;
++                }
++                return b;
++            }
++            len += n;
++            if (len == b.length) {
++                byte[] c = new byte[b.length + 1000];
++                System.arraycopy(b, 0, c, 0, len);
++                b = c;
++            }
++        }
++    }
++
++    // ------------------------------------------------------------------------
++    // Public methods
++    // ------------------------------------------------------------------------
++
++    /**
++     * Makes the given visitor visit the Java class of this {@link ClassReader}.
++     * This class is the one specified in the constructor (see
++     * {@link #ClassReader(byte[]) ClassReader}).
++     *
++     * @param classVisitor the visitor that must visit this class.
++     * @param flags option flags that can be used to modify the default behavior
++     *        of this class. See {@link #SKIP_DEBUG}, {@link #EXPAND_FRAMES},
++     *        {@link #SKIP_FRAMES}, {@link #SKIP_CODE}.
++     */
++    public void accept(final ClassVisitor classVisitor, final int flags) {
++        accept(classVisitor, new Attribute[0], flags);
++    }
++
++    /**
++     * Makes the given visitor visit the Java class of this {@link ClassReader}.
++     * This class is the one specified in the constructor (see
++     * {@link #ClassReader(byte[]) ClassReader}).
++     *
++     * @param classVisitor the visitor that must visit this class.
++     * @param attrs prototypes of the attributes that must be parsed during the
++     *        visit of the class. Any attribute whose type is not equal to the
++     *        type of one the prototypes will not be parsed: its byte array
++     *        value will be passed unchanged to the ClassWriter. <i>This may
++     *        corrupt it if this value contains references to the constant pool,
++     *        or has syntactic or semantic links with a class element that has
++     *        been transformed by a class adapter between the reader and the
++     *        writer</i>.
++     * @param flags option flags that can be used to modify the default behavior
++     *        of this class. See {@link #SKIP_DEBUG}, {@link #EXPAND_FRAMES},
++     *        {@link #SKIP_FRAMES}, {@link #SKIP_CODE}.
++     */
++    public void accept(
++        final ClassVisitor classVisitor,
++        final Attribute[] attrs,
++        final int flags)
++    {
++        byte[] b = this.b; // the bytecode array
++        char[] c = new char[maxStringLength]; // buffer used to read strings
++        int i, j, k; // loop variables
++        int u, v, w; // indexes in b
++        Attribute attr;
++
++        int access;
++        String name;
++        String desc;
++        String attrName;
++        String signature;
++        int anns = 0;
++        int ianns = 0;
++        Attribute cattrs = null;
++
++        // visits the header
++        u = header;
++        access = readUnsignedShort(u);
++        name = readClass(u + 2, c);
++        v = items[readUnsignedShort(u + 4)];
++        String superClassName = v == 0 ? null : readUTF8(v, c);
++        String[] implementedItfs = new String[readUnsignedShort(u + 6)];
++        w = 0;
++        u += 8;
++        for (i = 0; i < implementedItfs.length; ++i) {
++            implementedItfs[i] = readClass(u, c);
++            u += 2;
++        }
++
++        boolean skipCode = (flags & SKIP_CODE) != 0;
++        boolean skipDebug = (flags & SKIP_DEBUG) != 0;
++        boolean unzip = (flags & EXPAND_FRAMES) != 0;
++
++        // skips fields and methods
++        v = u;
++        i = readUnsignedShort(v);
++        v += 2;
++        for (; i > 0; --i) {
++            j = readUnsignedShort(v + 6);
++            v += 8;
++            for (; j > 0; --j) {
++                v += 6 + readInt(v + 2);
++            }
++        }
++        i = readUnsignedShort(v);
++        v += 2;
++        for (; i > 0; --i) {
++            j = readUnsignedShort(v + 6);
++            v += 8;
++            for (; j > 0; --j) {
++                v += 6 + readInt(v + 2);
++            }
++        }
++        // reads the class's attributes
++        signature = null;
++        String sourceFile = null;
++        String sourceDebug = null;
++        String enclosingOwner = null;
++        String enclosingName = null;
++        String enclosingDesc = null;
++
++        i = readUnsignedShort(v);
++        v += 2;
++        for (; i > 0; --i) {
++            attrName = readUTF8(v, c);
++            // tests are sorted in decreasing frequency order
++            // (based on frequencies observed on typical classes)
++            if ("SourceFile".equals(attrName)) {
++                sourceFile = readUTF8(v + 6, c);
++            } else if ("InnerClasses".equals(attrName)) {
++                w = v + 6;
++            } else if ("EnclosingMethod".equals(attrName)) {
++                enclosingOwner = readClass(v + 6, c);
++                int item = readUnsignedShort(v + 8);
++                if (item != 0) {
++                    enclosingName = readUTF8(items[item], c);
++                    enclosingDesc = readUTF8(items[item] + 2, c);
++                }
++            } else if (SIGNATURES && "Signature".equals(attrName)) {
++                signature = readUTF8(v + 6, c);
++            } else if (ANNOTATIONS && "RuntimeVisibleAnnotations".equals(attrName)) {
++                anns = v + 6;
++            } else if ("Deprecated".equals(attrName)) {
++                access |= Opcodes.ACC_DEPRECATED;
++            } else if ("Synthetic".equals(attrName)) {
++                access |= Opcodes.ACC_SYNTHETIC;
++            } else if ("SourceDebugExtension".equals(attrName)) {
++                int len = readInt(v + 2);
++                sourceDebug = readUTF(v + 6, len, new char[len]);
++            } else if (ANNOTATIONS && "RuntimeInvisibleAnnotations".equals(attrName)) {
++                ianns = v + 6;
++            } else {
++                attr = readAttribute(attrs,
++                        attrName,
++                        v + 6,
++                        readInt(v + 2),
++                        c,
++                        -1,
++                        null);
++                if (attr != null) {
++                    attr.next = cattrs;
++                    cattrs = attr;
++                }
++            }
++            v += 6 + readInt(v + 2);
++        }
++        // calls the visit method
++        classVisitor.visit(readInt(4),
++                access,
++                name,
++                signature,
++                superClassName,
++                implementedItfs);
++
++        // calls the visitSource method
++        if (!skipDebug && (sourceFile != null || sourceDebug != null)) {
++            classVisitor.visitSource(sourceFile, sourceDebug);
++        }
++
++        // calls the visitOuterClass method
++        if (enclosingOwner != null) {
++            classVisitor.visitOuterClass(enclosingOwner,
++                    enclosingName,
++                    enclosingDesc);
++        }
++
++        // visits the class annotations
++        if (ANNOTATIONS) {
++            for (i = 1; i >= 0; --i) {
++                v = i == 0 ? ianns : anns;
++                if (v != 0) {
++                    j = readUnsignedShort(v);
++                    v += 2;
++                    for (; j > 0; --j) {
++                        v = readAnnotationValues(v + 2,
++                                c,
++                                true,
++                                classVisitor.visitAnnotation(readUTF8(v, c), i != 0));
++                    }
++                }
++            }
++        }
++
++        // visits the class attributes
++        while (cattrs != null) {
++            attr = cattrs.next;
++            cattrs.next = null;
++            classVisitor.visitAttribute(cattrs);
++            cattrs = attr;
++        }
++
++        // calls the visitInnerClass method
++        if (w != 0) {
++            i = readUnsignedShort(w);
++            w += 2;
++            for (; i > 0; --i) {
++                classVisitor.visitInnerClass(readUnsignedShort(w) == 0
++                        ? null
++                        : readClass(w, c), readUnsignedShort(w + 2) == 0
++                        ? null
++                        : readClass(w + 2, c), readUnsignedShort(w + 4) == 0
++                        ? null
++                        : readUTF8(w + 4, c), readUnsignedShort(w + 6));
++                w += 8;
++            }
++        }
++
++        // visits the fields
++        i = readUnsignedShort(u);
++        u += 2;
++        for (; i > 0; --i) {
++            access = readUnsignedShort(u);
++            name = readUTF8(u + 2, c);
++            desc = readUTF8(u + 4, c);
++            // visits the field's attributes and looks for a ConstantValue
++            // attribute
++            int fieldValueItem = 0;
++            signature = null;
++            anns = 0;
++            ianns = 0;
++            cattrs = null;
++
++            j = readUnsignedShort(u + 6);
++            u += 8;
++            for (; j > 0; --j) {
++                attrName = readUTF8(u, c);
++                // tests are sorted in decreasing frequency order
++                // (based on frequencies observed on typical classes)
++                if ("ConstantValue".equals(attrName)) {
++                    fieldValueItem = readUnsignedShort(u + 6);
++                } else if (SIGNATURES && "Signature".equals(attrName)) {
++                    signature = readUTF8(u + 6, c);
++                } else if ("Deprecated".equals(attrName)) {
++                    access |= Opcodes.ACC_DEPRECATED;
++                } else if ("Synthetic".equals(attrName)) {
++                    access |= Opcodes.ACC_SYNTHETIC;
++                } else if (ANNOTATIONS && "RuntimeVisibleAnnotations".equals(attrName)) {
++                    anns = u + 6;
++                } else if (ANNOTATIONS && "RuntimeInvisibleAnnotations".equals(attrName)) {
++                    ianns = u + 6;
++                } else {
++                    attr = readAttribute(attrs,
++                            attrName,
++                            u + 6,
++                            readInt(u + 2),
++                            c,
++                            -1,
++                            null);
++                    if (attr != null) {
++                        attr.next = cattrs;
++                        cattrs = attr;
++                    }
++                }
++                u += 6 + readInt(u + 2);
++            }
++            // visits the field
++            FieldVisitor fv = classVisitor.visitField(access,
++                    name,
++                    desc,
++                    signature,
++                    fieldValueItem == 0 ? null : readConst(fieldValueItem, c));
++            // visits the field annotations and attributes
++            if (fv != null) {
++                if (ANNOTATIONS) {
++                    for (j = 1; j >= 0; --j) {
++                        v = j == 0 ? ianns : anns;
++                        if (v != 0) {
++                            k = readUnsignedShort(v);
++                            v += 2;
++                            for (; k > 0; --k) {
++                                v = readAnnotationValues(v + 2,
++                                        c,
++                                        true,
++                                        fv.visitAnnotation(readUTF8(v, c), j != 0));
++                            }
++                        }
++                    }
++                }
++                while (cattrs != null) {
++                    attr = cattrs.next;
++                    cattrs.next = null;
++                    fv.visitAttribute(cattrs);
++                    cattrs = attr;
++                }
++                fv.visitEnd();
++            }
++        }
++
++        // visits the methods
++        i = readUnsignedShort(u);
++        u += 2;
++        for (; i > 0; --i) {
++            int u0 = u + 6;
++            access = readUnsignedShort(u);
++            name = readUTF8(u + 2, c);
++            desc = readUTF8(u + 4, c);
++            signature = null;
++            anns = 0;
++            ianns = 0;
++            int dann = 0;
++            int mpanns = 0;
++            int impanns = 0;
++            cattrs = null;
++            v = 0;
++            w = 0;
++
++            // looks for Code and Exceptions attributes
++            j = readUnsignedShort(u + 6);
++            u += 8;
++            for (; j > 0; --j) {
++                attrName = readUTF8(u, c);
++                int attrSize = readInt(u + 2);
++                u += 6;
++                // tests are sorted in decreasing frequency order
++                // (based on frequencies observed on typical classes)
++                if ("Code".equals(attrName)) {
++                    if (!skipCode) {
++                        v = u;
++                    }
++                } else if ("Exceptions".equals(attrName)) {
++                    w = u;
++                } else if (SIGNATURES && "Signature".equals(attrName)) {
++                    signature = readUTF8(u, c);
++                } else if ("Deprecated".equals(attrName)) {
++                    access |= Opcodes.ACC_DEPRECATED;
++                } else if (ANNOTATIONS && "RuntimeVisibleAnnotations".equals(attrName)) {
++                    anns = u;
++                } else if (ANNOTATIONS && "AnnotationDefault".equals(attrName)) {
++                    dann = u;
++                } else if ("Synthetic".equals(attrName)) {
++                    access |= Opcodes.ACC_SYNTHETIC;
++                } else if (ANNOTATIONS && "RuntimeInvisibleAnnotations".equals(attrName)) {
++                    ianns = u;
++                } else if (ANNOTATIONS && "RuntimeVisibleParameterAnnotations".equals(attrName))
++                {
++                    mpanns = u;
++                } else if (ANNOTATIONS && "RuntimeInvisibleParameterAnnotations".equals(attrName))
++                {
++                    impanns = u;
++                } else {
++                    attr = readAttribute(attrs,
++                            attrName,
++                            u,
++                            attrSize,
++                            c,
++                            -1,
++                            null);
++                    if (attr != null) {
++                        attr.next = cattrs;
++                        cattrs = attr;
++                    }
++                }
++                u += attrSize;
++            }
++            // reads declared exceptions
++            String[] exceptions;
++            if (w == 0) {
++                exceptions = null;
++            } else {
++                exceptions = new String[readUnsignedShort(w)];
++                w += 2;
++                for (j = 0; j < exceptions.length; ++j) {
++                    exceptions[j] = readClass(w, c);
++                    w += 2;
++                }
++            }
++
++            // visits the method's code, if any
++            MethodVisitor mv = classVisitor.visitMethod(access,
++                    name,
++                    desc,
++                    signature,
++                    exceptions);
++
++            if (mv != null) {
++                /*
++                 * if the returned MethodVisitor is in fact a MethodWriter, it
++                 * means there is no method adapter between the reader and the
++                 * writer. If, in addition, the writer's constant pool was
++                 * copied from this reader (mw.cw.cr == this), and the signature
++                 * and exceptions of the method have not been changed, then it
++                 * is possible to skip all visit events and just copy the
++                 * original code of the method to the writer (the access, name
++                 * and descriptor can have been changed, this is not important
++                 * since they are not copied as is from the reader).
++                 */
++                if (WRITER && mv instanceof MethodWriter) {
++                    MethodWriter mw = (MethodWriter) mv;
++                    if (mw.cw.cr == this) {
++                        if (signature == mw.signature) {
++                            boolean sameExceptions = false;
++                            if (exceptions == null) {
++                                sameExceptions = mw.exceptionCount == 0;
++                            } else {
++                                if (exceptions.length == mw.exceptionCount) {
++                                    sameExceptions = true;
++                                    for (j = exceptions.length - 1; j >= 0; --j)
++                                    {
++                                        w -= 2;
++                                        if (mw.exceptions[j] != readUnsignedShort(w))
++                                        {
++                                            sameExceptions = false;
++                                            break;
++                                        }
++                                    }
++                                }
++                            }
++                            if (sameExceptions) {
++                                /*
++                                 * we do not copy directly the code into
++                                 * MethodWriter to save a byte array copy
++                                 * operation. The real copy will be done in
++                                 * ClassWriter.toByteArray().
++                                 */
++                                mw.classReaderOffset = u0;
++                                mw.classReaderLength = u - u0;
++                                continue;
++                            }
++                        }
++                    }
++                }
++
++                if (ANNOTATIONS && dann != 0) {
++                    AnnotationVisitor dv = mv.visitAnnotationDefault();
++                    readAnnotationValue(dann, c, null, dv);
++                    if (dv != null) {
++                        dv.visitEnd();
++                    }
++                }
++                if (ANNOTATIONS) {
++                    for (j = 1; j >= 0; --j) {
++                        w = j == 0 ? ianns : anns;
++                        if (w != 0) {
++                            k = readUnsignedShort(w);
++                            w += 2;
++                            for (; k > 0; --k) {
++                                w = readAnnotationValues(w + 2,
++                                        c,
++                                        true,
++                                        mv.visitAnnotation(readUTF8(w, c), j != 0));
++                            }
++                        }
++                    }
++                }
++                if (ANNOTATIONS && mpanns != 0) {
++                    readParameterAnnotations(mpanns, desc, c, true, mv);
++                }
++                if (ANNOTATIONS && impanns != 0) {
++                    readParameterAnnotations(impanns, desc, c, false, mv);
++                }
++                while (cattrs != null) {
++                    attr = cattrs.next;
++                    cattrs.next = null;
++                    mv.visitAttribute(cattrs);
++                    cattrs = attr;
++                }
++            }
++
++            if (mv != null && v != 0) {
++                int maxStack = readUnsignedShort(v);
++                int maxLocals = readUnsignedShort(v + 2);
++                int codeLength = readInt(v + 4);
++                v += 8;
++
++                int codeStart = v;
++                int codeEnd = v + codeLength;
++
++                mv.visitCode();
++
++                // 1st phase: finds the labels
++                int label;
++                Label[] labels = new Label[codeLength + 2];
++                readLabel(codeLength + 1, labels);
++                while (v < codeEnd) {
++                    w = v - codeStart;
++                    int opcode = b[v] & 0xFF;
++                    switch (ClassWriter.TYPE[opcode]) {
++                        case ClassWriter.NOARG_INSN:
++                        case ClassWriter.IMPLVAR_INSN:
++                            v += 1;
++                            break;
++                        case ClassWriter.LABEL_INSN:
++                            readLabel(w + readShort(v + 1), labels);
++                            v += 3;
++                            break;
++                        case ClassWriter.LABELW_INSN:
++                            readLabel(w + readInt(v + 1), labels);
++                            v += 5;
++                            break;
++                        case ClassWriter.WIDE_INSN:
++                            opcode = b[v + 1] & 0xFF;
++                            if (opcode == Opcodes.IINC) {
++                                v += 6;
++                            } else {
++                                v += 4;
++                            }
++                            break;
++                        case ClassWriter.TABL_INSN:
++                            // skips 0 to 3 padding bytes*
++                            v = v + 4 - (w & 3);
++                            // reads instruction
++                            readLabel(w + readInt(v), labels);
++                            j = readInt(v + 8) - readInt(v + 4) + 1;
++                            v += 12;
++                            for (; j > 0; --j) {
++                                readLabel(w + readInt(v), labels);
++                                v += 4;
++                            }
++                            break;
++                        case ClassWriter.LOOK_INSN:
++                            // skips 0 to 3 padding bytes*
++                            v = v + 4 - (w & 3);
++                            // reads instruction
++                            readLabel(w + readInt(v), labels);
++                            j = readInt(v + 4);
++                            v += 8;
++                            for (; j > 0; --j) {
++                                readLabel(w + readInt(v + 4), labels);
++                                v += 8;
++                            }
++                            break;
++                        case ClassWriter.VAR_INSN:
++                        case ClassWriter.SBYTE_INSN:
++                        case ClassWriter.LDC_INSN:
++                            v += 2;
++                            break;
++                        case ClassWriter.SHORT_INSN:
++                        case ClassWriter.LDCW_INSN:
++                        case ClassWriter.FIELDORMETH_INSN:
++                        case ClassWriter.TYPE_INSN:
++                        case ClassWriter.IINC_INSN:
++                            v += 3;
++                            break;
++                        case ClassWriter.ITFMETH_INSN:
++                            v += 5;
++                            break;
++                        // case MANA_INSN:
++                        default:
++                            v += 4;
++                            break;
++                    }
++                }
++                // parses the try catch entries
++                j = readUnsignedShort(v);
++                v += 2;
++                for (; j > 0; --j) {
++                    Label start = readLabel(readUnsignedShort(v), labels);
++                    Label end = readLabel(readUnsignedShort(v + 2), labels);
++                    Label handler = readLabel(readUnsignedShort(v + 4), labels);
++                    int type = readUnsignedShort(v + 6);
++                    if (type == 0) {
++                        mv.visitTryCatchBlock(start, end, handler, null);
++                    } else {
++                        mv.visitTryCatchBlock(start,
++                                end,
++                                handler,
++                                readUTF8(items[type], c));
++                    }
++                    v += 8;
++                }
++                // parses the local variable, line number tables, and code
++                // attributes
++                int varTable = 0;
++                int varTypeTable = 0;
++                int stackMap = 0;
++                int frameCount = 0;
++                int frameMode = 0;
++                int frameOffset = 0;
++                int frameLocalCount = 0;
++                int frameLocalDiff = 0;
++                int frameStackCount = 0;
++                Object[] frameLocal = null;
++                Object[] frameStack = null;
++                boolean zip = true;
++                cattrs = null;
++                j = readUnsignedShort(v);
++                v += 2;
++                for (; j > 0; --j) {
++                    attrName = readUTF8(v, c);
++                    if ("LocalVariableTable".equals(attrName)) {
++                        if (!skipDebug) {
++                            varTable = v + 6;
++                            k = readUnsignedShort(v + 6);
++                            w = v + 8;
++                            for (; k > 0; --k) {
++                                label = readUnsignedShort(w);
++                                if (labels[label] == null) {
++                                    readLabel(label, labels).status |= Label.DEBUG;
++                                }
++                                label += readUnsignedShort(w + 2);
++                                if (labels[label] == null) {
++                                    readLabel(label, labels).status |= Label.DEBUG;
++                                }
++                                w += 10;
++                            }
++                        }
++                    } else if ("LocalVariableTypeTable".equals(attrName)) {
++                        varTypeTable = v + 6;
++                    } else if ("LineNumberTable".equals(attrName)) {
++                        if (!skipDebug) {
++                            k = readUnsignedShort(v + 6);
++                            w = v + 8;
++                            for (; k > 0; --k) {
++                                label = readUnsignedShort(w);
++                                if (labels[label] == null) {
++                                    readLabel(label, labels).status |= Label.DEBUG;
++                                }
++                                labels[label].line = readUnsignedShort(w + 2);
++                                w += 4;
++                            }
++                        }
++                    } else if (FRAMES && "StackMapTable".equals(attrName)) {
++                        if ((flags & SKIP_FRAMES) == 0) {
++                            stackMap = v + 8;
++                            frameCount = readUnsignedShort(v + 6);
++                        }
++                        /*
++                         * here we do not extract the labels corresponding to
++                         * the attribute content. This would require a full
++                         * parsing of the attribute, which would need to be
++                         * repeated in the second phase (see below). Instead the
++                         * content of the attribute is read one frame at a time
++                         * (i.e. after a frame has been visited, the next frame
++                         * is read), and the labels it contains are also
++                         * extracted one frame at a time. Thanks to the ordering
++                         * of frames, having only a "one frame lookahead" is not
++                         * a problem, i.e. it is not possible to see an offset
++                         * smaller than the offset of the current insn and for
++                         * which no Label exist.
++                         */
++                        // TODO true for frame offsets,
++                        // but for UNINITIALIZED type offsets?
++                    } else if (FRAMES && "StackMap".equals(attrName)) {
++                        if ((flags & SKIP_FRAMES) == 0) {
++                            stackMap = v + 8;
++                            frameCount = readUnsignedShort(v + 6);
++                            zip = false;
++                        }
++                        /*
++                         * IMPORTANT! here we assume that the frames are
++                         * ordered, as in the StackMapTable attribute, although
++                         * this is not guaranteed by the attribute format.
++                         */
++                    } else {
++                        for (k = 0; k < attrs.length; ++k) {
++                            if (attrs[k].type.equals(attrName)) {
++                                attr = attrs[k].read(this,
++                                        v + 6,
++                                        readInt(v + 2),
++                                        c,
++                                        codeStart - 8,
++                                        labels);
++                                if (attr != null) {
++                                    attr.next = cattrs;
++                                    cattrs = attr;
++                                }
++                            }
++                        }
++                    }
++                    v += 6 + readInt(v + 2);
++                }
++
++                // 2nd phase: visits each instruction
++                if (FRAMES && stackMap != 0) {
++                    // creates the very first (implicit) frame from the method
++                    // descriptor
++                    frameLocal = new Object[maxLocals];
++                    frameStack = new Object[maxStack];
++                    if (unzip) {
++                        int local = 0;
++                        if ((access & Opcodes.ACC_STATIC) == 0) {
++                            if ("<init>".equals(name)) {
++                                frameLocal[local++] = Opcodes.UNINITIALIZED_THIS;
++                            } else {
++                                frameLocal[local++] = readClass(header + 2, c);
++                            }
++                        }
++                        j = 1;
++                        loop: while (true) {
++                            k = j;
++                            switch (desc.charAt(j++)) {
++                                case 'Z':
++                                case 'C':
++                                case 'B':
++                                case 'S':
++                                case 'I':
++                                    frameLocal[local++] = Opcodes.INTEGER;
++                                    break;
++                                case 'F':
++                                    frameLocal[local++] = Opcodes.FLOAT;
++                                    break;
++                                case 'J':
++                                    frameLocal[local++] = Opcodes.LONG;
++                                    break;
++                                case 'D':
++                                    frameLocal[local++] = Opcodes.DOUBLE;
++                                    break;
++                                case '[':
++                                    while (desc.charAt(j) == '[') {
++                                        ++j;
++                                    }
++                                    if (desc.charAt(j) == 'L') {
++                                        ++j;
++                                        while (desc.charAt(j) != ';') {
++                                            ++j;
++                                        }
++                                    }
++                                    frameLocal[local++] = desc.substring(k, ++j);
++                                    break;
++                                case 'L':
++                                    while (desc.charAt(j) != ';') {
++                                        ++j;
++                                    }
++                                    frameLocal[local++] = desc.substring(k + 1,
++                                            j++);
++                                    break;
++                                default:
++                                    break loop;
++                            }
++                        }
++                        frameLocalCount = local;
++                    }
++                    /*
++                     * for the first explicit frame the offset is not
++                     * offset_delta + 1 but only offset_delta; setting the
++                     * implicit frame offset to -1 allow the use of the
++                     * "offset_delta + 1" rule in all cases
++                     */
++                    frameOffset = -1;
++                }
++                v = codeStart;
++                Label l;
++                while (v < codeEnd) {
++                    w = v - codeStart;
++
++                    l = labels[w];
++                    if (l != null) {
++                        mv.visitLabel(l);
++                        if (!skipDebug && l.line > 0) {
++                            mv.visitLineNumber(l.line, l);
++                        }
++                    }
++
++                    while (FRAMES && frameLocal != null
++                            && (frameOffset == w || frameOffset == -1))
++                    {
++                        // if there is a frame for this offset,
++                        // makes the visitor visit it,
++                        // and reads the next frame if there is one.
++                        if (!zip || unzip) {
++                            mv.visitFrame(Opcodes.F_NEW,
++                                    frameLocalCount,
++                                    frameLocal,
++                                    frameStackCount,
++                                    frameStack);
++                        } else if (frameOffset != -1) {
++                            mv.visitFrame(frameMode,
++                                    frameLocalDiff,
++                                    frameLocal,
++                                    frameStackCount,
++                                    frameStack);
++                        }
++
++                        if (frameCount > 0) {
++                            int tag, delta, n;
++                            if (zip) {
++                                tag = b[stackMap++] & 0xFF;
++                            } else {
++                                tag = MethodWriter.FULL_FRAME;
++                                frameOffset = -1;
++                            }
++                            frameLocalDiff = 0;
++                            if (tag < MethodWriter.SAME_LOCALS_1_STACK_ITEM_FRAME)
++                            {
++                                delta = tag;
++                                frameMode = Opcodes.F_SAME;
++                                frameStackCount = 0;
++                            } else if (tag < MethodWriter.RESERVED) {
++                                delta = tag
++                                        - MethodWriter.SAME_LOCALS_1_STACK_ITEM_FRAME;
++                                stackMap = readFrameType(frameStack,
++                                        0,
++                                        stackMap,
++                                        c,
++                                        labels);
++                                frameMode = Opcodes.F_SAME1;
++                                frameStackCount = 1;
++                            } else {
++                                delta = readUnsignedShort(stackMap);
++                                stackMap += 2;
++                                if (tag == MethodWriter.SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED)
++                                {
++                                    stackMap = readFrameType(frameStack,
++                                            0,
++                                            stackMap,
++                                            c,
++                                            labels);
++                                    frameMode = Opcodes.F_SAME1;
++                                    frameStackCount = 1;
++                                } else if (tag >= MethodWriter.CHOP_FRAME
++                                        && tag < MethodWriter.SAME_FRAME_EXTENDED)
++                                {
++                                    frameMode = Opcodes.F_CHOP;
++                                    frameLocalDiff = MethodWriter.SAME_FRAME_EXTENDED
++                                            - tag;
++                                    frameLocalCount -= frameLocalDiff;
++                                    frameStackCount = 0;
++                                } else if (tag == MethodWriter.SAME_FRAME_EXTENDED)
++                                {
++                                    frameMode = Opcodes.F_SAME;
++                                    frameStackCount = 0;
++                                } else if (tag < MethodWriter.FULL_FRAME) {
++                                    j = unzip ? frameLocalCount : 0;
++                                    for (k = tag
++                                            - MethodWriter.SAME_FRAME_EXTENDED; k > 0; k--)
++                                    {
++                                        stackMap = readFrameType(frameLocal,
++                                                j++,
++                                                stackMap,
++                                                c,
++                                                labels);
++                                    }
++                                    frameMode = Opcodes.F_APPEND;
++                                    frameLocalDiff = tag
++                                            - MethodWriter.SAME_FRAME_EXTENDED;
++                                    frameLocalCount += frameLocalDiff;
++                                    frameStackCount = 0;
++                                } else { // if (tag == FULL_FRAME) {
++                                    frameMode = Opcodes.F_FULL;
++                                    n = frameLocalDiff = frameLocalCount = readUnsignedShort(stackMap);
++                                    stackMap += 2;
++                                    for (j = 0; n > 0; n--) {
++                                        stackMap = readFrameType(frameLocal,
++                                                j++,
++                                                stackMap,
++                                                c,
++                                                labels);
++                                    }
++                                    n = frameStackCount = readUnsignedShort(stackMap);
++                                    stackMap += 2;
++                                    for (j = 0; n > 0; n--) {
++                                        stackMap = readFrameType(frameStack,
++                                                j++,
++                                                stackMap,
++                                                c,
++                                                labels);
++                                    }
++                                }
++                            }
++                            frameOffset += delta + 1;
++                            readLabel(frameOffset, labels);
++
++                            --frameCount;
++                        } else {
++                            frameLocal = null;
++                        }
++                    }
++
++                    int opcode = b[v] & 0xFF;
++                    switch (ClassWriter.TYPE[opcode]) {
++                        case ClassWriter.NOARG_INSN:
++                            mv.visitInsn(opcode);
++                            v += 1;
++                            break;
++                        case ClassWriter.IMPLVAR_INSN:
++                            if (opcode > Opcodes.ISTORE) {
++                                opcode -= 59; // ISTORE_0
++                                mv.visitVarInsn(Opcodes.ISTORE + (opcode >> 2),
++                                        opcode & 0x3);
++                            } else {
++                                opcode -= 26; // ILOAD_0
++                                mv.visitVarInsn(Opcodes.ILOAD + (opcode >> 2),
++                                        opcode & 0x3);
++                            }
++                            v += 1;
++                            break;
++                        case ClassWriter.LABEL_INSN:
++                            mv.visitJumpInsn(opcode, labels[w
++                                    + readShort(v + 1)]);
++                            v += 3;
++                            break;
++                        case ClassWriter.LABELW_INSN:
++                            mv.visitJumpInsn(opcode - 33, labels[w
++                                    + readInt(v + 1)]);
++                            v += 5;
++                            break;
++                        case ClassWriter.WIDE_INSN:
++                            opcode = b[v + 1] & 0xFF;
++                            if (opcode == Opcodes.IINC) {
++                                mv.visitIincInsn(readUnsignedShort(v + 2),
++                                        readShort(v + 4));
++                                v += 6;
++                            } else {
++                                mv.visitVarInsn(opcode,
++                                        readUnsignedShort(v + 2));
++                                v += 4;
++                            }
++                            break;
++                        case ClassWriter.TABL_INSN:
++                            // skips 0 to 3 padding bytes
++                            v = v + 4 - (w & 3);
++                            // reads instruction
++                            label = w + readInt(v);
++                            int min = readInt(v + 4);
++                            int max = readInt(v + 8);
++                            v += 12;
++                            Label[] table = new Label[max - min + 1];
++                            for (j = 0; j < table.length; ++j) {
++                                table[j] = labels[w + readInt(v)];
++                                v += 4;
++                            }
++                            mv.visitTableSwitchInsn(min,
++                                    max,
++                                    labels[label],
++                                    table);
++                            break;
++                        case ClassWriter.LOOK_INSN:
++                            // skips 0 to 3 padding bytes
++                            v = v + 4 - (w & 3);
++                            // reads instruction
++                            label = w + readInt(v);
++                            j = readInt(v + 4);
++                            v += 8;
++                            int[] keys = new int[j];
++                            Label[] values = new Label[j];
++                            for (j = 0; j < keys.length; ++j) {
++                                keys[j] = readInt(v);
++                                values[j] = labels[w + readInt(v + 4)];
++                                v += 8;
++                            }
++                            mv.visitLookupSwitchInsn(labels[label],
++                                    keys,
++                                    values);
++                            break;
++                        case ClassWriter.VAR_INSN:
++                            mv.visitVarInsn(opcode, b[v + 1] & 0xFF);
++                            v += 2;
++                            break;
++                        case ClassWriter.SBYTE_INSN:
++                            mv.visitIntInsn(opcode, b[v + 1]);
++                            v += 2;
++                            break;
++                        case ClassWriter.SHORT_INSN:
++                            mv.visitIntInsn(opcode, readShort(v + 1));
++                            v += 3;
++                            break;
++                        case ClassWriter.LDC_INSN:
++                            mv.visitLdcInsn(readConst(b[v + 1] & 0xFF, c));
++                            v += 2;
++                            break;
++                        case ClassWriter.LDCW_INSN:
++                            mv.visitLdcInsn(readConst(readUnsignedShort(v + 1),
++                                    c));
++                            v += 3;
++                            break;
++                        case ClassWriter.FIELDORMETH_INSN:
++                        case ClassWriter.ITFMETH_INSN:
++                            int cpIndex = items[readUnsignedShort(v + 1)];
++                            String iowner = readClass(cpIndex, c);
++                            cpIndex = items[readUnsignedShort(cpIndex + 2)];
++                            String iname = readUTF8(cpIndex, c);
++                            String idesc = readUTF8(cpIndex + 2, c);
++                            if (opcode < Opcodes.INVOKEVIRTUAL) {
++                                mv.visitFieldInsn(opcode, iowner, iname, idesc);
++                            } else {
++                                mv.visitMethodInsn(opcode, iowner, iname, idesc);
++                            }
++                            if (opcode == Opcodes.INVOKEINTERFACE) {
++                                v += 5;
++                            } else {
++                                v += 3;
++                            }
++                            break;
++                        case ClassWriter.TYPE_INSN:
++                            mv.visitTypeInsn(opcode, readClass(v + 1, c));
++                            v += 3;
++                            break;
++                        case ClassWriter.IINC_INSN:
++                            mv.visitIincInsn(b[v + 1] & 0xFF, b[v + 2]);
++                            v += 3;
++                            break;
++                        // case MANA_INSN:
++                        default:
++                            mv.visitMultiANewArrayInsn(readClass(v + 1, c),
++                                    b[v + 3] & 0xFF);
++                            v += 4;
++                            break;
++                    }
++                }
++                l = labels[codeEnd - codeStart];
++                if (l != null) {
++                    mv.visitLabel(l);
++                }
++                // visits the local variable tables
++                if (!skipDebug && varTable != 0) {
++                    int[] typeTable = null;
++                    if (varTypeTable != 0) {
++                        k = readUnsignedShort(varTypeTable) * 3;
++                        w = varTypeTable + 2;
++                        typeTable = new int[k];
++                        while (k > 0) {
++                            typeTable[--k] = w + 6; // signature
++                            typeTable[--k] = readUnsignedShort(w + 8); // index
++                            typeTable[--k] = readUnsignedShort(w); // start
++                            w += 10;
++                        }
++                    }
++                    k = readUnsignedShort(varTable);
++                    w = varTable + 2;
++                    for (; k > 0; --k) {
++                        int start = readUnsignedShort(w);
++                        int length = readUnsignedShort(w + 2);
++                        int index = readUnsignedShort(w + 8);
++                        String vsignature = null;
++                        if (typeTable != null) {
++                            for (int a = 0; a < typeTable.length; a += 3) {
++                                if (typeTable[a] == start
++                                        && typeTable[a + 1] == index)
++                                {
++                                    vsignature = readUTF8(typeTable[a + 2], c);
++                                    break;
++                                }
++                            }
++                        }
++                        mv.visitLocalVariable(readUTF8(w + 4, c),
++                                readUTF8(w + 6, c),
++                                vsignature,
++                                labels[start],
++                                labels[start + length],
++                                index);
++                        w += 10;
++                    }
++                }
++                // visits the other attributes
++                while (cattrs != null) {
++                    attr = cattrs.next;
++                    cattrs.next = null;
++                    mv.visitAttribute(cattrs);
++                    cattrs = attr;
++                }
++                // visits the max stack and max locals values
++                mv.visitMaxs(maxStack, maxLocals);
++            }
++
++            if (mv != null) {
++                mv.visitEnd();
++            }
++        }
++
++        // visits the end of the class
++        classVisitor.visitEnd();
++    }
++
++    /**
++     * Reads parameter annotations and makes the given visitor visit them.
++     *
++     * @param v start offset in {@link #b b} of the annotations to be read.
++     * @param desc the method descriptor.
++     * @param buf buffer to be used to call {@link #readUTF8 readUTF8},
++     *        {@link #readClass(int,char[]) readClass} or
++     *        {@link #readConst readConst}.
++     * @param visible <tt>true</tt> if the annotations to be read are visible
++     *        at runtime.
++     * @param mv the visitor that must visit the annotations.
++     */
++    private void readParameterAnnotations(
++        int v,
++        final String desc,
++        final char[] buf,
++        final boolean visible,
++        final MethodVisitor mv)
++    {
++        int i;
++        int n = b[v++] & 0xFF;
++        // workaround for a bug in javac (javac compiler generates a parameter
++        // annotation array whose size is equal to the number of parameters in
++        // the Java source file, while it should generate an array whose size is
++        // equal to the number of parameters in the method descriptor - which
++        // includes the synthetic parameters added by the compiler). This work-
++        // around supposes that the synthetic parameters are the first ones.
++        int synthetics = Type.getArgumentTypes(desc).length - n;
++        AnnotationVisitor av;
++        for (i = 0; i < synthetics; ++i) {
++            // virtual annotation to detect synthetic parameters in MethodWriter
++            av = mv.visitParameterAnnotation(i, "Ljava/lang/Synthetic;", false);
++            if (av != null) {
++                av.visitEnd();
++            }
++        }
++        for (; i < n + synthetics; ++i) {
++            int j = readUnsignedShort(v);
++            v += 2;
++            for (; j > 0; --j) {
++                av = mv.visitParameterAnnotation(i, readUTF8(v, buf), visible);
++                v = readAnnotationValues(v + 2, buf, true, av);
++            }
++        }
++    }
++
++    /**
++     * Reads the values of an annotation and makes the given visitor visit them.
++     *
++     * @param v the start offset in {@link #b b} of the values to be read
++     *        (including the unsigned short that gives the number of values).
++     * @param buf buffer to be used to call {@link #readUTF8 readUTF8},
++     *        {@link #readClass(int,char[]) readClass} or
++     *        {@link #readConst readConst}.
++     * @param named if the annotation values are named or not.
++     * @param av the visitor that must visit the values.
++     * @return the end offset of the annotation values.
++     */
++    private int readAnnotationValues(
++        int v,
++        final char[] buf,
++        final boolean named,
++        final AnnotationVisitor av)
++    {
++        int i = readUnsignedShort(v);
++        v += 2;
++        if (named) {
++            for (; i > 0; --i) {
++                v = readAnnotationValue(v + 2, buf, readUTF8(v, buf), av);
++            }
++        } else {
++            for (; i > 0; --i) {
++                v = readAnnotationValue(v, buf, null, av);
++            }
++        }
++        if (av != null) {
++            av.visitEnd();
++        }
++        return v;
++    }
++
++    /**
++     * Reads a value of an annotation and makes the given visitor visit it.
++     *
++     * @param v the start offset in {@link #b b} of the value to be read (<i>not
++     *        including the value name constant pool index</i>).
++     * @param buf buffer to be used to call {@link #readUTF8 readUTF8},
++     *        {@link #readClass(int,char[]) readClass} or
++     *        {@link #readConst readConst}.
++     * @param name the name of the value to be read.
++     * @param av the visitor that must visit the value.
++     * @return the end offset of the annotation value.
++     */
++    private int readAnnotationValue(
++        int v,
++        final char[] buf,
++        final String name,
++        final AnnotationVisitor av)
++    {
++        int i;
++        if (av == null) {
++            switch (b[v] & 0xFF) {
++                case 'e': // enum_const_value
++                    return v + 5;
++                case '@': // annotation_value
++                    return readAnnotationValues(v + 3, buf, true, null);
++                case '[': // array_value
++                    return readAnnotationValues(v + 1, buf, false, null);
++                default:
++                    return v + 3;
++            }
++        }
++        switch (b[v++] & 0xFF) {
++            case 'I': // pointer to CONSTANT_Integer
++            case 'J': // pointer to CONSTANT_Long
++            case 'F': // pointer to CONSTANT_Float
++            case 'D': // pointer to CONSTANT_Double
++                av.visit(name, readConst(readUnsignedShort(v), buf));
++                v += 2;
++                break;
++            case 'B': // pointer to CONSTANT_Byte
++                av.visit(name,
++                        new Byte((byte) readInt(items[readUnsignedShort(v)])));
++                v += 2;
++                break;
++            case 'Z': // pointer to CONSTANT_Boolean
++                av.visit(name, readInt(items[readUnsignedShort(v)]) == 0
++                        ? Boolean.FALSE
++                        : Boolean.TRUE);
++                v += 2;
++                break;
++            case 'S': // pointer to CONSTANT_Short
++                av.visit(name,
++                        new Short((short) readInt(items[readUnsignedShort(v)])));
++                v += 2;
++                break;
++            case 'C': // pointer to CONSTANT_Char
++                av.visit(name,
++                        new Character((char) readInt(items[readUnsignedShort(v)])));
++                v += 2;
++                break;
++            case 's': // pointer to CONSTANT_Utf8
++                av.visit(name, readUTF8(v, buf));
++                v += 2;
++                break;
++            case 'e': // enum_const_value
++                av.visitEnum(name, readUTF8(v, buf), readUTF8(v + 2, buf));
++                v += 4;
++                break;
++            case 'c': // class_info
++                av.visit(name, Type.getType(readUTF8(v, buf)));
++                v += 2;
++                break;
++            case '@': // annotation_value
++                v = readAnnotationValues(v + 2,
++                        buf,
++                        true,
++                        av.visitAnnotation(name, readUTF8(v, buf)));
++                break;
++            case '[': // array_value
++                int size = readUnsignedShort(v);
++                v += 2;
++                if (size == 0) {
++                    return readAnnotationValues(v - 2,
++                            buf,
++                            false,
++                            av.visitArray(name));
++                }
++                switch (this.b[v++] & 0xFF) {
++                    case 'B':
++                        byte[] bv = new byte[size];
++                        for (i = 0; i < size; i++) {
++                            bv[i] = (byte) readInt(items[readUnsignedShort(v)]);
++                            v += 3;
++                        }
++                        av.visit(name, bv);
++                        --v;
++                        break;
++                    case 'Z':
++                        boolean[] zv = new boolean[size];
++                        for (i = 0; i < size; i++) {
++                            zv[i] = readInt(items[readUnsignedShort(v)]) != 0;
++                            v += 3;
++                        }
++                        av.visit(name, zv);
++                        --v;
++                        break;
++                    case 'S':
++                        short[] sv = new short[size];
++                        for (i = 0; i < size; i++) {
++                            sv[i] = (short) readInt(items[readUnsignedShort(v)]);
++                            v += 3;
++                        }
++                        av.visit(name, sv);
++                        --v;
++                        break;
++                    case 'C':
++                        char[] cv = new char[size];
++                        for (i = 0; i < size; i++) {
++                            cv[i] = (char) readInt(items[readUnsignedShort(v)]);
++                            v += 3;
++                        }
++                        av.visit(name, cv);
++                        --v;
++                        break;
++                    case 'I':
++                        int[] iv = new int[size];
++                        for (i = 0; i < size; i++) {
++                            iv[i] = readInt(items[readUnsignedShort(v)]);
++                            v += 3;
++                        }
++                        av.visit(name, iv);
++                        --v;
++                        break;
++                    case 'J':
++                        long[] lv = new long[size];
++                        for (i = 0; i < size; i++) {
++                            lv[i] = readLong(items[readUnsignedShort(v)]);
++                            v += 3;
++                        }
++                        av.visit(name, lv);
++                        --v;
++                        break;
++                    case 'F':
++                        float[] fv = new float[size];
++                        for (i = 0; i < size; i++) {
++                            fv[i] = Float.intBitsToFloat(readInt(items[readUnsignedShort(v)]));
++                            v += 3;
++                        }
++                        av.visit(name, fv);
++                        --v;
++                        break;
++                    case 'D':
++                        double[] dv = new double[size];
++                        for (i = 0; i < size; i++) {
++                            dv[i] = Double.longBitsToDouble(readLong(items[readUnsignedShort(v)]));
++                            v += 3;
++                        }
++                        av.visit(name, dv);
++                        --v;
++                        break;
++                    default:
++                        v = readAnnotationValues(v - 3,
++                                buf,
++                                false,
++                                av.visitArray(name));
++                }
++        }
++        return v;
++    }
++
++    private int readFrameType(
++        final Object[] frame,
++        final int index,
++        int v,
++        final char[] buf,
++        final Label[] labels)
++    {
++        int type = b[v++] & 0xFF;
++        switch (type) {
++            case 0:
++                frame[index] = Opcodes.TOP;
++                break;
++            case 1:
++                frame[index] = Opcodes.INTEGER;
++                break;
++            case 2:
++                frame[index] = Opcodes.FLOAT;
++                break;
++            case 3:
++                frame[index] = Opcodes.DOUBLE;
++                break;
++            case 4:
++                frame[index] = Opcodes.LONG;
++                break;
++            case 5:
++                frame[index] = Opcodes.NULL;
++                break;
++            case 6:
++                frame[index] = Opcodes.UNINITIALIZED_THIS;
++                break;
++            case 7: // Object
++                frame[index] = readClass(v, buf);
++                v += 2;
++                break;
++            default: // Uninitialized
++                frame[index] = readLabel(readUnsignedShort(v), labels);
++                v += 2;
++        }
++        return v;
++    }
++
++    /**
++     * Returns the label corresponding to the given offset. The default
++     * implementation of this method creates a label for the given offset if it
++     * has not been already created.
++     *
++     * @param offset a bytecode offset in a method.
++     * @param labels the already created labels, indexed by their offset. If a
++     *        label already exists for offset this method must not create a new
++     *        one. Otherwise it must store the new label in this array.
++     * @return a non null Label, which must be equal to labels[offset].
++     */
++    protected Label readLabel(int offset, Label[] labels) {
++        if (labels[offset] == null) {
++            labels[offset] = new Label();
++        }
++        return labels[offset];
++    }
++
++    /**
++     * Reads an attribute in {@link #b b}.
++     *
++     * @param attrs prototypes of the attributes that must be parsed during the
++     *        visit of the class. Any attribute whose type is not equal to the
++     *        type of one the prototypes is ignored (i.e. an empty
++     *        {@link Attribute} instance is returned).
++     * @param type the type of the attribute.
++     * @param off index of the first byte of the attribute's content in
++     *        {@link #b b}. The 6 attribute header bytes, containing the type
++     *        and the length of the attribute, are not taken into account here
++     *        (they have already been read).
++     * @param len the length of the attribute's content.
++     * @param buf buffer to be used to call {@link #readUTF8 readUTF8},
++     *        {@link #readClass(int,char[]) readClass} or
++     *        {@link #readConst readConst}.
++     * @param codeOff index of the first byte of code's attribute content in
++     *        {@link #b b}, or -1 if the attribute to be read is not a code
++     *        attribute. The 6 attribute header bytes, containing the type and
++     *        the length of the attribute, are not taken into account here.
++     * @param labels the labels of the method's code, or <tt>null</tt> if the
++     *        attribute to be read is not a code attribute.
++     * @return the attribute that has been read, or <tt>null</tt> to skip this
++     *         attribute.
++     */
++    private Attribute readAttribute(
++        final Attribute[] attrs,
++        final String type,
++        final int off,
++        final int len,
++        final char[] buf,
++        final int codeOff,
++        final Label[] labels)
++    {
++        for (int i = 0; i < attrs.length; ++i) {
++            if (attrs[i].type.equals(type)) {
++                return attrs[i].read(this, off, len, buf, codeOff, labels);
++            }
++        }
++        return new Attribute(type).read(this, off, len, null, -1, null);
++    }
++
++    // ------------------------------------------------------------------------
++    // Utility methods: low level parsing
++    // ------------------------------------------------------------------------
++
++    /**
++     * Returns the start index of the constant pool item in {@link #b b}, plus
++     * one. <i>This method is intended for {@link Attribute} sub classes, and is
++     * normally not needed by class generators or adapters.</i>
++     *
++     * @param item the index a constant pool item.
++     * @return the start index of the constant pool item in {@link #b b}, plus
++     *         one.
++     */
++    public int getItem(final int item) {
++        return items[item];
++    }
++
++    /**
++     * Reads a byte value in {@link #b b}. <i>This method is intended for
++     * {@link Attribute} sub classes, and is normally not needed by class
++     * generators or adapters.</i>
++     *
++     * @param index the start index of the value to be read in {@link #b b}.
++     * @return the read value.
++     */
++    public int readByte(final int index) {
++        return b[index] & 0xFF;
++    }
++
++    /**
++     * Reads an unsigned short value in {@link #b b}. <i>This method is
++     * intended for {@link Attribute} sub classes, and is normally not needed by
++     * class generators or adapters.</i>
++     *
++     * @param index the start index of the value to be read in {@link #b b}.
++     * @return the read value.
++     */
++    public int readUnsignedShort(final int index) {
++        byte[] b = this.b;
++        return ((b[index] & 0xFF) << 8) | (b[index + 1] & 0xFF);
++    }
++
++    /**
++     * Reads a signed short value in {@link #b b}. <i>This method is intended
++     * for {@link Attribute} sub classes, and is normally not needed by class
++     * generators or adapters.</i>
++     *
++     * @param index the start index of the value to be read in {@link #b b}.
++     * @return the read value.
++     */
++    public short readShort(final int index) {
++        byte[] b = this.b;
++        return (short) (((b[index] & 0xFF) << 8) | (b[index + 1] & 0xFF));
++    }
++
++    /**
++     * Reads a signed int value in {@link #b b}. <i>This method is intended for
++     * {@link Attribute} sub classes, and is normally not needed by class
++     * generators or adapters.</i>
++     *
++     * @param index the start index of the value to be read in {@link #b b}.
++     * @return the read value.
++     */
++    public int readInt(final int index) {
++        byte[] b = this.b;
++        return ((b[index] & 0xFF) << 24) | ((b[index + 1] & 0xFF) << 16)
++                | ((b[index + 2] & 0xFF) << 8) | (b[index + 3] & 0xFF);
++    }
++
++    /**
++     * Reads a signed long value in {@link #b b}. <i>This method is intended
++     * for {@link Attribute} sub classes, and is normally not needed by class
++     * generators or adapters.</i>
++     *
++     * @param index the start index of the value to be read in {@link #b b}.
++     * @return the read value.
++     */
++    public long readLong(final int index) {
++        long l1 = readInt(index);
++        long l0 = readInt(index + 4) & 0xFFFFFFFFL;
++        return (l1 << 32) | l0;
++    }
++
++    /**
++     * Reads an UTF8 string constant pool item in {@link #b b}. <i>This method
++     * is intended for {@link Attribute} sub classes, and is normally not needed
++     * by class generators or adapters.</i>
++     *
++     * @param index the start index of an unsigned short value in {@link #b b},
++     *        whose value is the index of an UTF8 constant pool item.
++     * @param buf buffer to be used to read the item. This buffer must be
++     *        sufficiently large. It is not automatically resized.
++     * @return the String corresponding to the specified UTF8 item.
++     */
++    public String readUTF8(int index, final char[] buf) {
++        int item = readUnsignedShort(index);
++        String s = strings[item];
++        if (s != null) {
++            return s;
++        }
++        index = items[item];
++        return strings[item] = readUTF(index + 2, readUnsignedShort(index), buf);
++    }
++
++    /**
++     * Reads UTF8 string in {@link #b b}.
++     *
++     * @param index start offset of the UTF8 string to be read.
++     * @param utfLen length of the UTF8 string to be read.
++     * @param buf buffer to be used to read the string. This buffer must be
++     *        sufficiently large. It is not automatically resized.
++     * @return the String corresponding to the specified UTF8 string.
++     */
++    private String readUTF(int index, final int utfLen, final char[] buf) {
++        int endIndex = index + utfLen;
++        byte[] b = this.b;
++        int strLen = 0;
++        int c, d, e;
++        while (index < endIndex) {
++            c = b[index++] & 0xFF;
++            switch (c >> 4) {
++                case 0:
++                case 1:
++                case 2:
++                case 3:
++                case 4:
++                case 5:
++                case 6:
++                case 7:
++                    // 0xxxxxxx
++                    buf[strLen++] = (char) c;
++                    break;
++                case 12:
++                case 13:
++                    // 110x xxxx 10xx xxxx
++                    d = b[index++];
++                    buf[strLen++] = (char) (((c & 0x1F) << 6) | (d & 0x3F));
++                    break;
++                default:
++                    // 1110 xxxx 10xx xxxx 10xx xxxx
++                    d = b[index++];
++                    e = b[index++];
++                    buf[strLen++] = (char) (((c & 0x0F) << 12)
++                            | ((d & 0x3F) << 6) | (e & 0x3F));
++                    break;
++            }
++        }
++        return new String(buf, 0, strLen);
++    }
++
++    /**
++     * Reads a class constant pool item in {@link #b b}. <i>This method is
++     * intended for {@link Attribute} sub classes, and is normally not needed by
++     * class generators or adapters.</i>
++     *
++     * @param index the start index of an unsigned short value in {@link #b b},
++     *        whose value is the index of a class constant pool item.
++     * @param buf buffer to be used to read the item. This buffer must be
++     *        sufficiently large. It is not automatically resized.
++     * @return the String corresponding to the specified class item.
++     */
++    public String readClass(final int index, final char[] buf) {
++        // computes the start index of the CONSTANT_Class item in b
++        // and reads the CONSTANT_Utf8 item designated by
++        // the first two bytes of this CONSTANT_Class item
++        return readUTF8(items[readUnsignedShort(index)], buf);
++    }
++
++    /**
++     * Reads a numeric or string constant pool item in {@link #b b}. <i>This
++     * method is intended for {@link Attribute} sub classes, and is normally not
++     * needed by class generators or adapters.</i>
++     *
++     * @param item the index of a constant pool item.
++     * @param buf buffer to be used to read the item. This buffer must be
++     *        sufficiently large. It is not automatically resized.
++     * @return the {@link Integer}, {@link Float}, {@link Long},
++     *         {@link Double}, {@link String} or {@link Type} corresponding to
++     *         the given constant pool item.
++     */
++    public Object readConst(final int item, final char[] buf) {
++        int index = items[item];
++        switch (b[index - 1]) {
++            case ClassWriter.INT:
++                return new Integer(readInt(index));
++            case ClassWriter.FLOAT:
++                return new Float(Float.intBitsToFloat(readInt(index)));
++            case ClassWriter.LONG:
++                return new Long(readLong(index));
++            case ClassWriter.DOUBLE:
++                return new Double(Double.longBitsToDouble(readLong(index)));
++            case ClassWriter.CLASS:
++                return Type.getObjectType(readUTF8(index, buf));
++                // case ClassWriter.STR:
++            default:
++                return readUTF8(index, buf);
++        }
++    }
++}
+--- /dev/null	Thu Jul 30 19:03:07 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/org/objectweb/asm/ClassVisitor.java	Thu Jul 30 19:03:06 2009
+@@ -0,0 +1,226 @@
++/*
++ * Copyright 2005-2009 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++
++/*
++ * This file is available under and governed by the GNU General Public
++ * License version 2 only, as published by the Free Software Foundation.
++ * However, the following notice accompanied the original version of this
++ * file:
++ *
++ * ASM: a very small and fast Java bytecode manipulation framework
++ * Copyright (c) 2000-2007 INRIA, France Telecom
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ *    notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ *    notice, this list of conditions and the following disclaimer in the
++ *    documentation and/or other materials provided with the distribution.
++ * 3. Neither the name of the copyright holders nor the names of its
++ *    contributors may be used to endorse or promote products derived from
++ *    this software without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
++ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
++ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
++ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
++ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
++ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
++ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
++ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
++ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
++ * THE POSSIBILITY OF SUCH DAMAGE.
++ */
++package com.sun.xml.internal.ws.org.objectweb.asm;
++
++/**
++ * A visitor to visit a Java class. The methods of this interface must be called
++ * in the following order: <tt>visit</tt> [ <tt>visitSource</tt> ] [
++ * <tt>visitOuterClass</tt> ] ( <tt>visitAnnotation</tt> |
++ * <tt>visitAttribute</tt> )* (<tt>visitInnerClass</tt> |
++ * <tt>visitField</tt> | <tt>visitMethod</tt> )* <tt>visitEnd</tt>.
++ *
++ * @author Eric Bruneton
++ */
++public interface ClassVisitor {
++
++    /**
++     * Visits the header of the class.
++     *
++     * @param version the class version.
++     * @param access the class's access flags (see {@link Opcodes}). This
++     *        parameter also indicates if the class is deprecated.
++     * @param name the internal name of the class (see
++     *        {@link Type#getInternalName() getInternalName}).
++     * @param signature the signature of this class. May be <tt>null</tt> if
++     *        the class is not a generic one, and does not extend or implement
++     *        generic classes or interfaces.
++     * @param superName the internal of name of the super class (see
++     *        {@link Type#getInternalName() getInternalName}). For interfaces,
++     *        the super class is {@link Object}. May be <tt>null</tt>, but
++     *        only for the {@link Object} class.
++     * @param interfaces the internal names of the class's interfaces (see
++     *        {@link Type#getInternalName() getInternalName}). May be
++     *        <tt>null</tt>.
++     */
++    void visit(
++        int version,
++        int access,
++        String name,
++        String signature,
++        String superName,
++        String[] interfaces);
++
++    /**
++     * Visits the source of the class.
++     *
++     * @param source the name of the source file from which the class was
++     *        compiled. May be <tt>null</tt>.
++     * @param debug additional debug information to compute the correspondance
++     *        between source and compiled elements of the class. May be
++     *        <tt>null</tt>.
++     */
++    void visitSource(String source, String debug);
++
++    /**
++     * Visits the enclosing class of the class. This method must be called only
++     * if the class has an enclosing class.
++     *
++     * @param owner internal name of the enclosing class of the class.
++     * @param name the name of the method that contains the class, or
++     *        <tt>null</tt> if the class is not enclosed in a method of its
++     *        enclosing class.
++     * @param desc the descriptor of the method that contains the class, or
++     *        <tt>null</tt> if the class is not enclosed in a method of its
++     *        enclosing class.
++     */
++    void visitOuterClass(String owner, String name, String desc);
++
++    /**
++     * Visits an annotation of the class.
++     *
++     * @param desc the class descriptor of the annotation class.
++     * @param visible <tt>true</tt> if the annotation is visible at runtime.
++     * @return a visitor to visit the annotation values, or <tt>null</tt> if
++     *         this visitor is not interested in visiting this annotation.
++     */
++    AnnotationVisitor visitAnnotation(String desc, boolean visible);
++
++    /**
++     * Visits a non standard attribute of the class.
++     *
++     * @param attr an attribute.
++     */
++    void visitAttribute(Attribute attr);
++
++    /**
++     * Visits information about an inner class. This inner class is not
++     * necessarily a member of the class being visited.
++     *
++     * @param name the internal name of an inner class (see
++     *        {@link Type#getInternalName() getInternalName}).
++     * @param outerName the internal name of the class to which the inner class
++     *        belongs (see {@link Type#getInternalName() getInternalName}). May
++     *        be <tt>null</tt> for not member classes.
++     * @param innerName the (simple) name of the inner class inside its
++     *        enclosing class. May be <tt>null</tt> for anonymous inner
++     *        classes.
++     * @param access the access flags of the inner class as originally declared
++     *        in the enclosing class.
++     */
++    void visitInnerClass(
++        String name,
++        String outerName,
++        String innerName,
++        int access);
++
++    /**
++     * Visits a field of the class.
++     *
++     * @param access the field's access flags (see {@link Opcodes}). This
++     *        parameter also indicates if the field is synthetic and/or
++     *        deprecated.
++     * @param name the field's name.
++     * @param desc the field's descriptor (see {@link Type Type}).
++     * @param signature the field's signature. May be <tt>null</tt> if the
++     *        field's type does not use generic types.
++     * @param value the field's initial value. This parameter, which may be
++     *        <tt>null</tt> if the field does not have an initial value, must
++     *        be an {@link Integer}, a {@link Float}, a {@link Long}, a
++     *        {@link Double} or a {@link String} (for <tt>int</tt>,
++     *        <tt>float</tt>, <tt>long</tt> or <tt>String</tt> fields
++     *        respectively). <i>This parameter is only used for static fields</i>.
++     *        Its value is ignored for non static fields, which must be
++     *        initialized through bytecode instructions in constructors or
++     *        methods.
++     * @return a visitor to visit field annotations and attributes, or
++     *         <tt>null</tt> if this class visitor is not interested in
++     *         visiting these annotations and attributes.
++     */
++    FieldVisitor visitField(
++        int access,
++        String name,
++        String desc,
++        String signature,
++        Object value);
++
++    /**
++     * Visits a method of the class. This method <i>must</i> return a new
++     * {@link MethodVisitor} instance (or <tt>null</tt>) each time it is
++     * called, i.e., it should not return a previously returned visitor.
++     *
++     * @param access the method's access flags (see {@link Opcodes}). This
++     *        parameter also indicates if the method is synthetic and/or
++     *        deprecated.
++     * @param name the method's name.
++     * @param desc the method's descriptor (see {@link Type Type}).
++     * @param signature the method's signature. May be <tt>null</tt> if the
++     *        method parameters, return type and exceptions do not use generic
++     *        types.
++     * @param exceptions the internal names of the method's exception classes
++     *        (see {@link Type#getInternalName() getInternalName}). May be
++     *        <tt>null</tt>.
++     * @return an object to visit the byte code of the method, or <tt>null</tt>
++     *         if this class visitor is not interested in visiting the code of
++     *         this method.
++     */
++    MethodVisitor visitMethod(
++        int access,
++        String name,
++        String desc,
++        String signature,
++        String[] exceptions);
++
++    /**
++     * Visits the end of the class. This method, which is the last one to be
++     * called, is used to inform the visitor that all the fields and methods of
++     * the class have been visited.
++     */
++    void visitEnd();
++}
+--- /dev/null	Thu Jul 30 19:03:10 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/org/objectweb/asm/ClassWriter.java	Thu Jul 30 19:03:09 2009
+@@ -0,0 +1,1374 @@
++/*
++ * Copyright 2005-2009 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++
++/*
++ * This file is available under and governed by the GNU General Public
++ * License version 2 only, as published by the Free Software Foundation.
++ * However, the following notice accompanied the original version of this
++ * file:
++ *
++ * ASM: a very small and fast Java bytecode manipulation framework
++ * Copyright (c) 2000-2007 INRIA, France Telecom
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ *    notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ *    notice, this list of conditions and the following disclaimer in the
++ *    documentation and/or other materials provided with the distribution.
++ * 3. Neither the name of the copyright holders nor the names of its
++ *    contributors may be used to endorse or promote products derived from
++ *    this software without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
++ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
++ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
++ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
++ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
++ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
++ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
++ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
++ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
++ * THE POSSIBILITY OF SUCH DAMAGE.
++ */
++package com.sun.xml.internal.ws.org.objectweb.asm;
++
++/**
++ * A {@link ClassVisitor} that generates classes in bytecode form. More
++ * precisely this visitor generates a byte array conforming to the Java class
++ * file format. It can be used alone, to generate a Java class "from scratch",
++ * or with one or more {@link ClassReader ClassReader} and adapter class visitor
++ * to generate a modified class from one or more existing Java classes.
++ *
++ * @author Eric Bruneton
++ */
++public class ClassWriter implements ClassVisitor {
++
++    /**
++     * Flag to automatically compute the maximum stack size and the maximum
++     * number of local variables of methods. If this flag is set, then the
++     * arguments of the {@link MethodVisitor#visitMaxs visitMaxs} method of the
++     * {@link MethodVisitor} returned by the {@link #visitMethod visitMethod}
++     * method will be ignored, and computed automatically from the signature and
++     * the bytecode of each method.
++     *
++     * @see #ClassWriter(int)
++     */
++    public static final int COMPUTE_MAXS = 1;
++
++    /**
++     * Flag to automatically compute the stack map frames of methods from
++     * scratch. If this flag is set, then the calls to the
++     * {@link MethodVisitor#visitFrame} method are ignored, and the stack map
++     * frames are recomputed from the methods bytecode. The arguments of the
++     * {@link MethodVisitor#visitMaxs visitMaxs} method are also ignored and
++     * recomputed from the bytecode. In other words, computeFrames implies
++     * computeMaxs.
++     *
++     * @see #ClassWriter(int)
++     */
++    public static final int COMPUTE_FRAMES = 2;
++
++    /**
++     * The type of instructions without any argument.
++     */
++    static final int NOARG_INSN = 0;
++
++    /**
++     * The type of instructions with an signed byte argument.
++     */
++    static final int SBYTE_INSN = 1;
++
++    /**
++     * The type of instructions with an signed short argument.
++     */
++    static final int SHORT_INSN = 2;
++
++    /**
++     * The type of instructions with a local variable index argument.
++     */
++    static final int VAR_INSN = 3;
++
++    /**
++     * The type of instructions with an implicit local variable index argument.
++     */
++    static final int IMPLVAR_INSN = 4;
++
++    /**
++     * The type of instructions with a type descriptor argument.
++     */
++    static final int TYPE_INSN = 5;
++
++    /**
++     * The type of field and method invocations instructions.
++     */
++    static final int FIELDORMETH_INSN = 6;
++
++    /**
++     * The type of the INVOKEINTERFACE instruction.
++     */
++    static final int ITFMETH_INSN = 7;
++
++    /**
++     * The type of instructions with a 2 bytes bytecode offset label.
++     */
++    static final int LABEL_INSN = 8;
++
++    /**
++     * The type of instructions with a 4 bytes bytecode offset label.
++     */
++    static final int LABELW_INSN = 9;
++
++    /**
++     * The type of the LDC instruction.
++     */
++    static final int LDC_INSN = 10;
++
++    /**
++     * The type of the LDC_W and LDC2_W instructions.
++     */
++    static final int LDCW_INSN = 11;
++
++    /**
++     * The type of the IINC instruction.
++     */
++    static final int IINC_INSN = 12;
++
++    /**
++     * The type of the TABLESWITCH instruction.
++     */
++    static final int TABL_INSN = 13;
++
++    /**
++     * The type of the LOOKUPSWITCH instruction.
++     */
++    static final int LOOK_INSN = 14;
++
++    /**
++     * The type of the MULTIANEWARRAY instruction.
++     */
++    static final int MANA_INSN = 15;
++
++    /**
++     * The type of the WIDE instruction.
++     */
++    static final int WIDE_INSN = 16;
++
++    /**
++     * The instruction types of all JVM opcodes.
++     */
++    static final byte[] TYPE;
++
++    /**
++     * The type of CONSTANT_Class constant pool items.
++     */
++    static final int CLASS = 7;
++
++    /**
++     * The type of CONSTANT_Fieldref constant pool items.
++     */
++    static final int FIELD = 9;
++
++    /**
++     * The type of CONSTANT_Methodref constant pool items.
++     */
++    static final int METH = 10;
++
++    /**
++     * The type of CONSTANT_InterfaceMethodref constant pool items.
++     */
++    static final int IMETH = 11;
++
++    /**
++     * The type of CONSTANT_String constant pool items.
++     */
++    static final int STR = 8;
++
++    /**
++     * The type of CONSTANT_Integer constant pool items.
++     */
++    static final int INT = 3;
++
++    /**
++     * The type of CONSTANT_Float constant pool items.
++     */
++    static final int FLOAT = 4;
++
++    /**
++     * The type of CONSTANT_Long constant pool items.
++     */
++    static final int LONG = 5;
++
++    /**
++     * The type of CONSTANT_Double constant pool items.
++     */
++    static final int DOUBLE = 6;
++
++    /**
++     * The type of CONSTANT_NameAndType constant pool items.
++     */
++    static final int NAME_TYPE = 12;
++
++    /**
++     * The type of CONSTANT_Utf8 constant pool items.
++     */
++    static final int UTF8 = 1;
++
++    /**
++     * Normal type Item stored in the ClassWriter {@link ClassWriter#typeTable},
++     * instead of the constant pool, in order to avoid clashes with normal
++     * constant pool items in the ClassWriter constant pool's hash table.
++     */
++    static final int TYPE_NORMAL = 13;
++
++    /**
++     * Uninitialized type Item stored in the ClassWriter
++     * {@link ClassWriter#typeTable}, instead of the constant pool, in order to
++     * avoid clashes with normal constant pool items in the ClassWriter constant
++     * pool's hash table.
++     */
++    static final int TYPE_UNINIT = 14;
++
++    /**
++     * Merged type Item stored in the ClassWriter {@link ClassWriter#typeTable},
++     * instead of the constant pool, in order to avoid clashes with normal
++     * constant pool items in the ClassWriter constant pool's hash table.
++     */
++    static final int TYPE_MERGED = 15;
++
++    /**
++     * The class reader from which this class writer was constructed, if any.
++     */
++    ClassReader cr;
++
++    /**
++     * Minor and major version numbers of the class to be generated.
++     */
++    int version;
++
++    /**
++     * Index of the next item to be added in the constant pool.
++     */
++    int index;
++
++    /**
++     * The constant pool of this class.
++     */
++    final ByteVector pool;
++
++    /**
++     * The constant pool's hash table data.
++     */
++    Item[] items;
++
++    /**
++     * The threshold of the constant pool's hash table.
++     */
++    int threshold;
++
++    /**
++     * A reusable key used to look for items in the {@link #items} hash table.
++     */
++    final Item key;
++
++    /**
++     * A reusable key used to look for items in the {@link #items} hash table.
++     */
++    final Item key2;
++
++    /**
++     * A reusable key used to look for items in the {@link #items} hash table.
++     */
++    final Item key3;
++
++    /**
++     * A type table used to temporarily store internal names that will not
++     * necessarily be stored in the constant pool. This type table is used by
++     * the control flow and data flow analysis algorithm used to compute stack
++     * map frames from scratch. This array associates to each index <tt>i</tt>
++     * the Item whose index is <tt>i</tt>. All Item objects stored in this
++     * array are also stored in the {@link #items} hash table. These two arrays
++     * allow to retrieve an Item from its index or, conversely, to get the index
++     * of an Item from its value. Each Item stores an internal name in its
++     * {@link Item#strVal1} field.
++     */
++    Item[] typeTable;
++
++    /**
++     * Number of elements in the {@link #typeTable} array.
++     */
++    private short typeCount;
++
++    /**
++     * The access flags of this class.
++     */
++    private int access;
++
++    /**
++     * The constant pool item that contains the internal name of this class.
++     */
++    private int name;
++
++    /**
++     * The internal name of this class.
++     */
++    String thisName;
++
++    /**
++     * The constant pool item that contains the signature of this class.
++     */
++    private int signature;
++
++    /**
++     * The constant pool item that contains the internal name of the super class
++     * of this class.
++     */
++    private int superName;
++
++    /**
++     * Number of interfaces implemented or extended by this class or interface.
++     */
++    private int interfaceCount;
++
++    /**
++     * The interfaces implemented or extended by this class or interface. More
++     * precisely, this array contains the indexes of the constant pool items
++     * that contain the internal names of these interfaces.
++     */
++    private int[] interfaces;
++
++    /**
++     * The index of the constant pool item that contains the name of the source
++     * file from which this class was compiled.
++     */
++    private int sourceFile;
++
++    /**
++     * The SourceDebug attribute of this class.
++     */
++    private ByteVector sourceDebug;
++
++    /**
++     * The constant pool item that contains the name of the enclosing class of
++     * this class.
++     */
++    private int enclosingMethodOwner;
++
++    /**
++     * The constant pool item that contains the name and descriptor of the
++     * enclosing method of this class.
++     */
++    private int enclosingMethod;
++
++    /**
++     * The runtime visible annotations of this class.
++     */
++    private AnnotationWriter anns;
++
++    /**
++     * The runtime invisible annotations of this class.
++     */
++    private AnnotationWriter ianns;
++
++    /**
++     * The non standard attributes of this class.
++     */
++    private Attribute attrs;
++
++    /**
++     * The number of entries in the InnerClasses attribute.
++     */
++    private int innerClassesCount;
++
++    /**
++     * The InnerClasses attribute.
++     */
++    private ByteVector innerClasses;
++
++    /**
++     * The fields of this class. These fields are stored in a linked list of
++     * {@link FieldWriter} objects, linked to each other by their
++     * {@link FieldWriter#next} field. This field stores the first element of
++     * this list.
++     */
++    FieldWriter firstField;
++
++    /**
++     * The fields of this class. These fields are stored in a linked list of
++     * {@link FieldWriter} objects, linked to each other by their
++     * {@link FieldWriter#next} field. This field stores the last element of
++     * this list.
++     */
++    FieldWriter lastField;
++
++    /**
++     * The methods of this class. These methods are stored in a linked list of
++     * {@link MethodWriter} objects, linked to each other by their
++     * {@link MethodWriter#next} field. This field stores the first element of
++     * this list.
++     */
++    MethodWriter firstMethod;
++
++    /**
++     * The methods of this class. These methods are stored in a linked list of
++     * {@link MethodWriter} objects, linked to each other by their
++     * {@link MethodWriter#next} field. This field stores the last element of
++     * this list.
++     */
++    MethodWriter lastMethod;
++
++    /**
++     * <tt>true</tt> if the maximum stack size and number of local variables
++     * must be automatically computed.
++     */
++    private final boolean computeMaxs;
++
++    /**
++     * <tt>true</tt> if the stack map frames must be recomputed from scratch.
++     */
++    private final boolean computeFrames;
++
++    /**
++     * <tt>true</tt> if the stack map tables of this class are invalid. The
++     * {@link MethodWriter#resizeInstructions} method cannot transform existing
++     * stack map tables, and so produces potentially invalid classes when it is
++     * executed. In this case the class is reread and rewritten with the
++     * {@link #COMPUTE_FRAMES} option (the resizeInstructions method can resize
++     * stack map tables when this option is used).
++     */
++    boolean invalidFrames;
++
++    // ------------------------------------------------------------------------
++    // Static initializer
++    // ------------------------------------------------------------------------
++
++    /**
++     * Computes the instruction types of JVM opcodes.
++     */
++    static {
++        int i;
++        byte[] b = new byte[220];
++        String s = "AAAAAAAAAAAAAAAABCKLLDDDDDEEEEEEEEEEEEEEEEEEEEAAAAAAAADD"
++                + "DDDEEEEEEEEEEEEEEEEEEEEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
++                + "AAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAAIIIIIIIIIIIIIIIIDNOAA"
++                + "AAAAGGGGGGGHAFBFAAFFAAQPIIJJIIIIIIIIIIIIIIIIII";
++        for (i = 0; i < b.length; ++i) {
++            b[i] = (byte) (s.charAt(i) - 'A');
++        }
++        TYPE = b;
++
++        // code to generate the above string
++        //
++        // // SBYTE_INSN instructions
++        // b[Constants.NEWARRAY] = SBYTE_INSN;
++        // b[Constants.BIPUSH] = SBYTE_INSN;
++        //
++        // // SHORT_INSN instructions
++        // b[Constants.SIPUSH] = SHORT_INSN;
++        //
++        // // (IMPL)VAR_INSN instructions
++        // b[Constants.RET] = VAR_INSN;
++        // for (i = Constants.ILOAD; i <= Constants.ALOAD; ++i) {
++        // b[i] = VAR_INSN;
++        // }
++        // for (i = Constants.ISTORE; i <= Constants.ASTORE; ++i) {
++        // b[i] = VAR_INSN;
++        // }
++        // for (i = 26; i <= 45; ++i) { // ILOAD_0 to ALOAD_3
++        // b[i] = IMPLVAR_INSN;
++        // }
++        // for (i = 59; i <= 78; ++i) { // ISTORE_0 to ASTORE_3
++        // b[i] = IMPLVAR_INSN;
++        // }
++        //
++        // // TYPE_INSN instructions
++        // b[Constants.NEW] = TYPE_INSN;
++        // b[Constants.ANEWARRAY] = TYPE_INSN;
++        // b[Constants.CHECKCAST] = TYPE_INSN;
++        // b[Constants.INSTANCEOF] = TYPE_INSN;
++        //
++        // // (Set)FIELDORMETH_INSN instructions
++        // for (i = Constants.GETSTATIC; i <= Constants.INVOKESTATIC; ++i) {
++        // b[i] = FIELDORMETH_INSN;
++        // }
++        // b[Constants.INVOKEINTERFACE] = ITFMETH_INSN;
++        //
++        // // LABEL(W)_INSN instructions
++        // for (i = Constants.IFEQ; i <= Constants.JSR; ++i) {
++        // b[i] = LABEL_INSN;
++        // }
++        // b[Constants.IFNULL] = LABEL_INSN;
++        // b[Constants.IFNONNULL] = LABEL_INSN;
++        // b[200] = LABELW_INSN; // GOTO_W
++        // b[201] = LABELW_INSN; // JSR_W
++        // // temporary opcodes used internally by ASM - see Label and
++        // MethodWriter
++        // for (i = 202; i < 220; ++i) {
++        // b[i] = LABEL_INSN;
++        // }
++        //
++        // // LDC(_W) instructions
++        // b[Constants.LDC] = LDC_INSN;
++        // b[19] = LDCW_INSN; // LDC_W
++        // b[20] = LDCW_INSN; // LDC2_W
++        //
++        // // special instructions
++        // b[Constants.IINC] = IINC_INSN;
++        // b[Constants.TABLESWITCH] = TABL_INSN;
++        // b[Constants.LOOKUPSWITCH] = LOOK_INSN;
++        // b[Constants.MULTIANEWARRAY] = MANA_INSN;
++        // b[196] = WIDE_INSN; // WIDE
++        //
++        // for (i = 0; i < b.length; ++i) {
++        // System.err.print((char)('A' + b[i]));
++        // }
++        // System.err.println();
++    }
++
++    // ------------------------------------------------------------------------
++    // Constructor
++    // ------------------------------------------------------------------------
++
++    /**
++     * Constructs a new {@link ClassWriter} object.
++     *
++     * @param flags option flags that can be used to modify the default behavior
++     *        of this class. See {@link #COMPUTE_MAXS}, {@link #COMPUTE_FRAMES}.
++     */
++    public ClassWriter(final int flags) {
++        index = 1;
++        pool = new ByteVector();
++        items = new Item[256];
++        threshold = (int) (0.75d * items.length);
++        key = new Item();
++        key2 = new Item();
++        key3 = new Item();
++        this.computeMaxs = (flags & COMPUTE_MAXS) != 0;
++        this.computeFrames = (flags & COMPUTE_FRAMES) != 0;
++    }
++
++    /**
++     * Constructs a new {@link ClassWriter} object and enables optimizations for
++     * "mostly add" bytecode transformations. These optimizations are the
++     * following:
++     *
++     * <ul> <li>The constant pool from the original class is copied as is in
++     * the new class, which saves time. New constant pool entries will be added
++     * at the end if necessary, but unused constant pool entries <i>won't be
++     * removed</i>.</li> <li>Methods that are not transformed are copied as
++     * is in the new class, directly from the original class bytecode (i.e.
++     * without emitting visit events for all the method instructions), which
++     * saves a <i>lot</i> of time. Untransformed methods are detected by the
++     * fact that the {@link ClassReader} receives {@link MethodVisitor} objects
++     * that come from a {@link ClassWriter} (and not from a custom
++     * {@link ClassAdapter} or any other {@link ClassVisitor} instance).</li>
++     * </ul>
++     *
++     * @param classReader the {@link ClassReader} used to read the original
++     *        class. It will be used to copy the entire constant pool from the
++     *        original class and also to copy other fragments of original
++     *        bytecode where applicable.
++     * @param flags option flags that can be used to modify the default behavior
++     *        of this class. See {@link #COMPUTE_MAXS}, {@link #COMPUTE_FRAMES}.
++     */
++    public ClassWriter(final ClassReader classReader, final int flags) {
++        this(flags);
++        classReader.copyPool(this);
++        this.cr = classReader;
++    }
++
++    // ------------------------------------------------------------------------
++    // Implementation of the ClassVisitor interface
++    // ------------------------------------------------------------------------
++
++    public void visit(
++        final int version,
++        final int access,
++        final String name,
++        final String signature,
++        final String superName,
++        final String[] interfaces)
++    {
++        this.version = version;
++        this.access = access;
++        this.name = newClass(name);
++        thisName = name;
++        if (ClassReader.SIGNATURES && signature != null) {
++            this.signature = newUTF8(signature);
++        }
++        this.superName = superName == null ? 0 : newClass(superName);
++        if (interfaces != null && interfaces.length > 0) {
++            interfaceCount = interfaces.length;
++            this.interfaces = new int[interfaceCount];
++            for (int i = 0; i < interfaceCount; ++i) {
++                this.interfaces[i] = newClass(interfaces[i]);
++            }
++        }
++    }
++
++    public void visitSource(final String file, final String debug) {
++        if (file != null) {
++            sourceFile = newUTF8(file);
++        }
++        if (debug != null) {
++            sourceDebug = new ByteVector().putUTF8(debug);
++        }
++    }
++
++    public void visitOuterClass(
++        final String owner,
++        final String name,
++        final String desc)
++    {
++        enclosingMethodOwner = newClass(owner);
++        if (name != null && desc != null) {
++            enclosingMethod = newNameType(name, desc);
++        }
++    }
++
++    public AnnotationVisitor visitAnnotation(
++        final String desc,
++        final boolean visible)
++    {
++        if (!ClassReader.ANNOTATIONS) {
++            return null;
++        }
++        ByteVector bv = new ByteVector();
++        // write type, and reserve space for values count
++        bv.putShort(newUTF8(desc)).putShort(0);
++        AnnotationWriter aw = new AnnotationWriter(this, true, bv, bv, 2);
++        if (visible) {
++            aw.next = anns;
++            anns = aw;
++        } else {
++            aw.next = ianns;
++            ianns = aw;
++        }
++        return aw;
++    }
++
++    public void visitAttribute(final Attribute attr) {
++        attr.next = attrs;
++        attrs = attr;
++    }
++
++    public void visitInnerClass(
++        final String name,
++        final String outerName,
++        final String innerName,
++        final int access)
++    {
++        if (innerClasses == null) {
++            innerClasses = new ByteVector();
++        }
++        ++innerClassesCount;
++        innerClasses.putShort(name == null ? 0 : newClass(name));
++        innerClasses.putShort(outerName == null ? 0 : newClass(outerName));
++        innerClasses.putShort(innerName == null ? 0 : newUTF8(innerName));
++        innerClasses.putShort(access);
++    }
++
++    public FieldVisitor visitField(
++        final int access,
++        final String name,
++        final String desc,
++        final String signature,
++        final Object value)
++    {
++        return new FieldWriter(this, access, name, desc, signature, value);
++    }
++
++    public MethodVisitor visitMethod(
++        final int access,
++        final String name,
++        final String desc,
++        final String signature,
++        final String[] exceptions)
++    {
++        return new MethodWriter(this,
++                access,
++                name,
++                desc,
++                signature,
++                exceptions,
++                computeMaxs,
++                computeFrames);
++    }
++
++    public void visitEnd() {
++    }
++
++    // ------------------------------------------------------------------------
++    // Other public methods
++    // ------------------------------------------------------------------------
++
++    /**
++     * Returns the bytecode of the class that was build with this class writer.
++     *
++     * @return the bytecode of the class that was build with this class writer.
++     */
++    public byte[] toByteArray() {
++        // computes the real size of the bytecode of this class
++        int size = 24 + 2 * interfaceCount;
++        int nbFields = 0;
++        FieldWriter fb = firstField;
++        while (fb != null) {
++            ++nbFields;
++            size += fb.getSize();
++            fb = fb.next;
++        }
++        int nbMethods = 0;
++        MethodWriter mb = firstMethod;
++        while (mb != null) {
++            ++nbMethods;
++            size += mb.getSize();
++            mb = mb.next;
++        }
++        int attributeCount = 0;
++        if (ClassReader.SIGNATURES && signature != 0) {
++            ++attributeCount;
++            size += 8;
++            newUTF8("Signature");
++        }
++        if (sourceFile != 0) {
++            ++attributeCount;
++            size += 8;
++            newUTF8("SourceFile");
++        }
++        if (sourceDebug != null) {
++            ++attributeCount;
++            size += sourceDebug.length + 4;
++            newUTF8("SourceDebugExtension");
++        }
++        if (enclosingMethodOwner != 0) {
++            ++attributeCount;
++            size += 10;
++            newUTF8("EnclosingMethod");
++        }
++        if ((access & Opcodes.ACC_DEPRECATED) != 0) {
++            ++attributeCount;
++            size += 6;
++            newUTF8("Deprecated");
++        }
++        if ((access & Opcodes.ACC_SYNTHETIC) != 0
++                && (version & 0xffff) < Opcodes.V1_5)
++        {
++            ++attributeCount;
++            size += 6;
++            newUTF8("Synthetic");
++        }
++        if (innerClasses != null) {
++            ++attributeCount;
++            size += 8 + innerClasses.length;
++            newUTF8("InnerClasses");
++        }
++        if (ClassReader.ANNOTATIONS && anns != null) {
++            ++attributeCount;
++            size += 8 + anns.getSize();
++            newUTF8("RuntimeVisibleAnnotations");
++        }
++        if (ClassReader.ANNOTATIONS && ianns != null) {
++            ++attributeCount;
++            size += 8 + ianns.getSize();
++            newUTF8("RuntimeInvisibleAnnotations");
++        }
++        if (attrs != null) {
++            attributeCount += attrs.getCount();
++            size += attrs.getSize(this, null, 0, -1, -1);
++        }
++        size += pool.length;
++        // allocates a byte vector of this size, in order to avoid unnecessary
++        // arraycopy operations in the ByteVector.enlarge() method
++        ByteVector out = new ByteVector(size);
++        out.putInt(0xCAFEBABE).putInt(version);
++        out.putShort(index).putByteArray(pool.data, 0, pool.length);
++        out.putShort(access).putShort(name).putShort(superName);
++        out.putShort(interfaceCount);
++        for (int i = 0; i < interfaceCount; ++i) {
++            out.putShort(interfaces[i]);
++        }
++        out.putShort(nbFields);
++        fb = firstField;
++        while (fb != null) {
++            fb.put(out);
++            fb = fb.next;
++        }
++        out.putShort(nbMethods);
++        mb = firstMethod;
++        while (mb != null) {
++            mb.put(out);
++            mb = mb.next;
++        }
++        out.putShort(attributeCount);
++        if (ClassReader.SIGNATURES && signature != 0) {
++            out.putShort(newUTF8("Signature")).putInt(2).putShort(signature);
++        }
++        if (sourceFile != 0) {
++            out.putShort(newUTF8("SourceFile")).putInt(2).putShort(sourceFile);
++        }
++        if (sourceDebug != null) {
++            int len = sourceDebug.length - 2;
++            out.putShort(newUTF8("SourceDebugExtension")).putInt(len);
++            out.putByteArray(sourceDebug.data, 2, len);
++        }
++        if (enclosingMethodOwner != 0) {
++            out.putShort(newUTF8("EnclosingMethod")).putInt(4);
++            out.putShort(enclosingMethodOwner).putShort(enclosingMethod);
++        }
++        if ((access & Opcodes.ACC_DEPRECATED) != 0) {
++            out.putShort(newUTF8("Deprecated")).putInt(0);
++        }
++        if ((access & Opcodes.ACC_SYNTHETIC) != 0
++                && (version & 0xffff) < Opcodes.V1_5)
++        {
++            out.putShort(newUTF8("Synthetic")).putInt(0);
++        }
++        if (innerClasses != null) {
++            out.putShort(newUTF8("InnerClasses"));
++            out.putInt(innerClasses.length + 2).putShort(innerClassesCount);
++            out.putByteArray(innerClasses.data, 0, innerClasses.length);
++        }
++        if (ClassReader.ANNOTATIONS && anns != null) {
++            out.putShort(newUTF8("RuntimeVisibleAnnotations"));
++            anns.put(out);
++        }
++        if (ClassReader.ANNOTATIONS && ianns != null) {
++            out.putShort(newUTF8("RuntimeInvisibleAnnotations"));
++            ianns.put(out);
++        }
++        if (attrs != null) {
++            attrs.put(this, null, 0, -1, -1, out);
++        }
++        if (invalidFrames) {
++            ClassWriter cw = new ClassWriter(COMPUTE_FRAMES);
++            new ClassReader(out.data).accept(cw, ClassReader.SKIP_FRAMES);
++            return cw.toByteArray();
++        }
++        return out.data;
++    }
++
++    // ------------------------------------------------------------------------
++    // Utility methods: constant pool management
++    // ------------------------------------------------------------------------
++
++    /**
++     * Adds a number or string constant to the constant pool of the class being
++     * build. Does nothing if the constant pool already contains a similar item.
++     *
++     * @param cst the value of the constant to be added to the constant pool.
++     *        This parameter must be an {@link Integer}, a {@link Float}, a
++     *        {@link Long}, a {@link Double}, a {@link String} or a
++     *        {@link Type}.
++     * @return a new or already existing constant item with the given value.
++     */
++    Item newConstItem(final Object cst) {
++        if (cst instanceof Integer) {
++            int val = ((Integer) cst).intValue();
++            return newInteger(val);
++        } else if (cst instanceof Byte) {
++            int val = ((Byte) cst).intValue();
++            return newInteger(val);
++        } else if (cst instanceof Character) {
++            int val = ((Character) cst).charValue();
++            return newInteger(val);
++        } else if (cst instanceof Short) {
++            int val = ((Short) cst).intValue();
++            return newInteger(val);
++        } else if (cst instanceof Boolean) {
++            int val = ((Boolean) cst).booleanValue() ? 1 : 0;
++            return newInteger(val);
++        } else if (cst instanceof Float) {
++            float val = ((Float) cst).floatValue();
++            return newFloat(val);
++        } else if (cst instanceof Long) {
++            long val = ((Long) cst).longValue();
++            return newLong(val);
++        } else if (cst instanceof Double) {
++            double val = ((Double) cst).doubleValue();
++            return newDouble(val);
++        } else if (cst instanceof String) {
++            return newString((String) cst);
++        } else if (cst instanceof Type) {
++            Type t = (Type) cst;
++            return newClassItem(t.getSort() == Type.OBJECT
++                    ? t.getInternalName()
++                    : t.getDescriptor());
++        } else {
++            throw new IllegalArgumentException("value " + cst);
++        }
++    }
++
++    /**
++     * Adds a number or string constant to the constant pool of the class being
++     * build. Does nothing if the constant pool already contains a similar item.
++     * <i>This method is intended for {@link Attribute} sub classes, and is
++     * normally not needed by class generators or adapters.</i>
++     *
++     * @param cst the value of the constant to be added to the constant pool.
++     *        This parameter must be an {@link Integer}, a {@link Float}, a
++     *        {@link Long}, a {@link Double} or a {@link String}.
++     * @return the index of a new or already existing constant item with the
++     *         given value.
++     */
++    public int newConst(final Object cst) {
++        return newConstItem(cst).index;
++    }
++
++    /**
++     * Adds an UTF8 string to the constant pool of the class being build. Does
++     * nothing if the constant pool already contains a similar item. <i>This
++     * method is intended for {@link Attribute} sub classes, and is normally not
++     * needed by class generators or adapters.</i>
++     *
++     * @param value the String value.
++     * @return the index of a new or already existing UTF8 item.
++     */
++    public int newUTF8(final String value) {
++        key.set(UTF8, value, null, null);
++        Item result = get(key);
++        if (result == null) {
++            pool.putByte(UTF8).putUTF8(value);
++            result = new Item(index++, key);
++            put(result);
++        }
++        return result.index;
++    }
++
++    /**
++     * Adds a class reference to the constant pool of the class being build.
++     * Does nothing if the constant pool already contains a similar item.
++     * <i>This method is intended for {@link Attribute} sub classes, and is
++     * normally not needed by class generators or adapters.</i>
++     *
++     * @param value the internal name of the class.
++     * @return a new or already existing class reference item.
++     */
++    Item newClassItem(final String value) {
++        key2.set(CLASS, value, null, null);
++        Item result = get(key2);
++        if (result == null) {
++            pool.put12(CLASS, newUTF8(value));
++            result = new Item(index++, key2);
++            put(result);
++        }
++        return result;
++    }
++
++    /**
++     * Adds a class reference to the constant pool of the class being build.
++     * Does nothing if the constant pool already contains a similar item.
++     * <i>This method is intended for {@link Attribute} sub classes, and is
++     * normally not needed by class generators or adapters.</i>
++     *
++     * @param value the internal name of the class.
++     * @return the index of a new or already existing class reference item.
++     */
++    public int newClass(final String value) {
++        return newClassItem(value).index;
++    }
++
++    /**
++     * Adds a field reference to the constant pool of the class being build.
++     * Does nothing if the constant pool already contains a similar item.
++     *
++     * @param owner the internal name of the field's owner class.
++     * @param name the field's name.
++     * @param desc the field's descriptor.
++     * @return a new or already existing field reference item.
++     */
++    Item newFieldItem(final String owner, final String name, final String desc)
++    {
++        key3.set(FIELD, owner, name, desc);
++        Item result = get(key3);
++        if (result == null) {
++            put122(FIELD, newClass(owner), newNameType(name, desc));
++            result = new Item(index++, key3);
++            put(result);
++        }
++        return result;
++    }
++
++    /**
++     * Adds a field reference to the constant pool of the class being build.
++     * Does nothing if the constant pool already contains a similar item.
++     * <i>This method is intended for {@link Attribute} sub classes, and is
++     * normally not needed by class generators or adapters.</i>
++     *
++     * @param owner the internal name of the field's owner class.
++     * @param name the field's name.
++     * @param desc the field's descriptor.
++     * @return the index of a new or already existing field reference item.
++     */
++    public int newField(final String owner, final String name, final String desc)
++    {
++        return newFieldItem(owner, name, desc).index;
++    }
++
++    /**
++     * Adds a method reference to the constant pool of the class being build.
++     * Does nothing if the constant pool already contains a similar item.
++     *
++     * @param owner the internal name of the method's owner class.
++     * @param name the method's name.
++     * @param desc the method's descriptor.
++     * @param itf <tt>true</tt> if <tt>owner</tt> is an interface.
++     * @return a new or already existing method reference item.
++     */
++    Item newMethodItem(
++        final String owner,
++        final String name,
++        final String desc,
++        final boolean itf)
++    {
++        int type = itf ? IMETH : METH;
++        key3.set(type, owner, name, desc);
++        Item result = get(key3);
++        if (result == null) {
++            put122(type, newClass(owner), newNameType(name, desc));
++            result = new Item(index++, key3);
++            put(result);
++        }
++        return result;
++    }
++
++    /**
++     * Adds a method reference to the constant pool of the class being build.
++     * Does nothing if the constant pool already contains a similar item.
++     * <i>This method is intended for {@link Attribute} sub classes, and is
++     * normally not needed by class generators or adapters.</i>
++     *
++     * @param owner the internal name of the method's owner class.
++     * @param name the method's name.
++     * @param desc the method's descriptor.
++     * @param itf <tt>true</tt> if <tt>owner</tt> is an interface.
++     * @return the index of a new or already existing method reference item.
++     */
++    public int newMethod(
++        final String owner,
++        final String name,
++        final String desc,
++        final boolean itf)
++    {
++        return newMethodItem(owner, name, desc, itf).index;
++    }
++
++    /**
++     * Adds an integer to the constant pool of the class being build. Does
++     * nothing if the constant pool already contains a similar item.
++     *
++     * @param value the int value.
++     * @return a new or already existing int item.
++     */
++    Item newInteger(final int value) {
++        key.set(value);
++        Item result = get(key);
++        if (result == null) {
++            pool.putByte(INT).putInt(value);
++            result = new Item(index++, key);
++            put(result);
++        }
++        return result;
++    }
++
++    /**
++     * Adds a float to the constant pool of the class being build. Does nothing
++     * if the constant pool already contains a similar item.
++     *
++     * @param value the float value.
++     * @return a new or already existing float item.
++     */
++    Item newFloat(final float value) {
++        key.set(value);
++        Item result = get(key);
++        if (result == null) {
++            pool.putByte(FLOAT).putInt(key.intVal);
++            result = new Item(index++, key);
++            put(result);
++        }
++        return result;
++    }
++
++    /**
++     * Adds a long to the constant pool of the class being build. Does nothing
++     * if the constant pool already contains a similar item.
++     *
++     * @param value the long value.
++     * @return a new or already existing long item.
++     */
++    Item newLong(final long value) {
++        key.set(value);
++        Item result = get(key);
++        if (result == null) {
++            pool.putByte(LONG).putLong(value);
++            result = new Item(index, key);
++            put(result);
++            index += 2;
++        }
++        return result;
++    }
++
++    /**
++     * Adds a double to the constant pool of the class being build. Does nothing
++     * if the constant pool already contains a similar item.
++     *
++     * @param value the double value.
++     * @return a new or already existing double item.
++     */
++    Item newDouble(final double value) {
++        key.set(value);
++        Item result = get(key);
++        if (result == null) {
++            pool.putByte(DOUBLE).putLong(key.longVal);
++            result = new Item(index, key);
++            put(result);
++            index += 2;
++        }
++        return result;
++    }
++
++    /**
++     * Adds a string to the constant pool of the class being build. Does nothing
++     * if the constant pool already contains a similar item.
++     *
++     * @param value the String value.
++     * @return a new or already existing string item.
++     */
++    private Item newString(final String value) {
++        key2.set(STR, value, null, null);
++        Item result = get(key2);
++        if (result == null) {
++            pool.put12(STR, newUTF8(value));
++            result = new Item(index++, key2);
++            put(result);
++        }
++        return result;
++    }
++
++    /**
++     * Adds a name and type to the constant pool of the class being build. Does
++     * nothing if the constant pool already contains a similar item. <i>This
++     * method is intended for {@link Attribute} sub classes, and is normally not
++     * needed by class generators or adapters.</i>
++     *
++     * @param name a name.
++     * @param desc a type descriptor.
++     * @return the index of a new or already existing name and type item.
++     */
++    public int newNameType(final String name, final String desc) {
++        key2.set(NAME_TYPE, name, desc, null);
++        Item result = get(key2);
++        if (result == null) {
++            put122(NAME_TYPE, newUTF8(name), newUTF8(desc));
++            result = new Item(index++, key2);
++            put(result);
++        }
++        return result.index;
++    }
++
++    /**
++     * Adds the given internal name to {@link #typeTable} and returns its index.
++     * Does nothing if the type table already contains this internal name.
++     *
++     * @param type the internal name to be added to the type table.
++     * @return the index of this internal name in the type table.
++     */
++    int addType(final String type) {
++        key.set(TYPE_NORMAL, type, null, null);
++        Item result = get(key);
++        if (result == null) {
++            result = addType(key);
++        }
++        return result.index;
++    }
++
++    /**
++     * Adds the given "uninitialized" type to {@link #typeTable} and returns its
++     * index. This method is used for UNINITIALIZED types, made of an internal
++     * name and a bytecode offset.
++     *
++     * @param type the internal name to be added to the type table.
++     * @param offset the bytecode offset of the NEW instruction that created
++     *        this UNINITIALIZED type value.
++     * @return the index of this internal name in the type table.
++     */
++    int addUninitializedType(final String type, final int offset) {
++        key.type = TYPE_UNINIT;
++        key.intVal = offset;
++        key.strVal1 = type;
++        key.hashCode = 0x7FFFFFFF & (TYPE_UNINIT + type.hashCode() + offset);
++        Item result = get(key);
++        if (result == null) {
++            result = addType(key);
++        }
++        return result.index;
++    }
++
++    /**
++     * Adds the given Item to {@link #typeTable}.
++     *
++     * @param item the value to be added to the type table.
++     * @return the added Item, which a new Item instance with the same value as
++     *         the given Item.
++     */
++    private Item addType(final Item item) {
++        ++typeCount;
++        Item result = new Item(typeCount, key);
++        put(result);
++        if (typeTable == null) {
++            typeTable = new Item[16];
++        }
++        if (typeCount == typeTable.length) {
++            Item[] newTable = new Item[2 * typeTable.length];
++            System.arraycopy(typeTable, 0, newTable, 0, typeTable.length);
++            typeTable = newTable;
++        }
++        typeTable[typeCount] = result;
++        return result;
++    }
++
++    /**
++     * Returns the index of the common super type of the two given types. This
++     * method calls {@link #getCommonSuperClass} and caches the result in the
++     * {@link #items} hash table to speedup future calls with the same
++     * parameters.
++     *
++     * @param type1 index of an internal name in {@link #typeTable}.
++     * @param type2 index of an internal name in {@link #typeTable}.
++     * @return the index of the common super type of the two given types.
++     */
++    int getMergedType(final int type1, final int type2) {
++        key2.type = TYPE_MERGED;
++        key2.longVal = type1 | (((long) type2) << 32);
++        key2.hashCode = 0x7FFFFFFF & (TYPE_MERGED + type1 + type2);
++        Item result = get(key2);
++        if (result == null) {
++            String t = typeTable[type1].strVal1;
++            String u = typeTable[type2].strVal1;
++            key2.intVal = addType(getCommonSuperClass(t, u));
++            result = new Item((short) 0, key2);
++            put(result);
++        }
++        return result.intVal;
++    }
++
++    /**
++     * Returns the common super type of the two given types. The default
++     * implementation of this method <i>loads<i> the two given classes and uses
++     * the java.lang.Class methods to find the common super class. It can be
++     * overridden to compute this common super type in other ways, in particular
++     * without actually loading any class, or to take into account the class
++     * that is currently being generated by this ClassWriter, which can of
++     * course not be loaded since it is under construction.
++     *
++     * @param type1 the internal name of a class.
++     * @param type2 the internal name of another class.
++     * @return the internal name of the common super class of the two given
++     *         classes.
++     */
++    protected String getCommonSuperClass(final String type1, final String type2)
++    {
++        Class c, d;
++        try {
++            c = Class.forName(type1.replace('/', '.'));
++            d = Class.forName(type2.replace('/', '.'));
++        } catch (Exception e) {
++            throw new RuntimeException(e.toString());
++        }
++        if (c.isAssignableFrom(d)) {
++            return type1;
++        }
++        if (d.isAssignableFrom(c)) {
++            return type2;
++        }
++        if (c.isInterface() || d.isInterface()) {
++            return "java/lang/Object";
++        } else {
++            do {
++                c = c.getSuperclass();
++            } while (!c.isAssignableFrom(d));
++            return c.getName().replace('.', '/');
++        }
++    }
++
++    /**
++     * Returns the constant pool's hash table item which is equal to the given
++     * item.
++     *
++     * @param key a constant pool item.
++     * @return the constant pool's hash table item which is equal to the given
++     *         item, or <tt>null</tt> if there is no such item.
++     */
++    private Item get(final Item key) {
++        Item i = items[key.hashCode % items.length];
++        while (i != null && !key.isEqualTo(i)) {
++            i = i.next;
++        }
++        return i;
++    }
++
++    /**
++     * Puts the given item in the constant pool's hash table. The hash table
++     * <i>must</i> not already contains this item.
++     *
++     * @param i the item to be added to the constant pool's hash table.
++     */
++    private void put(final Item i) {
++        if (index > threshold) {
++            int ll = items.length;
++            int nl = ll * 2 + 1;
++            Item[] newItems = new Item[nl];
++            for (int l = ll - 1; l >= 0; --l) {
++                Item j = items[l];
++                while (j != null) {
++                    int index = j.hashCode % newItems.length;
++                    Item k = j.next;
++                    j.next = newItems[index];
++                    newItems[index] = j;
++                    j = k;
++                }
++            }
++            items = newItems;
++            threshold = (int) (nl * 0.75);
++        }
++        int index = i.hashCode % items.length;
++        i.next = items[index];
++        items[index] = i;
++    }
++
++    /**
++     * Puts one byte and two shorts into the constant pool.
++     *
++     * @param b a byte.
++     * @param s1 a short.
++     * @param s2 another short.
++     */
++    private void put122(final int b, final int s1, final int s2) {
++        pool.put12(b, s1).putShort(s2);
++    }
++}
+--- /dev/null	Thu Jul 30 19:03:13 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/org/objectweb/asm/Edge.java	Thu Jul 30 19:03:12 2009
+@@ -0,0 +1,105 @@
++/*
++ * Copyright 2005-2009 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++
++/*
++ * This file is available under and governed by the GNU General Public
++ * License version 2 only, as published by the Free Software Foundation.
++ * However, the following notice accompanied the original version of this
++ * file:
++ *
++ * ASM: a very small and fast Java bytecode manipulation framework
++ * Copyright (c) 2000-2007 INRIA, France Telecom
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ *    notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ *    notice, this list of conditions and the following disclaimer in the
++ *    documentation and/or other materials provided with the distribution.
++ * 3. Neither the name of the copyright holders nor the names of its
++ *    contributors may be used to endorse or promote products derived from
++ *    this software without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
++ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
++ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
++ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
++ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
++ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
++ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
++ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
++ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
++ * THE POSSIBILITY OF SUCH DAMAGE.
++ */
++package com.sun.xml.internal.ws.org.objectweb.asm;
++
++/**
++ * An edge in the control flow graph of a method body. See {@link Label Label}.
++ *
++ * @author Eric Bruneton
++ */
++class Edge {
++
++    /**
++     * Denotes a normal control flow graph edge.
++     */
++    static final int NORMAL = 0;
++
++    /**
++     * Denotes a control flow graph edge corresponding to an exception handler.
++     * More precisely any {@link Edge} whose {@link #info} is strictly positive
++     * corresponds to an exception handler. The actual value of {@link #info} is
++     * the index, in the {@link ClassWriter} type table, of the exception that
++     * is catched.
++     */
++    static final int EXCEPTION = 0x7FFFFFFF;
++
++    /**
++     * Information about this control flow graph edge. If
++     * {@link ClassWriter#COMPUTE_MAXS} is used this field is the (relative)
++     * stack size in the basic block from which this edge originates. This size
++     * is equal to the stack size at the "jump" instruction to which this edge
++     * corresponds, relatively to the stack size at the beginning of the
++     * originating basic block. If {@link ClassWriter#COMPUTE_FRAMES} is used,
++     * this field is the kind of this control flow graph edge (i.e. NORMAL or
++     * EXCEPTION).
++     */
++    int info;
++
++    /**
++     * The successor block of the basic block from which this edge originates.
++     */
++    Label successor;
++
++    /**
++     * The next edge in the list of successors of the originating basic block.
++     * See {@link Label#successors successors}.
++     */
++    Edge next;
++}
+--- /dev/null	Thu Jul 30 19:03:16 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/org/objectweb/asm/FieldVisitor.java	Thu Jul 30 19:03:16 2009
+@@ -0,0 +1,94 @@
++/*
++ * Copyright 2005-2009 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++
++/*
++ * This file is available under and governed by the GNU General Public
++ * License version 2 only, as published by the Free Software Foundation.
++ * However, the following notice accompanied the original version of this
++ * file:
++ *
++ * ASM: a very small and fast Java bytecode manipulation framework
++ * Copyright (c) 2000-2007 INRIA, France Telecom
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ *    notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ *    notice, this list of conditions and the following disclaimer in the
++ *    documentation and/or other materials provided with the distribution.
++ * 3. Neither the name of the copyright holders nor the names of its
++ *    contributors may be used to endorse or promote products derived from
++ *    this software without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
++ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
++ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
++ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
++ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
++ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
++ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
++ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
++ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
++ * THE POSSIBILITY OF SUCH DAMAGE.
++ */
++package com.sun.xml.internal.ws.org.objectweb.asm;
++
++/**
++ * A visitor to visit a Java field. The methods of this interface must be called
++ * in the following order: ( <tt>visitAnnotation</tt> |
++ * <tt>visitAttribute</tt> )* <tt>visitEnd</tt>.
++ *
++ * @author Eric Bruneton
++ */
++public interface FieldVisitor {
++
++    /**
++     * Visits an annotation of the field.
++     *
++     * @param desc the class descriptor of the annotation class.
++     * @param visible <tt>true</tt> if the annotation is visible at runtime.
++     * @return a visitor to visit the annotation values, or <tt>null</tt> if
++     *         this visitor is not interested in visiting this annotation.
++     */
++    AnnotationVisitor visitAnnotation(String desc, boolean visible);
++
++    /**
++     * Visits a non standard attribute of the field.
++     *
++     * @param attr an attribute.
++     */
++    void visitAttribute(Attribute attr);
++
++    /**
++     * Visits the end of the field. This method, which is the last one to be
++     * called, is used to inform the visitor that all the annotations and
++     * attributes of the field have been visited.
++     */
++    void visitEnd();
++}
+--- /dev/null	Thu Jul 30 19:03:20 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/org/objectweb/asm/FieldWriter.java	Thu Jul 30 19:03:19 2009
+@@ -0,0 +1,299 @@
++/*
++ * Copyright 2005-2009 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++
++/*
++ * This file is available under and governed by the GNU General Public
++ * License version 2 only, as published by the Free Software Foundation.
++ * However, the following notice accompanied the original version of this
++ * file:
++ *
++ * ASM: a very small and fast Java bytecode manipulation framework
++ * Copyright (c) 2000-2007 INRIA, France Telecom
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ *    notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ *    notice, this list of conditions and the following disclaimer in the
++ *    documentation and/or other materials provided with the distribution.
++ * 3. Neither the name of the copyright holders nor the names of its
++ *    contributors may be used to endorse or promote products derived from
++ *    this software without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
++ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
++ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
++ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
++ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
++ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
++ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
++ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
++ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
++ * THE POSSIBILITY OF SUCH DAMAGE.
++ */
++package com.sun.xml.internal.ws.org.objectweb.asm;
++
++/**
++ * An {@link FieldVisitor} that generates Java fields in bytecode form.
++ *
++ * @author Eric Bruneton
++ */
++final class FieldWriter implements FieldVisitor {
++
++    /**
++     * Next field writer (see {@link ClassWriter#firstField firstField}).
++     */
++    FieldWriter next;
++
++    /**
++     * The class writer to which this field must be added.
++     */
++    private final ClassWriter cw;
++
++    /**
++     * Access flags of this field.
++     */
++    private final int access;
++
++    /**
++     * The index of the constant pool item that contains the name of this
++     * method.
++     */
++    private final int name;
++
++    /**
++     * The index of the constant pool item that contains the descriptor of this
++     * field.
++     */
++    private final int desc;
++
++    /**
++     * The index of the constant pool item that contains the signature of this
++     * field.
++     */
++    private int signature;
++
++    /**
++     * The index of the constant pool item that contains the constant value of
++     * this field.
++     */
++    private int value;
++
++    /**
++     * The runtime visible annotations of this field. May be <tt>null</tt>.
++     */
++    private AnnotationWriter anns;
++
++    /**
++     * The runtime invisible annotations of this field. May be <tt>null</tt>.
++     */
++    private AnnotationWriter ianns;
++
++    /**
++     * The non standard attributes of this field. May be <tt>null</tt>.
++     */
++    private Attribute attrs;
++
++    // ------------------------------------------------------------------------
++    // Constructor
++    // ------------------------------------------------------------------------
++
++    /**
++     * Constructs a new {@link FieldWriter}.
++     *
++     * @param cw the class writer to which this field must be added.
++     * @param access the field's access flags (see {@link Opcodes}).
++     * @param name the field's name.
++     * @param desc the field's descriptor (see {@link Type}).
++     * @param signature the field's signature. May be <tt>null</tt>.
++     * @param value the field's constant value. May be <tt>null</tt>.
++     */
++    FieldWriter(
++        final ClassWriter cw,
++        final int access,
++        final String name,
++        final String desc,
++        final String signature,
++        final Object value)
++    {
++        if (cw.firstField == null) {
++            cw.firstField = this;
++        } else {
++            cw.lastField.next = this;
++        }
++        cw.lastField = this;
++        this.cw = cw;
++        this.access = access;
++        this.name = cw.newUTF8(name);
++        this.desc = cw.newUTF8(desc);
++        if (ClassReader.SIGNATURES && signature != null) {
++            this.signature = cw.newUTF8(signature);
++        }
++        if (value != null) {
++            this.value = cw.newConstItem(value).index;
++        }
++    }
++
++    // ------------------------------------------------------------------------
++    // Implementation of the FieldVisitor interface
++    // ------------------------------------------------------------------------
++
++    public AnnotationVisitor visitAnnotation(
++        final String desc,
++        final boolean visible)
++    {
++        if (!ClassReader.ANNOTATIONS) {
++            return null;
++        }
++        ByteVector bv = new ByteVector();
++        // write type, and reserve space for values count
++        bv.putShort(cw.newUTF8(desc)).putShort(0);
++        AnnotationWriter aw = new AnnotationWriter(cw, true, bv, bv, 2);
++        if (visible) {
++            aw.next = anns;
++            anns = aw;
++        } else {
++            aw.next = ianns;
++            ianns = aw;
++        }
++        return aw;
++    }
++
++    public void visitAttribute(final Attribute attr) {
++        attr.next = attrs;
++        attrs = attr;
++    }
++
++    public void visitEnd() {
++    }
++
++    // ------------------------------------------------------------------------
++    // Utility methods
++    // ------------------------------------------------------------------------
++
++    /**
++     * Returns the size of this field.
++     *
++     * @return the size of this field.
++     */
++    int getSize() {
++        int size = 8;
++        if (value != 0) {
++            cw.newUTF8("ConstantValue");
++            size += 8;
++        }
++        if ((access & Opcodes.ACC_SYNTHETIC) != 0
++                && (cw.version & 0xffff) < Opcodes.V1_5)
++        {
++            cw.newUTF8("Synthetic");
++            size += 6;
++        }
++        if ((access & Opcodes.ACC_DEPRECATED) != 0) {
++            cw.newUTF8("Deprecated");
++            size += 6;
++        }
++        if (ClassReader.SIGNATURES && signature != 0) {
++            cw.newUTF8("Signature");
++            size += 8;
++        }
++        if (ClassReader.ANNOTATIONS && anns != null) {
++            cw.newUTF8("RuntimeVisibleAnnotations");
++            size += 8 + anns.getSize();
++        }
++        if (ClassReader.ANNOTATIONS && ianns != null) {
++            cw.newUTF8("RuntimeInvisibleAnnotations");
++            size += 8 + ianns.getSize();
++        }
++        if (attrs != null) {
++            size += attrs.getSize(cw, null, 0, -1, -1);
++        }
++        return size;
++    }
++
++    /**
++     * Puts the content of this field into the given byte vector.
++     *
++     * @param out where the content of this field must be put.
++     */
++    void put(final ByteVector out) {
++        out.putShort(access).putShort(name).putShort(desc);
++        int attributeCount = 0;
++        if (value != 0) {
++            ++attributeCount;
++        }
++        if ((access & Opcodes.ACC_SYNTHETIC) != 0
++                && (cw.version & 0xffff) < Opcodes.V1_5)
++        {
++            ++attributeCount;
++        }
++        if ((access & Opcodes.ACC_DEPRECATED) != 0) {
++            ++attributeCount;
++        }
++        if (ClassReader.SIGNATURES && signature != 0) {
++            ++attributeCount;
++        }
++        if (ClassReader.ANNOTATIONS && anns != null) {
++            ++attributeCount;
++        }
++        if (ClassReader.ANNOTATIONS && ianns != null) {
++            ++attributeCount;
++        }
++        if (attrs != null) {
++            attributeCount += attrs.getCount();
++        }
++        out.putShort(attributeCount);
++        if (value != 0) {
++            out.putShort(cw.newUTF8("ConstantValue"));
++            out.putInt(2).putShort(value);
++        }
++        if ((access & Opcodes.ACC_SYNTHETIC) != 0
++                && (cw.version & 0xffff) < Opcodes.V1_5)
++        {
++            out.putShort(cw.newUTF8("Synthetic")).putInt(0);
++        }
++        if ((access & Opcodes.ACC_DEPRECATED) != 0) {
++            out.putShort(cw.newUTF8("Deprecated")).putInt(0);
++        }
++        if (ClassReader.SIGNATURES && signature != 0) {
++            out.putShort(cw.newUTF8("Signature"));
++            out.putInt(2).putShort(signature);
++        }
++        if (ClassReader.ANNOTATIONS && anns != null) {
++            out.putShort(cw.newUTF8("RuntimeVisibleAnnotations"));
++            anns.put(out);
++        }
++        if (ClassReader.ANNOTATIONS && ianns != null) {
++            out.putShort(cw.newUTF8("RuntimeInvisibleAnnotations"));
++            ianns.put(out);
++        }
++        if (attrs != null) {
++            attrs.put(cw, null, 0, -1, -1, out);
++        }
++    }
++}
+--- /dev/null	Thu Jul 30 19:03:23 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/org/objectweb/asm/Frame.java	Thu Jul 30 19:03:22 2009
+@@ -0,0 +1,1432 @@
++/*
++ * Copyright 2005-2009 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++
++/*
++ * This file is available under and governed by the GNU General Public
++ * License version 2 only, as published by the Free Software Foundation.
++ * However, the following notice accompanied the original version of this
++ * file:
++ *
++ * ASM: a very small and fast Java bytecode manipulation framework
++ * Copyright (c) 2000-2007 INRIA, France Telecom
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ *    notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ *    notice, this list of conditions and the following disclaimer in the
++ *    documentation and/or other materials provided with the distribution.
++ * 3. Neither the name of the copyright holders nor the names of its
++ *    contributors may be used to endorse or promote products derived from
++ *    this software without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
++ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
++ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
++ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
++ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
++ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
++ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
++ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
++ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
++ * THE POSSIBILITY OF SUCH DAMAGE.
++ */
++package com.sun.xml.internal.ws.org.objectweb.asm;
++
++/**
++ * Information about the input and output stack map frames of a basic block.
++ *
++ * @author Eric Bruneton
++ */
++final class Frame {
++
++    /*
++     * Frames are computed in a two steps process: during the visit of each
++     * instruction, the state of the frame at the end of current basic block is
++     * updated by simulating the action of the instruction on the previous state
++     * of this so called "output frame". In visitMaxs, a fix point algorithm is
++     * used to compute the "input frame" of each basic block, i.e. the stack map
++     * frame at the begining of the basic block, starting from the input frame
++     * of the first basic block (which is computed from the method descriptor),
++     * and by using the previously computed output frames to compute the input
++     * state of the other blocks.
++     *
++     * All output and input frames are stored as arrays of integers. Reference
++     * and array types are represented by an index into a type table (which is
++     * not the same as the constant pool of the class, in order to avoid adding
++     * unnecessary constants in the pool - not all computed frames will end up
++     * being stored in the stack map table). This allows very fast type
++     * comparisons.
++     *
++     * Output stack map frames are computed relatively to the input frame of the
++     * basic block, which is not yet known when output frames are computed. It
++     * is therefore necessary to be able to represent abstract types such as
++     * "the type at position x in the input frame locals" or "the type at
++     * position x from the top of the input frame stack" or even "the type at
++     * position x in the input frame, with y more (or less) array dimensions".
++     * This explains the rather complicated type format used in output frames.
++     *
++     * This format is the following: DIM KIND VALUE (4, 4 and 24 bits). DIM is a
++     * signed number of array dimensions (from -8 to 7). KIND is either BASE,
++     * LOCAL or STACK. BASE is used for types that are not relative to the input
++     * frame. LOCAL is used for types that are relative to the input local
++     * variable types. STACK is used for types that are relative to the input
++     * stack types. VALUE depends on KIND. For LOCAL types, it is an index in
++     * the input local variable types. For STACK types, it is a position
++     * relatively to the top of input frame stack. For BASE types, it is either
++     * one of the constants defined in FrameVisitor, or for OBJECT and
++     * UNINITIALIZED types, a tag and an index in the type table.
++     *
++     * Output frames can contain types of any kind and with a positive or
++     * negative dimension (and even unassigned types, represented by 0 - which
++     * does not correspond to any valid type value). Input frames can only
++     * contain BASE types of positive or null dimension. In all cases the type
++     * table contains only internal type names (array type descriptors are
++     * forbidden - dimensions must be represented through the DIM field).
++     *
++     * The LONG and DOUBLE types are always represented by using two slots (LONG +
++     * TOP or DOUBLE + TOP), for local variable types as well as in the operand
++     * stack. This is necessary to be able to simulate DUPx_y instructions,
++     * whose effect would be dependent on the actual type values if types were
++     * always represented by a single slot in the stack (and this is not
++     * possible, since actual type values are not always known - cf LOCAL and
++     * STACK type kinds).
++     */
++
++    /**
++     * Mask to get the dimension of a frame type. This dimension is a signed
++     * integer between -8 and 7.
++     */
++    static final int DIM = 0xF0000000;
++
++    /**
++     * Constant to be added to a type to get a type with one more dimension.
++     */
++    static final int ARRAY_OF = 0x10000000;
++
++    /**
++     * Constant to be added to a type to get a type with one less dimension.
++     */
++    static final int ELEMENT_OF = 0xF0000000;
++
++    /**
++     * Mask to get the kind of a frame type.
++     *
++     * @see #BASE
++     * @see #LOCAL
++     * @see #STACK
++     */
++    static final int KIND = 0xF000000;
++
++    /**
++     * Mask to get the value of a frame type.
++     */
++    static final int VALUE = 0xFFFFFF;
++
++    /**
++     * Mask to get the kind of base types.
++     */
++    static final int BASE_KIND = 0xFF00000;
++
++    /**
++     * Mask to get the value of base types.
++     */
++    static final int BASE_VALUE = 0xFFFFF;
++
++    /**
++     * Kind of the types that are not relative to an input stack map frame.
++     */
++    static final int BASE = 0x1000000;
++
++    /**
++     * Base kind of the base reference types. The BASE_VALUE of such types is an
++     * index into the type table.
++     */
++    static final int OBJECT = BASE | 0x700000;
++
++    /**
++     * Base kind of the uninitialized base types. The BASE_VALUE of such types
++     * in an index into the type table (the Item at that index contains both an
++     * instruction offset and an internal class name).
++     */
++    static final int UNINITIALIZED = BASE | 0x800000;
++
++    /**
++     * Kind of the types that are relative to the local variable types of an
++     * input stack map frame. The value of such types is a local variable index.
++     */
++    private static final int LOCAL = 0x2000000;
++
++    /**
++     * Kind of the the types that are relative to the stack of an input stack
++     * map frame. The value of such types is a position relatively to the top of
++     * this stack.
++     */
++    private static final int STACK = 0x3000000;
++
++    /**
++     * The TOP type. This is a BASE type.
++     */
++    static final int TOP = BASE | 0;
++
++    /**
++     * The BOOLEAN type. This is a BASE type mainly used for array types.
++     */
++    static final int BOOLEAN = BASE | 9;
++
++    /**
++     * The BYTE type. This is a BASE type mainly used for array types.
++     */
++    static final int BYTE = BASE | 10;
++
++    /**
++     * The CHAR type. This is a BASE type mainly used for array types.
++     */
++    static final int CHAR = BASE | 11;
++
++    /**
++     * The SHORT type. This is a BASE type mainly used for array types.
++     */
++    static final int SHORT = BASE | 12;
++
++    /**
++     * The INTEGER type. This is a BASE type.
++     */
++    static final int INTEGER = BASE | 1;
++
++    /**
++     * The FLOAT type. This is a BASE type.
++     */
++    static final int FLOAT = BASE | 2;
++
++    /**
++     * The DOUBLE type. This is a BASE type.
++     */
++    static final int DOUBLE = BASE | 3;
++
++    /**
++     * The LONG type. This is a BASE type.
++     */
++    static final int LONG = BASE | 4;
++
++    /**
++     * The NULL type. This is a BASE type.
++     */
++    static final int NULL = BASE | 5;
++
++    /**
++     * The UNINITIALIZED_THIS type. This is a BASE type.
++     */
++    static final int UNINITIALIZED_THIS = BASE | 6;
++
++    /**
++     * The stack size variation corresponding to each JVM instruction. This
++     * stack variation is equal to the size of the values produced by an
++     * instruction, minus the size of the values consumed by this instruction.
++     */
++    static final int[] SIZE;
++
++    /**
++     * Computes the stack size variation corresponding to each JVM instruction.
++     */
++    static {
++        int i;
++        int[] b = new int[202];
++        String s = "EFFFFFFFFGGFFFGGFFFEEFGFGFEEEEEEEEEEEEEEEEEEEEDEDEDDDDD"
++                + "CDCDEEEEEEEEEEEEEEEEEEEEBABABBBBDCFFFGGGEDCDCDCDCDCDCDCDCD"
++                + "CDCEEEEDDDDDDDCDCDCEFEFDDEEFFDEDEEEBDDBBDDDDDDCCCCCCCCEFED"
++                + "DDCDCDEEEEEEEEEEFEEEEEEDDEEDDEE";
++        for (i = 0; i < b.length; ++i) {
++            b[i] = s.charAt(i) - 'E';
++        }
++        SIZE = b;
++
++        // code to generate the above string
++        //
++        // int NA = 0; // not applicable (unused opcode or variable size opcode)
++        //
++        // b = new int[] {
++        // 0, //NOP, // visitInsn
++        // 1, //ACONST_NULL, // -
++        // 1, //ICONST_M1, // -
++        // 1, //ICONST_0, // -
++        // 1, //ICONST_1, // -
++        // 1, //ICONST_2, // -
++        // 1, //ICONST_3, // -
++        // 1, //ICONST_4, // -
++        // 1, //ICONST_5, // -
++        // 2, //LCONST_0, // -
++        // 2, //LCONST_1, // -
++        // 1, //FCONST_0, // -
++        // 1, //FCONST_1, // -
++        // 1, //FCONST_2, // -
++        // 2, //DCONST_0, // -
++        // 2, //DCONST_1, // -
++        // 1, //BIPUSH, // visitIntInsn
++        // 1, //SIPUSH, // -
++        // 1, //LDC, // visitLdcInsn
++        // NA, //LDC_W, // -
++        // NA, //LDC2_W, // -
++        // 1, //ILOAD, // visitVarInsn
++        // 2, //LLOAD, // -
++        // 1, //FLOAD, // -
++        // 2, //DLOAD, // -
++        // 1, //ALOAD, // -
++        // NA, //ILOAD_0, // -
++        // NA, //ILOAD_1, // -
++        // NA, //ILOAD_2, // -
++        // NA, //ILOAD_3, // -
++        // NA, //LLOAD_0, // -
++        // NA, //LLOAD_1, // -
++        // NA, //LLOAD_2, // -
++        // NA, //LLOAD_3, // -
++        // NA, //FLOAD_0, // -
++        // NA, //FLOAD_1, // -
++        // NA, //FLOAD_2, // -
++        // NA, //FLOAD_3, // -
++        // NA, //DLOAD_0, // -
++        // NA, //DLOAD_1, // -
++        // NA, //DLOAD_2, // -
++        // NA, //DLOAD_3, // -
++        // NA, //ALOAD_0, // -
++        // NA, //ALOAD_1, // -
++        // NA, //ALOAD_2, // -
++        // NA, //ALOAD_3, // -
++        // -1, //IALOAD, // visitInsn
++        // 0, //LALOAD, // -
++        // -1, //FALOAD, // -
++        // 0, //DALOAD, // -
++        // -1, //AALOAD, // -
++        // -1, //BALOAD, // -
++        // -1, //CALOAD, // -
++        // -1, //SALOAD, // -
++        // -1, //ISTORE, // visitVarInsn
++        // -2, //LSTORE, // -
++        // -1, //FSTORE, // -
++        // -2, //DSTORE, // -
++        // -1, //ASTORE, // -
++        // NA, //ISTORE_0, // -
++        // NA, //ISTORE_1, // -
++        // NA, //ISTORE_2, // -
++        // NA, //ISTORE_3, // -
++        // NA, //LSTORE_0, // -
++        // NA, //LSTORE_1, // -
++        // NA, //LSTORE_2, // -
++        // NA, //LSTORE_3, // -
++        // NA, //FSTORE_0, // -
++        // NA, //FSTORE_1, // -
++        // NA, //FSTORE_2, // -
++        // NA, //FSTORE_3, // -
++        // NA, //DSTORE_0, // -
++        // NA, //DSTORE_1, // -
++        // NA, //DSTORE_2, // -
++        // NA, //DSTORE_3, // -
++        // NA, //ASTORE_0, // -
++        // NA, //ASTORE_1, // -
++        // NA, //ASTORE_2, // -
++        // NA, //ASTORE_3, // -
++        // -3, //IASTORE, // visitInsn
++        // -4, //LASTORE, // -
++        // -3, //FASTORE, // -
++        // -4, //DASTORE, // -
++        // -3, //AASTORE, // -
++        // -3, //BASTORE, // -
++        // -3, //CASTORE, // -
++        // -3, //SASTORE, // -
++        // -1, //POP, // -
++        // -2, //POP2, // -
++        // 1, //DUP, // -
++        // 1, //DUP_X1, // -
++        // 1, //DUP_X2, // -
++        // 2, //DUP2, // -
++        // 2, //DUP2_X1, // -
++        // 2, //DUP2_X2, // -
++        // 0, //SWAP, // -
++        // -1, //IADD, // -
++        // -2, //LADD, // -
++        // -1, //FADD, // -
++        // -2, //DADD, // -
++        // -1, //ISUB, // -
++        // -2, //LSUB, // -
++        // -1, //FSUB, // -
++        // -2, //DSUB, // -
++        // -1, //IMUL, // -
++        // -2, //LMUL, // -
++        // -1, //FMUL, // -
++        // -2, //DMUL, // -
++        // -1, //IDIV, // -
++        // -2, //LDIV, // -
++        // -1, //FDIV, // -
++        // -2, //DDIV, // -
++        // -1, //IREM, // -
++        // -2, //LREM, // -
++        // -1, //FREM, // -
++        // -2, //DREM, // -
++        // 0, //INEG, // -
++        // 0, //LNEG, // -
++        // 0, //FNEG, // -
++        // 0, //DNEG, // -
++        // -1, //ISHL, // -
++        // -1, //LSHL, // -
++        // -1, //ISHR, // -
++        // -1, //LSHR, // -
++        // -1, //IUSHR, // -
++        // -1, //LUSHR, // -
++        // -1, //IAND, // -
++        // -2, //LAND, // -
++        // -1, //IOR, // -
++        // -2, //LOR, // -
++        // -1, //IXOR, // -
++        // -2, //LXOR, // -
++        // 0, //IINC, // visitIincInsn
++        // 1, //I2L, // visitInsn
++        // 0, //I2F, // -
++        // 1, //I2D, // -
++        // -1, //L2I, // -
++        // -1, //L2F, // -
++        // 0, //L2D, // -
++        // 0, //F2I, // -
++        // 1, //F2L, // -
++        // 1, //F2D, // -
++        // -1, //D2I, // -
++        // 0, //D2L, // -
++        // -1, //D2F, // -
++        // 0, //I2B, // -
++        // 0, //I2C, // -
++        // 0, //I2S, // -
++        // -3, //LCMP, // -
++        // -1, //FCMPL, // -
++        // -1, //FCMPG, // -
++        // -3, //DCMPL, // -
++        // -3, //DCMPG, // -
++        // -1, //IFEQ, // visitJumpInsn
++        // -1, //IFNE, // -
++        // -1, //IFLT, // -
++        // -1, //IFGE, // -
++        // -1, //IFGT, // -
++        // -1, //IFLE, // -
++        // -2, //IF_ICMPEQ, // -
++        // -2, //IF_ICMPNE, // -
++        // -2, //IF_ICMPLT, // -
++        // -2, //IF_ICMPGE, // -
++        // -2, //IF_ICMPGT, // -
++        // -2, //IF_ICMPLE, // -
++        // -2, //IF_ACMPEQ, // -
++        // -2, //IF_ACMPNE, // -
++        // 0, //GOTO, // -
++        // 1, //JSR, // -
++        // 0, //RET, // visitVarInsn
++        // -1, //TABLESWITCH, // visiTableSwitchInsn
++        // -1, //LOOKUPSWITCH, // visitLookupSwitch
++        // -1, //IRETURN, // visitInsn
++        // -2, //LRETURN, // -
++        // -1, //FRETURN, // -
++        // -2, //DRETURN, // -
++        // -1, //ARETURN, // -
++        // 0, //RETURN, // -
++        // NA, //GETSTATIC, // visitFieldInsn
++        // NA, //PUTSTATIC, // -
++        // NA, //GETFIELD, // -
++        // NA, //PUTFIELD, // -
++        // NA, //INVOKEVIRTUAL, // visitMethodInsn
++        // NA, //INVOKESPECIAL, // -
++        // NA, //INVOKESTATIC, // -
++        // NA, //INVOKEINTERFACE, // -
++        // NA, //UNUSED, // NOT VISITED
++        // 1, //NEW, // visitTypeInsn
++        // 0, //NEWARRAY, // visitIntInsn
++        // 0, //ANEWARRAY, // visitTypeInsn
++        // 0, //ARRAYLENGTH, // visitInsn
++        // NA, //ATHROW, // -
++        // 0, //CHECKCAST, // visitTypeInsn
++        // 0, //INSTANCEOF, // -
++        // -1, //MONITORENTER, // visitInsn
++        // -1, //MONITOREXIT, // -
++        // NA, //WIDE, // NOT VISITED
++        // NA, //MULTIANEWARRAY, // visitMultiANewArrayInsn
++        // -1, //IFNULL, // visitJumpInsn
++        // -1, //IFNONNULL, // -
++        // NA, //GOTO_W, // -
++        // NA, //JSR_W, // -
++        // };
++        // for (i = 0; i < b.length; ++i) {
++        // System.err.print((char)('E' + b[i]));
++        // }
++        // System.err.println();
++    }
++
++    /**
++     * The label (i.e. basic block) to which these input and output stack map
++     * frames correspond.
++     */
++    Label owner;
++
++    /**
++     * The input stack map frame locals.
++     */
++    int[] inputLocals;
++
++    /**
++     * The input stack map frame stack.
++     */
++    int[] inputStack;
++
++    /**
++     * The output stack map frame locals.
++     */
++    private int[] outputLocals;
++
++    /**
++     * The output stack map frame stack.
++     */
++    private int[] outputStack;
++
++    /**
++     * Relative size of the output stack. The exact semantics of this field
++     * depends on the algorithm that is used.
++     *
++     * When only the maximum stack size is computed, this field is the size of
++     * the output stack relatively to the top of the input stack.
++     *
++     * When the stack map frames are completely computed, this field is the
++     * actual number of types in {@link #outputStack}.
++     */
++    private int outputStackTop;
++
++    /**
++     * Number of types that are initialized in the basic block.
++     *
++     * @see #initializations
++     */
++    private int initializationCount;
++
++    /**
++     * The types that are initialized in the basic block. A constructor
++     * invocation on an UNINITIALIZED or UNINITIALIZED_THIS type must replace
++     * <i>every occurence</i> of this type in the local variables and in the
++     * operand stack. This cannot be done during the first phase of the
++     * algorithm since, during this phase, the local variables and the operand
++     * stack are not completely computed. It is therefore necessary to store the
++     * types on which constructors are invoked in the basic block, in order to
++     * do this replacement during the second phase of the algorithm, where the
++     * frames are fully computed. Note that this array can contain types that
++     * are relative to input locals or to the input stack (see below for the
++     * description of the algorithm).
++     */
++    private int[] initializations;
++
++    /**
++     * Returns the output frame local variable type at the given index.
++     *
++     * @param local the index of the local that must be returned.
++     * @return the output frame local variable type at the given index.
++     */
++    private int get(final int local) {
++        if (outputLocals == null || local >= outputLocals.length) {
++            // this local has never been assigned in this basic block,
++            // so it is still equal to its value in the input frame
++            return LOCAL | local;
++        } else {
++            int type = outputLocals[local];
++            if (type == 0) {
++                // this local has never been assigned in this basic block,
++                // so it is still equal to its value in the input frame
++                type = outputLocals[local] = LOCAL | local;
++            }
++            return type;
++        }
++    }
++
++    /**
++     * Sets the output frame local variable type at the given index.
++     *
++     * @param local the index of the local that must be set.
++     * @param type the value of the local that must be set.
++     */
++    private void set(final int local, final int type) {
++        // creates and/or resizes the output local variables array if necessary
++        if (outputLocals == null) {
++            outputLocals = new int[10];
++        }
++        int n = outputLocals.length;
++        if (local >= n) {
++            int[] t = new int[Math.max(local + 1, 2 * n)];
++            System.arraycopy(outputLocals, 0, t, 0, n);
++            outputLocals = t;
++        }
++        // sets the local variable
++        outputLocals[local] = type;
++    }
++
++    /**
++     * Pushes a new type onto the output frame stack.
++     *
++     * @param type the type that must be pushed.
++     */
++    private void push(final int type) {
++        // creates and/or resizes the output stack array if necessary
++        if (outputStack == null) {
++            outputStack = new int[10];
++        }
++        int n = outputStack.length;
++        if (outputStackTop >= n) {
++            int[] t = new int[Math.max(outputStackTop + 1, 2 * n)];
++            System.arraycopy(outputStack, 0, t, 0, n);
++            outputStack = t;
++        }
++        // pushes the type on the output stack
++        outputStack[outputStackTop++] = type;
++        // updates the maximun height reached by the output stack, if needed
++        int top = owner.inputStackTop + outputStackTop;
++        if (top > owner.outputStackMax) {
++            owner.outputStackMax = top;
++        }
++    }
++
++    /**
++     * Pushes a new type onto the output frame stack.
++     *
++     * @param cw the ClassWriter to which this label belongs.
++     * @param desc the descriptor of the type to be pushed. Can also be a method
++     *        descriptor (in this case this method pushes its return type onto
++     *        the output frame stack).
++     */
++    private void push(final ClassWriter cw, final String desc) {
++        int type = type(cw, desc);
++        if (type != 0) {
++            push(type);
++            if (type == LONG || type == DOUBLE) {
++                push(TOP);
++            }
++        }
++    }
++
++    /**
++     * Returns the int encoding of the given type.
++     *
++     * @param cw the ClassWriter to which this label belongs.
++     * @param desc a type descriptor.
++     * @return the int encoding of the given type.
++     */
++    private static int type(final ClassWriter cw, final String desc) {
++        String t;
++        int index = desc.charAt(0) == '(' ? desc.indexOf(')') + 1 : 0;
++        switch (desc.charAt(index)) {
++            case 'V':
++                return 0;
++            case 'Z':
++            case 'C':
++            case 'B':
++            case 'S':
++            case 'I':
++                return INTEGER;
++            case 'F':
++                return FLOAT;
++            case 'J':
++                return LONG;
++            case 'D':
++                return DOUBLE;
++            case 'L':
++                // stores the internal name, not the descriptor!
++                t = desc.substring(index + 1, desc.length() - 1);
++                return OBJECT | cw.addType(t);
++                // case '[':
++            default:
++                // extracts the dimensions and the element type
++                int data;
++                int dims = index + 1;
++                while (desc.charAt(dims) == '[') {
++                    ++dims;
++                }
++                switch (desc.charAt(dims)) {
++                    case 'Z':
++                        data = BOOLEAN;
++                        break;
++                    case 'C':
++                        data = CHAR;
++                        break;
++                    case 'B':
++                        data = BYTE;
++                        break;
++                    case 'S':
++                        data = SHORT;
++                        break;
++                    case 'I':
++                        data = INTEGER;
++                        break;
++                    case 'F':
++                        data = FLOAT;
++                        break;
++                    case 'J':
++                        data = LONG;
++                        break;
++                    case 'D':
++                        data = DOUBLE;
++                        break;
++                    // case 'L':
++                    default:
++                        // stores the internal name, not the descriptor
++                        t = desc.substring(dims + 1, desc.length() - 1);
++                        data = OBJECT | cw.addType(t);
++                }
++                return (dims - index) << 28 | data;
++        }
++    }
++
++    /**
++     * Pops a type from the output frame stack and returns its value.
++     *
++     * @return the type that has been popped from the output frame stack.
++     */
++    private int pop() {
++        if (outputStackTop > 0) {
++            return outputStack[--outputStackTop];
++        } else {
++            // if the output frame stack is empty, pops from the input stack
++            return STACK | -(--owner.inputStackTop);
++        }
++    }
++
++    /**
++     * Pops the given number of types from the output frame stack.
++     *
++     * @param elements the number of types that must be popped.
++     */
++    private void pop(final int elements) {
++        if (outputStackTop >= elements) {
++            outputStackTop -= elements;
++        } else {
++            // if the number of elements to be popped is greater than the number
++            // of elements in the output stack, clear it, and pops the remaining
++            // elements from the input stack.
++            owner.inputStackTop -= elements - outputStackTop;
++            outputStackTop = 0;
++        }
++    }
++
++    /**
++     * Pops a type from the output frame stack.
++     *
++     * @param desc the descriptor of the type to be popped. Can also be a method
++     *        descriptor (in this case this method pops the types corresponding
++     *        to the method arguments).
++     */
++    private void pop(final String desc) {
++        char c = desc.charAt(0);
++        if (c == '(') {
++            pop((MethodWriter.getArgumentsAndReturnSizes(desc) >> 2) - 1);
++        } else if (c == 'J' || c == 'D') {
++            pop(2);
++        } else {
++            pop(1);
++        }
++    }
++
++    /**
++     * Adds a new type to the list of types on which a constructor is invoked in
++     * the basic block.
++     *
++     * @param var a type on a which a constructor is invoked.
++     */
++    private void init(final int var) {
++        // creates and/or resizes the initializations array if necessary
++        if (initializations == null) {
++            initializations = new int[2];
++        }
++        int n = initializations.length;
++        if (initializationCount >= n) {
++            int[] t = new int[Math.max(initializationCount + 1, 2 * n)];
++            System.arraycopy(initializations, 0, t, 0, n);
++            initializations = t;
++        }
++        // stores the type to be initialized
++        initializations[initializationCount++] = var;
++    }
++
++    /**
++     * Replaces the given type with the appropriate type if it is one of the
++     * types on which a constructor is invoked in the basic block.
++     *
++     * @param cw the ClassWriter to which this label belongs.
++     * @param t a type
++     * @return t or, if t is one of the types on which a constructor is invoked
++     *         in the basic block, the type corresponding to this constructor.
++     */
++    private int init(final ClassWriter cw, final int t) {
++        int s;
++        if (t == UNINITIALIZED_THIS) {
++            s = OBJECT | cw.addType(cw.thisName);
++        } else if ((t & (DIM | BASE_KIND)) == UNINITIALIZED) {
++            String type = cw.typeTable[t & BASE_VALUE].strVal1;
++            s = OBJECT | cw.addType(type);
++        } else {
++            return t;
++        }
++        for (int j = 0; j < initializationCount; ++j) {
++            int u = initializations[j];
++            int dim = u & DIM;
++            int kind = u & KIND;
++            if (kind == LOCAL) {
++                u = dim + inputLocals[u & VALUE];
++            } else if (kind == STACK) {
++                u = dim + inputStack[inputStack.length - (u & VALUE)];
++            }
++            if (t == u) {
++                return s;
++            }
++        }
++        return t;
++    }
++
++    /**
++     * Initializes the input frame of the first basic block from the method
++     * descriptor.
++     *
++     * @param cw the ClassWriter to which this label belongs.
++     * @param access the access flags of the method to which this label belongs.
++     * @param args the formal parameter types of this method.
++     * @param maxLocals the maximum number of local variables of this method.
++     */
++    void initInputFrame(
++        final ClassWriter cw,
++        final int access,
++        final Type[] args,
++        final int maxLocals)
++    {
++        inputLocals = new int[maxLocals];
++        inputStack = new int[0];
++        int i = 0;
++        if ((access & Opcodes.ACC_STATIC) == 0) {
++            if ((access & MethodWriter.ACC_CONSTRUCTOR) == 0) {
++                inputLocals[i++] = OBJECT | cw.addType(cw.thisName);
++            } else {
++                inputLocals[i++] = UNINITIALIZED_THIS;
++            }
++        }
++        for (int j = 0; j < args.length; ++j) {
++            int t = type(cw, args[j].getDescriptor());
++            inputLocals[i++] = t;
++            if (t == LONG || t == DOUBLE) {
++                inputLocals[i++] = TOP;
++            }
++        }
++        while (i < maxLocals) {
++            inputLocals[i++] = TOP;
++        }
++    }
++
++    /**
++     * Simulates the action of the given instruction on the output stack frame.
++     *
++     * @param opcode the opcode of the instruction.
++     * @param arg the operand of the instruction, if any.
++     * @param cw the class writer to which this label belongs.
++     * @param item the operand of the instructions, if any.
++     */
++    void execute(
++        final int opcode,
++        final int arg,
++        final ClassWriter cw,
++        final Item item)
++    {
++        int t1, t2, t3, t4;
++        switch (opcode) {
++            case Opcodes.NOP:
++            case Opcodes.INEG:
++            case Opcodes.LNEG:
++            case Opcodes.FNEG:
++            case Opcodes.DNEG:
++            case Opcodes.I2B:
++            case Opcodes.I2C:
++            case Opcodes.I2S:
++            case Opcodes.GOTO:
++            case Opcodes.RETURN:
++                break;
++            case Opcodes.ACONST_NULL:
++                push(NULL);
++                break;
++            case Opcodes.ICONST_M1:
++            case Opcodes.ICONST_0:
++            case Opcodes.ICONST_1:
++            case Opcodes.ICONST_2:
++            case Opcodes.ICONST_3:
++            case Opcodes.ICONST_4:
++            case Opcodes.ICONST_5:
++            case Opcodes.BIPUSH:
++            case Opcodes.SIPUSH:
++            case Opcodes.ILOAD:
++                push(INTEGER);
++                break;
++            case Opcodes.LCONST_0:
++            case Opcodes.LCONST_1:
++            case Opcodes.LLOAD:
++                push(LONG);
++                push(TOP);
++                break;
++            case Opcodes.FCONST_0:
++            case Opcodes.FCONST_1:
++            case Opcodes.FCONST_2:
++            case Opcodes.FLOAD:
++                push(FLOAT);
++                break;
++            case Opcodes.DCONST_0:
++            case Opcodes.DCONST_1:
++            case Opcodes.DLOAD:
++                push(DOUBLE);
++                push(TOP);
++                break;
++            case Opcodes.LDC:
++                switch (item.type) {
++                    case ClassWriter.INT:
++                        push(INTEGER);
++                        break;
++                    case ClassWriter.LONG:
++                        push(LONG);
++                        push(TOP);
++                        break;
++                    case ClassWriter.FLOAT:
++                        push(FLOAT);
++                        break;
++                    case ClassWriter.DOUBLE:
++                        push(DOUBLE);
++                        push(TOP);
++                        break;
++                    case ClassWriter.CLASS:
++                        push(OBJECT | cw.addType("java/lang/Class"));
++                        break;
++                    // case ClassWriter.STR:
++                    default:
++                        push(OBJECT | cw.addType("java/lang/String"));
++                }
++                break;
++            case Opcodes.ALOAD:
++                push(get(arg));
++                break;
++            case Opcodes.IALOAD:
++            case Opcodes.BALOAD:
++            case Opcodes.CALOAD:
++            case Opcodes.SALOAD:
++                pop(2);
++                push(INTEGER);
++                break;
++            case Opcodes.LALOAD:
++            case Opcodes.D2L:
++                pop(2);
++                push(LONG);
++                push(TOP);
++                break;
++            case Opcodes.FALOAD:
++                pop(2);
++                push(FLOAT);
++                break;
++            case Opcodes.DALOAD:
++            case Opcodes.L2D:
++                pop(2);
++                push(DOUBLE);
++                push(TOP);
++                break;
++            case Opcodes.AALOAD:
++                pop(1);
++                t1 = pop();
++                push(ELEMENT_OF + t1);
++                break;
++            case Opcodes.ISTORE:
++            case Opcodes.FSTORE:
++            case Opcodes.ASTORE:
++                t1 = pop();
++                set(arg, t1);
++                if (arg > 0) {
++                    t2 = get(arg - 1);
++                    // if t2 is of kind STACK or LOCAL we cannot know its size!
++                    if (t2 == LONG || t2 == DOUBLE) {
++                        set(arg - 1, TOP);
++                    }
++                }
++                break;
++            case Opcodes.LSTORE:
++            case Opcodes.DSTORE:
++                pop(1);
++                t1 = pop();
++                set(arg, t1);
++                set(arg + 1, TOP);
++                if (arg > 0) {
++                    t2 = get(arg - 1);
++                    // if t2 is of kind STACK or LOCAL we cannot know its size!
++                    if (t2 == LONG || t2 == DOUBLE) {
++                        set(arg - 1, TOP);
++                    }
++                }
++                break;
++            case Opcodes.IASTORE:
++            case Opcodes.BASTORE:
++            case Opcodes.CASTORE:
++            case Opcodes.SASTORE:
++            case Opcodes.FASTORE:
++            case Opcodes.AASTORE:
++                pop(3);
++                break;
++            case Opcodes.LASTORE:
++            case Opcodes.DASTORE:
++                pop(4);
++                break;
++            case Opcodes.POP:
++            case Opcodes.IFEQ:
++            case Opcodes.IFNE:
++            case Opcodes.IFLT:
++            case Opcodes.IFGE:
++            case Opcodes.IFGT:
++            case Opcodes.IFLE:
++            case Opcodes.IRETURN:
++            case Opcodes.FRETURN:
++            case Opcodes.ARETURN:
++            case Opcodes.TABLESWITCH:
++            case Opcodes.LOOKUPSWITCH:
++            case Opcodes.ATHROW:
++            case Opcodes.MONITORENTER:
++            case Opcodes.MONITOREXIT:
++            case Opcodes.IFNULL:
++            case Opcodes.IFNONNULL:
++                pop(1);
++                break;
++            case Opcodes.POP2:
++            case Opcodes.IF_ICMPEQ:
++            case Opcodes.IF_ICMPNE:
++            case Opcodes.IF_ICMPLT:
++            case Opcodes.IF_ICMPGE:
++            case Opcodes.IF_ICMPGT:
++            case Opcodes.IF_ICMPLE:
++            case Opcodes.IF_ACMPEQ:
++            case Opcodes.IF_ACMPNE:
++            case Opcodes.LRETURN:
++            case Opcodes.DRETURN:
++                pop(2);
++                break;
++            case Opcodes.DUP:
++                t1 = pop();
++                push(t1);
++                push(t1);
++                break;
++            case Opcodes.DUP_X1:
++                t1 = pop();
++                t2 = pop();
++                push(t1);
++                push(t2);
++                push(t1);
++                break;
++            case Opcodes.DUP_X2:
++                t1 = pop();
++                t2 = pop();
++                t3 = pop();
++                push(t1);
++                push(t3);
++                push(t2);
++                push(t1);
++                break;
++            case Opcodes.DUP2:
++                t1 = pop();
++                t2 = pop();
++                push(t2);
++                push(t1);
++                push(t2);
++                push(t1);
++                break;
++            case Opcodes.DUP2_X1:
++                t1 = pop();
++                t2 = pop();
++                t3 = pop();
++                push(t2);
++                push(t1);
++                push(t3);
++                push(t2);
++                push(t1);
++                break;
++            case Opcodes.DUP2_X2:
++                t1 = pop();
++                t2 = pop();
++                t3 = pop();
++                t4 = pop();
++                push(t2);
++                push(t1);
++                push(t4);
++                push(t3);
++                push(t2);
++                push(t1);
++                break;
++            case Opcodes.SWAP:
++                t1 = pop();
++                t2 = pop();
++                push(t1);
++                push(t2);
++                break;
++            case Opcodes.IADD:
++            case Opcodes.ISUB:
++            case Opcodes.IMUL:
++            case Opcodes.IDIV:
++            case Opcodes.IREM:
++            case Opcodes.IAND:
++            case Opcodes.IOR:
++            case Opcodes.IXOR:
++            case Opcodes.ISHL:
++            case Opcodes.ISHR:
++            case Opcodes.IUSHR:
++            case Opcodes.L2I:
++            case Opcodes.D2I:
++            case Opcodes.FCMPL:
++            case Opcodes.FCMPG:
++                pop(2);
++                push(INTEGER);
++                break;
++            case Opcodes.LADD:
++            case Opcodes.LSUB:
++            case Opcodes.LMUL:
++            case Opcodes.LDIV:
++            case Opcodes.LREM:
++            case Opcodes.LAND:
++            case Opcodes.LOR:
++            case Opcodes.LXOR:
++                pop(4);
++                push(LONG);
++                push(TOP);
++                break;
++            case Opcodes.FADD:
++            case Opcodes.FSUB:
++            case Opcodes.FMUL:
++            case Opcodes.FDIV:
++            case Opcodes.FREM:
++            case Opcodes.L2F:
++            case Opcodes.D2F:
++                pop(2);
++                push(FLOAT);
++                break;
++            case Opcodes.DADD:
++            case Opcodes.DSUB:
++            case Opcodes.DMUL:
++            case Opcodes.DDIV:
++            case Opcodes.DREM:
++                pop(4);
++                push(DOUBLE);
++                push(TOP);
++                break;
++            case Opcodes.LSHL:
++            case Opcodes.LSHR:
++            case Opcodes.LUSHR:
++                pop(3);
++                push(LONG);
++                push(TOP);
++                break;
++            case Opcodes.IINC:
++                set(arg, INTEGER);
++                break;
++            case Opcodes.I2L:
++            case Opcodes.F2L:
++                pop(1);
++                push(LONG);
++                push(TOP);
++                break;
++            case Opcodes.I2F:
++                pop(1);
++                push(FLOAT);
++                break;
++            case Opcodes.I2D:
++            case Opcodes.F2D:
++                pop(1);
++                push(DOUBLE);
++                push(TOP);
++                break;
++            case Opcodes.F2I:
++            case Opcodes.ARRAYLENGTH:
++            case Opcodes.INSTANCEOF:
++                pop(1);
++                push(INTEGER);
++                break;
++            case Opcodes.LCMP:
++            case Opcodes.DCMPL:
++            case Opcodes.DCMPG:
++                pop(4);
++                push(INTEGER);
++                break;
++            case Opcodes.JSR:
++            case Opcodes.RET:
++                throw new RuntimeException("JSR/RET are not supported with computeFrames option");
++            case Opcodes.GETSTATIC:
++                push(cw, item.strVal3);
++                break;
++            case Opcodes.PUTSTATIC:
++                pop(item.strVal3);
++                break;
++            case Opcodes.GETFIELD:
++                pop(1);
++                push(cw, item.strVal3);
++                break;
++            case Opcodes.PUTFIELD:
++                pop(item.strVal3);
++                pop();
++                break;
++            case Opcodes.INVOKEVIRTUAL:
++            case Opcodes.INVOKESPECIAL:
++            case Opcodes.INVOKESTATIC:
++            case Opcodes.INVOKEINTERFACE:
++                pop(item.strVal3);
++                if (opcode != Opcodes.INVOKESTATIC) {
++                    t1 = pop();
++                    if (opcode == Opcodes.INVOKESPECIAL
++                            && item.strVal2.charAt(0) == '<')
++                    {
++                        init(t1);
++                    }
++                }
++                push(cw, item.strVal3);
++                break;
++            case Opcodes.NEW:
++                push(UNINITIALIZED | cw.addUninitializedType(item.strVal1, arg));
++                break;
++            case Opcodes.NEWARRAY:
++                pop();
++                switch (arg) {
++                    case Opcodes.T_BOOLEAN:
++                        push(ARRAY_OF | BOOLEAN);
++                        break;
++                    case Opcodes.T_CHAR:
++                        push(ARRAY_OF | CHAR);
++                        break;
++                    case Opcodes.T_BYTE:
++                        push(ARRAY_OF | BYTE);
++                        break;
++                    case Opcodes.T_SHORT:
++                        push(ARRAY_OF | SHORT);
++                        break;
++                    case Opcodes.T_INT:
++                        push(ARRAY_OF | INTEGER);
++                        break;
++                    case Opcodes.T_FLOAT:
++                        push(ARRAY_OF | FLOAT);
++                        break;
++                    case Opcodes.T_DOUBLE:
++                        push(ARRAY_OF | DOUBLE);
++                        break;
++                    // case Opcodes.T_LONG:
++                    default:
++                        push(ARRAY_OF | LONG);
++                        break;
++                }
++                break;
++            case Opcodes.ANEWARRAY:
++                String s = item.strVal1;
++                pop();
++                if (s.charAt(0) == '[') {
++                    push(cw, '[' + s);
++                } else {
++                    push(ARRAY_OF | OBJECT | cw.addType(s));
++                }
++                break;
++            case Opcodes.CHECKCAST:
++                s = item.strVal1;
++                pop();
++                if (s.charAt(0) == '[') {
++                    push(cw, s);
++                } else {
++                    push(OBJECT | cw.addType(s));
++                }
++                break;
++            // case Opcodes.MULTIANEWARRAY:
++            default:
++                pop(arg);
++                push(cw, item.strVal1);
++                break;
++        }
++    }
++
++    /**
++     * Merges the input frame of the given basic block with the input and output
++     * frames of this basic block. Returns <tt>true</tt> if the input frame of
++     * the given label has been changed by this operation.
++     *
++     * @param cw the ClassWriter to which this label belongs.
++     * @param frame the basic block whose input frame must be updated.
++     * @param edge the kind of the {@link Edge} between this label and 'label'.
++     *        See {@link Edge#info}.
++     * @return <tt>true</tt> if the input frame of the given label has been
++     *         changed by this operation.
++     */
++    boolean merge(final ClassWriter cw, final Frame frame, final int edge) {
++        boolean changed = false;
++        int i, s, dim, kind, t;
++
++        int nLocal = inputLocals.length;
++        int nStack = inputStack.length;
++        if (frame.inputLocals == null) {
++            frame.inputLocals = new int[nLocal];
++            changed = true;
++        }
++
++        for (i = 0; i < nLocal; ++i) {
++            if (outputLocals != null && i < outputLocals.length) {
++                s = outputLocals[i];
++                if (s == 0) {
++                    t = inputLocals[i];
++                } else {
++                    dim = s & DIM;
++                    kind = s & KIND;
++                    if (kind == LOCAL) {
++                        t = dim + inputLocals[s & VALUE];
++                    } else if (kind == STACK) {
++                        t = dim + inputStack[nStack - (s & VALUE)];
++                    } else {
++                        t = s;
++                    }
++                }
++            } else {
++                t = inputLocals[i];
++            }
++            if (initializations != null) {
++                t = init(cw, t);
++            }
++            changed |= merge(cw, t, frame.inputLocals, i);
++        }
++
++        if (edge > 0) {
++            for (i = 0; i < nLocal; ++i) {
++                t = inputLocals[i];
++                changed |= merge(cw, t, frame.inputLocals, i);
++            }
++            if (frame.inputStack == null) {
++                frame.inputStack = new int[1];
++                changed = true;
++            }
++            changed |= merge(cw, edge, frame.inputStack, 0);
++            return changed;
++        }
++
++        int nInputStack = inputStack.length + owner.inputStackTop;
++        if (frame.inputStack == null) {
++            frame.inputStack = new int[nInputStack + outputStackTop];
++            changed = true;
++        }
++
++        for (i = 0; i < nInputStack; ++i) {
++            t = inputStack[i];
++            if (initializations != null) {
++                t = init(cw, t);
++            }
++            changed |= merge(cw, t, frame.inputStack, i);
++        }
++        for (i = 0; i < outputStackTop; ++i) {
++            s = outputStack[i];
++            dim = s & DIM;
++            kind = s & KIND;
++            if (kind == LOCAL) {
++                t = dim + inputLocals[s & VALUE];
++            } else if (kind == STACK) {
++                t = dim + inputStack[nStack - (s & VALUE)];
++            } else {
++                t = s;
++            }
++            if (initializations != null) {
++                t = init(cw, t);
++            }
++            changed |= merge(cw, t, frame.inputStack, nInputStack + i);
++        }
++        return changed;
++    }
++
++    /**
++     * Merges the type at the given index in the given type array with the given
++     * type. Returns <tt>true</tt> if the type array has been modified by this
++     * operation.
++     *
++     * @param cw the ClassWriter to which this label belongs.
++     * @param t the type with which the type array element must be merged.
++     * @param types an array of types.
++     * @param index the index of the type that must be merged in 'types'.
++     * @return <tt>true</tt> if the type array has been modified by this
++     *         operation.
++     */
++    private static boolean merge(
++        final ClassWriter cw,
++        int t,
++        final int[] types,
++        final int index)
++    {
++        int u = types[index];
++        if (u == t) {
++            // if the types are equal, merge(u,t)=u, so there is no change
++            return false;
++        }
++        if ((t & ~DIM) == NULL) {
++            if (u == NULL) {
++                return false;
++            }
++            t = NULL;
++        }
++        if (u == 0) {
++            // if types[index] has never been assigned, merge(u,t)=t
++            types[index] = t;
++            return true;
++        }
++        int v;
++        if ((u & BASE_KIND) == OBJECT || (u & DIM) != 0) {
++            // if u is a reference type of any dimension
++            if (t == NULL) {
++                // if t is the NULL type, merge(u,t)=u, so there is no change
++                return false;
++            } else if ((t & (DIM | BASE_KIND)) == (u & (DIM | BASE_KIND))) {
++                if ((u & BASE_KIND) == OBJECT) {
++                    // if t is also a reference type, and if u and t have the
++                    // same dimension merge(u,t) = dim(t) | common parent of the
++                    // element types of u and t
++                    v = (t & DIM) | OBJECT
++                            | cw.getMergedType(t & BASE_VALUE, u & BASE_VALUE);
++                } else {
++                    // if u and t are array types, but not with the same element
++                    // type, merge(u,t)=java/lang/Object
++                    v = OBJECT | cw.addType("java/lang/Object");
++                }
++            } else if ((t & BASE_KIND) == OBJECT || (t & DIM) != 0) {
++                // if t is any other reference or array type,
++                // merge(u,t)=java/lang/Object
++                v = OBJECT | cw.addType("java/lang/Object");
++            } else {
++                // if t is any other type, merge(u,t)=TOP
++                v = TOP;
++            }
++        } else if (u == NULL) {
++            // if u is the NULL type, merge(u,t)=t,
++            // or TOP if t is not a reference type
++            v = (t & BASE_KIND) == OBJECT || (t & DIM) != 0 ? t : TOP;
++        } else {
++            // if u is any other type, merge(u,t)=TOP whatever t
++            v = TOP;
++        }
++        if (u != v) {
++            types[index] = v;
++            return true;
++        }
++        return false;
++    }
++}
+--- /dev/null	Thu Jul 30 19:03:26 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/org/objectweb/asm/Handler.java	Thu Jul 30 19:03:26 2009
+@@ -0,0 +1,100 @@
++/*
++ * Copyright 2005-2009 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++
++/*
++ * This file is available under and governed by the GNU General Public
++ * License version 2 only, as published by the Free Software Foundation.
++ * However, the following notice accompanied the original version of this
++ * file:
++ *
++ * ASM: a very small and fast Java bytecode manipulation framework
++ * Copyright (c) 2000-2007 INRIA, France Telecom
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ *    notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ *    notice, this list of conditions and the following disclaimer in the
++ *    documentation and/or other materials provided with the distribution.
++ * 3. Neither the name of the copyright holders nor the names of its
++ *    contributors may be used to endorse or promote products derived from
++ *    this software without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
++ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
++ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
++ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
++ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
++ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
++ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
++ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
++ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
++ * THE POSSIBILITY OF SUCH DAMAGE.
++ */
++package com.sun.xml.internal.ws.org.objectweb.asm;
++
++/**
++ * Information about an exception handler block.
++ *
++ * @author Eric Bruneton
++ */
++class Handler {
++
++    /**
++     * Beginning of the exception handler's scope (inclusive).
++     */
++    Label start;
++
++    /**
++     * End of the exception handler's scope (exclusive).
++     */
++    Label end;
++
++    /**
++     * Beginning of the exception handler's code.
++     */
++    Label handler;
++
++    /**
++     * Internal name of the type of exceptions handled by this handler, or
++     * <tt>null</tt> to catch any exceptions.
++     */
++    String desc;
++
++    /**
++     * Constant pool index of the internal name of the type of exceptions
++     * handled by this handler, or 0 to catch any exceptions.
++     */
++    int type;
++
++    /**
++     * Next exception handler block info.
++     */
++    Handler next;
++}
+--- /dev/null	Thu Jul 30 19:03:30 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/org/objectweb/asm/Item.java	Thu Jul 30 19:03:29 2009
+@@ -0,0 +1,286 @@
++/*
++ * Copyright 2005-2009 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++
++/*
++ * This file is available under and governed by the GNU General Public
++ * License version 2 only, as published by the Free Software Foundation.
++ * However, the following notice accompanied the original version of this
++ * file:
++ *
++ * ASM: a very small and fast Java bytecode manipulation framework
++ * Copyright (c) 2000-2007 INRIA, France Telecom
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ *    notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ *    notice, this list of conditions and the following disclaimer in the
++ *    documentation and/or other materials provided with the distribution.
++ * 3. Neither the name of the copyright holders nor the names of its
++ *    contributors may be used to endorse or promote products derived from
++ *    this software without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
++ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
++ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
++ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
++ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
++ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
++ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
++ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
++ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
++ * THE POSSIBILITY OF SUCH DAMAGE.
++ */
++package com.sun.xml.internal.ws.org.objectweb.asm;
++
++/**
++ * A constant pool item. Constant pool items can be created with the 'newXXX'
++ * methods in the {@link ClassWriter} class.
++ *
++ * @author Eric Bruneton
++ */
++final class Item {
++
++    /**
++     * Index of this item in the constant pool.
++     */
++    int index;
++
++    /**
++     * Type of this constant pool item. A single class is used to represent all
++     * constant pool item types, in order to minimize the bytecode size of this
++     * package. The value of this field is one of {@link ClassWriter#INT},
++     * {@link ClassWriter#LONG}, {@link ClassWriter#FLOAT},
++     * {@link ClassWriter#DOUBLE}, {@link ClassWriter#UTF8},
++     * {@link ClassWriter#STR}, {@link ClassWriter#CLASS},
++     * {@link ClassWriter#NAME_TYPE}, {@link ClassWriter#FIELD},
++     * {@link ClassWriter#METH}, {@link ClassWriter#IMETH}.
++     *
++     * Special Item types are used for Items that are stored in the ClassWriter
++     * {@link ClassWriter#typeTable}, instead of the constant pool, in order to
++     * avoid clashes with normal constant pool items in the ClassWriter constant
++     * pool's hash table. These special item types are
++     * {@link ClassWriter#TYPE_NORMAL}, {@link ClassWriter#TYPE_UNINIT} and
++     * {@link ClassWriter#TYPE_MERGED}.
++     */
++    int type;
++
++    /**
++     * Value of this item, for an integer item.
++     */
++    int intVal;
++
++    /**
++     * Value of this item, for a long item.
++     */
++    long longVal;
++
++    /**
++     * First part of the value of this item, for items that do not hold a
++     * primitive value.
++     */
++    String strVal1;
++
++    /**
++     * Second part of the value of this item, for items that do not hold a
++     * primitive value.
++     */
++    String strVal2;
++
++    /**
++     * Third part of the value of this item, for items that do not hold a
++     * primitive value.
++     */
++    String strVal3;
++
++    /**
++     * The hash code value of this constant pool item.
++     */
++    int hashCode;
++
++    /**
++     * Link to another constant pool item, used for collision lists in the
++     * constant pool's hash table.
++     */
++    Item next;
++
++    /**
++     * Constructs an uninitialized {@link Item}.
++     */
++    Item() {
++    }
++
++    /**
++     * Constructs an uninitialized {@link Item} for constant pool element at
++     * given position.
++     *
++     * @param index index of the item to be constructed.
++     */
++    Item(final int index) {
++        this.index = index;
++    }
++
++    /**
++     * Constructs a copy of the given item.
++     *
++     * @param index index of the item to be constructed.
++     * @param i the item that must be copied into the item to be constructed.
++     */
++    Item(final int index, final Item i) {
++        this.index = index;
++        type = i.type;
++        intVal = i.intVal;
++        longVal = i.longVal;
++        strVal1 = i.strVal1;
++        strVal2 = i.strVal2;
++        strVal3 = i.strVal3;
++        hashCode = i.hashCode;
++    }
++
++    /**
++     * Sets this item to an integer item.
++     *
++     * @param intVal the value of this item.
++     */
++    void set(final int intVal) {
++        this.type = ClassWriter.INT;
++        this.intVal = intVal;
++        this.hashCode = 0x7FFFFFFF & (type + intVal);
++    }
++
++    /**
++     * Sets this item to a long item.
++     *
++     * @param longVal the value of this item.
++     */
++    void set(final long longVal) {
++        this.type = ClassWriter.LONG;
++        this.longVal = longVal;
++        this.hashCode = 0x7FFFFFFF & (type + (int) longVal);
++    }
++
++    /**
++     * Sets this item to a float item.
++     *
++     * @param floatVal the value of this item.
++     */
++    void set(final float floatVal) {
++        this.type = ClassWriter.FLOAT;
++        this.intVal = Float.floatToRawIntBits(floatVal);
++        this.hashCode = 0x7FFFFFFF & (type + (int) floatVal);
++    }
++
++    /**
++     * Sets this item to a double item.
++     *
++     * @param doubleVal the value of this item.
++     */
++    void set(final double doubleVal) {
++        this.type = ClassWriter.DOUBLE;
++        this.longVal = Double.doubleToRawLongBits(doubleVal);
++        this.hashCode = 0x7FFFFFFF & (type + (int) doubleVal);
++    }
++
++    /**
++     * Sets this item to an item that do not hold a primitive value.
++     *
++     * @param type the type of this item.
++     * @param strVal1 first part of the value of this item.
++     * @param strVal2 second part of the value of this item.
++     * @param strVal3 third part of the value of this item.
++     */
++    void set(
++        final int type,
++        final String strVal1,
++        final String strVal2,
++        final String strVal3)
++    {
++        this.type = type;
++        this.strVal1 = strVal1;
++        this.strVal2 = strVal2;
++        this.strVal3 = strVal3;
++        switch (type) {
++            case ClassWriter.UTF8:
++            case ClassWriter.STR:
++            case ClassWriter.CLASS:
++            case ClassWriter.TYPE_NORMAL:
++                hashCode = 0x7FFFFFFF & (type + strVal1.hashCode());
++                return;
++            case ClassWriter.NAME_TYPE:
++                hashCode = 0x7FFFFFFF & (type + strVal1.hashCode()
++                        * strVal2.hashCode());
++                return;
++                // ClassWriter.FIELD:
++                // ClassWriter.METH:
++                // ClassWriter.IMETH:
++            default:
++                hashCode = 0x7FFFFFFF & (type + strVal1.hashCode()
++                        * strVal2.hashCode() * strVal3.hashCode());
++        }
++    }
++
++    /**
++     * Indicates if the given item is equal to this one.
++     *
++     * @param i the item to be compared to this one.
++     * @return <tt>true</tt> if the given item if equal to this one,
++     *         <tt>false</tt> otherwise.
++     */
++    boolean isEqualTo(final Item i) {
++        if (i.type == type) {
++            switch (type) {
++                case ClassWriter.INT:
++                case ClassWriter.FLOAT:
++                    return i.intVal == intVal;
++                case ClassWriter.TYPE_MERGED:
++                case ClassWriter.LONG:
++                case ClassWriter.DOUBLE:
++                    return i.longVal == longVal;
++                case ClassWriter.UTF8:
++                case ClassWriter.STR:
++                case ClassWriter.CLASS:
++                case ClassWriter.TYPE_NORMAL:
++                    return i.strVal1.equals(strVal1);
++                case ClassWriter.TYPE_UNINIT:
++                    return i.intVal == intVal && i.strVal1.equals(strVal1);
++                case ClassWriter.NAME_TYPE:
++                    return i.strVal1.equals(strVal1)
++                            && i.strVal2.equals(strVal2);
++                    // ClassWriter.FIELD:
++                    // ClassWriter.METH:
++                    // ClassWriter.IMETH:
++                default:
++                    return i.strVal1.equals(strVal1)
++                            && i.strVal2.equals(strVal2)
++                            && i.strVal3.equals(strVal3);
++            }
++        }
++        return false;
++    }
++}
+--- /dev/null	Thu Jul 30 19:03:33 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/org/objectweb/asm/Label.java	Thu Jul 30 19:03:32 2009
+@@ -0,0 +1,556 @@
++/*
++ * Copyright 2005-2009 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++
++/*
++ * This file is available under and governed by the GNU General Public
++ * License version 2 only, as published by the Free Software Foundation.
++ * However, the following notice accompanied the original version of this
++ * file:
++ *
++ * ASM: a very small and fast Java bytecode manipulation framework
++ * Copyright (c) 2000-2007 INRIA, France Telecom
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ *    notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ *    notice, this list of conditions and the following disclaimer in the
++ *    documentation and/or other materials provided with the distribution.
++ * 3. Neither the name of the copyright holders nor the names of its
++ *    contributors may be used to endorse or promote products derived from
++ *    this software without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
++ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
++ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
++ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
++ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
++ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
++ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
++ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
++ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
++ * THE POSSIBILITY OF SUCH DAMAGE.
++ */
++package com.sun.xml.internal.ws.org.objectweb.asm;
++
++/**
++ * A label represents a position in the bytecode of a method. Labels are used
++ * for jump, goto, and switch instructions, and for try catch blocks.
++ *
++ * @author Eric Bruneton
++ */
++public class Label {
++
++    /**
++     * Indicates if this label is only used for debug attributes. Such a label
++     * is not the start of a basic block, the target of a jump instruction, or
++     * an exception handler. It can be safely ignored in control flow graph
++     * analysis algorithms (for optimization purposes).
++     */
++    static final int DEBUG = 1;
++
++    /**
++     * Indicates if the position of this label is known.
++     */
++    static final int RESOLVED = 2;
++
++    /**
++     * Indicates if this label has been updated, after instruction resizing.
++     */
++    static final int RESIZED = 4;
++
++    /**
++     * Indicates if this basic block has been pushed in the basic block stack.
++     * See {@link MethodWriter#visitMaxs visitMaxs}.
++     */
++    static final int PUSHED = 8;
++
++    /**
++     * Indicates if this label is the target of a jump instruction, or the start
++     * of an exception handler.
++     */
++    static final int TARGET = 16;
++
++    /**
++     * Indicates if a stack map frame must be stored for this label.
++     */
++    static final int STORE = 32;
++
++    /**
++     * Indicates if this label corresponds to a reachable basic block.
++     */
++    static final int REACHABLE = 64;
++
++    /**
++     * Indicates if this basic block ends with a JSR instruction.
++     */
++    static final int JSR = 128;
++
++    /**
++     * Indicates if this basic block ends with a RET instruction.
++     */
++    static final int RET = 256;
++
++    /**
++     * Indicates if this basic block is the start of a subroutine.
++     */
++    static final int SUBROUTINE = 512;
++
++    /**
++     * Indicates if this subroutine basic block has been visited.
++     */
++    static final int VISITED = 1024;
++
++    /**
++     * Field used to associate user information to a label. Warning: this field
++     * is used by the ASM tree package. In order to use it with the ASM tree
++     * package you must override the {@link
++     * com.sun.xml.internal.ws.org.objectweb.asm.tree.MethodNode#getLabelNode} method.
++     */
++    public Object info;
++
++    /**
++     * Flags that indicate the status of this label.
++     *
++     * @see #DEBUG
++     * @see #RESOLVED
++     * @see #RESIZED
++     * @see #PUSHED
++     * @see #TARGET
++     * @see #STORE
++     * @see #REACHABLE
++     * @see #JSR
++     * @see #RET
++     */
++    int status;
++
++    /**
++     * The line number corresponding to this label, if known.
++     */
++    int line;
++
++    /**
++     * The position of this label in the code, if known.
++     */
++    int position;
++
++    /**
++     * Number of forward references to this label, times two.
++     */
++    private int referenceCount;
++
++    /**
++     * Informations about forward references. Each forward reference is
++     * described by two consecutive integers in this array: the first one is the
++     * position of the first byte of the bytecode instruction that contains the
++     * forward reference, while the second is the position of the first byte of
++     * the forward reference itself. In fact the sign of the first integer
++     * indicates if this reference uses 2 or 4 bytes, and its absolute value
++     * gives the position of the bytecode instruction. This array is also used
++     * as a bitset to store the subroutines to which a basic block belongs. This
++     * information is needed in {@linked  MethodWriter#visitMaxs}, after all
++     * forward references have been resolved. Hence the same array can be used
++     * for both purposes without problems.
++     */
++    private int[] srcAndRefPositions;
++
++    // ------------------------------------------------------------------------
++
++    /*
++     * Fields for the control flow and data flow graph analysis algorithms (used
++     * to compute the maximum stack size or the stack map frames). A control
++     * flow graph contains one node per "basic block", and one edge per "jump"
++     * from one basic block to another. Each node (i.e., each basic block) is
++     * represented by the Label object that corresponds to the first instruction
++     * of this basic block. Each node also stores the list of its successors in
++     * the graph, as a linked list of Edge objects.
++     *
++     * The control flow analysis algorithms used to compute the maximum stack
++     * size or the stack map frames are similar and use two steps. The first
++     * step, during the visit of each instruction, builds information about the
++     * state of the local variables and the operand stack at the end of each
++     * basic block, called the "output frame", <i>relatively</i> to the frame
++     * state at the beginning of the basic block, which is called the "input
++     * frame", and which is <i>unknown</i> during this step. The second step,
++     * in {@link MethodWriter#visitMaxs}, is a fix point algorithm that
++     * computes information about the input frame of each basic block, from the
++     * input state of the first basic block (known from the method signature),
++     * and by the using the previously computed relative output frames.
++     *
++     * The algorithm used to compute the maximum stack size only computes the
++     * relative output and absolute input stack heights, while the algorithm
++     * used to compute stack map frames computes relative output frames and
++     * absolute input frames.
++     */
++
++    /**
++     * Start of the output stack relatively to the input stack. The exact
++     * semantics of this field depends on the algorithm that is used.
++     *
++     * When only the maximum stack size is computed, this field is the number of
++     * elements in the input stack.
++     *
++     * When the stack map frames are completely computed, this field is the
++     * offset of the first output stack element relatively to the top of the
++     * input stack. This offset is always negative or null. A null offset means
++     * that the output stack must be appended to the input stack. A -n offset
++     * means that the first n output stack elements must replace the top n input
++     * stack elements, and that the other elements must be appended to the input
++     * stack.
++     */
++    int inputStackTop;
++
++    /**
++     * Maximum height reached by the output stack, relatively to the top of the
++     * input stack. This maximum is always positive or null.
++     */
++    int outputStackMax;
++
++    /**
++     * Information about the input and output stack map frames of this basic
++     * block. This field is only used when {@link ClassWriter#COMPUTE_FRAMES}
++     * option is used.
++     */
++    Frame frame;
++
++    /**
++     * The successor of this label, in the order they are visited. This linked
++     * list does not include labels used for debug info only. If
++     * {@link ClassWriter#COMPUTE_FRAMES} option is used then, in addition, it
++     * does not contain successive labels that denote the same bytecode position
++     * (in this case only the first label appears in this list).
++     */
++    Label successor;
++
++    /**
++     * The successors of this node in the control flow graph. These successors
++     * are stored in a linked list of {@link Edge Edge} objects, linked to each
++     * other by their {@link Edge#next} field.
++     */
++    Edge successors;
++
++    /**
++     * The next basic block in the basic block stack. This stack is used in the
++     * main loop of the fix point algorithm used in the second step of the
++     * control flow analysis algorithms.
++     *
++     * @see MethodWriter#visitMaxs
++     */
++    Label next;
++
++    // ------------------------------------------------------------------------
++    // Constructor
++    // ------------------------------------------------------------------------
++
++    /**
++     * Constructs a new label.
++     */
++    public Label() {
++    }
++
++    // ------------------------------------------------------------------------
++    // Methods to compute offsets and to manage forward references
++    // ------------------------------------------------------------------------
++
++    /**
++     * Returns the offset corresponding to this label. This offset is computed
++     * from the start of the method's bytecode. <i>This method is intended for
++     * {@link Attribute} sub classes, and is normally not needed by class
++     * generators or adapters.</i>
++     *
++     * @return the offset corresponding to this label.
++     * @throws IllegalStateException if this label is not resolved yet.
++     */
++    public int getOffset() {
++        if ((status & RESOLVED) == 0) {
++            throw new IllegalStateException("Label offset position has not been resolved yet");
++        }
++        return position;
++    }
++
++    /**
++     * Puts a reference to this label in the bytecode of a method. If the
++     * position of the label is known, the offset is computed and written
++     * directly. Otherwise, a null offset is written and a new forward reference
++     * is declared for this label.
++     *
++     * @param owner the code writer that calls this method.
++     * @param out the bytecode of the method.
++     * @param source the position of first byte of the bytecode instruction that
++     *        contains this label.
++     * @param wideOffset <tt>true</tt> if the reference must be stored in 4
++     *        bytes, or <tt>false</tt> if it must be stored with 2 bytes.
++     * @throws IllegalArgumentException if this label has not been created by
++     *         the given code writer.
++     */
++    void put(
++        final MethodWriter owner,
++        final ByteVector out,
++        final int source,
++        final boolean wideOffset)
++    {
++        if ((status & RESOLVED) == 0) {
++            if (wideOffset) {
++                addReference(-1 - source, out.length);
++                out.putInt(-1);
++            } else {
++                addReference(source, out.length);
++                out.putShort(-1);
++            }
++        } else {
++            if (wideOffset) {
++                out.putInt(position - source);
++            } else {
++                out.putShort(position - source);
++            }
++        }
++    }
++
++    /**
++     * Adds a forward reference to this label. This method must be called only
++     * for a true forward reference, i.e. only if this label is not resolved
++     * yet. For backward references, the offset of the reference can be, and
++     * must be, computed and stored directly.
++     *
++     * @param sourcePosition the position of the referencing instruction. This
++     *        position will be used to compute the offset of this forward
++     *        reference.
++     * @param referencePosition the position where the offset for this forward
++     *        reference must be stored.
++     */
++    private void addReference(
++        final int sourcePosition,
++        final int referencePosition)
++    {
++        if (srcAndRefPositions == null) {
++            srcAndRefPositions = new int[6];
++        }
++        if (referenceCount >= srcAndRefPositions.length) {
++            int[] a = new int[srcAndRefPositions.length + 6];
++            System.arraycopy(srcAndRefPositions,
++                    0,
++                    a,
++                    0,
++                    srcAndRefPositions.length);
++            srcAndRefPositions = a;
++        }
++        srcAndRefPositions[referenceCount++] = sourcePosition;
++        srcAndRefPositions[referenceCount++] = referencePosition;
++    }
++
++    /**
++     * Resolves all forward references to this label. This method must be called
++     * when this label is added to the bytecode of the method, i.e. when its
++     * position becomes known. This method fills in the blanks that where left
++     * in the bytecode by each forward reference previously added to this label.
++     *
++     * @param owner the code writer that calls this method.
++     * @param position the position of this label in the bytecode.
++     * @param data the bytecode of the method.
++     * @return <tt>true</tt> if a blank that was left for this label was to
++     *         small to store the offset. In such a case the corresponding jump
++     *         instruction is replaced with a pseudo instruction (using unused
++     *         opcodes) using an unsigned two bytes offset. These pseudo
++     *         instructions will need to be replaced with true instructions with
++     *         wider offsets (4 bytes instead of 2). This is done in
++     *         {@link MethodWriter#resizeInstructions}.
++     * @throws IllegalArgumentException if this label has already been resolved,
++     *         or if it has not been created by the given code writer.
++     */
++    boolean resolve(
++        final MethodWriter owner,
++        final int position,
++        final byte[] data)
++    {
++        boolean needUpdate = false;
++        this.status |= RESOLVED;
++        this.position = position;
++        int i = 0;
++        while (i < referenceCount) {
++            int source = srcAndRefPositions[i++];
++            int reference = srcAndRefPositions[i++];
++            int offset;
++            if (source >= 0) {
++                offset = position - source;
++                if (offset < Short.MIN_VALUE || offset > Short.MAX_VALUE) {
++                    /*
++                     * changes the opcode of the jump instruction, in order to
++                     * be able to find it later (see resizeInstructions in
++                     * MethodWriter). These temporary opcodes are similar to
++                     * jump instruction opcodes, except that the 2 bytes offset
++                     * is unsigned (and can therefore represent values from 0 to
++                     * 65535, which is sufficient since the size of a method is
++                     * limited to 65535 bytes).
++                     */
++                    int opcode = data[reference - 1] & 0xFF;
++                    if (opcode <= Opcodes.JSR) {
++                        // changes IFEQ ... JSR to opcodes 202 to 217
++                        data[reference - 1] = (byte) (opcode + 49);
++                    } else {
++                        // changes IFNULL and IFNONNULL to opcodes 218 and 219
++                        data[reference - 1] = (byte) (opcode + 20);
++                    }
++                    needUpdate = true;
++                }
++                data[reference++] = (byte) (offset >>> 8);
++                data[reference] = (byte) offset;
++            } else {
++                offset = position + source + 1;
++                data[reference++] = (byte) (offset >>> 24);
++                data[reference++] = (byte) (offset >>> 16);
++                data[reference++] = (byte) (offset >>> 8);
++                data[reference] = (byte) offset;
++            }
++        }
++        return needUpdate;
++    }
++
++    /**
++     * Returns the first label of the series to which this label belongs. For an
++     * isolated label or for the first label in a series of successive labels,
++     * this method returns the label itself. For other labels it returns the
++     * first label of the series.
++     *
++     * @return the first label of the series to which this label belongs.
++     */
++    Label getFirst() {
++        return !ClassReader.FRAMES || frame == null ? this : frame.owner;
++    }
++
++    // ------------------------------------------------------------------------
++    // Methods related to subroutines
++    // ------------------------------------------------------------------------
++
++    /**
++     * Returns true is this basic block belongs to the given subroutine.
++     *
++     * @param id a subroutine id.
++     * @return true is this basic block belongs to the given subroutine.
++     */
++    boolean inSubroutine(final long id) {
++        if ((status & Label.VISITED) != 0) {
++            return (srcAndRefPositions[(int) (id >>> 32)] & (int) id) != 0;
++        }
++        return false;
++    }
++
++    /**
++     * Returns true if this basic block and the given one belong to a common
++     * subroutine.
++     *
++     * @param block another basic block.
++     * @return true if this basic block and the given one belong to a common
++     *         subroutine.
++     */
++    boolean inSameSubroutine(final Label block) {
++        for (int i = 0; i < srcAndRefPositions.length; ++i) {
++            if ((srcAndRefPositions[i] & block.srcAndRefPositions[i]) != 0) {
++                return true;
++            }
++        }
++        return false;
++    }
++
++    /**
++     * Marks this basic block as belonging to the given subroutine.
++     *
++     * @param id a subroutine id.
++     * @param nbSubroutines the total number of subroutines in the method.
++     */
++    void addToSubroutine(final long id, final int nbSubroutines) {
++        if ((status & VISITED) == 0) {
++            status |= VISITED;
++            srcAndRefPositions = new int[(nbSubroutines - 1) / 32 + 1];
++        }
++        srcAndRefPositions[(int) (id >>> 32)] |= (int) id;
++    }
++
++    /**
++     * Finds the basic blocks that belong to a given subroutine, and marks these
++     * blocks as belonging to this subroutine. This recursive method follows the
++     * control flow graph to find all the blocks that are reachable from the
++     * current block WITHOUT following any JSR target.
++     *
++     * @param JSR a JSR block that jumps to this subroutine. If this JSR is not
++     *        null it is added to the successor of the RET blocks found in the
++     *        subroutine.
++     * @param id the id of this subroutine.
++     * @param nbSubroutines the total number of subroutines in the method.
++     */
++    void visitSubroutine(final Label JSR, final long id, final int nbSubroutines)
++    {
++        if (JSR != null) {
++            if ((status & VISITED) != 0) {
++                return;
++            }
++            status |= VISITED;
++            // adds JSR to the successors of this block, if it is a RET block
++            if ((status & RET) != 0) {
++                if (!inSameSubroutine(JSR)) {
++                    Edge e = new Edge();
++                    e.info = inputStackTop;
++                    e.successor = JSR.successors.successor;
++                    e.next = successors;
++                    successors = e;
++                }
++            }
++        } else {
++            // if this block already belongs to subroutine 'id', returns
++            if (inSubroutine(id)) {
++                return;
++            }
++            // marks this block as belonging to subroutine 'id'
++            addToSubroutine(id, nbSubroutines);
++        }
++        // calls this method recursively on each successor, except JSR targets
++        Edge e = successors;
++        while (e != null) {
++            // if this block is a JSR block, then 'successors.next' leads
++            // to the JSR target (see {@link #visitJumpInsn}) and must therefore
++            // not be followed
++            if ((status & Label.JSR) == 0 || e != successors.next) {
++                e.successor.visitSubroutine(JSR, id, nbSubroutines);
++            }
++            e = e.next;
++        }
++    }
++
++    // ------------------------------------------------------------------------
++    // Overriden Object methods
++    // ------------------------------------------------------------------------
++
++    /**
++     * Returns a string representation of this label.
++     *
++     * @return a string representation of this label.
++     */
++    public String toString() {
++        return "L" + System.identityHashCode(this);
++    }
++}
+--- /dev/null	Thu Jul 30 19:03:36 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/org/objectweb/asm/MethodVisitor.java	Thu Jul 30 19:03:35 2009
+@@ -0,0 +1,425 @@
++/*
++ * Copyright 2005-2009 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++
++/*
++ * This file is available under and governed by the GNU General Public
++ * License version 2 only, as published by the Free Software Foundation.
++ * However, the following notice accompanied the original version of this
++ * file:
++ *
++ * ASM: a very small and fast Java bytecode manipulation framework
++ * Copyright (c) 2000-2007 INRIA, France Telecom
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ *    notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ *    notice, this list of conditions and the following disclaimer in the
++ *    documentation and/or other materials provided with the distribution.
++ * 3. Neither the name of the copyright holders nor the names of its
++ *    contributors may be used to endorse or promote products derived from
++ *    this software without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
++ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
++ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
++ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
++ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
++ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
++ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
++ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
++ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
++ * THE POSSIBILITY OF SUCH DAMAGE.
++ */
++package com.sun.xml.internal.ws.org.objectweb.asm;
++
++/**
++ * A visitor to visit a Java method. The methods of this interface must be
++ * called in the following order: [ <tt>visitAnnotationDefault</tt> ] (
++ * <tt>visitAnnotation</tt> | <tt>visitParameterAnnotation</tt> |
++ * <tt>visitAttribute</tt> )* [ <tt>visitCode</tt> ( <tt>visitFrame</tt> |
++ * <tt>visit</tt><i>X</i>Insn</tt> | <tt>visitLabel</tt> | <tt>visitTryCatchBlock</tt> |
++ * <tt>visitLocalVariable</tt> | <tt>visitLineNumber</tt>)* <tt>visitMaxs</tt> ]
++ * <tt>visitEnd</tt>. In addition, the <tt>visit</tt><i>X</i>Insn</tt>
++ * and <tt>visitLabel</tt> methods must be called in the sequential order of
++ * the bytecode instructions of the visited code, <tt>visitTryCatchBlock</tt>
++ * must be called <i>before</i> the labels passed as arguments have been
++ * visited, and the <tt>visitLocalVariable</tt> and <tt>visitLineNumber</tt>
++ * methods must be called <i>after</i> the labels passed as arguments have been
++ * visited.
++ *
++ * @author Eric Bruneton
++ */
++public interface MethodVisitor {
++
++    // -------------------------------------------------------------------------
++    // Annotations and non standard attributes
++    // -------------------------------------------------------------------------
++
++    /**
++     * Visits the default value of this annotation interface method.
++     *
++     * @return a visitor to the visit the actual default value of this
++     *         annotation interface method, or <tt>null</tt> if this visitor
++     *         is not interested in visiting this default value. The 'name'
++     *         parameters passed to the methods of this annotation visitor are
++     *         ignored. Moreover, exacly one visit method must be called on this
++     *         annotation visitor, followed by visitEnd.
++     */
++    AnnotationVisitor visitAnnotationDefault();
++
++    /**
++     * Visits an annotation of this method.
++     *
++     * @param desc the class descriptor of the annotation class.
++     * @param visible <tt>true</tt> if the annotation is visible at runtime.
++     * @return a visitor to visit the annotation values, or <tt>null</tt> if
++     *         this visitor is not interested in visiting this annotation.
++     */
++    AnnotationVisitor visitAnnotation(String desc, boolean visible);
++
++    /**
++     * Visits an annotation of a parameter this method.
++     *
++     * @param parameter the parameter index.
++     * @param desc the class descriptor of the annotation class.
++     * @param visible <tt>true</tt> if the annotation is visible at runtime.
++     * @return a visitor to visit the annotation values, or <tt>null</tt> if
++     *         this visitor is not interested in visiting this annotation.
++     */
++    AnnotationVisitor visitParameterAnnotation(
++        int parameter,
++        String desc,
++        boolean visible);
++
++    /**
++     * Visits a non standard attribute of this method.
++     *
++     * @param attr an attribute.
++     */
++    void visitAttribute(Attribute attr);
++
++    /**
++     * Starts the visit of the method's code, if any (i.e. non abstract method).
++     */
++    void visitCode();
++
++    /**
++     * Visits the current state of the local variables and operand stack
++     * elements. This method must(*) be called <i>just before</i> any
++     * instruction <b>i</b> that follows an unconditionnal branch instruction
++     * such as GOTO or THROW, that is the target of a jump instruction, or that
++     * starts an exception handler block. The visited types must describe the
++     * values of the local variables and of the operand stack elements <i>just
++     * before</i> <b>i</b> is executed. <br> <br> (*) this is mandatory only
++     * for classes whose version is greater than or equal to
++     * {@link Opcodes#V1_6 V1_6}. <br> <br> Packed frames are basically
++     * "deltas" from the state of the previous frame (very first frame is
++     * implicitly defined by the method's parameters and access flags): <ul>
++     * <li>{@link Opcodes#F_SAME} representing frame with exactly the same
++     * locals as the previous frame and with the empty stack.</li> <li>{@link Opcodes#F_SAME1}
++     * representing frame with exactly the same locals as the previous frame and
++     * with single value on the stack (<code>nStack</code> is 1 and
++     * <code>stack[0]</code> contains value for the type of the stack item).</li>
++     * <li>{@link Opcodes#F_APPEND} representing frame with current locals are
++     * the same as the locals in the previous frame, except that additional
++     * locals are defined (<code>nLocal</code> is 1, 2 or 3 and
++     * <code>local</code> elements contains values representing added types).</li>
++     * <li>{@link Opcodes#F_CHOP} representing frame with current locals are
++     * the same as the locals in the previous frame, except that the last 1-3
++     * locals are absent and with the empty stack (<code>nLocals</code> is 1,
++     * 2 or 3). </li> <li>{@link Opcodes#F_FULL} representing complete frame
++     * data.</li> </li> </ul>
++     *
++     * @param type the type of this stack map frame. Must be
++     *        {@link Opcodes#F_NEW} for expanded frames, or
++     *        {@link Opcodes#F_FULL}, {@link Opcodes#F_APPEND},
++     *        {@link Opcodes#F_CHOP}, {@link Opcodes#F_SAME} or
++     *        {@link Opcodes#F_APPEND}, {@link Opcodes#F_SAME1} for compressed
++     *        frames.
++     * @param nLocal the number of local variables in the visited frame.
++     * @param local the local variable types in this frame. This array must not
++     *        be modified. Primitive types are represented by
++     *        {@link Opcodes#TOP}, {@link Opcodes#INTEGER},
++     *        {@link Opcodes#FLOAT}, {@link Opcodes#LONG},
++     *        {@link Opcodes#DOUBLE},{@link Opcodes#NULL} or
++     *        {@link Opcodes#UNINITIALIZED_THIS} (long and double are
++     *        represented by a single element). Reference types are represented
++     *        by String objects (representing internal names), and uninitialized
++     *        types by Label objects (this label designates the NEW instruction
++     *        that created this uninitialized value).
++     * @param nStack the number of operand stack elements in the visited frame.
++     * @param stack the operand stack types in this frame. This array must not
++     *        be modified. Its content has the same format as the "local" array.
++     */
++    void visitFrame(
++        int type,
++        int nLocal,
++        Object[] local,
++        int nStack,
++        Object[] stack);
++
++    // -------------------------------------------------------------------------
++    // Normal instructions
++    // -------------------------------------------------------------------------
++
++    /**
++     * Visits a zero operand instruction.
++     *
++     * @param opcode the opcode of the instruction to be visited. This opcode is
++     *        either NOP, ACONST_NULL, ICONST_M1, ICONST_0, ICONST_1, ICONST_2,
++     *        ICONST_3, ICONST_4, ICONST_5, LCONST_0, LCONST_1, FCONST_0,
++     *        FCONST_1, FCONST_2, DCONST_0, DCONST_1, IALOAD, LALOAD, FALOAD,
++     *        DALOAD, AALOAD, BALOAD, CALOAD, SALOAD, IASTORE, LASTORE, FASTORE,
++     *        DASTORE, AASTORE, BASTORE, CASTORE, SASTORE, POP, POP2, DUP,
++     *        DUP_X1, DUP_X2, DUP2, DUP2_X1, DUP2_X2, SWAP, IADD, LADD, FADD,
++     *        DADD, ISUB, LSUB, FSUB, DSUB, IMUL, LMUL, FMUL, DMUL, IDIV, LDIV,
++     *        FDIV, DDIV, IREM, LREM, FREM, DREM, INEG, LNEG, FNEG, DNEG, ISHL,
++     *        LSHL, ISHR, LSHR, IUSHR, LUSHR, IAND, LAND, IOR, LOR, IXOR, LXOR,
++     *        I2L, I2F, I2D, L2I, L2F, L2D, F2I, F2L, F2D, D2I, D2L, D2F, I2B,
++     *        I2C, I2S, LCMP, FCMPL, FCMPG, DCMPL, DCMPG, IRETURN, LRETURN,
++     *        FRETURN, DRETURN, ARETURN, RETURN, ARRAYLENGTH, ATHROW,
++     *        MONITORENTER, or MONITOREXIT.
++     */
++    void visitInsn(int opcode);
++
++    /**
++     * Visits an instruction with a single int operand.
++     *
++     * @param opcode the opcode of the instruction to be visited. This opcode is
++     *        either BIPUSH, SIPUSH or NEWARRAY.
++     * @param operand the operand of the instruction to be visited.<br> When
++     *        opcode is BIPUSH, operand value should be between Byte.MIN_VALUE
++     *        and Byte.MAX_VALUE.<br> When opcode is SIPUSH, operand value
++     *        should be between Short.MIN_VALUE and Short.MAX_VALUE.<br> When
++     *        opcode is NEWARRAY, operand value should be one of
++     *        {@link Opcodes#T_BOOLEAN}, {@link Opcodes#T_CHAR},
++     *        {@link Opcodes#T_FLOAT}, {@link Opcodes#T_DOUBLE},
++     *        {@link Opcodes#T_BYTE}, {@link Opcodes#T_SHORT},
++     *        {@link Opcodes#T_INT} or {@link Opcodes#T_LONG}.
++     */
++    void visitIntInsn(int opcode, int operand);
++
++    /**
++     * Visits a local variable instruction. A local variable instruction is an
++     * instruction that loads or stores the value of a local variable.
++     *
++     * @param opcode the opcode of the local variable instruction to be visited.
++     *        This opcode is either ILOAD, LLOAD, FLOAD, DLOAD, ALOAD, ISTORE,
++     *        LSTORE, FSTORE, DSTORE, ASTORE or RET.
++     * @param var the operand of the instruction to be visited. This operand is
++     *        the index of a local variable.
++     */
++    void visitVarInsn(int opcode, int var);
++
++    /**
++     * Visits a type instruction. A type instruction is an instruction that
++     * takes the internal name of a class as parameter.
++     *
++     * @param opcode the opcode of the type instruction to be visited. This
++     *        opcode is either NEW, ANEWARRAY, CHECKCAST or INSTANCEOF.
++     * @param type the operand of the instruction to be visited. This operand
++     *        must be the internal name of an object or array class (see {@link
++     *        Type#getInternalName() getInternalName}).
++     */
++    void visitTypeInsn(int opcode, String type);
++
++    /**
++     * Visits a field instruction. A field instruction is an instruction that
++     * loads or stores the value of a field of an object.
++     *
++     * @param opcode the opcode of the type instruction to be visited. This
++     *        opcode is either GETSTATIC, PUTSTATIC, GETFIELD or PUTFIELD.
++     * @param owner the internal name of the field's owner class (see {@link
++     *        Type#getInternalName() getInternalName}).
++     * @param name the field's name.
++     * @param desc the field's descriptor (see {@link Type Type}).
++     */
++    void visitFieldInsn(int opcode, String owner, String name, String desc);
++
++    /**
++     * Visits a method instruction. A method instruction is an instruction that
++     * invokes a method.
++     *
++     * @param opcode the opcode of the type instruction to be visited. This
++     *        opcode is either INVOKEVIRTUAL, INVOKESPECIAL, INVOKESTATIC or
++     *        INVOKEINTERFACE.
++     * @param owner the internal name of the method's owner class (see {@link
++     *        Type#getInternalName() getInternalName}).
++     * @param name the method's name.
++     * @param desc the method's descriptor (see {@link Type Type}).
++     */
++    void visitMethodInsn(int opcode, String owner, String name, String desc);
++
++    /**
++     * Visits a jump instruction. A jump instruction is an instruction that may
++     * jump to another instruction.
++     *
++     * @param opcode the opcode of the type instruction to be visited. This
++     *        opcode is either IFEQ, IFNE, IFLT, IFGE, IFGT, IFLE, IF_ICMPEQ,
++     *        IF_ICMPNE, IF_ICMPLT, IF_ICMPGE, IF_ICMPGT, IF_ICMPLE, IF_ACMPEQ,
++     *        IF_ACMPNE, GOTO, JSR, IFNULL or IFNONNULL.
++     * @param label the operand of the instruction to be visited. This operand
++     *        is a label that designates the instruction to which the jump
++     *        instruction may jump.
++     */
++    void visitJumpInsn(int opcode, Label label);
++
++    /**
++     * Visits a label. A label designates the instruction that will be visited
++     * just after it.
++     *
++     * @param label a {@link Label Label} object.
++     */
++    void visitLabel(Label label);
++
++    // -------------------------------------------------------------------------
++    // Special instructions
++    // -------------------------------------------------------------------------
++
++    /**
++     * Visits a LDC instruction.
++     *
++     * @param cst the constant to be loaded on the stack. This parameter must be
++     *        a non null {@link Integer}, a {@link Float}, a {@link Long}, a
++     *        {@link Double} a {@link String} (or a {@link Type} for
++     *        <tt>.class</tt> constants, for classes whose version is 49.0 or
++     *        more).
++     */
++    void visitLdcInsn(Object cst);
++
++    /**
++     * Visits an IINC instruction.
++     *
++     * @param var index of the local variable to be incremented.
++     * @param increment amount to increment the local variable by.
++     */
++    void visitIincInsn(int var, int increment);
++
++    /**
++     * Visits a TABLESWITCH instruction.
++     *
++     * @param min the minimum key value.
++     * @param max the maximum key value.
++     * @param dflt beginning of the default handler block.
++     * @param labels beginnings of the handler blocks. <tt>labels[i]</tt> is
++     *        the beginning of the handler block for the <tt>min + i</tt> key.
++     */
++    void visitTableSwitchInsn(int min, int max, Label dflt, Label[] labels);
++
++    /**
++     * Visits a LOOKUPSWITCH instruction.
++     *
++     * @param dflt beginning of the default handler block.
++     * @param keys the values of the keys.
++     * @param labels beginnings of the handler blocks. <tt>labels[i]</tt> is
++     *        the beginning of the handler block for the <tt>keys[i]</tt> key.
++     */
++    void visitLookupSwitchInsn(Label dflt, int[] keys, Label[] labels);
++
++    /**
++     * Visits a MULTIANEWARRAY instruction.
++     *
++     * @param desc an array type descriptor (see {@link Type Type}).
++     * @param dims number of dimensions of the array to allocate.
++     */
++    void visitMultiANewArrayInsn(String desc, int dims);
++
++    // -------------------------------------------------------------------------
++    // Exceptions table entries, debug information, max stack and max locals
++    // -------------------------------------------------------------------------
++
++    /**
++     * Visits a try catch block.
++     *
++     * @param start beginning of the exception handler's scope (inclusive).
++     * @param end end of the exception handler's scope (exclusive).
++     * @param handler beginning of the exception handler's code.
++     * @param type internal name of the type of exceptions handled by the
++     *        handler, or <tt>null</tt> to catch any exceptions (for "finally"
++     *        blocks).
++     * @throws IllegalArgumentException if one of the labels has already been
++     *         visited by this visitor (by the {@link #visitLabel visitLabel}
++     *         method).
++     */
++    void visitTryCatchBlock(Label start, Label end, Label handler, String type);
++
++    /**
++     * Visits a local variable declaration.
++     *
++     * @param name the name of a local variable.
++     * @param desc the type descriptor of this local variable.
++     * @param signature the type signature of this local variable. May be
++     *        <tt>null</tt> if the local variable type does not use generic
++     *        types.
++     * @param start the first instruction corresponding to the scope of this
++     *        local variable (inclusive).
++     * @param end the last instruction corresponding to the scope of this local
++     *        variable (exclusive).
++     * @param index the local variable's index.
++     * @throws IllegalArgumentException if one of the labels has not already
++     *         been visited by this visitor (by the
++     *         {@link #visitLabel visitLabel} method).
++     */
++    void visitLocalVariable(
++        String name,
++        String desc,
++        String signature,
++        Label start,
++        Label end,
++        int index);
++
++    /**
++     * Visits a line number declaration.
++     *
++     * @param line a line number. This number refers to the source file from
++     *        which the class was compiled.
++     * @param start the first instruction corresponding to this line number.
++     * @throws IllegalArgumentException if <tt>start</tt> has not already been
++     *         visited by this visitor (by the {@link #visitLabel visitLabel}
++     *         method).
++     */
++    void visitLineNumber(int line, Label start);
++
++    /**
++     * Visits the maximum stack size and the maximum number of local variables
++     * of the method.
++     *
++     * @param maxStack maximum stack size of the method.
++     * @param maxLocals maximum number of local variables for the method.
++     */
++    void visitMaxs(int maxStack, int maxLocals);
++
++    /**
++     * Visits the end of the method. This method, which is the last one to be
++     * called, is used to inform the visitor that all the annotations and
++     * attributes of the method have been visited.
++     */
++    void visitEnd();
++}
+--- /dev/null	Thu Jul 30 19:03:39 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/org/objectweb/asm/MethodWriter.java	Thu Jul 30 19:03:38 2009
+@@ -0,0 +1,2631 @@
++/*
++ * Copyright 2005-2009 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++
++/*
++ * This file is available under and governed by the GNU General Public
++ * License version 2 only, as published by the Free Software Foundation.
++ * However, the following notice accompanied the original version of this
++ * file:
++ *
++ * ASM: a very small and fast Java bytecode manipulation framework
++ * Copyright (c) 2000-2007 INRIA, France Telecom
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ *    notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ *    notice, this list of conditions and the following disclaimer in the
++ *    documentation and/or other materials provided with the distribution.
++ * 3. Neither the name of the copyright holders nor the names of its
++ *    contributors may be used to endorse or promote products derived from
++ *    this software without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
++ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
++ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
++ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
++ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
++ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
++ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
++ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
++ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
++ * THE POSSIBILITY OF SUCH DAMAGE.
++ */
++package com.sun.xml.internal.ws.org.objectweb.asm;
++
++/**
++ * A {@link MethodVisitor} that generates methods in bytecode form. Each visit
++ * method of this class appends the bytecode corresponding to the visited
++ * instruction to a byte vector, in the order these methods are called.
++ *
++ * @author Eric Bruneton
++ * @author Eugene Kuleshov
++ */
++class MethodWriter implements MethodVisitor {
++
++    /**
++     * Pseudo access flag used to denote constructors.
++     */
++    static final int ACC_CONSTRUCTOR = 262144;
++
++    /**
++     * Frame has exactly the same locals as the previous stack map frame and
++     * number of stack items is zero.
++     */
++    static final int SAME_FRAME = 0; // to 63 (0-3f)
++
++    /**
++     * Frame has exactly the same locals as the previous stack map frame and
++     * number of stack items is 1
++     */
++    static final int SAME_LOCALS_1_STACK_ITEM_FRAME = 64; // to 127 (40-7f)
++
++    /**
++     * Reserved for future use
++     */
++    static final int RESERVED = 128;
++
++    /**
++     * Frame has exactly the same locals as the previous stack map frame and
++     * number of stack items is 1. Offset is bigger then 63;
++     */
++    static final int SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED = 247; // f7
++
++    /**
++     * Frame where current locals are the same as the locals in the previous
++     * frame, except that the k last locals are absent. The value of k is given
++     * by the formula 251-frame_type.
++     */
++    static final int CHOP_FRAME = 248; // to 250 (f8-fA)
++
++    /**
++     * Frame has exactly the same locals as the previous stack map frame and
++     * number of stack items is zero. Offset is bigger then 63;
++     */
++    static final int SAME_FRAME_EXTENDED = 251; // fb
++
++    /**
++     * Frame where current locals are the same as the locals in the previous
++     * frame, except that k additional locals are defined. The value of k is
++     * given by the formula frame_type-251.
++     */
++    static final int APPEND_FRAME = 252; // to 254 // fc-fe
++
++    /**
++     * Full frame
++     */
++    static final int FULL_FRAME = 255; // ff
++
++    /**
++     * Indicates that the stack map frames must be recomputed from scratch. In
++     * this case the maximum stack size and number of local variables is also
++     * recomputed from scratch.
++     *
++     * @see #compute
++     */
++    private static final int FRAMES = 0;
++
++    /**
++     * Indicates that the maximum stack size and number of local variables must
++     * be automatically computed.
++     *
++     * @see #compute
++     */
++    private static final int MAXS = 1;
++
++    /**
++     * Indicates that nothing must be automatically computed.
++     *
++     * @see #compute
++     */
++    private static final int NOTHING = 2;
++
++    /**
++     * Next method writer (see {@link ClassWriter#firstMethod firstMethod}).
++     */
++    MethodWriter next;
++
++    /**
++     * The class writer to which this method must be added.
++     */
++    final ClassWriter cw;
++
++    /**
++     * Access flags of this method.
++     */
++    private int access;
++
++    /**
++     * The index of the constant pool item that contains the name of this
++     * method.
++     */
++    private final int name;
++
++    /**
++     * The index of the constant pool item that contains the descriptor of this
++     * method.
++     */
++    private final int desc;
++
++    /**
++     * The descriptor of this method.
++     */
++    private final String descriptor;
++
++    /**
++     * The signature of this method.
++     */
++    String signature;
++
++    /**
++     * If not zero, indicates that the code of this method must be copied from
++     * the ClassReader associated to this writer in <code>cw.cr</code>. More
++     * precisely, this field gives the index of the first byte to copied from
++     * <code>cw.cr.b</code>.
++     */
++    int classReaderOffset;
++
++    /**
++     * If not zero, indicates that the code of this method must be copied from
++     * the ClassReader associated to this writer in <code>cw.cr</code>. More
++     * precisely, this field gives the number of bytes to copied from
++     * <code>cw.cr.b</code>.
++     */
++    int classReaderLength;
++
++    /**
++     * Number of exceptions that can be thrown by this method.
++     */
++    int exceptionCount;
++
++    /**
++     * The exceptions that can be thrown by this method. More precisely, this
++     * array contains the indexes of the constant pool items that contain the
++     * internal names of these exception classes.
++     */
++    int[] exceptions;
++
++    /**
++     * The annotation default attribute of this method. May be <tt>null</tt>.
++     */
++    private ByteVector annd;
++
++    /**
++     * The runtime visible annotations of this method. May be <tt>null</tt>.
++     */
++    private AnnotationWriter anns;
++
++    /**
++     * The runtime invisible annotations of this method. May be <tt>null</tt>.
++     */
++    private AnnotationWriter ianns;
++
++    /**
++     * The runtime visible parameter annotations of this method. May be
++     * <tt>null</tt>.
++     */
++    private AnnotationWriter[] panns;
++
++    /**
++     * The runtime invisible parameter annotations of this method. May be
++     * <tt>null</tt>.
++     */
++    private AnnotationWriter[] ipanns;
++
++    /**
++     * The number of synthetic parameters of this method.
++     */
++    private int synthetics;
++
++    /**
++     * The non standard attributes of the method.
++     */
++    private Attribute attrs;
++
++    /**
++     * The bytecode of this method.
++     */
++    private ByteVector code = new ByteVector();
++
++    /**
++     * Maximum stack size of this method.
++     */
++    private int maxStack;
++
++    /**
++     * Maximum number of local variables for this method.
++     */
++    private int maxLocals;
++
++    /**
++     * Number of stack map frames in the StackMapTable attribute.
++     */
++    private int frameCount;
++
++    /**
++     * The StackMapTable attribute.
++     */
++    private ByteVector stackMap;
++
++    /**
++     * The offset of the last frame that was written in the StackMapTable
++     * attribute.
++     */
++    private int previousFrameOffset;
++
++    /**
++     * The last frame that was written in the StackMapTable attribute.
++     *
++     * @see #frame
++     */
++    private int[] previousFrame;
++
++    /**
++     * Index of the next element to be added in {@link #frame}.
++     */
++    private int frameIndex;
++
++    /**
++     * The current stack map frame. The first element contains the offset of the
++     * instruction to which the frame corresponds, the second element is the
++     * number of locals and the third one is the number of stack elements. The
++     * local variables start at index 3 and are followed by the operand stack
++     * values. In summary frame[0] = offset, frame[1] = nLocal, frame[2] =
++     * nStack, frame[3] = nLocal. All types are encoded as integers, with the
++     * same format as the one used in {@link Label}, but limited to BASE types.
++     */
++    private int[] frame;
++
++    /**
++     * Number of elements in the exception handler list.
++     */
++    private int handlerCount;
++
++    /**
++     * The first element in the exception handler list.
++     */
++    private Handler firstHandler;
++
++    /**
++     * The last element in the exception handler list.
++     */
++    private Handler lastHandler;
++
++    /**
++     * Number of entries in the LocalVariableTable attribute.
++     */
++    private int localVarCount;
++
++    /**
++     * The LocalVariableTable attribute.
++     */
++    private ByteVector localVar;
++
++    /**
++     * Number of entries in the LocalVariableTypeTable attribute.
++     */
++    private int localVarTypeCount;
++
++    /**
++     * The LocalVariableTypeTable attribute.
++     */
++    private ByteVector localVarType;
++
++    /**
++     * Number of entries in the LineNumberTable attribute.
++     */
++    private int lineNumberCount;
++
++    /**
++     * The LineNumberTable attribute.
++     */
++    private ByteVector lineNumber;
++
++    /**
++     * The non standard attributes of the method's code.
++     */
++    private Attribute cattrs;
++
++    /**
++     * Indicates if some jump instructions are too small and need to be resized.
++     */
++    private boolean resize;
++
++    /**
++     * The number of subroutines in this method.
++     */
++    private int subroutines;
++
++    // ------------------------------------------------------------------------
++
++    /*
++     * Fields for the control flow graph analysis algorithm (used to compute the
++     * maximum stack size). A control flow graph contains one node per "basic
++     * block", and one edge per "jump" from one basic block to another. Each
++     * node (i.e., each basic block) is represented by the Label object that
++     * corresponds to the first instruction of this basic block. Each node also
++     * stores the list of its successors in the graph, as a linked list of Edge
++     * objects.
++     */
++
++    /**
++     * Indicates what must be automatically computed.
++     *
++     * @see #FRAMES
++     * @see #MAXS
++     * @see #NOTHING
++     */
++    private final int compute;
++
++    /**
++     * A list of labels. This list is the list of basic blocks in the method,
++     * i.e. a list of Label objects linked to each other by their
++     * {@link Label#successor} field, in the order they are visited by
++     * {@link MethodVisitor#visitLabel}, and starting with the first basic block.
++     */
++    private Label labels;
++
++    /**
++     * The previous basic block.
++     */
++    private Label previousBlock;
++
++    /**
++     * The current basic block.
++     */
++    private Label currentBlock;
++
++    /**
++     * The (relative) stack size after the last visited instruction. This size
++     * is relative to the beginning of the current basic block, i.e., the true
++     * stack size after the last visited instruction is equal to the
++     * {@link Label#inputStackTop beginStackSize} of the current basic block
++     * plus <tt>stackSize</tt>.
++     */
++    private int stackSize;
++
++    /**
++     * The (relative) maximum stack size after the last visited instruction.
++     * This size is relative to the beginning of the current basic block, i.e.,
++     * the true maximum stack size after the last visited instruction is equal
++     * to the {@link Label#inputStackTop beginStackSize} of the current basic
++     * block plus <tt>stackSize</tt>.
++     */
++    private int maxStackSize;
++
++    // ------------------------------------------------------------------------
++    // Constructor
++    // ------------------------------------------------------------------------
++
++    /**
++     * Constructs a new {@link MethodWriter}.
++     *
++     * @param cw the class writer in which the method must be added.
++     * @param access the method's access flags (see {@link Opcodes}).
++     * @param name the method's name.
++     * @param desc the method's descriptor (see {@link Type}).
++     * @param signature the method's signature. May be <tt>null</tt>.
++     * @param exceptions the internal names of the method's exceptions. May be
++     *        <tt>null</tt>.
++     * @param computeMaxs <tt>true</tt> if the maximum stack size and number
++     *        of local variables must be automatically computed.
++     * @param computeFrames <tt>true</tt> if the stack map tables must be
++     *        recomputed from scratch.
++     */
++    MethodWriter(
++        final ClassWriter cw,
++        final int access,
++        final String name,
++        final String desc,
++        final String signature,
++        final String[] exceptions,
++        final boolean computeMaxs,
++        final boolean computeFrames)
++    {
++        if (cw.firstMethod == null) {
++            cw.firstMethod = this;
++        } else {
++            cw.lastMethod.next = this;
++        }
++        cw.lastMethod = this;
++        this.cw = cw;
++        this.access = access;
++        this.name = cw.newUTF8(name);
++        this.desc = cw.newUTF8(desc);
++        this.descriptor = desc;
++        if (ClassReader.SIGNATURES) {
++            this.signature = signature;
++        }
++        if (exceptions != null && exceptions.length > 0) {
++            exceptionCount = exceptions.length;
++            this.exceptions = new int[exceptionCount];
++            for (int i = 0; i < exceptionCount; ++i) {
++                this.exceptions[i] = cw.newClass(exceptions[i]);
++            }
++        }
++        this.compute = computeFrames ? FRAMES : (computeMaxs ? MAXS : NOTHING);
++        if (computeMaxs || computeFrames) {
++            if (computeFrames && "<init>".equals(name)) {
++                this.access |= ACC_CONSTRUCTOR;
++            }
++            // updates maxLocals
++            int size = getArgumentsAndReturnSizes(descriptor) >> 2;
++            if ((access & Opcodes.ACC_STATIC) != 0) {
++                --size;
++            }
++            maxLocals = size;
++            // creates and visits the label for the first basic block
++            labels = new Label();
++            labels.status |= Label.PUSHED;
++            visitLabel(labels);
++        }
++    }
++
++    // ------------------------------------------------------------------------
++    // Implementation of the MethodVisitor interface
++    // ------------------------------------------------------------------------
++
++    public AnnotationVisitor visitAnnotationDefault() {
++        if (!ClassReader.ANNOTATIONS) {
++            return null;
++        }
++        annd = new ByteVector();
++        return new AnnotationWriter(cw, false, annd, null, 0);
++    }
++
++    public AnnotationVisitor visitAnnotation(
++        final String desc,
++        final boolean visible)
++    {
++        if (!ClassReader.ANNOTATIONS) {
++            return null;
++        }
++        ByteVector bv = new ByteVector();
++        // write type, and reserve space for values count
++        bv.putShort(cw.newUTF8(desc)).putShort(0);
++        AnnotationWriter aw = new AnnotationWriter(cw, true, bv, bv, 2);
++        if (visible) {
++            aw.next = anns;
++            anns = aw;
++        } else {
++            aw.next = ianns;
++            ianns = aw;
++        }
++        return aw;
++    }
++
++    public AnnotationVisitor visitParameterAnnotation(
++        final int parameter,
++        final String desc,
++        final boolean visible)
++    {
++        if (!ClassReader.ANNOTATIONS) {
++            return null;
++        }
++        ByteVector bv = new ByteVector();
++        if ("Ljava/lang/Synthetic;".equals(desc)) {
++            // workaround for a bug in javac with synthetic parameters
++            // see ClassReader.readParameterAnnotations
++            synthetics = Math.max(synthetics, parameter + 1);
++            return new AnnotationWriter(cw, false, bv, null, 0);
++        }
++        // write type, and reserve space for values count
++        bv.putShort(cw.newUTF8(desc)).putShort(0);
++        AnnotationWriter aw = new AnnotationWriter(cw, true, bv, bv, 2);
++        if (visible) {
++            if (panns == null) {
++                panns = new AnnotationWriter[Type.getArgumentTypes(descriptor).length];
++            }
++            aw.next = panns[parameter];
++            panns[parameter] = aw;
++        } else {
++            if (ipanns == null) {
++                ipanns = new AnnotationWriter[Type.getArgumentTypes(descriptor).length];
++            }
++            aw.next = ipanns[parameter];
++            ipanns[parameter] = aw;
++        }
++        return aw;
++    }
++
++    public void visitAttribute(final Attribute attr) {
++        if (attr.isCodeAttribute()) {
++            attr.next = cattrs;
++            cattrs = attr;
++        } else {
++            attr.next = attrs;
++            attrs = attr;
++        }
++    }
++
++    public void visitCode() {
++    }
++
++    public void visitFrame(
++        final int type,
++        final int nLocal,
++        final Object[] local,
++        final int nStack,
++        final Object[] stack)
++    {
++        if (!ClassReader.FRAMES || compute == FRAMES) {
++            return;
++        }
++
++        if (type == Opcodes.F_NEW) {
++            startFrame(code.length, nLocal, nStack);
++            for (int i = 0; i < nLocal; ++i) {
++                if (local[i] instanceof String) {
++                    frame[frameIndex++] = Frame.OBJECT
++                            | cw.addType((String) local[i]);
++                } else if (local[i] instanceof Integer) {
++                    frame[frameIndex++] = ((Integer) local[i]).intValue();
++                } else {
++                    frame[frameIndex++] = Frame.UNINITIALIZED
++                            | cw.addUninitializedType("",
++                                    ((Label) local[i]).position);
++                }
++            }
++            for (int i = 0; i < nStack; ++i) {
++                if (stack[i] instanceof String) {
++                    frame[frameIndex++] = Frame.OBJECT
++                            | cw.addType((String) stack[i]);
++                } else if (stack[i] instanceof Integer) {
++                    frame[frameIndex++] = ((Integer) stack[i]).intValue();
++                } else {
++                    frame[frameIndex++] = Frame.UNINITIALIZED
++                            | cw.addUninitializedType("",
++                                    ((Label) stack[i]).position);
++                }
++            }
++            endFrame();
++        } else {
++            int delta;
++            if (stackMap == null) {
++                stackMap = new ByteVector();
++                delta = code.length;
++            } else {
++                delta = code.length - previousFrameOffset - 1;
++            }
++
++            switch (type) {
++                case Opcodes.F_FULL:
++                    stackMap.putByte(FULL_FRAME)
++                            .putShort(delta)
++                            .putShort(nLocal);
++                    for (int i = 0; i < nLocal; ++i) {
++                        writeFrameType(local[i]);
++                    }
++                    stackMap.putShort(nStack);
++                    for (int i = 0; i < nStack; ++i) {
++                        writeFrameType(stack[i]);
++                    }
++                    break;
++                case Opcodes.F_APPEND:
++                    stackMap.putByte(SAME_FRAME_EXTENDED + nLocal)
++                            .putShort(delta);
++                    for (int i = 0; i < nLocal; ++i) {
++                        writeFrameType(local[i]);
++                    }
++                    break;
++                case Opcodes.F_CHOP:
++                    stackMap.putByte(SAME_FRAME_EXTENDED - nLocal)
++                            .putShort(delta);
++                    break;
++                case Opcodes.F_SAME:
++                    if (delta < 64) {
++                        stackMap.putByte(delta);
++                    } else {
++                        stackMap.putByte(SAME_FRAME_EXTENDED).putShort(delta);
++                    }
++                    break;
++                case Opcodes.F_SAME1:
++                    if (delta < 64) {
++                        stackMap.putByte(SAME_LOCALS_1_STACK_ITEM_FRAME + delta);
++                    } else {
++                        stackMap.putByte(SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED)
++                                .putShort(delta);
++                    }
++                    writeFrameType(stack[0]);
++                    break;
++            }
++
++            previousFrameOffset = code.length;
++            ++frameCount;
++        }
++    }
++
++    public void visitInsn(final int opcode) {
++        // adds the instruction to the bytecode of the method
++        code.putByte(opcode);
++        // update currentBlock
++        // Label currentBlock = this.currentBlock;
++        if (currentBlock != null) {
++            if (compute == FRAMES) {
++                currentBlock.frame.execute(opcode, 0, null, null);
++            } else {
++                // updates current and max stack sizes
++                int size = stackSize + Frame.SIZE[opcode];
++                if (size > maxStackSize) {
++                    maxStackSize = size;
++                }
++                stackSize = size;
++            }
++            // if opcode == ATHROW or xRETURN, ends current block (no successor)
++            if ((opcode >= Opcodes.IRETURN && opcode <= Opcodes.RETURN)
++                    || opcode == Opcodes.ATHROW)
++            {
++                noSuccessor();
++            }
++        }
++    }
++
++    public void visitIntInsn(final int opcode, final int operand) {
++        // Label currentBlock = this.currentBlock;
++        if (currentBlock != null) {
++            if (compute == FRAMES) {
++                currentBlock.frame.execute(opcode, operand, null, null);
++            } else if (opcode != Opcodes.NEWARRAY) {
++                // updates current and max stack sizes only for NEWARRAY
++                // (stack size variation = 0 for BIPUSH or SIPUSH)
++                int size = stackSize + 1;
++                if (size > maxStackSize) {
++                    maxStackSize = size;
++                }
++                stackSize = size;
++            }
++        }
++        // adds the instruction to the bytecode of the method
++        if (opcode == Opcodes.SIPUSH) {
++            code.put12(opcode, operand);
++        } else { // BIPUSH or NEWARRAY
++            code.put11(opcode, operand);
++        }
++    }
++
++    public void visitVarInsn(final int opcode, final int var) {
++        // Label currentBlock = this.currentBlock;
++        if (currentBlock != null) {
++            if (compute == FRAMES) {
++                currentBlock.frame.execute(opcode, var, null, null);
++            } else {
++                // updates current and max stack sizes
++                if (opcode == Opcodes.RET) {
++                    // no stack change, but end of current block (no successor)
++                    currentBlock.status |= Label.RET;
++                    // save 'stackSize' here for future use
++                    // (see {@link #findSubroutineSuccessors})
++                    currentBlock.inputStackTop = stackSize;
++                    noSuccessor();
++                } else { // xLOAD or xSTORE
++                    int size = stackSize + Frame.SIZE[opcode];
++                    if (size > maxStackSize) {
++                        maxStackSize = size;
++                    }
++                    stackSize = size;
++                }
++            }
++        }
++        if (compute != NOTHING) {
++            // updates max locals
++            int n;
++            if (opcode == Opcodes.LLOAD || opcode == Opcodes.DLOAD
++                    || opcode == Opcodes.LSTORE || opcode == Opcodes.DSTORE)
++            {
++                n = var + 2;
++            } else {
++                n = var + 1;
++            }
++            if (n > maxLocals) {
++                maxLocals = n;
++            }
++        }
++        // adds the instruction to the bytecode of the method
++        if (var < 4 && opcode != Opcodes.RET) {
++            int opt;
++            if (opcode < Opcodes.ISTORE) {
++                /* ILOAD_0 */
++                opt = 26 + ((opcode - Opcodes.ILOAD) << 2) + var;
++            } else {
++                /* ISTORE_0 */
++                opt = 59 + ((opcode - Opcodes.ISTORE) << 2) + var;
++            }
++            code.putByte(opt);
++        } else if (var >= 256) {
++            code.putByte(196 /* WIDE */).put12(opcode, var);
++        } else {
++            code.put11(opcode, var);
++        }
++        if (opcode >= Opcodes.ISTORE && compute == FRAMES && handlerCount > 0) {
++            visitLabel(new Label());
++        }
++    }
++
++    public void visitTypeInsn(final int opcode, final String type) {
++        Item i = cw.newClassItem(type);
++        // Label currentBlock = this.currentBlock;
++        if (currentBlock != null) {
++            if (compute == FRAMES) {
++                currentBlock.frame.execute(opcode, code.length, cw, i);
++            } else if (opcode == Opcodes.NEW) {
++                // updates current and max stack sizes only if opcode == NEW
++                // (no stack change for ANEWARRAY, CHECKCAST, INSTANCEOF)
++                int size = stackSize + 1;
++                if (size > maxStackSize) {
++                    maxStackSize = size;
++                }
++                stackSize = size;
++            }
++        }
++        // adds the instruction to the bytecode of the method
++        code.put12(opcode, i.index);
++    }
++
++    public void visitFieldInsn(
++        final int opcode,
++        final String owner,
++        final String name,
++        final String desc)
++    {
++        Item i = cw.newFieldItem(owner, name, desc);
++        // Label currentBlock = this.currentBlock;
++        if (currentBlock != null) {
++            if (compute == FRAMES) {
++                currentBlock.frame.execute(opcode, 0, cw, i);
++            } else {
++                int size;
++                // computes the stack size variation
++                char c = desc.charAt(0);
++                switch (opcode) {
++                    case Opcodes.GETSTATIC:
++                        size = stackSize + (c == 'D' || c == 'J' ? 2 : 1);
++                        break;
++                    case Opcodes.PUTSTATIC:
++                        size = stackSize + (c == 'D' || c == 'J' ? -2 : -1);
++                        break;
++                    case Opcodes.GETFIELD:
++                        size = stackSize + (c == 'D' || c == 'J' ? 1 : 0);
++                        break;
++                    // case Constants.PUTFIELD:
++                    default:
++                        size = stackSize + (c == 'D' || c == 'J' ? -3 : -2);
++                        break;
++                }
++                // updates current and max stack sizes
++                if (size > maxStackSize) {
++                    maxStackSize = size;
++                }
++                stackSize = size;
++            }
++        }
++        // adds the instruction to the bytecode of the method
++        code.put12(opcode, i.index);
++    }
++
++    public void visitMethodInsn(
++        final int opcode,
++        final String owner,
++        final String name,
++        final String desc)
++    {
++        boolean itf = opcode == Opcodes.INVOKEINTERFACE;
++        Item i = cw.newMethodItem(owner, name, desc, itf);
++        int argSize = i.intVal;
++        // Label currentBlock = this.currentBlock;
++        if (currentBlock != null) {
++            if (compute == FRAMES) {
++                currentBlock.frame.execute(opcode, 0, cw, i);
++            } else {
++                /*
++                 * computes the stack size variation. In order not to recompute
++                 * several times this variation for the same Item, we use the
++                 * intVal field of this item to store this variation, once it
++                 * has been computed. More precisely this intVal field stores
++                 * the sizes of the arguments and of the return value
++                 * corresponding to desc.
++                 */
++                if (argSize == 0) {
++                    // the above sizes have not been computed yet,
++                    // so we compute them...
++                    argSize = getArgumentsAndReturnSizes(desc);
++                    // ... and we save them in order
++                    // not to recompute them in the future
++                    i.intVal = argSize;
++                }
++                int size;
++                if (opcode == Opcodes.INVOKESTATIC) {
++                    size = stackSize - (argSize >> 2) + (argSize & 0x03) + 1;
++                } else {
++                    size = stackSize - (argSize >> 2) + (argSize & 0x03);
++                }
++                // updates current and max stack sizes
++                if (size > maxStackSize) {
++                    maxStackSize = size;
++                }
++                stackSize = size;
++            }
++        }
++        // adds the instruction to the bytecode of the method
++        if (itf) {
++            if (argSize == 0) {
++                argSize = getArgumentsAndReturnSizes(desc);
++                i.intVal = argSize;
++            }
++            code.put12(Opcodes.INVOKEINTERFACE, i.index).put11(argSize >> 2, 0);
++        } else {
++            code.put12(opcode, i.index);
++        }
++    }
++
++    public void visitJumpInsn(final int opcode, final Label label) {
++        Label nextInsn = null;
++        // Label currentBlock = this.currentBlock;
++        if (currentBlock != null) {
++            if (compute == FRAMES) {
++                currentBlock.frame.execute(opcode, 0, null, null);
++                // 'label' is the target of a jump instruction
++                label.getFirst().status |= Label.TARGET;
++                // adds 'label' as a successor of this basic block
++                addSuccessor(Edge.NORMAL, label);
++                if (opcode != Opcodes.GOTO) {
++                    // creates a Label for the next basic block
++                    nextInsn = new Label();
++                }
++            } else {
++                if (opcode == Opcodes.JSR) {
++                    if ((label.status & Label.SUBROUTINE) == 0) {
++                        label.status |= Label.SUBROUTINE;
++                        ++subroutines;
++                    }
++                    currentBlock.status |= Label.JSR;
++                    addSuccessor(stackSize + 1, label);
++                    // creates a Label for the next basic block
++                    nextInsn = new Label();
++                    /*
++                     * note that, by construction in this method, a JSR block
++                     * has at least two successors in the control flow graph:
++                     * the first one leads the next instruction after the JSR,
++                     * while the second one leads to the JSR target.
++                     */
++                } else {
++                    // updates current stack size (max stack size unchanged
++                    // because stack size variation always negative in this
++                    // case)
++                    stackSize += Frame.SIZE[opcode];
++                    addSuccessor(stackSize, label);
++                }
++            }
++        }
++        // adds the instruction to the bytecode of the method
++        if ((label.status & Label.RESOLVED) != 0
++                && label.position - code.length < Short.MIN_VALUE)
++        {
++            /*
++             * case of a backward jump with an offset < -32768. In this case we
++             * automatically replace GOTO with GOTO_W, JSR with JSR_W and IFxxx
++             * <l> with IFNOTxxx <l'> GOTO_W <l>, where IFNOTxxx is the
++             * "opposite" opcode of IFxxx (i.e., IFNE for IFEQ) and where <l'>
++             * designates the instruction just after the GOTO_W.
++             */
++            if (opcode == Opcodes.GOTO) {
++                code.putByte(200); // GOTO_W
++            } else if (opcode == Opcodes.JSR) {
++                code.putByte(201); // JSR_W
++            } else {
++                // if the IF instruction is transformed into IFNOT GOTO_W the
++                // next instruction becomes the target of the IFNOT instruction
++                if (nextInsn != null) {
++                    nextInsn.status |= Label.TARGET;
++                }
++                code.putByte(opcode <= 166
++                        ? ((opcode + 1) ^ 1) - 1
++                        : opcode ^ 1);
++                code.putShort(8); // jump offset
++                code.putByte(200); // GOTO_W
++            }
++            label.put(this, code, code.length - 1, true);
++        } else {
++            /*
++             * case of a backward jump with an offset >= -32768, or of a forward
++             * jump with, of course, an unknown offset. In these cases we store
++             * the offset in 2 bytes (which will be increased in
++             * resizeInstructions, if needed).
++             */
++            code.putByte(opcode);
++            label.put(this, code, code.length - 1, false);
++        }
++        if (currentBlock != null) {
++            if (nextInsn != null) {
++                // if the jump instruction is not a GOTO, the next instruction
++                // is also a successor of this instruction. Calling visitLabel
++                // adds the label of this next instruction as a successor of the
++                // current block, and starts a new basic block
++                visitLabel(nextInsn);
++            }
++            if (opcode == Opcodes.GOTO) {
++                noSuccessor();
++            }
++        }
++    }
++
++    public void visitLabel(final Label label) {
++        // resolves previous forward references to label, if any
++        resize |= label.resolve(this, code.length, code.data);
++        // updates currentBlock
++        if ((label.status & Label.DEBUG) != 0) {
++            return;
++        }
++        if (compute == FRAMES) {
++            if (currentBlock != null) {
++                if (label.position == currentBlock.position) {
++                    // successive labels, do not start a new basic block
++                    currentBlock.status |= (label.status & Label.TARGET);
++                    label.frame = currentBlock.frame;
++                    return;
++                }
++                // ends current block (with one new successor)
++                addSuccessor(Edge.NORMAL, label);
++            }
++            // begins a new current block
++            currentBlock = label;
++            if (label.frame == null) {
++                label.frame = new Frame();
++                label.frame.owner = label;
++            }
++            // updates the basic block list
++            if (previousBlock != null) {
++                if (label.position == previousBlock.position) {
++                    previousBlock.status |= (label.status & Label.TARGET);
++                    label.frame = previousBlock.frame;
++                    currentBlock = previousBlock;
++                    return;
++                }
++                previousBlock.successor = label;
++            }
++            previousBlock = label;
++        } else if (compute == MAXS) {
++            if (currentBlock != null) {
++                // ends current block (with one new successor)
++                currentBlock.outputStackMax = maxStackSize;
++                addSuccessor(stackSize, label);
++            }
++            // begins a new current block
++            currentBlock = label;
++            // resets the relative current and max stack sizes
++            stackSize = 0;
++            maxStackSize = 0;
++            // updates the basic block list
++            if (previousBlock != null) {
++                previousBlock.successor = label;
++            }
++            previousBlock = label;
++        }
++    }
++
++    public void visitLdcInsn(final Object cst) {
++        Item i = cw.newConstItem(cst);
++        // Label currentBlock = this.currentBlock;
++        if (currentBlock != null) {
++            if (compute == FRAMES) {
++                currentBlock.frame.execute(Opcodes.LDC, 0, cw, i);
++            } else {
++                int size;
++                // computes the stack size variation
++                if (i.type == ClassWriter.LONG || i.type == ClassWriter.DOUBLE)
++                {
++                    size = stackSize + 2;
++                } else {
++                    size = stackSize + 1;
++                }
++                // updates current and max stack sizes
++                if (size > maxStackSize) {
++                    maxStackSize = size;
++                }
++                stackSize = size;
++            }
++        }
++        // adds the instruction to the bytecode of the method
++        int index = i.index;
++        if (i.type == ClassWriter.LONG || i.type == ClassWriter.DOUBLE) {
++            code.put12(20 /* LDC2_W */, index);
++        } else if (index >= 256) {
++            code.put12(19 /* LDC_W */, index);
++        } else {
++            code.put11(Opcodes.LDC, index);
++        }
++    }
++
++    public void visitIincInsn(final int var, final int increment) {
++        if (currentBlock != null) {
++            if (compute == FRAMES) {
++                currentBlock.frame.execute(Opcodes.IINC, var, null, null);
++            }
++        }
++        if (compute != NOTHING) {
++            // updates max locals
++            int n = var + 1;
++            if (n > maxLocals) {
++                maxLocals = n;
++            }
++        }
++        // adds the instruction to the bytecode of the method
++        if ((var > 255) || (increment > 127) || (increment < -128)) {
++            code.putByte(196 /* WIDE */)
++                    .put12(Opcodes.IINC, var)
++                    .putShort(increment);
++        } else {
++            code.putByte(Opcodes.IINC).put11(var, increment);
++        }
++    }
++
++    public void visitTableSwitchInsn(
++        final int min,
++        final int max,
++        final Label dflt,
++        final Label[] labels)
++    {
++        // adds the instruction to the bytecode of the method
++        int source = code.length;
++        code.putByte(Opcodes.TABLESWITCH);
++        code.length += (4 - code.length % 4) % 4;
++        dflt.put(this, code, source, true);
++        code.putInt(min).putInt(max);
++        for (int i = 0; i < labels.length; ++i) {
++            labels[i].put(this, code, source, true);
++        }
++        // updates currentBlock
++        visitSwitchInsn(dflt, labels);
++    }
++
++    public void visitLookupSwitchInsn(
++        final Label dflt,
++        final int[] keys,
++        final Label[] labels)
++    {
++        // adds the instruction to the bytecode of the method
++        int source = code.length;
++        code.putByte(Opcodes.LOOKUPSWITCH);
++        code.length += (4 - code.length % 4) % 4;
++        dflt.put(this, code, source, true);
++        code.putInt(labels.length);
++        for (int i = 0; i < labels.length; ++i) {
++            code.putInt(keys[i]);
++            labels[i].put(this, code, source, true);
++        }
++        // updates currentBlock
++        visitSwitchInsn(dflt, labels);
++    }
++
++    private void visitSwitchInsn(final Label dflt, final Label[] labels) {
++        // Label currentBlock = this.currentBlock;
++        if (currentBlock != null) {
++            if (compute == FRAMES) {
++                currentBlock.frame.execute(Opcodes.LOOKUPSWITCH, 0, null, null);
++                // adds current block successors
++                addSuccessor(Edge.NORMAL, dflt);
++                dflt.getFirst().status |= Label.TARGET;
++                for (int i = 0; i < labels.length; ++i) {
++                    addSuccessor(Edge.NORMAL, labels[i]);
++                    labels[i].getFirst().status |= Label.TARGET;
++                }
++            } else {
++                // updates current stack size (max stack size unchanged)
++                --stackSize;
++                // adds current block successors
++                addSuccessor(stackSize, dflt);
++                for (int i = 0; i < labels.length; ++i) {
++                    addSuccessor(stackSize, labels[i]);
++                }
++            }
++            // ends current block
++            noSuccessor();
++        }
++    }
++
++    public void visitMultiANewArrayInsn(final String desc, final int dims) {
++        Item i = cw.newClassItem(desc);
++        // Label currentBlock = this.currentBlock;
++        if (currentBlock != null) {
++            if (compute == FRAMES) {
++                currentBlock.frame.execute(Opcodes.MULTIANEWARRAY, dims, cw, i);
++            } else {
++                // updates current stack size (max stack size unchanged because
++                // stack size variation always negative or null)
++                stackSize += 1 - dims;
++            }
++        }
++        // adds the instruction to the bytecode of the method
++        code.put12(Opcodes.MULTIANEWARRAY, i.index).putByte(dims);
++    }
++
++    public void visitTryCatchBlock(
++        final Label start,
++        final Label end,
++        final Label handler,
++        final String type)
++    {
++        ++handlerCount;
++        Handler h = new Handler();
++        h.start = start;
++        h.end = end;
++        h.handler = handler;
++        h.desc = type;
++        h.type = type != null ? cw.newClass(type) : 0;
++        if (lastHandler == null) {
++            firstHandler = h;
++        } else {
++            lastHandler.next = h;
++        }
++        lastHandler = h;
++    }
++
++    public void visitLocalVariable(
++        final String name,
++        final String desc,
++        final String signature,
++        final Label start,
++        final Label end,
++        final int index)
++    {
++        if (signature != null) {
++            if (localVarType == null) {
++                localVarType = new ByteVector();
++            }
++            ++localVarTypeCount;
++            localVarType.putShort(start.position)
++                    .putShort(end.position - start.position)
++                    .putShort(cw.newUTF8(name))
++                    .putShort(cw.newUTF8(signature))
++                    .putShort(index);
++        }
++        if (localVar == null) {
++            localVar = new ByteVector();
++        }
++        ++localVarCount;
++        localVar.putShort(start.position)
++                .putShort(end.position - start.position)
++                .putShort(cw.newUTF8(name))
++                .putShort(cw.newUTF8(desc))
++                .putShort(index);
++        if (compute != NOTHING) {
++            // updates max locals
++            char c = desc.charAt(0);
++            int n = index + (c == 'J' || c == 'D' ? 2 : 1);
++            if (n > maxLocals) {
++                maxLocals = n;
++            }
++        }
++    }
++
++    public void visitLineNumber(final int line, final Label start) {
++        if (lineNumber == null) {
++            lineNumber = new ByteVector();
++        }
++        ++lineNumberCount;
++        lineNumber.putShort(start.position);
++        lineNumber.putShort(line);
++    }
++
++    public void visitMaxs(final int maxStack, final int maxLocals) {
++        if (ClassReader.FRAMES && compute == FRAMES) {
++            // completes the control flow graph with exception handler blocks
++            Handler handler = firstHandler;
++            while (handler != null) {
++                Label l = handler.start.getFirst();
++                Label h = handler.handler.getFirst();
++                Label e = handler.end.getFirst();
++                // computes the kind of the edges to 'h'
++                String t = handler.desc == null
++                        ? "java/lang/Throwable"
++                        : handler.desc;
++                int kind = Frame.OBJECT | cw.addType(t);
++                // h is an exception handler
++                h.status |= Label.TARGET;
++                // adds 'h' as a successor of labels between 'start' and 'end'
++                while (l != e) {
++                    // creates an edge to 'h'
++                    Edge b = new Edge();
++                    b.info = kind;
++                    b.successor = h;
++                    // adds it to the successors of 'l'
++                    b.next = l.successors;
++                    l.successors = b;
++                    // goes to the next label
++                    l = l.successor;
++                }
++                handler = handler.next;
++            }
++
++            // creates and visits the first (implicit) frame
++            Frame f = labels.frame;
++            Type[] args = Type.getArgumentTypes(descriptor);
++            f.initInputFrame(cw, access, args, this.maxLocals);
++            visitFrame(f);
++
++            /*
++             * fix point algorithm: mark the first basic block as 'changed'
++             * (i.e. put it in the 'changed' list) and, while there are changed
++             * basic blocks, choose one, mark it as unchanged, and update its
++             * successors (which can be changed in the process).
++             */
++            int max = 0;
++            Label changed = labels;
++            while (changed != null) {
++                // removes a basic block from the list of changed basic blocks
++                Label l = changed;
++                changed = changed.next;
++                l.next = null;
++                f = l.frame;
++                // a reacheable jump target must be stored in the stack map
++                if ((l.status & Label.TARGET) != 0) {
++                    l.status |= Label.STORE;
++                }
++                // all visited labels are reacheable, by definition
++                l.status |= Label.REACHABLE;
++                // updates the (absolute) maximum stack size
++                int blockMax = f.inputStack.length + l.outputStackMax;
++                if (blockMax > max) {
++                    max = blockMax;
++                }
++                // updates the successors of the current basic block
++                Edge e = l.successors;
++                while (e != null) {
++                    Label n = e.successor.getFirst();
++                    boolean change = f.merge(cw, n.frame, e.info);
++                    if (change && n.next == null) {
++                        // if n has changed and is not already in the 'changed'
++                        // list, adds it to this list
++                        n.next = changed;
++                        changed = n;
++                    }
++                    e = e.next;
++                }
++            }
++            this.maxStack = max;
++
++            // visits all the frames that must be stored in the stack map
++            Label l = labels;
++            while (l != null) {
++                f = l.frame;
++                if ((l.status & Label.STORE) != 0) {
++                    visitFrame(f);
++                }
++                if ((l.status & Label.REACHABLE) == 0) {
++                    // finds start and end of dead basic block
++                    Label k = l.successor;
++                    int start = l.position;
++                    int end = (k == null ? code.length : k.position) - 1;
++                    // if non empty basic block
++                    if (end >= start) {
++                        // replaces instructions with NOP ... NOP ATHROW
++                        for (int i = start; i < end; ++i) {
++                            code.data[i] = Opcodes.NOP;
++                        }
++                        code.data[end] = (byte) Opcodes.ATHROW;
++                        // emits a frame for this unreachable block
++                        startFrame(start, 0, 1);
++                        frame[frameIndex++] = Frame.OBJECT
++                                | cw.addType("java/lang/Throwable");
++                        endFrame();
++                    }
++                }
++                l = l.successor;
++            }
++        } else if (compute == MAXS) {
++            // completes the control flow graph with exception handler blocks
++            Handler handler = firstHandler;
++            while (handler != null) {
++                Label l = handler.start;
++                Label h = handler.handler;
++                Label e = handler.end;
++                // adds 'h' as a successor of labels between 'start' and 'end'
++                while (l != e) {
++                    // creates an edge to 'h'
++                    Edge b = new Edge();
++                    b.info = Edge.EXCEPTION;
++                    b.successor = h;
++                    // adds it to the successors of 'l'
++                    if ((l.status & Label.JSR) == 0) {
++                        b.next = l.successors;
++                        l.successors = b;
++                    } else {
++                        // if l is a JSR block, adds b after the first two edges
++                        // to preserve the hypothesis about JSR block successors
++                        // order (see {@link #visitJumpInsn})
++                        b.next = l.successors.next.next;
++                        l.successors.next.next = b;
++                    }
++                    // goes to the next label
++                    l = l.successor;
++                }
++                handler = handler.next;
++            }
++
++            if (subroutines > 0) {
++                // completes the control flow graph with the RET successors
++                /*
++                 * first step: finds the subroutines. This step determines, for
++                 * each basic block, to which subroutine(s) it belongs.
++                 */
++                // finds the basic blocks that belong to the "main" subroutine
++                int id = 0;
++                labels.visitSubroutine(null, 1, subroutines);
++                // finds the basic blocks that belong to the real subroutines
++                Label l = labels;
++                while (l != null) {
++                    if ((l.status & Label.JSR) != 0) {
++                        // the subroutine is defined by l's TARGET, not by l
++                        Label subroutine = l.successors.next.successor;
++                        // if this subroutine has not been visited yet...
++                        if ((subroutine.status & Label.VISITED) == 0) {
++                            // ...assigns it a new id and finds its basic blocks
++                            id += 1;
++                            subroutine.visitSubroutine(null, (id / 32L) << 32
++                                    | (1L << (id % 32)), subroutines);
++                        }
++                    }
++                    l = l.successor;
++                }
++                // second step: finds the successors of RET blocks
++                l = labels;
++                while (l != null) {
++                    if ((l.status & Label.JSR) != 0) {
++                        Label L = labels;
++                        while (L != null) {
++                            L.status &= ~Label.VISITED;
++                            L = L.successor;
++                        }
++                        // the subroutine is defined by l's TARGET, not by l
++                        Label subroutine = l.successors.next.successor;
++                        subroutine.visitSubroutine(l, 0, subroutines);
++                    }
++                    l = l.successor;
++                }
++            }
++
++            /*
++             * control flow analysis algorithm: while the block stack is not
++             * empty, pop a block from this stack, update the max stack size,
++             * compute the true (non relative) begin stack size of the
++             * successors of this block, and push these successors onto the
++             * stack (unless they have already been pushed onto the stack).
++             * Note: by hypothesis, the {@link Label#inputStackTop} of the
++             * blocks in the block stack are the true (non relative) beginning
++             * stack sizes of these blocks.
++             */
++            int max = 0;
++            Label stack = labels;
++            while (stack != null) {
++                // pops a block from the stack
++                Label l = stack;
++                stack = stack.next;
++                // computes the true (non relative) max stack size of this block
++                int start = l.inputStackTop;
++                int blockMax = start + l.outputStackMax;
++                // updates the global max stack size
++                if (blockMax > max) {
++                    max = blockMax;
++                }
++                // analyzes the successors of the block
++                Edge b = l.successors;
++                if ((l.status & Label.JSR) != 0) {
++                    // ignores the first edge of JSR blocks (virtual successor)
++                    b = b.next;
++                }
++                while (b != null) {
++                    l = b.successor;
++                    // if this successor has not already been pushed...
++                    if ((l.status & Label.PUSHED) == 0) {
++                        // computes its true beginning stack size...
++                        l.inputStackTop = b.info == Edge.EXCEPTION ? 1 : start
++                                + b.info;
++                        // ...and pushes it onto the stack
++                        l.status |= Label.PUSHED;
++                        l.next = stack;
++                        stack = l;
++                    }
++                    b = b.next;
++                }
++            }
++            this.maxStack = max;
++        } else {
++            this.maxStack = maxStack;
++            this.maxLocals = maxLocals;
++        }
++    }
++
++    public void visitEnd() {
++    }
++
++    // ------------------------------------------------------------------------
++    // Utility methods: control flow analysis algorithm
++    // ------------------------------------------------------------------------
++
++    /**
++     * Computes the size of the arguments and of the return value of a method.
++     *
++     * @param desc the descriptor of a method.
++     * @return the size of the arguments of the method (plus one for the
++     *         implicit this argument), argSize, and the size of its return
++     *         value, retSize, packed into a single int i =
++     *         <tt>(argSize << 2) | retSize</tt> (argSize is therefore equal
++     *         to <tt>i >> 2</tt>, and retSize to <tt>i & 0x03</tt>).
++     */
++    static int getArgumentsAndReturnSizes(final String desc) {
++        int n = 1;
++        int c = 1;
++        while (true) {
++            char car = desc.charAt(c++);
++            if (car == ')') {
++                car = desc.charAt(c);
++                return n << 2
++                        | (car == 'V' ? 0 : (car == 'D' || car == 'J' ? 2 : 1));
++            } else if (car == 'L') {
++                while (desc.charAt(c++) != ';') {
++                }
++                n += 1;
++            } else if (car == '[') {
++                while ((car = desc.charAt(c)) == '[') {
++                    ++c;
++                }
++                if (car == 'D' || car == 'J') {
++                    n -= 1;
++                }
++            } else if (car == 'D' || car == 'J') {
++                n += 2;
++            } else {
++                n += 1;
++            }
++        }
++    }
++
++    /**
++     * Adds a successor to the {@link #currentBlock currentBlock} block.
++     *
++     * @param info information about the control flow edge to be added.
++     * @param successor the successor block to be added to the current block.
++     */
++    private void addSuccessor(final int info, final Label successor) {
++        // creates and initializes an Edge object...
++        Edge b = new Edge();
++        b.info = info;
++        b.successor = successor;
++        // ...and adds it to the successor list of the currentBlock block
++        b.next = currentBlock.successors;
++        currentBlock.successors = b;
++    }
++
++    /**
++     * Ends the current basic block. This method must be used in the case where
++     * the current basic block does not have any successor.
++     */
++    private void noSuccessor() {
++        if (compute == FRAMES) {
++            Label l = new Label();
++            l.frame = new Frame();
++            l.frame.owner = l;
++            l.resolve(this, code.length, code.data);
++            previousBlock.successor = l;
++            previousBlock = l;
++        } else {
++            currentBlock.outputStackMax = maxStackSize;
++        }
++        currentBlock = null;
++    }
++
++    // ------------------------------------------------------------------------
++    // Utility methods: stack map frames
++    // ------------------------------------------------------------------------
++
++    /**
++     * Visits a frame that has been computed from scratch.
++     *
++     * @param f the frame that must be visited.
++     */
++    private void visitFrame(final Frame f) {
++        int i, t;
++        int nTop = 0;
++        int nLocal = 0;
++        int nStack = 0;
++        int[] locals = f.inputLocals;
++        int[] stacks = f.inputStack;
++        // computes the number of locals (ignores TOP types that are just after
++        // a LONG or a DOUBLE, and all trailing TOP types)
++        for (i = 0; i < locals.length; ++i) {
++            t = locals[i];
++            if (t == Frame.TOP) {
++                ++nTop;
++            } else {
++                nLocal += nTop + 1;
++                nTop = 0;
++            }
++            if (t == Frame.LONG || t == Frame.DOUBLE) {
++                ++i;
++            }
++        }
++        // computes the stack size (ignores TOP types that are just after
++        // a LONG or a DOUBLE)
++        for (i = 0; i < stacks.length; ++i) {
++            t = stacks[i];
++            ++nStack;
++            if (t == Frame.LONG || t == Frame.DOUBLE) {
++                ++i;
++            }
++        }
++        // visits the frame and its content
++        startFrame(f.owner.position, nLocal, nStack);
++        for (i = 0; nLocal > 0; ++i, --nLocal) {
++            t = locals[i];
++            frame[frameIndex++] = t;
++            if (t == Frame.LONG || t == Frame.DOUBLE) {
++                ++i;
++            }
++        }
++        for (i = 0; i < stacks.length; ++i) {
++            t = stacks[i];
++            frame[frameIndex++] = t;
++            if (t == Frame.LONG || t == Frame.DOUBLE) {
++                ++i;
++            }
++        }
++        endFrame();
++    }
++
++    /**
++     * Starts the visit of a stack map frame.
++     *
++     * @param offset the offset of the instruction to which the frame
++     *        corresponds.
++     * @param nLocal the number of local variables in the frame.
++     * @param nStack the number of stack elements in the frame.
++     */
++    private void startFrame(final int offset, final int nLocal, final int nStack)
++    {
++        int n = 3 + nLocal + nStack;
++        if (frame == null || frame.length < n) {
++            frame = new int[n];
++        }
++        frame[0] = offset;
++        frame[1] = nLocal;
++        frame[2] = nStack;
++        frameIndex = 3;
++    }
++
++    /**
++     * Checks if the visit of the current frame {@link #frame} is finished, and
++     * if yes, write it in the StackMapTable attribute.
++     */
++    private void endFrame() {
++        if (previousFrame != null) { // do not write the first frame
++            if (stackMap == null) {
++                stackMap = new ByteVector();
++            }
++            writeFrame();
++            ++frameCount;
++        }
++        previousFrame = frame;
++        frame = null;
++    }
++
++    /**
++     * Compress and writes the current frame {@link #frame} in the StackMapTable
++     * attribute.
++     */
++    private void writeFrame() {
++        int clocalsSize = frame[1];
++        int cstackSize = frame[2];
++        if ((cw.version & 0xFFFF) < Opcodes.V1_6) {
++            stackMap.putShort(frame[0]).putShort(clocalsSize);
++            writeFrameTypes(3, 3 + clocalsSize);
++            stackMap.putShort(cstackSize);
++            writeFrameTypes(3 + clocalsSize, 3 + clocalsSize + cstackSize);
++            return;
++        }
++        int localsSize = previousFrame[1];
++        int type = FULL_FRAME;
++        int k = 0;
++        int delta;
++        if (frameCount == 0) {
++            delta = frame[0];
++        } else {
++            delta = frame[0] - previousFrame[0] - 1;
++        }
++        if (cstackSize == 0) {
++            k = clocalsSize - localsSize;
++            switch (k) {
++                case -3:
++                case -2:
++                case -1:
++                    type = CHOP_FRAME;
++                    localsSize = clocalsSize;
++                    break;
++                case 0:
++                    type = delta < 64 ? SAME_FRAME : SAME_FRAME_EXTENDED;
++                    break;
++                case 1:
++                case 2:
++                case 3:
++                    type = APPEND_FRAME;
++                    break;
++            }
++        } else if (clocalsSize == localsSize && cstackSize == 1) {
++            type = delta < 63
++                    ? SAME_LOCALS_1_STACK_ITEM_FRAME
++                    : SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED;
++        }
++        if (type != FULL_FRAME) {
++            // verify if locals are the same
++            int l = 3;
++            for (int j = 0; j < localsSize; j++) {
++                if (frame[l] != previousFrame[l]) {
++                    type = FULL_FRAME;
++                    break;
++                }
++                l++;
++            }
++        }
++        switch (type) {
++            case SAME_FRAME:
++                stackMap.putByte(delta);
++                break;
++            case SAME_LOCALS_1_STACK_ITEM_FRAME:
++                stackMap.putByte(SAME_LOCALS_1_STACK_ITEM_FRAME + delta);
++                writeFrameTypes(3 + clocalsSize, 4 + clocalsSize);
++                break;
++            case SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED:
++                stackMap.putByte(SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED)
++                        .putShort(delta);
++                writeFrameTypes(3 + clocalsSize, 4 + clocalsSize);
++                break;
++            case SAME_FRAME_EXTENDED:
++                stackMap.putByte(SAME_FRAME_EXTENDED).putShort(delta);
++                break;
++            case CHOP_FRAME:
++                stackMap.putByte(SAME_FRAME_EXTENDED + k).putShort(delta);
++                break;
++            case APPEND_FRAME:
++                stackMap.putByte(SAME_FRAME_EXTENDED + k).putShort(delta);
++                writeFrameTypes(3 + localsSize, 3 + clocalsSize);
++                break;
++            // case FULL_FRAME:
++            default:
++                stackMap.putByte(FULL_FRAME)
++                        .putShort(delta)
++                        .putShort(clocalsSize);
++                writeFrameTypes(3, 3 + clocalsSize);
++                stackMap.putShort(cstackSize);
++                writeFrameTypes(3 + clocalsSize, 3 + clocalsSize + cstackSize);
++        }
++    }
++
++    /**
++     * Writes some types of the current frame {@link #frame} into the
++     * StackMapTableAttribute. This method converts types from the format used
++     * in {@link Label} to the format used in StackMapTable attributes. In
++     * particular, it converts type table indexes to constant pool indexes.
++     *
++     * @param start index of the first type in {@link #frame} to write.
++     * @param end index of last type in {@link #frame} to write (exclusive).
++     */
++    private void writeFrameTypes(final int start, final int end) {
++        for (int i = start; i < end; ++i) {
++            int t = frame[i];
++            int d = t & Frame.DIM;
++            if (d == 0) {
++                int v = t & Frame.BASE_VALUE;
++                switch (t & Frame.BASE_KIND) {
++                    case Frame.OBJECT:
++                        stackMap.putByte(7)
++                                .putShort(cw.newClass(cw.typeTable[v].strVal1));
++                        break;
++                    case Frame.UNINITIALIZED:
++                        stackMap.putByte(8).putShort(cw.typeTable[v].intVal);
++                        break;
++                    default:
++                        stackMap.putByte(v);
++                }
++            } else {
++                StringBuffer buf = new StringBuffer();
++                d >>= 28;
++                while (d-- > 0) {
++                    buf.append('[');
++                }
++                if ((t & Frame.BASE_KIND) == Frame.OBJECT) {
++                    buf.append('L');
++                    buf.append(cw.typeTable[t & Frame.BASE_VALUE].strVal1);
++                    buf.append(';');
++                } else {
++                    switch (t & 0xF) {
++                        case 1:
++                            buf.append('I');
++                            break;
++                        case 2:
++                            buf.append('F');
++                            break;
++                        case 3:
++                            buf.append('D');
++                            break;
++                        case 9:
++                            buf.append('Z');
++                            break;
++                        case 10:
++                            buf.append('B');
++                            break;
++                        case 11:
++                            buf.append('C');
++                            break;
++                        case 12:
++                            buf.append('S');
++                            break;
++                        default:
++                            buf.append('J');
++                    }
++                }
++                stackMap.putByte(7).putShort(cw.newClass(buf.toString()));
++            }
++        }
++    }
++
++    private void writeFrameType(final Object type) {
++        if (type instanceof String) {
++            stackMap.putByte(7).putShort(cw.newClass((String) type));
++        } else if (type instanceof Integer) {
++            stackMap.putByte(((Integer) type).intValue());
++        } else {
++            stackMap.putByte(8).putShort(((Label) type).position);
++        }
++    }
++
++    // ------------------------------------------------------------------------
++    // Utility methods: dump bytecode array
++    // ------------------------------------------------------------------------
++
++    /**
++     * Returns the size of the bytecode of this method.
++     *
++     * @return the size of the bytecode of this method.
++     */
++    final int getSize() {
++        if (classReaderOffset != 0) {
++            return 6 + classReaderLength;
++        }
++        if (resize) {
++            // replaces the temporary jump opcodes introduced by Label.resolve.
++            if (ClassReader.RESIZE) {
++                resizeInstructions();
++            } else {
++                throw new RuntimeException("Method code too large!");
++            }
++        }
++        int size = 8;
++        if (code.length > 0) {
++            cw.newUTF8("Code");
++            size += 18 + code.length + 8 * handlerCount;
++            if (localVar != null) {
++                cw.newUTF8("LocalVariableTable");
++                size += 8 + localVar.length;
++            }
++            if (localVarType != null) {
++                cw.newUTF8("LocalVariableTypeTable");
++                size += 8 + localVarType.length;
++            }
++            if (lineNumber != null) {
++                cw.newUTF8("LineNumberTable");
++                size += 8 + lineNumber.length;
++            }
++            if (stackMap != null) {
++                boolean zip = (cw.version & 0xFFFF) >= Opcodes.V1_6;
++                cw.newUTF8(zip ? "StackMapTable" : "StackMap");
++                size += 8 + stackMap.length;
++            }
++            if (cattrs != null) {
++                size += cattrs.getSize(cw,
++                        code.data,
++                        code.length,
++                        maxStack,
++                        maxLocals);
++            }
++        }
++        if (exceptionCount > 0) {
++            cw.newUTF8("Exceptions");
++            size += 8 + 2 * exceptionCount;
++        }
++        if ((access & Opcodes.ACC_SYNTHETIC) != 0
++                && (cw.version & 0xffff) < Opcodes.V1_5)
++        {
++            cw.newUTF8("Synthetic");
++            size += 6;
++        }
++        if ((access & Opcodes.ACC_DEPRECATED) != 0) {
++            cw.newUTF8("Deprecated");
++            size += 6;
++        }
++        if (ClassReader.SIGNATURES && signature != null) {
++            cw.newUTF8("Signature");
++            cw.newUTF8(signature);
++            size += 8;
++        }
++        if (ClassReader.ANNOTATIONS && annd != null) {
++            cw.newUTF8("AnnotationDefault");
++            size += 6 + annd.length;
++        }
++        if (ClassReader.ANNOTATIONS && anns != null) {
++            cw.newUTF8("RuntimeVisibleAnnotations");
++            size += 8 + anns.getSize();
++        }
++        if (ClassReader.ANNOTATIONS && ianns != null) {
++            cw.newUTF8("RuntimeInvisibleAnnotations");
++            size += 8 + ianns.getSize();
++        }
++        if (ClassReader.ANNOTATIONS && panns != null) {
++            cw.newUTF8("RuntimeVisibleParameterAnnotations");
++            size += 7 + 2 * (panns.length - synthetics);
++            for (int i = panns.length - 1; i >= synthetics; --i) {
++                size += panns[i] == null ? 0 : panns[i].getSize();
++            }
++        }
++        if (ClassReader.ANNOTATIONS && ipanns != null) {
++            cw.newUTF8("RuntimeInvisibleParameterAnnotations");
++            size += 7 + 2 * (ipanns.length - synthetics);
++            for (int i = ipanns.length - 1; i >= synthetics; --i) {
++                size += ipanns[i] == null ? 0 : ipanns[i].getSize();
++            }
++        }
++        if (attrs != null) {
++            size += attrs.getSize(cw, null, 0, -1, -1);
++        }
++        return size;
++    }
++
++    /**
++     * Puts the bytecode of this method in the given byte vector.
++     *
++     * @param out the byte vector into which the bytecode of this method must be
++     *        copied.
++     */
++    final void put(final ByteVector out) {
++        out.putShort(access).putShort(name).putShort(desc);
++        if (classReaderOffset != 0) {
++            out.putByteArray(cw.cr.b, classReaderOffset, classReaderLength);
++            return;
++        }
++        int attributeCount = 0;
++        if (code.length > 0) {
++            ++attributeCount;
++        }
++        if (exceptionCount > 0) {
++            ++attributeCount;
++        }
++        if ((access & Opcodes.ACC_SYNTHETIC) != 0
++                && (cw.version & 0xffff) < Opcodes.V1_5)
++        {
++            ++attributeCount;
++        }
++        if ((access & Opcodes.ACC_DEPRECATED) != 0) {
++            ++attributeCount;
++        }
++        if (ClassReader.SIGNATURES && signature != null) {
++            ++attributeCount;
++        }
++        if (ClassReader.ANNOTATIONS && annd != null) {
++            ++attributeCount;
++        }
++        if (ClassReader.ANNOTATIONS && anns != null) {
++            ++attributeCount;
++        }
++        if (ClassReader.ANNOTATIONS && ianns != null) {
++            ++attributeCount;
++        }
++        if (ClassReader.ANNOTATIONS && panns != null) {
++            ++attributeCount;
++        }
++        if (ClassReader.ANNOTATIONS && ipanns != null) {
++            ++attributeCount;
++        }
++        if (attrs != null) {
++            attributeCount += attrs.getCount();
++        }
++        out.putShort(attributeCount);
++        if (code.length > 0) {
++            int size = 12 + code.length + 8 * handlerCount;
++            if (localVar != null) {
++                size += 8 + localVar.length;
++            }
++            if (localVarType != null) {
++                size += 8 + localVarType.length;
++            }
++            if (lineNumber != null) {
++                size += 8 + lineNumber.length;
++            }
++            if (stackMap != null) {
++                size += 8 + stackMap.length;
++            }
++            if (cattrs != null) {
++                size += cattrs.getSize(cw,
++                        code.data,
++                        code.length,
++                        maxStack,
++                        maxLocals);
++            }
++            out.putShort(cw.newUTF8("Code")).putInt(size);
++            out.putShort(maxStack).putShort(maxLocals);
++            out.putInt(code.length).putByteArray(code.data, 0, code.length);
++            out.putShort(handlerCount);
++            if (handlerCount > 0) {
++                Handler h = firstHandler;
++                while (h != null) {
++                    out.putShort(h.start.position)
++                            .putShort(h.end.position)
++                            .putShort(h.handler.position)
++                            .putShort(h.type);
++                    h = h.next;
++                }
++            }
++            attributeCount = 0;
++            if (localVar != null) {
++                ++attributeCount;
++            }
++            if (localVarType != null) {
++                ++attributeCount;
++            }
++            if (lineNumber != null) {
++                ++attributeCount;
++            }
++            if (stackMap != null) {
++                ++attributeCount;
++            }
++            if (cattrs != null) {
++                attributeCount += cattrs.getCount();
++            }
++            out.putShort(attributeCount);
++            if (localVar != null) {
++                out.putShort(cw.newUTF8("LocalVariableTable"));
++                out.putInt(localVar.length + 2).putShort(localVarCount);
++                out.putByteArray(localVar.data, 0, localVar.length);
++            }
++            if (localVarType != null) {
++                out.putShort(cw.newUTF8("LocalVariableTypeTable"));
++                out.putInt(localVarType.length + 2).putShort(localVarTypeCount);
++                out.putByteArray(localVarType.data, 0, localVarType.length);
++            }
++            if (lineNumber != null) {
++                out.putShort(cw.newUTF8("LineNumberTable"));
++                out.putInt(lineNumber.length + 2).putShort(lineNumberCount);
++                out.putByteArray(lineNumber.data, 0, lineNumber.length);
++            }
++            if (stackMap != null) {
++                boolean zip = (cw.version & 0xFFFF) >= Opcodes.V1_6;
++                out.putShort(cw.newUTF8(zip ? "StackMapTable" : "StackMap"));
++                out.putInt(stackMap.length + 2).putShort(frameCount);
++                out.putByteArray(stackMap.data, 0, stackMap.length);
++            }
++            if (cattrs != null) {
++                cattrs.put(cw, code.data, code.length, maxLocals, maxStack, out);
++            }
++        }
++        if (exceptionCount > 0) {
++            out.putShort(cw.newUTF8("Exceptions"))
++                    .putInt(2 * exceptionCount + 2);
++            out.putShort(exceptionCount);
++            for (int i = 0; i < exceptionCount; ++i) {
++                out.putShort(exceptions[i]);
++            }
++        }
++        if ((access & Opcodes.ACC_SYNTHETIC) != 0
++                && (cw.version & 0xffff) < Opcodes.V1_5)
++        {
++            out.putShort(cw.newUTF8("Synthetic")).putInt(0);
++        }
++        if ((access & Opcodes.ACC_DEPRECATED) != 0) {
++            out.putShort(cw.newUTF8("Deprecated")).putInt(0);
++        }
++        if (ClassReader.SIGNATURES && signature != null) {
++            out.putShort(cw.newUTF8("Signature"))
++                    .putInt(2)
++                    .putShort(cw.newUTF8(signature));
++        }
++        if (ClassReader.ANNOTATIONS && annd != null) {
++            out.putShort(cw.newUTF8("AnnotationDefault"));
++            out.putInt(annd.length);
++            out.putByteArray(annd.data, 0, annd.length);
++        }
++        if (ClassReader.ANNOTATIONS && anns != null) {
++            out.putShort(cw.newUTF8("RuntimeVisibleAnnotations"));
++            anns.put(out);
++        }
++        if (ClassReader.ANNOTATIONS && ianns != null) {
++            out.putShort(cw.newUTF8("RuntimeInvisibleAnnotations"));
++            ianns.put(out);
++        }
++        if (ClassReader.ANNOTATIONS && panns != null) {
++            out.putShort(cw.newUTF8("RuntimeVisibleParameterAnnotations"));
++            AnnotationWriter.put(panns, synthetics, out);
++        }
++        if (ClassReader.ANNOTATIONS && ipanns != null) {
++            out.putShort(cw.newUTF8("RuntimeInvisibleParameterAnnotations"));
++            AnnotationWriter.put(ipanns, synthetics, out);
++        }
++        if (attrs != null) {
++            attrs.put(cw, null, 0, -1, -1, out);
++        }
++    }
++
++    // ------------------------------------------------------------------------
++    // Utility methods: instruction resizing (used to handle GOTO_W and JSR_W)
++    // ------------------------------------------------------------------------
++
++    /**
++     * Resizes and replaces the temporary instructions inserted by
++     * {@link Label#resolve} for wide forward jumps, while keeping jump offsets
++     * and instruction addresses consistent. This may require to resize other
++     * existing instructions, or even to introduce new instructions: for
++     * example, increasing the size of an instruction by 2 at the middle of a
++     * method can increases the offset of an IFEQ instruction from 32766 to
++     * 32768, in which case IFEQ 32766 must be replaced with IFNEQ 8 GOTO_W
++     * 32765. This, in turn, may require to increase the size of another jump
++     * instruction, and so on... All these operations are handled automatically
++     * by this method. <p> <i>This method must be called after all the method
++     * that is being built has been visited</i>. In particular, the
++     * {@link Label Label} objects used to construct the method are no longer
++     * valid after this method has been called.
++     */
++    private void resizeInstructions() {
++        byte[] b = code.data; // bytecode of the method
++        int u, v, label; // indexes in b
++        int i, j; // loop indexes
++        /*
++         * 1st step: As explained above, resizing an instruction may require to
++         * resize another one, which may require to resize yet another one, and
++         * so on. The first step of the algorithm consists in finding all the
++         * instructions that need to be resized, without modifying the code.
++         * This is done by the following "fix point" algorithm:
++         *
++         * Parse the code to find the jump instructions whose offset will need
++         * more than 2 bytes to be stored (the future offset is computed from
++         * the current offset and from the number of bytes that will be inserted
++         * or removed between the source and target instructions). For each such
++         * instruction, adds an entry in (a copy of) the indexes and sizes
++         * arrays (if this has not already been done in a previous iteration!).
++         *
++         * If at least one entry has been added during the previous step, go
++         * back to the beginning, otherwise stop.
++         *
++         * In fact the real algorithm is complicated by the fact that the size
++         * of TABLESWITCH and LOOKUPSWITCH instructions depends on their
++         * position in the bytecode (because of padding). In order to ensure the
++         * convergence of the algorithm, the number of bytes to be added or
++         * removed from these instructions is over estimated during the previous
++         * loop, and computed exactly only after the loop is finished (this
++         * requires another pass to parse the bytecode of the method).
++         */
++        int[] allIndexes = new int[0]; // copy of indexes
++        int[] allSizes = new int[0]; // copy of sizes
++        boolean[] resize; // instructions to be resized
++        int newOffset; // future offset of a jump instruction
++
++        resize = new boolean[code.length];
++
++        // 3 = loop again, 2 = loop ended, 1 = last pass, 0 = done
++        int state = 3;
++        do {
++            if (state == 3) {
++                state = 2;
++            }
++            u = 0;
++            while (u < b.length) {
++                int opcode = b[u] & 0xFF; // opcode of current instruction
++                int insert = 0; // bytes to be added after this instruction
++
++                switch (ClassWriter.TYPE[opcode]) {
++                    case ClassWriter.NOARG_INSN:
++                    case ClassWriter.IMPLVAR_INSN:
++                        u += 1;
++                        break;
++                    case ClassWriter.LABEL_INSN:
++                        if (opcode > 201) {
++                            // converts temporary opcodes 202 to 217, 218 and
++                            // 219 to IFEQ ... JSR (inclusive), IFNULL and
++                            // IFNONNULL
++                            opcode = opcode < 218 ? opcode - 49 : opcode - 20;
++                            label = u + readUnsignedShort(b, u + 1);
++                        } else {
++                            label = u + readShort(b, u + 1);
++                        }
++                        newOffset = getNewOffset(allIndexes, allSizes, u, label);
++                        if (newOffset < Short.MIN_VALUE
++                                || newOffset > Short.MAX_VALUE)
++                        {
++                            if (!resize[u]) {
++                                if (opcode == Opcodes.GOTO
++                                        || opcode == Opcodes.JSR)
++                                {
++                                    // two additional bytes will be required to
++                                    // replace this GOTO or JSR instruction with
++                                    // a GOTO_W or a JSR_W
++                                    insert = 2;
++                                } else {
++                                    // five additional bytes will be required to
++                                    // replace this IFxxx <l> instruction with
++                                    // IFNOTxxx <l'> GOTO_W <l>, where IFNOTxxx
++                                    // is the "opposite" opcode of IFxxx (i.e.,
++                                    // IFNE for IFEQ) and where <l'> designates
++                                    // the instruction just after the GOTO_W.
++                                    insert = 5;
++                                }
++                                resize[u] = true;
++                            }
++                        }
++                        u += 3;
++                        break;
++                    case ClassWriter.LABELW_INSN:
++                        u += 5;
++                        break;
++                    case ClassWriter.TABL_INSN:
++                        if (state == 1) {
++                            // true number of bytes to be added (or removed)
++                            // from this instruction = (future number of padding
++                            // bytes - current number of padding byte) -
++                            // previously over estimated variation =
++                            // = ((3 - newOffset%4) - (3 - u%4)) - u%4
++                            // = (-newOffset%4 + u%4) - u%4
++                            // = -(newOffset & 3)
++                            newOffset = getNewOffset(allIndexes, allSizes, 0, u);
++                            insert = -(newOffset & 3);
++                        } else if (!resize[u]) {
++                            // over estimation of the number of bytes to be
++                            // added to this instruction = 3 - current number
++                            // of padding bytes = 3 - (3 - u%4) = u%4 = u & 3
++                            insert = u & 3;
++                            resize[u] = true;
++                        }
++                        // skips instruction
++                        u = u + 4 - (u & 3);
++                        u += 4 * (readInt(b, u + 8) - readInt(b, u + 4) + 1) + 12;
++                        break;
++                    case ClassWriter.LOOK_INSN:
++                        if (state == 1) {
++                            // like TABL_INSN
++                            newOffset = getNewOffset(allIndexes, allSizes, 0, u);
++                            insert = -(newOffset & 3);
++                        } else if (!resize[u]) {
++                            // like TABL_INSN
++                            insert = u & 3;
++                            resize[u] = true;
++                        }
++                        // skips instruction
++                        u = u + 4 - (u & 3);
++                        u += 8 * readInt(b, u + 4) + 8;
++                        break;
++                    case ClassWriter.WIDE_INSN:
++                        opcode = b[u + 1] & 0xFF;
++                        if (opcode == Opcodes.IINC) {
++                            u += 6;
++                        } else {
++                            u += 4;
++                        }
++                        break;
++                    case ClassWriter.VAR_INSN:
++                    case ClassWriter.SBYTE_INSN:
++                    case ClassWriter.LDC_INSN:
++                        u += 2;
++                        break;
++                    case ClassWriter.SHORT_INSN:
++                    case ClassWriter.LDCW_INSN:
++                    case ClassWriter.FIELDORMETH_INSN:
++                    case ClassWriter.TYPE_INSN:
++                    case ClassWriter.IINC_INSN:
++                        u += 3;
++                        break;
++                    case ClassWriter.ITFMETH_INSN:
++                        u += 5;
++                        break;
++                    // case ClassWriter.MANA_INSN:
++                    default:
++                        u += 4;
++                        break;
++                }
++                if (insert != 0) {
++                    // adds a new (u, insert) entry in the allIndexes and
++                    // allSizes arrays
++                    int[] newIndexes = new int[allIndexes.length + 1];
++                    int[] newSizes = new int[allSizes.length + 1];
++                    System.arraycopy(allIndexes,
++                            0,
++                            newIndexes,
++                            0,
++                            allIndexes.length);
++                    System.arraycopy(allSizes, 0, newSizes, 0, allSizes.length);
++                    newIndexes[allIndexes.length] = u;
++                    newSizes[allSizes.length] = insert;
++                    allIndexes = newIndexes;
++                    allSizes = newSizes;
++                    if (insert > 0) {
++                        state = 3;
++                    }
++                }
++            }
++            if (state < 3) {
++                --state;
++            }
++        } while (state != 0);
++
++        // 2nd step:
++        // copies the bytecode of the method into a new bytevector, updates the
++        // offsets, and inserts (or removes) bytes as requested.
++
++        ByteVector newCode = new ByteVector(code.length);
++
++        u = 0;
++        while (u < code.length) {
++            int opcode = b[u] & 0xFF;
++            switch (ClassWriter.TYPE[opcode]) {
++                case ClassWriter.NOARG_INSN:
++                case ClassWriter.IMPLVAR_INSN:
++                    newCode.putByte(opcode);
++                    u += 1;
++                    break;
++                case ClassWriter.LABEL_INSN:
++                    if (opcode > 201) {
++                        // changes temporary opcodes 202 to 217 (inclusive), 218
++                        // and 219 to IFEQ ... JSR (inclusive), IFNULL and
++                        // IFNONNULL
++                        opcode = opcode < 218 ? opcode - 49 : opcode - 20;
++                        label = u + readUnsignedShort(b, u + 1);
++                    } else {
++                        label = u + readShort(b, u + 1);
++                    }
++                    newOffset = getNewOffset(allIndexes, allSizes, u, label);
++                    if (resize[u]) {
++                        // replaces GOTO with GOTO_W, JSR with JSR_W and IFxxx
++                        // <l> with IFNOTxxx <l'> GOTO_W <l>, where IFNOTxxx is
++                        // the "opposite" opcode of IFxxx (i.e., IFNE for IFEQ)
++                        // and where <l'> designates the instruction just after
++                        // the GOTO_W.
++                        if (opcode == Opcodes.GOTO) {
++                            newCode.putByte(200); // GOTO_W
++                        } else if (opcode == Opcodes.JSR) {
++                            newCode.putByte(201); // JSR_W
++                        } else {
++                            newCode.putByte(opcode <= 166
++                                    ? ((opcode + 1) ^ 1) - 1
++                                    : opcode ^ 1);
++                            newCode.putShort(8); // jump offset
++                            newCode.putByte(200); // GOTO_W
++                            // newOffset now computed from start of GOTO_W
++                            newOffset -= 3;
++                        }
++                        newCode.putInt(newOffset);
++                    } else {
++                        newCode.putByte(opcode);
++                        newCode.putShort(newOffset);
++                    }
++                    u += 3;
++                    break;
++                case ClassWriter.LABELW_INSN:
++                    label = u + readInt(b, u + 1);
++                    newOffset = getNewOffset(allIndexes, allSizes, u, label);
++                    newCode.putByte(opcode);
++                    newCode.putInt(newOffset);
++                    u += 5;
++                    break;
++                case ClassWriter.TABL_INSN:
++                    // skips 0 to 3 padding bytes
++                    v = u;
++                    u = u + 4 - (v & 3);
++                    // reads and copies instruction
++                    newCode.putByte(Opcodes.TABLESWITCH);
++                    newCode.length += (4 - newCode.length % 4) % 4;
++                    label = v + readInt(b, u);
++                    u += 4;
++                    newOffset = getNewOffset(allIndexes, allSizes, v, label);
++                    newCode.putInt(newOffset);
++                    j = readInt(b, u);
++                    u += 4;
++                    newCode.putInt(j);
++                    j = readInt(b, u) - j + 1;
++                    u += 4;
++                    newCode.putInt(readInt(b, u - 4));
++                    for (; j > 0; --j) {
++                        label = v + readInt(b, u);
++                        u += 4;
++                        newOffset = getNewOffset(allIndexes, allSizes, v, label);
++                        newCode.putInt(newOffset);
++                    }
++                    break;
++                case ClassWriter.LOOK_INSN:
++                    // skips 0 to 3 padding bytes
++                    v = u;
++                    u = u + 4 - (v & 3);
++                    // reads and copies instruction
++                    newCode.putByte(Opcodes.LOOKUPSWITCH);
++                    newCode.length += (4 - newCode.length % 4) % 4;
++                    label = v + readInt(b, u);
++                    u += 4;
++                    newOffset = getNewOffset(allIndexes, allSizes, v, label);
++                    newCode.putInt(newOffset);
++                    j = readInt(b, u);
++                    u += 4;
++                    newCode.putInt(j);
++                    for (; j > 0; --j) {
++                        newCode.putInt(readInt(b, u));
++                        u += 4;
++                        label = v + readInt(b, u);
++                        u += 4;
++                        newOffset = getNewOffset(allIndexes, allSizes, v, label);
++                        newCode.putInt(newOffset);
++                    }
++                    break;
++                case ClassWriter.WIDE_INSN:
++                    opcode = b[u + 1] & 0xFF;
++                    if (opcode == Opcodes.IINC) {
++                        newCode.putByteArray(b, u, 6);
++                        u += 6;
++                    } else {
++                        newCode.putByteArray(b, u, 4);
++                        u += 4;
++                    }
++                    break;
++                case ClassWriter.VAR_INSN:
++                case ClassWriter.SBYTE_INSN:
++                case ClassWriter.LDC_INSN:
++                    newCode.putByteArray(b, u, 2);
++                    u += 2;
++                    break;
++                case ClassWriter.SHORT_INSN:
++                case ClassWriter.LDCW_INSN:
++                case ClassWriter.FIELDORMETH_INSN:
++                case ClassWriter.TYPE_INSN:
++                case ClassWriter.IINC_INSN:
++                    newCode.putByteArray(b, u, 3);
++                    u += 3;
++                    break;
++                case ClassWriter.ITFMETH_INSN:
++                    newCode.putByteArray(b, u, 5);
++                    u += 5;
++                    break;
++                // case MANA_INSN:
++                default:
++                    newCode.putByteArray(b, u, 4);
++                    u += 4;
++                    break;
++            }
++        }
++
++        // recomputes the stack map frames
++        if (frameCount > 0) {
++            if (compute == FRAMES) {
++                frameCount = 0;
++                stackMap = null;
++                previousFrame = null;
++                frame = null;
++                Frame f = new Frame();
++                f.owner = labels;
++                Type[] args = Type.getArgumentTypes(descriptor);
++                f.initInputFrame(cw, access, args, maxLocals);
++                visitFrame(f);
++                Label l = labels;
++                while (l != null) {
++                    /*
++                     * here we need the original label position. getNewOffset
++                     * must therefore never have been called for this label.
++                     */
++                    u = l.position - 3;
++                    if ((l.status & Label.STORE) != 0 || (u >= 0 && resize[u]))
++                    {
++                        getNewOffset(allIndexes, allSizes, l);
++                        // TODO update offsets in UNINITIALIZED values
++                        visitFrame(l.frame);
++                    }
++                    l = l.successor;
++                }
++            } else {
++                /*
++                 * Resizing an existing stack map frame table is really hard.
++                 * Not only the table must be parsed to update the offets, but
++                 * new frames may be needed for jump instructions that were
++                 * inserted by this method. And updating the offsets or
++                 * inserting frames can change the format of the following
++                 * frames, in case of packed frames. In practice the whole table
++                 * must be recomputed. For this the frames are marked as
++                 * potentially invalid. This will cause the whole class to be
++                 * reread and rewritten with the COMPUTE_FRAMES option (see the
++                 * ClassWriter.toByteArray method). This is not very efficient
++                 * but is much easier and requires much less code than any other
++                 * method I can think of.
++                 */
++                cw.invalidFrames = true;
++            }
++        }
++        // updates the exception handler block labels
++        Handler h = firstHandler;
++        while (h != null) {
++            getNewOffset(allIndexes, allSizes, h.start);
++            getNewOffset(allIndexes, allSizes, h.end);
++            getNewOffset(allIndexes, allSizes, h.handler);
++            h = h.next;
++        }
++        // updates the instructions addresses in the
++        // local var and line number tables
++        for (i = 0; i < 2; ++i) {
++            ByteVector bv = i == 0 ? localVar : localVarType;
++            if (bv != null) {
++                b = bv.data;
++                u = 0;
++                while (u < bv.length) {
++                    label = readUnsignedShort(b, u);
++                    newOffset = getNewOffset(allIndexes, allSizes, 0, label);
++                    writeShort(b, u, newOffset);
++                    label += readUnsignedShort(b, u + 2);
++                    newOffset = getNewOffset(allIndexes, allSizes, 0, label)
++                            - newOffset;
++                    writeShort(b, u + 2, newOffset);
++                    u += 10;
++                }
++            }
++        }
++        if (lineNumber != null) {
++            b = lineNumber.data;
++            u = 0;
++            while (u < lineNumber.length) {
++                writeShort(b, u, getNewOffset(allIndexes,
++                        allSizes,
++                        0,
++                        readUnsignedShort(b, u)));
++                u += 4;
++            }
++        }
++        // updates the labels of the other attributes
++        Attribute attr = cattrs;
++        while (attr != null) {
++            Label[] labels = attr.getLabels();
++            if (labels != null) {
++                for (i = labels.length - 1; i >= 0; --i) {
++                    getNewOffset(allIndexes, allSizes, labels[i]);
++                }
++            }
++            attr = attr.next;
++        }
++
++        // replaces old bytecodes with new ones
++        code = newCode;
++    }
++
++    /**
++     * Reads an unsigned short value in the given byte array.
++     *
++     * @param b a byte array.
++     * @param index the start index of the value to be read.
++     * @return the read value.
++     */
++    static int readUnsignedShort(final byte[] b, final int index) {
++        return ((b[index] & 0xFF) << 8) | (b[index + 1] & 0xFF);
++    }
++
++    /**
++     * Reads a signed short value in the given byte array.
++     *
++     * @param b a byte array.
++     * @param index the start index of the value to be read.
++     * @return the read value.
++     */
++    static short readShort(final byte[] b, final int index) {
++        return (short) (((b[index] & 0xFF) << 8) | (b[index + 1] & 0xFF));
++    }
++
++    /**
++     * Reads a signed int value in the given byte array.
++     *
++     * @param b a byte array.
++     * @param index the start index of the value to be read.
++     * @return the read value.
++     */
++    static int readInt(final byte[] b, final int index) {
++        return ((b[index] & 0xFF) << 24) | ((b[index + 1] & 0xFF) << 16)
++                | ((b[index + 2] & 0xFF) << 8) | (b[index + 3] & 0xFF);
++    }
++
++    /**
++     * Writes a short value in the given byte array.
++     *
++     * @param b a byte array.
++     * @param index where the first byte of the short value must be written.
++     * @param s the value to be written in the given byte array.
++     */
++    static void writeShort(final byte[] b, final int index, final int s) {
++        b[index] = (byte) (s >>> 8);
++        b[index + 1] = (byte) s;
++    }
++
++    /**
++     * Computes the future value of a bytecode offset. <p> Note: it is possible
++     * to have several entries for the same instruction in the <tt>indexes</tt>
++     * and <tt>sizes</tt>: two entries (index=a,size=b) and (index=a,size=b')
++     * are equivalent to a single entry (index=a,size=b+b').
++     *
++     * @param indexes current positions of the instructions to be resized. Each
++     *        instruction must be designated by the index of its <i>last</i>
++     *        byte, plus one (or, in other words, by the index of the <i>first</i>
++     *        byte of the <i>next</i> instruction).
++     * @param sizes the number of bytes to be <i>added</i> to the above
++     *        instructions. More precisely, for each i < <tt>len</tt>,
++     *        <tt>sizes</tt>[i] bytes will be added at the end of the
++     *        instruction designated by <tt>indexes</tt>[i] or, if
++     *        <tt>sizes</tt>[i] is negative, the <i>last</i> |<tt>sizes[i]</tt>|
++     *        bytes of the instruction will be removed (the instruction size
++     *        <i>must not</i> become negative or null).
++     * @param begin index of the first byte of the source instruction.
++     * @param end index of the first byte of the target instruction.
++     * @return the future value of the given bytecode offset.
++     */
++    static int getNewOffset(
++        final int[] indexes,
++        final int[] sizes,
++        final int begin,
++        final int end)
++    {
++        int offset = end - begin;
++        for (int i = 0; i < indexes.length; ++i) {
++            if (begin < indexes[i] && indexes[i] <= end) {
++                // forward jump
++                offset += sizes[i];
++            } else if (end < indexes[i] && indexes[i] <= begin) {
++                // backward jump
++                offset -= sizes[i];
++            }
++        }
++        return offset;
++    }
++
++    /**
++     * Updates the offset of the given label.
++     *
++     * @param indexes current positions of the instructions to be resized. Each
++     *        instruction must be designated by the index of its <i>last</i>
++     *        byte, plus one (or, in other words, by the index of the <i>first</i>
++     *        byte of the <i>next</i> instruction).
++     * @param sizes the number of bytes to be <i>added</i> to the above
++     *        instructions. More precisely, for each i < <tt>len</tt>,
++     *        <tt>sizes</tt>[i] bytes will be added at the end of the
++     *        instruction designated by <tt>indexes</tt>[i] or, if
++     *        <tt>sizes</tt>[i] is negative, the <i>last</i> |<tt>sizes[i]</tt>|
++     *        bytes of the instruction will be removed (the instruction size
++     *        <i>must not</i> become negative or null).
++     * @param label the label whose offset must be updated.
++     */
++    static void getNewOffset(
++        final int[] indexes,
++        final int[] sizes,
++        final Label label)
++    {
++        if ((label.status & Label.RESIZED) == 0) {
++            label.position = getNewOffset(indexes, sizes, 0, label.position);
++            label.status |= Label.RESIZED;
++        }
++    }
++}
+--- /dev/null	Thu Jul 30 19:03:43 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/org/objectweb/asm/Opcodes.java	Thu Jul 30 19:03:42 2009
+@@ -0,0 +1,371 @@
++/*
++ * Copyright 2005-2009 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++
++/*
++ * This file is available under and governed by the GNU General Public
++ * License version 2 only, as published by the Free Software Foundation.
++ * However, the following notice accompanied the original version of this
++ * file:
++ *
++ * ASM: a very small and fast Java bytecode manipulation framework
++ * Copyright (c) 2000-2007 INRIA, France Telecom
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ *    notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ *    notice, this list of conditions and the following disclaimer in the
++ *    documentation and/or other materials provided with the distribution.
++ * 3. Neither the name of the copyright holders nor the names of its
++ *    contributors may be used to endorse or promote products derived from
++ *    this software without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
++ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
++ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
++ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
++ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
++ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
++ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
++ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
++ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
++ * THE POSSIBILITY OF SUCH DAMAGE.
++ */
++package com.sun.xml.internal.ws.org.objectweb.asm;
++
++/**
++ * Defines the JVM opcodes, access flags and array type codes. This interface
++ * does not define all the JVM opcodes because some opcodes are automatically
++ * handled. For example, the xLOAD and xSTORE opcodes are automatically replaced
++ * by xLOAD_n and xSTORE_n opcodes when possible. The xLOAD_n and xSTORE_n
++ * opcodes are therefore not defined in this interface. Likewise for LDC,
++ * automatically replaced by LDC_W or LDC2_W when necessary, WIDE, GOTO_W and
++ * JSR_W.
++ *
++ * @author Eric Bruneton
++ * @author Eugene Kuleshov
++ */
++public interface Opcodes {
++
++    // versions
++
++    int V1_1 = 3 << 16 | 45;
++    int V1_2 = 0 << 16 | 46;
++    int V1_3 = 0 << 16 | 47;
++    int V1_4 = 0 << 16 | 48;
++    int V1_5 = 0 << 16 | 49;
++    int V1_6 = 0 << 16 | 50;
++
++    // access flags
++
++    int ACC_PUBLIC = 0x0001; // class, field, method
++    int ACC_PRIVATE = 0x0002; // class, field, method
++    int ACC_PROTECTED = 0x0004; // class, field, method
++    int ACC_STATIC = 0x0008; // field, method
++    int ACC_FINAL = 0x0010; // class, field, method
++    int ACC_SUPER = 0x0020; // class
++    int ACC_SYNCHRONIZED = 0x0020; // method
++    int ACC_VOLATILE = 0x0040; // field
++    int ACC_BRIDGE = 0x0040; // method
++    int ACC_VARARGS = 0x0080; // method
++    int ACC_TRANSIENT = 0x0080; // field
++    int ACC_NATIVE = 0x0100; // method
++    int ACC_INTERFACE = 0x0200; // class
++    int ACC_ABSTRACT = 0x0400; // class, method
++    int ACC_STRICT = 0x0800; // method
++    int ACC_SYNTHETIC = 0x1000; // class, field, method
++    int ACC_ANNOTATION = 0x2000; // class
++    int ACC_ENUM = 0x4000; // class(?) field inner
++
++    // ASM specific pseudo access flags
++
++    int ACC_DEPRECATED = 131072; // class, field, method
++
++    // types for NEWARRAY
++
++    int T_BOOLEAN = 4;
++    int T_CHAR = 5;
++    int T_FLOAT = 6;
++    int T_DOUBLE = 7;
++    int T_BYTE = 8;
++    int T_SHORT = 9;
++    int T_INT = 10;
++    int T_LONG = 11;
++
++    // stack map frame types
++
++    /**
++     * Represents an expanded frame. See {@link ClassReader#EXPAND_FRAMES}.
++     */
++    int F_NEW = -1;
++
++    /**
++     * Represents a compressed frame with complete frame data.
++     */
++    int F_FULL = 0;
++
++    /**
++     * Represents a compressed frame where locals are the same as the locals in
++     * the previous frame, except that additional 1-3 locals are defined, and
++     * with an empty stack.
++     */
++    int F_APPEND = 1;
++
++    /**
++     * Represents a compressed frame where locals are the same as the locals in
++     * the previous frame, except that the last 1-3 locals are absent and with
++     * an empty stack.
++     */
++    int F_CHOP = 2;
++
++    /**
++     * Represents a compressed frame with exactly the same locals as the
++     * previous frame and with an empty stack.
++     */
++    int F_SAME = 3;
++
++    /**
++     * Represents a compressed frame with exactly the same locals as the
++     * previous frame and with a single value on the stack.
++     */
++    int F_SAME1 = 4;
++
++    Integer TOP = new Integer(0);
++    Integer INTEGER = new Integer(1);
++    Integer FLOAT = new Integer(2);
++    Integer DOUBLE = new Integer(3);
++    Integer LONG = new Integer(4);
++    Integer NULL = new Integer(5);
++    Integer UNINITIALIZED_THIS = new Integer(6);
++
++    // opcodes // visit method (- = idem)
++
++    int NOP = 0; // visitInsn
++    int ACONST_NULL = 1; // -
++    int ICONST_M1 = 2; // -
++    int ICONST_0 = 3; // -
++    int ICONST_1 = 4; // -
++    int ICONST_2 = 5; // -
++    int ICONST_3 = 6; // -
++    int ICONST_4 = 7; // -
++    int ICONST_5 = 8; // -
++    int LCONST_0 = 9; // -
++    int LCONST_1 = 10; // -
++    int FCONST_0 = 11; // -
++    int FCONST_1 = 12; // -
++    int FCONST_2 = 13; // -
++    int DCONST_0 = 14; // -
++    int DCONST_1 = 15; // -
++    int BIPUSH = 16; // visitIntInsn
++    int SIPUSH = 17; // -
++    int LDC = 18; // visitLdcInsn
++    // int LDC_W = 19; // -
++    // int LDC2_W = 20; // -
++    int ILOAD = 21; // visitVarInsn
++    int LLOAD = 22; // -
++    int FLOAD = 23; // -
++    int DLOAD = 24; // -
++    int ALOAD = 25; // -
++    // int ILOAD_0 = 26; // -
++    // int ILOAD_1 = 27; // -
++    // int ILOAD_2 = 28; // -
++    // int ILOAD_3 = 29; // -
++    // int LLOAD_0 = 30; // -
++    // int LLOAD_1 = 31; // -
++    // int LLOAD_2 = 32; // -
++    // int LLOAD_3 = 33; // -
++    // int FLOAD_0 = 34; // -
++    // int FLOAD_1 = 35; // -
++    // int FLOAD_2 = 36; // -
++    // int FLOAD_3 = 37; // -
++    // int DLOAD_0 = 38; // -
++    // int DLOAD_1 = 39; // -
++    // int DLOAD_2 = 40; // -
++    // int DLOAD_3 = 41; // -
++    // int ALOAD_0 = 42; // -
++    // int ALOAD_1 = 43; // -
++    // int ALOAD_2 = 44; // -
++    // int ALOAD_3 = 45; // -
++    int IALOAD = 46; // visitInsn
++    int LALOAD = 47; // -
++    int FALOAD = 48; // -
++    int DALOAD = 49; // -
++    int AALOAD = 50; // -
++    int BALOAD = 51; // -
++    int CALOAD = 52; // -
++    int SALOAD = 53; // -
++    int ISTORE = 54; // visitVarInsn
++    int LSTORE = 55; // -
++    int FSTORE = 56; // -
++    int DSTORE = 57; // -
++    int ASTORE = 58; // -
++    // int ISTORE_0 = 59; // -
++    // int ISTORE_1 = 60; // -
++    // int ISTORE_2 = 61; // -
++    // int ISTORE_3 = 62; // -
++    // int LSTORE_0 = 63; // -
++    // int LSTORE_1 = 64; // -
++    // int LSTORE_2 = 65; // -
++    // int LSTORE_3 = 66; // -
++    // int FSTORE_0 = 67; // -
++    // int FSTORE_1 = 68; // -
++    // int FSTORE_2 = 69; // -
++    // int FSTORE_3 = 70; // -
++    // int DSTORE_0 = 71; // -
++    // int DSTORE_1 = 72; // -
++    // int DSTORE_2 = 73; // -
++    // int DSTORE_3 = 74; // -
++    // int ASTORE_0 = 75; // -
++    // int ASTORE_1 = 76; // -
++    // int ASTORE_2 = 77; // -
++    // int ASTORE_3 = 78; // -
++    int IASTORE = 79; // visitInsn
++    int LASTORE = 80; // -
++    int FASTORE = 81; // -
++    int DASTORE = 82; // -
++    int AASTORE = 83; // -
++    int BASTORE = 84; // -
++    int CASTORE = 85; // -
++    int SASTORE = 86; // -
++    int POP = 87; // -
++    int POP2 = 88; // -
++    int DUP = 89; // -
++    int DUP_X1 = 90; // -
++    int DUP_X2 = 91; // -
++    int DUP2 = 92; // -
++    int DUP2_X1 = 93; // -
++    int DUP2_X2 = 94; // -
++    int SWAP = 95; // -
++    int IADD = 96; // -
++    int LADD = 97; // -
++    int FADD = 98; // -
++    int DADD = 99; // -
++    int ISUB = 100; // -
++    int LSUB = 101; // -
++    int FSUB = 102; // -
++    int DSUB = 103; // -
++    int IMUL = 104; // -
++    int LMUL = 105; // -
++    int FMUL = 106; // -
++    int DMUL = 107; // -
++    int IDIV = 108; // -
++    int LDIV = 109; // -
++    int FDIV = 110; // -
++    int DDIV = 111; // -
++    int IREM = 112; // -
++    int LREM = 113; // -
++    int FREM = 114; // -
++    int DREM = 115; // -
++    int INEG = 116; // -
++    int LNEG = 117; // -
++    int FNEG = 118; // -
++    int DNEG = 119; // -
++    int ISHL = 120; // -
++    int LSHL = 121; // -
++    int ISHR = 122; // -
++    int LSHR = 123; // -
++    int IUSHR = 124; // -
++    int LUSHR = 125; // -
++    int IAND = 126; // -
++    int LAND = 127; // -
++    int IOR = 128; // -
++    int LOR = 129; // -
++    int IXOR = 130; // -
++    int LXOR = 131; // -
++    int IINC = 132; // visitIincInsn
++    int I2L = 133; // visitInsn
++    int I2F = 134; // -
++    int I2D = 135; // -
++    int L2I = 136; // -
++    int L2F = 137; // -
++    int L2D = 138; // -
++    int F2I = 139; // -
++    int F2L = 140; // -
++    int F2D = 141; // -
++    int D2I = 142; // -
++    int D2L = 143; // -
++    int D2F = 144; // -
++    int I2B = 145; // -
++    int I2C = 146; // -
++    int I2S = 147; // -
++    int LCMP = 148; // -
++    int FCMPL = 149; // -
++    int FCMPG = 150; // -
++    int DCMPL = 151; // -
++    int DCMPG = 152; // -
++    int IFEQ = 153; // visitJumpInsn
++    int IFNE = 154; // -
++    int IFLT = 155; // -
++    int IFGE = 156; // -
++    int IFGT = 157; // -
++    int IFLE = 158; // -
++    int IF_ICMPEQ = 159; // -
++    int IF_ICMPNE = 160; // -
++    int IF_ICMPLT = 161; // -
++    int IF_ICMPGE = 162; // -
++    int IF_ICMPGT = 163; // -
++    int IF_ICMPLE = 164; // -
++    int IF_ACMPEQ = 165; // -
++    int IF_ACMPNE = 166; // -
++    int GOTO = 167; // -
++    int JSR = 168; // -
++    int RET = 169; // visitVarInsn
++    int TABLESWITCH = 170; // visiTableSwitchInsn
++    int LOOKUPSWITCH = 171; // visitLookupSwitch
++    int IRETURN = 172; // visitInsn
++    int LRETURN = 173; // -
++    int FRETURN = 174; // -
++    int DRETURN = 175; // -
++    int ARETURN = 176; // -
++    int RETURN = 177; // -
++    int GETSTATIC = 178; // visitFieldInsn
++    int PUTSTATIC = 179; // -
++    int GETFIELD = 180; // -
++    int PUTFIELD = 181; // -
++    int INVOKEVIRTUAL = 182; // visitMethodInsn
++    int INVOKESPECIAL = 183; // -
++    int INVOKESTATIC = 184; // -
++    int INVOKEINTERFACE = 185; // -
++    // int UNUSED = 186; // NOT VISITED
++    int NEW = 187; // visitTypeInsn
++    int NEWARRAY = 188; // visitIntInsn
++    int ANEWARRAY = 189; // visitTypeInsn
++    int ARRAYLENGTH = 190; // visitInsn
++    int ATHROW = 191; // -
++    int CHECKCAST = 192; // visitTypeInsn
++    int INSTANCEOF = 193; // -
++    int MONITORENTER = 194; // visitInsn
++    int MONITOREXIT = 195; // -
++    // int WIDE = 196; // NOT VISITED
++    int MULTIANEWARRAY = 197; // visitMultiANewArrayInsn
++    int IFNULL = 198; // visitJumpInsn
++    int IFNONNULL = 199; // -
++    // int GOTO_W = 200; // -
++    // int JSR_W = 201; // -
++}
+--- /dev/null	Thu Jul 30 19:03:46 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/org/objectweb/asm/Type.java	Thu Jul 30 19:03:45 2009
+@@ -0,0 +1,824 @@
++/*
++ * Copyright 2005-2009 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++
++/*
++ * This file is available under and governed by the GNU General Public
++ * License version 2 only, as published by the Free Software Foundation.
++ * However, the following notice accompanied the original version of this
++ * file:
++ *
++ * ASM: a very small and fast Java bytecode manipulation framework
++ * Copyright (c) 2000-2007 INRIA, France Telecom
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ *    notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ *    notice, this list of conditions and the following disclaimer in the
++ *    documentation and/or other materials provided with the distribution.
++ * 3. Neither the name of the copyright holders nor the names of its
++ *    contributors may be used to endorse or promote products derived from
++ *    this software without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
++ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
++ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
++ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
++ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
++ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
++ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
++ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
++ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
++ * THE POSSIBILITY OF SUCH DAMAGE.
++ */
++package com.sun.xml.internal.ws.org.objectweb.asm;
++
++import java.lang.reflect.Constructor;
++import java.lang.reflect.Method;
++
++/**
++ * A Java type. This class can be used to make it easier to manipulate type and
++ * method descriptors.
++ *
++ * @author Eric Bruneton
++ * @author Chris Nokleberg
++ */
++public class Type {
++
++    /**
++     * The sort of the <tt>void</tt> type. See {@link #getSort getSort}.
++     */
++    public static final int VOID = 0;
++
++    /**
++     * The sort of the <tt>boolean</tt> type. See {@link #getSort getSort}.
++     */
++    public static final int BOOLEAN = 1;
++
++    /**
++     * The sort of the <tt>char</tt> type. See {@link #getSort getSort}.
++     */
++    public static final int CHAR = 2;
++
++    /**
++     * The sort of the <tt>byte</tt> type. See {@link #getSort getSort}.
++     */
++    public static final int BYTE = 3;
++
++    /**
++     * The sort of the <tt>short</tt> type. See {@link #getSort getSort}.
++     */
++    public static final int SHORT = 4;
++
++    /**
++     * The sort of the <tt>int</tt> type. See {@link #getSort getSort}.
++     */
++    public static final int INT = 5;
++
++    /**
++     * The sort of the <tt>float</tt> type. See {@link #getSort getSort}.
++     */
++    public static final int FLOAT = 6;
++
++    /**
++     * The sort of the <tt>long</tt> type. See {@link #getSort getSort}.
++     */
++    public static final int LONG = 7;
++
++    /**
++     * The sort of the <tt>double</tt> type. See {@link #getSort getSort}.
++     */
++    public static final int DOUBLE = 8;
++
++    /**
++     * The sort of array reference types. See {@link #getSort getSort}.
++     */
++    public static final int ARRAY = 9;
++
++    /**
++     * The sort of object reference type. See {@link #getSort getSort}.
++     */
++    public static final int OBJECT = 10;
++
++    /**
++     * The <tt>void</tt> type.
++     */
++    public static final Type VOID_TYPE = new Type(VOID);
++
++    /**
++     * The <tt>boolean</tt> type.
++     */
++    public static final Type BOOLEAN_TYPE = new Type(BOOLEAN);
++
++    /**
++     * The <tt>char</tt> type.
++     */
++    public static final Type CHAR_TYPE = new Type(CHAR);
++
++    /**
++     * The <tt>byte</tt> type.
++     */
++    public static final Type BYTE_TYPE = new Type(BYTE);
++
++    /**
++     * The <tt>short</tt> type.
++     */
++    public static final Type SHORT_TYPE = new Type(SHORT);
++
++    /**
++     * The <tt>int</tt> type.
++     */
++    public static final Type INT_TYPE = new Type(INT);
++
++    /**
++     * The <tt>float</tt> type.
++     */
++    public static final Type FLOAT_TYPE = new Type(FLOAT);
++
++    /**
++     * The <tt>long</tt> type.
++     */
++    public static final Type LONG_TYPE = new Type(LONG);
++
++    /**
++     * The <tt>double</tt> type.
++     */
++    public static final Type DOUBLE_TYPE = new Type(DOUBLE);
++
++    // ------------------------------------------------------------------------
++    // Fields
++    // ------------------------------------------------------------------------
++
++    /**
++     * The sort of this Java type.
++     */
++    private final int sort;
++
++    /**
++     * A buffer containing the internal name of this Java type. This field is
++     * only used for reference types.
++     */
++    private final char[] buf;
++
++    /**
++     * The offset of the internal name of this Java type in {@link #buf buf}.
++     * This field is only used for reference types.
++     */
++    private final int off;
++
++    /**
++     * The length of the internal name of this Java type. This field is only
++     * used for reference types.
++     */
++    private final int len;
++
++    // ------------------------------------------------------------------------
++    // Constructors
++    // ------------------------------------------------------------------------
++
++    /**
++     * Constructs a primitive type.
++     *
++     * @param sort the sort of the primitive type to be constructed.
++     */
++    private Type(final int sort) {
++        this(sort, null, 0, 1);
++    }
++
++    /**
++     * Constructs a reference type.
++     *
++     * @param sort the sort of the reference type to be constructed.
++     * @param buf a buffer containing the descriptor of the previous type.
++     * @param off the offset of this descriptor in the previous buffer.
++     * @param len the length of this descriptor.
++     */
++    private Type(final int sort, final char[] buf, final int off, final int len)
++    {
++        this.sort = sort;
++        this.buf = buf;
++        this.off = off;
++        this.len = len;
++    }
++
++    /**
++     * Returns the Java type corresponding to the given type descriptor.
++     *
++     * @param typeDescriptor a type descriptor.
++     * @return the Java type corresponding to the given type descriptor.
++     */
++    public static Type getType(final String typeDescriptor) {
++        return getType(typeDescriptor.toCharArray(), 0);
++    }
++
++    /**
++     * Returns the Java type corresponding to the given internal name.
++     *
++     * @param internalName an internal name.
++     * @return the Java type corresponding to the given internal name.
++     */
++    public static Type getObjectType(final String internalName) {
++        char[] buf = internalName.toCharArray();
++        return new Type(buf[0] == '[' ? ARRAY : OBJECT, buf, 0, buf.length);
++    }
++
++    /**
++     * Returns the Java type corresponding to the given class.
++     *
++     * @param c a class.
++     * @return the Java type corresponding to the given class.
++     */
++    public static Type getType(final Class c) {
++        if (c.isPrimitive()) {
++            if (c == Integer.TYPE) {
++                return INT_TYPE;
++            } else if (c == Void.TYPE) {
++                return VOID_TYPE;
++            } else if (c == Boolean.TYPE) {
++                return BOOLEAN_TYPE;
++            } else if (c == Byte.TYPE) {
++                return BYTE_TYPE;
++            } else if (c == Character.TYPE) {
++                return CHAR_TYPE;
++            } else if (c == Short.TYPE) {
++                return SHORT_TYPE;
++            } else if (c == Double.TYPE) {
++                return DOUBLE_TYPE;
++            } else if (c == Float.TYPE) {
++                return FLOAT_TYPE;
++            } else /* if (c == Long.TYPE) */{
++                return LONG_TYPE;
++            }
++        } else {
++            return getType(getDescriptor(c));
++        }
++    }
++
++    /**
++     * Returns the Java types corresponding to the argument types of the given
++     * method descriptor.
++     *
++     * @param methodDescriptor a method descriptor.
++     * @return the Java types corresponding to the argument types of the given
++     *         method descriptor.
++     */
++    public static Type[] getArgumentTypes(final String methodDescriptor) {
++        char[] buf = methodDescriptor.toCharArray();
++        int off = 1;
++        int size = 0;
++        while (true) {
++            char car = buf[off++];
++            if (car == ')') {
++                break;
++            } else if (car == 'L') {
++                while (buf[off++] != ';') {
++                }
++                ++size;
++            } else if (car != '[') {
++                ++size;
++            }
++        }
++        Type[] args = new Type[size];
++        off = 1;
++        size = 0;
++        while (buf[off] != ')') {
++            args[size] = getType(buf, off);
++            off += args[size].len + (args[size].sort == OBJECT ? 2 : 0);
++            size += 1;
++        }
++        return args;
++    }
++
++    /**
++     * Returns the Java types corresponding to the argument types of the given
++     * method.
++     *
++     * @param method a method.
++     * @return the Java types corresponding to the argument types of the given
++     *         method.
++     */
++    public static Type[] getArgumentTypes(final Method method) {
++        Class[] classes = method.getParameterTypes();
++        Type[] types = new Type[classes.length];
++        for (int i = classes.length - 1; i >= 0; --i) {
++            types[i] = getType(classes[i]);
++        }
++        return types;
++    }
++
++    /**
++     * Returns the Java type corresponding to the return type of the given
++     * method descriptor.
++     *
++     * @param methodDescriptor a method descriptor.
++     * @return the Java type corresponding to the return type of the given
++     *         method descriptor.
++     */
++    public static Type getReturnType(final String methodDescriptor) {
++        char[] buf = methodDescriptor.toCharArray();
++        return getType(buf, methodDescriptor.indexOf(')') + 1);
++    }
++
++    /**
++     * Returns the Java type corresponding to the return type of the given
++     * method.
++     *
++     * @param method a method.
++     * @return the Java type corresponding to the return type of the given
++     *         method.
++     */
++    public static Type getReturnType(final Method method) {
++        return getType(method.getReturnType());
++    }
++
++    /**
++     * Returns the Java type corresponding to the given type descriptor.
++     *
++     * @param buf a buffer containing a type descriptor.
++     * @param off the offset of this descriptor in the previous buffer.
++     * @return the Java type corresponding to the given type descriptor.
++     */
++    private static Type getType(final char[] buf, final int off) {
++        int len;
++        switch (buf[off]) {
++            case 'V':
++                return VOID_TYPE;
++            case 'Z':
++                return BOOLEAN_TYPE;
++            case 'C':
++                return CHAR_TYPE;
++            case 'B':
++                return BYTE_TYPE;
++            case 'S':
++                return SHORT_TYPE;
++            case 'I':
++                return INT_TYPE;
++            case 'F':
++                return FLOAT_TYPE;
++            case 'J':
++                return LONG_TYPE;
++            case 'D':
++                return DOUBLE_TYPE;
++            case '[':
++                len = 1;
++                while (buf[off + len] == '[') {
++                    ++len;
++                }
++                if (buf[off + len] == 'L') {
++                    ++len;
++                    while (buf[off + len] != ';') {
++                        ++len;
++                    }
++                }
++                return new Type(ARRAY, buf, off, len + 1);
++                // case 'L':
++            default:
++                len = 1;
++                while (buf[off + len] != ';') {
++                    ++len;
++                }
++                return new Type(OBJECT, buf, off + 1, len - 1);
++        }
++    }
++
++    // ------------------------------------------------------------------------
++    // Accessors
++    // ------------------------------------------------------------------------
++
++    /**
++     * Returns the sort of this Java type.
++     *
++     * @return {@link #VOID VOID}, {@link #BOOLEAN BOOLEAN},
++     *         {@link #CHAR CHAR}, {@link #BYTE BYTE}, {@link #SHORT SHORT},
++     *         {@link #INT INT}, {@link #FLOAT FLOAT}, {@link #LONG LONG},
++     *         {@link #DOUBLE DOUBLE}, {@link #ARRAY ARRAY} or
++     *         {@link #OBJECT OBJECT}.
++     */
++    public int getSort() {
++        return sort;
++    }
++
++    /**
++     * Returns the number of dimensions of this array type. This method should
++     * only be used for an array type.
++     *
++     * @return the number of dimensions of this array type.
++     */
++    public int getDimensions() {
++        int i = 1;
++        while (buf[off + i] == '[') {
++            ++i;
++        }
++        return i;
++    }
++
++    /**
++     * Returns the type of the elements of this array type. This method should
++     * only be used for an array type.
++     *
++     * @return Returns the type of the elements of this array type.
++     */
++    public Type getElementType() {
++        return getType(buf, off + getDimensions());
++    }
++
++    /**
++     * Returns the name of the class corresponding to this type.
++     *
++     * @return the fully qualified name of the class corresponding to this type.
++     */
++    public String getClassName() {
++        switch (sort) {
++            case VOID:
++                return "void";
++            case BOOLEAN:
++                return "boolean";
++            case CHAR:
++                return "char";
++            case BYTE:
++                return "byte";
++            case SHORT:
++                return "short";
++            case INT:
++                return "int";
++            case FLOAT:
++                return "float";
++            case LONG:
++                return "long";
++            case DOUBLE:
++                return "double";
++            case ARRAY:
++                StringBuffer b = new StringBuffer(getElementType().getClassName());
++                for (int i = getDimensions(); i > 0; --i) {
++                    b.append("[]");
++                }
++                return b.toString();
++                // case OBJECT:
++            default:
++                return new String(buf, off, len).replace('/', '.');
++        }
++    }
++
++    /**
++     * Returns the internal name of the class corresponding to this object or
++     * array type. The internal name of a class is its fully qualified name (as
++     * returned by Class.getName(), where '.' are replaced by '/'. This method
++     * should only be used for an object or array type.
++     *
++     * @return the internal name of the class corresponding to this object type.
++     */
++    public String getInternalName() {
++        return new String(buf, off, len);
++    }
++
++    // ------------------------------------------------------------------------
++    // Conversion to type descriptors
++    // ------------------------------------------------------------------------
++
++    /**
++     * Returns the descriptor corresponding to this Java type.
++     *
++     * @return the descriptor corresponding to this Java type.
++     */
++    public String getDescriptor() {
++        StringBuffer buf = new StringBuffer();
++        getDescriptor(buf);
++        return buf.toString();
++    }
++
++    /**
++     * Returns the descriptor corresponding to the given argument and return
++     * types.
++     *
++     * @param returnType the return type of the method.
++     * @param argumentTypes the argument types of the method.
++     * @return the descriptor corresponding to the given argument and return
++     *         types.
++     */
++    public static String getMethodDescriptor(
++        final Type returnType,
++        final Type[] argumentTypes)
++    {
++        StringBuffer buf = new StringBuffer();
++        buf.append('(');
++        for (int i = 0; i < argumentTypes.length; ++i) {
++            argumentTypes[i].getDescriptor(buf);
++        }
++        buf.append(')');
++        returnType.getDescriptor(buf);
++        return buf.toString();
++    }
++
++    /**
++     * Appends the descriptor corresponding to this Java type to the given
++     * string buffer.
++     *
++     * @param buf the string buffer to which the descriptor must be appended.
++     */
++    private void getDescriptor(final StringBuffer buf) {
++        switch (sort) {
++            case VOID:
++                buf.append('V');
++                return;
++            case BOOLEAN:
++                buf.append('Z');
++                return;
++            case CHAR:
++                buf.append('C');
++                return;
++            case BYTE:
++                buf.append('B');
++                return;
++            case SHORT:
++                buf.append('S');
++                return;
++            case INT:
++                buf.append('I');
++                return;
++            case FLOAT:
++                buf.append('F');
++                return;
++            case LONG:
++                buf.append('J');
++                return;
++            case DOUBLE:
++                buf.append('D');
++                return;
++            case ARRAY:
++                buf.append(this.buf, off, len);
++                return;
++                // case OBJECT:
++            default:
++                buf.append('L');
++                buf.append(this.buf, off, len);
++                buf.append(';');
++        }
++    }
++
++    // ------------------------------------------------------------------------
++    // Direct conversion from classes to type descriptors,
++    // without intermediate Type objects
++    // ------------------------------------------------------------------------
++
++    /**
++     * Returns the internal name of the given class. The internal name of a
++     * class is its fully qualified name, as returned by Class.getName(), where
++     * '.' are replaced by '/'.
++     *
++     * @param c an object or array class.
++     * @return the internal name of the given class.
++     */
++    public static String getInternalName(final Class c) {
++        return c.getName().replace('.', '/');
++    }
++
++    /**
++     * Returns the descriptor corresponding to the given Java type.
++     *
++     * @param c an object class, a primitive class or an array class.
++     * @return the descriptor corresponding to the given class.
++     */
++    public static String getDescriptor(final Class c) {
++        StringBuffer buf = new StringBuffer();
++        getDescriptor(buf, c);
++        return buf.toString();
++    }
++
++    /**
++     * Returns the descriptor corresponding to the given constructor.
++     *
++     * @param c a {@link Constructor Constructor} object.
++     * @return the descriptor of the given constructor.
++     */
++    public static String getConstructorDescriptor(final Constructor c) {
++        Class[] parameters = c.getParameterTypes();
++        StringBuffer buf = new StringBuffer();
++        buf.append('(');
++        for (int i = 0; i < parameters.length; ++i) {
++            getDescriptor(buf, parameters[i]);
++        }
++        return buf.append(")V").toString();
++    }
++
++    /**
++     * Returns the descriptor corresponding to the given method.
++     *
++     * @param m a {@link Method Method} object.
++     * @return the descriptor of the given method.
++     */
++    public static String getMethodDescriptor(final Method m) {
++        Class[] parameters = m.getParameterTypes();
++        StringBuffer buf = new StringBuffer();
++        buf.append('(');
++        for (int i = 0; i < parameters.length; ++i) {
++            getDescriptor(buf, parameters[i]);
++        }
++        buf.append(')');
++        getDescriptor(buf, m.getReturnType());
++        return buf.toString();
++    }
++
++    /**
++     * Appends the descriptor of the given class to the given string buffer.
++     *
++     * @param buf the string buffer to which the descriptor must be appended.
++     * @param c the class whose descriptor must be computed.
++     */
++    private static void getDescriptor(final StringBuffer buf, final Class c) {
++        Class d = c;
++        while (true) {
++            if (d.isPrimitive()) {
++                char car;
++                if (d == Integer.TYPE) {
++                    car = 'I';
++                } else if (d == Void.TYPE) {
++                    car = 'V';
++                } else if (d == Boolean.TYPE) {
++                    car = 'Z';
++                } else if (d == Byte.TYPE) {
++                    car = 'B';
++                } else if (d == Character.TYPE) {
++                    car = 'C';
++                } else if (d == Short.TYPE) {
++                    car = 'S';
++                } else if (d == Double.TYPE) {
++                    car = 'D';
++                } else if (d == Float.TYPE) {
++                    car = 'F';
++                } else /* if (d == Long.TYPE) */{
++                    car = 'J';
++                }
++                buf.append(car);
++                return;
++            } else if (d.isArray()) {
++                buf.append('[');
++                d = d.getComponentType();
++            } else {
++                buf.append('L');
++                String name = d.getName();
++                int len = name.length();
++                for (int i = 0; i < len; ++i) {
++                    char car = name.charAt(i);
++                    buf.append(car == '.' ? '/' : car);
++                }
++                buf.append(';');
++                return;
++            }
++        }
++    }
++
++    // ------------------------------------------------------------------------
++    // Corresponding size and opcodes
++    // ------------------------------------------------------------------------
++
++    /**
++     * Returns the size of values of this type.
++     *
++     * @return the size of values of this type, i.e., 2 for <tt>long</tt> and
++     *         <tt>double</tt>, and 1 otherwise.
++     */
++    public int getSize() {
++        return sort == LONG || sort == DOUBLE ? 2 : 1;
++    }
++
++    /**
++     * Returns a JVM instruction opcode adapted to this Java type.
++     *
++     * @param opcode a JVM instruction opcode. This opcode must be one of ILOAD,
++     *        ISTORE, IALOAD, IASTORE, IADD, ISUB, IMUL, IDIV, IREM, INEG, ISHL,
++     *        ISHR, IUSHR, IAND, IOR, IXOR and IRETURN.
++     * @return an opcode that is similar to the given opcode, but adapted to
++     *         this Java type. For example, if this type is <tt>float</tt> and
++     *         <tt>opcode</tt> is IRETURN, this method returns FRETURN.
++     */
++    public int getOpcode(final int opcode) {
++        if (opcode == Opcodes.IALOAD || opcode == Opcodes.IASTORE) {
++            switch (sort) {
++                case BOOLEAN:
++                case BYTE:
++                    return opcode + 5;
++                case CHAR:
++                    return opcode + 6;
++                case SHORT:
++                    return opcode + 7;
++                case INT:
++                    return opcode;
++                case FLOAT:
++                    return opcode + 2;
++                case LONG:
++                    return opcode + 1;
++                case DOUBLE:
++                    return opcode + 3;
++                    // case ARRAY:
++                    // case OBJECT:
++                default:
++                    return opcode + 4;
++            }
++        } else {
++            switch (sort) {
++                case VOID:
++                    return opcode + 5;
++                case BOOLEAN:
++                case CHAR:
++                case BYTE:
++                case SHORT:
++                case INT:
++                    return opcode;
++                case FLOAT:
++                    return opcode + 2;
++                case LONG:
++                    return opcode + 1;
++                case DOUBLE:
++                    return opcode + 3;
++                    // case ARRAY:
++                    // case OBJECT:
++                default:
++                    return opcode + 4;
++            }
++        }
++    }
++
++    // ------------------------------------------------------------------------
++    // Equals, hashCode and toString
++    // ------------------------------------------------------------------------
++
++    /**
++     * Tests if the given object is equal to this type.
++     *
++     * @param o the object to be compared to this type.
++     * @return <tt>true</tt> if the given object is equal to this type.
++     */
++    public boolean equals(final Object o) {
++        if (this == o) {
++            return true;
++        }
++        if (!(o instanceof Type)) {
++            return false;
++        }
++        Type t = (Type) o;
++        if (sort != t.sort) {
++            return false;
++        }
++        if (sort == OBJECT || sort == ARRAY) {
++            if (len != t.len) {
++                return false;
++            }
++            for (int i = off, j = t.off, end = i + len; i < end; i++, j++) {
++                if (buf[i] != t.buf[j]) {
++                    return false;
++                }
++            }
++        }
++        return true;
++    }
++
++    /**
++     * Returns a hash code value for this type.
++     *
++     * @return a hash code value for this type.
++     */
++    public int hashCode() {
++        int hc = 13 * sort;
++        if (sort == OBJECT || sort == ARRAY) {
++            for (int i = off, end = i + len; i < end; i++) {
++                hc = 17 * (hc + buf[i]);
++            }
++        }
++        return hc;
++    }
++
++    /**
++     * Returns a string representation of this type.
++     *
++     * @return the descriptor of this type.
++     */
++    public String toString() {
++        return getDescriptor();
++    }
++}
+--- /dev/null	Thu Jul 30 19:03:49 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/protocol/soap/MessageCreationException.java	Thu Jul 30 19:03:48 2009
+@@ -0,0 +1,60 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++
++package com.sun.xml.internal.ws.protocol.soap;
++
++import com.sun.xml.internal.ws.api.SOAPVersion;
++import com.sun.xml.internal.ws.api.message.ExceptionHasMessage;
++import com.sun.xml.internal.ws.api.message.Message;
++import com.sun.xml.internal.ws.fault.SOAPFaultBuilder;
++
++import javax.xml.namespace.QName;
++
++/**
++ * This is used to represent Message creation exception when a {@link com.sun.xml.internal.ws.api.pipe.Codec}
++ * trying to create a {@link Message}.
++ *
++ * @author Jitendra Kotamraju
++ */
++public class MessageCreationException extends ExceptionHasMessage {
++
++    private final SOAPVersion soapVersion;
++
++    public MessageCreationException(SOAPVersion soapVersion, Object... args) {
++        super("soap.msg.create.err", args);
++        this.soapVersion = soapVersion;
++    }
++
++    public String getDefaultResourceBundleName() {
++        return "com.sun.xml.internal.ws.resources.soap";
++    }
++
++    public Message getFaultMessage() {
++        QName faultCode = soapVersion.faultCodeClient;
++        return SOAPFaultBuilder.createSOAPFaultMessage(
++                soapVersion, getLocalizedMessage(), faultCode);
++    }
++
++}
+--- /dev/null	Thu Jul 30 19:03:52 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/server/DraconianValidationErrorHandler.java	Thu Jul 30 19:03:52 2009
+@@ -0,0 +1,47 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++package com.sun.xml.internal.ws.server;
++
++import com.sun.xml.internal.ws.developer.ValidationErrorHandler;
++import org.xml.sax.SAXParseException;
++import org.xml.sax.SAXException;
++
++/**
++ * @author Jitendra Kotamraju
++ */
++public class DraconianValidationErrorHandler extends ValidationErrorHandler {
++    public void warning(SAXParseException e) throws SAXException {
++        throw e;
++    }
++
++    public void error(SAXParseException e) throws SAXException {
++        throw e;
++    }
++
++    public void fatalError(SAXParseException e) throws SAXException {
++        ; // noop
++    }
++
++}
+--- /dev/null	Thu Jul 30 19:03:56 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/server/JMXAgent.java	Thu Jul 30 19:03:55 2009
+@@ -0,0 +1,87 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++
++/*
++ * JAXWSServerAgent.java
++ *
++ * Created on February 7, 2007, 6:37 PM
++ */
++
++package com.sun.xml.internal.ws.server;
++
++import com.sun.xml.internal.ws.util.RuntimeVersionMBean;
++import com.sun.xml.internal.ws.util.RuntimeVersion;
++import com.sun.xml.internal.ws.transport.http.HttpDump;
++
++import javax.management.ObjectName;
++import javax.management.MBeanServer;
++import java.lang.management.ManagementFactory;
++
++/**
++ *
++ * @author Jitendra Kotamraju
++ */
++public class JMXAgent {
++
++    // Platform MBeanServer used to register your MBeans
++    private final MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
++
++    // Singleton instance
++    private static JMXAgent singleton;
++
++    /**
++     * Instantiate and register your MBeans.
++     */
++    public void init() throws Exception {
++
++        RuntimeVersionMBean mbean = new RuntimeVersion();
++        ObjectName mbeanName = new ObjectName("com.sun.xml.internal.ws.util:type=RuntimeVersion");
++        if (!getMBeanServer().isRegistered(mbeanName)) {
++            getMBeanServer().registerMBean(mbean, mbeanName);
++        }
++
++        HttpDump dump = new HttpDump();
++        ObjectName dumpName = new ObjectName("com.sun.xml.internal.ws.transport.http:type=HttpDump");
++        if (!getMBeanServer().isRegistered(dumpName)) {
++            getMBeanServer().registerMBean(dump, dumpName);
++        }
++    }
++
++    /**
++     * Returns an agent singleton.
++     */
++    public synchronized static JMXAgent getDefault() throws Exception {
++        if(singleton == null) {
++            singleton = new JMXAgent();
++            singleton.init();
++        }
++        return singleton;
++    }
++
++    private MBeanServer getMBeanServer() {
++        return mbs;
++    }
++
++}
+--- /dev/null	Thu Jul 30 19:03:59 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/server/ServerSchemaValidationTube.java	Thu Jul 30 19:03:58 2009
+@@ -0,0 +1,319 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++package com.sun.xml.internal.ws.server;
++
++import com.sun.istack.internal.Nullable;
++import com.sun.xml.internal.ws.api.WSBinding;
++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.AbstractTubeImpl;
++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.ServiceDefinition;
++import com.sun.xml.internal.ws.api.server.WSEndpoint;
++import com.sun.xml.internal.ws.util.ByteArrayBuffer;
++import com.sun.xml.internal.ws.util.MetadataUtil;
++import com.sun.xml.internal.ws.util.pipe.AbstractSchemaValidationTube;
++import com.sun.xml.internal.ws.util.xml.MetadataDocument;
++import org.w3c.dom.*;
++import org.w3c.dom.ls.LSInput;
++import org.w3c.dom.ls.LSResourceResolver;
++import org.xml.sax.SAXException;
++import org.xml.sax.helpers.NamespaceSupport;
++
++import javax.xml.XMLConstants;
++import javax.xml.namespace.QName;
++import javax.xml.transform.Source;
++import javax.xml.transform.dom.DOMSource;
++import javax.xml.validation.Schema;
++import javax.xml.validation.SchemaFactory;
++import javax.xml.validation.Validator;
++import javax.xml.ws.WebServiceException;
++import java.io.IOException;
++import java.io.InputStream;
++import java.io.Reader;
++import java.net.MalformedURLException;
++import java.net.URL;
++import java.util.*;
++import java.util.logging.Level;
++import java.util.logging.Logger;
++
++/**
++ * {@link Tube} that does the schema validation on the server side.
++ *
++ * @author Jitendra Kotamraju
++ */
++public class ServerSchemaValidationTube extends AbstractSchemaValidationTube {
++
++    private static final Logger LOGGER = Logger.getLogger(ServerSchemaValidationTube.class.getName());
++
++    //private final ServiceDefinition docs;
++    private final Schema schema;
++    private final Validator validator;
++
++    private final boolean noValidation;
++
++    public ServerSchemaValidationTube(WSEndpoint endpoint, WSBinding binding, Tube next) {
++        super(binding, next);
++        //docs = endpoint.getServiceDefinition();
++        SchemaFactory sf = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
++        Source[] sources = getSchemaSources(endpoint.getServiceDefinition());
++        for(Source source : sources) {
++            LOGGER.fine("Constructing validation Schema from = "+source.getSystemId());
++            //printDOM((DOMSource)source);
++        }
++        if (sources.length != 0) {
++            noValidation = false;
++            sf.setResourceResolver(new MetadataResolverImpl(endpoint.getServiceDefinition()));
++            try {
++                schema = sf.newSchema(sources);
++            } catch(SAXException e) {
++                throw new WebServiceException(e);
++            }
++            validator = schema.newValidator();
++        } else {
++            noValidation = true;
++            schema = null;
++            validator = null;
++        }
++    }
++
++    /**
++     * Constructs list of schema documents as follows:
++     *   - all <xsd:schema> fragements from all WSDL documents.
++     *   - all schema documents in the application(from WAR etc)
++     *
++     * @return list of root schema documents
++     */
++    private Source[] getSchemaSources(ServiceDefinition sd) {
++        String primary = sd.getPrimary().getURL().toExternalForm();
++        MetadataUtil.MetadataResolver mdresolver = new MetadataResolverImpl(sd);
++        Map<String, SDDocument> docs = MetadataUtil.getMetadataClosure(primary, mdresolver, true);
++
++        List<Source> list = new ArrayList<Source>();
++        for(Map.Entry<String, SDDocument> entry : docs.entrySet()) {
++            SDDocument doc = entry.getValue();
++            // Add all xsd:schema fragments from all WSDLs. That should form a closure of schemas.
++            if (doc.isWSDL()) {
++                Document dom = createDOM(doc);
++                // Get xsd:schema node from WSDL's DOM
++                addSchemaFragmentSource(dom, doc.getURL().toExternalForm(), list);
++            } else if (doc.isSchema()) {
++                // If there are multiple schemas with the same targetnamespace,
++                // JAXP works only with the first one. Above, all schema fragments may have the same targetnamespace,
++                // and that means it will not include all the schemas. Since we have a list of schemas, just add them.
++                Document dom = createDOM(doc);
++                list.add(new DOMSource(dom, doc.getURL().toExternalForm()));
++            }
++        }
++        //addSchemaSource(list);
++        return list.toArray(new Source[list.size()]) ;
++    }
++
++    private class MetadataResolverImpl implements MetadataUtil.MetadataResolver, LSResourceResolver {
++
++        Map<String, SDDocument> docs = new HashMap<String, SDDocument>();
++
++        MetadataResolverImpl(ServiceDefinition sd) {
++            for(SDDocument doc : sd) {
++                SDDocument sdi = doc;
++                docs.put(sdi.getURL().toExternalForm(), sdi);
++            }
++        }
++
++        public SDDocument resolveEntity(String systemId) {
++            SDDocument sdi = docs.get(systemId);
++            if (sdi == null) {
++                SDDocumentSource sds;
++                try {
++                    sds = SDDocumentSource.create(new URL(systemId));
++                } catch(MalformedURLException e) {
++                    throw new WebServiceException(e);
++                }
++                sdi = MetadataDocument.create(sds, new QName(""), new QName(""));
++                docs.put(systemId, sdi);
++            }
++            return sdi;
++        }
++
++        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);
++            try {
++                URL base = baseURI == null ? null : new URL(baseURI);
++                final URL rel = new URL(base, systemId);
++                final SDDocument doc = docs.get(rel.toExternalForm());
++                if (doc != null) {
++                    return new LSInput() {
++
++                        public Reader getCharacterStream() {
++                            return null;
++                        }
++
++                        public void setCharacterStream(Reader characterStream) {
++                            throw new UnsupportedOperationException();
++                        }
++
++                        public InputStream getByteStream() {
++                            ByteArrayBuffer bab = new ByteArrayBuffer();
++                            try {
++                                doc.writeTo(null, resolver, bab);
++                            } catch (IOException ioe) {
++                                throw new WebServiceException(ioe);
++                            }
++                            return bab.newInputStream();
++                        }
++
++                        public void setByteStream(InputStream byteStream) {
++                            throw new UnsupportedOperationException();
++                        }
++
++                        public String getStringData() {
++                            return null;
++                        }
++
++                        public void setStringData(String stringData) {
++                            throw new UnsupportedOperationException();
++                        }
++
++                        public String getSystemId() {
++                            return rel.toExternalForm();
++                        }
++
++                        public void setSystemId(String systemId) {
++                            throw new UnsupportedOperationException();
++                        }
++
++                        public String getPublicId() {
++                            return null;
++                        }
++
++                        public void setPublicId(String publicId) {
++                            throw new UnsupportedOperationException();
++                        }
++
++                        public String getBaseURI() {
++                            return rel.toExternalForm();
++                        }
++
++                        public void setBaseURI(String baseURI) {
++                            throw new UnsupportedOperationException();
++                        }
++
++                        public String getEncoding() {
++                            return null;
++                        }
++
++                        public void setEncoding(String encoding) {
++                            throw new UnsupportedOperationException();
++                        }
++
++                        public boolean getCertifiedText() {
++                            return false;
++                        }
++
++                        public void setCertifiedText(boolean certifiedText) {
++                            throw new UnsupportedOperationException();
++                        }
++                    };
++                }
++            } catch(Exception e) {
++                LOGGER.log(Level.WARNING, "Exception in LSResourceResolver impl", e);
++            }
++            LOGGER.fine("Don't know about systemId="+systemId+" baseURI="+baseURI);
++            return null;
++        }
++
++    }
++
++
++    protected Validator getValidator() {
++        return validator;
++    }
++
++    protected boolean isNoValidation() {
++        return noValidation;
++    }
++
++    /**
++     * Recursively visit ancestors and build up {@link org.xml.sax.helpers.NamespaceSupport} oject.
++     */
++    private void buildNamespaceSupport(NamespaceSupport nss, Node node) {
++        if(node==null || node.getNodeType()!=Node.ELEMENT_NODE)
++            return;
++
++        buildNamespaceSupport( nss, node.getParentNode() );
++
++        nss.pushContext();
++        NamedNodeMap atts = node.getAttributes();
++        for( int i=0; i<atts.getLength(); i++ ) {
++            Attr a = (Attr)atts.item(i);
++            if( "xmlns".equals(a.getPrefix()) ) {
++                nss.declarePrefix( a.getLocalName(), a.getValue() );
++                continue;
++            }
++            if( "xmlns".equals(a.getName()) ) {
++                nss.declarePrefix( "", a.getValue() );
++                continue;
++            }
++        }
++    }
++
++    /**
++     * Adds inscope namespaces as attributes to  <xsd:schema> fragment nodes.
++     *
++     * @param nss namespace context info
++     * @param elem that is patched with inscope namespaces
++     */
++    private @Nullable void patchDOMFragment(NamespaceSupport nss, Element elem) {
++        NamedNodeMap atts = elem.getAttributes();
++        for( Enumeration en = nss.getPrefixes(); en.hasMoreElements(); ) {
++            String prefix = (String)en.nextElement();
++
++            for( int i=0; i<atts.getLength(); i++ ) {
++                Attr a = (Attr)atts.item(i);
++                if (!"xmlns".equals(a.getPrefix()) || !a.getLocalName().equals("prefix")) {
++                    LOGGER.fine("Patching with xmlns:"+prefix+"="+nss.getURI(prefix));
++                    elem.setAttributeNS(XMLConstants.XMLNS_ATTRIBUTE_NS_URI, "xmlns:"+prefix, nss.getURI(prefix));
++                }
++            }
++        }
++    }
++
++
++
++
++    protected ServerSchemaValidationTube(ServerSchemaValidationTube that, TubeCloner cloner) {
++        super(that,cloner);
++        //this.docs = that.docs;
++        this.schema = that.schema;
++        this.validator = schema.newValidator();
++        this.noValidation = that.noValidation;
++    }
++
++    public AbstractTubeImpl copy(TubeCloner cloner) {
++        return new ServerSchemaValidationTube(this,cloner);
++    }
++
++}
+--- /dev/null	Thu Jul 30 19:04:02 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/server/sei/SOAPActionBasedDispatcher.java	Thu Jul 30 19:04:01 2009
+@@ -0,0 +1,76 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++package com.sun.xml.internal.ws.server.sei;
++
++import com.sun.istack.internal.Nullable;
++import com.sun.xml.internal.ws.api.WSBinding;
++import com.sun.xml.internal.ws.api.message.Packet;
++import com.sun.xml.internal.ws.model.AbstractSEIModelImpl;
++import com.sun.xml.internal.ws.model.JavaMethodImpl;
++
++import javax.xml.namespace.QName;
++import java.util.HashMap;
++import java.util.Map;
++
++/**
++ * An {@link EndpointMethodDispatcher} that uses SOAPAction as the key for dispatching.
++ * <p/>
++ * A map of all SOAPAction on the port and the corresponding {@link EndpointMethodHandler}
++ * is initialized in the constructor. The SOAPAction from the
++ * request {@link Packet} is used as the key to return the correct handler.
++ *
++ * @author Jitendra Kotamraju
++ */
++final class SOAPActionBasedDispatcher implements EndpointMethodDispatcher {
++    private final Map<String, EndpointMethodHandler> methodHandlers;
++
++    public SOAPActionBasedDispatcher(AbstractSEIModelImpl model, WSBinding binding, SEIInvokerTube invokerTube) {
++        // Find if any SOAPAction repeat for operations
++        Map<String, Integer> unique = new HashMap<String, Integer>();
++        for(JavaMethodImpl m : model.getJavaMethods()) {
++            String soapAction = m.getOperation().getSOAPAction();
++            Integer count = unique.get(soapAction);
++            if (count == null) {
++                unique.put(soapAction, 1);
++            } else {
++                unique.put(soapAction, ++count);
++            }
++        }
++        methodHandlers = new HashMap<String, EndpointMethodHandler>();
++        for( JavaMethodImpl m : model.getJavaMethods() ) {
++            String soapAction = m.getOperation().getSOAPAction();
++            // 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+'"', new EndpointMethodHandler(invokerTube,m,binding));
++            }
++        }
++    }
++
++    public @Nullable EndpointMethodHandler getEndpointMethodHandler(Packet request) {
++        return request.soapAction == null ? null : methodHandlers.get(request.soapAction);
++    }
++
++}
+--- /dev/null	Thu Jul 30 19:04:05 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/streaming/MtomStreamWriter.java	Thu Jul 30 19:04:05 2009
+@@ -0,0 +1,44 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++package com.sun.xml.internal.ws.streaming;
++
++import com.sun.xml.internal.ws.message.jaxb.JAXBMessage;
++import com.sun.xml.internal.ws.encoding.MtomCodec;
++
++import javax.xml.bind.attachment.AttachmentMarshaller;
++import javax.xml.stream.XMLStreamWriter;
++
++/**
++ * A {@link XMLStreamWriter} that used for MTOM encoding may provide its own
++ * {@link AttachmentMarshaller}. The marshaller could do processing based on
++ * MTOM threshold, and make decisions about inlining the attachment data or not.
++ *
++ * @author Jitendra Kotamraju
++ * @see JAXBMessage
++ * @see MtomCodec
++ */
++public interface MtomStreamWriter {
++    AttachmentMarshaller getAttachmentMarshaller();
++}
+--- /dev/null	Thu Jul 30 19:04:09 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/HttpDump.java	Thu Jul 30 19:04:08 2009
+@@ -0,0 +1,40 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++
++package com.sun.xml.internal.ws.transport.http;
++
++/**
++ * @author Jitendra Kotamraju
++ *
++ */
++public class HttpDump implements HttpDumpMBean {
++    public void setDump(boolean dump) {
++        HttpAdapter.dump = dump;
++    }
++
++    public boolean getDump() {
++        return HttpAdapter.dump;
++    }
++}
+--- /dev/null	Thu Jul 30 19:04:12 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/HttpDumpMBean.java	Thu Jul 30 19:04:11 2009
+@@ -0,0 +1,37 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++
++package com.sun.xml.internal.ws.transport.http;
++
++/**
++ * @author Jitendra Kotamraju
++ */
++public interface HttpDumpMBean {
++
++    public void setDump(boolean dump);
++
++    public boolean getDump();
++
++}
+--- /dev/null	Thu Jul 30 19:04:15 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/transport/http/HttpMetadataPublisher.java	Thu Jul 30 19:04:14 2009
+@@ -0,0 +1,59 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++
++package com.sun.xml.internal.ws.transport.http;
++
++import com.sun.istack.internal.NotNull;
++import com.sun.xml.internal.ws.api.server.EndpointComponent;
++import com.sun.xml.internal.ws.api.server.WSEndpoint;
++
++import java.io.IOException;
++
++/**
++ * Intercepts GET HTTP requests to process the requests.
++ *
++ * <p>
++ * {@link HttpAdapter} looks for this SPI in {@link WSEndpoint#getComponentRegistry()}
++ * to allow components to expose additional information through HTTP.
++ *
++ * @author Kohsuke Kawaguchi
++ * @see EndpointComponent#getSPI(Class)
++ * @since 2.1.2
++ */
++public abstract class HttpMetadataPublisher {
++    /**
++     * When {@link HttpAdapter} receives a GET request with a query string
++     * (which is a convention for metadata requests, such as '?wsdl' or '?xsd=...'),
++     * then this method is invoked to allow components to intercept the request.
++     *
++     * @param adapter
++     *      Adapter that accepted the connection.
++     * @param connection
++     *      Represents the current connection.
++     * @return
++     *      true if the request is processed. If false is returned the default processing kicks in.
++     */
++    public abstract boolean handleMetadataRequest(@NotNull HttpAdapter adapter, @NotNull WSHTTPConnection connection) throws IOException;
++}
+--- /dev/null	Thu Jul 30 19:04:18 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/util/MetadataUtil.java	Thu Jul 30 19:04:17 2009
+@@ -0,0 +1,92 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++package com.sun.xml.internal.ws.util;
++
++import com.sun.istack.internal.NotNull;
++import com.sun.xml.internal.ws.api.server.SDDocument;
++import com.sun.xml.internal.ws.server.SDDocumentImpl;
++import org.xml.sax.EntityResolver;
++
++import java.util.*;
++
++/**
++ * WSDL, schema document metadata utility class.
++ *
++ * @author Jitendra Kotamraju
++ */
++public class MetadataUtil {
++
++    /**
++     * Gets closure of all the referenced documents from the primary document(typically
++     * the service WSDL). It traverses the WSDL and schema imports and builds a closure
++     * set of documents.
++     *
++     * @param systemId primary wsdl or the any root document
++     * @param resolver used to get SDDocumentImpl for a document
++     * @param onlyTopLevelSchemas if true, the imported schemas from a schema would be ignored
++     * @return all the documents
++     */
++    public static Map<String, SDDocument> getMetadataClosure(@NotNull String systemId,
++            @NotNull MetadataResolver resolver, boolean onlyTopLevelSchemas) {
++        Map <String, SDDocument> closureDocs = new HashMap<String, SDDocument>();
++        Set<String> remaining = new HashSet<String>();
++        remaining.add(systemId);
++
++        while(!remaining.isEmpty()) {
++            Iterator<String> it = remaining.iterator();
++            String current = it.next();
++            remaining.remove(current);
++
++            SDDocument currentDoc = resolver.resolveEntity(current);
++            SDDocument old = closureDocs.put(currentDoc.getURL().toExternalForm(), currentDoc);
++            assert old == null;
++
++            Set<String> imports =  currentDoc.getImports();
++            if (!currentDoc.isSchema() || !onlyTopLevelSchemas) {
++                for(String importedDoc : imports) {
++                    if (closureDocs.get(importedDoc) == null) {
++                        remaining.add(importedDoc);
++                    }
++                }
++            }
++        }
++
++        return closureDocs;
++    }
++
++    public interface MetadataResolver {
++        /**
++         * returns {@link SDDocumentImpl} for the give systemId. It
++         * parses the document and categorises as WSDL, schema etc.
++         * The implementation could use a catlog resolver or an entity
++         * resolver {@link EntityResolver} before parsing.
++         *
++         * @param systemId document's systemId
++         * @return document for the systemId
++         */
++        @NotNull SDDocument resolveEntity(String systemId);
++    }
++
++}
+--- /dev/null	Thu Jul 30 19:04:21 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/util/RuntimeVersionMBean.java	Thu Jul 30 19:04:21 2009
+@@ -0,0 +1,43 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++
++
++
++package com.sun.xml.internal.ws.util;
++
++import javax.management.*;
++import com.sun.xml.internal.ws.util.RuntimeVersion;
++
++/**
++ * @author Jitendra Kotamraju
++ */
++public interface RuntimeVersionMBean {
++
++    /**
++     * Get JAX-WS runtime version
++     */
++    public String getVersion();
++
++}
+--- /dev/null	Thu Jul 30 19:04:25 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/util/pipe/AbstractSchemaValidationTube.java	Thu Jul 30 19:04:24 2009
+@@ -0,0 +1,261 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++package com.sun.xml.internal.ws.util.pipe;
++
++import com.sun.istack.internal.NotNull;
++import com.sun.istack.internal.Nullable;
++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.pipe.NextAction;
++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.api.server.DocumentAddressResolver;
++import com.sun.xml.internal.ws.api.server.SDDocument;
++import com.sun.xml.internal.ws.developer.SchemaValidationFeature;
++import com.sun.xml.internal.ws.developer.ValidationErrorHandler;
++import com.sun.xml.internal.ws.util.ByteArrayBuffer;
++import com.sun.xml.internal.ws.util.xml.XmlUtil;
++import com.sun.xml.internal.ws.wsdl.parser.WSDLConstants;
++import org.w3c.dom.*;
++import org.xml.sax.helpers.NamespaceSupport;
++
++import javax.xml.XMLConstants;
++import javax.xml.transform.Source;
++import javax.xml.transform.Transformer;
++import javax.xml.transform.TransformerException;
++import javax.xml.transform.TransformerFactory;
++import javax.xml.transform.dom.DOMResult;
++import javax.xml.transform.dom.DOMSource;
++import javax.xml.transform.stream.StreamResult;
++import javax.xml.transform.stream.StreamSource;
++import javax.xml.validation.Validator;
++import javax.xml.ws.WebServiceException;
++import java.io.IOException;
++import java.util.Enumeration;
++import java.util.List;
++import java.util.logging.Logger;
++
++/**
++ * {@link Tube} that does the schema validation.
++ *
++ * @author Jitendra Kotamraju
++ */
++public abstract class AbstractSchemaValidationTube extends AbstractFilterTubeImpl {
++
++    private static final Logger LOGGER = Logger.getLogger(AbstractSchemaValidationTube.class.getName());
++
++    protected final WSBinding binding;
++    protected final SchemaValidationFeature feature;
++    protected final DocumentAddressResolver resolver = new ValidationDocumentAddressResolver();
++
++    public AbstractSchemaValidationTube(WSBinding binding, Tube next) {
++        super(next);
++        this.binding = binding;
++        feature = binding.getFeature(SchemaValidationFeature.class);
++    }
++
++    protected AbstractSchemaValidationTube(AbstractSchemaValidationTube that, TubeCloner cloner) {
++        super(that, cloner);
++        this.binding = that.binding;
++        this.feature = that.feature;
++    }
++
++    protected abstract Validator getValidator();
++
++    protected abstract boolean isNoValidation();
++
++    private static class ValidationDocumentAddressResolver implements DocumentAddressResolver {
++
++        @Nullable
++        public String getRelativeAddressFor(@NotNull SDDocument current, @NotNull SDDocument referenced) {
++            LOGGER.fine("Current = "+current.getURL()+" resolved relative="+referenced.getURL());
++            return referenced.getURL().toExternalForm();
++        }
++    }
++
++    protected Document createDOM(SDDocument doc) {
++        // Get infoset
++        ByteArrayBuffer bab = new ByteArrayBuffer();
++        try {
++            doc.writeTo(null, resolver, bab);
++        } catch (IOException ioe) {
++            throw new WebServiceException(ioe);
++        }
++
++        // Convert infoset to DOM
++        Transformer trans = XmlUtil.newTransformer();
++        Source source = new StreamSource(bab.newInputStream(), null); //doc.getURL().toExternalForm());
++        DOMResult result = new DOMResult();
++        try {
++            trans.transform(source, result);
++        } catch(TransformerException te) {
++            throw new WebServiceException(te);
++        }
++        return (Document)result.getNode();
++    }
++
++
++    /**
++     * Locates xsd:schema elements in the WSDL and creates DOMSource and adds them to the list
++     *
++     * @param doc WSDL document
++     * @param systemId systemId for WSDL document
++     * @param list xsd:schema DOMSource list
++     */
++    protected @Nullable void addSchemaFragmentSource(Document doc, String systemId, List<Source> list) {
++
++        Element e = doc.getDocumentElement();
++        assert e.getNamespaceURI().equals(WSDLConstants.NS_WSDL);
++        assert e.getLocalName().equals("definitions");
++
++        NodeList typesList = e.getElementsByTagNameNS(WSDLConstants.NS_WSDL, "types");
++        for(int i=0; i < typesList.getLength(); i++) {
++            NodeList schemaList = ((Element)typesList.item(i)).getElementsByTagNameNS(WSDLConstants.NS_XMLNS, "schema");
++            for(int j=0; j < schemaList.getLength(); j++) {
++                Element elem = (Element)schemaList.item(j);
++                NamespaceSupport nss = new NamespaceSupport();
++                buildNamespaceSupport(nss, elem);
++                patchDOMFragment(nss, elem);
++                list.add(new DOMSource(elem, systemId+"#schema"+j));
++            }
++        }
++    }
++
++
++    /**
++     * Recursively visit ancestors and build up {@link org.xml.sax.helpers.NamespaceSupport} oject.
++     */
++    private void buildNamespaceSupport(NamespaceSupport nss, Node node) {
++        if(node==null || node.getNodeType()!=Node.ELEMENT_NODE)
++            return;
++
++        buildNamespaceSupport( nss, node.getParentNode() );
++
++        nss.pushContext();
++        NamedNodeMap atts = node.getAttributes();
++        for( int i=0; i<atts.getLength(); i++ ) {
++            Attr a = (Attr)atts.item(i);
++            if( "xmlns".equals(a.getPrefix()) ) {
++                nss.declarePrefix( a.getLocalName(), a.getValue() );
++                continue;
++            }
++            if( "xmlns".equals(a.getName()) ) {
++                nss.declarePrefix( "", a.getValue() );
++                continue;
++            }
++        }
++    }
++
++    /**
++     * Adds inscope namespaces as attributes to  <xsd:schema> fragment nodes.
++     *
++     * @param nss namespace context info
++     * @param elem that is patched with inscope namespaces
++     */
++    private @Nullable void patchDOMFragment(NamespaceSupport nss, Element elem) {
++        NamedNodeMap atts = elem.getAttributes();
++        for( Enumeration en = nss.getPrefixes(); en.hasMoreElements(); ) {
++            String prefix = (String)en.nextElement();
++
++            for( int i=0; i<atts.getLength(); i++ ) {
++                Attr a = (Attr)atts.item(i);
++                if (!"xmlns".equals(a.getPrefix()) || !a.getLocalName().equals("prefix")) {
++                    LOGGER.fine("Patching with xmlns:"+prefix+"="+nss.getURI(prefix));
++                    elem.setAttributeNS(XMLConstants.XMLNS_ATTRIBUTE_NS_URI, "xmlns:"+prefix, nss.getURI(prefix));
++                }
++            }
++        }
++    }
++
++    @Override
++    public NextAction processRequest(Packet request) {
++        if (isNoValidation() || !request.getMessage().hasPayload() || request.getMessage().isFault()) {
++            return super.processRequest(request);
++        }
++        doProcess(request);
++        return super.processRequest(request);
++    }
++
++    @Override
++    public NextAction processResponse(Packet response) {
++        if (isNoValidation() || response.getMessage() == null || !response.getMessage().hasPayload() || response.getMessage().isFault()) {
++            return super.processResponse(response);
++        }
++        doProcess(response);
++        return super.processResponse(response);
++    }
++
++    private void doProcess(Packet packet) {
++        getValidator().reset();
++        Class<? extends ValidationErrorHandler> handlerClass = feature.getErrorHandler();
++        ValidationErrorHandler handler;
++        try {
++            handler = handlerClass.newInstance();
++        } catch(Exception e) {
++            throw new WebServiceException(e);
++        }
++        handler.setPacket(packet);
++        getValidator().setErrorHandler(handler);
++        Message msg = packet.getMessage().copy();
++        Source source = msg.readPayloadAsSource();
++        try {
++            // Validator javadoc allows ONLY SAX, and DOM Sources
++            // But the impl seems to handle all kinds.
++            getValidator().validate(source);
++        } catch(Exception e) {
++            throw new WebServiceException(e);
++        }
++    }
++
++    protected DOMSource toDOMSource(Source source) {
++        if (source instanceof DOMSource) {
++            return (DOMSource)source;
++        }
++        Transformer trans = XmlUtil.newTransformer();
++        DOMResult result = new DOMResult();
++        try {
++            trans.transform(source, result);
++        } catch(TransformerException te) {
++            throw new WebServiceException(te);
++        }
++        return new DOMSource(result.getNode());
++    }
++
++    protected static void printDOM(DOMSource src) {
++        try {
++            ByteArrayBuffer bos = new ByteArrayBuffer();
++            StreamResult sr = new StreamResult(bos );
++            Transformer trans = TransformerFactory.newInstance().newTransformer();
++            trans.transform(src, sr);
++            LOGGER.info("**** src ******"+bos.toString());
++            bos.close();
++        } catch(Exception e) {
++            e.printStackTrace();
++        }
++    }
++
++}
+--- /dev/null	Thu Jul 30 19:04:28 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/util/xml/MetadataDocument.java	Thu Jul 30 19:04:27 2009
+@@ -0,0 +1,317 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++
++package com.sun.xml.internal.ws.util.xml;
++
++import com.sun.xml.internal.ws.api.server.*;
++import com.sun.xml.internal.ws.api.streaming.XMLStreamWriterFactory;
++import com.sun.xml.internal.ws.streaming.XMLStreamReaderUtil;
++import com.sun.xml.internal.ws.util.RuntimeVersion;
++import com.sun.xml.internal.ws.wsdl.parser.ParserUtil;
++import com.sun.xml.internal.ws.wsdl.parser.WSDLConstants;
++import com.sun.xml.internal.ws.server.ServerRtException;
++
++import javax.xml.namespace.QName;
++import javax.xml.stream.*;
++import javax.xml.ws.WebServiceException;
++import java.io.IOException;
++import java.io.OutputStream;
++import java.net.URL;
++import java.util.HashSet;
++import java.util.Set;
++
++/**
++ * {@link com.sun.xml.internal.ws.api.server.SDDocument} implmentation.
++ *
++ * <p>
++ * This extends from {@link com.sun.xml.internal.ws.api.server.SDDocumentSource} so that
++ * JAX-WS server runtime code can use {@link com.sun.xml.internal.ws.api.server.SDDocument}
++ * as {@link com.sun.xml.internal.ws.api.server.SDDocumentSource}.
++ *
++ * @author Kohsuke Kawaguchi
++ * @author Jitendra Kotamraju
++ */
++public class MetadataDocument extends SDDocumentSource implements SDDocument {
++
++    private static final String NS_XSD = "http://www.w3.org/2001/XMLSchema";
++    private static final QName SCHEMA_INCLUDE_QNAME = new QName(NS_XSD, "include");
++    private static final QName SCHEMA_IMPORT_QNAME = new QName(NS_XSD, "import");
++    private static final QName SCHEMA_REDEFINE_QNAME = new QName(NS_XSD, "redefine");
++    private static final String VERSION_COMMENT =
++        " Published by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is "+RuntimeVersion.VERSION+". ";
++
++    /**
++     * Creates {@link com.sun.xml.internal.ws.api.server.SDDocument} from {@link com.sun.xml.internal.ws.api.server.SDDocumentSource}.
++     * @param src WSDL document infoset
++     * @param serviceName wsdl:service name
++     * @param portTypeName
++     *      The information about the port of {@link com.sun.xml.internal.ws.api.server.WSEndpoint} to which this document is built for.
++     *      These values are used to determine which document is the concrete and abstract WSDLs
++     *      for this endpoint.
++     *
++     * @return null
++     *      Always non-null.
++     */
++    public static SDDocument create(SDDocumentSource src, QName serviceName, QName portTypeName) {
++        URL systemId = src.getSystemId();
++
++        try {
++            // RuntimeWSDLParser parser = new RuntimeWSDLParser(null);
++            XMLStreamReader reader = src.read();
++            try {
++                XMLStreamReaderUtil.nextElementContent(reader);
++
++                QName rootName = reader.getName();
++                if(rootName.equals(WSDLConstants.QNAME_SCHEMA)) {
++                    String tns = ParserUtil.getMandatoryNonEmptyAttribute(reader, WSDLConstants.ATTR_TNS);
++                    Set<String> importedDocs = new HashSet<String>();
++                    while (XMLStreamReaderUtil.nextContent(reader) != XMLStreamConstants.END_DOCUMENT) {
++                         if (reader.getEventType() != XMLStreamConstants.START_ELEMENT)
++                            continue;
++                        QName name = reader.getName();
++                        if (SCHEMA_INCLUDE_QNAME.equals(name) || SCHEMA_IMPORT_QNAME.equals(name) ||
++                                SCHEMA_REDEFINE_QNAME.equals(name)) {
++                            String importedDoc = reader.getAttributeValue(null, "schemaLocation");
++                            if (importedDoc != null) {
++                                importedDocs.add(new URL(src.getSystemId(), importedDoc).toString());
++                            }
++                        }
++                    }
++                    return new SchemaImpl(rootName,systemId,src,tns,importedDocs);
++                } else if (rootName.equals(WSDLConstants.QNAME_DEFINITIONS)) {
++                    String tns = ParserUtil.getMandatoryNonEmptyAttribute(reader, WSDLConstants.ATTR_TNS);
++
++                    boolean hasPortType = false;
++                    boolean hasService = false;
++                    Set<String> importedDocs = new HashSet<String>();
++                    Set<QName> allServices = new HashSet<QName>();
++
++                    // if WSDL, parse more
++                    while (XMLStreamReaderUtil.nextContent(reader) != XMLStreamConstants.END_DOCUMENT) {
++                         if(reader.getEventType() != XMLStreamConstants.START_ELEMENT)
++                            continue;
++
++                        QName name = reader.getName();
++                        if (WSDLConstants.QNAME_PORT_TYPE.equals(name)) {
++                            String pn = ParserUtil.getMandatoryNonEmptyAttribute(reader, WSDLConstants.ATTR_NAME);
++                            if (portTypeName != null) {
++                                if(portTypeName.getLocalPart().equals(pn)&&portTypeName.getNamespaceURI().equals(tns)) {
++                                    hasPortType = true;
++                                }
++                            }
++                        } else if (WSDLConstants.QNAME_SERVICE.equals(name)) {
++                            String sn = ParserUtil.getMandatoryNonEmptyAttribute(reader, WSDLConstants.ATTR_NAME);
++                            QName sqn = new QName(tns,sn);
++                            allServices.add(sqn);
++                            if(serviceName.equals(sqn)) {
++                                hasService = true;
++                            }
++                        } else if (WSDLConstants.QNAME_IMPORT.equals(name)) {
++                            String importedDoc = reader.getAttributeValue(null, "location");
++                            if (importedDoc != null) {
++                                importedDocs.add(new URL(src.getSystemId(), importedDoc).toString());
++                            }
++                        } else if (SCHEMA_INCLUDE_QNAME.equals(name) || SCHEMA_IMPORT_QNAME.equals(name) ||
++                                SCHEMA_REDEFINE_QNAME.equals(name)) {
++                            String importedDoc = reader.getAttributeValue(null, "schemaLocation");
++                            if (importedDoc != null) {
++                                importedDocs.add(new URL(src.getSystemId(), importedDoc).toString());
++                            }
++                        }
++                    }
++                    return new WSDLImpl(
++                        rootName,systemId,src,tns,hasPortType,hasService,importedDocs,allServices);
++                } else {
++                    return new MetadataDocument(rootName,systemId,src);
++                }
++            } finally {
++                reader.close();
++            }
++        } catch (WebServiceException e) {
++            throw new ServerRtException("runtime.parser.wsdl", systemId,e);
++        } catch (IOException e) {
++            throw new ServerRtException("runtime.parser.wsdl", systemId,e);
++        } catch (XMLStreamException e) {
++            throw new ServerRtException("runtime.parser.wsdl", systemId,e);
++        }
++    }
++
++
++    private final QName rootName;
++    private final SDDocumentSource source;
++
++    /**
++     * The original system ID of this document.
++     *
++     * When this document contains relative references to other resources,
++     * this field is used to find which {@link com.sun.xml.internal.ws.server.SDDocumentImpl} it refers to.
++     *
++     * Must not be null.
++     */
++    private final URL url;
++    private final Set<String> imports;
++
++    protected MetadataDocument(QName rootName, URL url, SDDocumentSource source) {
++        this(rootName, url, source, new HashSet<String>());
++    }
++
++    protected MetadataDocument(QName rootName, URL url, SDDocumentSource source, Set<String> imports) {
++        assert url!=null;
++        this.rootName = rootName;
++        this.source = source;
++        this.url = url;
++        this.imports = imports;
++    }
++
++    public QName getRootName() {
++        return rootName;
++    }
++
++    public boolean isWSDL() {
++        return false;
++    }
++
++    public boolean isSchema() {
++        return false;
++    }
++
++    public URL getURL() {
++        return url;
++    }
++
++    public XMLStreamReader read(XMLInputFactory xif) throws IOException, XMLStreamException {
++        return source.read(xif);
++    }
++
++    public XMLStreamReader read() throws IOException, XMLStreamException {
++        return source.read();
++    }
++
++    public URL getSystemId() {
++        return url;
++    }
++
++    public Set<String> getImports() {
++        return imports;
++    }
++
++    public void writeTo(PortAddressResolver portAddressResolver, DocumentAddressResolver resolver, OutputStream os) throws IOException {
++        XMLStreamWriter w = null;
++        try {
++            //generate the WSDL with utf-8 encoding and XML version 1.0
++            w = XMLStreamWriterFactory.create(os, "UTF-8");
++            w.writeStartDocument("UTF-8", "1.0");
++            writeTo(portAddressResolver,resolver,w);
++            w.writeEndDocument();
++        } catch (XMLStreamException e) {
++            IOException ioe = new IOException(e.getMessage());
++            ioe.initCause(e);
++            throw ioe;
++        } finally {
++            try {
++                if (w != null)
++                    w.close();
++            } catch (XMLStreamException e) {
++                IOException ioe = new IOException(e.getMessage());
++                ioe.initCause(e);
++                throw ioe;
++            }
++        }
++    }
++
++    public void writeTo(PortAddressResolver portAddressResolver, DocumentAddressResolver resolver, XMLStreamWriter out) throws XMLStreamException, IOException {
++
++        XMLStreamReader xsr = source.read();
++        try {
++            out.writeComment(VERSION_COMMENT);
++            new XMLStreamReaderToXMLStreamWriter().bridge(xsr, out);
++        } finally {
++            xsr.close();
++        }
++    }
++
++
++    /**
++     * {@link com.sun.xml.internal.ws.api.server.SDDocument.Schema} implementation.
++     *
++     * @author Kohsuke Kawaguchi
++     */
++    private static final class SchemaImpl extends MetadataDocument implements Schema {
++        private final String targetNamespace;
++
++        public SchemaImpl(QName rootName, URL url, SDDocumentSource source, String targetNamespace,
++                          Set<String> imports) {
++            super(rootName, url, source, imports);
++            this.targetNamespace = targetNamespace;
++        }
++
++        public String getTargetNamespace() {
++            return targetNamespace;
++        }
++
++        public boolean isSchema() {
++            return true;
++        }
++    }
++
++
++    private static final class WSDLImpl extends MetadataDocument implements WSDL {
++        private final String targetNamespace;
++        private final boolean hasPortType;
++        private final boolean hasService;
++        private final Set<QName> allServices;
++
++        public WSDLImpl(QName rootName, URL url, SDDocumentSource source, String targetNamespace, boolean hasPortType,
++                        boolean hasService, Set<String> imports, Set<QName> allServices) {
++            super(rootName, url, source, imports);
++            this.targetNamespace = targetNamespace;
++            this.hasPortType = hasPortType;
++            this.hasService = hasService;
++            this.allServices = allServices;
++        }
++
++        public String getTargetNamespace() {
++            return targetNamespace;
++        }
++
++        public boolean hasPortType() {
++            return hasPortType;
++        }
++
++        public boolean hasService() {
++            return hasService;
++        }
++
++        public Set<QName> getAllServices() {
++            return allServices;
++        }
++
++        public boolean isWSDL() {
++            return true;
++        }
++    }
++
++
++}
+--- /dev/null	Thu Jul 30 19:04:31 2009
++++ openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/wsdl/parser/W3CAddressingMetadataWSDLParserExtension.java	Thu Jul 30 19:04:30 2009
+@@ -0,0 +1,106 @@
++/*
++ * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++package com.sun.xml.internal.ws.wsdl.parser;
++
++import com.sun.xml.internal.ws.api.model.wsdl.*;
++import com.sun.xml.internal.ws.model.wsdl.WSDLOperationImpl;
++import com.sun.xml.internal.ws.model.wsdl.WSDLBoundPortTypeImpl;
++import javax.xml.stream.XMLStreamReader;
++import javax.xml.namespace.QName;
++
++/**
++ * W3C WS-Addressing Runtime WSDL parser extension that parses
++ * WS-Addressing Metadata wsdl extensibility elements
++ * This mainly reads wsam:Action element on input/output/fault messages in wsdl.
++ *
++ * @author Rama Pulavarthi
++ */
++public class W3CAddressingMetadataWSDLParserExtension extends W3CAddressingWSDLParserExtension {
++
++    String METADATA_WSDL_EXTN_NS = "http://www.w3.org/2007/05/addressing/metadata";
++    QName METADATA_WSDL_ACTION_TAG = new QName(METADATA_WSDL_EXTN_NS, "Action", "wsam");
++
++    @Override
++    public boolean bindingElements(WSDLBoundPortType binding, XMLStreamReader reader) {
++        return false;
++    }
++
++    @Override
++    public boolean portElements(WSDLPort port, XMLStreamReader reader) {
++        return false;
++    }
++
++    @Override
++    public boolean bindingOperationElements(WSDLBoundOperation operation, XMLStreamReader reader) {
++        return false;
++    }
++
++    @Override
++    public boolean portTypeOperationInput(WSDLOperation o, XMLStreamReader reader) {
++        WSDLOperationImpl impl = (WSDLOperationImpl) o;
++
++        String action = ParserUtil.getAttribute(reader, METADATA_WSDL_ACTION_TAG);
++        if (action != null) {
++            impl.getInput().setAction(action);
++            impl.getInput().setDefaultAction(false);
++        }
++
++        return false;
++    }
++
++    @Override
++    public boolean portTypeOperationOutput(WSDLOperation o, XMLStreamReader reader) {
++        WSDLOperationImpl impl = (WSDLOperationImpl) o;
++
++        String action = ParserUtil.getAttribute(reader, METADATA_WSDL_ACTION_TAG);
++        if (action != null) {
++            impl.getOutput().setAction(action);
++        }
++
++        return false;
++    }
++
++    @Override
++    public boolean portTypeOperationFault(WSDLOperation o, XMLStreamReader reader) {
++        WSDLOperationImpl impl = (WSDLOperationImpl) o;
++
++        String action = ParserUtil.getAttribute(reader, METADATA_WSDL_ACTION_TAG);
++        if (action != null) {
++            String name = ParserUtil.getMandatoryNonEmptyAttribute(reader, "name");
++            impl.getFaultActionMap().put(name, action);
++        }
++
++        return false;
++    }
++
++    @Override
++    protected void patchAnonymousDefault(WSDLBoundPortTypeImpl binding) {
++    }
++
++    @Override
++    protected String getNamespaceURI() {
++        return METADATA_WSDL_EXTN_NS;
++    }
++}
+--- openjdk/jaxws/src/share/classes/com/sun/codemodel/internal/fmt/package.html	Thu Jul 30 19:04:34 2009
++++ /dev/null	Thu Jul 30 19:04:34 2009
+@@ -1,29 +0,0 @@
+-<!--
+- Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+-
+- This code is free software; you can redistribute it and/or modify it
+- under the terms of the GNU General Public License version 2 only, as
+- published by the Free Software Foundation.  Sun designates this
+- particular file as subject to the "Classpath" exception as provided
+- by Sun in the LICENSE file that accompanied this code.
+-
+- This code is distributed in the hope that it will be useful, but WITHOUT
+- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+- FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+- version 2 for more details (a copy is included in the LICENSE file that
+- accompanied this code).
+-
+- You should have received a copy of the GNU General Public License version
+- 2 along with this work; if not, write to the Free Software Foundation,
+- Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+-
+- Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+- CA 95054 USA or visit www.sun.com if you need additional information or
+- have any questions.
+--->
+-<HTML>
+-<BODY>
+-Various resource file formats (classes that implement <code>JResourceFile</code>).
+-</BODY>
+-</HTML>
+--- openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/impl/j2s/Messages.java	Thu Jul 30 19:04:36 2009
++++ /dev/null	Thu Jul 30 19:04:36 2009
+@@ -1,46 +0,0 @@
+-/*
+- * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+- *
+- * This code is free software; you can redistribute it and/or modify it
+- * under the terms of the GNU General Public License version 2 only, as
+- * published by the Free Software Foundation.  Sun designates this
+- * particular file as subject to the "Classpath" exception as provided
+- * by Sun in the LICENSE file that accompanied this code.
+- *
+- * This code is distributed in the hope that it will be useful, but WITHOUT
+- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+- * version 2 for more details (a copy is included in the LICENSE file that
+- * accompanied this code).
+- *
+- * You should have received a copy of the GNU General Public License version
+- * 2 along with this work; if not, write to the Free Software Foundation,
+- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+- *
+- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+- * CA 95054 USA or visit www.sun.com if you need additional information or
+- * have any questions.
+- */
+-package com.sun.tools.internal.xjc.api.impl.j2s;
+-
+-import java.text.MessageFormat;
+-import java.util.ResourceBundle;
+-
+-/**
+- * @author Kohsuke Kawaguchi
+- */
+-enum Messages {
+-    ;
+-
+-
+-    private static final ResourceBundle rb = ResourceBundle.getBundle(Messages.class.getName());
+-
+-    public String toString() {
+-        return format();
+-    }
+-
+-    public String format( Object... args ) {
+-        return MessageFormat.format( rb.getString(name()), args );
+-    }
+-}
+--- openjdk/jaxws/src/share/classes/com/sun/tools/internal/xjc/api/impl/j2s/Messages.properties	Thu Jul 30 19:04:38 2009
++++ /dev/null	Thu Jul 30 19:04:38 2009
+@@ -1,26 +0,0 @@
+-#
+-# Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+-#
+-# This code is free software; you can redistribute it and/or modify it
+-# under the terms of the GNU General Public License version 2 only, as
+-# published by the Free Software Foundation.  Sun designates this
+-# particular file as subject to the "Classpath" exception as provided
+-# by Sun in the LICENSE file that accompanied this code.
+-#
+-# This code is distributed in the hope that it will be useful, but WITHOUT
+-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+-# version 2 for more details (a copy is included in the LICENSE file that
+-# accompanied this code).
+-#
+-# You should have received a copy of the GNU General Public License version
+-# 2 along with this work; if not, write to the Free Software Foundation,
+-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+-#
+-# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+-# CA 95054 USA or visit www.sun.com if you need additional information or
+-# have any questions.
+-#
+-
+- 
+--- openjdk/jaxws/src/share/classes/com/sun/xml/internal/fastinfoset/stax/events/StAXEventAllocator.java	Thu Jul 30 19:04:40 2009
++++ /dev/null	Thu Jul 30 19:04:41 2009
+@@ -1,237 +0,0 @@
+-/*
+- * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+- *
+- * This code is free software; you can redistribute it and/or modify it
+- * under the terms of the GNU General Public License version 2 only, as
+- * published by the Free Software Foundation.  Sun designates this
+- * particular file as subject to the "Classpath" exception as provided
+- * by Sun in the LICENSE file that accompanied this code.
+- *
+- * This code is distributed in the hope that it will be useful, but WITHOUT
+- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+- * version 2 for more details (a copy is included in the LICENSE file that
+- * accompanied this code).
+- *
+- * You should have received a copy of the GNU General Public License version
+- * 2 along with this work; if not, write to the Free Software Foundation,
+- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+- *
+- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+- * CA 95054 USA or visit www.sun.com if you need additional information or
+- * have any questions.
+- *
+- * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
+- */
+- 
+-
+-
+-package com.sun.xml.internal.fastinfoset.stax.events;
+-
+-import javax.xml.namespace.QName;
+-import javax.xml.stream.XMLStreamException;
+-import javax.xml.stream.XMLStreamReader;
+-import javax.xml.stream.events.Namespace;
+-import javax.xml.stream.events.XMLEvent;
+-import javax.xml.stream.util.XMLEventAllocator;
+-import javax.xml.stream.util.XMLEventConsumer;
+-
+-import com.sun.xml.internal.fastinfoset.CommonResourceBundle;
+-
+-/**
+- * This class provides the same functionality as StAXEventAllocatorBase, but without
+- * using EventFactory and creating a new object for each call.
+- *
+- * It seems to be good idea using static components. Unfortunately, EventReader's peek
+- * and next methods require that multiple instances being created.
+- *
+- */
+-public class StAXEventAllocator implements XMLEventAllocator {
+-    StartElementEvent startElement = new StartElementEvent();
+-    EndElementEvent endElement = new EndElementEvent();
+-    CharactersEvent characters = new CharactersEvent();
+-    CharactersEvent cData = new CharactersEvent("",true);
+-    CharactersEvent space = new CharactersEvent();
+-    CommentEvent comment = new CommentEvent();
+-    EntityReferenceEvent entity = new EntityReferenceEvent();
+-    ProcessingInstructionEvent pi = new ProcessingInstructionEvent();
+-    StartDocumentEvent startDoc = new StartDocumentEvent();
+-    EndDocumentEvent endDoc = new EndDocumentEvent();
+-    DTDEvent dtd = new DTDEvent();
+-    
+-    /** Creates a new instance of StAXEventAllocator */
+-    public StAXEventAllocator() {
+-    }
+-    public XMLEventAllocator newInstance() {
+-        return new StAXEventAllocator();
+-    }
+-
+-  /**
+-   * This method allocates an event given the current state of the XMLStreamReader.  
+-   * If this XMLEventAllocator does not have a one-to-one mapping between reader state
+-   * and events this method will return null.  
+-   * @param streamReader The XMLStreamReader to allocate from
+-   * @return the event corresponding to the current reader state
+-   */
+-    public XMLEvent allocate(XMLStreamReader streamReader) throws XMLStreamException {
+-        if(streamReader == null )
+-            throw new XMLStreamException(CommonResourceBundle.getInstance().getString("message.nullReader"));
+-        return getXMLEvent(streamReader);
+-    }
+-    
+-  /**
+-   * This method allocates an event or set of events given the current state of 
+-   * the XMLStreamReader and adds the event or set of events to the consumer that 
+-   * was passed in.  
+-   * @param streamReader The XMLStreamReader to allocate from
+-   * @param consumer The XMLEventConsumer to add to.
+-   */
+-    public void allocate(XMLStreamReader streamReader, XMLEventConsumer consumer) throws XMLStreamException {
+-        consumer.add(getXMLEvent(streamReader));
+-
+-    }
+-    // ---------------------end of methods defined by XMLEventAllocator-----------------//
+-    
+-    
+-    XMLEvent getXMLEvent(XMLStreamReader reader){
+-        EventBase event = null;
+-        int eventType = reader.getEventType();
+-        
+-        switch(eventType){
+-            
+-            case XMLEvent.START_ELEMENT:
+-            {
+-                startElement.reset();
+-                startElement.setName(new QName(reader.getNamespaceURI(),
+-                                   reader.getLocalName(), reader.getPrefix()));
+-
+-                addAttributes(startElement,reader);
+-                addNamespaces(startElement, reader);
+-                //need to fix it along with the Reader
+-                //setNamespaceContext(startElement,reader);
+-                event = startElement;
+-                break;
+-            }
+-            case XMLEvent.END_ELEMENT:
+-            {
+-                endElement.reset();
+-                endElement.setName(new QName(reader.getNamespaceURI(),
+-                                 reader.getLocalName(),reader.getPrefix()));
+-                addNamespaces(endElement,reader);
+-                event = endElement ;
+-                break;
+-            }
+-            case XMLEvent.PROCESSING_INSTRUCTION:
+-            {
+-                pi.setTarget(reader.getPITarget());
+-                pi.setData(reader.getPIData());
+-                event = pi;
+-                break;
+-            }
+-            case XMLEvent.CHARACTERS:
+-            {
+-                characters.setData(reader.getText());
+-                event = characters;
+-                /**
+-                if (reader.isWhiteSpace()) {
+-                    space.setData(reader.getText());
+-                    space.setSpace(true);
+-                    event = space;
+-                }
+-                else {
+-                    characters.setData(reader.getText()); 
+-                    event = characters;
+-                }
+-                 */
+-                break;
+-            }
+-            case XMLEvent.COMMENT:
+-            {
+-                comment.setText(reader.getText());
+-                event = comment;
+-                break;
+-            }
+-            case XMLEvent.START_DOCUMENT:
+-            {
+-                startDoc.reset();
+-                String encoding = reader.getEncoding();
+-                String version = reader.getVersion();
+-                if (encoding != null)
+-                    startDoc.setEncoding(encoding);
+-                if (version != null)
+-                    startDoc.setVersion(version);
+-                startDoc.setStandalone(reader.isStandalone());
+-                if(reader.getCharacterEncodingScheme() != null){
+-                    startDoc.setDeclaredEncoding(true);
+-                }else{
+-                    startDoc.setDeclaredEncoding(false);
+-                }
+-                event = startDoc ;
+-                break;
+-            }
+-            case XMLEvent.END_DOCUMENT:{
+-                event = endDoc;
+-                break;
+-            }
+-            case XMLEvent.ENTITY_REFERENCE:{
+-                entity.setName(reader.getLocalName());
+-                entity.setDeclaration(new EntityDeclarationImpl(reader.getLocalName(),reader.getText()));
+-                event = entity;
+-                break;
+-                
+-            }
+-            case XMLEvent.ATTRIBUTE:{
+-                event = null ;
+-                break;
+-            }
+-            case XMLEvent.DTD:{
+-                dtd.setDTD(reader.getText());
+-                event = dtd;
+-                break;
+-            }
+-            case XMLEvent.CDATA:{
+-                cData.setData(reader.getText()); 
+-                event = cData;
+-                break;
+-            }
+-            case XMLEvent.SPACE:{
+-                space.setData(reader.getText());
+-                space.setSpace(true);
+-                event = space;
+-                break;
+-            }
+-        }
+-        event.setLocation(reader.getLocation());
+-        return event ;
+-    }
+-    
+-    //use event.addAttribute instead of addAttributes to avoid creating another list
+-    protected void addAttributes(StartElementEvent event,XMLStreamReader reader){        
+-        AttributeBase attr = null;
+-        for(int i=0; i<reader.getAttributeCount() ;i++){
+-            attr =  new AttributeBase(reader.getAttributeName(i), reader.getAttributeValue(i));
+-            attr.setAttributeType(reader.getAttributeType(i));
+-            attr.setSpecified(reader.isAttributeSpecified(i));
+-            event.addAttribute(attr);
+-        }
+-    }
+-    
+-    //add namespaces to StartElement/EndElement
+-    protected void addNamespaces(StartElementEvent event,XMLStreamReader reader){
+-        Namespace namespace = null;
+-        for(int i=0; i<reader.getNamespaceCount(); i++){
+-            namespace =  new NamespaceBase(reader.getNamespacePrefix(i), reader.getNamespaceURI(i));
+-            event.addNamespace(namespace);
+-        }
+-    }
+-    
+-    protected void addNamespaces(EndElementEvent event,XMLStreamReader reader){
+-        Namespace namespace = null;
+-        for(int i=0; i<reader.getNamespaceCount(); i++){
+-            namespace =  new NamespaceBase(reader.getNamespacePrefix(i), reader.getNamespaceURI(i));
+-            event.addNamespace(namespace);
+-        }
+-    }
+-        
+-}
+--- openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/addressing/model/InvalidMapException.java	Thu Jul 30 19:04:43 2009
++++ /dev/null	Thu Jul 30 19:04:43 2009
+@@ -1,50 +0,0 @@
+-/*
+- * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+- *
+- * This code is free software; you can redistribute it and/or modify it
+- * under the terms of the GNU General Public License version 2 only, as
+- * published by the Free Software Foundation.  Sun designates this
+- * particular file as subject to the "Classpath" exception as provided
+- * by Sun in the LICENSE file that accompanied this code.
+- *
+- * This code is distributed in the hope that it will be useful, but WITHOUT
+- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+- * version 2 for more details (a copy is included in the LICENSE file that
+- * accompanied this code).
+- *
+- * You should have received a copy of the GNU General Public License version
+- * 2 along with this work; if not, write to the Free Software Foundation,
+- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+- *
+- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+- * CA 95054 USA or visit www.sun.com if you need additional information or
+- * have any questions.
+- */
+-
+-package com.sun.xml.internal.ws.addressing.model;
+-
+-import javax.xml.ws.WebServiceException;
+-import javax.xml.namespace.QName;
+-
+-/**
+- * @author Arun Gupta
+- */
+-public class InvalidMapException extends WebServiceException {
+-    QName name;
+-    QName subsubcode;
+-
+-    public InvalidMapException(QName name, QName subsubcode) {
+-        this.name = name;
+-        this.subsubcode = subsubcode;
+-    }
+-
+-    public QName getMapQName() {
+-        return name;
+-    }
+-
+-    public QName getSubsubcode() {
+-        return subsubcode;
+-    }
+-}
+--- openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/addressing/model/MapRequiredException.java	Thu Jul 30 19:04:45 2009
++++ /dev/null	Thu Jul 30 19:04:45 2009
+@@ -1,44 +0,0 @@
+-/*
+- * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+- *
+- * This code is free software; you can redistribute it and/or modify it
+- * under the terms of the GNU General Public License version 2 only, as
+- * published by the Free Software Foundation.  Sun designates this
+- * particular file as subject to the "Classpath" exception as provided
+- * by Sun in the LICENSE file that accompanied this code.
+- *
+- * This code is distributed in the hope that it will be useful, but WITHOUT
+- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+- * version 2 for more details (a copy is included in the LICENSE file that
+- * accompanied this code).
+- *
+- * You should have received a copy of the GNU General Public License version
+- * 2 along with this work; if not, write to the Free Software Foundation,
+- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+- *
+- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+- * CA 95054 USA or visit www.sun.com if you need additional information or
+- * have any questions.
+- */
+-
+-package com.sun.xml.internal.ws.addressing.model;
+-
+-import javax.xml.ws.WebServiceException;
+-import javax.xml.namespace.QName;
+-
+-/**
+- * @author Arun Gupta
+- */
+-public class MapRequiredException extends WebServiceException {
+-    QName name;
+-
+-    public MapRequiredException(QName name) {
+-        this.name = name;
+-    }
+-
+-    public QName getMapQName() {
+-        return name;
+-    }
+-}
+--- openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/client/ResponseImpl.java	Thu Jul 30 19:04:47 2009
++++ /dev/null	Thu Jul 30 19:04:47 2009
+@@ -1,118 +0,0 @@
+-/*
+- * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+- *
+- * This code is free software; you can redistribute it and/or modify it
+- * under the terms of the GNU General Public License version 2 only, as
+- * published by the Free Software Foundation.  Sun designates this
+- * particular file as subject to the "Classpath" exception as provided
+- * by Sun in the LICENSE file that accompanied this code.
+- *
+- * This code is distributed in the hope that it will be useful, but WITHOUT
+- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+- * version 2 for more details (a copy is included in the LICENSE file that
+- * accompanied this code).
+- *
+- * You should have received a copy of the GNU General Public License version
+- * 2 along with this work; if not, write to the Free Software Foundation,
+- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+- *
+- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+- * CA 95054 USA or visit www.sun.com if you need additional information or
+- * have any questions.
+- */
+-
+-package com.sun.xml.internal.ws.client;
+-
+-import com.sun.xml.internal.ws.util.CompletedFuture;
+-
+-import javax.xml.ws.AsyncHandler;
+-import javax.xml.ws.Response;
+-import java.util.Map;
+-import java.util.concurrent.Callable;
+-import java.util.concurrent.Future;
+-import java.util.concurrent.FutureTask;
+-
+-/**
+- * {@link Response} implementation.
+- *
+- * @author Kohsuke Kawaguchi
+- * @author Kathy Walsh
+- */
+-public final class ResponseImpl<T> extends FutureTask<T> implements Response<T>, ResponseContextReceiver {
+-
+-    /**
+-     * Optional {@link AsyncHandler} that gets invoked
+-     * at the completion of the task.
+-     */
+-    private final AsyncHandler<T> handler;
+-    private ResponseContext responseContext;
+-
+-    private final Callable<T> callable;
+-
+-    /**
+-     *
+-     * @param callable
+-     *      This {@link Callable} is executed asynchronously.
+-     * @param handler
+-     *      Optional {@link AsyncHandler} to invoke at the end
+-     *      of the processing. Can be null.
+-     */
+-    public ResponseImpl(Callable<T> callable, AsyncHandler<T> handler) {
+-        super(callable);
+-        this.callable = callable;
+-        this.handler = handler;
+-    }
+-
+-    @Override
+-    public void run() {
+-        // override so that we call set()
+-        try {
+-            set(callable.call(), null);
+-        } catch (Throwable t) {
+-            set(null, t);
+-        }
+-    }
+-    
+-    protected void set(final T v, final Throwable t) {
+-        // call the handler before we mark the future as 'done'
+-        if (handler!=null) {
+-            try {
+-                /**
+-                 * {@link Response} object passed into the callback.
+-                 * We need a separate {@link Future} because we don't want {@link ResponseImpl}
+-                 * to be marked as 'done' before the callback finishes execution.
+-                 * (That would provide implicit synchronization between the application code
+-                 * in the main thread and the callback code, and is compatible with the JAX-RI 2.0 FCS.
+-                 */
+-                class CallbackFuture<T> extends CompletedFuture<T> implements Response<T> {
+-                    public CallbackFuture(T v, Throwable t) {
+-                        super(v, t);
+-                    }
+-
+-                    public Map<String, Object> getContext() {
+-                        return ResponseImpl.this.getContext();
+-                    }
+-                }
+-                handler.handleResponse(new CallbackFuture<T>(v, t));
+-            } catch (Throwable e) {
+-                super.setException(e);
+-                return;
+-            }
+-        }
+-        if (t != null) {
+-            super.setException(t); 
+-        } else {
+-            super.set(v);
+-        }
+-    }
+-
+-    public ResponseContext getContext() {
+-        return responseContext;
+-    }
+-
+-    public void setResponseContext(ResponseContext rc) {
+-        responseContext = rc;
+-    }
+-}
+--- openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/client/sei/AsyncBuilder.java	Thu Jul 30 19:04:49 2009
++++ /dev/null	Thu Jul 30 19:04:49 2009
+@@ -1,244 +0,0 @@
+-/*
+- * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+- *
+- * This code is free software; you can redistribute it and/or modify it
+- * under the terms of the GNU General Public License version 2 only, as
+- * published by the Free Software Foundation.  Sun designates this
+- * particular file as subject to the "Classpath" exception as provided
+- * by Sun in the LICENSE file that accompanied this code.
+- *
+- * This code is distributed in the hope that it will be useful, but WITHOUT
+- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+- * version 2 for more details (a copy is included in the LICENSE file that
+- * accompanied this code).
+- *
+- * You should have received a copy of the GNU General Public License version
+- * 2 along with this work; if not, write to the Free Software Foundation,
+- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+- *
+- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+- * CA 95054 USA or visit www.sun.com if you need additional information or
+- * have any questions.
+- */
+-
+-package com.sun.xml.internal.ws.client.sei;
+-
+-import com.sun.xml.internal.bind.api.AccessorException;
+-import com.sun.xml.internal.bind.api.Bridge;
+-import com.sun.xml.internal.bind.api.CompositeStructure;
+-import com.sun.xml.internal.bind.api.RawAccessor;
+-import com.sun.xml.internal.ws.api.SOAPVersion;
+-import com.sun.xml.internal.ws.api.message.Message;
+-import com.sun.xml.internal.ws.api.message.Messages;
+-import com.sun.xml.internal.ws.api.model.SEIModel;
+-import com.sun.xml.internal.ws.model.ParameterImpl;
+-import com.sun.xml.internal.ws.model.WrapperParameter;
+-import com.sun.xml.internal.ws.message.jaxb.JAXBMessage;
+-import java.util.Collection;
+-
+-import javax.xml.bind.JAXBException;
+-import javax.xml.namespace.QName;
+-import javax.xml.ws.Holder;
+-import javax.xml.ws.WebServiceException;
+-import java.util.List;
+-
+-/**
+- * Builds Async bean
+- *
+- * @see MessageFiller
+- * @author Jitendra Kotamraju
+- */
+-abstract class AsyncBuilder {
+-    
+-    abstract Object fillAsyncBean(Object[] methodArgs, Object returnValue, Object bean);
+-
+-    /**
+-     * Used to create a payload JAXB object just by taking
+-     * one of the parameters.
+-     */
+-    final static class Bare extends AsyncBuilder {
+-        /**
+-         * The index of the method invocation parameters that goes into the payload.
+-         */
+-        private final int methodPos;
+-        private final ValueGetter getter;
+-        private final RawAccessor accessor;
+-
+-        /**
+-         * Creates a {@link BodyBuilder} from a bare parameter.
+-         */
+-        Bare(Class wrapper, ParameterImpl p) {
+-            this.methodPos = p.getIndex();
+-            this.getter = ValueGetter.get(p);
+-            QName name = p.getName();
+-            try {
+-                accessor = p.getOwner().getJAXBContext().getElementPropertyAccessor(
+-                        wrapper, name.getNamespaceURI(), name.getLocalPart() );
+-            } catch (JAXBException e) {
+-                throw new WebServiceException(  // TODO: i18n
+-                    wrapper+" do not have a property of the name "+name,e);
+-            }
+-        }
+-
+-        /**
+-         * Picks up an object from the method arguments and uses it.
+-         */
+-        Object fillAsyncBean(Object[] methodArgs, Object returnValue, Object bean) {
+-            Object obj = (methodPos == -1) ? returnValue : getter.get(methodArgs[methodPos]);
+-            try {
+-                accessor.set(bean, obj);
+-            } catch (Exception e) {
+-                throw new WebServiceException(e);    // TODO:i18n
+-            }
+-            return bean;
+-        }
+-    }
+-    
+-    final static class Filler extends AsyncBuilder {
+-        /**
+-         * The index of the method invocation parameters that goes into the payload.
+-         */
+-        private final int methodPos;
+-        private final ValueGetter getter;
+-
+-        /**
+-         * Creates a {@link BodyBuilder} from a bare parameter.
+-         */
+-        Filler(ParameterImpl p) {
+-            this.methodPos = p.getIndex();
+-            this.getter = ValueGetter.get(p);
+-        }
+-
+-        /**
+-         * Picks up an object from the method arguments and uses it.
+-         */
+-        Object fillAsyncBean(Object[] methodArgs, Object returnValue, Object bean) {
+-            return (methodPos == -1) ? returnValue : getter.get(methodArgs[methodPos]);
+-        }
+-    }
+-    
+-    public static AsyncBuilder NONE = new None();
+-    
+-    static final class None extends AsyncBuilder {
+-        Object fillAsyncBean(Object[] methodArgs, Object returnValue, Object bean) {
+-            return bean;
+-        }
+-    }
+-    
+-    static final class Composite extends AsyncBuilder {
+-        private final AsyncBuilder[] builders;
+-        private final Class beanClass;
+-
+-        public Composite(AsyncBuilder[] builders, Class beanClass) {
+-            this.builders = builders;
+-            this.beanClass = beanClass;
+-        }
+-
+-
+-        public Composite(Collection<? extends AsyncBuilder> builders, Class beanClass) {
+-            this(builders.toArray(new AsyncBuilder[builders.size()]), beanClass);
+-        }
+-
+-        Object fillAsyncBean(Object[] methodArgs, Object returnValue, Object bean) {
+-            try {
+-                bean = beanClass.newInstance();
+-            } catch (Exception ex) {
+-                throw new WebServiceException(ex);
+-            }
+-            for (AsyncBuilder builder : builders) {
+-                builder.fillAsyncBean(methodArgs, returnValue, bean);
+-            }
+-            return bean;
+-        }
+-    }
+-
+-
+-    /**
+-     * Used to handle a 'wrapper' style request.
+-     * Common part of rpc/lit and doc/lit.
+-     */
+-    abstract static class Wrapped extends AsyncBuilder {
+-
+-        /**
+-         * Where in the method argument list do they come from?
+-         */
+-        protected final int[] indices;
+-
+-        /**
+-         * Abstracts away the {@link Holder} handling when touching method arguments.
+-         */
+-        protected final ValueGetter[] getters;
+-
+-        protected Wrapped(WrapperParameter wp) {
+-
+-            List<ParameterImpl> children = wp.getWrapperChildren();
+-
+-            indices = new int[children.size()];
+-            getters = new ValueGetter[children.size()];
+-            for( int i=0; i<indices.length; i++ ) {
+-                ParameterImpl p = children.get(i);
+-                indices[i] = p.getIndex();
+-                getters[i] = ValueGetter.get(p);
+-            }
+-        }
+-    }
+-
+-    /**
+-     * Used to create a payload JAXB object by wrapping
+-     * multiple parameters into one "wrapper bean".
+-     */
+-    final static class DocLit extends Wrapped {
+-        /**
+-         * How does each wrapped parameter binds to XML?
+-         */
+-        private final RawAccessor[] accessors;
+-
+-        /**
+-         * Wrapper bean.
+-         */
+-        private final Class wrapper;
+-
+-        /**
+-         * Creates a {@link BodyBuilder} from a {@link WrapperParameter}.
+-         */
+-        DocLit(Class wrapper, WrapperParameter wp) {
+-            super(wp);
+-            this.wrapper = wrapper;
+-
+-            List<ParameterImpl> children = wp.getWrapperChildren();
+-
+-            accessors = new RawAccessor[children.size()];
+-            for( int i=0; i<accessors.length; i++ ) {
+-                ParameterImpl p = children.get(i);
+-                QName name = p.getName();
+-                try {
+-                    accessors[i] = p.getOwner().getJAXBContext().getElementPropertyAccessor(
+-                        wrapper, name.getNamespaceURI(), name.getLocalPart() );
+-                } catch (JAXBException e) {
+-                    throw new WebServiceException(  // TODO: i18n
+-                        wrapper+" do not have a property of the name "+name,e);
+-                }
+-            }
+-
+-        }
+-
+-        /**
+-         * Packs a bunch of arguments into a {@link CompositeStructure}.
+-         */
+-        Object fillAsyncBean(Object[] methodArgs, Object returnValue, Object bean) {
+-            try {
+-                // fill in wrapped parameters from methodArgs
+-                for( int i=indices.length-1; i>=0; i-- ) {
+-                    Object obj = (indices[i] == -1) ? returnValue : methodArgs[indices[i]];                    
+-                    accessors[i].set(bean,getters[i].get(obj));
+-                }
+-            } catch (Exception e) {
+-                throw new WebServiceException(e);    // TODO:i18n
+-            }
+-            return bean;
+-        }
+-    }
+-
+-}
+--- openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/encoding/AbstractXMLStreamWriterExImpl.java	Thu Jul 30 19:04:51 2009
++++ /dev/null	Thu Jul 30 19:04:51 2009
+@@ -1,83 +0,0 @@
+-/*
+- * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+- *
+- * This code is free software; you can redistribute it and/or modify it
+- * under the terms of the GNU General Public License version 2 only, as
+- * published by the Free Software Foundation.  Sun designates this
+- * particular file as subject to the "Classpath" exception as provided
+- * by Sun in the LICENSE file that accompanied this code.
+- *
+- * This code is distributed in the hope that it will be useful, but WITHOUT
+- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+- * version 2 for more details (a copy is included in the LICENSE file that
+- * accompanied this code).
+- *
+- * You should have received a copy of the GNU General Public License version
+- * 2 along with this work; if not, write to the Free Software Foundation,
+- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+- *
+- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+- * CA 95054 USA or visit www.sun.com if you need additional information or
+- * have any questions.
+- */
+-
+-package com.sun.xml.internal.ws.encoding;
+-
+-import com.sun.istack.internal.XMLStreamException2;
+-import com.sun.xml.internal.ws.util.ByteArrayBuffer;
+-import com.sun.xml.internal.org.jvnet.staxex.XMLStreamWriterEx;
+-
+-import javax.activation.DataHandler;
+-import javax.xml.stream.XMLStreamException;
+-import java.io.IOException;
+-import java.io.OutputStream;
+-
+-/**
+- * Partial default implementation of {@link XMLStreamWriterEx}.
+- *
+- * TODO: find a good home for this class.
+- *
+- * @author Kohsuke Kawaguchi
+- */
+-public abstract class AbstractXMLStreamWriterExImpl implements XMLStreamWriterEx {
+-
+-    private StreamImpl stream;
+-
+-    public void writeBinary(DataHandler data) throws XMLStreamException {
+-        try {
+-            StreamImpl stream = _writeBinary(data.getContentType());
+-            stream.write(data.getInputStream());
+-            stream.close();
+-        } catch (IOException e) {
+-            throw new XMLStreamException2(e);
+-        }
+-    }
+-    public OutputStream writeBinary(String contentType) throws XMLStreamException {
+-        return _writeBinary(contentType);
+-    }
+-
+-    private StreamImpl _writeBinary(String contentType) {
+-        if(stream==null)
+-            stream = new StreamImpl();
+-        else
+-            stream.reset();
+-        stream.contentType = contentType;
+-        return stream;
+-    }
+-
+-    private final class StreamImpl extends ByteArrayBuffer {
+-        private String contentType;
+-        public void close() throws IOException {
+-            super.close();
+-            try {
+-                writeBinary(buf,0,size(),contentType);
+-            } catch (XMLStreamException e) {
+-                IOException x = new IOException();
+-                x.initCause(e);
+-                throw x;
+-            }
+-        }
+-    }
+-}
+--- openjdk/jaxws/src/share/classes/com/sun/xml/internal/ws/streaming/XMLReader.java	Thu Jul 30 19:04:53 2009
++++ /dev/null	Thu Jul 30 19:04:53 2009
+@@ -1,230 +0,0 @@
+-/*
+- * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+- *
+- * This code is free software; you can redistribute it and/or modify it
+- * under the terms of the GNU General Public License version 2 only, as
+- * published by the Free Software Foundation.  Sun designates this
+- * particular file as subject to the "Classpath" exception as provided
+- * by Sun in the LICENSE file that accompanied this code.
+- *
+- * This code is distributed in the hope that it will be useful, but WITHOUT
+- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+- * version 2 for more details (a copy is included in the LICENSE file that
+- * accompanied this code).
+- *
+- * You should have received a copy of the GNU General Public License version
+- * 2 along with this work; if not, write to the Free Software Foundation,
+- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+- *
+- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+- * CA 95054 USA or visit www.sun.com if you need additional information or
+- * have any questions.
+- */
+-
+-package com.sun.xml.internal.ws.streaming;
+-
+-import org.xml.sax.helpers.XMLReaderFactory;
+-
+-import java.util.Iterator;
+-
+-import javax.xml.namespace.QName;
+-
+-/**
+- * <p> XMLReader provides a high-level streaming parser interface
+- * for reading XML documents. </p>
+- *
+- * <p> The {@link #next} method is used to read events from the XML document. </p>
+- *
+- * <p> Each time it is called, {@link #next} returns the new state of the reader. </p>
+- *
+- * <p> Possible states are: BOF, the initial state, START, denoting the start
+- * tag of an element, END, denoting the end tag of an element, CHARS, denoting
+- * the character content of an element, PI, denoting a processing instruction,
+- * EOF, denoting the end of the document. </p>
+- *
+- * <p> Depending on the state the reader is in, one or more of the following
+- * query methods will be meaningful: {@link #getName}, {@link #getURI},
+- * {@link #getLocalName}, {@link #getAttributes}, {@link #getValue}. </p>
+- *
+- * <p> Elements visited by a XMLReader are tagged with unique IDs. The ID of the
+- * current element can be found by calling {@link #getElementId}. </p>
+- *
+- * <p> A XMLReader is always namespace-aware, and keeps track of the namespace
+- * declarations which are in scope at any time during streaming. The
+- * {@link #getURI(java.lang.String)} method can be used to find the URI
+- * associated to a given prefix in the current scope. </p>
+- *
+- * <p> XMLReaders can be created using a {@link XMLReaderFactory}. </p>
+- *
+- * <p> Some utility methods, {@link #nextContent} and {@link #nextElementContent}
+- * make it possible to ignore whitespace and processing instructions with
+- * minimum impact on the client code. </p>
+- *
+- * <p> Similarly, the {@link #skipElement} and {@link #skipElement(int elementId)}
+- * methods allow to skip to the end tag of an element ignoring all its content. </p>
+- *
+- * <p> Finally, the {@link #recordElement} method can be invoked when the XMLReader
+- * is positioned on the start tag of an element to record the element's contents
+- * so that they can be played back later. </p>
+- *
+- * @see XMLReaderFactory
+- *
+- * @author WS Development Team
+- */
+-public interface XMLReader {
+-    /**
+-     * The initial state of a XMLReader.
+-     */
+-    public static final int BOF = 0;
+-
+-    /**
+-     * The state denoting the start tag of an element.
+-     */
+-    public static final int START = 1;
+-
+-    /**
+-     * The state denoting the end tag of an element.
+-     */
+-    public static final int END = 2;
+-
+-    /**
+-     * The state denoting the character content of an element.
+-     */
+-    public static final int CHARS = 3;
+-
+-    /**
+-     * The state denoting a processing instruction.
+-     */
+-    public static final int PI = 4;
+-
+-    /**
+-     * The state denoting that the end of the document has been reached.
+-     */
+-    public static final int EOF = 5;
+-
+-    /**
+-     * Return the next state of the XMLReader.
+-     *
+-     * The return value is one of: START, END, CHARS, PI, EOF.
+-     */
+-    public int next();
+-
+-    /*
+-    * Return the next state of the XMLReader.
+-    *
+-    * <p> Whitespace character content and processing instructions are ignored. </p>
+-    *
+-    * <p> The return value is one of: START, END, CHARS, EOF. </p>
+-    */
+-    public int nextContent();
+-
+-    /**
+-     * Return the next state of the XMLReader.
+-     *
+-     * <p> Whitespace character content, processing instructions are ignored.
+-     * Non-whitespace character content triggers an exception. </p>
+-     *
+-     * <p> The return value is one of: START, END, EOF. </p>
+-     */
+-    public int nextElementContent();
+-
+-    /**
+-     * Return the current state of the XMLReader.
+-     *
+-     */
+-    public int getState();
+-
+-    /**
+-     * Return the current qualified name.
+-     *
+-     * <p> Meaningful only when the state is one of: START, END. </p>
+-     */
+-    public QName getName();
+-
+-    /**
+-     * Return the current URI.
+-     *
+-     * <p> Meaningful only when the state is one of: START, END. </p>
+-     */
+-    public String getURI();
+-
+-    /**
+-     * Return the current local name.
+-     *
+-     * <p> Meaningful only when the state is one of: START, END, PI. </p>
+-     */
+-    public String getLocalName();
+-
+-    /**
+-     * Return the current attribute list. In the jaxws implementation,
+-     * this list also includes namespace declarations.
+-     *
+-     * <p> Meaningful only when the state is one of: START. </p>
+-     *
+-     * <p> The returned {@link Attributes} object belong to the XMLReader and is
+-     * only guaranteed to be valid until the {@link #next} method is called,
+-     * directly or indirectly.</p>
+-     */
+-    public Attributes getAttributes();
+-
+-    /**
+-     * Return the current value.
+-     *
+-     * <p> Meaningful only when the state is one of: CHARS, PI. </p>
+-     */
+-    public String getValue();
+-
+-    /**
+-     * Return the current element ID.
+-     */
+-    public int getElementId();
+-
+-    /**
+-     * Return the current line number.
+-     *
+-     * <p> Due to aggressive parsing, this value may be off by a few lines. </p>
+-     */
+-    public int getLineNumber();
+-
+-    /**
+-     * Return the URI for the given prefix.
+-     *
+-     * <p> If there is no namespace declaration in scope for the given
+-     * prefix, return null. </p>
+-     */
+-    public String getURI(String prefix);
+-
+-    /**
+-     * Return an iterator on all prefixes in scope, except for the default prefix.
+-     *
+-     */
+-    public Iterator getPrefixes();
+-
+-    /**
+-     * Records the current element and leaves the reader positioned on its end tag.
+-     *
+-     * <p> The XMLReader must be positioned on the start tag of the element.
+-     * The returned reader will play back all events starting with the
+-     * start tag of the element and ending with its end tag. </p>
+-     */
+-    public XMLReader recordElement();
+-
+-    /**
+-     * Skip all nodes up to the end tag of the element with the current element ID.
+-     */
+-    public void skipElement();
+-
+-    /**
+-     * Skip all nodes up to the end tag of the element with the given element ID.
+-     */
+-    public void skipElement(int elementId);
+-
+-    /**
+-     * Close the XMLReader.
+-     *
+-     * <p> All subsequent calls to {@link #next} will return EOF. </p>
+-     */
+-    public void close();
+-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/security/icedtea-6823373.patch	Fri Aug 07 10:05:32 2009 -0400
@@ -0,0 +1,49 @@
+--- old/src/share/native/sun/awt/splashscreen/splashscreen_jpeg.c	2009-04-24 17:19:34.781300000 +0400
++++ openjdk/jdk/src/share/native/sun/awt/splashscreen/splashscreen_jpeg.c	2009-04-24 17:19:33.862300000 +0400
+@@ -139,21 +139,45 @@
+ 
+     splash->width = cinfo->output_width;
+     splash->height = cinfo->output_height;
++
++    if (!SAFE_TO_ALLOC(splash->imageFormat.depthBytes, splash->width)) {
++        return 0;
++    }
+     stride = splash->width * splash->imageFormat.depthBytes;
+ 
++    if (!SAFE_TO_ALLOC(stride, splash->height)) {
++        return 0;
++    }
++    if (!SAFE_TO_ALLOC(cinfo->output_width, cinfo->output_components)) {
++        return 0;
++    }
++
+     splash->frameCount = 1;
+     splash->frames = (SplashImage *) malloc(sizeof(SplashImage) *
+         splash->frameCount);
++    if (splash->frames == NULL) {
++        return 0;
++    }
+     memset(splash->frames, 0, sizeof(SplashImage) *
+         splash->frameCount);
++
+     splash->loopCount = 1;
+-    splash->frames[0].bitmapBits = malloc(stride * splash->height);
+     splash->frames[0].delay = 0;
++    splash->frames[0].bitmapBits = malloc(stride * splash->height);
++    if (splash->frames[0].bitmapBits == NULL) {
++        free(splash->frames);
++        return 0;
++    }
+ 
+     rowStride = cinfo->output_width * cinfo->output_components;
+ 
+     buffer = (*cinfo->mem->alloc_sarray)
+         ((j_common_ptr) cinfo, JPOOL_IMAGE, rowStride, 1);
++    if (buffer == NULL) {
++        free(splash->frames[0].bitmapBits);
++        free(splash->frames);
++        return 0;
++    }
+ 
+     initFormat(&srcFormat, 0x00FF0000, 0x0000FF00, 0x000000FF, 0x00000000);
+     srcFormat.byteOrder = BYTE_ORDER_LSBFIRST;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/security/icedtea-6824440.patch	Fri Aug 07 10:05:32 2009 -0400
@@ -0,0 +1,265 @@
+--- old/src/share/classes/com/sun/org/apache/xml/internal/security/algorithms/implementations/IntegrityHmac.java	Mon Jun 22 11:15:55 2009
++++ openjdk/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/algorithms/implementations/IntegrityHmac.java	Mon Jun 22 11:15:55 2009
+@@ -60,8 +60,14 @@
+     */
+    public abstract String engineGetURI();
+ 
++   /**
++    * Returns the output length of the hash/digest.
++    */
++   abstract int getDigestLength();
++
+    /** Field _macAlgorithm */
+    private Mac _macAlgorithm = null;
++   private boolean _HMACOutputLengthSet = false;
+ 
+    /** Field _HMACOutputLength */
+    int _HMACOutputLength = 0;
+@@ -111,14 +117,16 @@
+            throws XMLSignatureException {
+ 
+       try {
+-         byte[] completeResult = this._macAlgorithm.doFinal();
+-
+-         if ((this._HMACOutputLength == 0) || (this._HMACOutputLength >= 160)) {
++         if (this._HMACOutputLengthSet && this._HMACOutputLength < getDigestLength()) {
++            if (log.isLoggable(java.util.logging.Level.FINE)) {
++                log.log(java.util.logging.Level.FINE, 
++                    "HMACOutputLength must not be less than " + getDigestLength());
++            }
++            throw new XMLSignatureException("errorMessages.XMLSignatureException");
++         } else {
++            byte[] completeResult = this._macAlgorithm.doFinal();
+             return MessageDigestAlgorithm.isEqual(completeResult, signature);
+          }
+-         byte[] stripped = IntegrityHmac.reduceBitLength(completeResult,
+-                                 this._HMACOutputLength);
+-         return MessageDigestAlgorithm.isEqual(stripped, signature);
+       } catch (IllegalStateException ex) {
+          throw new XMLSignatureException("empty", ex);
+       }
+@@ -159,14 +167,16 @@
+    protected byte[] engineSign() throws XMLSignatureException {
+ 
+       try {
+-         byte[] completeResult = this._macAlgorithm.doFinal();
+ 
+-         if ((this._HMACOutputLength == 0) || (this._HMACOutputLength >= 160)) {
+-            return completeResult;
++         if (this._HMACOutputLengthSet && this._HMACOutputLength < getDigestLength()) {
++            if (log.isLoggable(java.util.logging.Level.FINE)) {
++                log.log(java.util.logging.Level.FINE, 
++                   "HMACOutputLength must not be less than " + getDigestLength());
++            }
++            throw new XMLSignatureException("errorMessages.XMLSignatureException");
++         } else {
++            return this._macAlgorithm.doFinal();
+          }
+-          return IntegrityHmac.reduceBitLength(completeResult,
+-                                                 this._HMACOutputLength);
+-
+       } catch (IllegalStateException ex) {
+          throw new XMLSignatureException("empty", ex);
+       }
+@@ -344,6 +354,7 @@
+     */
+    protected void engineSetHMACOutputLength(int HMACOutputLength) {
+       this._HMACOutputLength = HMACOutputLength;
++      this._HMACOutputLengthSet = true;
+    }
+ 
+    /**
+@@ -359,13 +370,13 @@
+          throw new IllegalArgumentException("element null");
+       }
+ 
+-             Text hmaclength =XMLUtils.selectDsNodeText(element.getFirstChild(),
+-                    Constants._TAG_HMACOUTPUTLENGTH,0);
++      Text hmaclength =XMLUtils.selectDsNodeText(element.getFirstChild(),
++         Constants._TAG_HMACOUTPUTLENGTH,0);
+ 
+-            if (hmaclength != null) {
+-               this._HMACOutputLength = Integer.parseInt(hmaclength.getData());
+-            }
+-
++      if (hmaclength != null) {
++         this._HMACOutputLength = Integer.parseInt(hmaclength.getData());
++         this._HMACOutputLengthSet = true;
++      }
+    }
+ 
+    /**
+@@ -373,14 +384,13 @@
+     *
+     * @param element
+     */
+-   public void engineAddContextToElement(Element element)
+-           {
++   public void engineAddContextToElement(Element element) {
+ 
+       if (element == null) {
+          throw new IllegalArgumentException("null element");
+       }
+ 
+-      if (this._HMACOutputLength != 0) {
++      if (this._HMACOutputLengthSet) {
+          Document doc = element.getOwnerDocument();
+          Element HMElem = XMLUtils.createElementInSignatureSpace(doc,
+                              Constants._TAG_HMACOUTPUTLENGTH);
+@@ -418,6 +428,10 @@
+       public String engineGetURI() {
+          return XMLSignature.ALGO_ID_MAC_HMAC_SHA1;
+       }
++
++      int getDigestLength() {
++         return 160;
++      }
+    }
+ 
+    /**
+@@ -444,6 +458,10 @@
+       public String engineGetURI() {
+          return XMLSignature.ALGO_ID_MAC_HMAC_SHA256;
+       }
++
++      int getDigestLength() {
++         return 256;
++      }
+    }
+ 
+    /**
+@@ -470,6 +488,10 @@
+       public String engineGetURI() {
+          return XMLSignature.ALGO_ID_MAC_HMAC_SHA384;
+       }
++
++      int getDigestLength() {
++         return 384;
++      }
+    }
+ 
+    /**
+@@ -496,6 +518,10 @@
+       public String engineGetURI() {
+          return XMLSignature.ALGO_ID_MAC_HMAC_SHA512;
+       }
++
++      int getDigestLength() {
++         return 512;
++      }
+    }
+ 
+    /**
+@@ -522,6 +548,10 @@
+       public String engineGetURI() {
+          return XMLSignature.ALGO_ID_MAC_HMAC_RIPEMD160;
+       }
++
++      int getDigestLength() {
++         return 160;
++      }
+    }
+ 
+    /**
+@@ -548,5 +578,9 @@
+       public String engineGetURI() {
+          return XMLSignature.ALGO_ID_MAC_HMAC_NOT_RECOMMENDED_MD5;
+       }
++
++      int getDigestLength() {
++         return 128;
++      }
+    }
+ }
+--- old/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMHMACSignatureMethod.java	Mon Jun 22 11:15:56 2009
++++ openjdk/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMHMACSignatureMethod.java	Mon Jun 22 11:15:56 2009
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright 2005-2007 Sun Microsystems, Inc.  All Rights Reserved.
++ * Copyright 2005-2009 Sun Microsystems, Inc.  All Rights Reserved.
+  * 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,6 +59,8 @@
+         Logger.getLogger("org.jcp.xml.dsig.internal.dom");
+     private Mac hmac;
+     private int outputLength;
++    private boolean outputLengthSet;
++    private static final int DIGEST_LENGTH = 160;
+ 
+     /**
+      * Creates a <code>DOMHMACSignatureMethod</code> with the specified params
+@@ -88,13 +90,12 @@
+                     ("params must be of type HMACParameterSpec");
+             }
+             outputLength = ((HMACParameterSpec) params).getOutputLength();
++            outputLengthSet = true;
+             if (log.isLoggable(Level.FINE)) {
+                 log.log(Level.FINE,
+                     "Setting outputLength from HMACParameterSpec to: "
+                     + outputLength);
+             }
+-        } else {
+-            outputLength = -1;
+         }
+     }
+ 
+@@ -102,6 +103,7 @@
+         throws MarshalException {
+         outputLength = new Integer
+             (paramsElem.getFirstChild().getNodeValue()).intValue();
++        outputLengthSet = true;
+         if (log.isLoggable(Level.FINE)) {
+             log.log(Level.FINE, "unmarshalled outputLength: " + outputLength);
+         }
+@@ -136,23 +138,13 @@
+                 throw new XMLSignatureException(nsae);
+             }
+         }
+-        if (log.isLoggable(Level.FINE)) {
+-            log.log(Level.FINE, "outputLength = " + outputLength);
++        if (outputLengthSet && outputLength < DIGEST_LENGTH) {
++            throw new XMLSignatureException
++                ("HMACOutputLength must not be less than " + DIGEST_LENGTH);
+         }
+         hmac.init((SecretKey) key);
+         si.canonicalize(context, new MacOutputStream(hmac));
+         byte[] result = hmac.doFinal();
+-        if (log.isLoggable(Level.FINE)) {
+-            log.log(Level.FINE, "resultLength = " + result.length);
+-        }
+-        if (outputLength != -1) {
+-            int byteLength = outputLength/8;
+-            if (result.length > byteLength) {
+-                byte[] truncated = new byte[byteLength];
+-                System.arraycopy(result, 0, truncated, 0, byteLength);
+-                result = truncated;
+-            }
+-        }
+ 
+         return MessageDigest.isEqual(sig, result);
+     }
+@@ -172,18 +164,13 @@
+                 throw new XMLSignatureException(nsae);
+             }
+         }
++        if (outputLengthSet && outputLength < DIGEST_LENGTH) {
++            throw new XMLSignatureException
++                ("HMACOutputLength must not be less than " + DIGEST_LENGTH);
++        }
+         hmac.init((SecretKey) key);
+         si.canonicalize(context, new MacOutputStream(hmac));
+-        byte[] result = hmac.doFinal();
+-        if (outputLength != -1) {
+-            int byteLength = outputLength/8;
+-            if (result.length > byteLength) {
+-                byte[] truncated = new byte[byteLength];
+-                System.arraycopy(result, 0, truncated, 0, byteLength);
+-                result = truncated;
+-            }
+-        }
+-        return result;
++        return hmac.doFinal();
+     }
+ 
+     boolean paramsEqual(AlgorithmParameterSpec spec) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/security/icedtea-6830335.patch	Fri Aug 07 10:05:32 2009 -0400
@@ -0,0 +1,19 @@
+--- old/src/share/native/com/sun/java/util/jar/pack/unpack.cpp	Mon Jun 22 11:50:40 2009
++++ openjdk/jdk/src/share/native/com/sun/java/util/jar/pack/unpack.cpp	Mon Jun 22 11:50:40 2009
+@@ -885,10 +885,12 @@
+ 
+   // place a limit on future CP growth:
+   int generous = 0;
+-  generous += u->ic_count*3; // implicit name, outer, outer.utf8
+-  generous += 40;  // WKUs, misc
+-  generous += u->class_count;  // implicit SourceFile strings
+-  maxentries = nentries + generous;
++  generous = add_size(generous, u->ic_count); // implicit name
++  generous = add_size(generous, u->ic_count); // outer
++  generous = add_size(generous, u->ic_count); // outer.utf8
++  generous = add_size(generous, 40); // WKUs, misc
++  generous = add_size(generous, u->class_count); // implicit SourceFile strings
++  maxentries = add_size(nentries, generous); 
+ 
+   // Note that this CP does not include "empty" entries
+   // for longs and doubles.  Those are introduced when
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/security/icedtea-6845701.patch	Fri Aug 07 10:05:32 2009 -0400
@@ -0,0 +1,12 @@
+--- old/src/share/classes/com/sun/org/apache/xerces/internal/impl/XMLScanner.java	Thu Jun 18 23:37:50 2009
++++ openjdk/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/XMLScanner.java	Thu Jun 18 23:37:49 2009
+@@ -1027,6 +1027,9 @@
+                     int c = fEntityScanner.peekChar();
+                     if (XMLChar.isMarkup(c) || c == ']') {
+                         fStringBuffer.append((char)fEntityScanner.scanChar());
++                    } else if (c != -1 && isInvalidLiteral(c)) {
++                        reportFatalError("InvalidCharInSystemID",
++                            new Object[] {Integer.toString(c, 16)});
+                     }
+                 } while (fEntityScanner.scanLiteral(quote, ident) != quote);
+                 fStringBuffer.append(ident);
--- a/plugin/icedtea/netscape/javascript/JSObject.java	Fri May 29 09:35:05 2009 -0400
+++ b/plugin/icedtea/netscape/javascript/JSObject.java	Fri Aug 07 10:05:32 2009 -0400
@@ -47,6 +47,10 @@
 package netscape.javascript;
 
 import java.applet.Applet;
+import java.security.AccessControlContext;
+import java.security.AccessControlException;
+import java.security.AccessController;
+import java.security.BasicPermission;
 
 import sun.applet.PluginAppletViewer;
 import sun.applet.PluginDebug;
@@ -102,13 +106,37 @@
     /**
      * it is illegal to construct a JSObject manually
      */
-    // FIXME: make private!
     public JSObject(int jsobj_addr) {
-        PluginDebug.debug ("JSObject int CONSTRUCTOR");
-        internal = jsobj_addr;
+        this((long) jsobj_addr);
     }
 
     public JSObject(long jsobj_addr) {
+        
+        // See if the caller has permission
+        
+        try {
+            AccessController.getContext().checkPermission(new JSObjectCreatePermission());
+        } catch (AccessControlException ace) {
+            
+            // If not, only caller with JSObject.getWindow on the stack may 
+            // make this call unprivileged.
+            
+            // Although this check is inefficient, it should happen only once
+            // during applet init, so we look the other way
+
+            StackTraceElement[] stack =  Thread.currentThread().getStackTrace();
+            boolean mayProceed = false;
+            
+            for (int i=0; i < stack.length; i++) {
+                if (stack[i].getClassName().equals("netscape.javascript.JSObject") &&
+                    stack[i].getMethodName().equals("getWindow")) {
+                    mayProceed = true;
+                }
+            }
+
+            if (!mayProceed) throw ace;
+        }
+
         PluginDebug.debug ("JSObject long CONSTRUCTOR");
         internal = jsobj_addr;
     }
@@ -234,7 +262,7 @@
         internal = ((PluginAppletViewer)
                     applet.getAppletContext()).getWindow();
         PluginDebug.debug ("GOT IT: " + internal);
-        return new JSObject(internal);
+        return new JSObject((long) internal);
     }
 
 
@@ -259,5 +287,4 @@
 
         return false;
     }
-
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/plugin/icedtea/netscape/javascript/JSObjectCreatePermission.java	Fri Aug 07 10:05:32 2009 -0400
@@ -0,0 +1,47 @@
+/* JSObjectCreatePermission.java
+   Copyright (C) 2009  Red Hat
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+IcedTea is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+ 
+package netscape.javascript;
+
+import java.security.BasicPermission;
+
+
+public class JSObjectCreatePermission extends BasicPermission {
+    public JSObjectCreatePermission() {
+        super("JSObjectCreate");
+    }
+}
--- a/plugin/icedtea/sun/applet/PluginAppletSecurityContext.java	Fri May 29 09:35:05 2009 -0400
+++ b/plugin/icedtea/sun/applet/PluginAppletSecurityContext.java	Fri Aug 07 10:05:32 2009 -0400
@@ -58,6 +58,7 @@
 import java.util.List;
 
 import net.sourceforge.jnlp.runtime.JNLPRuntime;
+import netscape.javascript.JSObjectCreatePermission;
 
 
 
@@ -1285,12 +1286,15 @@
 
 		CodeSource cs = new CodeSource((URL) null, (java.security.cert.Certificate  [])null);
 		
-		if (src != null) {
+		if (src != null && src.length() > 0) {
 			try {
 				cs = new CodeSource(new URL(src + "/"), (java.security.cert.Certificate[]) null);
 			} catch (MalformedURLException mfue) {
 				// do nothing
 			}
+		} else {
+		    JSObjectCreatePermission perm = new JSObjectCreatePermission();
+		    grantedPermissions.add(perm);
 		}
 
 		ProtectionDomain pd = new ProtectionDomain(cs, grantedPermissions, null, null);
--- a/rt/net/sourceforge/jnlp/SecurityDesc.java	Fri May 29 09:35:05 2009 -0400
+++ b/rt/net/sourceforge/jnlp/SecurityDesc.java	Fri Aug 07 10:05:32 2009 -0400
@@ -166,6 +166,30 @@
 
         return permissions;
     }
+    
+    /**
+     * Returns a PermissionCollection containing the sandbox permissions
+     */
+    public PermissionCollection getSandBoxPermissions() {
+        
+        Permissions permissions = new Permissions();
+
+        for (int i=0; i < sandboxPermissions.length; i++)
+            permissions.add(sandboxPermissions[i]);
+
+        if (downloadHost != null)
+            permissions.add(new SocketPermission(downloadHost,
+                                                 "connect, accept"));
+
+        // properties
+        PropertyDesc props[] = file.getResources().getProperties();
+        for (int i=0; i < props.length; i++) {
+            // should only allow jnlp.* properties if in sandbox?
+            permissions.add(new PropertyPermission(props[i].getKey(), "read,write"));
+        }
+
+        return permissions;
+    }
 
 }
 
--- a/rt/net/sourceforge/jnlp/runtime/JNLPClassLoader.java	Fri May 29 09:35:05 2009 -0400
+++ b/rt/net/sourceforge/jnlp/runtime/JNLPClassLoader.java	Fri Aug 07 10:05:32 2009 -0400
@@ -433,11 +433,27 @@
         // access w/o security dialog once we actually check certificates.
 
         // copy security permissions from SecurityDesc element
-		if (security != null) {
-        	Enumeration e = security.getPermissions().elements();
-        	while (e.hasMoreElements())
-            	result.add((Permission) e.nextElement());
-		}
+	if (security != null) {
+            // Security desc. is used only to track security settings for the
+            // application. However, an application may comprise of multiple
+            // jars, and as such, security must be evaluated on a per jar basis.
+
+            // set default perms
+            PermissionCollection permissions = security.getSandBoxPermissions();
+
+            // If more than default is needed, evaluate based on codesource
+            if (security.getSecurityType().equals(SecurityDesc.ALL_PERMISSIONS) ||
+                security.getSecurityType().equals(SecurityDesc.J2EE_PERMISSIONS)) {
+
+                if (cs.getCodeSigners() != null) {
+                    permissions = security.getPermissions();
+                }
+            }
+
+            Enumeration<Permission> e = permissions.elements();
+            while (e.hasMoreElements())
+                result.add(e.nextElement());
+        }
 
         // add in permission to read the cached JAR files
         for (int i=0; i < resourcePermissions.size(); i++)